// Signature format: 2.0
package android {

  public final class Manifest {
    ctor public Manifest();
  }

  public static final class Manifest.permission {
    ctor public Manifest.permission();
    field public static final String ACCEPT_HANDOVER = "android.permission.ACCEPT_HANDOVER";
    field public static final String ACCESS_CHECKIN_PROPERTIES = "android.permission.ACCESS_CHECKIN_PROPERTIES";
    field public static final String ACCESS_COARSE_LOCATION = "android.permission.ACCESS_COARSE_LOCATION";
    field public static final String ACCESS_FINE_LOCATION = "android.permission.ACCESS_FINE_LOCATION";
    field public static final String ACCESS_LOCATION_EXTRA_COMMANDS = "android.permission.ACCESS_LOCATION_EXTRA_COMMANDS";
    field public static final String ACCESS_NETWORK_STATE = "android.permission.ACCESS_NETWORK_STATE";
    field public static final String ACCESS_NOTIFICATION_POLICY = "android.permission.ACCESS_NOTIFICATION_POLICY";
    field public static final String ACCESS_WIFI_STATE = "android.permission.ACCESS_WIFI_STATE";
    field public static final String ACCOUNT_MANAGER = "android.permission.ACCOUNT_MANAGER";
    field public static final String ADD_VOICEMAIL = "com.android.voicemail.permission.ADD_VOICEMAIL";
    field public static final String ANSWER_PHONE_CALLS = "android.permission.ANSWER_PHONE_CALLS";
    field public static final String BATTERY_STATS = "android.permission.BATTERY_STATS";
    field public static final String BIND_ACCESSIBILITY_SERVICE = "android.permission.BIND_ACCESSIBILITY_SERVICE";
    field public static final String BIND_APPWIDGET = "android.permission.BIND_APPWIDGET";
    field public static final String BIND_AUTOFILL_SERVICE = "android.permission.BIND_AUTOFILL_SERVICE";
    field public static final String BIND_CALL_REDIRECTION_SERVICE = "android.permission.BIND_CALL_REDIRECTION_SERVICE";
    field @Deprecated public static final String BIND_CARRIER_MESSAGING_SERVICE = "android.permission.BIND_CARRIER_MESSAGING_SERVICE";
    field public static final String BIND_CARRIER_SERVICES = "android.permission.BIND_CARRIER_SERVICES";
    field public static final String BIND_CHOOSER_TARGET_SERVICE = "android.permission.BIND_CHOOSER_TARGET_SERVICE";
    field public static final String BIND_CONDITION_PROVIDER_SERVICE = "android.permission.BIND_CONDITION_PROVIDER_SERVICE";
    field public static final String BIND_DEVICE_ADMIN = "android.permission.BIND_DEVICE_ADMIN";
    field public static final String BIND_DREAM_SERVICE = "android.permission.BIND_DREAM_SERVICE";
    field public static final String BIND_INCALL_SERVICE = "android.permission.BIND_INCALL_SERVICE";
    field public static final String BIND_INPUT_METHOD = "android.permission.BIND_INPUT_METHOD";
    field public static final String BIND_MIDI_DEVICE_SERVICE = "android.permission.BIND_MIDI_DEVICE_SERVICE";
    field public static final String BIND_NFC_SERVICE = "android.permission.BIND_NFC_SERVICE";
    field public static final String BIND_NOTIFICATION_LISTENER_SERVICE = "android.permission.BIND_NOTIFICATION_LISTENER_SERVICE";
    field public static final String BIND_PRINT_SERVICE = "android.permission.BIND_PRINT_SERVICE";
    field public static final String BIND_QUICK_SETTINGS_TILE = "android.permission.BIND_QUICK_SETTINGS_TILE";
    field public static final String BIND_REMOTEVIEWS = "android.permission.BIND_REMOTEVIEWS";
    field public static final String BIND_SCREENING_SERVICE = "android.permission.BIND_SCREENING_SERVICE";
    field public static final String BIND_TELECOM_CONNECTION_SERVICE = "android.permission.BIND_TELECOM_CONNECTION_SERVICE";
    field public static final String BIND_TEXT_SERVICE = "android.permission.BIND_TEXT_SERVICE";
    field public static final String BIND_TV_INPUT = "android.permission.BIND_TV_INPUT";
    field public static final String BIND_VISUAL_VOICEMAIL_SERVICE = "android.permission.BIND_VISUAL_VOICEMAIL_SERVICE";
    field public static final String BIND_VOICE_INTERACTION = "android.permission.BIND_VOICE_INTERACTION";
    field public static final String BIND_VPN_SERVICE = "android.permission.BIND_VPN_SERVICE";
    field public static final String BIND_VR_LISTENER_SERVICE = "android.permission.BIND_VR_LISTENER_SERVICE";
    field public static final String BIND_WALLPAPER = "android.permission.BIND_WALLPAPER";
    field public static final String BLUETOOTH = "android.permission.BLUETOOTH";
    field public static final String BLUETOOTH_ADMIN = "android.permission.BLUETOOTH_ADMIN";
    field public static final String BLUETOOTH_PRIVILEGED = "android.permission.BLUETOOTH_PRIVILEGED";
    field public static final String BODY_SENSORS = "android.permission.BODY_SENSORS";
    field public static final String BROADCAST_PACKAGE_REMOVED = "android.permission.BROADCAST_PACKAGE_REMOVED";
    field public static final String BROADCAST_SMS = "android.permission.BROADCAST_SMS";
    field public static final String BROADCAST_STICKY = "android.permission.BROADCAST_STICKY";
    field public static final String BROADCAST_WAP_PUSH = "android.permission.BROADCAST_WAP_PUSH";
    field public static final String CALL_PHONE = "android.permission.CALL_PHONE";
    field public static final String CALL_PRIVILEGED = "android.permission.CALL_PRIVILEGED";
    field public static final String CAMERA = "android.permission.CAMERA";
    field public static final String CAPTURE_AUDIO_OUTPUT = "android.permission.CAPTURE_AUDIO_OUTPUT";
    field public static final String CAPTURE_SECURE_VIDEO_OUTPUT = "android.permission.CAPTURE_SECURE_VIDEO_OUTPUT";
    field public static final String CAPTURE_VIDEO_OUTPUT = "android.permission.CAPTURE_VIDEO_OUTPUT";
    field public static final String CHANGE_COMPONENT_ENABLED_STATE = "android.permission.CHANGE_COMPONENT_ENABLED_STATE";
    field public static final String CHANGE_CONFIGURATION = "android.permission.CHANGE_CONFIGURATION";
    field public static final String CHANGE_NETWORK_STATE = "android.permission.CHANGE_NETWORK_STATE";
    field public static final String CHANGE_WIFI_MULTICAST_STATE = "android.permission.CHANGE_WIFI_MULTICAST_STATE";
    field public static final String CHANGE_WIFI_STATE = "android.permission.CHANGE_WIFI_STATE";
    field public static final String CLEAR_APP_CACHE = "android.permission.CLEAR_APP_CACHE";
    field public static final String CONTROL_LOCATION_UPDATES = "android.permission.CONTROL_LOCATION_UPDATES";
    field public static final String DELETE_CACHE_FILES = "android.permission.DELETE_CACHE_FILES";
    field public static final String DELETE_PACKAGES = "android.permission.DELETE_PACKAGES";
    field public static final String DIAGNOSTIC = "android.permission.DIAGNOSTIC";
    field public static final String DISABLE_KEYGUARD = "android.permission.DISABLE_KEYGUARD";
    field public static final String DUMP = "android.permission.DUMP";
    field public static final String EXPAND_STATUS_BAR = "android.permission.EXPAND_STATUS_BAR";
    field public static final String FACTORY_TEST = "android.permission.FACTORY_TEST";
    field public static final String FOREGROUND_SERVICE = "android.permission.FOREGROUND_SERVICE";
    field public static final String GET_ACCOUNTS = "android.permission.GET_ACCOUNTS";
    field public static final String GET_ACCOUNTS_PRIVILEGED = "android.permission.GET_ACCOUNTS_PRIVILEGED";
    field public static final String GET_PACKAGE_SIZE = "android.permission.GET_PACKAGE_SIZE";
    field @Deprecated public static final String GET_TASKS = "android.permission.GET_TASKS";
    field public static final String GLOBAL_SEARCH = "android.permission.GLOBAL_SEARCH";
    field public static final String INSTALL_LOCATION_PROVIDER = "android.permission.INSTALL_LOCATION_PROVIDER";
    field public static final String INSTALL_PACKAGES = "android.permission.INSTALL_PACKAGES";
    field public static final String INSTALL_SHORTCUT = "com.android.launcher.permission.INSTALL_SHORTCUT";
    field public static final String INSTANT_APP_FOREGROUND_SERVICE = "android.permission.INSTANT_APP_FOREGROUND_SERVICE";
    field public static final String INTERNET = "android.permission.INTERNET";
    field public static final String KILL_BACKGROUND_PROCESSES = "android.permission.KILL_BACKGROUND_PROCESSES";
    field public static final String LOCATION_HARDWARE = "android.permission.LOCATION_HARDWARE";
    field public static final String MANAGE_DOCUMENTS = "android.permission.MANAGE_DOCUMENTS";
    field public static final String MANAGE_OWN_CALLS = "android.permission.MANAGE_OWN_CALLS";
    field public static final String MASTER_CLEAR = "android.permission.MASTER_CLEAR";
    field public static final String MEDIA_CONTENT_CONTROL = "android.permission.MEDIA_CONTENT_CONTROL";
    field public static final String MODIFY_AUDIO_SETTINGS = "android.permission.MODIFY_AUDIO_SETTINGS";
    field public static final String MODIFY_PHONE_STATE = "android.permission.MODIFY_PHONE_STATE";
    field public static final String MOUNT_FORMAT_FILESYSTEMS = "android.permission.MOUNT_FORMAT_FILESYSTEMS";
    field public static final String MOUNT_UNMOUNT_FILESYSTEMS = "android.permission.MOUNT_UNMOUNT_FILESYSTEMS";
    field public static final String NFC = "android.permission.NFC";
    field public static final String NFC_TRANSACTION_EVENT = "android.permission.NFC_TRANSACTION_EVENT";
    field public static final String PACKAGE_USAGE_STATS = "android.permission.PACKAGE_USAGE_STATS";
    field @Deprecated public static final String PERSISTENT_ACTIVITY = "android.permission.PERSISTENT_ACTIVITY";
    field public static final String PROCESS_OUTGOING_CALLS = "android.permission.PROCESS_OUTGOING_CALLS";
    field public static final String READ_CALENDAR = "android.permission.READ_CALENDAR";
    field public static final String READ_CALL_LOG = "android.permission.READ_CALL_LOG";
    field public static final String READ_CONTACTS = "android.permission.READ_CONTACTS";
    field public static final String READ_EXTERNAL_STORAGE = "android.permission.READ_EXTERNAL_STORAGE";
    field public static final String READ_FRAME_BUFFER = "android.permission.READ_FRAME_BUFFER";
    field @Deprecated public static final String READ_INPUT_STATE = "android.permission.READ_INPUT_STATE";
    field public static final String READ_LOGS = "android.permission.READ_LOGS";
    field public static final String READ_PHONE_NUMBERS = "android.permission.READ_PHONE_NUMBERS";
    field public static final String READ_PHONE_STATE = "android.permission.READ_PHONE_STATE";
    field public static final String READ_SMS = "android.permission.READ_SMS";
    field public static final String READ_SYNC_SETTINGS = "android.permission.READ_SYNC_SETTINGS";
    field public static final String READ_SYNC_STATS = "android.permission.READ_SYNC_STATS";
    field public static final String READ_VOICEMAIL = "com.android.voicemail.permission.READ_VOICEMAIL";
    field public static final String REBOOT = "android.permission.REBOOT";
    field public static final String RECEIVE_BOOT_COMPLETED = "android.permission.RECEIVE_BOOT_COMPLETED";
    field public static final String RECEIVE_MMS = "android.permission.RECEIVE_MMS";
    field public static final String RECEIVE_SMS = "android.permission.RECEIVE_SMS";
    field public static final String RECEIVE_WAP_PUSH = "android.permission.RECEIVE_WAP_PUSH";
    field public static final String RECORD_AUDIO = "android.permission.RECORD_AUDIO";
    field public static final String REORDER_TASKS = "android.permission.REORDER_TASKS";
    field public static final String REQUEST_COMPANION_RUN_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND";
    field public static final String REQUEST_COMPANION_USE_DATA_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND";
    field public static final String REQUEST_DELETE_PACKAGES = "android.permission.REQUEST_DELETE_PACKAGES";
    field public static final String REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
    field public static final String REQUEST_INSTALL_PACKAGES = "android.permission.REQUEST_INSTALL_PACKAGES";
    field @Deprecated public static final String RESTART_PACKAGES = "android.permission.RESTART_PACKAGES";
    field public static final String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE";
    field public static final String SEND_SMS = "android.permission.SEND_SMS";
    field public static final String SET_ALARM = "com.android.alarm.permission.SET_ALARM";
    field public static final String SET_ALWAYS_FINISH = "android.permission.SET_ALWAYS_FINISH";
    field public static final String SET_ANIMATION_SCALE = "android.permission.SET_ANIMATION_SCALE";
    field public static final String SET_DEBUG_APP = "android.permission.SET_DEBUG_APP";
    field @Deprecated public static final String SET_PREFERRED_APPLICATIONS = "android.permission.SET_PREFERRED_APPLICATIONS";
    field public static final String SET_PROCESS_LIMIT = "android.permission.SET_PROCESS_LIMIT";
    field public static final String SET_TIME = "android.permission.SET_TIME";
    field public static final String SET_TIME_ZONE = "android.permission.SET_TIME_ZONE";
    field public static final String SET_WALLPAPER = "android.permission.SET_WALLPAPER";
    field public static final String SET_WALLPAPER_HINTS = "android.permission.SET_WALLPAPER_HINTS";
    field public static final String SIGNAL_PERSISTENT_PROCESSES = "android.permission.SIGNAL_PERSISTENT_PROCESSES";
    field public static final String STATUS_BAR = "android.permission.STATUS_BAR";
    field public static final String SYSTEM_ALERT_WINDOW = "android.permission.SYSTEM_ALERT_WINDOW";
    field public static final String TRANSMIT_IR = "android.permission.TRANSMIT_IR";
    field public static final String UNINSTALL_SHORTCUT = "com.android.launcher.permission.UNINSTALL_SHORTCUT";
    field public static final String UPDATE_DEVICE_STATS = "android.permission.UPDATE_DEVICE_STATS";
    field public static final String USE_BIOMETRIC = "android.permission.USE_BIOMETRIC";
    field @Deprecated public static final String USE_FINGERPRINT = "android.permission.USE_FINGERPRINT";
    field public static final String USE_SIP = "android.permission.USE_SIP";
    field public static final String VIBRATE = "android.permission.VIBRATE";
    field public static final String WAKE_LOCK = "android.permission.WAKE_LOCK";
    field public static final String WRITE_APN_SETTINGS = "android.permission.WRITE_APN_SETTINGS";
    field public static final String WRITE_CALENDAR = "android.permission.WRITE_CALENDAR";
    field public static final String WRITE_CALL_LOG = "android.permission.WRITE_CALL_LOG";
    field public static final String WRITE_CONTACTS = "android.permission.WRITE_CONTACTS";
    field public static final String WRITE_EXTERNAL_STORAGE = "android.permission.WRITE_EXTERNAL_STORAGE";
    field public static final String WRITE_GSERVICES = "android.permission.WRITE_GSERVICES";
    field public static final String WRITE_SECURE_SETTINGS = "android.permission.WRITE_SECURE_SETTINGS";
    field public static final String WRITE_SETTINGS = "android.permission.WRITE_SETTINGS";
    field public static final String WRITE_SYNC_SETTINGS = "android.permission.WRITE_SYNC_SETTINGS";
    field public static final String WRITE_VOICEMAIL = "com.android.voicemail.permission.WRITE_VOICEMAIL";
  }

  public static final class Manifest.permission_group {
    ctor public Manifest.permission_group();
    field public static final String CALENDAR = "android.permission-group.CALENDAR";
    field public static final String CALL_LOG = "android.permission-group.CALL_LOG";
    field public static final String CAMERA = "android.permission-group.CAMERA";
    field public static final String CONTACTS = "android.permission-group.CONTACTS";
    field public static final String LOCATION = "android.permission-group.LOCATION";
    field public static final String MICROPHONE = "android.permission-group.MICROPHONE";
    field public static final String PHONE = "android.permission-group.PHONE";
    field public static final String SENSORS = "android.permission-group.SENSORS";
    field public static final String SMS = "android.permission-group.SMS";
    field public static final String STORAGE = "android.permission-group.STORAGE";
  }

  public final class R {
    ctor public R();
  }

  public static final class R.anim {
    ctor public R.anim();
    field public static final int accelerate_decelerate_interpolator = 17432580; // 0x10a0004
    field public static final int accelerate_interpolator = 17432581; // 0x10a0005
    field public static final int anticipate_interpolator = 17432583; // 0x10a0007
    field public static final int anticipate_overshoot_interpolator = 17432585; // 0x10a0009
    field public static final int bounce_interpolator = 17432586; // 0x10a000a
    field public static final int cycle_interpolator = 17432588; // 0x10a000c
    field public static final int decelerate_interpolator = 17432582; // 0x10a0006
    field public static final int fade_in = 17432576; // 0x10a0000
    field public static final int fade_out = 17432577; // 0x10a0001
    field public static final int linear_interpolator = 17432587; // 0x10a000b
    field public static final int overshoot_interpolator = 17432584; // 0x10a0008
    field public static final int slide_in_left = 17432578; // 0x10a0002
    field public static final int slide_out_right = 17432579; // 0x10a0003
  }

  public static final class R.animator {
    ctor public R.animator();
    field public static final int fade_in = 17498112; // 0x10b0000
    field public static final int fade_out = 17498113; // 0x10b0001
  }

  public static final class R.array {
    ctor public R.array();
    field public static final int emailAddressTypes = 17235968; // 0x1070000
    field public static final int imProtocols = 17235969; // 0x1070001
    field public static final int organizationTypes = 17235970; // 0x1070002
    field public static final int phoneTypes = 17235971; // 0x1070003
    field public static final int postalAddressTypes = 17235972; // 0x1070004
  }

  public static final class R.attr {
    ctor public R.attr();
    field public static final int absListViewStyle = 16842858; // 0x101006a
    field public static final int accessibilityEventTypes = 16843648; // 0x1010380
    field public static final int accessibilityFeedbackType = 16843650; // 0x1010382
    field public static final int accessibilityFlags = 16843652; // 0x1010384
    field public static final int accessibilityHeading = 16844160; // 0x1010580
    field public static final int accessibilityLiveRegion = 16843758; // 0x10103ee
    field public static final int accessibilityPaneTitle = 16844156; // 0x101057c
    field public static final int accessibilityTraversalAfter = 16843986; // 0x10104d2
    field public static final int accessibilityTraversalBefore = 16843985; // 0x10104d1
    field public static final int accountPreferences = 16843423; // 0x101029f
    field public static final int accountType = 16843407; // 0x101028f
    field public static final int action = 16842797; // 0x101002d
    field public static final int actionBarDivider = 16843675; // 0x101039b
    field public static final int actionBarItemBackground = 16843676; // 0x101039c
    field public static final int actionBarPopupTheme = 16843917; // 0x101048d
    field public static final int actionBarSize = 16843499; // 0x10102eb
    field public static final int actionBarSplitStyle = 16843656; // 0x1010388
    field public static final int actionBarStyle = 16843470; // 0x10102ce
    field public static final int actionBarTabBarStyle = 16843508; // 0x10102f4
    field public static final int actionBarTabStyle = 16843507; // 0x10102f3
    field public static final int actionBarTabTextStyle = 16843509; // 0x10102f5
    field public static final int actionBarTheme = 16843825; // 0x1010431
    field public static final int actionBarWidgetTheme = 16843671; // 0x1010397
    field public static final int actionButtonStyle = 16843480; // 0x10102d8
    field public static final int actionDropDownStyle = 16843479; // 0x10102d7
    field public static final int actionLayout = 16843515; // 0x10102fb
    field public static final int actionMenuTextAppearance = 16843616; // 0x1010360
    field public static final int actionMenuTextColor = 16843617; // 0x1010361
    field public static final int actionModeBackground = 16843483; // 0x10102db
    field public static final int actionModeCloseButtonStyle = 16843511; // 0x10102f7
    field public static final int actionModeCloseDrawable = 16843484; // 0x10102dc
    field public static final int actionModeCopyDrawable = 16843538; // 0x1010312
    field public static final int actionModeCutDrawable = 16843537; // 0x1010311
    field public static final int actionModeFindDrawable = 16843898; // 0x101047a
    field public static final int actionModePasteDrawable = 16843539; // 0x1010313
    field public static final int actionModeSelectAllDrawable = 16843646; // 0x101037e
    field public static final int actionModeShareDrawable = 16843897; // 0x1010479
    field public static final int actionModeSplitBackground = 16843677; // 0x101039d
    field public static final int actionModeStyle = 16843668; // 0x1010394
    field public static final int actionModeWebSearchDrawable = 16843899; // 0x101047b
    field public static final int actionOverflowButtonStyle = 16843510; // 0x10102f6
    field public static final int actionOverflowMenuStyle = 16843844; // 0x1010444
    field public static final int actionProviderClass = 16843657; // 0x1010389
    field public static final int actionViewClass = 16843516; // 0x10102fc
    field public static final int activatedBackgroundIndicator = 16843517; // 0x10102fd
    field public static final int activityCloseEnterAnimation = 16842938; // 0x10100ba
    field public static final int activityCloseExitAnimation = 16842939; // 0x10100bb
    field public static final int activityOpenEnterAnimation = 16842936; // 0x10100b8
    field public static final int activityOpenExitAnimation = 16842937; // 0x10100b9
    field public static final int addPrintersActivity = 16843750; // 0x10103e6
    field public static final int addStatesFromChildren = 16842992; // 0x10100f0
    field public static final int adjustViewBounds = 16843038; // 0x101011e
    field public static final int advancedPrintOptionsActivity = 16843761; // 0x10103f1
    field public static final int alertDialogIcon = 16843605; // 0x1010355
    field public static final int alertDialogStyle = 16842845; // 0x101005d
    field public static final int alertDialogTheme = 16843529; // 0x1010309
    field public static final int alignmentMode = 16843642; // 0x101037a
    field public static final int allContactsName = 16843468; // 0x10102cc
    field public static final int allowBackup = 16843392; // 0x1010280
    field public static final int allowClearUserData = 16842757; // 0x1010005
    field public static final int allowEmbedded = 16843765; // 0x10103f5
    field public static final int allowParallelSyncs = 16843570; // 0x1010332
    field public static final int allowSingleTap = 16843353; // 0x1010259
    field public static final int allowTaskReparenting = 16843268; // 0x1010204
    field public static final int allowUndo = 16843999; // 0x10104df
    field public static final int alpha = 16843551; // 0x101031f
    field public static final int alphabeticModifiers = 16844110; // 0x101054e
    field public static final int alphabeticShortcut = 16843235; // 0x10101e3
    field public static final int alwaysDrawnWithCache = 16842991; // 0x10100ef
    field public static final int alwaysRetainTaskState = 16843267; // 0x1010203
    field @Deprecated public static final int amPmBackgroundColor = 16843941; // 0x10104a5
    field @Deprecated public static final int amPmTextColor = 16843940; // 0x10104a4
    field public static final int ambientShadowAlpha = 16843966; // 0x10104be
    field public static final int angle = 16843168; // 0x10101a0
    field public static final int animateFirstView = 16843477; // 0x10102d5
    field public static final int animateLayoutChanges = 16843506; // 0x10102f2
    field public static final int animateOnClick = 16843356; // 0x101025c
    field public static final int animation = 16843213; // 0x10101cd
    field public static final int animationCache = 16842989; // 0x10100ed
    field public static final int animationDuration = 16843026; // 0x1010112
    field public static final int animationOrder = 16843214; // 0x10101ce
    field @Deprecated public static final int animationResolution = 16843546; // 0x101031a
    field public static final int antialias = 16843034; // 0x101011a
    field public static final int anyDensity = 16843372; // 0x101026c
    field public static final int apduServiceBanner = 16843757; // 0x10103ed
    field public static final int apiKey = 16843281; // 0x1010211
    field public static final int appCategory = 16844101; // 0x1010545
    field public static final int appComponentFactory = 16844154; // 0x101057a
    field public static final int author = 16843444; // 0x10102b4
    field public static final int authorities = 16842776; // 0x1010018
    field public static final int autoAdvanceViewId = 16843535; // 0x101030f
    field public static final int autoCompleteTextViewStyle = 16842859; // 0x101006b
    field public static final int autoLink = 16842928; // 0x10100b0
    field public static final int autoMirrored = 16843754; // 0x10103ea
    field public static final int autoRemoveFromRecents = 16843847; // 0x1010447
    field public static final int autoSizeMaxTextSize = 16844102; // 0x1010546
    field public static final int autoSizeMinTextSize = 16844088; // 0x1010538
    field public static final int autoSizePresetSizes = 16844087; // 0x1010537
    field public static final int autoSizeStepGranularity = 16844086; // 0x1010536
    field public static final int autoSizeTextType = 16844085; // 0x1010535
    field public static final int autoStart = 16843445; // 0x10102b5
    field @Deprecated public static final int autoText = 16843114; // 0x101016a
    field public static final int autoUrlDetect = 16843404; // 0x101028c
    field public static final int autoVerify = 16844014; // 0x10104ee
    field public static final int autofillHints = 16844118; // 0x1010556
    field public static final int autofilledHighlight = 16844136; // 0x1010568
    field public static final int background = 16842964; // 0x10100d4
    field public static final int backgroundDimAmount = 16842802; // 0x1010032
    field public static final int backgroundDimEnabled = 16843295; // 0x101021f
    field public static final int backgroundSplit = 16843659; // 0x101038b
    field public static final int backgroundStacked = 16843658; // 0x101038a
    field public static final int backgroundTint = 16843883; // 0x101046b
    field public static final int backgroundTintMode = 16843884; // 0x101046c
    field public static final int backupAgent = 16843391; // 0x101027f
    field public static final int backupInForeground = 16844058; // 0x101051a
    field public static final int banner = 16843762; // 0x10103f2
    field public static final int baseline = 16843548; // 0x101031c
    field public static final int baselineAlignBottom = 16843042; // 0x1010122
    field public static final int baselineAligned = 16843046; // 0x1010126
    field public static final int baselineAlignedChildIndex = 16843047; // 0x1010127
    field public static final int bitmap = 16844054; // 0x1010516
    field public static final int borderlessButtonStyle = 16843563; // 0x101032b
    field public static final int bottom = 16843184; // 0x10101b0
    field public static final int bottomBright = 16842957; // 0x10100cd
    field public static final int bottomDark = 16842953; // 0x10100c9
    field public static final int bottomLeftRadius = 16843179; // 0x10101ab
    field public static final int bottomMedium = 16842958; // 0x10100ce
    field public static final int bottomOffset = 16843351; // 0x1010257
    field public static final int bottomRightRadius = 16843180; // 0x10101ac
    field public static final int breadCrumbShortTitle = 16843524; // 0x1010304
    field public static final int breadCrumbTitle = 16843523; // 0x1010303
    field public static final int breakStrategy = 16843997; // 0x10104dd
    field public static final int bufferType = 16843086; // 0x101014e
    field public static final int button = 16843015; // 0x1010107
    field public static final int buttonBarButtonStyle = 16843567; // 0x101032f
    field public static final int buttonBarNegativeButtonStyle = 16843915; // 0x101048b
    field public static final int buttonBarNeutralButtonStyle = 16843914; // 0x101048a
    field public static final int buttonBarPositiveButtonStyle = 16843913; // 0x1010489
    field public static final int buttonBarStyle = 16843566; // 0x101032e
    field public static final int buttonCornerRadius = 16844149; // 0x1010575
    field public static final int buttonGravity = 16844030; // 0x10104fe
    field public static final int buttonStyle = 16842824; // 0x1010048
    field public static final int buttonStyleInset = 16842826; // 0x101004a
    field public static final int buttonStyleSmall = 16842825; // 0x1010049
    field public static final int buttonStyleToggle = 16842827; // 0x101004b
    field public static final int buttonTint = 16843887; // 0x101046f
    field public static final int buttonTintMode = 16843888; // 0x1010470
    field public static final int cacheColorHint = 16843009; // 0x1010101
    field public static final int calendarTextColor = 16843931; // 0x101049b
    field public static final int calendarViewShown = 16843596; // 0x101034c
    field public static final int calendarViewStyle = 16843613; // 0x101035d
    field public static final int canControlMagnification = 16844039; // 0x1010507
    field public static final int canPerformGestures = 16844045; // 0x101050d
    field public static final int canRecord = 16844060; // 0x101051c
    field @Deprecated public static final int canRequestEnhancedWebAccessibility = 16843736; // 0x10103d8
    field public static final int canRequestFilterKeyEvents = 16843737; // 0x10103d9
    field public static final int canRequestFingerprintGestures = 16844109; // 0x101054d
    field public static final int canRequestTouchExplorationMode = 16843735; // 0x10103d7
    field public static final int canRetrieveWindowContent = 16843653; // 0x1010385
    field public static final int candidatesTextStyleSpans = 16843312; // 0x1010230
    field public static final int cantSaveState = 16844142; // 0x101056e
    field @Deprecated public static final int capitalize = 16843113; // 0x1010169
    field public static final int category = 16843752; // 0x10103e8
    field public static final int centerBright = 16842956; // 0x10100cc
    field public static final int centerColor = 16843275; // 0x101020b
    field public static final int centerDark = 16842952; // 0x10100c8
    field public static final int centerMedium = 16842959; // 0x10100cf
    field public static final int centerX = 16843170; // 0x10101a2
    field public static final int centerY = 16843171; // 0x10101a3
    field public static final int certDigest = 16844104; // 0x1010548
    field public static final int checkBoxPreferenceStyle = 16842895; // 0x101008f
    field public static final int checkMark = 16843016; // 0x1010108
    field public static final int checkMarkTint = 16843943; // 0x10104a7
    field public static final int checkMarkTintMode = 16843944; // 0x10104a8
    field public static final int checkable = 16843237; // 0x10101e5
    field public static final int checkableBehavior = 16843232; // 0x10101e0
    field public static final int checkboxStyle = 16842860; // 0x101006c
    field public static final int checked = 16843014; // 0x1010106
    field public static final int checkedButton = 16843080; // 0x1010148
    field public static final int checkedTextViewStyle = 16843720; // 0x10103c8
    field public static final int childDivider = 16843025; // 0x1010111
    field public static final int childIndicator = 16843020; // 0x101010c
    field public static final int childIndicatorEnd = 16843732; // 0x10103d4
    field public static final int childIndicatorLeft = 16843023; // 0x101010f
    field public static final int childIndicatorRight = 16843024; // 0x1010110
    field public static final int childIndicatorStart = 16843731; // 0x10103d3
    field public static final int choiceMode = 16843051; // 0x101012b
    field public static final int classLoader = 16844139; // 0x101056b
    field public static final int clearTaskOnLaunch = 16842773; // 0x1010015
    field public static final int clickable = 16842981; // 0x10100e5
    field public static final int clipChildren = 16842986; // 0x10100ea
    field public static final int clipOrientation = 16843274; // 0x101020a
    field public static final int clipToPadding = 16842987; // 0x10100eb
    field public static final int closeIcon = 16843905; // 0x1010481
    field public static final int codes = 16843330; // 0x1010242
    field public static final int collapseColumns = 16843083; // 0x101014b
    field public static final int collapseContentDescription = 16843984; // 0x10104d0
    field public static final int collapseIcon = 16844031; // 0x10104ff
    field public static final int color = 16843173; // 0x10101a5
    field public static final int colorAccent = 16843829; // 0x1010435
    field public static final int colorActivatedHighlight = 16843664; // 0x1010390
    field public static final int colorBackground = 16842801; // 0x1010031
    field public static final int colorBackgroundCacheHint = 16843435; // 0x10102ab
    field public static final int colorBackgroundFloating = 16844002; // 0x10104e2
    field public static final int colorButtonNormal = 16843819; // 0x101042b
    field public static final int colorControlActivated = 16843818; // 0x101042a
    field public static final int colorControlHighlight = 16843820; // 0x101042c
    field public static final int colorControlNormal = 16843817; // 0x1010429
    field public static final int colorEdgeEffect = 16843982; // 0x10104ce
    field public static final int colorError = 16844099; // 0x1010543
    field public static final int colorFocusedHighlight = 16843663; // 0x101038f
    field public static final int colorForeground = 16842800; // 0x1010030
    field public static final int colorForegroundInverse = 16843270; // 0x1010206
    field public static final int colorLongPressedHighlight = 16843662; // 0x101038e
    field public static final int colorMode = 16844106; // 0x101054a
    field public static final int colorMultiSelectHighlight = 16843665; // 0x1010391
    field public static final int colorPressedHighlight = 16843661; // 0x101038d
    field public static final int colorPrimary = 16843827; // 0x1010433
    field public static final int colorPrimaryDark = 16843828; // 0x1010434
    field public static final int colorSecondary = 16844080; // 0x1010530
    field public static final int columnCount = 16843639; // 0x1010377
    field public static final int columnDelay = 16843215; // 0x10101cf
    field public static final int columnOrderPreserved = 16843640; // 0x1010378
    field public static final int columnWidth = 16843031; // 0x1010117
    field public static final int commitIcon = 16843909; // 0x1010485
    field public static final int compatibleWidthLimitDp = 16843621; // 0x1010365
    field public static final int completionHint = 16843122; // 0x1010172
    field public static final int completionHintView = 16843123; // 0x1010173
    field public static final int completionThreshold = 16843124; // 0x1010174
    field public static final int configChanges = 16842783; // 0x101001f
    field public static final int configure = 16843357; // 0x101025d
    field public static final int constantSize = 16843158; // 0x1010196
    field public static final int content = 16843355; // 0x101025b
    field public static final int contentAgeHint = 16843961; // 0x10104b9
    field public static final int contentAuthority = 16843408; // 0x1010290
    field public static final int contentDescription = 16843379; // 0x1010273
    field public static final int contentInsetEnd = 16843860; // 0x1010454
    field public static final int contentInsetEndWithActions = 16844067; // 0x1010523
    field public static final int contentInsetLeft = 16843861; // 0x1010455
    field public static final int contentInsetRight = 16843862; // 0x1010456
    field public static final int contentInsetStart = 16843859; // 0x1010453
    field public static final int contentInsetStartWithNavigation = 16844066; // 0x1010522
    field public static final int contextClickable = 16844007; // 0x10104e7
    field public static final int contextDescription = 16844078; // 0x101052e
    field public static final int contextPopupMenuStyle = 16844033; // 0x1010501
    field public static final int contextUri = 16844077; // 0x101052d
    field public static final int controlX1 = 16843772; // 0x10103fc
    field public static final int controlX2 = 16843774; // 0x10103fe
    field public static final int controlY1 = 16843773; // 0x10103fd
    field public static final int controlY2 = 16843775; // 0x10103ff
    field public static final int countDown = 16844059; // 0x101051b
    field public static final int country = 16843962; // 0x10104ba
    field public static final int cropToPadding = 16843043; // 0x1010123
    field public static final int cursorVisible = 16843090; // 0x1010152
    field public static final int customNavigationLayout = 16843474; // 0x10102d2
    field public static final int customTokens = 16843579; // 0x101033b
    field public static final int cycles = 16843220; // 0x10101d4
    field public static final int dashGap = 16843175; // 0x10101a7
    field public static final int dashWidth = 16843174; // 0x10101a6
    field public static final int data = 16842798; // 0x101002e
    field public static final int datePickerDialogTheme = 16843948; // 0x10104ac
    field public static final int datePickerMode = 16843955; // 0x10104b3
    field public static final int datePickerStyle = 16843612; // 0x101035c
    field public static final int dateTextAppearance = 16843593; // 0x1010349
    field @Deprecated public static final int dayOfWeekBackground = 16843924; // 0x1010494
    field @Deprecated public static final int dayOfWeekTextAppearance = 16843925; // 0x1010495
    field public static final int debuggable = 16842767; // 0x101000f
    field public static final int defaultFocusHighlightEnabled = 16844130; // 0x1010562
    field public static final int defaultHeight = 16844021; // 0x10104f5
    field public static final int defaultToDeviceProtectedStorage = 16844036; // 0x1010504
    field public static final int defaultValue = 16843245; // 0x10101ed
    field public static final int defaultWidth = 16844020; // 0x10104f4
    field public static final int delay = 16843212; // 0x10101cc
    field public static final int dependency = 16843244; // 0x10101ec
    field public static final int descendantFocusability = 16842993; // 0x10100f1
    field public static final int description = 16842784; // 0x1010020
    field public static final int detachWallpaper = 16843430; // 0x10102a6
    field public static final int detailColumn = 16843427; // 0x10102a3
    field public static final int detailSocialSummary = 16843428; // 0x10102a4
    field public static final int detailsElementBackground = 16843598; // 0x101034e
    field public static final int dial = 16843010; // 0x1010102
    field public static final int dialogCornerRadius = 16844145; // 0x1010571
    field public static final int dialogIcon = 16843252; // 0x10101f4
    field public static final int dialogLayout = 16843255; // 0x10101f7
    field public static final int dialogMessage = 16843251; // 0x10101f3
    field public static final int dialogPreferenceStyle = 16842897; // 0x1010091
    field public static final int dialogPreferredPadding = 16843987; // 0x10104d3
    field public static final int dialogTheme = 16843528; // 0x1010308
    field public static final int dialogTitle = 16843250; // 0x10101f2
    field public static final int digits = 16843110; // 0x1010166
    field public static final int directBootAware = 16844037; // 0x1010505
    field public static final int direction = 16843217; // 0x10101d1
    field @Deprecated public static final int directionDescriptions = 16843681; // 0x10103a1
    field public static final int directionPriority = 16843218; // 0x10101d2
    field public static final int disableDependentsState = 16843249; // 0x10101f1
    field public static final int disabledAlpha = 16842803; // 0x1010033
    field public static final int displayOptions = 16843472; // 0x10102d0
    field public static final int dither = 16843036; // 0x101011c
    field public static final int divider = 16843049; // 0x1010129
    field public static final int dividerHeight = 16843050; // 0x101012a
    field public static final int dividerHorizontal = 16843564; // 0x101032c
    field public static final int dividerPadding = 16843562; // 0x101032a
    field public static final int dividerVertical = 16843530; // 0x101030a
    field public static final int documentLaunchMode = 16843845; // 0x1010445
    field public static final int drawSelectorOnTop = 16843004; // 0x10100fc
    field public static final int drawable = 16843161; // 0x1010199
    field public static final int drawableBottom = 16843118; // 0x101016e
    field public static final int drawableEnd = 16843667; // 0x1010393
    field public static final int drawableLeft = 16843119; // 0x101016f
    field public static final int drawablePadding = 16843121; // 0x1010171
    field public static final int drawableRight = 16843120; // 0x1010170
    field public static final int drawableStart = 16843666; // 0x1010392
    field public static final int drawableTint = 16843990; // 0x10104d6
    field public static final int drawableTintMode = 16843991; // 0x10104d7
    field public static final int drawableTop = 16843117; // 0x101016d
    field public static final int drawingCacheQuality = 16842984; // 0x10100e8
    field public static final int dropDownAnchor = 16843363; // 0x1010263
    field public static final int dropDownHeight = 16843395; // 0x1010283
    field public static final int dropDownHintAppearance = 16842888; // 0x1010088
    field public static final int dropDownHorizontalOffset = 16843436; // 0x10102ac
    field public static final int dropDownItemStyle = 16842886; // 0x1010086
    field public static final int dropDownListViewStyle = 16842861; // 0x101006d
    field public static final int dropDownSelector = 16843125; // 0x1010175
    field public static final int dropDownSpinnerStyle = 16843478; // 0x10102d6
    field public static final int dropDownVerticalOffset = 16843437; // 0x10102ad
    field public static final int dropDownWidth = 16843362; // 0x1010262
    field public static final int duplicateParentState = 16842985; // 0x10100e9
    field public static final int duration = 16843160; // 0x1010198
    field public static final int editTextBackground = 16843602; // 0x1010352
    field public static final int editTextColor = 16843601; // 0x1010351
    field public static final int editTextPreferenceStyle = 16842898; // 0x1010092
    field public static final int editTextStyle = 16842862; // 0x101006e
    field @Deprecated public static final int editable = 16843115; // 0x101016b
    field public static final int editorExtras = 16843300; // 0x1010224
    field public static final int elegantTextHeight = 16843869; // 0x101045d
    field public static final int elevation = 16843840; // 0x1010440
    field public static final int ellipsize = 16842923; // 0x10100ab
    field public static final int ems = 16843096; // 0x1010158
    field public static final int enableVrMode = 16844069; // 0x1010525
    field public static final int enabled = 16842766; // 0x101000e
    field public static final int end = 16843996; // 0x10104dc
    field public static final int endColor = 16843166; // 0x101019e
    field public static final int endX = 16844050; // 0x1010512
    field public static final int endY = 16844051; // 0x1010513
    field @Deprecated public static final int endYear = 16843133; // 0x101017d
    field public static final int enterFadeDuration = 16843532; // 0x101030c
    field public static final int entries = 16842930; // 0x10100b2
    field public static final int entryValues = 16843256; // 0x10101f8
    field public static final int eventsInterceptionEnabled = 16843389; // 0x101027d
    field public static final int excludeClass = 16843842; // 0x1010442
    field public static final int excludeFromRecents = 16842775; // 0x1010017
    field public static final int excludeId = 16843841; // 0x1010441
    field public static final int excludeName = 16843854; // 0x101044e
    field public static final int exitFadeDuration = 16843533; // 0x101030d
    field public static final int expandableListPreferredChildIndicatorLeft = 16842834; // 0x1010052
    field public static final int expandableListPreferredChildIndicatorRight = 16842835; // 0x1010053
    field public static final int expandableListPreferredChildPaddingLeft = 16842831; // 0x101004f
    field public static final int expandableListPreferredItemIndicatorLeft = 16842832; // 0x1010050
    field public static final int expandableListPreferredItemIndicatorRight = 16842833; // 0x1010051
    field public static final int expandableListPreferredItemPaddingLeft = 16842830; // 0x101004e
    field public static final int expandableListViewStyle = 16842863; // 0x101006f
    field public static final int expandableListViewWhiteStyle = 16843446; // 0x10102b6
    field public static final int exported = 16842768; // 0x1010010
    field public static final int externalService = 16844046; // 0x101050e
    field public static final int extraTension = 16843371; // 0x101026b
    field public static final int extractNativeLibs = 16844010; // 0x10104ea
    field public static final int factor = 16843219; // 0x10101d3
    field public static final int fadeDuration = 16843384; // 0x1010278
    field public static final int fadeEnabled = 16843390; // 0x101027e
    field public static final int fadeOffset = 16843383; // 0x1010277
    field public static final int fadeScrollbars = 16843434; // 0x10102aa
    field public static final int fadingEdge = 16842975; // 0x10100df
    field public static final int fadingEdgeLength = 16842976; // 0x10100e0
    field public static final int fadingMode = 16843745; // 0x10103e1
    field public static final int fallbackLineSpacing = 16844155; // 0x101057b
    field public static final int fastScrollAlwaysVisible = 16843573; // 0x1010335
    field public static final int fastScrollEnabled = 16843302; // 0x1010226
    field public static final int fastScrollOverlayPosition = 16843578; // 0x101033a
    field public static final int fastScrollPreviewBackgroundLeft = 16843575; // 0x1010337
    field public static final int fastScrollPreviewBackgroundRight = 16843576; // 0x1010338
    field public static final int fastScrollStyle = 16843767; // 0x10103f7
    field public static final int fastScrollTextColor = 16843609; // 0x1010359
    field public static final int fastScrollThumbDrawable = 16843574; // 0x1010336
    field public static final int fastScrollTrackDrawable = 16843577; // 0x1010339
    field public static final int fillAfter = 16843197; // 0x10101bd
    field public static final int fillAlpha = 16843980; // 0x10104cc
    field public static final int fillBefore = 16843196; // 0x10101bc
    field public static final int fillColor = 16843780; // 0x1010404
    field public static final int fillEnabled = 16843343; // 0x101024f
    field public static final int fillType = 16844062; // 0x101051e
    field public static final int fillViewport = 16843130; // 0x101017a
    field public static final int filter = 16843035; // 0x101011b
    field public static final int filterTouchesWhenObscured = 16843460; // 0x10102c4
    field public static final int fingerprintAuthDrawable = 16844008; // 0x10104e8
    field public static final int finishOnCloseSystemDialogs = 16843431; // 0x10102a7
    field public static final int finishOnTaskLaunch = 16842772; // 0x1010014
    field public static final int firstBaselineToTopHeight = 16844157; // 0x101057d
    field public static final int firstDayOfWeek = 16843581; // 0x101033d
    field public static final int fitsSystemWindows = 16842973; // 0x10100dd
    field public static final int flipInterval = 16843129; // 0x1010179
    field public static final int focusable = 16842970; // 0x10100da
    field public static final int focusableInTouchMode = 16842971; // 0x10100db
    field public static final int focusedByDefault = 16844100; // 0x1010544
    field @Deprecated public static final int focusedMonthDateColor = 16843587; // 0x1010343
    field public static final int font = 16844082; // 0x1010532
    field public static final int fontFamily = 16843692; // 0x10103ac
    field public static final int fontFeatureSettings = 16843959; // 0x10104b7
    field public static final int fontProviderAuthority = 16844112; // 0x1010550
    field public static final int fontProviderCerts = 16844125; // 0x101055d
    field public static final int fontProviderPackage = 16844119; // 0x1010557
    field public static final int fontProviderQuery = 16844113; // 0x1010551
    field public static final int fontStyle = 16844095; // 0x101053f
    field public static final int fontVariationSettings = 16844144; // 0x1010570
    field public static final int fontWeight = 16844083; // 0x1010533
    field public static final int footerDividersEnabled = 16843311; // 0x101022f
    field public static final int forceHasOverlappingRendering = 16844065; // 0x1010521
    field public static final int foreground = 16843017; // 0x1010109
    field public static final int foregroundGravity = 16843264; // 0x1010200
    field public static final int foregroundTint = 16843885; // 0x101046d
    field public static final int foregroundTintMode = 16843886; // 0x101046e
    field public static final int format = 16843013; // 0x1010105
    field public static final int format12Hour = 16843722; // 0x10103ca
    field public static final int format24Hour = 16843723; // 0x10103cb
    field public static final int fraction = 16843992; // 0x10104d8
    field public static final int fragment = 16843491; // 0x10102e3
    field public static final int fragmentAllowEnterTransitionOverlap = 16843976; // 0x10104c8
    field public static final int fragmentAllowReturnTransitionOverlap = 16843977; // 0x10104c9
    field public static final int fragmentCloseEnterAnimation = 16843495; // 0x10102e7
    field public static final int fragmentCloseExitAnimation = 16843496; // 0x10102e8
    field public static final int fragmentEnterTransition = 16843971; // 0x10104c3
    field public static final int fragmentExitTransition = 16843970; // 0x10104c2
    field public static final int fragmentFadeEnterAnimation = 16843497; // 0x10102e9
    field public static final int fragmentFadeExitAnimation = 16843498; // 0x10102ea
    field public static final int fragmentOpenEnterAnimation = 16843493; // 0x10102e5
    field public static final int fragmentOpenExitAnimation = 16843494; // 0x10102e6
    field public static final int fragmentReenterTransition = 16843975; // 0x10104c7
    field public static final int fragmentReturnTransition = 16843973; // 0x10104c5
    field public static final int fragmentSharedElementEnterTransition = 16843972; // 0x10104c4
    field public static final int fragmentSharedElementReturnTransition = 16843974; // 0x10104c6
    field public static final int freezesText = 16843116; // 0x101016c
    field public static final int fromAlpha = 16843210; // 0x10101ca
    field public static final int fromDegrees = 16843187; // 0x10101b3
    field public static final int fromId = 16843850; // 0x101044a
    field public static final int fromScene = 16843741; // 0x10103dd
    field public static final int fromXDelta = 16843206; // 0x10101c6
    field public static final int fromXScale = 16843202; // 0x10101c2
    field public static final int fromYDelta = 16843208; // 0x10101c8
    field public static final int fromYScale = 16843204; // 0x10101c4
    field public static final int fullBackupContent = 16844011; // 0x10104eb
    field public static final int fullBackupOnly = 16843891; // 0x1010473
    field public static final int fullBright = 16842954; // 0x10100ca
    field public static final int fullDark = 16842950; // 0x10100c6
    field public static final int functionalTest = 16842787; // 0x1010023
    field public static final int galleryItemBackground = 16842828; // 0x101004c
    field public static final int galleryStyle = 16842864; // 0x1010070
    field public static final int gestureColor = 16843381; // 0x1010275
    field public static final int gestureStrokeAngleThreshold = 16843388; // 0x101027c
    field public static final int gestureStrokeLengthThreshold = 16843386; // 0x101027a
    field public static final int gestureStrokeSquarenessThreshold = 16843387; // 0x101027b
    field public static final int gestureStrokeType = 16843385; // 0x1010279
    field public static final int gestureStrokeWidth = 16843380; // 0x1010274
    field public static final int glEsVersion = 16843393; // 0x1010281
    field public static final int goIcon = 16843906; // 0x1010482
    field public static final int gradientRadius = 16843172; // 0x10101a4
    field public static final int grantUriPermissions = 16842779; // 0x101001b
    field public static final int gravity = 16842927; // 0x10100af
    field public static final int gridViewStyle = 16842865; // 0x1010071
    field public static final int groupIndicator = 16843019; // 0x101010b
    field public static final int hand_hour = 16843011; // 0x1010103
    field public static final int hand_minute = 16843012; // 0x1010104
    field public static final int handle = 16843354; // 0x101025a
    field public static final int handleProfiling = 16842786; // 0x1010022
    field public static final int hapticFeedbackEnabled = 16843358; // 0x101025e
    field public static final int hardwareAccelerated = 16843475; // 0x10102d3
    field public static final int hasCode = 16842764; // 0x101000c
    field @Deprecated public static final int headerAmPmTextAppearance = 16843936; // 0x10104a0
    field public static final int headerBackground = 16843055; // 0x101012f
    field @Deprecated public static final int headerDayOfMonthTextAppearance = 16843927; // 0x1010497
    field public static final int headerDividersEnabled = 16843310; // 0x101022e
    field @Deprecated public static final int headerMonthTextAppearance = 16843926; // 0x1010496
    field @Deprecated public static final int headerTimeTextAppearance = 16843935; // 0x101049f
    field @Deprecated public static final int headerYearTextAppearance = 16843928; // 0x1010498
    field public static final int height = 16843093; // 0x1010155
    field public static final int hideOnContentScroll = 16843843; // 0x1010443
    field public static final int hint = 16843088; // 0x1010150
    field public static final int homeAsUpIndicator = 16843531; // 0x101030b
    field public static final int homeLayout = 16843549; // 0x101031d
    field public static final int horizontalDivider = 16843053; // 0x101012d
    field public static final int horizontalGap = 16843327; // 0x101023f
    field public static final int horizontalScrollViewStyle = 16843603; // 0x1010353
    field public static final int horizontalSpacing = 16843028; // 0x1010114
    field public static final int host = 16842792; // 0x1010028
    field public static final int hotSpotX = 16844055; // 0x1010517
    field public static final int hotSpotY = 16844056; // 0x1010518
    field public static final int hyphenationFrequency = 16843998; // 0x10104de
    field public static final int icon = 16842754; // 0x1010002
    field public static final int iconPreview = 16843337; // 0x1010249
    field public static final int iconSpaceReserved = 16844129; // 0x1010561
    field public static final int iconTint = 16844126; // 0x101055e
    field public static final int iconTintMode = 16844127; // 0x101055f
    field public static final int iconifiedByDefault = 16843514; // 0x10102fa
    field public static final int id = 16842960; // 0x10100d0
    field public static final int ignoreGravity = 16843263; // 0x10101ff
    field public static final int imageButtonStyle = 16842866; // 0x1010072
    field public static final int imageWellStyle = 16842867; // 0x1010073
    field public static final int imeActionId = 16843366; // 0x1010266
    field public static final int imeActionLabel = 16843365; // 0x1010265
    field public static final int imeExtractEnterAnimation = 16843368; // 0x1010268
    field public static final int imeExtractExitAnimation = 16843369; // 0x1010269
    field public static final int imeFullscreenBackground = 16843308; // 0x101022c
    field public static final int imeOptions = 16843364; // 0x1010264
    field public static final int imeSubtypeExtraValue = 16843502; // 0x10102ee
    field public static final int imeSubtypeLocale = 16843500; // 0x10102ec
    field public static final int imeSubtypeMode = 16843501; // 0x10102ed
    field public static final int immersive = 16843456; // 0x10102c0
    field public static final int importantForAccessibility = 16843690; // 0x10103aa
    field public static final int importantForAutofill = 16844120; // 0x1010558
    field public static final int inAnimation = 16843127; // 0x1010177
    field public static final int includeFontPadding = 16843103; // 0x101015f
    field public static final int includeInGlobalSearch = 16843374; // 0x101026e
    field public static final int indeterminate = 16843065; // 0x1010139
    field public static final int indeterminateBehavior = 16843070; // 0x101013e
    field public static final int indeterminateDrawable = 16843067; // 0x101013b
    field public static final int indeterminateDuration = 16843069; // 0x101013d
    field public static final int indeterminateOnly = 16843066; // 0x101013a
    field public static final int indeterminateProgressStyle = 16843544; // 0x1010318
    field public static final int indeterminateTint = 16843881; // 0x1010469
    field public static final int indeterminateTintMode = 16843882; // 0x101046a
    field public static final int indicatorEnd = 16843730; // 0x10103d2
    field public static final int indicatorLeft = 16843021; // 0x101010d
    field public static final int indicatorRight = 16843022; // 0x101010e
    field public static final int indicatorStart = 16843729; // 0x10103d1
    field public static final int inflatedId = 16842995; // 0x10100f3
    field public static final int initOrder = 16842778; // 0x101001a
    field public static final int initialKeyguardLayout = 16843714; // 0x10103c2
    field public static final int initialLayout = 16843345; // 0x1010251
    field public static final int innerRadius = 16843359; // 0x101025f
    field public static final int innerRadiusRatio = 16843163; // 0x101019b
    field @Deprecated public static final int inputMethod = 16843112; // 0x1010168
    field public static final int inputType = 16843296; // 0x1010220
    field public static final int inset = 16843957; // 0x10104b5
    field public static final int insetBottom = 16843194; // 0x10101ba
    field public static final int insetLeft = 16843191; // 0x10101b7
    field public static final int insetRight = 16843192; // 0x10101b8
    field public static final int insetTop = 16843193; // 0x10101b9
    field public static final int installLocation = 16843447; // 0x10102b7
    field public static final int interpolator = 16843073; // 0x1010141
    field public static final int isAlwaysSyncable = 16843571; // 0x1010333
    field public static final int isAsciiCapable = 16843753; // 0x10103e9
    field public static final int isAuxiliary = 16843647; // 0x101037f
    field public static final int isDefault = 16843297; // 0x1010221
    field public static final int isFeatureSplit = 16844123; // 0x101055b
    field public static final int isGame = 16843764; // 0x10103f4
    field public static final int isIndicator = 16843079; // 0x1010147
    field public static final int isModifier = 16843334; // 0x1010246
    field public static final int isRepeatable = 16843336; // 0x1010248
    field public static final int isScrollContainer = 16843342; // 0x101024e
    field public static final int isStatic = 16844122; // 0x101055a
    field public static final int isSticky = 16843335; // 0x1010247
    field public static final int isolatedProcess = 16843689; // 0x10103a9
    field public static final int isolatedSplits = 16844107; // 0x101054b
    field public static final int itemBackground = 16843056; // 0x1010130
    field public static final int itemIconDisabledAlpha = 16843057; // 0x1010131
    field public static final int itemPadding = 16843565; // 0x101032d
    field public static final int itemTextAppearance = 16843052; // 0x101012c
    field public static final int justificationMode = 16844135; // 0x1010567
    field public static final int keepScreenOn = 16843286; // 0x1010216
    field public static final int key = 16843240; // 0x10101e8
    field public static final int keyBackground = 16843315; // 0x1010233
    field public static final int keyEdgeFlags = 16843333; // 0x1010245
    field public static final int keyHeight = 16843326; // 0x101023e
    field public static final int keyIcon = 16843340; // 0x101024c
    field public static final int keyLabel = 16843339; // 0x101024b
    field public static final int keyOutputText = 16843338; // 0x101024a
    field public static final int keyPreviewHeight = 16843321; // 0x1010239
    field public static final int keyPreviewLayout = 16843319; // 0x1010237
    field public static final int keyPreviewOffset = 16843320; // 0x1010238
    field public static final int keySet = 16843739; // 0x10103db
    field public static final int keyTextColor = 16843318; // 0x1010236
    field public static final int keyTextSize = 16843316; // 0x1010234
    field public static final int keyWidth = 16843325; // 0x101023d
    field public static final int keyboardLayout = 16843691; // 0x10103ab
    field public static final int keyboardMode = 16843341; // 0x101024d
    field public static final int keyboardNavigationCluster = 16844096; // 0x1010540
    field public static final int keycode = 16842949; // 0x10100c5
    field public static final int killAfterRestore = 16843420; // 0x101029c
    field public static final int label = 16842753; // 0x1010001
    field public static final int labelFor = 16843718; // 0x10103c6
    field public static final int labelTextSize = 16843317; // 0x1010235
    field public static final int languageTag = 16844040; // 0x1010508
    field public static final int largeHeap = 16843610; // 0x101035a
    field public static final int largeScreens = 16843398; // 0x1010286
    field public static final int largestWidthLimitDp = 16843622; // 0x1010366
    field public static final int lastBaselineToBottomHeight = 16844158; // 0x101057e
    field public static final int launchMode = 16842781; // 0x101001d
    field public static final int launchTaskBehindSourceAnimation = 16843922; // 0x1010492
    field public static final int launchTaskBehindTargetAnimation = 16843921; // 0x1010491
    field public static final int layerType = 16843604; // 0x1010354
    field public static final int layout = 16842994; // 0x10100f2
    field public static final int layoutAnimation = 16842988; // 0x10100ec
    field public static final int layoutDirection = 16843698; // 0x10103b2
    field public static final int layoutMode = 16843738; // 0x10103da
    field public static final int layout_above = 16843140; // 0x1010184
    field public static final int layout_alignBaseline = 16843142; // 0x1010186
    field public static final int layout_alignBottom = 16843146; // 0x101018a
    field public static final int layout_alignEnd = 16843706; // 0x10103ba
    field public static final int layout_alignLeft = 16843143; // 0x1010187
    field public static final int layout_alignParentBottom = 16843150; // 0x101018e
    field public static final int layout_alignParentEnd = 16843708; // 0x10103bc
    field public static final int layout_alignParentLeft = 16843147; // 0x101018b
    field public static final int layout_alignParentRight = 16843149; // 0x101018d
    field public static final int layout_alignParentStart = 16843707; // 0x10103bb
    field public static final int layout_alignParentTop = 16843148; // 0x101018c
    field public static final int layout_alignRight = 16843145; // 0x1010189
    field public static final int layout_alignStart = 16843705; // 0x10103b9
    field public static final int layout_alignTop = 16843144; // 0x1010188
    field public static final int layout_alignWithParentIfMissing = 16843154; // 0x1010192
    field public static final int layout_below = 16843141; // 0x1010185
    field public static final int layout_centerHorizontal = 16843152; // 0x1010190
    field public static final int layout_centerInParent = 16843151; // 0x101018f
    field public static final int layout_centerVertical = 16843153; // 0x1010191
    field public static final int layout_column = 16843084; // 0x101014c
    field public static final int layout_columnSpan = 16843645; // 0x101037d
    field public static final int layout_columnWeight = 16843865; // 0x1010459
    field public static final int layout_gravity = 16842931; // 0x10100b3
    field public static final int layout_height = 16842997; // 0x10100f5
    field public static final int layout_margin = 16842998; // 0x10100f6
    field public static final int layout_marginBottom = 16843002; // 0x10100fa
    field public static final int layout_marginEnd = 16843702; // 0x10103b6
    field public static final int layout_marginHorizontal = 16844091; // 0x101053b
    field public static final int layout_marginLeft = 16842999; // 0x10100f7
    field public static final int layout_marginRight = 16843001; // 0x10100f9
    field public static final int layout_marginStart = 16843701; // 0x10103b5
    field public static final int layout_marginTop = 16843000; // 0x10100f8
    field public static final int layout_marginVertical = 16844092; // 0x101053c
    field public static final int layout_row = 16843643; // 0x101037b
    field public static final int layout_rowSpan = 16843644; // 0x101037c
    field public static final int layout_rowWeight = 16843864; // 0x1010458
    field public static final int layout_scale = 16843155; // 0x1010193
    field public static final int layout_span = 16843085; // 0x101014d
    field public static final int layout_toEndOf = 16843704; // 0x10103b8
    field public static final int layout_toLeftOf = 16843138; // 0x1010182
    field public static final int layout_toRightOf = 16843139; // 0x1010183
    field public static final int layout_toStartOf = 16843703; // 0x10103b7
    field public static final int layout_weight = 16843137; // 0x1010181
    field public static final int layout_width = 16842996; // 0x10100f4
    field public static final int layout_x = 16843135; // 0x101017f
    field public static final int layout_y = 16843136; // 0x1010180
    field public static final int left = 16843181; // 0x10101ad
    field public static final int letterSpacing = 16843958; // 0x10104b6
    field public static final int level = 16844032; // 0x1010500
    field public static final int lineHeight = 16844159; // 0x101057f
    field public static final int lineSpacingExtra = 16843287; // 0x1010217
    field public static final int lineSpacingMultiplier = 16843288; // 0x1010218
    field public static final int lines = 16843092; // 0x1010154
    field public static final int linksClickable = 16842929; // 0x10100b1
    field public static final int listChoiceBackgroundIndicator = 16843504; // 0x10102f0
    field public static final int listChoiceIndicatorMultiple = 16843290; // 0x101021a
    field public static final int listChoiceIndicatorSingle = 16843289; // 0x1010219
    field public static final int listDivider = 16843284; // 0x1010214
    field public static final int listDividerAlertDialog = 16843525; // 0x1010305
    field public static final int listMenuViewStyle = 16844018; // 0x10104f2
    field public static final int listPopupWindowStyle = 16843519; // 0x10102ff
    field public static final int listPreferredItemHeight = 16842829; // 0x101004d
    field public static final int listPreferredItemHeightLarge = 16843654; // 0x1010386
    field public static final int listPreferredItemHeightSmall = 16843655; // 0x1010387
    field public static final int listPreferredItemPaddingEnd = 16843710; // 0x10103be
    field public static final int listPreferredItemPaddingLeft = 16843683; // 0x10103a3
    field public static final int listPreferredItemPaddingRight = 16843684; // 0x10103a4
    field public static final int listPreferredItemPaddingStart = 16843709; // 0x10103bd
    field public static final int listSelector = 16843003; // 0x10100fb
    field public static final int listSeparatorTextViewStyle = 16843272; // 0x1010208
    field public static final int listViewStyle = 16842868; // 0x1010074
    field public static final int listViewWhiteStyle = 16842869; // 0x1010075
    field public static final int lockTaskMode = 16844013; // 0x10104ed
    field public static final int logo = 16843454; // 0x10102be
    field public static final int logoDescription = 16844009; // 0x10104e9
    field public static final int longClickable = 16842982; // 0x10100e6
    field public static final int loopViews = 16843527; // 0x1010307
    field public static final int manageSpaceActivity = 16842756; // 0x1010004
    field public static final int mapViewStyle = 16842890; // 0x101008a
    field public static final int marqueeRepeatLimit = 16843293; // 0x101021d
    field public static final int matchOrder = 16843855; // 0x101044f
    field public static final int max = 16843062; // 0x1010136
    field public static final int maxAspectRatio = 16844128; // 0x1010560
    field public static final int maxButtonHeight = 16844029; // 0x10104fd
    field public static final int maxDate = 16843584; // 0x1010340
    field public static final int maxEms = 16843095; // 0x1010157
    field public static final int maxHeight = 16843040; // 0x1010120
    field public static final int maxItemsPerRow = 16843060; // 0x1010134
    field public static final int maxLength = 16843104; // 0x1010160
    field public static final int maxLevel = 16843186; // 0x10101b2
    field public static final int maxLines = 16843091; // 0x1010153
    field public static final int maxLongVersionCode = 16844163; // 0x1010583
    field public static final int maxRecents = 16843846; // 0x1010446
    field public static final int maxRows = 16843059; // 0x1010133
    field public static final int maxSdkVersion = 16843377; // 0x1010271
    field public static final int maxWidth = 16843039; // 0x101011f
    field public static final int maximumAngle = 16843903; // 0x101047f
    field public static final int measureAllChildren = 16843018; // 0x101010a
    field public static final int measureWithLargestChild = 16843476; // 0x10102d4
    field public static final int mediaRouteButtonStyle = 16843693; // 0x10103ad
    field public static final int mediaRouteTypes = 16843694; // 0x10103ae
    field public static final int menuCategory = 16843230; // 0x10101de
    field public static final int mimeType = 16842790; // 0x1010026
    field public static final int min = 16844089; // 0x1010539
    field public static final int minDate = 16843583; // 0x101033f
    field public static final int minEms = 16843098; // 0x101015a
    field public static final int minHeight = 16843072; // 0x1010140
    field public static final int minLevel = 16843185; // 0x10101b1
    field public static final int minLines = 16843094; // 0x1010156
    field public static final int minResizeHeight = 16843670; // 0x1010396
    field public static final int minResizeWidth = 16843669; // 0x1010395
    field public static final int minSdkVersion = 16843276; // 0x101020c
    field public static final int minWidth = 16843071; // 0x101013f
    field public static final int minimumHorizontalAngle = 16843901; // 0x101047d
    field public static final int minimumVerticalAngle = 16843902; // 0x101047e
    field public static final int mipMap = 16843725; // 0x10103cd
    field public static final int mirrorForRtl = 16843726; // 0x10103ce
    field public static final int mode = 16843134; // 0x101017e
    field public static final int moreIcon = 16843061; // 0x1010135
    field public static final int multiArch = 16843918; // 0x101048e
    field public static final int multiprocess = 16842771; // 0x1010013
    field public static final int name = 16842755; // 0x1010003
    field public static final int navigationBarColor = 16843858; // 0x1010452
    field public static final int navigationBarDividerColor = 16844141; // 0x101056d
    field public static final int navigationContentDescription = 16843969; // 0x10104c1
    field public static final int navigationIcon = 16843968; // 0x10104c0
    field public static final int navigationMode = 16843471; // 0x10102cf
    field public static final int negativeButtonText = 16843254; // 0x10101f6
    field public static final int nestedScrollingEnabled = 16843830; // 0x1010436
    field public static final int networkSecurityConfig = 16844071; // 0x1010527
    field public static final int nextClusterForward = 16844098; // 0x1010542
    field public static final int nextFocusDown = 16842980; // 0x10100e4
    field public static final int nextFocusForward = 16843580; // 0x101033c
    field public static final int nextFocusLeft = 16842977; // 0x10100e1
    field public static final int nextFocusRight = 16842978; // 0x10100e2
    field public static final int nextFocusUp = 16842979; // 0x10100e3
    field public static final int noHistory = 16843309; // 0x101022d
    field public static final int normalScreens = 16843397; // 0x1010285
    field public static final int notificationTimeout = 16843651; // 0x1010383
    field public static final int numColumns = 16843032; // 0x1010118
    field public static final int numStars = 16843076; // 0x1010144
    field public static final int numberPickerStyle = 16844068; // 0x1010524
    field public static final int numbersBackgroundColor = 16843938; // 0x10104a2
    field public static final int numbersInnerTextColor = 16844001; // 0x10104e1
    field public static final int numbersSelectorColor = 16843939; // 0x10104a3
    field public static final int numbersTextColor = 16843937; // 0x10104a1
    field @Deprecated public static final int numeric = 16843109; // 0x1010165
    field public static final int numericModifiers = 16844111; // 0x101054f
    field public static final int numericShortcut = 16843236; // 0x10101e4
    field public static final int offset = 16844052; // 0x1010514
    field public static final int onClick = 16843375; // 0x101026f
    field public static final int oneshot = 16843159; // 0x1010197
    field public static final int opacity = 16843550; // 0x101031e
    field public static final int order = 16843242; // 0x10101ea
    field public static final int orderInCategory = 16843231; // 0x10101df
    field public static final int ordering = 16843490; // 0x10102e2
    field public static final int orderingFromXml = 16843239; // 0x10101e7
    field public static final int orientation = 16842948; // 0x10100c4
    field public static final int outAnimation = 16843128; // 0x1010178
    field public static final int outlineAmbientShadowColor = 16844162; // 0x1010582
    field public static final int outlineProvider = 16843960; // 0x10104b8
    field public static final int outlineSpotShadowColor = 16844161; // 0x1010581
    field public static final int overScrollFooter = 16843459; // 0x10102c3
    field public static final int overScrollHeader = 16843458; // 0x10102c2
    field public static final int overScrollMode = 16843457; // 0x10102c1
    field public static final int overlapAnchor = 16843874; // 0x1010462
    field public static final int overridesImplicitlyEnabledSubtype = 16843682; // 0x10103a2
    field public static final int packageNames = 16843649; // 0x1010381
    field public static final int padding = 16842965; // 0x10100d5
    field public static final int paddingBottom = 16842969; // 0x10100d9
    field public static final int paddingEnd = 16843700; // 0x10103b4
    field public static final int paddingHorizontal = 16844093; // 0x101053d
    field public static final int paddingLeft = 16842966; // 0x10100d6
    field public static final int paddingMode = 16843863; // 0x1010457
    field public static final int paddingRight = 16842968; // 0x10100d8
    field public static final int paddingStart = 16843699; // 0x10103b3
    field public static final int paddingTop = 16842967; // 0x10100d7
    field public static final int paddingVertical = 16844094; // 0x101053e
    field public static final int panelBackground = 16842846; // 0x101005e
    field public static final int panelColorBackground = 16842849; // 0x1010061
    field public static final int panelColorForeground = 16842848; // 0x1010060
    field public static final int panelFullBackground = 16842847; // 0x101005f
    field public static final int panelTextAppearance = 16842850; // 0x1010062
    field public static final int parentActivityName = 16843687; // 0x10103a7
    field @Deprecated public static final int password = 16843100; // 0x101015c
    field public static final int path = 16842794; // 0x101002a
    field public static final int pathData = 16843781; // 0x1010405
    field public static final int pathPattern = 16842796; // 0x101002c
    field public static final int pathPrefix = 16842795; // 0x101002b
    field public static final int patternPathData = 16843978; // 0x10104ca
    field public static final int permission = 16842758; // 0x1010006
    field public static final int permissionFlags = 16843719; // 0x10103c7
    field public static final int permissionGroup = 16842762; // 0x101000a
    field public static final int permissionGroupFlags = 16843717; // 0x10103c5
    field public static final int persistableMode = 16843821; // 0x101042d
    field public static final int persistent = 16842765; // 0x101000d
    field public static final int persistentDrawingCache = 16842990; // 0x10100ee
    field public static final int persistentWhenFeatureAvailable = 16844131; // 0x1010563
    field @Deprecated public static final int phoneNumber = 16843111; // 0x1010167
    field public static final int pivotX = 16843189; // 0x10101b5
    field public static final int pivotY = 16843190; // 0x10101b6
    field public static final int pointerIcon = 16844041; // 0x1010509
    field public static final int popupAnimationStyle = 16843465; // 0x10102c9
    field public static final int popupBackground = 16843126; // 0x1010176
    field public static final int popupCharacters = 16843332; // 0x1010244
    field public static final int popupElevation = 16843916; // 0x101048c
    field public static final int popupEnterTransition = 16844063; // 0x101051f
    field public static final int popupExitTransition = 16844064; // 0x1010520
    field public static final int popupKeyboard = 16843331; // 0x1010243
    field public static final int popupLayout = 16843323; // 0x101023b
    field public static final int popupMenuStyle = 16843520; // 0x1010300
    field public static final int popupTheme = 16843945; // 0x10104a9
    field public static final int popupWindowStyle = 16842870; // 0x1010076
    field public static final int port = 16842793; // 0x1010029
    field public static final int positiveButtonText = 16843253; // 0x10101f5
    field public static final int preferenceCategoryStyle = 16842892; // 0x101008c
    field public static final int preferenceFragmentStyle = 16844038; // 0x1010506
    field public static final int preferenceInformationStyle = 16842893; // 0x101008d
    field public static final int preferenceLayoutChild = 16842900; // 0x1010094
    field public static final int preferenceScreenStyle = 16842891; // 0x101008b
    field public static final int preferenceStyle = 16842894; // 0x101008e
    field public static final int presentationTheme = 16843712; // 0x10103c0
    field public static final int previewImage = 16843482; // 0x10102da
    field public static final int primaryContentAlpha = 16844114; // 0x1010552
    field public static final int priority = 16842780; // 0x101001c
    field public static final int privateImeOptions = 16843299; // 0x1010223
    field public static final int process = 16842769; // 0x1010011
    field public static final int progress = 16843063; // 0x1010137
    field public static final int progressBackgroundTint = 16843877; // 0x1010465
    field public static final int progressBackgroundTintMode = 16843878; // 0x1010466
    field public static final int progressBarPadding = 16843545; // 0x1010319
    field public static final int progressBarStyle = 16842871; // 0x1010077
    field public static final int progressBarStyleHorizontal = 16842872; // 0x1010078
    field public static final int progressBarStyleInverse = 16843399; // 0x1010287
    field public static final int progressBarStyleLarge = 16842874; // 0x101007a
    field public static final int progressBarStyleLargeInverse = 16843401; // 0x1010289
    field public static final int progressBarStyleSmall = 16842873; // 0x1010079
    field public static final int progressBarStyleSmallInverse = 16843400; // 0x1010288
    field public static final int progressBarStyleSmallTitle = 16843279; // 0x101020f
    field public static final int progressDrawable = 16843068; // 0x101013c
    field public static final int progressTint = 16843875; // 0x1010463
    field public static final int progressTintMode = 16843876; // 0x1010464
    field public static final int prompt = 16843131; // 0x101017b
    field public static final int propertyName = 16843489; // 0x10102e1
    field public static final int propertyXName = 16843892; // 0x1010474
    field public static final int propertyYName = 16843893; // 0x1010475
    field public static final int protectionLevel = 16842761; // 0x1010009
    field public static final int publicKey = 16843686; // 0x10103a6
    field public static final int queryActionMsg = 16843227; // 0x10101db
    field public static final int queryAfterZeroResults = 16843394; // 0x1010282
    field public static final int queryBackground = 16843911; // 0x1010487
    field public static final int queryHint = 16843608; // 0x1010358
    field public static final int quickContactBadgeStyleSmallWindowLarge = 16843443; // 0x10102b3
    field public static final int quickContactBadgeStyleSmallWindowMedium = 16843442; // 0x10102b2
    field public static final int quickContactBadgeStyleSmallWindowSmall = 16843441; // 0x10102b1
    field public static final int quickContactBadgeStyleWindowLarge = 16843440; // 0x10102b0
    field public static final int quickContactBadgeStyleWindowMedium = 16843439; // 0x10102af
    field public static final int quickContactBadgeStyleWindowSmall = 16843438; // 0x10102ae
    field public static final int radioButtonStyle = 16842878; // 0x101007e
    field public static final int radius = 16843176; // 0x10101a8
    field public static final int rating = 16843077; // 0x1010145
    field public static final int ratingBarStyle = 16842876; // 0x101007c
    field public static final int ratingBarStyleIndicator = 16843280; // 0x1010210
    field public static final int ratingBarStyleSmall = 16842877; // 0x101007d
    field public static final int readPermission = 16842759; // 0x1010007
    field public static final int recognitionService = 16843932; // 0x101049c
    field public static final int recreateOnConfigChanges = 16844103; // 0x1010547
    field public static final int recycleEnabled = 16844121; // 0x1010559
    field public static final int relinquishTaskIdentity = 16843894; // 0x1010476
    field public static final int reparent = 16843964; // 0x10104bc
    field public static final int reparentWithOverlay = 16843965; // 0x10104bd
    field public static final int repeatCount = 16843199; // 0x10101bf
    field public static final int repeatMode = 16843200; // 0x10101c0
    field public static final int reqFiveWayNav = 16843314; // 0x1010232
    field public static final int reqHardKeyboard = 16843305; // 0x1010229
    field public static final int reqKeyboardType = 16843304; // 0x1010228
    field public static final int reqNavigation = 16843306; // 0x101022a
    field public static final int reqTouchScreen = 16843303; // 0x1010227
    field public static final int requireDeviceUnlock = 16843756; // 0x10103ec
    field public static final int required = 16843406; // 0x101028e
    field public static final int requiredAccountType = 16843734; // 0x10103d6
    field public static final int requiredFeature = 16844116; // 0x1010554
    field public static final int requiredForAllUsers = 16843728; // 0x10103d0
    field public static final int requiredNotFeature = 16844117; // 0x1010555
    field public static final int requiresFadingEdge = 16843685; // 0x10103a5
    field public static final int requiresSmallestWidthDp = 16843620; // 0x1010364
    field public static final int resizeClip = 16843983; // 0x10104cf
    field public static final int resizeMode = 16843619; // 0x1010363
    field public static final int resizeable = 16843405; // 0x101028d
    field public static final int resizeableActivity = 16844022; // 0x10104f6
    field public static final int resource = 16842789; // 0x1010025
    field public static final int restoreAnyVersion = 16843450; // 0x10102ba
    field @Deprecated public static final int restoreNeedsApplication = 16843421; // 0x101029d
    field public static final int restrictedAccountType = 16843733; // 0x10103d5
    field public static final int restrictionType = 16843923; // 0x1010493
    field public static final int resumeWhilePausing = 16843954; // 0x10104b2
    field public static final int reversible = 16843851; // 0x101044b
    field public static final int revisionCode = 16843989; // 0x10104d5
    field public static final int right = 16843183; // 0x10101af
    field public static final int ringtonePreferenceStyle = 16842899; // 0x1010093
    field public static final int ringtoneType = 16843257; // 0x10101f9
    field public static final int rotation = 16843558; // 0x1010326
    field public static final int rotationAnimation = 16844090; // 0x101053a
    field public static final int rotationX = 16843559; // 0x1010327
    field public static final int rotationY = 16843560; // 0x1010328
    field public static final int roundIcon = 16844076; // 0x101052c
    field public static final int rowCount = 16843637; // 0x1010375
    field public static final int rowDelay = 16843216; // 0x10101d0
    field public static final int rowEdgeFlags = 16843329; // 0x1010241
    field public static final int rowHeight = 16843058; // 0x1010132
    field public static final int rowOrderPreserved = 16843638; // 0x1010376
    field public static final int saveEnabled = 16842983; // 0x10100e7
    field public static final int scaleGravity = 16843262; // 0x10101fe
    field public static final int scaleHeight = 16843261; // 0x10101fd
    field public static final int scaleType = 16843037; // 0x101011d
    field public static final int scaleWidth = 16843260; // 0x10101fc
    field public static final int scaleX = 16843556; // 0x1010324
    field public static final int scaleY = 16843557; // 0x1010325
    field public static final int scheme = 16842791; // 0x1010027
    field public static final int screenDensity = 16843467; // 0x10102cb
    field public static final int screenOrientation = 16842782; // 0x101001e
    field public static final int screenReaderFocusable = 16844148; // 0x1010574
    field public static final int screenSize = 16843466; // 0x10102ca
    field public static final int scrollHorizontally = 16843099; // 0x101015b
    field public static final int scrollIndicators = 16844006; // 0x10104e6
    field public static final int scrollViewStyle = 16842880; // 0x1010080
    field public static final int scrollX = 16842962; // 0x10100d2
    field public static final int scrollY = 16842963; // 0x10100d3
    field public static final int scrollbarAlwaysDrawHorizontalTrack = 16842856; // 0x1010068
    field public static final int scrollbarAlwaysDrawVerticalTrack = 16842857; // 0x1010069
    field public static final int scrollbarDefaultDelayBeforeFade = 16843433; // 0x10102a9
    field public static final int scrollbarFadeDuration = 16843432; // 0x10102a8
    field public static final int scrollbarSize = 16842851; // 0x1010063
    field public static final int scrollbarStyle = 16842879; // 0x101007f
    field public static final int scrollbarThumbHorizontal = 16842852; // 0x1010064
    field public static final int scrollbarThumbVertical = 16842853; // 0x1010065
    field public static final int scrollbarTrackHorizontal = 16842854; // 0x1010066
    field public static final int scrollbarTrackVertical = 16842855; // 0x1010067
    field public static final int scrollbars = 16842974; // 0x10100de
    field public static final int scrollingCache = 16843006; // 0x10100fe
    field @Deprecated public static final int searchButtonText = 16843269; // 0x1010205
    field public static final int searchHintIcon = 16843988; // 0x10104d4
    field public static final int searchIcon = 16843907; // 0x1010483
    field public static final int searchMode = 16843221; // 0x10101d5
    field public static final int searchSettingsDescription = 16843402; // 0x101028a
    field public static final int searchSuggestAuthority = 16843222; // 0x10101d6
    field public static final int searchSuggestIntentAction = 16843225; // 0x10101d9
    field public static final int searchSuggestIntentData = 16843226; // 0x10101da
    field public static final int searchSuggestPath = 16843223; // 0x10101d7
    field public static final int searchSuggestSelection = 16843224; // 0x10101d8
    field public static final int searchSuggestThreshold = 16843373; // 0x101026d
    field public static final int searchViewStyle = 16843904; // 0x1010480
    field public static final int secondaryContentAlpha = 16844115; // 0x1010553
    field public static final int secondaryProgress = 16843064; // 0x1010138
    field public static final int secondaryProgressTint = 16843879; // 0x1010467
    field public static final int secondaryProgressTintMode = 16843880; // 0x1010468
    field public static final int seekBarStyle = 16842875; // 0x101007b
    field public static final int segmentedButtonStyle = 16843568; // 0x1010330
    field public static final int selectAllOnFocus = 16843102; // 0x101015e
    field public static final int selectable = 16843238; // 0x10101e6
    field public static final int selectableItemBackground = 16843534; // 0x101030e
    field public static final int selectableItemBackgroundBorderless = 16843868; // 0x101045c
    field @Deprecated public static final int selectedDateVerticalBar = 16843591; // 0x1010347
    field @Deprecated public static final int selectedWeekBackgroundColor = 16843586; // 0x1010342
    field public static final int sessionService = 16843837; // 0x101043d
    field public static final int settingsActivity = 16843301; // 0x1010225
    field public static final int setupActivity = 16843766; // 0x10103f6
    field public static final int shadowColor = 16843105; // 0x1010161
    field public static final int shadowDx = 16843106; // 0x1010162
    field public static final int shadowDy = 16843107; // 0x1010163
    field public static final int shadowRadius = 16843108; // 0x1010164
    field public static final int shape = 16843162; // 0x101019a
    field public static final int shareInterpolator = 16843195; // 0x10101bb
    field public static final int sharedUserId = 16842763; // 0x101000b
    field public static final int sharedUserLabel = 16843361; // 0x1010261
    field public static final int shortcutDisabledMessage = 16844075; // 0x101052b
    field public static final int shortcutId = 16844072; // 0x1010528
    field public static final int shortcutLongLabel = 16844074; // 0x101052a
    field public static final int shortcutShortLabel = 16844073; // 0x1010529
    field public static final int shouldDisableView = 16843246; // 0x10101ee
    field public static final int showAsAction = 16843481; // 0x10102d9
    field public static final int showDefault = 16843258; // 0x10101fa
    field public static final int showDividers = 16843561; // 0x1010329
    field public static final int showForAllUsers = 16844015; // 0x10104ef
    field public static final int showMetadataInPreview = 16844079; // 0x101052f
    field @Deprecated public static final int showOnLockScreen = 16843721; // 0x10103c9
    field public static final int showSilent = 16843259; // 0x10101fb
    field public static final int showText = 16843949; // 0x10104ad
    field @Deprecated public static final int showWeekNumber = 16843582; // 0x101033e
    field public static final int showWhenLocked = 16844137; // 0x1010569
    field @Deprecated public static final int shownWeekCount = 16843585; // 0x1010341
    field public static final int shrinkColumns = 16843082; // 0x101014a
    field @Deprecated public static final int singleLine = 16843101; // 0x101015d
    field public static final int singleLineTitle = 16844124; // 0x101055c
    field public static final int singleUser = 16843711; // 0x10103bf
    field public static final int slideEdge = 16843824; // 0x1010430
    field public static final int smallIcon = 16843422; // 0x101029e
    field public static final int smallScreens = 16843396; // 0x1010284
    field public static final int smoothScrollbar = 16843313; // 0x1010231
    field public static final int soundEffectsEnabled = 16843285; // 0x1010215
    field public static final int spacing = 16843027; // 0x1010113
    field public static final int spinnerDropDownItemStyle = 16842887; // 0x1010087
    field public static final int spinnerItemStyle = 16842889; // 0x1010089
    field public static final int spinnerMode = 16843505; // 0x10102f1
    field public static final int spinnerStyle = 16842881; // 0x1010081
    field public static final int spinnersShown = 16843595; // 0x101034b
    field public static final int splitMotionEvents = 16843503; // 0x10102ef
    field public static final int splitName = 16844105; // 0x1010549
    field public static final int splitTrack = 16843852; // 0x101044c
    field public static final int spotShadowAlpha = 16843967; // 0x10104bf
    field public static final int src = 16843033; // 0x1010119
    field public static final int ssp = 16843747; // 0x10103e3
    field public static final int sspPattern = 16843749; // 0x10103e5
    field public static final int sspPrefix = 16843748; // 0x10103e4
    field public static final int stackFromBottom = 16843005; // 0x10100fd
    field public static final int stackViewStyle = 16843838; // 0x101043e
    field public static final int starStyle = 16842882; // 0x1010082
    field public static final int start = 16843995; // 0x10104db
    field public static final int startColor = 16843165; // 0x101019d
    field public static final int startDelay = 16843746; // 0x10103e2
    field public static final int startOffset = 16843198; // 0x10101be
    field public static final int startX = 16844048; // 0x1010510
    field public static final int startY = 16844049; // 0x1010511
    field @Deprecated public static final int startYear = 16843132; // 0x101017c
    field public static final int stateListAnimator = 16843848; // 0x1010448
    field public static final int stateNotNeeded = 16842774; // 0x1010016
    field public static final int state_above_anchor = 16842922; // 0x10100aa
    field public static final int state_accelerated = 16843547; // 0x101031b
    field public static final int state_activated = 16843518; // 0x10102fe
    field public static final int state_active = 16842914; // 0x10100a2
    field public static final int state_checkable = 16842911; // 0x101009f
    field public static final int state_checked = 16842912; // 0x10100a0
    field public static final int state_drag_can_accept = 16843624; // 0x1010368
    field public static final int state_drag_hovered = 16843625; // 0x1010369
    field public static final int state_empty = 16842921; // 0x10100a9
    field public static final int state_enabled = 16842910; // 0x101009e
    field public static final int state_expanded = 16842920; // 0x10100a8
    field public static final int state_first = 16842916; // 0x10100a4
    field public static final int state_focused = 16842908; // 0x101009c
    field public static final int state_hovered = 16843623; // 0x1010367
    field public static final int state_last = 16842918; // 0x10100a6
    field public static final int state_long_pressable = 16843324; // 0x101023c
    field public static final int state_middle = 16842917; // 0x10100a5
    field public static final int state_multiline = 16843597; // 0x101034d
    field public static final int state_pressed = 16842919; // 0x10100a7
    field public static final int state_selected = 16842913; // 0x10100a1
    field public static final int state_single = 16842915; // 0x10100a3
    field public static final int state_window_focused = 16842909; // 0x101009d
    field public static final int staticWallpaperPreview = 16843569; // 0x1010331
    field public static final int statusBarColor = 16843857; // 0x1010451
    field public static final int stepSize = 16843078; // 0x1010146
    field public static final int stopWithTask = 16843626; // 0x101036a
    field public static final int streamType = 16843273; // 0x1010209
    field public static final int stretchColumns = 16843081; // 0x1010149
    field public static final int stretchMode = 16843030; // 0x1010116
    field public static final int strokeAlpha = 16843979; // 0x10104cb
    field public static final int strokeColor = 16843782; // 0x1010406
    field public static final int strokeLineCap = 16843787; // 0x101040b
    field public static final int strokeLineJoin = 16843788; // 0x101040c
    field public static final int strokeMiterLimit = 16843789; // 0x101040d
    field public static final int strokeWidth = 16843783; // 0x1010407
    field public static final int subMenuArrow = 16844019; // 0x10104f3
    field public static final int submitBackground = 16843912; // 0x1010488
    field public static final int subtitle = 16843473; // 0x10102d1
    field public static final int subtitleTextAppearance = 16843823; // 0x101042f
    field public static final int subtitleTextColor = 16844004; // 0x10104e4
    field public static final int subtitleTextStyle = 16843513; // 0x10102f9
    field public static final int subtypeExtraValue = 16843674; // 0x101039a
    field public static final int subtypeId = 16843713; // 0x10103c1
    field public static final int subtypeLocale = 16843673; // 0x1010399
    field public static final int suggestActionMsg = 16843228; // 0x10101dc
    field public static final int suggestActionMsgColumn = 16843229; // 0x10101dd
    field public static final int suggestionRowLayout = 16843910; // 0x1010486
    field public static final int summary = 16843241; // 0x10101e9
    field public static final int summaryColumn = 16843426; // 0x10102a2
    field public static final int summaryOff = 16843248; // 0x10101f0
    field public static final int summaryOn = 16843247; // 0x10101ef
    field public static final int supportsAssist = 16844016; // 0x10104f0
    field public static final int supportsLaunchVoiceAssistFromKeyguard = 16844017; // 0x10104f1
    field public static final int supportsLocalInteraction = 16844047; // 0x101050f
    field public static final int supportsPictureInPicture = 16844023; // 0x10104f7
    field public static final int supportsRtl = 16843695; // 0x10103af
    field public static final int supportsSwitchingToNextInputMethod = 16843755; // 0x10103eb
    field public static final int supportsUploading = 16843419; // 0x101029b
    field public static final int switchMinWidth = 16843632; // 0x1010370
    field public static final int switchPadding = 16843633; // 0x1010371
    field public static final int switchPreferenceStyle = 16843629; // 0x101036d
    field public static final int switchStyle = 16843839; // 0x101043f
    field public static final int switchTextAppearance = 16843630; // 0x101036e
    field public static final int switchTextOff = 16843628; // 0x101036c
    field public static final int switchTextOn = 16843627; // 0x101036b
    field public static final int syncable = 16842777; // 0x1010019
    field public static final int tabStripEnabled = 16843453; // 0x10102bd
    field public static final int tabStripLeft = 16843451; // 0x10102bb
    field public static final int tabStripRight = 16843452; // 0x10102bc
    field public static final int tabWidgetStyle = 16842883; // 0x1010083
    field public static final int tag = 16842961; // 0x10100d1
    field public static final int targetActivity = 16843266; // 0x1010202
    field public static final int targetClass = 16842799; // 0x101002f
    field @Deprecated public static final int targetDescriptions = 16843680; // 0x10103a0
    field public static final int targetId = 16843740; // 0x10103dc
    field public static final int targetName = 16843853; // 0x101044d
    field public static final int targetPackage = 16842785; // 0x1010021
    field public static final int targetProcesses = 16844097; // 0x1010541
    field public static final int targetSandboxVersion = 16844108; // 0x101054c
    field public static final int targetSdkVersion = 16843376; // 0x1010270
    field public static final int taskAffinity = 16842770; // 0x1010012
    field public static final int taskCloseEnterAnimation = 16842942; // 0x10100be
    field public static final int taskCloseExitAnimation = 16842943; // 0x10100bf
    field public static final int taskOpenEnterAnimation = 16842940; // 0x10100bc
    field public static final int taskOpenExitAnimation = 16842941; // 0x10100bd
    field public static final int taskToBackEnterAnimation = 16842946; // 0x10100c2
    field public static final int taskToBackExitAnimation = 16842947; // 0x10100c3
    field public static final int taskToFrontEnterAnimation = 16842944; // 0x10100c0
    field public static final int taskToFrontExitAnimation = 16842945; // 0x10100c1
    field public static final int tension = 16843370; // 0x101026a
    field public static final int testOnly = 16843378; // 0x1010272
    field public static final int text = 16843087; // 0x101014f
    field public static final int textAlignment = 16843697; // 0x10103b1
    field public static final int textAllCaps = 16843660; // 0x101038c
    field public static final int textAppearance = 16842804; // 0x1010034
    field public static final int textAppearanceButton = 16843271; // 0x1010207
    field public static final int textAppearanceInverse = 16842805; // 0x1010035
    field public static final int textAppearanceLarge = 16842816; // 0x1010040
    field public static final int textAppearanceLargeInverse = 16842819; // 0x1010043
    field public static final int textAppearanceLargePopupMenu = 16843521; // 0x1010301
    field public static final int textAppearanceListItem = 16843678; // 0x101039e
    field public static final int textAppearanceListItemSecondary = 16843826; // 0x1010432
    field public static final int textAppearanceListItemSmall = 16843679; // 0x101039f
    field public static final int textAppearanceMedium = 16842817; // 0x1010041
    field public static final int textAppearanceMediumInverse = 16842820; // 0x1010044
    field public static final int textAppearancePopupMenuHeader = 16844034; // 0x1010502
    field public static final int textAppearanceSearchResultSubtitle = 16843424; // 0x10102a0
    field public static final int textAppearanceSearchResultTitle = 16843425; // 0x10102a1
    field public static final int textAppearanceSmall = 16842818; // 0x1010042
    field public static final int textAppearanceSmallInverse = 16842821; // 0x1010045
    field public static final int textAppearanceSmallPopupMenu = 16843522; // 0x1010302
    field public static final int textCheckMark = 16842822; // 0x1010046
    field public static final int textCheckMarkInverse = 16842823; // 0x1010047
    field public static final int textColor = 16842904; // 0x1010098
    field public static final int textColorAlertDialogListItem = 16843526; // 0x1010306
    field public static final int textColorHighlight = 16842905; // 0x1010099
    field public static final int textColorHighlightInverse = 16843599; // 0x101034f
    field public static final int textColorHint = 16842906; // 0x101009a
    field public static final int textColorHintInverse = 16842815; // 0x101003f
    field public static final int textColorLink = 16842907; // 0x101009b
    field public static final int textColorLinkInverse = 16843600; // 0x1010350
    field public static final int textColorPrimary = 16842806; // 0x1010036
    field public static final int textColorPrimaryDisableOnly = 16842807; // 0x1010037
    field public static final int textColorPrimaryInverse = 16842809; // 0x1010039
    field public static final int textColorPrimaryInverseDisableOnly = 16843403; // 0x101028b
    field public static final int textColorPrimaryInverseNoDisable = 16842813; // 0x101003d
    field public static final int textColorPrimaryNoDisable = 16842811; // 0x101003b
    field public static final int textColorSecondary = 16842808; // 0x1010038
    field public static final int textColorSecondaryInverse = 16842810; // 0x101003a
    field public static final int textColorSecondaryInverseNoDisable = 16842814; // 0x101003e
    field public static final int textColorSecondaryNoDisable = 16842812; // 0x101003c
    field public static final int textColorTertiary = 16843282; // 0x1010212
    field public static final int textColorTertiaryInverse = 16843283; // 0x1010213
    field public static final int textCursorDrawable = 16843618; // 0x1010362
    field public static final int textDirection = 16843696; // 0x10103b0
    field public static final int textEditNoPasteWindowLayout = 16843541; // 0x1010315
    field public static final int textEditPasteWindowLayout = 16843540; // 0x1010314
    field public static final int textEditSideNoPasteWindowLayout = 16843615; // 0x101035f
    field public static final int textEditSidePasteWindowLayout = 16843614; // 0x101035e
    field public static final int textEditSuggestionItemLayout = 16843636; // 0x1010374
    field public static final int textFilterEnabled = 16843007; // 0x10100ff
    field public static final int textFontWeight = 16844165; // 0x1010585
    field public static final int textIsSelectable = 16843542; // 0x1010316
    field public static final int textOff = 16843045; // 0x1010125
    field public static final int textOn = 16843044; // 0x1010124
    field public static final int textScaleX = 16843089; // 0x1010151
    field public static final int textSelectHandle = 16843463; // 0x10102c7
    field public static final int textSelectHandleLeft = 16843461; // 0x10102c5
    field public static final int textSelectHandleRight = 16843462; // 0x10102c6
    field public static final int textSelectHandleWindowStyle = 16843464; // 0x10102c8
    field public static final int textSize = 16842901; // 0x1010095
    field public static final int textStyle = 16842903; // 0x1010097
    field public static final int textSuggestionsWindowStyle = 16843635; // 0x1010373
    field public static final int textViewStyle = 16842884; // 0x1010084
    field public static final int theme = 16842752; // 0x1010000
    field public static final int thickness = 16843360; // 0x1010260
    field public static final int thicknessRatio = 16843164; // 0x101019c
    field public static final int thumb = 16843074; // 0x1010142
    field public static final int thumbOffset = 16843075; // 0x1010143
    field public static final int thumbPosition = 16844005; // 0x10104e5
    field public static final int thumbTextPadding = 16843634; // 0x1010372
    field public static final int thumbTint = 16843889; // 0x1010471
    field public static final int thumbTintMode = 16843890; // 0x1010472
    field public static final int thumbnail = 16843429; // 0x10102a5
    field public static final int tickMark = 16844042; // 0x101050a
    field public static final int tickMarkTint = 16844043; // 0x101050b
    field public static final int tickMarkTintMode = 16844044; // 0x101050c
    field public static final int tileMode = 16843265; // 0x1010201
    field public static final int tileModeX = 16843895; // 0x1010477
    field public static final int tileModeY = 16843896; // 0x1010478
    field public static final int timePickerDialogTheme = 16843934; // 0x101049e
    field public static final int timePickerMode = 16843956; // 0x10104b4
    field public static final int timePickerStyle = 16843933; // 0x101049d
    field public static final int timeZone = 16843724; // 0x10103cc
    field public static final int tint = 16843041; // 0x1010121
    field public static final int tintMode = 16843771; // 0x10103fb
    field public static final int title = 16843233; // 0x10101e1
    field public static final int titleCondensed = 16843234; // 0x10101e2
    field public static final int titleMargin = 16844024; // 0x10104f8
    field public static final int titleMarginBottom = 16844028; // 0x10104fc
    field public static final int titleMarginEnd = 16844026; // 0x10104fa
    field public static final int titleMarginStart = 16844025; // 0x10104f9
    field public static final int titleMarginTop = 16844027; // 0x10104fb
    field public static final int titleTextAppearance = 16843822; // 0x101042e
    field public static final int titleTextColor = 16844003; // 0x10104e3
    field public static final int titleTextStyle = 16843512; // 0x10102f8
    field public static final int toAlpha = 16843211; // 0x10101cb
    field public static final int toDegrees = 16843188; // 0x10101b4
    field public static final int toId = 16843849; // 0x1010449
    field public static final int toScene = 16843742; // 0x10103de
    field public static final int toXDelta = 16843207; // 0x10101c7
    field public static final int toXScale = 16843203; // 0x10101c3
    field public static final int toYDelta = 16843209; // 0x10101c9
    field public static final int toYScale = 16843205; // 0x10101c5
    field public static final int toolbarStyle = 16843946; // 0x10104aa
    field public static final int tooltipText = 16844084; // 0x1010534
    field public static final int top = 16843182; // 0x10101ae
    field public static final int topBright = 16842955; // 0x10100cb
    field public static final int topDark = 16842951; // 0x10100c7
    field public static final int topLeftRadius = 16843177; // 0x10101a9
    field public static final int topOffset = 16843352; // 0x1010258
    field public static final int topRightRadius = 16843178; // 0x10101aa
    field public static final int touchscreenBlocksFocus = 16843919; // 0x101048f
    field public static final int track = 16843631; // 0x101036f
    field public static final int trackTint = 16843993; // 0x10104d9
    field public static final int trackTintMode = 16843994; // 0x10104da
    field public static final int transcriptMode = 16843008; // 0x1010100
    field public static final int transformPivotX = 16843552; // 0x1010320
    field public static final int transformPivotY = 16843553; // 0x1010321
    field public static final int transition = 16843743; // 0x10103df
    field public static final int transitionGroup = 16843777; // 0x1010401
    field public static final int transitionName = 16843776; // 0x1010400
    field public static final int transitionOrdering = 16843744; // 0x10103e0
    field public static final int transitionVisibilityMode = 16843900; // 0x101047c
    field public static final int translateX = 16843866; // 0x101045a
    field public static final int translateY = 16843867; // 0x101045b
    field public static final int translationX = 16843554; // 0x1010322
    field public static final int translationY = 16843555; // 0x1010323
    field public static final int translationZ = 16843770; // 0x10103fa
    field public static final int trimPathEnd = 16843785; // 0x1010409
    field public static final int trimPathOffset = 16843786; // 0x101040a
    field public static final int trimPathStart = 16843784; // 0x1010408
    field public static final int ttcIndex = 16844143; // 0x101056f
    field public static final int tunerCount = 16844061; // 0x101051d
    field public static final int turnScreenOn = 16844138; // 0x101056a
    field public static final int type = 16843169; // 0x10101a1
    field public static final int typeface = 16842902; // 0x1010096
    field public static final int uiOptions = 16843672; // 0x1010398
    field public static final int uncertainGestureColor = 16843382; // 0x1010276
    field @Deprecated public static final int unfocusedMonthDateColor = 16843588; // 0x1010344
    field public static final int unselectedAlpha = 16843278; // 0x101020e
    field public static final int updatePeriodMillis = 16843344; // 0x1010250
    field public static final int use32bitAbi = 16844053; // 0x1010515
    field public static final int useDefaultMargins = 16843641; // 0x1010379
    field public static final int useIntrinsicSizeAsMinimum = 16843536; // 0x1010310
    field public static final int useLevel = 16843167; // 0x101019f
    field public static final int userVisible = 16843409; // 0x1010291
    field public static final int usesCleartextTraffic = 16844012; // 0x10104ec
    field public static final int value = 16842788; // 0x1010024
    field public static final int valueFrom = 16843486; // 0x10102de
    field public static final int valueTo = 16843487; // 0x10102df
    field public static final int valueType = 16843488; // 0x10102e0
    field public static final int variablePadding = 16843157; // 0x1010195
    field public static final int vendor = 16843751; // 0x10103e7
    field public static final int version = 16844057; // 0x1010519
    field public static final int versionCode = 16843291; // 0x101021b
    field public static final int versionCodeMajor = 16844150; // 0x1010576
    field public static final int versionMajor = 16844151; // 0x1010577
    field public static final int versionName = 16843292; // 0x101021c
    field public static final int verticalCorrection = 16843322; // 0x101023a
    field public static final int verticalDivider = 16843054; // 0x101012e
    field public static final int verticalGap = 16843328; // 0x1010240
    field public static final int verticalScrollbarPosition = 16843572; // 0x1010334
    field public static final int verticalSpacing = 16843029; // 0x1010115
    field public static final int viewportHeight = 16843779; // 0x1010403
    field public static final int viewportWidth = 16843778; // 0x1010402
    field public static final int visibility = 16842972; // 0x10100dc
    field public static final int visible = 16843156; // 0x1010194
    field public static final int visibleToInstantApps = 16844081; // 0x1010531
    field public static final int vmSafeMode = 16843448; // 0x10102b8
    field public static final int voiceIcon = 16843908; // 0x1010484
    field public static final int voiceLanguage = 16843349; // 0x1010255
    field public static final int voiceLanguageModel = 16843347; // 0x1010253
    field public static final int voiceMaxResults = 16843350; // 0x1010256
    field public static final int voicePromptText = 16843348; // 0x1010254
    field public static final int voiceSearchMode = 16843346; // 0x1010252
    field public static final int wallpaperCloseEnterAnimation = 16843413; // 0x1010295
    field public static final int wallpaperCloseExitAnimation = 16843414; // 0x1010296
    field public static final int wallpaperIntraCloseEnterAnimation = 16843417; // 0x1010299
    field public static final int wallpaperIntraCloseExitAnimation = 16843418; // 0x101029a
    field public static final int wallpaperIntraOpenEnterAnimation = 16843415; // 0x1010297
    field public static final int wallpaperIntraOpenExitAnimation = 16843416; // 0x1010298
    field public static final int wallpaperOpenEnterAnimation = 16843411; // 0x1010293
    field public static final int wallpaperOpenExitAnimation = 16843412; // 0x1010294
    field public static final int webTextViewStyle = 16843449; // 0x10102b9
    field public static final int webViewStyle = 16842885; // 0x1010085
    field public static final int weekDayTextAppearance = 16843592; // 0x1010348
    field @Deprecated public static final int weekNumberColor = 16843589; // 0x1010345
    field @Deprecated public static final int weekSeparatorLineColor = 16843590; // 0x1010346
    field public static final int weightSum = 16843048; // 0x1010128
    field public static final int widgetCategory = 16843716; // 0x10103c4
    field public static final int widgetFeatures = 16844153; // 0x1010579
    field public static final int widgetLayout = 16843243; // 0x10101eb
    field public static final int width = 16843097; // 0x1010159
    field public static final int windowActionBar = 16843469; // 0x10102cd
    field public static final int windowActionBarOverlay = 16843492; // 0x10102e4
    field public static final int windowActionModeOverlay = 16843485; // 0x10102dd
    field public static final int windowActivityTransitions = 16843981; // 0x10104cd
    field public static final int windowAllowEnterTransitionOverlap = 16843836; // 0x101043c
    field public static final int windowAllowReturnTransitionOverlap = 16843835; // 0x101043b
    field public static final int windowAnimationStyle = 16842926; // 0x10100ae
    field public static final int windowBackground = 16842836; // 0x1010054
    field public static final int windowBackgroundFallback = 16844035; // 0x1010503
    field public static final int windowClipToOutline = 16843947; // 0x10104ab
    field public static final int windowCloseOnTouchOutside = 16843611; // 0x101035b
    field public static final int windowContentOverlay = 16842841; // 0x1010059
    field public static final int windowContentTransitionManager = 16843769; // 0x10103f9
    field public static final int windowContentTransitions = 16843768; // 0x10103f8
    field public static final int windowDisablePreview = 16843298; // 0x1010222
    field public static final int windowDrawsSystemBarBackgrounds = 16843856; // 0x1010450
    field public static final int windowElevation = 16843920; // 0x1010490
    field public static final int windowEnableSplitTouch = 16843543; // 0x1010317
    field public static final int windowEnterAnimation = 16842932; // 0x10100b4
    field public static final int windowEnterTransition = 16843831; // 0x1010437
    field public static final int windowExitAnimation = 16842933; // 0x10100b5
    field public static final int windowExitTransition = 16843832; // 0x1010438
    field public static final int windowFrame = 16842837; // 0x1010055
    field public static final int windowFullscreen = 16843277; // 0x101020d
    field public static final int windowHideAnimation = 16842935; // 0x10100b7
    field public static final int windowIsFloating = 16842839; // 0x1010057
    field public static final int windowIsTranslucent = 16842840; // 0x1010058
    field public static final int windowLayoutInDisplayCutoutMode = 16844166; // 0x1010586
    field public static final int windowLightNavigationBar = 16844140; // 0x101056c
    field public static final int windowLightStatusBar = 16844000; // 0x10104e0
    field public static final int windowMinWidthMajor = 16843606; // 0x1010356
    field public static final int windowMinWidthMinor = 16843607; // 0x1010357
    field public static final int windowNoDisplay = 16843294; // 0x101021e
    field public static final int windowNoTitle = 16842838; // 0x1010056
    field public static final int windowOverscan = 16843727; // 0x10103cf
    field public static final int windowReenterTransition = 16843951; // 0x10104af
    field public static final int windowReturnTransition = 16843950; // 0x10104ae
    field public static final int windowSharedElementEnterTransition = 16843833; // 0x1010439
    field public static final int windowSharedElementExitTransition = 16843834; // 0x101043a
    field public static final int windowSharedElementReenterTransition = 16843953; // 0x10104b1
    field public static final int windowSharedElementReturnTransition = 16843952; // 0x10104b0
    field public static final int windowSharedElementsUseOverlay = 16843963; // 0x10104bb
    field public static final int windowShowAnimation = 16842934; // 0x10100b6
    field public static final int windowShowWallpaper = 16843410; // 0x1010292
    field public static final int windowSoftInputMode = 16843307; // 0x101022b
    field public static final int windowSplashscreenContent = 16844132; // 0x1010564
    field public static final int windowSwipeToDismiss = 16843763; // 0x10103f3
    field public static final int windowTitleBackgroundStyle = 16842844; // 0x101005c
    field public static final int windowTitleSize = 16842842; // 0x101005a
    field public static final int windowTitleStyle = 16842843; // 0x101005b
    field public static final int windowTransitionBackgroundFadeDuration = 16843873; // 0x1010461
    field public static final int windowTranslucentNavigation = 16843760; // 0x10103f0
    field public static final int windowTranslucentStatus = 16843759; // 0x10103ef
    field public static final int writePermission = 16842760; // 0x1010008
    field public static final int x = 16842924; // 0x10100ac
    field public static final int xlargeScreens = 16843455; // 0x10102bf
    field public static final int y = 16842925; // 0x10100ad
    field @Deprecated public static final int yearListItemTextAppearance = 16843929; // 0x1010499
    field @Deprecated public static final int yearListSelectorColor = 16843930; // 0x101049a
    field public static final int yesNoPreferenceStyle = 16842896; // 0x1010090
    field public static final int zAdjustment = 16843201; // 0x10101c1
  }

  public static final class R.bool {
    ctor public R.bool();
  }

  public static final class R.color {
    ctor public R.color();
    field public static final int background_dark = 17170446; // 0x106000e
    field public static final int background_light = 17170447; // 0x106000f
    field public static final int black = 17170444; // 0x106000c
    field public static final int darker_gray = 17170432; // 0x1060000
    field public static final int holo_blue_bright = 17170459; // 0x106001b
    field public static final int holo_blue_dark = 17170451; // 0x1060013
    field public static final int holo_blue_light = 17170450; // 0x1060012
    field public static final int holo_green_dark = 17170453; // 0x1060015
    field public static final int holo_green_light = 17170452; // 0x1060014
    field public static final int holo_orange_dark = 17170457; // 0x1060019
    field public static final int holo_orange_light = 17170456; // 0x1060018
    field public static final int holo_purple = 17170458; // 0x106001a
    field public static final int holo_red_dark = 17170455; // 0x1060017
    field public static final int holo_red_light = 17170454; // 0x1060016
    field @Deprecated public static final int primary_text_dark = 17170433; // 0x1060001
    field @Deprecated public static final int primary_text_dark_nodisable = 17170434; // 0x1060002
    field @Deprecated public static final int primary_text_light = 17170435; // 0x1060003
    field @Deprecated public static final int primary_text_light_nodisable = 17170436; // 0x1060004
    field @Deprecated public static final int secondary_text_dark = 17170437; // 0x1060005
    field @Deprecated public static final int secondary_text_dark_nodisable = 17170438; // 0x1060006
    field @Deprecated public static final int secondary_text_light = 17170439; // 0x1060007
    field @Deprecated public static final int secondary_text_light_nodisable = 17170440; // 0x1060008
    field public static final int tab_indicator_text = 17170441; // 0x1060009
    field @Deprecated public static final int tertiary_text_dark = 17170448; // 0x1060010
    field @Deprecated public static final int tertiary_text_light = 17170449; // 0x1060011
    field public static final int transparent = 17170445; // 0x106000d
    field public static final int white = 17170443; // 0x106000b
    field public static final int widget_edittext_dark = 17170442; // 0x106000a
  }

  public static final class R.dimen {
    ctor public R.dimen();
    field public static final int app_icon_size = 17104896; // 0x1050000
    field public static final int dialog_min_width_major = 17104899; // 0x1050003
    field public static final int dialog_min_width_minor = 17104900; // 0x1050004
    field public static final int notification_large_icon_height = 17104902; // 0x1050006
    field public static final int notification_large_icon_width = 17104901; // 0x1050005
    field public static final int thumbnail_height = 17104897; // 0x1050001
    field public static final int thumbnail_width = 17104898; // 0x1050002
  }

  public static final class R.drawable {
    ctor public R.drawable();
    field public static final int alert_dark_frame = 17301504; // 0x1080000
    field public static final int alert_light_frame = 17301505; // 0x1080001
    field public static final int arrow_down_float = 17301506; // 0x1080002
    field public static final int arrow_up_float = 17301507; // 0x1080003
    field public static final int bottom_bar = 17301658; // 0x108009a
    field public static final int btn_default = 17301508; // 0x1080004
    field public static final int btn_default_small = 17301509; // 0x1080005
    field public static final int btn_dialog = 17301527; // 0x1080017
    field public static final int btn_dropdown = 17301510; // 0x1080006
    field public static final int btn_minus = 17301511; // 0x1080007
    field public static final int btn_plus = 17301512; // 0x1080008
    field public static final int btn_radio = 17301513; // 0x1080009
    field public static final int btn_star = 17301514; // 0x108000a
    field public static final int btn_star_big_off = 17301515; // 0x108000b
    field public static final int btn_star_big_on = 17301516; // 0x108000c
    field public static final int button_onoff_indicator_off = 17301518; // 0x108000e
    field public static final int button_onoff_indicator_on = 17301517; // 0x108000d
    field public static final int checkbox_off_background = 17301519; // 0x108000f
    field public static final int checkbox_on_background = 17301520; // 0x1080010
    field public static final int dark_header = 17301669; // 0x10800a5
    field public static final int dialog_frame = 17301521; // 0x1080011
    field public static final int dialog_holo_dark_frame = 17301682; // 0x10800b2
    field public static final int dialog_holo_light_frame = 17301683; // 0x10800b3
    field public static final int divider_horizontal_bright = 17301522; // 0x1080012
    field public static final int divider_horizontal_dark = 17301524; // 0x1080014
    field public static final int divider_horizontal_dim_dark = 17301525; // 0x1080015
    field public static final int divider_horizontal_textfield = 17301523; // 0x1080013
    field public static final int edit_text = 17301526; // 0x1080016
    field public static final int editbox_background = 17301528; // 0x1080018
    field public static final int editbox_background_normal = 17301529; // 0x1080019
    field public static final int editbox_dropdown_dark_frame = 17301530; // 0x108001a
    field public static final int editbox_dropdown_light_frame = 17301531; // 0x108001b
    field public static final int gallery_thumb = 17301532; // 0x108001c
    field public static final int ic_btn_speak_now = 17301668; // 0x10800a4
    field public static final int ic_delete = 17301533; // 0x108001d
    field public static final int ic_dialog_alert = 17301543; // 0x1080027
    field public static final int ic_dialog_dialer = 17301544; // 0x1080028
    field public static final int ic_dialog_email = 17301545; // 0x1080029
    field public static final int ic_dialog_info = 17301659; // 0x108009b
    field public static final int ic_dialog_map = 17301546; // 0x108002a
    field public static final int ic_input_add = 17301547; // 0x108002b
    field public static final int ic_input_delete = 17301548; // 0x108002c
    field public static final int ic_input_get = 17301549; // 0x108002d
    field public static final int ic_lock_idle_alarm = 17301550; // 0x108002e
    field public static final int ic_lock_idle_charging = 17301534; // 0x108001e
    field public static final int ic_lock_idle_lock = 17301535; // 0x108001f
    field public static final int ic_lock_idle_low_battery = 17301536; // 0x1080020
    field public static final int ic_lock_lock = 17301551; // 0x108002f
    field public static final int ic_lock_power_off = 17301552; // 0x1080030
    field public static final int ic_lock_silent_mode = 17301553; // 0x1080031
    field public static final int ic_lock_silent_mode_off = 17301554; // 0x1080032
    field public static final int ic_media_ff = 17301537; // 0x1080021
    field public static final int ic_media_next = 17301538; // 0x1080022
    field public static final int ic_media_pause = 17301539; // 0x1080023
    field public static final int ic_media_play = 17301540; // 0x1080024
    field public static final int ic_media_previous = 17301541; // 0x1080025
    field public static final int ic_media_rew = 17301542; // 0x1080026
    field public static final int ic_menu_add = 17301555; // 0x1080033
    field public static final int ic_menu_agenda = 17301556; // 0x1080034
    field public static final int ic_menu_always_landscape_portrait = 17301557; // 0x1080035
    field public static final int ic_menu_call = 17301558; // 0x1080036
    field public static final int ic_menu_camera = 17301559; // 0x1080037
    field public static final int ic_menu_close_clear_cancel = 17301560; // 0x1080038
    field public static final int ic_menu_compass = 17301561; // 0x1080039
    field public static final int ic_menu_crop = 17301562; // 0x108003a
    field public static final int ic_menu_day = 17301563; // 0x108003b
    field public static final int ic_menu_delete = 17301564; // 0x108003c
    field public static final int ic_menu_directions = 17301565; // 0x108003d
    field public static final int ic_menu_edit = 17301566; // 0x108003e
    field public static final int ic_menu_gallery = 17301567; // 0x108003f
    field public static final int ic_menu_help = 17301568; // 0x1080040
    field public static final int ic_menu_info_details = 17301569; // 0x1080041
    field public static final int ic_menu_manage = 17301570; // 0x1080042
    field public static final int ic_menu_mapmode = 17301571; // 0x1080043
    field public static final int ic_menu_month = 17301572; // 0x1080044
    field public static final int ic_menu_more = 17301573; // 0x1080045
    field public static final int ic_menu_my_calendar = 17301574; // 0x1080046
    field public static final int ic_menu_mylocation = 17301575; // 0x1080047
    field public static final int ic_menu_myplaces = 17301576; // 0x1080048
    field public static final int ic_menu_preferences = 17301577; // 0x1080049
    field public static final int ic_menu_recent_history = 17301578; // 0x108004a
    field public static final int ic_menu_report_image = 17301579; // 0x108004b
    field public static final int ic_menu_revert = 17301580; // 0x108004c
    field public static final int ic_menu_rotate = 17301581; // 0x108004d
    field public static final int ic_menu_save = 17301582; // 0x108004e
    field public static final int ic_menu_search = 17301583; // 0x108004f
    field public static final int ic_menu_send = 17301584; // 0x1080050
    field public static final int ic_menu_set_as = 17301585; // 0x1080051
    field public static final int ic_menu_share = 17301586; // 0x1080052
    field public static final int ic_menu_slideshow = 17301587; // 0x1080053
    field public static final int ic_menu_sort_alphabetically = 17301660; // 0x108009c
    field public static final int ic_menu_sort_by_size = 17301661; // 0x108009d
    field public static final int ic_menu_today = 17301588; // 0x1080054
    field public static final int ic_menu_upload = 17301589; // 0x1080055
    field public static final int ic_menu_upload_you_tube = 17301590; // 0x1080056
    field public static final int ic_menu_view = 17301591; // 0x1080057
    field public static final int ic_menu_week = 17301592; // 0x1080058
    field public static final int ic_menu_zoom = 17301593; // 0x1080059
    field public static final int ic_notification_clear_all = 17301594; // 0x108005a
    field public static final int ic_notification_overlay = 17301595; // 0x108005b
    field public static final int ic_partial_secure = 17301596; // 0x108005c
    field public static final int ic_popup_disk_full = 17301597; // 0x108005d
    field public static final int ic_popup_reminder = 17301598; // 0x108005e
    field public static final int ic_popup_sync = 17301599; // 0x108005f
    field public static final int ic_search_category_default = 17301600; // 0x1080060
    field public static final int ic_secure = 17301601; // 0x1080061
    field public static final int list_selector_background = 17301602; // 0x1080062
    field public static final int menu_frame = 17301603; // 0x1080063
    field public static final int menu_full_frame = 17301604; // 0x1080064
    field public static final int menuitem_background = 17301605; // 0x1080065
    field public static final int picture_frame = 17301606; // 0x1080066
    field public static final int presence_audio_away = 17301679; // 0x10800af
    field public static final int presence_audio_busy = 17301680; // 0x10800b0
    field public static final int presence_audio_online = 17301681; // 0x10800b1
    field public static final int presence_away = 17301607; // 0x1080067
    field public static final int presence_busy = 17301608; // 0x1080068
    field public static final int presence_invisible = 17301609; // 0x1080069
    field public static final int presence_offline = 17301610; // 0x108006a
    field public static final int presence_online = 17301611; // 0x108006b
    field public static final int presence_video_away = 17301676; // 0x10800ac
    field public static final int presence_video_busy = 17301677; // 0x10800ad
    field public static final int presence_video_online = 17301678; // 0x10800ae
    field public static final int progress_horizontal = 17301612; // 0x108006c
    field public static final int progress_indeterminate_horizontal = 17301613; // 0x108006d
    field public static final int radiobutton_off_background = 17301614; // 0x108006e
    field public static final int radiobutton_on_background = 17301615; // 0x108006f
    field public static final int screen_background_dark = 17301656; // 0x1080098
    field public static final int screen_background_dark_transparent = 17301673; // 0x10800a9
    field public static final int screen_background_light = 17301657; // 0x1080099
    field public static final int screen_background_light_transparent = 17301674; // 0x10800aa
    field public static final int spinner_background = 17301616; // 0x1080070
    field public static final int spinner_dropdown_background = 17301617; // 0x1080071
    field public static final int star_big_off = 17301619; // 0x1080073
    field public static final int star_big_on = 17301618; // 0x1080072
    field public static final int star_off = 17301621; // 0x1080075
    field public static final int star_on = 17301620; // 0x1080074
    field public static final int stat_notify_call_mute = 17301622; // 0x1080076
    field public static final int stat_notify_chat = 17301623; // 0x1080077
    field public static final int stat_notify_error = 17301624; // 0x1080078
    field public static final int stat_notify_missed_call = 17301631; // 0x108007f
    field public static final int stat_notify_more = 17301625; // 0x1080079
    field public static final int stat_notify_sdcard = 17301626; // 0x108007a
    field public static final int stat_notify_sdcard_prepare = 17301675; // 0x10800ab
    field public static final int stat_notify_sdcard_usb = 17301627; // 0x108007b
    field public static final int stat_notify_sync = 17301628; // 0x108007c
    field public static final int stat_notify_sync_noanim = 17301629; // 0x108007d
    field public static final int stat_notify_voicemail = 17301630; // 0x108007e
    field public static final int stat_sys_data_bluetooth = 17301632; // 0x1080080
    field public static final int stat_sys_download = 17301633; // 0x1080081
    field public static final int stat_sys_download_done = 17301634; // 0x1080082
    field public static final int stat_sys_headset = 17301635; // 0x1080083
    field @Deprecated public static final int stat_sys_phone_call = 17301636; // 0x1080084
    field @Deprecated public static final int stat_sys_phone_call_forward = 17301637; // 0x1080085
    field @Deprecated public static final int stat_sys_phone_call_on_hold = 17301638; // 0x1080086
    field public static final int stat_sys_speakerphone = 17301639; // 0x1080087
    field public static final int stat_sys_upload = 17301640; // 0x1080088
    field public static final int stat_sys_upload_done = 17301641; // 0x1080089
    field @Deprecated public static final int stat_sys_vp_phone_call = 17301671; // 0x10800a7
    field @Deprecated public static final int stat_sys_vp_phone_call_on_hold = 17301672; // 0x10800a8
    field public static final int stat_sys_warning = 17301642; // 0x108008a
    field public static final int status_bar_item_app_background = 17301643; // 0x108008b
    field public static final int status_bar_item_background = 17301644; // 0x108008c
    field public static final int sym_action_call = 17301645; // 0x108008d
    field public static final int sym_action_chat = 17301646; // 0x108008e
    field public static final int sym_action_email = 17301647; // 0x108008f
    field public static final int sym_call_incoming = 17301648; // 0x1080090
    field public static final int sym_call_missed = 17301649; // 0x1080091
    field public static final int sym_call_outgoing = 17301650; // 0x1080092
    field public static final int sym_contact_card = 17301652; // 0x1080094
    field public static final int sym_def_app_icon = 17301651; // 0x1080093
    field public static final int title_bar = 17301653; // 0x1080095
    field public static final int title_bar_tall = 17301670; // 0x10800a6
    field public static final int toast_frame = 17301654; // 0x1080096
    field public static final int zoom_plate = 17301655; // 0x1080097
  }

  public static final class R.fraction {
    ctor public R.fraction();
  }

  public static final class R.id {
    ctor public R.id();
    field public static final int accessibilityActionContextClick = 16908348; // 0x102003c
    field public static final int accessibilityActionHideTooltip = 16908357; // 0x1020045
    field public static final int accessibilityActionMoveWindow = 16908354; // 0x1020042
    field public static final int accessibilityActionScrollDown = 16908346; // 0x102003a
    field public static final int accessibilityActionScrollLeft = 16908345; // 0x1020039
    field public static final int accessibilityActionScrollRight = 16908347; // 0x102003b
    field public static final int accessibilityActionScrollToPosition = 16908343; // 0x1020037
    field public static final int accessibilityActionScrollUp = 16908344; // 0x1020038
    field public static final int accessibilityActionSetProgress = 16908349; // 0x102003d
    field public static final int accessibilityActionShowOnScreen = 16908342; // 0x1020036
    field public static final int accessibilityActionShowTooltip = 16908356; // 0x1020044
    field public static final int addToDictionary = 16908330; // 0x102002a
    field public static final int autofill = 16908355; // 0x1020043
    field public static final int background = 16908288; // 0x1020000
    field public static final int button1 = 16908313; // 0x1020019
    field public static final int button2 = 16908314; // 0x102001a
    field public static final int button3 = 16908315; // 0x102001b
    field public static final int candidatesArea = 16908317; // 0x102001d
    field public static final int checkbox = 16908289; // 0x1020001
    field public static final int closeButton = 16908327; // 0x1020027
    field public static final int content = 16908290; // 0x1020002
    field public static final int copy = 16908321; // 0x1020021
    field public static final int copyUrl = 16908323; // 0x1020023
    field public static final int custom = 16908331; // 0x102002b
    field public static final int cut = 16908320; // 0x1020020
    field public static final int edit = 16908291; // 0x1020003
    field public static final int empty = 16908292; // 0x1020004
    field public static final int extractArea = 16908316; // 0x102001c
    field public static final int hint = 16908293; // 0x1020005
    field public static final int home = 16908332; // 0x102002c
    field public static final int icon = 16908294; // 0x1020006
    field public static final int icon1 = 16908295; // 0x1020007
    field public static final int icon2 = 16908296; // 0x1020008
    field public static final int icon_frame = 16908350; // 0x102003e
    field public static final int input = 16908297; // 0x1020009
    field public static final int inputArea = 16908318; // 0x102001e
    field public static final int inputExtractEditText = 16908325; // 0x1020025
    field public static final int keyboardView = 16908326; // 0x1020026
    field public static final int list = 16908298; // 0x102000a
    field public static final int list_container = 16908351; // 0x102003f
    field public static final int mask = 16908334; // 0x102002e
    field public static final int message = 16908299; // 0x102000b
    field public static final int navigationBarBackground = 16908336; // 0x1020030
    field public static final int paste = 16908322; // 0x1020022
    field public static final int pasteAsPlainText = 16908337; // 0x1020031
    field public static final int primary = 16908300; // 0x102000c
    field public static final int progress = 16908301; // 0x102000d
    field public static final int redo = 16908339; // 0x1020033
    field public static final int replaceText = 16908340; // 0x1020034
    field public static final int secondaryProgress = 16908303; // 0x102000f
    field public static final int selectAll = 16908319; // 0x102001f
    field public static final int selectTextMode = 16908333; // 0x102002d
    field public static final int selectedIcon = 16908302; // 0x102000e
    field public static final int shareText = 16908341; // 0x1020035
    field public static final int startSelectingText = 16908328; // 0x1020028
    field public static final int statusBarBackground = 16908335; // 0x102002f
    field public static final int stopSelectingText = 16908329; // 0x1020029
    field public static final int summary = 16908304; // 0x1020010
    field public static final int switchInputMethod = 16908324; // 0x1020024
    field public static final int switch_widget = 16908352; // 0x1020040
    field public static final int tabcontent = 16908305; // 0x1020011
    field public static final int tabhost = 16908306; // 0x1020012
    field public static final int tabs = 16908307; // 0x1020013
    field public static final int text1 = 16908308; // 0x1020014
    field public static final int text2 = 16908309; // 0x1020015
    field public static final int textAssist = 16908353; // 0x1020041
    field public static final int title = 16908310; // 0x1020016
    field public static final int toggle = 16908311; // 0x1020017
    field public static final int undo = 16908338; // 0x1020032
    field public static final int widget_frame = 16908312; // 0x1020018
  }

  public static final class R.integer {
    ctor public R.integer();
    field public static final int config_longAnimTime = 17694722; // 0x10e0002
    field public static final int config_mediumAnimTime = 17694721; // 0x10e0001
    field public static final int config_shortAnimTime = 17694720; // 0x10e0000
    field public static final int status_bar_notification_info_maxnum = 17694723; // 0x10e0003
  }

  public static final class R.interpolator {
    ctor public R.interpolator();
    field public static final int accelerate_cubic = 17563650; // 0x10c0002
    field public static final int accelerate_decelerate = 17563654; // 0x10c0006
    field public static final int accelerate_quad = 17563648; // 0x10c0000
    field public static final int accelerate_quint = 17563652; // 0x10c0004
    field public static final int anticipate = 17563655; // 0x10c0007
    field public static final int anticipate_overshoot = 17563657; // 0x10c0009
    field public static final int bounce = 17563658; // 0x10c000a
    field public static final int cycle = 17563660; // 0x10c000c
    field public static final int decelerate_cubic = 17563651; // 0x10c0003
    field public static final int decelerate_quad = 17563649; // 0x10c0001
    field public static final int decelerate_quint = 17563653; // 0x10c0005
    field public static final int fast_out_extra_slow_in = 17563674; // 0x10c001a
    field public static final int fast_out_linear_in = 17563663; // 0x10c000f
    field public static final int fast_out_slow_in = 17563661; // 0x10c000d
    field public static final int linear = 17563659; // 0x10c000b
    field public static final int linear_out_slow_in = 17563662; // 0x10c000e
    field public static final int overshoot = 17563656; // 0x10c0008
  }

  public static final class R.layout {
    ctor public R.layout();
    field public static final int activity_list_item = 17367040; // 0x1090000
    field public static final int browser_link_context_header = 17367054; // 0x109000e
    field public static final int expandable_list_content = 17367041; // 0x1090001
    field public static final int list_content = 17367060; // 0x1090014
    field public static final int preference_category = 17367042; // 0x1090002
    field public static final int select_dialog_item = 17367057; // 0x1090011
    field public static final int select_dialog_multichoice = 17367059; // 0x1090013
    field public static final int select_dialog_singlechoice = 17367058; // 0x1090012
    field public static final int simple_dropdown_item_1line = 17367050; // 0x109000a
    field public static final int simple_expandable_list_item_1 = 17367046; // 0x1090006
    field public static final int simple_expandable_list_item_2 = 17367047; // 0x1090007
    field public static final int simple_gallery_item = 17367051; // 0x109000b
    field public static final int simple_list_item_1 = 17367043; // 0x1090003
    field public static final int simple_list_item_2 = 17367044; // 0x1090004
    field public static final int simple_list_item_activated_1 = 17367062; // 0x1090016
    field public static final int simple_list_item_activated_2 = 17367063; // 0x1090017
    field public static final int simple_list_item_checked = 17367045; // 0x1090005
    field public static final int simple_list_item_multiple_choice = 17367056; // 0x1090010
    field public static final int simple_list_item_single_choice = 17367055; // 0x109000f
    field public static final int simple_selectable_list_item = 17367061; // 0x1090015
    field public static final int simple_spinner_dropdown_item = 17367049; // 0x1090009
    field public static final int simple_spinner_item = 17367048; // 0x1090008
    field public static final int test_list_item = 17367052; // 0x109000c
    field public static final int two_line_list_item = 17367053; // 0x109000d
  }

  public static final class R.menu {
    ctor public R.menu();
  }

  public static final class R.mipmap {
    ctor public R.mipmap();
    field public static final int sym_def_app_icon = 17629184; // 0x10d0000
  }

  public static final class R.plurals {
    ctor public R.plurals();
  }

  public static final class R.raw {
    ctor public R.raw();
  }

  public static final class R.string {
    ctor public R.string();
    field public static final int VideoView_error_button = 17039376; // 0x1040010
    field public static final int VideoView_error_text_invalid_progressive_playback = 17039381; // 0x1040015
    field public static final int VideoView_error_text_unknown = 17039377; // 0x1040011
    field public static final int VideoView_error_title = 17039378; // 0x1040012
    field public static final int autofill = 17039386; // 0x104001a
    field public static final int cancel = 17039360; // 0x1040000
    field public static final int copy = 17039361; // 0x1040001
    field public static final int copyUrl = 17039362; // 0x1040002
    field public static final int cut = 17039363; // 0x1040003
    field public static final int defaultMsisdnAlphaTag = 17039365; // 0x1040005
    field public static final int defaultVoiceMailAlphaTag = 17039364; // 0x1040004
    field public static final int dialog_alert_title = 17039380; // 0x1040014
    field public static final int emptyPhoneNumber = 17039366; // 0x1040006
    field public static final int fingerprint_icon_content_description = 17039384; // 0x1040018
    field public static final int httpErrorBadUrl = 17039367; // 0x1040007
    field public static final int httpErrorUnsupportedScheme = 17039368; // 0x1040008
    field public static final int no = 17039369; // 0x1040009
    field public static final int ok = 17039370; // 0x104000a
    field public static final int paste = 17039371; // 0x104000b
    field public static final int paste_as_plain_text = 17039385; // 0x1040019
    field public static final int search_go = 17039372; // 0x104000c
    field public static final int selectAll = 17039373; // 0x104000d
    field public static final int selectTextMode = 17039382; // 0x1040016
    field public static final int status_bar_notification_info_overflow = 17039383; // 0x1040017
    field public static final int unknownName = 17039374; // 0x104000e
    field public static final int untitled = 17039375; // 0x104000f
    field public static final int yes = 17039379; // 0x1040013
  }

  public static final class R.style {
    ctor public R.style();
    field public static final int Animation = 16973824; // 0x1030000
    field public static final int Animation_Activity = 16973825; // 0x1030001
    field public static final int Animation_Dialog = 16973826; // 0x1030002
    field public static final int Animation_InputMethod = 16973910; // 0x1030056
    field public static final int Animation_Toast = 16973828; // 0x1030004
    field public static final int Animation_Translucent = 16973827; // 0x1030003
    field public static final int DeviceDefault_ButtonBar = 16974287; // 0x10301cf
    field public static final int DeviceDefault_ButtonBar_AlertDialog = 16974288; // 0x10301d0
    field public static final int DeviceDefault_Light_ButtonBar = 16974290; // 0x10301d2
    field public static final int DeviceDefault_Light_ButtonBar_AlertDialog = 16974291; // 0x10301d3
    field public static final int DeviceDefault_Light_SegmentedButton = 16974292; // 0x10301d4
    field public static final int DeviceDefault_SegmentedButton = 16974289; // 0x10301d1
    field public static final int Holo_ButtonBar = 16974053; // 0x10300e5
    field public static final int Holo_ButtonBar_AlertDialog = 16974055; // 0x10300e7
    field public static final int Holo_Light_ButtonBar = 16974054; // 0x10300e6
    field public static final int Holo_Light_ButtonBar_AlertDialog = 16974056; // 0x10300e8
    field public static final int Holo_Light_SegmentedButton = 16974058; // 0x10300ea
    field public static final int Holo_SegmentedButton = 16974057; // 0x10300e9
    field public static final int MediaButton = 16973879; // 0x1030037
    field public static final int MediaButton_Ffwd = 16973883; // 0x103003b
    field public static final int MediaButton_Next = 16973881; // 0x1030039
    field public static final int MediaButton_Pause = 16973885; // 0x103003d
    field public static final int MediaButton_Play = 16973882; // 0x103003a
    field public static final int MediaButton_Previous = 16973880; // 0x1030038
    field public static final int MediaButton_Rew = 16973884; // 0x103003c
    field public static final int TextAppearance = 16973886; // 0x103003e
    field public static final int TextAppearance_DeviceDefault = 16974253; // 0x10301ad
    field public static final int TextAppearance_DeviceDefault_DialogWindowTitle = 16974264; // 0x10301b8
    field public static final int TextAppearance_DeviceDefault_Inverse = 16974254; // 0x10301ae
    field public static final int TextAppearance_DeviceDefault_Large = 16974255; // 0x10301af
    field public static final int TextAppearance_DeviceDefault_Large_Inverse = 16974256; // 0x10301b0
    field public static final int TextAppearance_DeviceDefault_Medium = 16974257; // 0x10301b1
    field public static final int TextAppearance_DeviceDefault_Medium_Inverse = 16974258; // 0x10301b2
    field public static final int TextAppearance_DeviceDefault_SearchResult_Subtitle = 16974262; // 0x10301b6
    field public static final int TextAppearance_DeviceDefault_SearchResult_Title = 16974261; // 0x10301b5
    field public static final int TextAppearance_DeviceDefault_Small = 16974259; // 0x10301b3
    field public static final int TextAppearance_DeviceDefault_Small_Inverse = 16974260; // 0x10301b4
    field public static final int TextAppearance_DeviceDefault_Widget = 16974265; // 0x10301b9
    field public static final int TextAppearance_DeviceDefault_Widget_ActionBar_Menu = 16974286; // 0x10301ce
    field public static final int TextAppearance_DeviceDefault_Widget_ActionBar_Subtitle = 16974279; // 0x10301c7
    field @Deprecated public static final int TextAppearance_DeviceDefault_Widget_ActionBar_Subtitle_Inverse = 16974283; // 0x10301cb
    field public static final int TextAppearance_DeviceDefault_Widget_ActionBar_Title = 16974278; // 0x10301c6
    field @Deprecated public static final int TextAppearance_DeviceDefault_Widget_ActionBar_Title_Inverse = 16974282; // 0x10301ca
    field public static final int TextAppearance_DeviceDefault_Widget_ActionMode_Subtitle = 16974281; // 0x10301c9
    field @Deprecated public static final int TextAppearance_DeviceDefault_Widget_ActionMode_Subtitle_Inverse = 16974285; // 0x10301cd
    field public static final int TextAppearance_DeviceDefault_Widget_ActionMode_Title = 16974280; // 0x10301c8
    field @Deprecated public static final int TextAppearance_DeviceDefault_Widget_ActionMode_Title_Inverse = 16974284; // 0x10301cc
    field public static final int TextAppearance_DeviceDefault_Widget_Button = 16974266; // 0x10301ba
    field public static final int TextAppearance_DeviceDefault_Widget_DropDownHint = 16974271; // 0x10301bf
    field public static final int TextAppearance_DeviceDefault_Widget_DropDownItem = 16974272; // 0x10301c0
    field public static final int TextAppearance_DeviceDefault_Widget_EditText = 16974274; // 0x10301c2
    field public static final int TextAppearance_DeviceDefault_Widget_IconMenu_Item = 16974267; // 0x10301bb
    field public static final int TextAppearance_DeviceDefault_Widget_PopupMenu = 16974275; // 0x10301c3
    field public static final int TextAppearance_DeviceDefault_Widget_PopupMenu_Large = 16974276; // 0x10301c4
    field public static final int TextAppearance_DeviceDefault_Widget_PopupMenu_Small = 16974277; // 0x10301c5
    field public static final int TextAppearance_DeviceDefault_Widget_TabWidget = 16974268; // 0x10301bc
    field public static final int TextAppearance_DeviceDefault_Widget_TextView = 16974269; // 0x10301bd
    field public static final int TextAppearance_DeviceDefault_Widget_TextView_PopupMenu = 16974270; // 0x10301be
    field public static final int TextAppearance_DeviceDefault_Widget_TextView_SpinnerItem = 16974273; // 0x10301c1
    field public static final int TextAppearance_DeviceDefault_WindowTitle = 16974263; // 0x10301b7
    field public static final int TextAppearance_DialogWindowTitle = 16973889; // 0x1030041
    field public static final int TextAppearance_Holo = 16974075; // 0x10300fb
    field public static final int TextAppearance_Holo_DialogWindowTitle = 16974103; // 0x1030117
    field public static final int TextAppearance_Holo_Inverse = 16974076; // 0x10300fc
    field public static final int TextAppearance_Holo_Large = 16974077; // 0x10300fd
    field public static final int TextAppearance_Holo_Large_Inverse = 16974078; // 0x10300fe
    field public static final int TextAppearance_Holo_Medium = 16974079; // 0x10300ff
    field public static final int TextAppearance_Holo_Medium_Inverse = 16974080; // 0x1030100
    field public static final int TextAppearance_Holo_SearchResult_Subtitle = 16974084; // 0x1030104
    field public static final int TextAppearance_Holo_SearchResult_Title = 16974083; // 0x1030103
    field public static final int TextAppearance_Holo_Small = 16974081; // 0x1030101
    field public static final int TextAppearance_Holo_Small_Inverse = 16974082; // 0x1030102
    field public static final int TextAppearance_Holo_Widget = 16974085; // 0x1030105
    field public static final int TextAppearance_Holo_Widget_ActionBar_Menu = 16974112; // 0x1030120
    field public static final int TextAppearance_Holo_Widget_ActionBar_Subtitle = 16974099; // 0x1030113
    field public static final int TextAppearance_Holo_Widget_ActionBar_Subtitle_Inverse = 16974109; // 0x103011d
    field public static final int TextAppearance_Holo_Widget_ActionBar_Title = 16974098; // 0x1030112
    field public static final int TextAppearance_Holo_Widget_ActionBar_Title_Inverse = 16974108; // 0x103011c
    field public static final int TextAppearance_Holo_Widget_ActionMode_Subtitle = 16974101; // 0x1030115
    field public static final int TextAppearance_Holo_Widget_ActionMode_Subtitle_Inverse = 16974111; // 0x103011f
    field public static final int TextAppearance_Holo_Widget_ActionMode_Title = 16974100; // 0x1030114
    field public static final int TextAppearance_Holo_Widget_ActionMode_Title_Inverse = 16974110; // 0x103011e
    field public static final int TextAppearance_Holo_Widget_Button = 16974086; // 0x1030106
    field public static final int TextAppearance_Holo_Widget_DropDownHint = 16974091; // 0x103010b
    field public static final int TextAppearance_Holo_Widget_DropDownItem = 16974092; // 0x103010c
    field public static final int TextAppearance_Holo_Widget_EditText = 16974094; // 0x103010e
    field public static final int TextAppearance_Holo_Widget_IconMenu_Item = 16974087; // 0x1030107
    field public static final int TextAppearance_Holo_Widget_PopupMenu = 16974095; // 0x103010f
    field public static final int TextAppearance_Holo_Widget_PopupMenu_Large = 16974096; // 0x1030110
    field public static final int TextAppearance_Holo_Widget_PopupMenu_Small = 16974097; // 0x1030111
    field public static final int TextAppearance_Holo_Widget_TabWidget = 16974088; // 0x1030108
    field public static final int TextAppearance_Holo_Widget_TextView = 16974089; // 0x1030109
    field public static final int TextAppearance_Holo_Widget_TextView_PopupMenu = 16974090; // 0x103010a
    field public static final int TextAppearance_Holo_Widget_TextView_SpinnerItem = 16974093; // 0x103010d
    field public static final int TextAppearance_Holo_WindowTitle = 16974102; // 0x1030116
    field public static final int TextAppearance_Inverse = 16973887; // 0x103003f
    field public static final int TextAppearance_Large = 16973890; // 0x1030042
    field public static final int TextAppearance_Large_Inverse = 16973891; // 0x1030043
    field public static final int TextAppearance_Material = 16974317; // 0x10301ed
    field public static final int TextAppearance_Material_Body1 = 16974320; // 0x10301f0
    field public static final int TextAppearance_Material_Body2 = 16974319; // 0x10301ef
    field public static final int TextAppearance_Material_Button = 16974318; // 0x10301ee
    field public static final int TextAppearance_Material_Caption = 16974321; // 0x10301f1
    field public static final int TextAppearance_Material_DialogWindowTitle = 16974322; // 0x10301f2
    field public static final int TextAppearance_Material_Display1 = 16974326; // 0x10301f6
    field public static final int TextAppearance_Material_Display2 = 16974325; // 0x10301f5
    field public static final int TextAppearance_Material_Display3 = 16974324; // 0x10301f4
    field public static final int TextAppearance_Material_Display4 = 16974323; // 0x10301f3
    field public static final int TextAppearance_Material_Headline = 16974327; // 0x10301f7
    field public static final int TextAppearance_Material_Inverse = 16974328; // 0x10301f8
    field public static final int TextAppearance_Material_Large = 16974329; // 0x10301f9
    field public static final int TextAppearance_Material_Large_Inverse = 16974330; // 0x10301fa
    field public static final int TextAppearance_Material_Medium = 16974331; // 0x10301fb
    field public static final int TextAppearance_Material_Medium_Inverse = 16974332; // 0x10301fc
    field public static final int TextAppearance_Material_Menu = 16974333; // 0x10301fd
    field public static final int TextAppearance_Material_Notification = 16974334; // 0x10301fe
    field public static final int TextAppearance_Material_Notification_Emphasis = 16974335; // 0x10301ff
    field public static final int TextAppearance_Material_Notification_Info = 16974336; // 0x1030200
    field public static final int TextAppearance_Material_Notification_Line2 = 16974337; // 0x1030201
    field public static final int TextAppearance_Material_Notification_Time = 16974338; // 0x1030202
    field public static final int TextAppearance_Material_Notification_Title = 16974339; // 0x1030203
    field public static final int TextAppearance_Material_SearchResult_Subtitle = 16974340; // 0x1030204
    field public static final int TextAppearance_Material_SearchResult_Title = 16974341; // 0x1030205
    field public static final int TextAppearance_Material_Small = 16974342; // 0x1030206
    field public static final int TextAppearance_Material_Small_Inverse = 16974343; // 0x1030207
    field public static final int TextAppearance_Material_Subhead = 16974344; // 0x1030208
    field public static final int TextAppearance_Material_Title = 16974345; // 0x1030209
    field public static final int TextAppearance_Material_Widget = 16974347; // 0x103020b
    field public static final int TextAppearance_Material_Widget_ActionBar_Menu = 16974348; // 0x103020c
    field public static final int TextAppearance_Material_Widget_ActionBar_Subtitle = 16974349; // 0x103020d
    field public static final int TextAppearance_Material_Widget_ActionBar_Subtitle_Inverse = 16974350; // 0x103020e
    field public static final int TextAppearance_Material_Widget_ActionBar_Title = 16974351; // 0x103020f
    field public static final int TextAppearance_Material_Widget_ActionBar_Title_Inverse = 16974352; // 0x1030210
    field public static final int TextAppearance_Material_Widget_ActionMode_Subtitle = 16974353; // 0x1030211
    field public static final int TextAppearance_Material_Widget_ActionMode_Subtitle_Inverse = 16974354; // 0x1030212
    field public static final int TextAppearance_Material_Widget_ActionMode_Title = 16974355; // 0x1030213
    field public static final int TextAppearance_Material_Widget_ActionMode_Title_Inverse = 16974356; // 0x1030214
    field public static final int TextAppearance_Material_Widget_Button = 16974357; // 0x1030215
    field public static final int TextAppearance_Material_Widget_Button_Borderless_Colored = 16974559; // 0x10302df
    field public static final int TextAppearance_Material_Widget_Button_Colored = 16974558; // 0x10302de
    field public static final int TextAppearance_Material_Widget_Button_Inverse = 16974548; // 0x10302d4
    field public static final int TextAppearance_Material_Widget_DropDownHint = 16974358; // 0x1030216
    field public static final int TextAppearance_Material_Widget_DropDownItem = 16974359; // 0x1030217
    field public static final int TextAppearance_Material_Widget_EditText = 16974360; // 0x1030218
    field public static final int TextAppearance_Material_Widget_IconMenu_Item = 16974361; // 0x1030219
    field public static final int TextAppearance_Material_Widget_PopupMenu = 16974362; // 0x103021a
    field public static final int TextAppearance_Material_Widget_PopupMenu_Large = 16974363; // 0x103021b
    field public static final int TextAppearance_Material_Widget_PopupMenu_Small = 16974364; // 0x103021c
    field public static final int TextAppearance_Material_Widget_TabWidget = 16974365; // 0x103021d
    field public static final int TextAppearance_Material_Widget_TextView = 16974366; // 0x103021e
    field public static final int TextAppearance_Material_Widget_TextView_PopupMenu = 16974367; // 0x103021f
    field public static final int TextAppearance_Material_Widget_TextView_SpinnerItem = 16974368; // 0x1030220
    field public static final int TextAppearance_Material_Widget_Toolbar_Subtitle = 16974369; // 0x1030221
    field public static final int TextAppearance_Material_Widget_Toolbar_Title = 16974370; // 0x1030222
    field public static final int TextAppearance_Material_WindowTitle = 16974346; // 0x103020a
    field public static final int TextAppearance_Medium = 16973892; // 0x1030044
    field public static final int TextAppearance_Medium_Inverse = 16973893; // 0x1030045
    field public static final int TextAppearance_Small = 16973894; // 0x1030046
    field public static final int TextAppearance_Small_Inverse = 16973895; // 0x1030047
    field public static final int TextAppearance_StatusBar_EventContent = 16973927; // 0x1030067
    field public static final int TextAppearance_StatusBar_EventContent_Title = 16973928; // 0x1030068
    field public static final int TextAppearance_StatusBar_Icon = 16973926; // 0x1030066
    field public static final int TextAppearance_StatusBar_Title = 16973925; // 0x1030065
    field public static final int TextAppearance_SuggestionHighlight = 16974104; // 0x1030118
    field public static final int TextAppearance_Theme = 16973888; // 0x1030040
    field public static final int TextAppearance_Theme_Dialog = 16973896; // 0x1030048
    field public static final int TextAppearance_Widget = 16973897; // 0x1030049
    field public static final int TextAppearance_Widget_Button = 16973898; // 0x103004a
    field public static final int TextAppearance_Widget_DropDownHint = 16973904; // 0x1030050
    field public static final int TextAppearance_Widget_DropDownItem = 16973905; // 0x1030051
    field public static final int TextAppearance_Widget_EditText = 16973900; // 0x103004c
    field public static final int TextAppearance_Widget_IconMenu_Item = 16973899; // 0x103004b
    field public static final int TextAppearance_Widget_PopupMenu_Large = 16973952; // 0x1030080
    field public static final int TextAppearance_Widget_PopupMenu_Small = 16973953; // 0x1030081
    field public static final int TextAppearance_Widget_TabWidget = 16973901; // 0x103004d
    field public static final int TextAppearance_Widget_TextView = 16973902; // 0x103004e
    field public static final int TextAppearance_Widget_TextView_PopupMenu = 16973903; // 0x103004f
    field public static final int TextAppearance_Widget_TextView_SpinnerItem = 16973906; // 0x1030052
    field public static final int TextAppearance_WindowTitle = 16973907; // 0x1030053
    field public static final int Theme = 16973829; // 0x1030005
    field public static final int ThemeOverlay = 16974407; // 0x1030247
    field public static final int ThemeOverlay_Material = 16974408; // 0x1030248
    field public static final int ThemeOverlay_Material_ActionBar = 16974409; // 0x1030249
    field public static final int ThemeOverlay_Material_Dark = 16974411; // 0x103024b
    field public static final int ThemeOverlay_Material_Dark_ActionBar = 16974412; // 0x103024c
    field public static final int ThemeOverlay_Material_Dialog = 16974550; // 0x10302d6
    field public static final int ThemeOverlay_Material_Dialog_Alert = 16974551; // 0x10302d7
    field public static final int ThemeOverlay_Material_Light = 16974410; // 0x103024a
    field public static final int Theme_Black = 16973832; // 0x1030008
    field public static final int Theme_Black_NoTitleBar = 16973833; // 0x1030009
    field public static final int Theme_Black_NoTitleBar_Fullscreen = 16973834; // 0x103000a
    field public static final int Theme_DeviceDefault = 16974120; // 0x1030128
    field public static final int Theme_DeviceDefault_Dialog = 16974126; // 0x103012e
    field public static final int Theme_DeviceDefault_DialogWhenLarge = 16974134; // 0x1030136
    field public static final int Theme_DeviceDefault_DialogWhenLarge_NoActionBar = 16974135; // 0x1030137
    field public static final int Theme_DeviceDefault_Dialog_Alert = 16974545; // 0x10302d1
    field public static final int Theme_DeviceDefault_Dialog_MinWidth = 16974127; // 0x103012f
    field public static final int Theme_DeviceDefault_Dialog_NoActionBar = 16974128; // 0x1030130
    field public static final int Theme_DeviceDefault_Dialog_NoActionBar_MinWidth = 16974129; // 0x1030131
    field public static final int Theme_DeviceDefault_InputMethod = 16974142; // 0x103013e
    field public static final int Theme_DeviceDefault_Light = 16974123; // 0x103012b
    field public static final int Theme_DeviceDefault_Light_DarkActionBar = 16974143; // 0x103013f
    field public static final int Theme_DeviceDefault_Light_Dialog = 16974130; // 0x1030132
    field public static final int Theme_DeviceDefault_Light_DialogWhenLarge = 16974136; // 0x1030138
    field public static final int Theme_DeviceDefault_Light_DialogWhenLarge_NoActionBar = 16974137; // 0x1030139
    field public static final int Theme_DeviceDefault_Light_Dialog_Alert = 16974546; // 0x10302d2
    field public static final int Theme_DeviceDefault_Light_Dialog_MinWidth = 16974131; // 0x1030133
    field public static final int Theme_DeviceDefault_Light_Dialog_NoActionBar = 16974132; // 0x1030134
    field public static final int Theme_DeviceDefault_Light_Dialog_NoActionBar_MinWidth = 16974133; // 0x1030135
    field public static final int Theme_DeviceDefault_Light_NoActionBar = 16974124; // 0x103012c
    field public static final int Theme_DeviceDefault_Light_NoActionBar_Fullscreen = 16974125; // 0x103012d
    field public static final int Theme_DeviceDefault_Light_NoActionBar_Overscan = 16974304; // 0x10301e0
    field public static final int Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor = 16974308; // 0x10301e4
    field public static final int Theme_DeviceDefault_Light_Panel = 16974139; // 0x103013b
    field public static final int Theme_DeviceDefault_NoActionBar = 16974121; // 0x1030129
    field public static final int Theme_DeviceDefault_NoActionBar_Fullscreen = 16974122; // 0x103012a
    field public static final int Theme_DeviceDefault_NoActionBar_Overscan = 16974303; // 0x10301df
    field public static final int Theme_DeviceDefault_NoActionBar_TranslucentDecor = 16974307; // 0x10301e3
    field public static final int Theme_DeviceDefault_Panel = 16974138; // 0x103013a
    field public static final int Theme_DeviceDefault_Settings = 16974371; // 0x1030223
    field public static final int Theme_DeviceDefault_Wallpaper = 16974140; // 0x103013c
    field public static final int Theme_DeviceDefault_Wallpaper_NoTitleBar = 16974141; // 0x103013d
    field public static final int Theme_Dialog = 16973835; // 0x103000b
    field @Deprecated public static final int Theme_Holo = 16973931; // 0x103006b
    field @Deprecated public static final int Theme_Holo_Dialog = 16973935; // 0x103006f
    field @Deprecated public static final int Theme_Holo_DialogWhenLarge = 16973943; // 0x1030077
    field @Deprecated public static final int Theme_Holo_DialogWhenLarge_NoActionBar = 16973944; // 0x1030078
    field @Deprecated public static final int Theme_Holo_Dialog_MinWidth = 16973936; // 0x1030070
    field @Deprecated public static final int Theme_Holo_Dialog_NoActionBar = 16973937; // 0x1030071
    field @Deprecated public static final int Theme_Holo_Dialog_NoActionBar_MinWidth = 16973938; // 0x1030072
    field @Deprecated public static final int Theme_Holo_InputMethod = 16973951; // 0x103007f
    field @Deprecated public static final int Theme_Holo_Light = 16973934; // 0x103006e
    field @Deprecated public static final int Theme_Holo_Light_DarkActionBar = 16974105; // 0x1030119
    field @Deprecated public static final int Theme_Holo_Light_Dialog = 16973939; // 0x1030073
    field @Deprecated public static final int Theme_Holo_Light_DialogWhenLarge = 16973945; // 0x1030079
    field @Deprecated public static final int Theme_Holo_Light_DialogWhenLarge_NoActionBar = 16973946; // 0x103007a
    field @Deprecated public static final int Theme_Holo_Light_Dialog_MinWidth = 16973940; // 0x1030074
    field @Deprecated public static final int Theme_Holo_Light_Dialog_NoActionBar = 16973941; // 0x1030075
    field @Deprecated public static final int Theme_Holo_Light_Dialog_NoActionBar_MinWidth = 16973942; // 0x1030076
    field @Deprecated public static final int Theme_Holo_Light_NoActionBar = 16974064; // 0x10300f0
    field @Deprecated public static final int Theme_Holo_Light_NoActionBar_Fullscreen = 16974065; // 0x10300f1
    field @Deprecated public static final int Theme_Holo_Light_NoActionBar_Overscan = 16974302; // 0x10301de
    field @Deprecated public static final int Theme_Holo_Light_NoActionBar_TranslucentDecor = 16974306; // 0x10301e2
    field @Deprecated public static final int Theme_Holo_Light_Panel = 16973948; // 0x103007c
    field @Deprecated public static final int Theme_Holo_NoActionBar = 16973932; // 0x103006c
    field @Deprecated public static final int Theme_Holo_NoActionBar_Fullscreen = 16973933; // 0x103006d
    field @Deprecated public static final int Theme_Holo_NoActionBar_Overscan = 16974301; // 0x10301dd
    field @Deprecated public static final int Theme_Holo_NoActionBar_TranslucentDecor = 16974305; // 0x10301e1
    field @Deprecated public static final int Theme_Holo_Panel = 16973947; // 0x103007b
    field @Deprecated public static final int Theme_Holo_Wallpaper = 16973949; // 0x103007d
    field @Deprecated public static final int Theme_Holo_Wallpaper_NoTitleBar = 16973950; // 0x103007e
    field public static final int Theme_InputMethod = 16973908; // 0x1030054
    field public static final int Theme_Light = 16973836; // 0x103000c
    field public static final int Theme_Light_NoTitleBar = 16973837; // 0x103000d
    field public static final int Theme_Light_NoTitleBar_Fullscreen = 16973838; // 0x103000e
    field public static final int Theme_Light_Panel = 16973914; // 0x103005a
    field public static final int Theme_Light_WallpaperSettings = 16973922; // 0x1030062
    field public static final int Theme_Material = 16974372; // 0x1030224
    field public static final int Theme_Material_Dialog = 16974373; // 0x1030225
    field public static final int Theme_Material_DialogWhenLarge = 16974379; // 0x103022b
    field public static final int Theme_Material_DialogWhenLarge_NoActionBar = 16974380; // 0x103022c
    field public static final int Theme_Material_Dialog_Alert = 16974374; // 0x1030226
    field public static final int Theme_Material_Dialog_MinWidth = 16974375; // 0x1030227
    field public static final int Theme_Material_Dialog_NoActionBar = 16974376; // 0x1030228
    field public static final int Theme_Material_Dialog_NoActionBar_MinWidth = 16974377; // 0x1030229
    field public static final int Theme_Material_Dialog_Presentation = 16974378; // 0x103022a
    field public static final int Theme_Material_InputMethod = 16974381; // 0x103022d
    field public static final int Theme_Material_Light = 16974391; // 0x1030237
    field public static final int Theme_Material_Light_DarkActionBar = 16974392; // 0x1030238
    field public static final int Theme_Material_Light_Dialog = 16974393; // 0x1030239
    field public static final int Theme_Material_Light_DialogWhenLarge = 16974399; // 0x103023f
    field public static final int Theme_Material_Light_DialogWhenLarge_DarkActionBar = 16974552; // 0x10302d8
    field public static final int Theme_Material_Light_DialogWhenLarge_NoActionBar = 16974400; // 0x1030240
    field public static final int Theme_Material_Light_Dialog_Alert = 16974394; // 0x103023a
    field public static final int Theme_Material_Light_Dialog_MinWidth = 16974395; // 0x103023b
    field public static final int Theme_Material_Light_Dialog_NoActionBar = 16974396; // 0x103023c
    field public static final int Theme_Material_Light_Dialog_NoActionBar_MinWidth = 16974397; // 0x103023d
    field public static final int Theme_Material_Light_Dialog_Presentation = 16974398; // 0x103023e
    field public static final int Theme_Material_Light_LightStatusBar = 16974549; // 0x10302d5
    field public static final int Theme_Material_Light_NoActionBar = 16974401; // 0x1030241
    field public static final int Theme_Material_Light_NoActionBar_Fullscreen = 16974402; // 0x1030242
    field public static final int Theme_Material_Light_NoActionBar_Overscan = 16974403; // 0x1030243
    field public static final int Theme_Material_Light_NoActionBar_TranslucentDecor = 16974404; // 0x1030244
    field public static final int Theme_Material_Light_Panel = 16974405; // 0x1030245
    field public static final int Theme_Material_Light_Voice = 16974406; // 0x1030246
    field public static final int Theme_Material_NoActionBar = 16974382; // 0x103022e
    field public static final int Theme_Material_NoActionBar_Fullscreen = 16974383; // 0x103022f
    field public static final int Theme_Material_NoActionBar_Overscan = 16974384; // 0x1030230
    field public static final int Theme_Material_NoActionBar_TranslucentDecor = 16974385; // 0x1030231
    field public static final int Theme_Material_Panel = 16974386; // 0x1030232
    field public static final int Theme_Material_Settings = 16974387; // 0x1030233
    field public static final int Theme_Material_Voice = 16974388; // 0x1030234
    field public static final int Theme_Material_Wallpaper = 16974389; // 0x1030235
    field public static final int Theme_Material_Wallpaper_NoTitleBar = 16974390; // 0x1030236
    field public static final int Theme_NoDisplay = 16973909; // 0x1030055
    field public static final int Theme_NoTitleBar = 16973830; // 0x1030006
    field public static final int Theme_NoTitleBar_Fullscreen = 16973831; // 0x1030007
    field public static final int Theme_NoTitleBar_OverlayActionModes = 16973930; // 0x103006a
    field public static final int Theme_Panel = 16973913; // 0x1030059
    field public static final int Theme_Translucent = 16973839; // 0x103000f
    field public static final int Theme_Translucent_NoTitleBar = 16973840; // 0x1030010
    field public static final int Theme_Translucent_NoTitleBar_Fullscreen = 16973841; // 0x1030011
    field public static final int Theme_Wallpaper = 16973918; // 0x103005e
    field public static final int Theme_WallpaperSettings = 16973921; // 0x1030061
    field public static final int Theme_Wallpaper_NoTitleBar = 16973919; // 0x103005f
    field public static final int Theme_Wallpaper_NoTitleBar_Fullscreen = 16973920; // 0x1030060
    field public static final int Theme_WithActionBar = 16973929; // 0x1030069
    field public static final int Widget = 16973842; // 0x1030012
    field public static final int Widget_AbsListView = 16973843; // 0x1030013
    field public static final int Widget_ActionBar = 16973954; // 0x1030082
    field public static final int Widget_ActionBar_TabBar = 16974068; // 0x10300f4
    field public static final int Widget_ActionBar_TabText = 16974067; // 0x10300f3
    field public static final int Widget_ActionBar_TabView = 16974066; // 0x10300f2
    field public static final int Widget_ActionButton = 16973956; // 0x1030084
    field public static final int Widget_ActionButton_CloseMode = 16973960; // 0x1030088
    field public static final int Widget_ActionButton_Overflow = 16973959; // 0x1030087
    field public static final int Widget_AutoCompleteTextView = 16973863; // 0x1030027
    field public static final int Widget_Button = 16973844; // 0x1030014
    field public static final int Widget_Button_Inset = 16973845; // 0x1030015
    field public static final int Widget_Button_Small = 16973846; // 0x1030016
    field public static final int Widget_Button_Toggle = 16973847; // 0x1030017
    field public static final int Widget_CalendarView = 16974059; // 0x10300eb
    field public static final int Widget_CompoundButton = 16973848; // 0x1030018
    field public static final int Widget_CompoundButton_CheckBox = 16973849; // 0x1030019
    field public static final int Widget_CompoundButton_RadioButton = 16973850; // 0x103001a
    field public static final int Widget_CompoundButton_Star = 16973851; // 0x103001b
    field public static final int Widget_DatePicker = 16974062; // 0x10300ee
    field public static final int Widget_DeviceDefault = 16974144; // 0x1030140
    field public static final int Widget_DeviceDefault_ActionBar = 16974187; // 0x103016b
    field public static final int Widget_DeviceDefault_ActionBar_Solid = 16974195; // 0x1030173
    field public static final int Widget_DeviceDefault_ActionBar_TabBar = 16974194; // 0x1030172
    field public static final int Widget_DeviceDefault_ActionBar_TabText = 16974193; // 0x1030171
    field public static final int Widget_DeviceDefault_ActionBar_TabView = 16974192; // 0x1030170
    field public static final int Widget_DeviceDefault_ActionButton = 16974182; // 0x1030166
    field public static final int Widget_DeviceDefault_ActionButton_CloseMode = 16974186; // 0x103016a
    field public static final int Widget_DeviceDefault_ActionButton_Overflow = 16974183; // 0x1030167
    field public static final int Widget_DeviceDefault_ActionButton_TextButton = 16974184; // 0x1030168
    field public static final int Widget_DeviceDefault_ActionMode = 16974185; // 0x1030169
    field public static final int Widget_DeviceDefault_AutoCompleteTextView = 16974151; // 0x1030147
    field public static final int Widget_DeviceDefault_Button = 16974145; // 0x1030141
    field public static final int Widget_DeviceDefault_Button_Borderless = 16974188; // 0x103016c
    field public static final int Widget_DeviceDefault_Button_Borderless_Colored = 16974561; // 0x10302e1
    field public static final int Widget_DeviceDefault_Button_Borderless_Small = 16974149; // 0x1030145
    field public static final int Widget_DeviceDefault_Button_Colored = 16974560; // 0x10302e0
    field public static final int Widget_DeviceDefault_Button_Inset = 16974147; // 0x1030143
    field public static final int Widget_DeviceDefault_Button_Small = 16974146; // 0x1030142
    field public static final int Widget_DeviceDefault_Button_Toggle = 16974148; // 0x1030144
    field public static final int Widget_DeviceDefault_CalendarView = 16974190; // 0x103016e
    field public static final int Widget_DeviceDefault_CheckedTextView = 16974299; // 0x10301db
    field public static final int Widget_DeviceDefault_CompoundButton_CheckBox = 16974152; // 0x1030148
    field public static final int Widget_DeviceDefault_CompoundButton_RadioButton = 16974169; // 0x1030159
    field public static final int Widget_DeviceDefault_CompoundButton_Star = 16974173; // 0x103015d
    field public static final int Widget_DeviceDefault_DatePicker = 16974191; // 0x103016f
    field public static final int Widget_DeviceDefault_DropDownItem = 16974177; // 0x1030161
    field public static final int Widget_DeviceDefault_DropDownItem_Spinner = 16974178; // 0x1030162
    field public static final int Widget_DeviceDefault_EditText = 16974154; // 0x103014a
    field public static final int Widget_DeviceDefault_ExpandableListView = 16974155; // 0x103014b
    field public static final int Widget_DeviceDefault_FastScroll = 16974313; // 0x10301e9
    field public static final int Widget_DeviceDefault_GridView = 16974156; // 0x103014c
    field public static final int Widget_DeviceDefault_HorizontalScrollView = 16974171; // 0x103015b
    field public static final int Widget_DeviceDefault_ImageButton = 16974157; // 0x103014d
    field public static final int Widget_DeviceDefault_Light = 16974196; // 0x1030174
    field public static final int Widget_DeviceDefault_Light_ActionBar = 16974243; // 0x10301a3
    field public static final int Widget_DeviceDefault_Light_ActionBar_Solid = 16974247; // 0x10301a7
    field @Deprecated public static final int Widget_DeviceDefault_Light_ActionBar_Solid_Inverse = 16974248; // 0x10301a8
    field public static final int Widget_DeviceDefault_Light_ActionBar_TabBar = 16974246; // 0x10301a6
    field @Deprecated public static final int Widget_DeviceDefault_Light_ActionBar_TabBar_Inverse = 16974249; // 0x10301a9
    field public static final int Widget_DeviceDefault_Light_ActionBar_TabText = 16974245; // 0x10301a5
    field @Deprecated public static final int Widget_DeviceDefault_Light_ActionBar_TabText_Inverse = 16974251; // 0x10301ab
    field public static final int Widget_DeviceDefault_Light_ActionBar_TabView = 16974244; // 0x10301a4
    field @Deprecated public static final int Widget_DeviceDefault_Light_ActionBar_TabView_Inverse = 16974250; // 0x10301aa
    field public static final int Widget_DeviceDefault_Light_ActionButton = 16974239; // 0x103019f
    field public static final int Widget_DeviceDefault_Light_ActionButton_CloseMode = 16974242; // 0x10301a2
    field public static final int Widget_DeviceDefault_Light_ActionButton_Overflow = 16974240; // 0x10301a0
    field public static final int Widget_DeviceDefault_Light_ActionMode = 16974241; // 0x10301a1
    field @Deprecated public static final int Widget_DeviceDefault_Light_ActionMode_Inverse = 16974252; // 0x10301ac
    field public static final int Widget_DeviceDefault_Light_AutoCompleteTextView = 16974203; // 0x103017b
    field public static final int Widget_DeviceDefault_Light_Button = 16974197; // 0x1030175
    field public static final int Widget_DeviceDefault_Light_Button_Borderless_Small = 16974201; // 0x1030179
    field public static final int Widget_DeviceDefault_Light_Button_Inset = 16974199; // 0x1030177
    field public static final int Widget_DeviceDefault_Light_Button_Small = 16974198; // 0x1030176
    field public static final int Widget_DeviceDefault_Light_Button_Toggle = 16974200; // 0x1030178
    field public static final int Widget_DeviceDefault_Light_CalendarView = 16974238; // 0x103019e
    field public static final int Widget_DeviceDefault_Light_CheckedTextView = 16974300; // 0x10301dc
    field public static final int Widget_DeviceDefault_Light_CompoundButton_CheckBox = 16974204; // 0x103017c
    field public static final int Widget_DeviceDefault_Light_CompoundButton_RadioButton = 16974224; // 0x1030190
    field public static final int Widget_DeviceDefault_Light_CompoundButton_Star = 16974228; // 0x1030194
    field public static final int Widget_DeviceDefault_Light_DropDownItem = 16974232; // 0x1030198
    field public static final int Widget_DeviceDefault_Light_DropDownItem_Spinner = 16974233; // 0x1030199
    field public static final int Widget_DeviceDefault_Light_EditText = 16974206; // 0x103017e
    field public static final int Widget_DeviceDefault_Light_ExpandableListView = 16974207; // 0x103017f
    field public static final int Widget_DeviceDefault_Light_FastScroll = 16974315; // 0x10301eb
    field public static final int Widget_DeviceDefault_Light_GridView = 16974208; // 0x1030180
    field public static final int Widget_DeviceDefault_Light_HorizontalScrollView = 16974226; // 0x1030192
    field public static final int Widget_DeviceDefault_Light_ImageButton = 16974209; // 0x1030181
    field public static final int Widget_DeviceDefault_Light_ListPopupWindow = 16974235; // 0x103019b
    field public static final int Widget_DeviceDefault_Light_ListView = 16974210; // 0x1030182
    field public static final int Widget_DeviceDefault_Light_ListView_DropDown = 16974205; // 0x103017d
    field public static final int Widget_DeviceDefault_Light_MediaRouteButton = 16974296; // 0x10301d8
    field public static final int Widget_DeviceDefault_Light_PopupMenu = 16974236; // 0x103019c
    field public static final int Widget_DeviceDefault_Light_PopupWindow = 16974211; // 0x1030183
    field public static final int Widget_DeviceDefault_Light_ProgressBar = 16974212; // 0x1030184
    field public static final int Widget_DeviceDefault_Light_ProgressBar_Horizontal = 16974213; // 0x1030185
    field public static final int Widget_DeviceDefault_Light_ProgressBar_Inverse = 16974217; // 0x1030189
    field public static final int Widget_DeviceDefault_Light_ProgressBar_Large = 16974216; // 0x1030188
    field public static final int Widget_DeviceDefault_Light_ProgressBar_Large_Inverse = 16974219; // 0x103018b
    field public static final int Widget_DeviceDefault_Light_ProgressBar_Small = 16974214; // 0x1030186
    field public static final int Widget_DeviceDefault_Light_ProgressBar_Small_Inverse = 16974218; // 0x103018a
    field public static final int Widget_DeviceDefault_Light_ProgressBar_Small_Title = 16974215; // 0x1030187
    field public static final int Widget_DeviceDefault_Light_RatingBar = 16974221; // 0x103018d
    field public static final int Widget_DeviceDefault_Light_RatingBar_Indicator = 16974222; // 0x103018e
    field public static final int Widget_DeviceDefault_Light_RatingBar_Small = 16974223; // 0x103018f
    field public static final int Widget_DeviceDefault_Light_ScrollView = 16974225; // 0x1030191
    field public static final int Widget_DeviceDefault_Light_SeekBar = 16974220; // 0x103018c
    field public static final int Widget_DeviceDefault_Light_Spinner = 16974227; // 0x1030193
    field public static final int Widget_DeviceDefault_Light_StackView = 16974316; // 0x10301ec
    field public static final int Widget_DeviceDefault_Light_Tab = 16974237; // 0x103019d
    field public static final int Widget_DeviceDefault_Light_TabWidget = 16974229; // 0x1030195
    field public static final int Widget_DeviceDefault_Light_TextView = 16974202; // 0x103017a
    field public static final int Widget_DeviceDefault_Light_TextView_SpinnerItem = 16974234; // 0x103019a
    field public static final int Widget_DeviceDefault_Light_WebTextView = 16974230; // 0x1030196
    field public static final int Widget_DeviceDefault_Light_WebView = 16974231; // 0x1030197
    field public static final int Widget_DeviceDefault_ListPopupWindow = 16974180; // 0x1030164
    field public static final int Widget_DeviceDefault_ListView = 16974158; // 0x103014e
    field public static final int Widget_DeviceDefault_ListView_DropDown = 16974153; // 0x1030149
    field public static final int Widget_DeviceDefault_MediaRouteButton = 16974295; // 0x10301d7
    field public static final int Widget_DeviceDefault_PopupMenu = 16974181; // 0x1030165
    field public static final int Widget_DeviceDefault_PopupWindow = 16974159; // 0x103014f
    field public static final int Widget_DeviceDefault_ProgressBar = 16974160; // 0x1030150
    field public static final int Widget_DeviceDefault_ProgressBar_Horizontal = 16974161; // 0x1030151
    field public static final int Widget_DeviceDefault_ProgressBar_Large = 16974164; // 0x1030154
    field public static final int Widget_DeviceDefault_ProgressBar_Small = 16974162; // 0x1030152
    field public static final int Widget_DeviceDefault_ProgressBar_Small_Title = 16974163; // 0x1030153
    field public static final int Widget_DeviceDefault_RatingBar = 16974166; // 0x1030156
    field public static final int Widget_DeviceDefault_RatingBar_Indicator = 16974167; // 0x1030157
    field public static final int Widget_DeviceDefault_RatingBar_Small = 16974168; // 0x1030158
    field public static final int Widget_DeviceDefault_ScrollView = 16974170; // 0x103015a
    field public static final int Widget_DeviceDefault_SeekBar = 16974165; // 0x1030155
    field public static final int Widget_DeviceDefault_Spinner = 16974172; // 0x103015c
    field public static final int Widget_DeviceDefault_StackView = 16974314; // 0x10301ea
    field public static final int Widget_DeviceDefault_Tab = 16974189; // 0x103016d
    field public static final int Widget_DeviceDefault_TabWidget = 16974174; // 0x103015e
    field public static final int Widget_DeviceDefault_TextView = 16974150; // 0x1030146
    field public static final int Widget_DeviceDefault_TextView_SpinnerItem = 16974179; // 0x1030163
    field public static final int Widget_DeviceDefault_WebTextView = 16974175; // 0x103015f
    field public static final int Widget_DeviceDefault_WebView = 16974176; // 0x1030160
    field public static final int Widget_DropDownItem = 16973867; // 0x103002b
    field public static final int Widget_DropDownItem_Spinner = 16973868; // 0x103002c
    field public static final int Widget_EditText = 16973859; // 0x1030023
    field public static final int Widget_ExpandableListView = 16973860; // 0x1030024
    field public static final int Widget_FastScroll = 16974309; // 0x10301e5
    field public static final int Widget_FragmentBreadCrumbs = 16973961; // 0x1030089
    field public static final int Widget_Gallery = 16973877; // 0x1030035
    field public static final int Widget_GridView = 16973874; // 0x1030032
    field public static final int Widget_Holo = 16973962; // 0x103008a
    field public static final int Widget_Holo_ActionBar = 16974004; // 0x10300b4
    field public static final int Widget_Holo_ActionBar_Solid = 16974113; // 0x1030121
    field public static final int Widget_Holo_ActionBar_TabBar = 16974071; // 0x10300f7
    field public static final int Widget_Holo_ActionBar_TabText = 16974070; // 0x10300f6
    field public static final int Widget_Holo_ActionBar_TabView = 16974069; // 0x10300f5
    field public static final int Widget_Holo_ActionButton = 16973999; // 0x10300af
    field public static final int Widget_Holo_ActionButton_CloseMode = 16974003; // 0x10300b3
    field public static final int Widget_Holo_ActionButton_Overflow = 16974000; // 0x10300b0
    field public static final int Widget_Holo_ActionButton_TextButton = 16974001; // 0x10300b1
    field public static final int Widget_Holo_ActionMode = 16974002; // 0x10300b2
    field public static final int Widget_Holo_AutoCompleteTextView = 16973968; // 0x1030090
    field public static final int Widget_Holo_Button = 16973963; // 0x103008b
    field public static final int Widget_Holo_Button_Borderless = 16974050; // 0x10300e2
    field public static final int Widget_Holo_Button_Borderless_Small = 16974106; // 0x103011a
    field public static final int Widget_Holo_Button_Inset = 16973965; // 0x103008d
    field public static final int Widget_Holo_Button_Small = 16973964; // 0x103008c
    field public static final int Widget_Holo_Button_Toggle = 16973966; // 0x103008e
    field public static final int Widget_Holo_CalendarView = 16974060; // 0x10300ec
    field public static final int Widget_Holo_CheckedTextView = 16974297; // 0x10301d9
    field public static final int Widget_Holo_CompoundButton_CheckBox = 16973969; // 0x1030091
    field public static final int Widget_Holo_CompoundButton_RadioButton = 16973986; // 0x10300a2
    field public static final int Widget_Holo_CompoundButton_Star = 16973990; // 0x10300a6
    field public static final int Widget_Holo_DatePicker = 16974063; // 0x10300ef
    field public static final int Widget_Holo_DropDownItem = 16973994; // 0x10300aa
    field public static final int Widget_Holo_DropDownItem_Spinner = 16973995; // 0x10300ab
    field public static final int Widget_Holo_EditText = 16973971; // 0x1030093
    field public static final int Widget_Holo_ExpandableListView = 16973972; // 0x1030094
    field public static final int Widget_Holo_GridView = 16973973; // 0x1030095
    field public static final int Widget_Holo_HorizontalScrollView = 16973988; // 0x10300a4
    field public static final int Widget_Holo_ImageButton = 16973974; // 0x1030096
    field public static final int Widget_Holo_Light = 16974005; // 0x10300b5
    field public static final int Widget_Holo_Light_ActionBar = 16974049; // 0x10300e1
    field public static final int Widget_Holo_Light_ActionBar_Solid = 16974114; // 0x1030122
    field public static final int Widget_Holo_Light_ActionBar_Solid_Inverse = 16974115; // 0x1030123
    field public static final int Widget_Holo_Light_ActionBar_TabBar = 16974074; // 0x10300fa
    field public static final int Widget_Holo_Light_ActionBar_TabBar_Inverse = 16974116; // 0x1030124
    field public static final int Widget_Holo_Light_ActionBar_TabText = 16974073; // 0x10300f9
    field public static final int Widget_Holo_Light_ActionBar_TabText_Inverse = 16974118; // 0x1030126
    field public static final int Widget_Holo_Light_ActionBar_TabView = 16974072; // 0x10300f8
    field public static final int Widget_Holo_Light_ActionBar_TabView_Inverse = 16974117; // 0x1030125
    field public static final int Widget_Holo_Light_ActionButton = 16974045; // 0x10300dd
    field public static final int Widget_Holo_Light_ActionButton_CloseMode = 16974048; // 0x10300e0
    field public static final int Widget_Holo_Light_ActionButton_Overflow = 16974046; // 0x10300de
    field public static final int Widget_Holo_Light_ActionMode = 16974047; // 0x10300df
    field public static final int Widget_Holo_Light_ActionMode_Inverse = 16974119; // 0x1030127
    field public static final int Widget_Holo_Light_AutoCompleteTextView = 16974011; // 0x10300bb
    field public static final int Widget_Holo_Light_Button = 16974006; // 0x10300b6
    field public static final int Widget_Holo_Light_Button_Borderless_Small = 16974107; // 0x103011b
    field public static final int Widget_Holo_Light_Button_Inset = 16974008; // 0x10300b8
    field public static final int Widget_Holo_Light_Button_Small = 16974007; // 0x10300b7
    field public static final int Widget_Holo_Light_Button_Toggle = 16974009; // 0x10300b9
    field public static final int Widget_Holo_Light_CalendarView = 16974061; // 0x10300ed
    field public static final int Widget_Holo_Light_CheckedTextView = 16974298; // 0x10301da
    field public static final int Widget_Holo_Light_CompoundButton_CheckBox = 16974012; // 0x10300bc
    field public static final int Widget_Holo_Light_CompoundButton_RadioButton = 16974032; // 0x10300d0
    field public static final int Widget_Holo_Light_CompoundButton_Star = 16974036; // 0x10300d4
    field public static final int Widget_Holo_Light_DropDownItem = 16974040; // 0x10300d8
    field public static final int Widget_Holo_Light_DropDownItem_Spinner = 16974041; // 0x10300d9
    field public static final int Widget_Holo_Light_EditText = 16974014; // 0x10300be
    field public static final int Widget_Holo_Light_ExpandableListView = 16974015; // 0x10300bf
    field public static final int Widget_Holo_Light_GridView = 16974016; // 0x10300c0
    field public static final int Widget_Holo_Light_HorizontalScrollView = 16974034; // 0x10300d2
    field public static final int Widget_Holo_Light_ImageButton = 16974017; // 0x10300c1
    field public static final int Widget_Holo_Light_ListPopupWindow = 16974043; // 0x10300db
    field public static final int Widget_Holo_Light_ListView = 16974018; // 0x10300c2
    field public static final int Widget_Holo_Light_ListView_DropDown = 16974013; // 0x10300bd
    field public static final int Widget_Holo_Light_MediaRouteButton = 16974294; // 0x10301d6
    field public static final int Widget_Holo_Light_PopupMenu = 16974044; // 0x10300dc
    field public static final int Widget_Holo_Light_PopupWindow = 16974019; // 0x10300c3
    field public static final int Widget_Holo_Light_ProgressBar = 16974020; // 0x10300c4
    field public static final int Widget_Holo_Light_ProgressBar_Horizontal = 16974021; // 0x10300c5
    field public static final int Widget_Holo_Light_ProgressBar_Inverse = 16974025; // 0x10300c9
    field public static final int Widget_Holo_Light_ProgressBar_Large = 16974024; // 0x10300c8
    field public static final int Widget_Holo_Light_ProgressBar_Large_Inverse = 16974027; // 0x10300cb
    field public static final int Widget_Holo_Light_ProgressBar_Small = 16974022; // 0x10300c6
    field public static final int Widget_Holo_Light_ProgressBar_Small_Inverse = 16974026; // 0x10300ca
    field public static final int Widget_Holo_Light_ProgressBar_Small_Title = 16974023; // 0x10300c7
    field public static final int Widget_Holo_Light_RatingBar = 16974029; // 0x10300cd
    field public static final int Widget_Holo_Light_RatingBar_Indicator = 16974030; // 0x10300ce
    field public static final int Widget_Holo_Light_RatingBar_Small = 16974031; // 0x10300cf
    field public static final int Widget_Holo_Light_ScrollView = 16974033; // 0x10300d1
    field public static final int Widget_Holo_Light_SeekBar = 16974028; // 0x10300cc
    field public static final int Widget_Holo_Light_Spinner = 16974035; // 0x10300d3
    field public static final int Widget_Holo_Light_Tab = 16974052; // 0x10300e4
    field public static final int Widget_Holo_Light_TabWidget = 16974037; // 0x10300d5
    field public static final int Widget_Holo_Light_TextView = 16974010; // 0x10300ba
    field public static final int Widget_Holo_Light_TextView_SpinnerItem = 16974042; // 0x10300da
    field public static final int Widget_Holo_Light_WebTextView = 16974038; // 0x10300d6
    field public static final int Widget_Holo_Light_WebView = 16974039; // 0x10300d7
    field public static final int Widget_Holo_ListPopupWindow = 16973997; // 0x10300ad
    field public static final int Widget_Holo_ListView = 16973975; // 0x1030097
    field public static final int Widget_Holo_ListView_DropDown = 16973970; // 0x1030092
    field public static final int Widget_Holo_MediaRouteButton = 16974293; // 0x10301d5
    field public static final int Widget_Holo_PopupMenu = 16973998; // 0x10300ae
    field public static final int Widget_Holo_PopupWindow = 16973976; // 0x1030098
    field public static final int Widget_Holo_ProgressBar = 16973977; // 0x1030099
    field public static final int Widget_Holo_ProgressBar_Horizontal = 16973978; // 0x103009a
    field public static final int Widget_Holo_ProgressBar_Large = 16973981; // 0x103009d
    field public static final int Widget_Holo_ProgressBar_Small = 16973979; // 0x103009b
    field public static final int Widget_Holo_ProgressBar_Small_Title = 16973980; // 0x103009c
    field public static final int Widget_Holo_RatingBar = 16973983; // 0x103009f
    field public static final int Widget_Holo_RatingBar_Indicator = 16973984; // 0x10300a0
    field public static final int Widget_Holo_RatingBar_Small = 16973985; // 0x10300a1
    field public static final int Widget_Holo_ScrollView = 16973987; // 0x10300a3
    field public static final int Widget_Holo_SeekBar = 16973982; // 0x103009e
    field public static final int Widget_Holo_Spinner = 16973989; // 0x10300a5
    field public static final int Widget_Holo_Tab = 16974051; // 0x10300e3
    field public static final int Widget_Holo_TabWidget = 16973991; // 0x10300a7
    field public static final int Widget_Holo_TextView = 16973967; // 0x103008f
    field public static final int Widget_Holo_TextView_SpinnerItem = 16973996; // 0x10300ac
    field public static final int Widget_Holo_WebTextView = 16973992; // 0x10300a8
    field public static final int Widget_Holo_WebView = 16973993; // 0x10300a9
    field public static final int Widget_ImageButton = 16973862; // 0x1030026
    field public static final int Widget_ImageWell = 16973861; // 0x1030025
    field public static final int Widget_KeyboardView = 16973911; // 0x1030057
    field public static final int Widget_ListPopupWindow = 16973957; // 0x1030085
    field public static final int Widget_ListView = 16973870; // 0x103002e
    field public static final int Widget_ListView_DropDown = 16973872; // 0x1030030
    field public static final int Widget_ListView_Menu = 16973873; // 0x1030031
    field public static final int Widget_ListView_White = 16973871; // 0x103002f
    field public static final int Widget_Material = 16974413; // 0x103024d
    field public static final int Widget_Material_ActionBar = 16974414; // 0x103024e
    field public static final int Widget_Material_ActionBar_Solid = 16974415; // 0x103024f
    field public static final int Widget_Material_ActionBar_TabBar = 16974416; // 0x1030250
    field public static final int Widget_Material_ActionBar_TabText = 16974417; // 0x1030251
    field public static final int Widget_Material_ActionBar_TabView = 16974418; // 0x1030252
    field public static final int Widget_Material_ActionButton = 16974419; // 0x1030253
    field public static final int Widget_Material_ActionButton_CloseMode = 16974420; // 0x1030254
    field public static final int Widget_Material_ActionButton_Overflow = 16974421; // 0x1030255
    field public static final int Widget_Material_ActionMode = 16974422; // 0x1030256
    field public static final int Widget_Material_AutoCompleteTextView = 16974423; // 0x1030257
    field public static final int Widget_Material_Button = 16974424; // 0x1030258
    field public static final int Widget_Material_ButtonBar = 16974431; // 0x103025f
    field public static final int Widget_Material_ButtonBar_AlertDialog = 16974432; // 0x1030260
    field public static final int Widget_Material_Button_Borderless = 16974425; // 0x1030259
    field public static final int Widget_Material_Button_Borderless_Colored = 16974426; // 0x103025a
    field public static final int Widget_Material_Button_Borderless_Small = 16974427; // 0x103025b
    field public static final int Widget_Material_Button_Colored = 16974547; // 0x10302d3
    field public static final int Widget_Material_Button_Inset = 16974428; // 0x103025c
    field public static final int Widget_Material_Button_Small = 16974429; // 0x103025d
    field public static final int Widget_Material_Button_Toggle = 16974430; // 0x103025e
    field public static final int Widget_Material_CalendarView = 16974433; // 0x1030261
    field public static final int Widget_Material_CheckedTextView = 16974434; // 0x1030262
    field public static final int Widget_Material_CompoundButton_CheckBox = 16974435; // 0x1030263
    field public static final int Widget_Material_CompoundButton_RadioButton = 16974436; // 0x1030264
    field public static final int Widget_Material_CompoundButton_Star = 16974437; // 0x1030265
    field public static final int Widget_Material_CompoundButton_Switch = 16974554; // 0x10302da
    field public static final int Widget_Material_DatePicker = 16974438; // 0x1030266
    field public static final int Widget_Material_DropDownItem = 16974439; // 0x1030267
    field public static final int Widget_Material_DropDownItem_Spinner = 16974440; // 0x1030268
    field public static final int Widget_Material_EditText = 16974441; // 0x1030269
    field public static final int Widget_Material_ExpandableListView = 16974442; // 0x103026a
    field public static final int Widget_Material_FastScroll = 16974443; // 0x103026b
    field public static final int Widget_Material_GridView = 16974444; // 0x103026c
    field public static final int Widget_Material_HorizontalScrollView = 16974445; // 0x103026d
    field public static final int Widget_Material_ImageButton = 16974446; // 0x103026e
    field public static final int Widget_Material_Light = 16974478; // 0x103028e
    field public static final int Widget_Material_Light_ActionBar = 16974479; // 0x103028f
    field public static final int Widget_Material_Light_ActionBar_Solid = 16974480; // 0x1030290
    field public static final int Widget_Material_Light_ActionBar_TabBar = 16974481; // 0x1030291
    field public static final int Widget_Material_Light_ActionBar_TabText = 16974482; // 0x1030292
    field public static final int Widget_Material_Light_ActionBar_TabView = 16974483; // 0x1030293
    field public static final int Widget_Material_Light_ActionButton = 16974484; // 0x1030294
    field public static final int Widget_Material_Light_ActionButton_CloseMode = 16974485; // 0x1030295
    field public static final int Widget_Material_Light_ActionButton_Overflow = 16974486; // 0x1030296
    field public static final int Widget_Material_Light_ActionMode = 16974487; // 0x1030297
    field public static final int Widget_Material_Light_AutoCompleteTextView = 16974488; // 0x1030298
    field public static final int Widget_Material_Light_Button = 16974489; // 0x1030299
    field public static final int Widget_Material_Light_ButtonBar = 16974496; // 0x10302a0
    field public static final int Widget_Material_Light_ButtonBar_AlertDialog = 16974497; // 0x10302a1
    field public static final int Widget_Material_Light_Button_Borderless = 16974490; // 0x103029a
    field public static final int Widget_Material_Light_Button_Borderless_Colored = 16974491; // 0x103029b
    field public static final int Widget_Material_Light_Button_Borderless_Small = 16974492; // 0x103029c
    field public static final int Widget_Material_Light_Button_Inset = 16974493; // 0x103029d
    field public static final int Widget_Material_Light_Button_Small = 16974494; // 0x103029e
    field public static final int Widget_Material_Light_Button_Toggle = 16974495; // 0x103029f
    field public static final int Widget_Material_Light_CalendarView = 16974498; // 0x10302a2
    field public static final int Widget_Material_Light_CheckedTextView = 16974499; // 0x10302a3
    field public static final int Widget_Material_Light_CompoundButton_CheckBox = 16974500; // 0x10302a4
    field public static final int Widget_Material_Light_CompoundButton_RadioButton = 16974501; // 0x10302a5
    field public static final int Widget_Material_Light_CompoundButton_Star = 16974502; // 0x10302a6
    field public static final int Widget_Material_Light_CompoundButton_Switch = 16974555; // 0x10302db
    field public static final int Widget_Material_Light_DatePicker = 16974503; // 0x10302a7
    field public static final int Widget_Material_Light_DropDownItem = 16974504; // 0x10302a8
    field public static final int Widget_Material_Light_DropDownItem_Spinner = 16974505; // 0x10302a9
    field public static final int Widget_Material_Light_EditText = 16974506; // 0x10302aa
    field public static final int Widget_Material_Light_ExpandableListView = 16974507; // 0x10302ab
    field public static final int Widget_Material_Light_FastScroll = 16974508; // 0x10302ac
    field public static final int Widget_Material_Light_GridView = 16974509; // 0x10302ad
    field public static final int Widget_Material_Light_HorizontalScrollView = 16974510; // 0x10302ae
    field public static final int Widget_Material_Light_ImageButton = 16974511; // 0x10302af
    field public static final int Widget_Material_Light_ListPopupWindow = 16974512; // 0x10302b0
    field public static final int Widget_Material_Light_ListView = 16974513; // 0x10302b1
    field public static final int Widget_Material_Light_ListView_DropDown = 16974514; // 0x10302b2
    field public static final int Widget_Material_Light_MediaRouteButton = 16974515; // 0x10302b3
    field public static final int Widget_Material_Light_NumberPicker = 16974557; // 0x10302dd
    field public static final int Widget_Material_Light_PopupMenu = 16974516; // 0x10302b4
    field public static final int Widget_Material_Light_PopupMenu_Overflow = 16974517; // 0x10302b5
    field public static final int Widget_Material_Light_PopupWindow = 16974518; // 0x10302b6
    field public static final int Widget_Material_Light_ProgressBar = 16974519; // 0x10302b7
    field public static final int Widget_Material_Light_ProgressBar_Horizontal = 16974520; // 0x10302b8
    field public static final int Widget_Material_Light_ProgressBar_Inverse = 16974521; // 0x10302b9
    field public static final int Widget_Material_Light_ProgressBar_Large = 16974522; // 0x10302ba
    field public static final int Widget_Material_Light_ProgressBar_Large_Inverse = 16974523; // 0x10302bb
    field public static final int Widget_Material_Light_ProgressBar_Small = 16974524; // 0x10302bc
    field public static final int Widget_Material_Light_ProgressBar_Small_Inverse = 16974525; // 0x10302bd
    field public static final int Widget_Material_Light_ProgressBar_Small_Title = 16974526; // 0x10302be
    field public static final int Widget_Material_Light_RatingBar = 16974527; // 0x10302bf
    field public static final int Widget_Material_Light_RatingBar_Indicator = 16974528; // 0x10302c0
    field public static final int Widget_Material_Light_RatingBar_Small = 16974529; // 0x10302c1
    field public static final int Widget_Material_Light_ScrollView = 16974530; // 0x10302c2
    field public static final int Widget_Material_Light_SearchView = 16974531; // 0x10302c3
    field public static final int Widget_Material_Light_SeekBar = 16974532; // 0x10302c4
    field public static final int Widget_Material_Light_SegmentedButton = 16974533; // 0x10302c5
    field public static final int Widget_Material_Light_Spinner = 16974535; // 0x10302c7
    field public static final int Widget_Material_Light_Spinner_Underlined = 16974536; // 0x10302c8
    field public static final int Widget_Material_Light_StackView = 16974534; // 0x10302c6
    field public static final int Widget_Material_Light_Tab = 16974537; // 0x10302c9
    field public static final int Widget_Material_Light_TabWidget = 16974538; // 0x10302ca
    field public static final int Widget_Material_Light_TextView = 16974539; // 0x10302cb
    field public static final int Widget_Material_Light_TextView_SpinnerItem = 16974540; // 0x10302cc
    field public static final int Widget_Material_Light_TimePicker = 16974541; // 0x10302cd
    field public static final int Widget_Material_Light_WebTextView = 16974542; // 0x10302ce
    field public static final int Widget_Material_Light_WebView = 16974543; // 0x10302cf
    field public static final int Widget_Material_ListPopupWindow = 16974447; // 0x103026f
    field public static final int Widget_Material_ListView = 16974448; // 0x1030270
    field public static final int Widget_Material_ListView_DropDown = 16974449; // 0x1030271
    field public static final int Widget_Material_MediaRouteButton = 16974450; // 0x1030272
    field public static final int Widget_Material_NumberPicker = 16974556; // 0x10302dc
    field public static final int Widget_Material_PopupMenu = 16974451; // 0x1030273
    field public static final int Widget_Material_PopupMenu_Overflow = 16974452; // 0x1030274
    field public static final int Widget_Material_PopupWindow = 16974453; // 0x1030275
    field public static final int Widget_Material_ProgressBar = 16974454; // 0x1030276
    field public static final int Widget_Material_ProgressBar_Horizontal = 16974455; // 0x1030277
    field public static final int Widget_Material_ProgressBar_Large = 16974456; // 0x1030278
    field public static final int Widget_Material_ProgressBar_Small = 16974457; // 0x1030279
    field public static final int Widget_Material_ProgressBar_Small_Title = 16974458; // 0x103027a
    field public static final int Widget_Material_RatingBar = 16974459; // 0x103027b
    field public static final int Widget_Material_RatingBar_Indicator = 16974460; // 0x103027c
    field public static final int Widget_Material_RatingBar_Small = 16974461; // 0x103027d
    field public static final int Widget_Material_ScrollView = 16974462; // 0x103027e
    field public static final int Widget_Material_SearchView = 16974463; // 0x103027f
    field public static final int Widget_Material_SeekBar = 16974464; // 0x1030280
    field public static final int Widget_Material_SeekBar_Discrete = 16974553; // 0x10302d9
    field public static final int Widget_Material_SegmentedButton = 16974465; // 0x1030281
    field public static final int Widget_Material_Spinner = 16974467; // 0x1030283
    field public static final int Widget_Material_Spinner_Underlined = 16974468; // 0x1030284
    field public static final int Widget_Material_StackView = 16974466; // 0x1030282
    field public static final int Widget_Material_Tab = 16974469; // 0x1030285
    field public static final int Widget_Material_TabWidget = 16974470; // 0x1030286
    field public static final int Widget_Material_TextView = 16974471; // 0x1030287
    field public static final int Widget_Material_TextView_SpinnerItem = 16974472; // 0x1030288
    field public static final int Widget_Material_TimePicker = 16974473; // 0x1030289
    field public static final int Widget_Material_Toolbar = 16974474; // 0x103028a
    field public static final int Widget_Material_Toolbar_Button_Navigation = 16974475; // 0x103028b
    field public static final int Widget_Material_WebTextView = 16974476; // 0x103028c
    field public static final int Widget_Material_WebView = 16974477; // 0x103028d
    field public static final int Widget_PopupMenu = 16973958; // 0x1030086
    field public static final int Widget_PopupWindow = 16973878; // 0x1030036
    field public static final int Widget_ProgressBar = 16973852; // 0x103001c
    field public static final int Widget_ProgressBar_Horizontal = 16973855; // 0x103001f
    field public static final int Widget_ProgressBar_Inverse = 16973915; // 0x103005b
    field public static final int Widget_ProgressBar_Large = 16973853; // 0x103001d
    field public static final int Widget_ProgressBar_Large_Inverse = 16973916; // 0x103005c
    field public static final int Widget_ProgressBar_Small = 16973854; // 0x103001e
    field public static final int Widget_ProgressBar_Small_Inverse = 16973917; // 0x103005d
    field public static final int Widget_RatingBar = 16973857; // 0x1030021
    field public static final int Widget_ScrollView = 16973869; // 0x103002d
    field public static final int Widget_SeekBar = 16973856; // 0x1030020
    field public static final int Widget_Spinner = 16973864; // 0x1030028
    field public static final int Widget_Spinner_DropDown = 16973955; // 0x1030083
    field public static final int Widget_StackView = 16974310; // 0x10301e6
    field public static final int Widget_TabWidget = 16973876; // 0x1030034
    field public static final int Widget_TextView = 16973858; // 0x1030022
    field public static final int Widget_TextView_PopupMenu = 16973865; // 0x1030029
    field public static final int Widget_TextView_SpinnerItem = 16973866; // 0x103002a
    field public static final int Widget_Toolbar = 16974311; // 0x10301e7
    field public static final int Widget_Toolbar_Button_Navigation = 16974312; // 0x10301e8
    field public static final int Widget_WebView = 16973875; // 0x1030033
  }

  public static final class R.transition {
    ctor public R.transition();
    field public static final int explode = 17760259; // 0x10f0003
    field public static final int fade = 17760258; // 0x10f0002
    field public static final int move = 17760257; // 0x10f0001
    field public static final int no_transition = 17760256; // 0x10f0000
    field public static final int slide_bottom = 17760260; // 0x10f0004
    field public static final int slide_left = 17760263; // 0x10f0007
    field public static final int slide_right = 17760262; // 0x10f0006
    field public static final int slide_top = 17760261; // 0x10f0005
  }

  public static final class R.xml {
    ctor public R.xml();
  }

}

package android.accessibilityservice {

  public final class AccessibilityButtonController {
    method public boolean isAccessibilityButtonAvailable();
    method public void registerAccessibilityButtonCallback(@NonNull android.accessibilityservice.AccessibilityButtonController.AccessibilityButtonCallback);
    method public void registerAccessibilityButtonCallback(@NonNull android.accessibilityservice.AccessibilityButtonController.AccessibilityButtonCallback, @NonNull android.os.Handler);
    method public void unregisterAccessibilityButtonCallback(@NonNull android.accessibilityservice.AccessibilityButtonController.AccessibilityButtonCallback);
  }

  public abstract static class AccessibilityButtonController.AccessibilityButtonCallback {
    ctor public AccessibilityButtonController.AccessibilityButtonCallback();
    method public void onAvailabilityChanged(android.accessibilityservice.AccessibilityButtonController, boolean);
    method public void onClicked(android.accessibilityservice.AccessibilityButtonController);
  }

  public abstract class AccessibilityService extends android.app.Service {
    ctor public AccessibilityService();
    method public final void disableSelf();
    method public final boolean dispatchGesture(@NonNull android.accessibilityservice.GestureDescription, @Nullable android.accessibilityservice.AccessibilityService.GestureResultCallback, @Nullable android.os.Handler);
    method public android.view.accessibility.AccessibilityNodeInfo findFocus(int);
    method @NonNull public final android.accessibilityservice.AccessibilityButtonController getAccessibilityButtonController();
    method @RequiresPermission(android.Manifest.permission.USE_FINGERPRINT) @NonNull public final android.accessibilityservice.FingerprintGestureController getFingerprintGestureController();
    method @NonNull public final android.accessibilityservice.AccessibilityService.MagnificationController getMagnificationController();
    method public android.view.accessibility.AccessibilityNodeInfo getRootInActiveWindow();
    method public final android.accessibilityservice.AccessibilityServiceInfo getServiceInfo();
    method @NonNull public final android.accessibilityservice.AccessibilityService.SoftKeyboardController getSoftKeyboardController();
    method public java.util.List<android.view.accessibility.AccessibilityWindowInfo> getWindows();
    method public abstract void onAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public final android.os.IBinder onBind(android.content.Intent);
    method protected boolean onGesture(int);
    method public abstract void onInterrupt();
    method protected boolean onKeyEvent(android.view.KeyEvent);
    method protected void onServiceConnected();
    method public final boolean performGlobalAction(int);
    method public final void setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo);
    field public static final int GESTURE_SWIPE_DOWN = 2; // 0x2
    field public static final int GESTURE_SWIPE_DOWN_AND_LEFT = 15; // 0xf
    field public static final int GESTURE_SWIPE_DOWN_AND_RIGHT = 16; // 0x10
    field public static final int GESTURE_SWIPE_DOWN_AND_UP = 8; // 0x8
    field public static final int GESTURE_SWIPE_LEFT = 3; // 0x3
    field public static final int GESTURE_SWIPE_LEFT_AND_DOWN = 10; // 0xa
    field public static final int GESTURE_SWIPE_LEFT_AND_RIGHT = 5; // 0x5
    field public static final int GESTURE_SWIPE_LEFT_AND_UP = 9; // 0x9
    field public static final int GESTURE_SWIPE_RIGHT = 4; // 0x4
    field public static final int GESTURE_SWIPE_RIGHT_AND_DOWN = 12; // 0xc
    field public static final int GESTURE_SWIPE_RIGHT_AND_LEFT = 6; // 0x6
    field public static final int GESTURE_SWIPE_RIGHT_AND_UP = 11; // 0xb
    field public static final int GESTURE_SWIPE_UP = 1; // 0x1
    field public static final int GESTURE_SWIPE_UP_AND_DOWN = 7; // 0x7
    field public static final int GESTURE_SWIPE_UP_AND_LEFT = 13; // 0xd
    field public static final int GESTURE_SWIPE_UP_AND_RIGHT = 14; // 0xe
    field public static final int GLOBAL_ACTION_BACK = 1; // 0x1
    field public static final int GLOBAL_ACTION_HOME = 2; // 0x2
    field public static final int GLOBAL_ACTION_LOCK_SCREEN = 8; // 0x8
    field public static final int GLOBAL_ACTION_NOTIFICATIONS = 4; // 0x4
    field public static final int GLOBAL_ACTION_POWER_DIALOG = 6; // 0x6
    field public static final int GLOBAL_ACTION_QUICK_SETTINGS = 5; // 0x5
    field public static final int GLOBAL_ACTION_RECENTS = 3; // 0x3
    field public static final int GLOBAL_ACTION_TAKE_SCREENSHOT = 9; // 0x9
    field public static final int GLOBAL_ACTION_TOGGLE_SPLIT_SCREEN = 7; // 0x7
    field public static final String SERVICE_INTERFACE = "android.accessibilityservice.AccessibilityService";
    field public static final String SERVICE_META_DATA = "android.accessibilityservice";
    field public static final int SHOW_MODE_AUTO = 0; // 0x0
    field public static final int SHOW_MODE_HIDDEN = 1; // 0x1
  }

  public abstract static class AccessibilityService.GestureResultCallback {
    ctor public AccessibilityService.GestureResultCallback();
    method public void onCancelled(android.accessibilityservice.GestureDescription);
    method public void onCompleted(android.accessibilityservice.GestureDescription);
  }

  public static final class AccessibilityService.MagnificationController {
    method public void addListener(@NonNull android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener);
    method public void addListener(@NonNull android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener, @Nullable android.os.Handler);
    method public float getCenterX();
    method public float getCenterY();
    method @NonNull public android.graphics.Region getMagnificationRegion();
    method public float getScale();
    method public boolean removeListener(@NonNull android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener);
    method public boolean reset(boolean);
    method public boolean setCenter(float, float, boolean);
    method public boolean setScale(float, boolean);
  }

  public static interface AccessibilityService.MagnificationController.OnMagnificationChangedListener {
    method public void onMagnificationChanged(@NonNull android.accessibilityservice.AccessibilityService.MagnificationController, @NonNull android.graphics.Region, float, float, float);
  }

  public static final class AccessibilityService.SoftKeyboardController {
    method public void addOnShowModeChangedListener(@NonNull android.accessibilityservice.AccessibilityService.SoftKeyboardController.OnShowModeChangedListener);
    method public void addOnShowModeChangedListener(@NonNull android.accessibilityservice.AccessibilityService.SoftKeyboardController.OnShowModeChangedListener, @Nullable android.os.Handler);
    method public int getShowMode();
    method public boolean removeOnShowModeChangedListener(@NonNull android.accessibilityservice.AccessibilityService.SoftKeyboardController.OnShowModeChangedListener);
    method public boolean setShowMode(int);
  }

  public static interface AccessibilityService.SoftKeyboardController.OnShowModeChangedListener {
    method public void onShowModeChanged(@NonNull android.accessibilityservice.AccessibilityService.SoftKeyboardController, int);
  }

  public class AccessibilityServiceInfo implements android.os.Parcelable {
    ctor public AccessibilityServiceInfo();
    method public static String capabilityToString(int);
    method public int describeContents();
    method public static String feedbackTypeToString(int);
    method public static String flagToString(int);
    method @Deprecated public boolean getCanRetrieveWindowContent();
    method public int getCapabilities();
    method @Deprecated public String getDescription();
    method public String getId();
    method public android.content.pm.ResolveInfo getResolveInfo();
    method public String getSettingsActivityName();
    method public String loadDescription(android.content.pm.PackageManager);
    method public CharSequence loadSummary(android.content.pm.PackageManager);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CAPABILITY_CAN_CONTROL_MAGNIFICATION = 16; // 0x10
    field public static final int CAPABILITY_CAN_PERFORM_GESTURES = 32; // 0x20
    field @Deprecated public static final int CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 4; // 0x4
    field public static final int CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS = 8; // 0x8
    field public static final int CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES = 64; // 0x40
    field public static final int CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION = 2; // 0x2
    field public static final int CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT = 1; // 0x1
    field public static final android.os.Parcelable.Creator<android.accessibilityservice.AccessibilityServiceInfo> CREATOR;
    field public static final int DEFAULT = 1; // 0x1
    field public static final int FEEDBACK_ALL_MASK = -1; // 0xffffffff
    field public static final int FEEDBACK_AUDIBLE = 4; // 0x4
    field public static final int FEEDBACK_BRAILLE = 32; // 0x20
    field public static final int FEEDBACK_GENERIC = 16; // 0x10
    field public static final int FEEDBACK_HAPTIC = 2; // 0x2
    field public static final int FEEDBACK_SPOKEN = 1; // 0x1
    field public static final int FEEDBACK_VISUAL = 8; // 0x8
    field public static final int FLAG_ENABLE_ACCESSIBILITY_VOLUME = 128; // 0x80
    field public static final int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 2; // 0x2
    field public static final int FLAG_REPORT_VIEW_IDS = 16; // 0x10
    field public static final int FLAG_REQUEST_ACCESSIBILITY_BUTTON = 256; // 0x100
    field @Deprecated public static final int FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 8; // 0x8
    field public static final int FLAG_REQUEST_FILTER_KEY_EVENTS = 32; // 0x20
    field public static final int FLAG_REQUEST_FINGERPRINT_GESTURES = 512; // 0x200
    field public static final int FLAG_REQUEST_TOUCH_EXPLORATION_MODE = 4; // 0x4
    field public static final int FLAG_RETRIEVE_INTERACTIVE_WINDOWS = 64; // 0x40
    field public int eventTypes;
    field public int feedbackType;
    field public int flags;
    field public long notificationTimeout;
    field public String[] packageNames;
  }

  public final class FingerprintGestureController {
    method public boolean isGestureDetectionAvailable();
    method public void registerFingerprintGestureCallback(@NonNull android.accessibilityservice.FingerprintGestureController.FingerprintGestureCallback, @Nullable android.os.Handler);
    method public void unregisterFingerprintGestureCallback(android.accessibilityservice.FingerprintGestureController.FingerprintGestureCallback);
    field public static final int FINGERPRINT_GESTURE_SWIPE_DOWN = 8; // 0x8
    field public static final int FINGERPRINT_GESTURE_SWIPE_LEFT = 2; // 0x2
    field public static final int FINGERPRINT_GESTURE_SWIPE_RIGHT = 1; // 0x1
    field public static final int FINGERPRINT_GESTURE_SWIPE_UP = 4; // 0x4
  }

  public abstract static class FingerprintGestureController.FingerprintGestureCallback {
    ctor public FingerprintGestureController.FingerprintGestureCallback();
    method public void onGestureDetected(int);
    method public void onGestureDetectionAvailabilityChanged(boolean);
  }

  public final class GestureDescription {
    method public static long getMaxGestureDuration();
    method public static int getMaxStrokeCount();
    method public android.accessibilityservice.GestureDescription.StrokeDescription getStroke(@IntRange(from=0) int);
    method public int getStrokeCount();
  }

  public static class GestureDescription.Builder {
    ctor public GestureDescription.Builder();
    method public android.accessibilityservice.GestureDescription.Builder addStroke(@NonNull android.accessibilityservice.GestureDescription.StrokeDescription);
    method public android.accessibilityservice.GestureDescription build();
  }

  public static class GestureDescription.StrokeDescription {
    ctor public GestureDescription.StrokeDescription(@NonNull android.graphics.Path, @IntRange(from=0) long, @IntRange(from=0) long);
    ctor public GestureDescription.StrokeDescription(@NonNull android.graphics.Path, @IntRange(from=0) long, @IntRange(from=0) long, boolean);
    method public android.accessibilityservice.GestureDescription.StrokeDescription continueStroke(android.graphics.Path, long, long, boolean);
    method public long getDuration();
    method public android.graphics.Path getPath();
    method public long getStartTime();
    method public boolean willContinue();
  }

}

package android.accounts {

  public abstract class AbstractAccountAuthenticator {
    ctor public AbstractAccountAuthenticator(android.content.Context);
    method public abstract android.os.Bundle addAccount(android.accounts.AccountAuthenticatorResponse, String, String, String[], android.os.Bundle) throws android.accounts.NetworkErrorException;
    method public android.os.Bundle addAccountFromCredentials(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, android.os.Bundle) throws android.accounts.NetworkErrorException;
    method public abstract android.os.Bundle confirmCredentials(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, android.os.Bundle) throws android.accounts.NetworkErrorException;
    method public abstract android.os.Bundle editProperties(android.accounts.AccountAuthenticatorResponse, String);
    method public android.os.Bundle finishSession(android.accounts.AccountAuthenticatorResponse, String, android.os.Bundle) throws android.accounts.NetworkErrorException;
    method public android.os.Bundle getAccountCredentialsForCloning(android.accounts.AccountAuthenticatorResponse, android.accounts.Account) throws android.accounts.NetworkErrorException;
    method public android.os.Bundle getAccountRemovalAllowed(android.accounts.AccountAuthenticatorResponse, android.accounts.Account) throws android.accounts.NetworkErrorException;
    method public abstract android.os.Bundle getAuthToken(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, String, android.os.Bundle) throws android.accounts.NetworkErrorException;
    method public abstract String getAuthTokenLabel(String);
    method public final android.os.IBinder getIBinder();
    method public abstract android.os.Bundle hasFeatures(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, String[]) throws android.accounts.NetworkErrorException;
    method public android.os.Bundle isCredentialsUpdateSuggested(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, String) throws android.accounts.NetworkErrorException;
    method public android.os.Bundle startAddAccountSession(android.accounts.AccountAuthenticatorResponse, String, String, String[], android.os.Bundle) throws android.accounts.NetworkErrorException;
    method public android.os.Bundle startUpdateCredentialsSession(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, String, android.os.Bundle) throws android.accounts.NetworkErrorException;
    method public abstract android.os.Bundle updateCredentials(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, String, android.os.Bundle) throws android.accounts.NetworkErrorException;
    field public static final String KEY_CUSTOM_TOKEN_EXPIRY = "android.accounts.expiry";
  }

  public class Account implements android.os.Parcelable {
    ctor public Account(String, String);
    ctor public Account(android.os.Parcel);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.accounts.Account> CREATOR;
    field public final String name;
    field public final String type;
  }

  public class AccountAuthenticatorActivity extends android.app.Activity {
    ctor public AccountAuthenticatorActivity();
    method public final void setAccountAuthenticatorResult(android.os.Bundle);
  }

  public class AccountAuthenticatorResponse implements android.os.Parcelable {
    ctor public AccountAuthenticatorResponse(android.os.Parcel);
    method public int describeContents();
    method public void onError(int, String);
    method public void onRequestContinued();
    method public void onResult(android.os.Bundle);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.accounts.AccountAuthenticatorResponse> CREATOR;
  }

  public class AccountManager {
    method @RequiresPermission(value="android.permission.MANAGE_ACCOUNTS", apis="..22") public android.accounts.AccountManagerFuture<android.os.Bundle> addAccount(String, String, String[], android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method @RequiresPermission(value="android.permission.AUTHENTICATE_ACCOUNTS", apis="..22") public boolean addAccountExplicitly(android.accounts.Account, String, android.os.Bundle);
    method public boolean addAccountExplicitly(android.accounts.Account, String, android.os.Bundle, java.util.Map<java.lang.String,java.lang.Integer>);
    method @RequiresPermission(value="android.permission.GET_ACCOUNTS", apis="..22") public void addOnAccountsUpdatedListener(android.accounts.OnAccountsUpdateListener, android.os.Handler, boolean);
    method public void addOnAccountsUpdatedListener(android.accounts.OnAccountsUpdateListener, android.os.Handler, boolean, String[]);
    method @RequiresPermission(value="android.permission.USE_CREDENTIALS", apis="..22") public String blockingGetAuthToken(android.accounts.Account, String, boolean) throws android.accounts.AuthenticatorException, java.io.IOException, android.accounts.OperationCanceledException;
    method @RequiresPermission(value="android.permission.MANAGE_ACCOUNTS", apis="..22") public void clearPassword(android.accounts.Account);
    method @RequiresPermission(value="android.permission.MANAGE_ACCOUNTS", apis="..22") public android.accounts.AccountManagerFuture<android.os.Bundle> confirmCredentials(android.accounts.Account, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method @RequiresPermission(value="android.permission.MANAGE_ACCOUNTS", apis="..22") public android.accounts.AccountManagerFuture<android.os.Bundle> editProperties(String, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method public android.accounts.AccountManagerFuture<android.os.Bundle> finishSession(android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method public static android.accounts.AccountManager get(android.content.Context);
    method public int getAccountVisibility(android.accounts.Account, String);
    method @NonNull @RequiresPermission(value="android.permission.GET_ACCOUNTS", apis="..22") public android.accounts.Account[] getAccounts();
    method public java.util.Map<android.accounts.Account,java.lang.Integer> getAccountsAndVisibilityForPackage(String, String);
    method @NonNull @RequiresPermission(value="android.permission.GET_ACCOUNTS", apis="..22") public android.accounts.Account[] getAccountsByType(String);
    method public android.accounts.AccountManagerFuture<android.accounts.Account[]> getAccountsByTypeAndFeatures(String, String[], android.accounts.AccountManagerCallback<android.accounts.Account[]>, android.os.Handler);
    method @NonNull public android.accounts.Account[] getAccountsByTypeForPackage(String, String);
    method @RequiresPermission(value="android.permission.USE_CREDENTIALS", apis="..22") public android.accounts.AccountManagerFuture<android.os.Bundle> getAuthToken(android.accounts.Account, String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method @Deprecated @RequiresPermission(value="android.permission.USE_CREDENTIALS", apis="..22") public android.accounts.AccountManagerFuture<android.os.Bundle> getAuthToken(android.accounts.Account, String, boolean, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method @RequiresPermission(value="android.permission.USE_CREDENTIALS", apis="..22") public android.accounts.AccountManagerFuture<android.os.Bundle> getAuthToken(android.accounts.Account, String, android.os.Bundle, boolean, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method @RequiresPermission(value="android.permission.MANAGE_ACCOUNTS", apis="..22") public android.accounts.AccountManagerFuture<android.os.Bundle> getAuthTokenByFeatures(String, String, String[], android.app.Activity, android.os.Bundle, android.os.Bundle, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method public android.accounts.AuthenticatorDescription[] getAuthenticatorTypes();
    method public java.util.Map<java.lang.String,java.lang.Integer> getPackagesAndVisibilityForAccount(android.accounts.Account);
    method @RequiresPermission(value="android.permission.AUTHENTICATE_ACCOUNTS", apis="..22") public String getPassword(android.accounts.Account);
    method public String getPreviousName(android.accounts.Account);
    method @RequiresPermission(value="android.permission.AUTHENTICATE_ACCOUNTS", apis="..22") public String getUserData(android.accounts.Account, String);
    method public android.accounts.AccountManagerFuture<java.lang.Boolean> hasFeatures(android.accounts.Account, String[], android.accounts.AccountManagerCallback<java.lang.Boolean>, android.os.Handler);
    method @RequiresPermission(anyOf={"android.permission.MANAGE_ACCOUNTS", "android.permission.USE_CREDENTIALS"}, apis="..22") public void invalidateAuthToken(String, String);
    method public android.accounts.AccountManagerFuture<java.lang.Boolean> isCredentialsUpdateSuggested(android.accounts.Account, String, android.accounts.AccountManagerCallback<java.lang.Boolean>, android.os.Handler);
    method @Deprecated public static android.content.Intent newChooseAccountIntent(android.accounts.Account, java.util.ArrayList<android.accounts.Account>, String[], boolean, String, String, String[], android.os.Bundle);
    method public static android.content.Intent newChooseAccountIntent(android.accounts.Account, java.util.List<android.accounts.Account>, String[], String, String, String[], android.os.Bundle);
    method @RequiresPermission(value="android.permission.AUTHENTICATE_ACCOUNTS", apis="..22") public boolean notifyAccountAuthenticated(android.accounts.Account);
    method @RequiresPermission(value="android.permission.AUTHENTICATE_ACCOUNTS", apis="..22") public String peekAuthToken(android.accounts.Account, String);
    method @Deprecated @RequiresPermission(value="android.permission.MANAGE_ACCOUNTS", apis="..22") public android.accounts.AccountManagerFuture<java.lang.Boolean> removeAccount(android.accounts.Account, android.accounts.AccountManagerCallback<java.lang.Boolean>, android.os.Handler);
    method @RequiresPermission(value="android.permission.MANAGE_ACCOUNTS", apis="..22") public android.accounts.AccountManagerFuture<android.os.Bundle> removeAccount(android.accounts.Account, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method @RequiresPermission(value="android.permission.AUTHENTICATE_ACCOUNTS", apis="..22") public boolean removeAccountExplicitly(android.accounts.Account);
    method public void removeOnAccountsUpdatedListener(android.accounts.OnAccountsUpdateListener);
    method @RequiresPermission(value="android.permission.AUTHENTICATE_ACCOUNTS", apis="..22") public android.accounts.AccountManagerFuture<android.accounts.Account> renameAccount(android.accounts.Account, @Size(min=1) String, android.accounts.AccountManagerCallback<android.accounts.Account>, android.os.Handler);
    method public boolean setAccountVisibility(android.accounts.Account, String, int);
    method @RequiresPermission(value="android.permission.AUTHENTICATE_ACCOUNTS", apis="..22") public void setAuthToken(android.accounts.Account, String, String);
    method @RequiresPermission(value="android.permission.AUTHENTICATE_ACCOUNTS", apis="..22") public void setPassword(android.accounts.Account, String);
    method @RequiresPermission(value="android.permission.AUTHENTICATE_ACCOUNTS", apis="..22") public void setUserData(android.accounts.Account, String, String);
    method public android.accounts.AccountManagerFuture<android.os.Bundle> startAddAccountSession(String, String, String[], android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method public android.accounts.AccountManagerFuture<android.os.Bundle> startUpdateCredentialsSession(android.accounts.Account, String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method @RequiresPermission(value="android.permission.MANAGE_ACCOUNTS", apis="..22") public android.accounts.AccountManagerFuture<android.os.Bundle> updateCredentials(android.accounts.Account, String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    field public static final String ACTION_ACCOUNT_REMOVED = "android.accounts.action.ACCOUNT_REMOVED";
    field public static final String ACTION_AUTHENTICATOR_INTENT = "android.accounts.AccountAuthenticator";
    field public static final String AUTHENTICATOR_ATTRIBUTES_NAME = "account-authenticator";
    field public static final String AUTHENTICATOR_META_DATA_NAME = "android.accounts.AccountAuthenticator";
    field public static final int ERROR_CODE_BAD_ARGUMENTS = 7; // 0x7
    field public static final int ERROR_CODE_BAD_AUTHENTICATION = 9; // 0x9
    field public static final int ERROR_CODE_BAD_REQUEST = 8; // 0x8
    field public static final int ERROR_CODE_CANCELED = 4; // 0x4
    field public static final int ERROR_CODE_INVALID_RESPONSE = 5; // 0x5
    field public static final int ERROR_CODE_NETWORK_ERROR = 3; // 0x3
    field public static final int ERROR_CODE_REMOTE_EXCEPTION = 1; // 0x1
    field public static final int ERROR_CODE_UNSUPPORTED_OPERATION = 6; // 0x6
    field public static final String KEY_ACCOUNTS = "accounts";
    field public static final String KEY_ACCOUNT_AUTHENTICATOR_RESPONSE = "accountAuthenticatorResponse";
    field public static final String KEY_ACCOUNT_MANAGER_RESPONSE = "accountManagerResponse";
    field public static final String KEY_ACCOUNT_NAME = "authAccount";
    field public static final String KEY_ACCOUNT_SESSION_BUNDLE = "accountSessionBundle";
    field public static final String KEY_ACCOUNT_STATUS_TOKEN = "accountStatusToken";
    field public static final String KEY_ACCOUNT_TYPE = "accountType";
    field public static final String KEY_ANDROID_PACKAGE_NAME = "androidPackageName";
    field public static final String KEY_AUTHENTICATOR_TYPES = "authenticator_types";
    field public static final String KEY_AUTHTOKEN = "authtoken";
    field public static final String KEY_AUTH_FAILED_MESSAGE = "authFailedMessage";
    field public static final String KEY_AUTH_TOKEN_LABEL = "authTokenLabelKey";
    field public static final String KEY_BOOLEAN_RESULT = "booleanResult";
    field public static final String KEY_CALLER_PID = "callerPid";
    field public static final String KEY_CALLER_UID = "callerUid";
    field public static final String KEY_ERROR_CODE = "errorCode";
    field public static final String KEY_ERROR_MESSAGE = "errorMessage";
    field public static final String KEY_INTENT = "intent";
    field public static final String KEY_LAST_AUTHENTICATED_TIME = "lastAuthenticatedTime";
    field public static final String KEY_PASSWORD = "password";
    field public static final String KEY_USERDATA = "userdata";
    field @Deprecated public static final String LOGIN_ACCOUNTS_CHANGED_ACTION = "android.accounts.LOGIN_ACCOUNTS_CHANGED";
    field public static final String PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE = "android:accounts:key_legacy_not_visible";
    field public static final String PACKAGE_NAME_KEY_LEGACY_VISIBLE = "android:accounts:key_legacy_visible";
    field public static final int VISIBILITY_NOT_VISIBLE = 3; // 0x3
    field public static final int VISIBILITY_UNDEFINED = 0; // 0x0
    field public static final int VISIBILITY_USER_MANAGED_NOT_VISIBLE = 4; // 0x4
    field public static final int VISIBILITY_USER_MANAGED_VISIBLE = 2; // 0x2
    field public static final int VISIBILITY_VISIBLE = 1; // 0x1
  }

  public interface AccountManagerCallback<V> {
    method public void run(android.accounts.AccountManagerFuture<V>);
  }

  public interface AccountManagerFuture<V> {
    method public boolean cancel(boolean);
    method public V getResult() throws android.accounts.AuthenticatorException, java.io.IOException, android.accounts.OperationCanceledException;
    method public V getResult(long, java.util.concurrent.TimeUnit) throws android.accounts.AuthenticatorException, java.io.IOException, android.accounts.OperationCanceledException;
    method public boolean isCancelled();
    method public boolean isDone();
  }

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

  public class AuthenticatorDescription implements android.os.Parcelable {
    ctor public AuthenticatorDescription(String, String, int, int, int, int, boolean);
    ctor public AuthenticatorDescription(String, String, int, int, int, int);
    method public int describeContents();
    method public static android.accounts.AuthenticatorDescription newKey(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.accounts.AuthenticatorDescription> CREATOR;
    field public final int accountPreferencesId;
    field public final boolean customTokens;
    field public final int iconId;
    field public final int labelId;
    field public final String packageName;
    field public final int smallIconId;
    field public final String type;
  }

  public class AuthenticatorException extends android.accounts.AccountsException {
    ctor public AuthenticatorException();
    ctor public AuthenticatorException(String);
    ctor public AuthenticatorException(String, Throwable);
    ctor public AuthenticatorException(Throwable);
  }

  public class NetworkErrorException extends android.accounts.AccountsException {
    ctor public NetworkErrorException();
    ctor public NetworkErrorException(String);
    ctor public NetworkErrorException(String, Throwable);
    ctor public NetworkErrorException(Throwable);
  }

  public interface OnAccountsUpdateListener {
    method public void onAccountsUpdated(android.accounts.Account[]);
  }

  public class OperationCanceledException extends android.accounts.AccountsException {
    ctor public OperationCanceledException();
    ctor public OperationCanceledException(String);
    ctor public OperationCanceledException(String, Throwable);
    ctor public OperationCanceledException(Throwable);
  }

}

package android.animation {

  public abstract class Animator implements java.lang.Cloneable {
    ctor public Animator();
    method public void addListener(android.animation.Animator.AnimatorListener);
    method public void addPauseListener(android.animation.Animator.AnimatorPauseListener);
    method public void cancel();
    method public android.animation.Animator clone();
    method public void end();
    method public abstract long getDuration();
    method public android.animation.TimeInterpolator getInterpolator();
    method public java.util.ArrayList<android.animation.Animator.AnimatorListener> getListeners();
    method public abstract long getStartDelay();
    method public long getTotalDuration();
    method public boolean isPaused();
    method public abstract boolean isRunning();
    method public boolean isStarted();
    method public void pause();
    method public void removeAllListeners();
    method public void removeListener(android.animation.Animator.AnimatorListener);
    method public void removePauseListener(android.animation.Animator.AnimatorPauseListener);
    method public void resume();
    method public abstract android.animation.Animator setDuration(long);
    method public abstract void setInterpolator(android.animation.TimeInterpolator);
    method public abstract void setStartDelay(long);
    method public void setTarget(@Nullable Object);
    method public void setupEndValues();
    method public void setupStartValues();
    method public void start();
    field public static final long DURATION_INFINITE = -1L; // 0xffffffffffffffffL
  }

  public static interface Animator.AnimatorListener {
    method public void onAnimationCancel(android.animation.Animator);
    method public default void onAnimationEnd(android.animation.Animator, boolean);
    method public void onAnimationEnd(android.animation.Animator);
    method public void onAnimationRepeat(android.animation.Animator);
    method public default void onAnimationStart(android.animation.Animator, boolean);
    method public void onAnimationStart(android.animation.Animator);
  }

  public static interface Animator.AnimatorPauseListener {
    method public void onAnimationPause(android.animation.Animator);
    method public void onAnimationResume(android.animation.Animator);
  }

  public class AnimatorInflater {
    ctor public AnimatorInflater();
    method public static android.animation.Animator loadAnimator(android.content.Context, @AnimatorRes int) throws android.content.res.Resources.NotFoundException;
    method public static android.animation.StateListAnimator loadStateListAnimator(android.content.Context, int) throws android.content.res.Resources.NotFoundException;
  }

  public abstract class AnimatorListenerAdapter implements android.animation.Animator.AnimatorListener android.animation.Animator.AnimatorPauseListener {
    ctor public AnimatorListenerAdapter();
    method public void onAnimationCancel(android.animation.Animator);
    method public void onAnimationEnd(android.animation.Animator);
    method public void onAnimationPause(android.animation.Animator);
    method public void onAnimationRepeat(android.animation.Animator);
    method public void onAnimationResume(android.animation.Animator);
    method public void onAnimationStart(android.animation.Animator);
  }

  public final class AnimatorSet extends android.animation.Animator {
    ctor public AnimatorSet();
    method public android.animation.AnimatorSet clone();
    method public java.util.ArrayList<android.animation.Animator> getChildAnimations();
    method public long getCurrentPlayTime();
    method public long getDuration();
    method public long getStartDelay();
    method public boolean isRunning();
    method public android.animation.AnimatorSet.Builder play(android.animation.Animator);
    method public void playSequentially(android.animation.Animator...);
    method public void playSequentially(java.util.List<android.animation.Animator>);
    method public void playTogether(android.animation.Animator...);
    method public void playTogether(java.util.Collection<android.animation.Animator>);
    method public void reverse();
    method public void setCurrentPlayTime(long);
    method public android.animation.AnimatorSet setDuration(long);
    method public void setInterpolator(android.animation.TimeInterpolator);
    method public void setStartDelay(long);
  }

  public class AnimatorSet.Builder {
    method public android.animation.AnimatorSet.Builder after(android.animation.Animator);
    method public android.animation.AnimatorSet.Builder after(long);
    method public android.animation.AnimatorSet.Builder before(android.animation.Animator);
    method public android.animation.AnimatorSet.Builder with(android.animation.Animator);
  }

  public class ArgbEvaluator implements android.animation.TypeEvaluator {
    ctor public ArgbEvaluator();
    method public Object evaluate(float, Object, Object);
  }

  public abstract class BidirectionalTypeConverter<T, V> extends android.animation.TypeConverter<T,V> {
    ctor public BidirectionalTypeConverter(Class<T>, Class<V>);
    method public abstract T convertBack(V);
    method public android.animation.BidirectionalTypeConverter<V,T> invert();
  }

  public class FloatArrayEvaluator implements android.animation.TypeEvaluator<float[]> {
    ctor public FloatArrayEvaluator();
    ctor public FloatArrayEvaluator(float[]);
    method public float[] evaluate(float, float[], float[]);
  }

  public class FloatEvaluator implements android.animation.TypeEvaluator<java.lang.Number> {
    ctor public FloatEvaluator();
    method public Float evaluate(float, Number, Number);
  }

  public class IntArrayEvaluator implements android.animation.TypeEvaluator<int[]> {
    ctor public IntArrayEvaluator();
    ctor public IntArrayEvaluator(int[]);
    method public int[] evaluate(float, int[], int[]);
  }

  public class IntEvaluator implements android.animation.TypeEvaluator<java.lang.Integer> {
    ctor public IntEvaluator();
    method public Integer evaluate(float, Integer, Integer);
  }

  public abstract class Keyframe implements java.lang.Cloneable {
    ctor public Keyframe();
    method public abstract android.animation.Keyframe clone();
    method public float getFraction();
    method public android.animation.TimeInterpolator getInterpolator();
    method public Class getType();
    method public abstract Object getValue();
    method public boolean hasValue();
    method public static android.animation.Keyframe ofFloat(float, float);
    method public static android.animation.Keyframe ofFloat(float);
    method public static android.animation.Keyframe ofInt(float, int);
    method public static android.animation.Keyframe ofInt(float);
    method public static android.animation.Keyframe ofObject(float, Object);
    method public static android.animation.Keyframe ofObject(float);
    method public void setFraction(float);
    method public void setInterpolator(android.animation.TimeInterpolator);
    method public abstract void setValue(Object);
  }

  public class LayoutTransition {
    ctor public LayoutTransition();
    method public void addChild(android.view.ViewGroup, android.view.View);
    method public void addTransitionListener(android.animation.LayoutTransition.TransitionListener);
    method public void disableTransitionType(int);
    method public void enableTransitionType(int);
    method public android.animation.Animator getAnimator(int);
    method public long getDuration(int);
    method public android.animation.TimeInterpolator getInterpolator(int);
    method public long getStagger(int);
    method public long getStartDelay(int);
    method public java.util.List<android.animation.LayoutTransition.TransitionListener> getTransitionListeners();
    method @Deprecated public void hideChild(android.view.ViewGroup, android.view.View);
    method public void hideChild(android.view.ViewGroup, android.view.View, int);
    method public boolean isChangingLayout();
    method public boolean isRunning();
    method public boolean isTransitionTypeEnabled(int);
    method public void removeChild(android.view.ViewGroup, android.view.View);
    method public void removeTransitionListener(android.animation.LayoutTransition.TransitionListener);
    method public void setAnimateParentHierarchy(boolean);
    method public void setAnimator(int, android.animation.Animator);
    method public void setDuration(long);
    method public void setDuration(int, long);
    method public void setInterpolator(int, android.animation.TimeInterpolator);
    method public void setStagger(int, long);
    method public void setStartDelay(int, long);
    method @Deprecated public void showChild(android.view.ViewGroup, android.view.View);
    method public void showChild(android.view.ViewGroup, android.view.View, int);
    field public static final int APPEARING = 2; // 0x2
    field public static final int CHANGE_APPEARING = 0; // 0x0
    field public static final int CHANGE_DISAPPEARING = 1; // 0x1
    field public static final int CHANGING = 4; // 0x4
    field public static final int DISAPPEARING = 3; // 0x3
  }

  public static interface LayoutTransition.TransitionListener {
    method public void endTransition(android.animation.LayoutTransition, android.view.ViewGroup, android.view.View, int);
    method public void startTransition(android.animation.LayoutTransition, android.view.ViewGroup, android.view.View, int);
  }

  public final class ObjectAnimator extends android.animation.ValueAnimator {
    ctor public ObjectAnimator();
    method public android.animation.ObjectAnimator clone();
    method @Nullable public String getPropertyName();
    method @Nullable public Object getTarget();
    method public static android.animation.ObjectAnimator ofArgb(Object, String, int...);
    method public static <T> android.animation.ObjectAnimator ofArgb(T, android.util.Property<T,java.lang.Integer>, int...);
    method public static android.animation.ObjectAnimator ofFloat(Object, String, float...);
    method public static android.animation.ObjectAnimator ofFloat(Object, String, String, android.graphics.Path);
    method public static <T> android.animation.ObjectAnimator ofFloat(T, android.util.Property<T,java.lang.Float>, float...);
    method public static <T> android.animation.ObjectAnimator ofFloat(T, android.util.Property<T,java.lang.Float>, android.util.Property<T,java.lang.Float>, android.graphics.Path);
    method public static android.animation.ObjectAnimator ofInt(Object, String, int...);
    method public static android.animation.ObjectAnimator ofInt(Object, String, String, android.graphics.Path);
    method public static <T> android.animation.ObjectAnimator ofInt(T, android.util.Property<T,java.lang.Integer>, int...);
    method public static <T> android.animation.ObjectAnimator ofInt(T, android.util.Property<T,java.lang.Integer>, android.util.Property<T,java.lang.Integer>, android.graphics.Path);
    method public static android.animation.ObjectAnimator ofMultiFloat(Object, String, float[][]);
    method public static android.animation.ObjectAnimator ofMultiFloat(Object, String, android.graphics.Path);
    method @java.lang.SafeVarargs public static <T> android.animation.ObjectAnimator ofMultiFloat(Object, String, android.animation.TypeConverter<T,float[]>, android.animation.TypeEvaluator<T>, T...);
    method public static android.animation.ObjectAnimator ofMultiInt(Object, String, int[][]);
    method public static android.animation.ObjectAnimator ofMultiInt(Object, String, android.graphics.Path);
    method @java.lang.SafeVarargs public static <T> android.animation.ObjectAnimator ofMultiInt(Object, String, android.animation.TypeConverter<T,int[]>, android.animation.TypeEvaluator<T>, T...);
    method public static android.animation.ObjectAnimator ofObject(Object, String, android.animation.TypeEvaluator, java.lang.Object...);
    method @NonNull public static android.animation.ObjectAnimator ofObject(Object, String, @Nullable android.animation.TypeConverter<android.graphics.PointF,?>, android.graphics.Path);
    method @NonNull @java.lang.SafeVarargs public static <T, V> android.animation.ObjectAnimator ofObject(T, android.util.Property<T,V>, android.animation.TypeEvaluator<V>, V...);
    method @NonNull @java.lang.SafeVarargs public static <T, V, P> android.animation.ObjectAnimator ofObject(T, android.util.Property<T,P>, android.animation.TypeConverter<V,P>, android.animation.TypeEvaluator<V>, V...);
    method @NonNull public static <T, V> android.animation.ObjectAnimator ofObject(T, @NonNull android.util.Property<T,V>, @Nullable android.animation.TypeConverter<android.graphics.PointF,V>, android.graphics.Path);
    method @NonNull public static android.animation.ObjectAnimator ofPropertyValuesHolder(Object, android.animation.PropertyValuesHolder...);
    method public void setAutoCancel(boolean);
    method @NonNull public android.animation.ObjectAnimator setDuration(long);
    method public void setProperty(@NonNull android.util.Property);
    method public void setPropertyName(@NonNull String);
  }

  public class PointFEvaluator implements android.animation.TypeEvaluator<android.graphics.PointF> {
    ctor public PointFEvaluator();
    ctor public PointFEvaluator(android.graphics.PointF);
    method public android.graphics.PointF evaluate(float, android.graphics.PointF, android.graphics.PointF);
  }

  public class PropertyValuesHolder implements java.lang.Cloneable {
    method public android.animation.PropertyValuesHolder clone();
    method public String getPropertyName();
    method public static android.animation.PropertyValuesHolder ofFloat(String, float...);
    method public static android.animation.PropertyValuesHolder ofFloat(android.util.Property<?,java.lang.Float>, float...);
    method public static android.animation.PropertyValuesHolder ofInt(String, int...);
    method public static android.animation.PropertyValuesHolder ofInt(android.util.Property<?,java.lang.Integer>, int...);
    method public static android.animation.PropertyValuesHolder ofKeyframe(String, android.animation.Keyframe...);
    method public static android.animation.PropertyValuesHolder ofKeyframe(android.util.Property, android.animation.Keyframe...);
    method public static android.animation.PropertyValuesHolder ofMultiFloat(String, float[][]);
    method public static android.animation.PropertyValuesHolder ofMultiFloat(String, android.graphics.Path);
    method @java.lang.SafeVarargs public static <V> android.animation.PropertyValuesHolder ofMultiFloat(String, android.animation.TypeConverter<V,float[]>, android.animation.TypeEvaluator<V>, V...);
    method public static <T> android.animation.PropertyValuesHolder ofMultiFloat(String, android.animation.TypeConverter<T,float[]>, android.animation.TypeEvaluator<T>, android.animation.Keyframe...);
    method public static android.animation.PropertyValuesHolder ofMultiInt(String, int[][]);
    method public static android.animation.PropertyValuesHolder ofMultiInt(String, android.graphics.Path);
    method @java.lang.SafeVarargs public static <V> android.animation.PropertyValuesHolder ofMultiInt(String, android.animation.TypeConverter<V,int[]>, android.animation.TypeEvaluator<V>, V...);
    method public static <T> android.animation.PropertyValuesHolder ofMultiInt(String, android.animation.TypeConverter<T,int[]>, android.animation.TypeEvaluator<T>, android.animation.Keyframe...);
    method public static android.animation.PropertyValuesHolder ofObject(String, android.animation.TypeEvaluator, java.lang.Object...);
    method public static android.animation.PropertyValuesHolder ofObject(String, android.animation.TypeConverter<android.graphics.PointF,?>, android.graphics.Path);
    method @java.lang.SafeVarargs public static <V> android.animation.PropertyValuesHolder ofObject(android.util.Property, android.animation.TypeEvaluator<V>, V...);
    method @java.lang.SafeVarargs public static <T, V> android.animation.PropertyValuesHolder ofObject(android.util.Property<?,V>, android.animation.TypeConverter<T,V>, android.animation.TypeEvaluator<T>, T...);
    method public static <V> android.animation.PropertyValuesHolder ofObject(android.util.Property<?,V>, android.animation.TypeConverter<android.graphics.PointF,V>, android.graphics.Path);
    method public void setConverter(android.animation.TypeConverter);
    method public void setEvaluator(android.animation.TypeEvaluator);
    method public void setFloatValues(float...);
    method public void setIntValues(int...);
    method public void setKeyframes(android.animation.Keyframe...);
    method public void setObjectValues(java.lang.Object...);
    method public void setProperty(android.util.Property);
    method public void setPropertyName(String);
  }

  public class RectEvaluator implements android.animation.TypeEvaluator<android.graphics.Rect> {
    ctor public RectEvaluator();
    ctor public RectEvaluator(android.graphics.Rect);
    method public android.graphics.Rect evaluate(float, android.graphics.Rect, android.graphics.Rect);
  }

  public class StateListAnimator implements java.lang.Cloneable {
    ctor public StateListAnimator();
    method public void addState(int[], android.animation.Animator);
    method public android.animation.StateListAnimator clone();
    method public void jumpToCurrentState();
  }

  public class TimeAnimator extends android.animation.ValueAnimator {
    ctor public TimeAnimator();
    method public void setTimeListener(android.animation.TimeAnimator.TimeListener);
  }

  public static interface TimeAnimator.TimeListener {
    method public void onTimeUpdate(android.animation.TimeAnimator, long, long);
  }

  public interface TimeInterpolator {
    method public float getInterpolation(float);
  }

  public abstract class TypeConverter<T, V> {
    ctor public TypeConverter(Class<T>, Class<V>);
    method public abstract V convert(T);
  }

  public interface TypeEvaluator<T> {
    method public T evaluate(float, T, T);
  }

  public class ValueAnimator extends android.animation.Animator {
    ctor public ValueAnimator();
    method public void addUpdateListener(android.animation.ValueAnimator.AnimatorUpdateListener);
    method public static boolean areAnimatorsEnabled();
    method public android.animation.ValueAnimator clone();
    method public float getAnimatedFraction();
    method public Object getAnimatedValue();
    method public Object getAnimatedValue(String);
    method public long getCurrentPlayTime();
    method public long getDuration();
    method public static long getFrameDelay();
    method public int getRepeatCount();
    method public int getRepeatMode();
    method public long getStartDelay();
    method public android.animation.PropertyValuesHolder[] getValues();
    method public boolean isRunning();
    method public static android.animation.ValueAnimator ofArgb(int...);
    method public static android.animation.ValueAnimator ofFloat(float...);
    method public static android.animation.ValueAnimator ofInt(int...);
    method public static android.animation.ValueAnimator ofObject(android.animation.TypeEvaluator, java.lang.Object...);
    method public static android.animation.ValueAnimator ofPropertyValuesHolder(android.animation.PropertyValuesHolder...);
    method public void removeAllUpdateListeners();
    method public void removeUpdateListener(android.animation.ValueAnimator.AnimatorUpdateListener);
    method public void reverse();
    method public void setCurrentFraction(float);
    method public void setCurrentPlayTime(long);
    method public android.animation.ValueAnimator setDuration(long);
    method public void setEvaluator(android.animation.TypeEvaluator);
    method public void setFloatValues(float...);
    method public static void setFrameDelay(long);
    method public void setIntValues(int...);
    method public void setInterpolator(android.animation.TimeInterpolator);
    method public void setObjectValues(java.lang.Object...);
    method public void setRepeatCount(int);
    method public void setRepeatMode(int);
    method public void setStartDelay(long);
    method public void setValues(android.animation.PropertyValuesHolder...);
    field public static final int INFINITE = -1; // 0xffffffff
    field public static final int RESTART = 1; // 0x1
    field public static final int REVERSE = 2; // 0x2
  }

  public static interface ValueAnimator.AnimatorUpdateListener {
    method public void onAnimationUpdate(android.animation.ValueAnimator);
  }

}

package android.annotation {

  @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.LOCAL_VARIABLE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface SuppressLint {
    method public abstract String[] value();
  }

  @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface TargetApi {
    method public abstract int value();
  }

}

package android.app {

  public abstract class ActionBar {
    ctor public ActionBar();
    method public abstract void addOnMenuVisibilityListener(android.app.ActionBar.OnMenuVisibilityListener);
    method @Deprecated public abstract void addTab(android.app.ActionBar.Tab);
    method @Deprecated public abstract void addTab(android.app.ActionBar.Tab, boolean);
    method @Deprecated public abstract void addTab(android.app.ActionBar.Tab, int);
    method @Deprecated public abstract void addTab(android.app.ActionBar.Tab, int, boolean);
    method public abstract android.view.View getCustomView();
    method public abstract int getDisplayOptions();
    method public float getElevation();
    method public abstract int getHeight();
    method public int getHideOffset();
    method @Deprecated public abstract int getNavigationItemCount();
    method @Deprecated public abstract int getNavigationMode();
    method @Deprecated public abstract int getSelectedNavigationIndex();
    method @Deprecated public abstract android.app.ActionBar.Tab getSelectedTab();
    method public abstract CharSequence getSubtitle();
    method @Deprecated public abstract android.app.ActionBar.Tab getTabAt(int);
    method @Deprecated public abstract int getTabCount();
    method public android.content.Context getThemedContext();
    method public abstract CharSequence getTitle();
    method public abstract void hide();
    method public boolean isHideOnContentScrollEnabled();
    method public abstract boolean isShowing();
    method @Deprecated public abstract android.app.ActionBar.Tab newTab();
    method @Deprecated public abstract void removeAllTabs();
    method public abstract void removeOnMenuVisibilityListener(android.app.ActionBar.OnMenuVisibilityListener);
    method @Deprecated public abstract void removeTab(android.app.ActionBar.Tab);
    method @Deprecated public abstract void removeTabAt(int);
    method @Deprecated public abstract void selectTab(android.app.ActionBar.Tab);
    method public abstract void setBackgroundDrawable(@Nullable android.graphics.drawable.Drawable);
    method public abstract void setCustomView(android.view.View);
    method public abstract void setCustomView(android.view.View, android.app.ActionBar.LayoutParams);
    method public abstract void setCustomView(@LayoutRes int);
    method public abstract void setDisplayHomeAsUpEnabled(boolean);
    method public abstract void setDisplayOptions(int);
    method public abstract void setDisplayOptions(int, int);
    method public abstract void setDisplayShowCustomEnabled(boolean);
    method public abstract void setDisplayShowHomeEnabled(boolean);
    method public abstract void setDisplayShowTitleEnabled(boolean);
    method public abstract void setDisplayUseLogoEnabled(boolean);
    method public void setElevation(float);
    method public void setHideOffset(int);
    method public void setHideOnContentScrollEnabled(boolean);
    method public void setHomeActionContentDescription(CharSequence);
    method public void setHomeActionContentDescription(@StringRes int);
    method public void setHomeAsUpIndicator(android.graphics.drawable.Drawable);
    method public void setHomeAsUpIndicator(@DrawableRes int);
    method public void setHomeButtonEnabled(boolean);
    method public abstract void setIcon(@DrawableRes int);
    method public abstract void setIcon(android.graphics.drawable.Drawable);
    method @Deprecated public abstract void setListNavigationCallbacks(android.widget.SpinnerAdapter, android.app.ActionBar.OnNavigationListener);
    method public abstract void setLogo(@DrawableRes int);
    method public abstract void setLogo(android.graphics.drawable.Drawable);
    method @Deprecated public abstract void setNavigationMode(int);
    method @Deprecated public abstract void setSelectedNavigationItem(int);
    method public void setSplitBackgroundDrawable(android.graphics.drawable.Drawable);
    method public void setStackedBackgroundDrawable(android.graphics.drawable.Drawable);
    method public abstract void setSubtitle(CharSequence);
    method public abstract void setSubtitle(@StringRes int);
    method public abstract void setTitle(CharSequence);
    method public abstract void setTitle(@StringRes int);
    method public abstract void show();
    field public static final int DISPLAY_HOME_AS_UP = 4; // 0x4
    field public static final int DISPLAY_SHOW_CUSTOM = 16; // 0x10
    field public static final int DISPLAY_SHOW_HOME = 2; // 0x2
    field public static final int DISPLAY_SHOW_TITLE = 8; // 0x8
    field public static final int DISPLAY_USE_LOGO = 1; // 0x1
    field @Deprecated public static final int NAVIGATION_MODE_LIST = 1; // 0x1
    field @Deprecated public static final int NAVIGATION_MODE_STANDARD = 0; // 0x0
    field @Deprecated public static final int NAVIGATION_MODE_TABS = 2; // 0x2
  }

  public static class ActionBar.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
    ctor public ActionBar.LayoutParams(@NonNull android.content.Context, android.util.AttributeSet);
    ctor public ActionBar.LayoutParams(int, int);
    ctor public ActionBar.LayoutParams(int, int, int);
    ctor public ActionBar.LayoutParams(int);
    ctor public ActionBar.LayoutParams(android.app.ActionBar.LayoutParams);
    ctor public ActionBar.LayoutParams(android.view.ViewGroup.LayoutParams);
    field @android.view.ViewDebug.ExportedProperty(category="layout", mapping={@android.view.ViewDebug.IntToString(from=0xffffffff, to="NONE"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.NO_GRAVITY, to="NONE"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.TOP, to="TOP"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.BOTTOM, to="BOTTOM"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.LEFT, to="LEFT"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.RIGHT, to="RIGHT"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.START, to="START"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.END, to="END"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.CENTER_VERTICAL, to="CENTER_VERTICAL"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.FILL_VERTICAL, to="FILL_VERTICAL"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.CENTER_HORIZONTAL, to="CENTER_HORIZONTAL"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.FILL_HORIZONTAL, to="FILL_HORIZONTAL"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.CENTER, to="CENTER"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.FILL, to="FILL")}) public int gravity;
  }

  public static interface ActionBar.OnMenuVisibilityListener {
    method public void onMenuVisibilityChanged(boolean);
  }

  @Deprecated public static interface ActionBar.OnNavigationListener {
    method @Deprecated public boolean onNavigationItemSelected(int, long);
  }

  @Deprecated public abstract static class ActionBar.Tab {
    ctor @Deprecated public ActionBar.Tab();
    method @Deprecated public abstract CharSequence getContentDescription();
    method @Deprecated public abstract android.view.View getCustomView();
    method @Deprecated public abstract android.graphics.drawable.Drawable getIcon();
    method @Deprecated public abstract int getPosition();
    method @Deprecated public abstract Object getTag();
    method @Deprecated public abstract CharSequence getText();
    method @Deprecated public abstract void select();
    method @Deprecated public abstract android.app.ActionBar.Tab setContentDescription(@StringRes int);
    method @Deprecated public abstract android.app.ActionBar.Tab setContentDescription(CharSequence);
    method @Deprecated public abstract android.app.ActionBar.Tab setCustomView(android.view.View);
    method @Deprecated public abstract android.app.ActionBar.Tab setCustomView(@LayoutRes int);
    method @Deprecated public abstract android.app.ActionBar.Tab setIcon(android.graphics.drawable.Drawable);
    method @Deprecated public abstract android.app.ActionBar.Tab setIcon(@DrawableRes int);
    method @Deprecated public abstract android.app.ActionBar.Tab setTabListener(android.app.ActionBar.TabListener);
    method @Deprecated public abstract android.app.ActionBar.Tab setTag(Object);
    method @Deprecated public abstract android.app.ActionBar.Tab setText(CharSequence);
    method @Deprecated public abstract android.app.ActionBar.Tab setText(@StringRes int);
    field @Deprecated public static final int INVALID_POSITION = -1; // 0xffffffff
  }

  @Deprecated public static interface ActionBar.TabListener {
    method @Deprecated public void onTabReselected(android.app.ActionBar.Tab, android.app.FragmentTransaction);
    method @Deprecated public void onTabSelected(android.app.ActionBar.Tab, android.app.FragmentTransaction);
    method @Deprecated public void onTabUnselected(android.app.ActionBar.Tab, android.app.FragmentTransaction);
  }

  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 {
    ctor public Activity();
    method public void addContentView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public void closeContextMenu();
    method public void closeOptionsMenu();
    method public android.app.PendingIntent createPendingResult(int, @NonNull android.content.Intent, int);
    method @Deprecated public final void dismissDialog(int);
    method public final void dismissKeyboardShortcutsHelper();
    method public boolean dispatchGenericMotionEvent(android.view.MotionEvent);
    method public boolean dispatchKeyEvent(android.view.KeyEvent);
    method public boolean dispatchKeyShortcutEvent(android.view.KeyEvent);
    method public boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public boolean dispatchTouchEvent(android.view.MotionEvent);
    method public boolean dispatchTrackballEvent(android.view.MotionEvent);
    method public void dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method @Deprecated public void enterPictureInPictureMode();
    method public boolean enterPictureInPictureMode(@NonNull android.app.PictureInPictureParams);
    method public <T extends android.view.View> T findViewById(@IdRes int);
    method public void finish();
    method public void finishActivity(int);
    method public void finishActivityFromChild(@NonNull android.app.Activity, int);
    method public void finishAffinity();
    method public void finishAfterTransition();
    method public void finishAndRemoveTask();
    method public void finishFromChild(android.app.Activity);
    method @Nullable public android.app.ActionBar getActionBar();
    method public final android.app.Application getApplication();
    method @Nullable public android.content.ComponentName getCallingActivity();
    method @Nullable public String getCallingPackage();
    method public int getChangingConfigurations();
    method public android.content.ComponentName getComponentName();
    method public android.transition.Scene getContentScene();
    method public android.transition.TransitionManager getContentTransitionManager();
    method @Nullable public android.view.View getCurrentFocus();
    method @Deprecated public android.app.FragmentManager getFragmentManager();
    method public android.content.Intent getIntent();
    method @Nullable public Object getLastNonConfigurationInstance();
    method @NonNull public android.view.LayoutInflater getLayoutInflater();
    method @Deprecated public android.app.LoaderManager getLoaderManager();
    method @NonNull public String getLocalClassName();
    method public int getMaxNumPictureInPictureActions();
    method public final android.media.session.MediaController getMediaController();
    method @NonNull public android.view.MenuInflater getMenuInflater();
    method public final android.app.Activity getParent();
    method @Nullable public android.content.Intent getParentActivityIntent();
    method public android.content.SharedPreferences getPreferences(int);
    method @Nullable public android.net.Uri getReferrer();
    method public int getRequestedOrientation();
    method public final android.view.SearchEvent getSearchEvent();
    method public int getTaskId();
    method public final CharSequence getTitle();
    method public final int getTitleColor();
    method public android.app.VoiceInteractor getVoiceInteractor();
    method public final int getVolumeControlStream();
    method public android.view.Window getWindow();
    method public android.view.WindowManager getWindowManager();
    method public boolean hasWindowFocus();
    method public void invalidateOptionsMenu();
    method public boolean isActivityTransitionRunning();
    method public boolean isChangingConfigurations();
    method public final boolean isChild();
    method public boolean isDestroyed();
    method public boolean isFinishing();
    method public boolean isImmersive();
    method public boolean isInMultiWindowMode();
    method public boolean isInPictureInPictureMode();
    method public boolean isLocalVoiceInteractionSupported();
    method public boolean isTaskRoot();
    method public boolean isVoiceInteraction();
    method public boolean isVoiceInteractionRoot();
    method @Deprecated public final android.database.Cursor managedQuery(android.net.Uri, String[], String, String[], String);
    method public boolean moveTaskToBack(boolean);
    method public boolean navigateUpTo(android.content.Intent);
    method public boolean navigateUpToFromChild(android.app.Activity, android.content.Intent);
    method @CallSuper public void onActionModeFinished(android.view.ActionMode);
    method @CallSuper public void onActionModeStarted(android.view.ActionMode);
    method public void onActivityReenter(int, android.content.Intent);
    method protected void onActivityResult(int, int, android.content.Intent);
    method @Deprecated public void onAttachFragment(android.app.Fragment);
    method public void onAttachedToWindow();
    method public void onBackPressed();
    method protected void onChildTitleChanged(android.app.Activity, CharSequence);
    method public void onConfigurationChanged(android.content.res.Configuration);
    method public void onContentChanged();
    method public boolean onContextItemSelected(android.view.MenuItem);
    method public void onContextMenuClosed(android.view.Menu);
    method @MainThread @CallSuper protected void onCreate(@Nullable android.os.Bundle);
    method public void onCreate(@Nullable android.os.Bundle, @Nullable android.os.PersistableBundle);
    method public void onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo);
    method @Nullable public CharSequence onCreateDescription();
    method @Deprecated protected android.app.Dialog onCreateDialog(int);
    method @Deprecated @Nullable protected android.app.Dialog onCreateDialog(int, android.os.Bundle);
    method public void onCreateNavigateUpTaskStack(android.app.TaskStackBuilder);
    method public boolean onCreateOptionsMenu(android.view.Menu);
    method public boolean onCreatePanelMenu(int, android.view.Menu);
    method @Nullable public android.view.View onCreatePanelView(int);
    method @Deprecated public boolean onCreateThumbnail(android.graphics.Bitmap, android.graphics.Canvas);
    method @Nullable public android.view.View onCreateView(String, android.content.Context, android.util.AttributeSet);
    method public android.view.View onCreateView(android.view.View, String, android.content.Context, android.util.AttributeSet);
    method @CallSuper protected void onDestroy();
    method public void onDetachedFromWindow();
    method public void onEnterAnimationComplete();
    method public boolean onGenericMotionEvent(android.view.MotionEvent);
    method public boolean onKeyDown(int, android.view.KeyEvent);
    method public boolean onKeyLongPress(int, android.view.KeyEvent);
    method public boolean onKeyMultiple(int, int, android.view.KeyEvent);
    method public boolean onKeyShortcut(int, android.view.KeyEvent);
    method public boolean onKeyUp(int, android.view.KeyEvent);
    method public void onLocalVoiceInteractionStarted();
    method public void onLocalVoiceInteractionStopped();
    method public void onLowMemory();
    method public boolean onMenuItemSelected(int, android.view.MenuItem);
    method public boolean onMenuOpened(int, android.view.Menu);
    method public void onMultiWindowModeChanged(boolean, android.content.res.Configuration);
    method @Deprecated public void onMultiWindowModeChanged(boolean);
    method public boolean onNavigateUp();
    method public boolean onNavigateUpFromChild(android.app.Activity);
    method protected void onNewIntent(android.content.Intent);
    method public boolean onOptionsItemSelected(android.view.MenuItem);
    method public void onOptionsMenuClosed(android.view.Menu);
    method public void onPanelClosed(int, android.view.Menu);
    method @CallSuper protected void onPause();
    method public void onPictureInPictureModeChanged(boolean, android.content.res.Configuration);
    method @Deprecated public void onPictureInPictureModeChanged(boolean);
    method @CallSuper protected void onPostCreate(@Nullable android.os.Bundle);
    method public void onPostCreate(@Nullable android.os.Bundle, @Nullable android.os.PersistableBundle);
    method @CallSuper protected void onPostResume();
    method @Deprecated protected void onPrepareDialog(int, android.app.Dialog);
    method @Deprecated protected void onPrepareDialog(int, android.app.Dialog, android.os.Bundle);
    method public void onPrepareNavigateUpTaskStack(android.app.TaskStackBuilder);
    method public boolean onPrepareOptionsMenu(android.view.Menu);
    method public boolean onPreparePanel(int, android.view.View, android.view.Menu);
    method public void onProvideAssistContent(android.app.assist.AssistContent);
    method public void onProvideAssistData(android.os.Bundle);
    method public android.net.Uri onProvideReferrer();
    method public void onRequestPermissionsResult(int, @NonNull String[], @NonNull int[]);
    method @CallSuper protected void onRestart();
    method protected void onRestoreInstanceState(android.os.Bundle);
    method public void onRestoreInstanceState(android.os.Bundle, android.os.PersistableBundle);
    method @CallSuper protected void onResume();
    method public Object onRetainNonConfigurationInstance();
    method protected void onSaveInstanceState(android.os.Bundle);
    method public void onSaveInstanceState(android.os.Bundle, android.os.PersistableBundle);
    method public boolean onSearchRequested(@Nullable android.view.SearchEvent);
    method public boolean onSearchRequested();
    method @CallSuper protected void onStart();
    method public void onStateNotSaved();
    method @CallSuper protected void onStop();
    method protected void onTitleChanged(CharSequence, int);
    method public boolean onTouchEvent(android.view.MotionEvent);
    method public boolean onTrackballEvent(android.view.MotionEvent);
    method public void onTrimMemory(int);
    method public void onUserInteraction();
    method protected void onUserLeaveHint();
    method @Deprecated @CallSuper public void onVisibleBehindCanceled();
    method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams);
    method public void onWindowFocusChanged(boolean);
    method @Nullable public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback);
    method @Nullable public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback, int);
    method public void openContextMenu(android.view.View);
    method public void openOptionsMenu();
    method public void overridePendingTransition(int, int);
    method public void postponeEnterTransition();
    method public void recreate();
    method public void registerForContextMenu(android.view.View);
    method public boolean releaseInstance();
    method @Deprecated public final void removeDialog(int);
    method public void reportFullyDrawn();
    method public android.view.DragAndDropPermissions requestDragAndDropPermissions(android.view.DragEvent);
    method public final void requestPermissions(@NonNull String[], int);
    method public final void requestShowKeyboardShortcuts();
    method @Deprecated public boolean requestVisibleBehind(boolean);
    method public final boolean requestWindowFeature(int);
    method @NonNull public final <T extends android.view.View> T requireViewById(@IdRes int);
    method public final void runOnUiThread(Runnable);
    method public void setActionBar(@Nullable android.widget.Toolbar);
    method public void setContentTransitionManager(android.transition.TransitionManager);
    method public void setContentView(@LayoutRes int);
    method public void setContentView(android.view.View);
    method public void setContentView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public final void setDefaultKeyMode(int);
    method public void setEnterSharedElementCallback(android.app.SharedElementCallback);
    method public void setExitSharedElementCallback(android.app.SharedElementCallback);
    method public final void setFeatureDrawable(int, android.graphics.drawable.Drawable);
    method public final void setFeatureDrawableAlpha(int, int);
    method public final void setFeatureDrawableResource(int, @DrawableRes int);
    method public final void setFeatureDrawableUri(int, android.net.Uri);
    method public void setFinishOnTouchOutside(boolean);
    method public void setImmersive(boolean);
    method public void setIntent(android.content.Intent);
    method public final void setMediaController(android.media.session.MediaController);
    method public void setPictureInPictureParams(@NonNull android.app.PictureInPictureParams);
    method @Deprecated public final void setProgress(int);
    method @Deprecated public final void setProgressBarIndeterminate(boolean);
    method @Deprecated public final void setProgressBarIndeterminateVisibility(boolean);
    method @Deprecated public final void setProgressBarVisibility(boolean);
    method public void setRequestedOrientation(int);
    method public final void setResult(int);
    method public final void setResult(int, android.content.Intent);
    method @Deprecated public final void setSecondaryProgress(int);
    method public void setShowWhenLocked(boolean);
    method public void setTaskDescription(android.app.ActivityManager.TaskDescription);
    method public void setTitle(CharSequence);
    method public void setTitle(int);
    method @Deprecated public void setTitleColor(int);
    method public void setTurnScreenOn(boolean);
    method public void setVisible(boolean);
    method public final void setVolumeControlStream(int);
    method public void setVrModeEnabled(boolean, @NonNull android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public boolean shouldShowRequestPermissionRationale(@NonNull String);
    method public boolean shouldUpRecreateTask(android.content.Intent);
    method public boolean showAssist(android.os.Bundle);
    method @Deprecated public final void showDialog(int);
    method @Deprecated public final boolean showDialog(int, android.os.Bundle);
    method public void showLockTaskEscapeMessage();
    method @Nullable public android.view.ActionMode startActionMode(android.view.ActionMode.Callback);
    method @Nullable public android.view.ActionMode startActionMode(android.view.ActionMode.Callback, int);
    method public void startActivityForResult(@RequiresPermission android.content.Intent, int);
    method public void startActivityForResult(@RequiresPermission android.content.Intent, int, @Nullable android.os.Bundle);
    method public void startActivityFromChild(@NonNull android.app.Activity, @RequiresPermission android.content.Intent, int);
    method public void startActivityFromChild(@NonNull android.app.Activity, @RequiresPermission android.content.Intent, int, @Nullable android.os.Bundle);
    method @Deprecated public void startActivityFromFragment(@NonNull android.app.Fragment, @RequiresPermission android.content.Intent, int);
    method @Deprecated public void startActivityFromFragment(@NonNull android.app.Fragment, @RequiresPermission android.content.Intent, int, @Nullable android.os.Bundle);
    method public boolean startActivityIfNeeded(@RequiresPermission @NonNull android.content.Intent, int);
    method public boolean startActivityIfNeeded(@RequiresPermission @NonNull android.content.Intent, int, @Nullable android.os.Bundle);
    method public void startIntentSenderForResult(android.content.IntentSender, int, @Nullable android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSenderForResult(android.content.IntentSender, int, @Nullable android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSenderFromChild(android.app.Activity, android.content.IntentSender, int, android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSenderFromChild(android.app.Activity, android.content.IntentSender, int, android.content.Intent, int, int, int, @Nullable android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method public void startLocalVoiceInteraction(android.os.Bundle);
    method public void startLockTask();
    method @Deprecated public void startManagingCursor(android.database.Cursor);
    method public boolean startNextMatchingActivity(@RequiresPermission @NonNull android.content.Intent);
    method public boolean startNextMatchingActivity(@RequiresPermission @NonNull android.content.Intent, @Nullable android.os.Bundle);
    method public void startPostponedEnterTransition();
    method public void startSearch(@Nullable String, boolean, @Nullable android.os.Bundle, boolean);
    method public void stopLocalVoiceInteraction();
    method public void stopLockTask();
    method @Deprecated public void stopManagingCursor(android.database.Cursor);
    method public void takeKeyEvents(boolean);
    method public void triggerSearch(String, @Nullable android.os.Bundle);
    method public void unregisterForContextMenu(android.view.View);
    field public static final int DEFAULT_KEYS_DIALER = 1; // 0x1
    field public static final int DEFAULT_KEYS_DISABLE = 0; // 0x0
    field public static final int DEFAULT_KEYS_SEARCH_GLOBAL = 4; // 0x4
    field public static final int DEFAULT_KEYS_SEARCH_LOCAL = 3; // 0x3
    field public static final int DEFAULT_KEYS_SHORTCUT = 2; // 0x2
    field protected static final int[] FOCUSED_STATE_SET;
    field public static final int RESULT_CANCELED = 0; // 0x0
    field public static final int RESULT_FIRST_USER = 1; // 0x1
    field public static final int RESULT_OK = -1; // 0xffffffff
  }

  @Deprecated public class ActivityGroup extends android.app.Activity {
    ctor @Deprecated public ActivityGroup();
    ctor @Deprecated public ActivityGroup(boolean);
    method @Deprecated public android.app.Activity getCurrentActivity();
    method @Deprecated public final android.app.LocalActivityManager getLocalActivityManager();
  }

  public class ActivityManager {
    method public int addAppTask(@NonNull android.app.Activity, @NonNull android.content.Intent, @Nullable android.app.ActivityManager.TaskDescription, @NonNull android.graphics.Bitmap);
    method public boolean clearApplicationUserData();
    method public void clearWatchHeapLimit();
    method @RequiresPermission(android.Manifest.permission.DUMP) public void dumpPackageState(java.io.FileDescriptor, String);
    method public android.util.Size getAppTaskThumbnailSize();
    method public java.util.List<android.app.ActivityManager.AppTask> getAppTasks();
    method public android.content.pm.ConfigurationInfo getDeviceConfigurationInfo();
    method public int getLargeMemoryClass();
    method public int getLauncherLargeIconDensity();
    method public int getLauncherLargeIconSize();
    method public int getLockTaskModeState();
    method public int getMemoryClass();
    method public void getMemoryInfo(android.app.ActivityManager.MemoryInfo);
    method public static void getMyMemoryState(android.app.ActivityManager.RunningAppProcessInfo);
    method public android.os.Debug.MemoryInfo[] getProcessMemoryInfo(int[]);
    method public java.util.List<android.app.ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState();
    method @Deprecated public java.util.List<android.app.ActivityManager.RecentTaskInfo> getRecentTasks(int, int) throws java.lang.SecurityException;
    method public java.util.List<android.app.ActivityManager.RunningAppProcessInfo> getRunningAppProcesses();
    method public android.app.PendingIntent getRunningServiceControlPanel(android.content.ComponentName) throws java.lang.SecurityException;
    method @Deprecated public java.util.List<android.app.ActivityManager.RunningServiceInfo> getRunningServices(int) throws java.lang.SecurityException;
    method @Deprecated public java.util.List<android.app.ActivityManager.RunningTaskInfo> getRunningTasks(int) throws java.lang.SecurityException;
    method public boolean isBackgroundRestricted();
    method @Deprecated public boolean isInLockTaskMode();
    method public boolean isLowRamDevice();
    method public static boolean isRunningInTestHarness();
    method public static boolean isUserAMonkey();
    method @RequiresPermission(android.Manifest.permission.KILL_BACKGROUND_PROCESSES) public void killBackgroundProcesses(String);
    method @RequiresPermission(android.Manifest.permission.REORDER_TASKS) public void moveTaskToFront(int, int);
    method @RequiresPermission(android.Manifest.permission.REORDER_TASKS) public void moveTaskToFront(int, int, android.os.Bundle);
    method @Deprecated public void restartPackage(String);
    method public static void setVrThread(int);
    method public void setWatchHeapLimit(long);
    field public static final String ACTION_REPORT_HEAP_LIMIT = "android.app.action.REPORT_HEAP_LIMIT";
    field public static final int LOCK_TASK_MODE_LOCKED = 1; // 0x1
    field public static final int LOCK_TASK_MODE_NONE = 0; // 0x0
    field public static final int LOCK_TASK_MODE_PINNED = 2; // 0x2
    field public static final String META_HOME_ALTERNATE = "android.app.home.alternate";
    field public static final int MOVE_TASK_NO_USER_ACTION = 2; // 0x2
    field public static final int MOVE_TASK_WITH_HOME = 1; // 0x1
    field public static final int RECENT_IGNORE_UNAVAILABLE = 2; // 0x2
    field public static final int RECENT_WITH_EXCLUDED = 1; // 0x1
  }

  public static class ActivityManager.AppTask {
    method public void finishAndRemoveTask();
    method public android.app.ActivityManager.RecentTaskInfo getTaskInfo();
    method public void moveToFront();
    method public void setExcludeFromRecents(boolean);
    method public void startActivity(android.content.Context, android.content.Intent, android.os.Bundle);
  }

  public static class ActivityManager.MemoryInfo implements android.os.Parcelable {
    ctor public ActivityManager.MemoryInfo();
    method public int describeContents();
    method public void readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.ActivityManager.MemoryInfo> CREATOR;
    field public long availMem;
    field public boolean lowMemory;
    field public long threshold;
    field public long totalMem;
  }

  public static class ActivityManager.ProcessErrorStateInfo implements android.os.Parcelable {
    ctor public ActivityManager.ProcessErrorStateInfo();
    method public int describeContents();
    method public void readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CRASHED = 1; // 0x1
    field public static final android.os.Parcelable.Creator<android.app.ActivityManager.ProcessErrorStateInfo> CREATOR;
    field public static final int NOT_RESPONDING = 2; // 0x2
    field public static final int NO_ERROR = 0; // 0x0
    field public int condition;
    field public byte[] crashData;
    field public String longMsg;
    field public int pid;
    field public String processName;
    field public String shortMsg;
    field public String stackTrace;
    field public String tag;
    field public int uid;
  }

  public static class ActivityManager.RecentTaskInfo implements android.os.Parcelable {
    ctor public ActivityManager.RecentTaskInfo();
    method public int describeContents();
    method public void readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.ActivityManager.RecentTaskInfo> CREATOR;
    field public int affiliatedTaskId;
    field public android.content.ComponentName baseActivity;
    field public android.content.Intent baseIntent;
    field public CharSequence description;
    field public int id;
    field public int numActivities;
    field public android.content.ComponentName origActivity;
    field public int persistentId;
    field public android.app.ActivityManager.TaskDescription taskDescription;
    field public android.content.ComponentName topActivity;
  }

  public static class ActivityManager.RunningAppProcessInfo implements android.os.Parcelable {
    ctor public ActivityManager.RunningAppProcessInfo();
    ctor public ActivityManager.RunningAppProcessInfo(String, int, String[]);
    method public int describeContents();
    method public void readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.ActivityManager.RunningAppProcessInfo> CREATOR;
    field @Deprecated public static final int IMPORTANCE_BACKGROUND = 400; // 0x190
    field public static final int IMPORTANCE_CACHED = 400; // 0x190
    field public static final int IMPORTANCE_CANT_SAVE_STATE = 350; // 0x15e
    field @Deprecated public static final int IMPORTANCE_EMPTY = 500; // 0x1f4
    field public static final int IMPORTANCE_FOREGROUND = 100; // 0x64
    field public static final int IMPORTANCE_FOREGROUND_SERVICE = 125; // 0x7d
    field public static final int IMPORTANCE_GONE = 1000; // 0x3e8
    field public static final int IMPORTANCE_PERCEPTIBLE = 230; // 0xe6
    field public static final int IMPORTANCE_PERCEPTIBLE_PRE_26 = 130; // 0x82
    field public static final int IMPORTANCE_SERVICE = 300; // 0x12c
    field public static final int IMPORTANCE_TOP_SLEEPING = 325; // 0x145
    field @Deprecated public static final int IMPORTANCE_TOP_SLEEPING_PRE_28 = 150; // 0x96
    field public static final int IMPORTANCE_VISIBLE = 200; // 0xc8
    field public static final int REASON_PROVIDER_IN_USE = 1; // 0x1
    field public static final int REASON_SERVICE_IN_USE = 2; // 0x2
    field public static final int REASON_UNKNOWN = 0; // 0x0
    field public int importance;
    field public int importanceReasonCode;
    field public android.content.ComponentName importanceReasonComponent;
    field public int importanceReasonPid;
    field public int lastTrimLevel;
    field public int lru;
    field public int pid;
    field public String[] pkgList;
    field public String processName;
    field public int uid;
  }

  public static class ActivityManager.RunningServiceInfo implements android.os.Parcelable {
    ctor public ActivityManager.RunningServiceInfo();
    method public int describeContents();
    method public void readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.ActivityManager.RunningServiceInfo> CREATOR;
    field public static final int FLAG_FOREGROUND = 2; // 0x2
    field public static final int FLAG_PERSISTENT_PROCESS = 8; // 0x8
    field public static final int FLAG_STARTED = 1; // 0x1
    field public static final int FLAG_SYSTEM_PROCESS = 4; // 0x4
    field public long activeSince;
    field public int clientCount;
    field public int clientLabel;
    field public String clientPackage;
    field public int crashCount;
    field public int flags;
    field public boolean foreground;
    field public long lastActivityTime;
    field public int pid;
    field public String process;
    field public long restarting;
    field public android.content.ComponentName service;
    field public boolean started;
    field public int uid;
  }

  public static class ActivityManager.RunningTaskInfo implements android.os.Parcelable {
    ctor public ActivityManager.RunningTaskInfo();
    method public int describeContents();
    method public void readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.ActivityManager.RunningTaskInfo> CREATOR;
    field public android.content.ComponentName baseActivity;
    field public CharSequence description;
    field public int id;
    field public int numActivities;
    field public int numRunning;
    field public android.graphics.Bitmap thumbnail;
    field public android.content.ComponentName topActivity;
  }

  public static class ActivityManager.TaskDescription implements android.os.Parcelable {
    ctor @Deprecated public ActivityManager.TaskDescription(String, android.graphics.Bitmap, int);
    ctor public ActivityManager.TaskDescription(String, @DrawableRes int, int);
    ctor @Deprecated public ActivityManager.TaskDescription(String, android.graphics.Bitmap);
    ctor public ActivityManager.TaskDescription(String, @DrawableRes int);
    ctor public ActivityManager.TaskDescription(String);
    ctor public ActivityManager.TaskDescription();
    ctor public ActivityManager.TaskDescription(android.app.ActivityManager.TaskDescription);
    method public int describeContents();
    method public android.graphics.Bitmap getIcon();
    method public String getLabel();
    method public int getPrimaryColor();
    method public void readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.ActivityManager.TaskDescription> CREATOR;
  }

  public class ActivityOptions {
    method @Nullable public android.graphics.Rect getLaunchBounds();
    method public int getLaunchDisplayId();
    method public boolean getLockTaskMode();
    method public static android.app.ActivityOptions makeBasic();
    method public static android.app.ActivityOptions makeClipRevealAnimation(android.view.View, int, int, int, int);
    method public static android.app.ActivityOptions makeCustomAnimation(android.content.Context, int, int);
    method public static android.app.ActivityOptions makeScaleUpAnimation(android.view.View, int, int, int, int);
    method public static android.app.ActivityOptions makeSceneTransitionAnimation(android.app.Activity, android.view.View, String);
    method @java.lang.SafeVarargs public static android.app.ActivityOptions makeSceneTransitionAnimation(android.app.Activity, android.util.Pair<android.view.View,java.lang.String>...);
    method public static android.app.ActivityOptions makeTaskLaunchBehind();
    method public static android.app.ActivityOptions makeThumbnailScaleUpAnimation(android.view.View, android.graphics.Bitmap, int, int);
    method public void requestUsageTimeReport(android.app.PendingIntent);
    method public android.app.ActivityOptions setAppVerificationBundle(android.os.Bundle);
    method public android.app.ActivityOptions setLaunchBounds(@Nullable android.graphics.Rect);
    method public android.app.ActivityOptions setLaunchDisplayId(int);
    method public android.app.ActivityOptions setLockTaskEnabled(boolean);
    method public android.os.Bundle toBundle();
    method public void update(android.app.ActivityOptions);
    field public static final String EXTRA_USAGE_TIME_REPORT = "android.activity.usage_time";
    field public static final String EXTRA_USAGE_TIME_REPORT_PACKAGES = "android.usage_time_packages";
  }

  public class AlarmManager {
    method public void cancel(android.app.PendingIntent);
    method public void cancel(android.app.AlarmManager.OnAlarmListener);
    method public android.app.AlarmManager.AlarmClockInfo getNextAlarmClock();
    method public void set(int, long, android.app.PendingIntent);
    method public void set(int, long, String, android.app.AlarmManager.OnAlarmListener, android.os.Handler);
    method public void setAlarmClock(android.app.AlarmManager.AlarmClockInfo, android.app.PendingIntent);
    method public void setAndAllowWhileIdle(int, long, android.app.PendingIntent);
    method public void setExact(int, long, android.app.PendingIntent);
    method public void setExact(int, long, String, android.app.AlarmManager.OnAlarmListener, android.os.Handler);
    method public void setExactAndAllowWhileIdle(int, long, android.app.PendingIntent);
    method public void setInexactRepeating(int, long, long, android.app.PendingIntent);
    method public void setRepeating(int, long, long, android.app.PendingIntent);
    method public void setTime(long);
    method public void setTimeZone(String);
    method public void setWindow(int, long, long, android.app.PendingIntent);
    method public void setWindow(int, long, long, String, android.app.AlarmManager.OnAlarmListener, android.os.Handler);
    field public static final String ACTION_NEXT_ALARM_CLOCK_CHANGED = "android.app.action.NEXT_ALARM_CLOCK_CHANGED";
    field public static final int ELAPSED_REALTIME = 3; // 0x3
    field public static final int ELAPSED_REALTIME_WAKEUP = 2; // 0x2
    field public static final long INTERVAL_DAY = 86400000L; // 0x5265c00L
    field public static final long INTERVAL_FIFTEEN_MINUTES = 900000L; // 0xdbba0L
    field public static final long INTERVAL_HALF_DAY = 43200000L; // 0x2932e00L
    field public static final long INTERVAL_HALF_HOUR = 1800000L; // 0x1b7740L
    field public static final long INTERVAL_HOUR = 3600000L; // 0x36ee80L
    field public static final int RTC = 1; // 0x1
    field public static final int RTC_WAKEUP = 0; // 0x0
  }

  public static final class AlarmManager.AlarmClockInfo implements android.os.Parcelable {
    ctor public AlarmManager.AlarmClockInfo(long, android.app.PendingIntent);
    method public int describeContents();
    method public android.app.PendingIntent getShowIntent();
    method public long getTriggerTime();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.AlarmManager.AlarmClockInfo> CREATOR;
  }

  public static interface AlarmManager.OnAlarmListener {
    method public void onAlarm();
  }

  public class AlertDialog extends android.app.Dialog implements android.content.DialogInterface {
    ctor protected AlertDialog(android.content.Context);
    ctor protected AlertDialog(android.content.Context, boolean, android.content.DialogInterface.OnCancelListener);
    ctor protected AlertDialog(android.content.Context, @StyleRes int);
    method public android.widget.Button getButton(int);
    method public android.widget.ListView getListView();
    method public void setButton(int, CharSequence, android.os.Message);
    method public void setButton(int, CharSequence, android.content.DialogInterface.OnClickListener);
    method @Deprecated public void setButton(CharSequence, android.os.Message);
    method @Deprecated public void setButton(CharSequence, android.content.DialogInterface.OnClickListener);
    method @Deprecated public void setButton2(CharSequence, android.os.Message);
    method @Deprecated public void setButton2(CharSequence, android.content.DialogInterface.OnClickListener);
    method @Deprecated public void setButton3(CharSequence, android.os.Message);
    method @Deprecated public void setButton3(CharSequence, android.content.DialogInterface.OnClickListener);
    method public void setCustomTitle(android.view.View);
    method public void setIcon(@DrawableRes int);
    method public void setIcon(android.graphics.drawable.Drawable);
    method public void setIconAttribute(@AttrRes int);
    method public void setInverseBackgroundForced(boolean);
    method public void setMessage(CharSequence);
    method public void setView(android.view.View);
    method public void setView(android.view.View, int, int, int, int);
    field @Deprecated public static final int THEME_DEVICE_DEFAULT_DARK = 4; // 0x4
    field @Deprecated public static final int THEME_DEVICE_DEFAULT_LIGHT = 5; // 0x5
    field @Deprecated public static final int THEME_HOLO_DARK = 2; // 0x2
    field @Deprecated public static final int THEME_HOLO_LIGHT = 3; // 0x3
    field @Deprecated public static final int THEME_TRADITIONAL = 1; // 0x1
  }

  public static class AlertDialog.Builder {
    ctor public AlertDialog.Builder(android.content.Context);
    ctor public AlertDialog.Builder(android.content.Context, int);
    method public android.app.AlertDialog create();
    method public android.content.Context getContext();
    method public android.app.AlertDialog.Builder setAdapter(android.widget.ListAdapter, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setCancelable(boolean);
    method public android.app.AlertDialog.Builder setCursor(android.database.Cursor, android.content.DialogInterface.OnClickListener, String);
    method public android.app.AlertDialog.Builder setCustomTitle(android.view.View);
    method public android.app.AlertDialog.Builder setIcon(@DrawableRes int);
    method public android.app.AlertDialog.Builder setIcon(android.graphics.drawable.Drawable);
    method public android.app.AlertDialog.Builder setIconAttribute(@AttrRes int);
    method @Deprecated public android.app.AlertDialog.Builder setInverseBackgroundForced(boolean);
    method public android.app.AlertDialog.Builder setItems(@ArrayRes int, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setItems(CharSequence[], android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setMessage(@StringRes int);
    method public android.app.AlertDialog.Builder setMessage(CharSequence);
    method public android.app.AlertDialog.Builder setMultiChoiceItems(@ArrayRes int, boolean[], android.content.DialogInterface.OnMultiChoiceClickListener);
    method public android.app.AlertDialog.Builder setMultiChoiceItems(CharSequence[], boolean[], android.content.DialogInterface.OnMultiChoiceClickListener);
    method public android.app.AlertDialog.Builder setMultiChoiceItems(android.database.Cursor, String, String, android.content.DialogInterface.OnMultiChoiceClickListener);
    method public android.app.AlertDialog.Builder setNegativeButton(@StringRes int, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setNegativeButton(CharSequence, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setNeutralButton(@StringRes int, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setNeutralButton(CharSequence, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setOnCancelListener(android.content.DialogInterface.OnCancelListener);
    method public android.app.AlertDialog.Builder setOnDismissListener(android.content.DialogInterface.OnDismissListener);
    method public android.app.AlertDialog.Builder setOnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener);
    method public android.app.AlertDialog.Builder setOnKeyListener(android.content.DialogInterface.OnKeyListener);
    method public android.app.AlertDialog.Builder setPositiveButton(@StringRes int, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setPositiveButton(CharSequence, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setSingleChoiceItems(@ArrayRes int, int, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setSingleChoiceItems(android.database.Cursor, int, String, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setSingleChoiceItems(CharSequence[], int, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setSingleChoiceItems(android.widget.ListAdapter, int, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setTitle(@StringRes int);
    method public android.app.AlertDialog.Builder setTitle(CharSequence);
    method public android.app.AlertDialog.Builder setView(int);
    method public android.app.AlertDialog.Builder setView(android.view.View);
    method public android.app.AlertDialog show();
  }

  public class AliasActivity extends android.app.Activity {
    ctor public AliasActivity();
  }

  public class AppComponentFactory {
    ctor public AppComponentFactory();
    method public android.content.pm.ApplicationInfo getApplicationInfo();
    method @NonNull public android.app.Activity instantiateActivity(@NonNull ClassLoader, @NonNull String, @Nullable android.content.Intent) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method @NonNull public android.app.Application instantiateApplication(@NonNull ClassLoader, @NonNull String) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method @NonNull public ClassLoader instantiateClassLoader(@NonNull ClassLoader);
    method @NonNull public android.content.ContentProvider instantiateProvider(@NonNull ClassLoader, @NonNull String) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method @NonNull public android.content.BroadcastReceiver instantiateReceiver(@NonNull ClassLoader, @NonNull String, @Nullable android.content.Intent) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method @NonNull public android.app.Service instantiateService(@NonNull ClassLoader, @NonNull String, @Nullable android.content.Intent) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
  }

  public class AppOpsManager {
    method public int checkOp(String, int, String);
    method public int checkOpNoThrow(String, int, String);
    method public void checkPackage(int, String);
    method public void finishOp(String, int, String);
    method public int noteOp(String, int, String);
    method public int noteOpNoThrow(String, int, String);
    method public int noteProxyOp(String, String);
    method public int noteProxyOpNoThrow(String, String);
    method public static String permissionToOp(String);
    method public int startOp(String, int, String);
    method public int startOpNoThrow(String, int, String);
    method public void startWatchingMode(String, String, android.app.AppOpsManager.OnOpChangedListener);
    method public void stopWatchingMode(android.app.AppOpsManager.OnOpChangedListener);
    field public static final int MODE_ALLOWED = 0; // 0x0
    field public static final int MODE_DEFAULT = 3; // 0x3
    field public static final int MODE_ERRORED = 2; // 0x2
    field public static final int MODE_IGNORED = 1; // 0x1
    field public static final String OPSTR_ADD_VOICEMAIL = "android:add_voicemail";
    field public static final String OPSTR_ANSWER_PHONE_CALLS = "android:answer_phone_calls";
    field public static final String OPSTR_BODY_SENSORS = "android:body_sensors";
    field public static final String OPSTR_CALL_PHONE = "android:call_phone";
    field public static final String OPSTR_CAMERA = "android:camera";
    field public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
    field public static final String OPSTR_FINE_LOCATION = "android:fine_location";
    field public static final String OPSTR_GET_USAGE_STATS = "android:get_usage_stats";
    field public static final String OPSTR_MOCK_LOCATION = "android:mock_location";
    field public static final String OPSTR_MONITOR_HIGH_POWER_LOCATION = "android:monitor_location_high_power";
    field public static final String OPSTR_MONITOR_LOCATION = "android:monitor_location";
    field public static final String OPSTR_PICTURE_IN_PICTURE = "android:picture_in_picture";
    field public static final String OPSTR_PROCESS_OUTGOING_CALLS = "android:process_outgoing_calls";
    field public static final String OPSTR_READ_CALENDAR = "android:read_calendar";
    field public static final String OPSTR_READ_CALL_LOG = "android:read_call_log";
    field public static final String OPSTR_READ_CELL_BROADCASTS = "android:read_cell_broadcasts";
    field public static final String OPSTR_READ_CONTACTS = "android:read_contacts";
    field public static final String OPSTR_READ_EXTERNAL_STORAGE = "android:read_external_storage";
    field public static final String OPSTR_READ_PHONE_NUMBERS = "android:read_phone_numbers";
    field public static final String OPSTR_READ_PHONE_STATE = "android:read_phone_state";
    field public static final String OPSTR_READ_SMS = "android:read_sms";
    field public static final String OPSTR_RECEIVE_MMS = "android:receive_mms";
    field public static final String OPSTR_RECEIVE_SMS = "android:receive_sms";
    field public static final String OPSTR_RECEIVE_WAP_PUSH = "android:receive_wap_push";
    field public static final String OPSTR_RECORD_AUDIO = "android:record_audio";
    field public static final String OPSTR_SEND_SMS = "android:send_sms";
    field public static final String OPSTR_SYSTEM_ALERT_WINDOW = "android:system_alert_window";
    field public static final String OPSTR_USE_FINGERPRINT = "android:use_fingerprint";
    field public static final String OPSTR_USE_SIP = "android:use_sip";
    field public static final String OPSTR_WRITE_CALENDAR = "android:write_calendar";
    field public static final String OPSTR_WRITE_CALL_LOG = "android:write_call_log";
    field public static final String OPSTR_WRITE_CONTACTS = "android:write_contacts";
    field public static final String OPSTR_WRITE_EXTERNAL_STORAGE = "android:write_external_storage";
    field public static final String OPSTR_WRITE_SETTINGS = "android:write_settings";
  }

  public static interface AppOpsManager.OnOpChangedListener {
    method public void onOpChanged(String, String);
  }

  public class Application extends android.content.ContextWrapper implements android.content.ComponentCallbacks2 {
    ctor public Application();
    method public static String getProcessName();
    method @CallSuper public void onConfigurationChanged(android.content.res.Configuration);
    method @CallSuper public void onCreate();
    method @CallSuper public void onLowMemory();
    method @CallSuper public void onTerminate();
    method @CallSuper public void onTrimMemory(int);
    method public void registerActivityLifecycleCallbacks(android.app.Application.ActivityLifecycleCallbacks);
    method public void registerOnProvideAssistDataListener(android.app.Application.OnProvideAssistDataListener);
    method public void unregisterActivityLifecycleCallbacks(android.app.Application.ActivityLifecycleCallbacks);
    method public void unregisterOnProvideAssistDataListener(android.app.Application.OnProvideAssistDataListener);
  }

  public static interface Application.ActivityLifecycleCallbacks {
    method public void onActivityCreated(android.app.Activity, android.os.Bundle);
    method public void onActivityDestroyed(android.app.Activity);
    method public void onActivityPaused(android.app.Activity);
    method public void onActivityResumed(android.app.Activity);
    method public void onActivitySaveInstanceState(android.app.Activity, android.os.Bundle);
    method public void onActivityStarted(android.app.Activity);
    method public void onActivityStopped(android.app.Activity);
  }

  public static interface Application.OnProvideAssistDataListener {
    method public void onProvideAssistData(android.app.Activity, android.os.Bundle);
  }

  public class ApplicationErrorReport implements android.os.Parcelable {
    ctor public ApplicationErrorReport();
    method public int describeContents();
    method public void dump(android.util.Printer, String);
    method public static android.content.ComponentName getErrorReportReceiver(android.content.Context, String, int);
    method public void readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.ApplicationErrorReport> CREATOR;
    field public static final int TYPE_ANR = 2; // 0x2
    field public static final int TYPE_BATTERY = 3; // 0x3
    field public static final int TYPE_CRASH = 1; // 0x1
    field public static final int TYPE_NONE = 0; // 0x0
    field public static final int TYPE_RUNNING_SERVICE = 5; // 0x5
    field public android.app.ApplicationErrorReport.AnrInfo anrInfo;
    field public android.app.ApplicationErrorReport.BatteryInfo batteryInfo;
    field public android.app.ApplicationErrorReport.CrashInfo crashInfo;
    field public String installerPackageName;
    field public String packageName;
    field public String processName;
    field public android.app.ApplicationErrorReport.RunningServiceInfo runningServiceInfo;
    field public boolean systemApp;
    field public long time;
    field public int type;
  }

  public static class ApplicationErrorReport.AnrInfo {
    ctor public ApplicationErrorReport.AnrInfo();
    ctor public ApplicationErrorReport.AnrInfo(android.os.Parcel);
    method public void dump(android.util.Printer, String);
    method public void writeToParcel(android.os.Parcel, int);
    field public String activity;
    field public String cause;
    field public String info;
  }

  public static class ApplicationErrorReport.BatteryInfo {
    ctor public ApplicationErrorReport.BatteryInfo();
    ctor public ApplicationErrorReport.BatteryInfo(android.os.Parcel);
    method public void dump(android.util.Printer, String);
    method public void writeToParcel(android.os.Parcel, int);
    field public String checkinDetails;
    field public long durationMicros;
    field public String usageDetails;
    field public int usagePercent;
  }

  public static class ApplicationErrorReport.CrashInfo {
    ctor public ApplicationErrorReport.CrashInfo();
    ctor public ApplicationErrorReport.CrashInfo(Throwable);
    ctor public ApplicationErrorReport.CrashInfo(android.os.Parcel);
    method public void dump(android.util.Printer, String);
    method public void writeToParcel(android.os.Parcel, int);
    field public String exceptionClassName;
    field public String exceptionMessage;
    field public String stackTrace;
    field public String throwClassName;
    field public String throwFileName;
    field public int throwLineNumber;
    field public String throwMethodName;
  }

  public static class ApplicationErrorReport.RunningServiceInfo {
    ctor public ApplicationErrorReport.RunningServiceInfo();
    ctor public ApplicationErrorReport.RunningServiceInfo(android.os.Parcel);
    method public void dump(android.util.Printer, String);
    method public void writeToParcel(android.os.Parcel, int);
    field public long durationMillis;
    field public String serviceDetails;
  }

  public final class AuthenticationRequiredException extends java.lang.SecurityException implements android.os.Parcelable {
    ctor public AuthenticationRequiredException(Throwable, android.app.PendingIntent);
    method public int describeContents();
    method public android.app.PendingIntent getUserAction();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.AuthenticationRequiredException> CREATOR;
  }

  public final class AutomaticZenRule implements android.os.Parcelable {
    ctor public AutomaticZenRule(String, android.content.ComponentName, android.net.Uri, int, boolean);
    ctor public AutomaticZenRule(android.os.Parcel);
    method public int describeContents();
    method public android.net.Uri getConditionId();
    method public long getCreationTime();
    method public int getInterruptionFilter();
    method public String getName();
    method public android.content.ComponentName getOwner();
    method public boolean isEnabled();
    method public void setConditionId(android.net.Uri);
    method public void setEnabled(boolean);
    method public void setInterruptionFilter(int);
    method public void setName(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.AutomaticZenRule> CREATOR;
  }

  public class DatePickerDialog extends android.app.AlertDialog implements android.widget.DatePicker.OnDateChangedListener android.content.DialogInterface.OnClickListener {
    ctor public DatePickerDialog(@NonNull android.content.Context);
    ctor public DatePickerDialog(@NonNull android.content.Context, @StyleRes int);
    ctor public DatePickerDialog(@NonNull android.content.Context, @Nullable android.app.DatePickerDialog.OnDateSetListener, int, int, int);
    ctor public DatePickerDialog(@NonNull android.content.Context, @StyleRes int, @Nullable android.app.DatePickerDialog.OnDateSetListener, int, int, int);
    method @NonNull public android.widget.DatePicker getDatePicker();
    method public void onClick(@NonNull android.content.DialogInterface, int);
    method public void onDateChanged(@NonNull android.widget.DatePicker, int, int, int);
    method public void setOnDateSetListener(@Nullable android.app.DatePickerDialog.OnDateSetListener);
    method public void updateDate(int, int, int);
  }

  public static interface DatePickerDialog.OnDateSetListener {
    method public void onDateSet(android.widget.DatePicker, int, int, int);
  }

  public class Dialog implements android.content.DialogInterface android.view.KeyEvent.Callback android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
    ctor public Dialog(@NonNull android.content.Context);
    ctor public Dialog(@NonNull android.content.Context, @StyleRes int);
    ctor protected Dialog(@NonNull android.content.Context, boolean, @Nullable android.content.DialogInterface.OnCancelListener);
    method public void addContentView(@NonNull android.view.View, @Nullable android.view.ViewGroup.LayoutParams);
    method public void cancel();
    method public void closeOptionsMenu();
    method public void create();
    method public void dismiss();
    method public boolean dispatchGenericMotionEvent(@NonNull android.view.MotionEvent);
    method public boolean dispatchKeyEvent(@NonNull android.view.KeyEvent);
    method public boolean dispatchKeyShortcutEvent(@NonNull android.view.KeyEvent);
    method public boolean dispatchPopulateAccessibilityEvent(@NonNull android.view.accessibility.AccessibilityEvent);
    method public boolean dispatchTouchEvent(@NonNull android.view.MotionEvent);
    method public boolean dispatchTrackballEvent(@NonNull android.view.MotionEvent);
    method public <T extends android.view.View> T findViewById(@IdRes int);
    method @Nullable public android.app.ActionBar getActionBar();
    method @NonNull public final android.content.Context getContext();
    method @Nullable public android.view.View getCurrentFocus();
    method @NonNull public android.view.LayoutInflater getLayoutInflater();
    method @Nullable public final android.app.Activity getOwnerActivity();
    method @Nullable public final android.view.SearchEvent getSearchEvent();
    method public final int getVolumeControlStream();
    method @Nullable public android.view.Window getWindow();
    method public void hide();
    method public void invalidateOptionsMenu();
    method public boolean isShowing();
    method @CallSuper public void onActionModeFinished(android.view.ActionMode);
    method @CallSuper public void onActionModeStarted(android.view.ActionMode);
    method public void onAttachedToWindow();
    method public void onBackPressed();
    method public void onContentChanged();
    method public boolean onContextItemSelected(@NonNull android.view.MenuItem);
    method public void onContextMenuClosed(@NonNull android.view.Menu);
    method protected void onCreate(android.os.Bundle);
    method public void onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo);
    method public boolean onCreateOptionsMenu(@NonNull android.view.Menu);
    method public boolean onCreatePanelMenu(int, @NonNull android.view.Menu);
    method public android.view.View onCreatePanelView(int);
    method public void onDetachedFromWindow();
    method public boolean onGenericMotionEvent(@NonNull android.view.MotionEvent);
    method public boolean onKeyDown(int, @NonNull android.view.KeyEvent);
    method public boolean onKeyLongPress(int, @NonNull android.view.KeyEvent);
    method public boolean onKeyMultiple(int, int, @NonNull android.view.KeyEvent);
    method public boolean onKeyShortcut(int, @NonNull android.view.KeyEvent);
    method public boolean onKeyUp(int, @NonNull android.view.KeyEvent);
    method public boolean onMenuItemSelected(int, android.view.MenuItem);
    method public boolean onMenuOpened(int, android.view.Menu);
    method public boolean onOptionsItemSelected(@NonNull android.view.MenuItem);
    method public void onOptionsMenuClosed(@NonNull android.view.Menu);
    method public void onPanelClosed(int, android.view.Menu);
    method public boolean onPrepareOptionsMenu(@NonNull android.view.Menu);
    method public boolean onPreparePanel(int, android.view.View, android.view.Menu);
    method public void onRestoreInstanceState(@NonNull android.os.Bundle);
    method @NonNull public android.os.Bundle onSaveInstanceState();
    method public boolean onSearchRequested(@NonNull android.view.SearchEvent);
    method public boolean onSearchRequested();
    method protected void onStart();
    method protected void onStop();
    method public boolean onTouchEvent(@NonNull android.view.MotionEvent);
    method public boolean onTrackballEvent(@NonNull android.view.MotionEvent);
    method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams);
    method public void onWindowFocusChanged(boolean);
    method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback);
    method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback, int);
    method public void openContextMenu(@NonNull android.view.View);
    method public void openOptionsMenu();
    method public void registerForContextMenu(@NonNull android.view.View);
    method public final boolean requestWindowFeature(int);
    method @NonNull public final <T extends android.view.View> T requireViewById(@IdRes int);
    method public void setCancelMessage(@Nullable android.os.Message);
    method public void setCancelable(boolean);
    method public void setCanceledOnTouchOutside(boolean);
    method public void setContentView(@LayoutRes int);
    method public void setContentView(@NonNull android.view.View);
    method public void setContentView(@NonNull android.view.View, @Nullable android.view.ViewGroup.LayoutParams);
    method public void setDismissMessage(@Nullable android.os.Message);
    method public final void setFeatureDrawable(int, @Nullable android.graphics.drawable.Drawable);
    method public final void setFeatureDrawableAlpha(int, int);
    method public final void setFeatureDrawableResource(int, @DrawableRes int);
    method public final void setFeatureDrawableUri(int, @Nullable android.net.Uri);
    method public void setOnCancelListener(@Nullable android.content.DialogInterface.OnCancelListener);
    method public void setOnDismissListener(@Nullable android.content.DialogInterface.OnDismissListener);
    method public void setOnKeyListener(@Nullable android.content.DialogInterface.OnKeyListener);
    method public void setOnShowListener(@Nullable android.content.DialogInterface.OnShowListener);
    method public final void setOwnerActivity(@NonNull android.app.Activity);
    method public void setTitle(@Nullable CharSequence);
    method public void setTitle(@StringRes int);
    method public final void setVolumeControlStream(int);
    method public void show();
    method public void takeKeyEvents(boolean);
    method public void unregisterForContextMenu(@NonNull android.view.View);
  }

  @Deprecated public class DialogFragment extends android.app.Fragment implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
    ctor @Deprecated public DialogFragment();
    method @Deprecated public void dismiss();
    method @Deprecated public void dismissAllowingStateLoss();
    method @Deprecated public android.app.Dialog getDialog();
    method @Deprecated public boolean getShowsDialog();
    method @Deprecated public int getTheme();
    method @Deprecated public boolean isCancelable();
    method @Deprecated public void onCancel(android.content.DialogInterface);
    method @Deprecated public android.app.Dialog onCreateDialog(android.os.Bundle);
    method @Deprecated public void onDismiss(android.content.DialogInterface);
    method public android.view.LayoutInflater onGetLayoutInflater(android.os.Bundle);
    method @Deprecated public void setCancelable(boolean);
    method @Deprecated public void setShowsDialog(boolean);
    method @Deprecated public void setStyle(int, int);
    method @Deprecated public void show(android.app.FragmentManager, String);
    method @Deprecated public int show(android.app.FragmentTransaction, String);
    field @Deprecated public static final int STYLE_NORMAL = 0; // 0x0
    field @Deprecated public static final int STYLE_NO_FRAME = 2; // 0x2
    field @Deprecated public static final int STYLE_NO_INPUT = 3; // 0x3
    field @Deprecated public static final int STYLE_NO_TITLE = 1; // 0x1
  }

  public class DownloadManager {
    method public long addCompletedDownload(String, String, boolean, String, String, long, boolean);
    method public long addCompletedDownload(String, String, boolean, String, String, long, boolean, android.net.Uri, android.net.Uri);
    method public long enqueue(android.app.DownloadManager.Request);
    method public static Long getMaxBytesOverMobile(android.content.Context);
    method public String getMimeTypeForDownloadedFile(long);
    method public static Long getRecommendedMaxBytesOverMobile(android.content.Context);
    method public android.net.Uri getUriForDownloadedFile(long);
    method public android.os.ParcelFileDescriptor openDownloadedFile(long) throws java.io.FileNotFoundException;
    method public android.database.Cursor query(android.app.DownloadManager.Query);
    method public int remove(long...);
    field public static final String ACTION_DOWNLOAD_COMPLETE = "android.intent.action.DOWNLOAD_COMPLETE";
    field public static final String ACTION_NOTIFICATION_CLICKED = "android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED";
    field public static final String ACTION_VIEW_DOWNLOADS = "android.intent.action.VIEW_DOWNLOADS";
    field public static final String COLUMN_BYTES_DOWNLOADED_SO_FAR = "bytes_so_far";
    field public static final String COLUMN_DESCRIPTION = "description";
    field public static final String COLUMN_ID = "_id";
    field public static final String COLUMN_LAST_MODIFIED_TIMESTAMP = "last_modified_timestamp";
    field @Deprecated public static final String COLUMN_LOCAL_FILENAME = "local_filename";
    field public static final String COLUMN_LOCAL_URI = "local_uri";
    field public static final String COLUMN_MEDIAPROVIDER_URI = "mediaprovider_uri";
    field public static final String COLUMN_MEDIA_TYPE = "media_type";
    field public static final String COLUMN_REASON = "reason";
    field public static final String COLUMN_STATUS = "status";
    field public static final String COLUMN_TITLE = "title";
    field public static final String COLUMN_TOTAL_SIZE_BYTES = "total_size";
    field public static final String COLUMN_URI = "uri";
    field public static final int ERROR_CANNOT_RESUME = 1008; // 0x3f0
    field public static final int ERROR_DEVICE_NOT_FOUND = 1007; // 0x3ef
    field public static final int ERROR_FILE_ALREADY_EXISTS = 1009; // 0x3f1
    field public static final int ERROR_FILE_ERROR = 1001; // 0x3e9
    field public static final int ERROR_HTTP_DATA_ERROR = 1004; // 0x3ec
    field public static final int ERROR_INSUFFICIENT_SPACE = 1006; // 0x3ee
    field public static final int ERROR_TOO_MANY_REDIRECTS = 1005; // 0x3ed
    field public static final int ERROR_UNHANDLED_HTTP_CODE = 1002; // 0x3ea
    field public static final int ERROR_UNKNOWN = 1000; // 0x3e8
    field public static final String EXTRA_DOWNLOAD_ID = "extra_download_id";
    field public static final String EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS = "extra_click_download_ids";
    field public static final String INTENT_EXTRAS_SORT_BY_SIZE = "android.app.DownloadManager.extra_sortBySize";
    field public static final int PAUSED_QUEUED_FOR_WIFI = 3; // 0x3
    field public static final int PAUSED_UNKNOWN = 4; // 0x4
    field public static final int PAUSED_WAITING_FOR_NETWORK = 2; // 0x2
    field public static final int PAUSED_WAITING_TO_RETRY = 1; // 0x1
    field public static final int STATUS_FAILED = 16; // 0x10
    field public static final int STATUS_PAUSED = 4; // 0x4
    field public static final int STATUS_PENDING = 1; // 0x1
    field public static final int STATUS_RUNNING = 2; // 0x2
    field public static final int STATUS_SUCCESSFUL = 8; // 0x8
  }

  public static class DownloadManager.Query {
    ctor public DownloadManager.Query();
    method public android.app.DownloadManager.Query setFilterById(long...);
    method public android.app.DownloadManager.Query setFilterByStatus(int);
  }

  public static class DownloadManager.Request {
    ctor public DownloadManager.Request(android.net.Uri);
    method public android.app.DownloadManager.Request addRequestHeader(String, String);
    method public void allowScanningByMediaScanner();
    method public android.app.DownloadManager.Request setAllowedNetworkTypes(int);
    method public android.app.DownloadManager.Request setAllowedOverMetered(boolean);
    method public android.app.DownloadManager.Request setAllowedOverRoaming(boolean);
    method public android.app.DownloadManager.Request setDescription(CharSequence);
    method public android.app.DownloadManager.Request setDestinationInExternalFilesDir(android.content.Context, String, String);
    method public android.app.DownloadManager.Request setDestinationInExternalPublicDir(String, String);
    method public android.app.DownloadManager.Request setDestinationUri(android.net.Uri);
    method public android.app.DownloadManager.Request setMimeType(String);
    method public android.app.DownloadManager.Request setNotificationVisibility(int);
    method public android.app.DownloadManager.Request setRequiresCharging(boolean);
    method public android.app.DownloadManager.Request setRequiresDeviceIdle(boolean);
    method @Deprecated public android.app.DownloadManager.Request setShowRunningNotification(boolean);
    method public android.app.DownloadManager.Request setTitle(CharSequence);
    method public android.app.DownloadManager.Request setVisibleInDownloadsUi(boolean);
    field public static final int NETWORK_MOBILE = 1; // 0x1
    field public static final int NETWORK_WIFI = 2; // 0x2
    field public static final int VISIBILITY_HIDDEN = 2; // 0x2
    field public static final int VISIBILITY_VISIBLE = 0; // 0x0
    field public static final int VISIBILITY_VISIBLE_NOTIFY_COMPLETED = 1; // 0x1
    field public static final int VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION = 3; // 0x3
  }

  public class ExpandableListActivity extends android.app.Activity implements android.widget.ExpandableListView.OnChildClickListener android.widget.ExpandableListView.OnGroupCollapseListener android.widget.ExpandableListView.OnGroupExpandListener android.view.View.OnCreateContextMenuListener {
    ctor public ExpandableListActivity();
    method public android.widget.ExpandableListAdapter getExpandableListAdapter();
    method public android.widget.ExpandableListView getExpandableListView();
    method public long getSelectedId();
    method public long getSelectedPosition();
    method public boolean onChildClick(android.widget.ExpandableListView, android.view.View, int, int, long);
    method public void onGroupCollapse(int);
    method public void onGroupExpand(int);
    method public void setListAdapter(android.widget.ExpandableListAdapter);
    method public boolean setSelectedChild(int, int, boolean);
    method public void setSelectedGroup(int);
  }

  @Deprecated public class Fragment implements android.content.ComponentCallbacks2 android.view.View.OnCreateContextMenuListener {
    ctor @Deprecated public Fragment();
    method @Deprecated public void dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method @Deprecated public final boolean equals(Object);
    method @Deprecated public final android.app.Activity getActivity();
    method @Deprecated public boolean getAllowEnterTransitionOverlap();
    method @Deprecated public boolean getAllowReturnTransitionOverlap();
    method @Deprecated public final android.os.Bundle getArguments();
    method @Deprecated public final android.app.FragmentManager getChildFragmentManager();
    method @Deprecated public android.content.Context getContext();
    method @Deprecated public android.transition.Transition getEnterTransition();
    method @Deprecated public android.transition.Transition getExitTransition();
    method @Deprecated public final android.app.FragmentManager getFragmentManager();
    method @Deprecated @Nullable public final Object getHost();
    method @Deprecated public final int getId();
    method @Deprecated public final android.view.LayoutInflater getLayoutInflater();
    method @Deprecated public android.app.LoaderManager getLoaderManager();
    method @Deprecated public final android.app.Fragment getParentFragment();
    method @Deprecated public android.transition.Transition getReenterTransition();
    method @Deprecated public final android.content.res.Resources getResources();
    method @Deprecated public final boolean getRetainInstance();
    method @Deprecated public android.transition.Transition getReturnTransition();
    method @Deprecated public android.transition.Transition getSharedElementEnterTransition();
    method @Deprecated public android.transition.Transition getSharedElementReturnTransition();
    method @Deprecated public final String getString(@StringRes int);
    method @Deprecated public final String getString(@StringRes int, java.lang.Object...);
    method @Deprecated public final String getTag();
    method @Deprecated public final android.app.Fragment getTargetFragment();
    method @Deprecated public final int getTargetRequestCode();
    method @Deprecated public final CharSequence getText(@StringRes int);
    method @Deprecated public boolean getUserVisibleHint();
    method @Deprecated @Nullable public android.view.View getView();
    method @Deprecated public final int hashCode();
    method @Deprecated public static android.app.Fragment instantiate(android.content.Context, String);
    method @Deprecated public static android.app.Fragment instantiate(android.content.Context, String, @Nullable android.os.Bundle);
    method @Deprecated public final boolean isAdded();
    method @Deprecated public final boolean isDetached();
    method @Deprecated public final boolean isHidden();
    method @Deprecated public final boolean isInLayout();
    method @Deprecated public final boolean isRemoving();
    method @Deprecated public final boolean isResumed();
    method @Deprecated public final boolean isStateSaved();
    method @Deprecated public final boolean isVisible();
    method @Deprecated @CallSuper public void onActivityCreated(@Nullable android.os.Bundle);
    method @Deprecated public void onActivityResult(int, int, android.content.Intent);
    method @Deprecated @CallSuper public void onAttach(android.content.Context);
    method @Deprecated @CallSuper public void onAttach(android.app.Activity);
    method @Deprecated public void onAttachFragment(android.app.Fragment);
    method @Deprecated @CallSuper public void onConfigurationChanged(android.content.res.Configuration);
    method @Deprecated public boolean onContextItemSelected(android.view.MenuItem);
    method @Deprecated @CallSuper public void onCreate(@Nullable android.os.Bundle);
    method @Deprecated public android.animation.Animator onCreateAnimator(int, boolean, int);
    method @Deprecated public void onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo);
    method @Deprecated public void onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater);
    method @Deprecated @Nullable public android.view.View onCreateView(android.view.LayoutInflater, @Nullable android.view.ViewGroup, android.os.Bundle);
    method @Deprecated @CallSuper public void onDestroy();
    method @Deprecated public void onDestroyOptionsMenu();
    method @Deprecated @CallSuper public void onDestroyView();
    method @Deprecated @CallSuper public void onDetach();
    method @Deprecated public android.view.LayoutInflater onGetLayoutInflater(android.os.Bundle);
    method @Deprecated public void onHiddenChanged(boolean);
    method @Deprecated @CallSuper public void onInflate(android.util.AttributeSet, android.os.Bundle);
    method @Deprecated @CallSuper public void onInflate(android.content.Context, android.util.AttributeSet, android.os.Bundle);
    method @Deprecated @CallSuper public void onInflate(android.app.Activity, android.util.AttributeSet, android.os.Bundle);
    method @Deprecated @CallSuper public void onLowMemory();
    method @Deprecated public void onMultiWindowModeChanged(boolean, android.content.res.Configuration);
    method @Deprecated public void onMultiWindowModeChanged(boolean);
    method @Deprecated public boolean onOptionsItemSelected(android.view.MenuItem);
    method @Deprecated public void onOptionsMenuClosed(android.view.Menu);
    method @Deprecated @CallSuper public void onPause();
    method @Deprecated public void onPictureInPictureModeChanged(boolean, android.content.res.Configuration);
    method @Deprecated public void onPictureInPictureModeChanged(boolean);
    method @Deprecated public void onPrepareOptionsMenu(android.view.Menu);
    method @Deprecated public void onRequestPermissionsResult(int, @NonNull String[], @NonNull int[]);
    method @Deprecated @CallSuper public void onResume();
    method @Deprecated public void onSaveInstanceState(android.os.Bundle);
    method @Deprecated @CallSuper public void onStart();
    method @Deprecated @CallSuper public void onStop();
    method @Deprecated @CallSuper public void onTrimMemory(int);
    method @Deprecated public void onViewCreated(android.view.View, @Nullable android.os.Bundle);
    method @Deprecated @CallSuper public void onViewStateRestored(android.os.Bundle);
    method @Deprecated public void postponeEnterTransition();
    method @Deprecated public void registerForContextMenu(android.view.View);
    method @Deprecated public final void requestPermissions(@NonNull String[], int);
    method @Deprecated public void setAllowEnterTransitionOverlap(boolean);
    method @Deprecated public void setAllowReturnTransitionOverlap(boolean);
    method @Deprecated public void setArguments(android.os.Bundle);
    method @Deprecated public void setEnterSharedElementCallback(android.app.SharedElementCallback);
    method @Deprecated public void setEnterTransition(android.transition.Transition);
    method @Deprecated public void setExitSharedElementCallback(android.app.SharedElementCallback);
    method @Deprecated public void setExitTransition(android.transition.Transition);
    method @Deprecated public void setHasOptionsMenu(boolean);
    method @Deprecated public void setInitialSavedState(android.app.Fragment.SavedState);
    method @Deprecated public void setMenuVisibility(boolean);
    method @Deprecated public void setReenterTransition(android.transition.Transition);
    method @Deprecated public void setRetainInstance(boolean);
    method @Deprecated public void setReturnTransition(android.transition.Transition);
    method @Deprecated public void setSharedElementEnterTransition(android.transition.Transition);
    method @Deprecated public void setSharedElementReturnTransition(android.transition.Transition);
    method @Deprecated public void setTargetFragment(android.app.Fragment, int);
    method @Deprecated public void setUserVisibleHint(boolean);
    method @Deprecated public boolean shouldShowRequestPermissionRationale(@NonNull String);
    method @Deprecated public void startActivity(android.content.Intent);
    method @Deprecated public void startActivity(android.content.Intent, android.os.Bundle);
    method @Deprecated public void startActivityForResult(android.content.Intent, int);
    method @Deprecated public void startActivityForResult(android.content.Intent, int, android.os.Bundle);
    method @Deprecated public void startIntentSenderForResult(android.content.IntentSender, int, @Nullable android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method @Deprecated public void startPostponedEnterTransition();
    method @Deprecated public void unregisterForContextMenu(android.view.View);
  }

  @Deprecated public static class Fragment.InstantiationException extends android.util.AndroidRuntimeException {
    ctor @Deprecated public Fragment.InstantiationException(String, Exception);
  }

  @Deprecated public static class Fragment.SavedState implements android.os.Parcelable {
    method @Deprecated public int describeContents();
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public static final android.os.Parcelable.ClassLoaderCreator<android.app.Fragment.SavedState> CREATOR;
  }

  @Deprecated public class FragmentBreadCrumbs extends android.view.ViewGroup implements android.app.FragmentManager.OnBackStackChangedListener {
    ctor @Deprecated public FragmentBreadCrumbs(android.content.Context);
    ctor @Deprecated public FragmentBreadCrumbs(android.content.Context, android.util.AttributeSet);
    ctor @Deprecated public FragmentBreadCrumbs(android.content.Context, android.util.AttributeSet, int);
    method @Deprecated public void onBackStackChanged();
    method @Deprecated public void setActivity(android.app.Activity);
    method @Deprecated public void setMaxVisible(int);
    method @Deprecated public void setOnBreadCrumbClickListener(android.app.FragmentBreadCrumbs.OnBreadCrumbClickListener);
    method @Deprecated public void setParentTitle(CharSequence, CharSequence, android.view.View.OnClickListener);
    method @Deprecated public void setTitle(CharSequence, CharSequence);
  }

  @Deprecated public static interface FragmentBreadCrumbs.OnBreadCrumbClickListener {
    method @Deprecated public boolean onBreadCrumbClick(android.app.FragmentManager.BackStackEntry, int);
  }

  @Deprecated public abstract class FragmentContainer {
    ctor @Deprecated public FragmentContainer();
    method @Deprecated @Nullable public abstract <T extends android.view.View> T onFindViewById(@IdRes int);
    method @Deprecated public abstract boolean onHasView();
  }

  @Deprecated public class FragmentController {
    method @Deprecated public void attachHost(android.app.Fragment);
    method @Deprecated public static final android.app.FragmentController createController(android.app.FragmentHostCallback<?>);
    method @Deprecated public void dispatchActivityCreated();
    method @Deprecated public void dispatchConfigurationChanged(android.content.res.Configuration);
    method @Deprecated public boolean dispatchContextItemSelected(android.view.MenuItem);
    method @Deprecated public void dispatchCreate();
    method @Deprecated public boolean dispatchCreateOptionsMenu(android.view.Menu, android.view.MenuInflater);
    method @Deprecated public void dispatchDestroy();
    method @Deprecated public void dispatchDestroyView();
    method @Deprecated public void dispatchLowMemory();
    method @Deprecated public void dispatchMultiWindowModeChanged(boolean);
    method @Deprecated public void dispatchMultiWindowModeChanged(boolean, android.content.res.Configuration);
    method @Deprecated public boolean dispatchOptionsItemSelected(android.view.MenuItem);
    method @Deprecated public void dispatchOptionsMenuClosed(android.view.Menu);
    method @Deprecated public void dispatchPause();
    method @Deprecated public void dispatchPictureInPictureModeChanged(boolean);
    method @Deprecated public void dispatchPictureInPictureModeChanged(boolean, android.content.res.Configuration);
    method @Deprecated public boolean dispatchPrepareOptionsMenu(android.view.Menu);
    method @Deprecated public void dispatchResume();
    method @Deprecated public void dispatchStart();
    method @Deprecated public void dispatchStop();
    method @Deprecated public void dispatchTrimMemory(int);
    method @Deprecated public void doLoaderDestroy();
    method @Deprecated public void doLoaderStart();
    method @Deprecated public void doLoaderStop(boolean);
    method @Deprecated public void dumpLoaders(String, java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method @Deprecated public boolean execPendingActions();
    method @Deprecated @Nullable public android.app.Fragment findFragmentByWho(String);
    method @Deprecated public android.app.FragmentManager getFragmentManager();
    method @Deprecated public android.app.LoaderManager getLoaderManager();
    method @Deprecated public void noteStateNotSaved();
    method @Deprecated public android.view.View onCreateView(android.view.View, String, android.content.Context, android.util.AttributeSet);
    method @Deprecated public void reportLoaderStart();
    method @Deprecated public void restoreAllState(android.os.Parcelable, java.util.List<android.app.Fragment>);
    method @Deprecated public void restoreAllState(android.os.Parcelable, android.app.FragmentManagerNonConfig);
    method @Deprecated public void restoreLoaderNonConfig(android.util.ArrayMap<java.lang.String,android.app.LoaderManager>);
    method @Deprecated public android.util.ArrayMap<java.lang.String,android.app.LoaderManager> retainLoaderNonConfig();
    method @Deprecated public android.app.FragmentManagerNonConfig retainNestedNonConfig();
    method @Deprecated public java.util.List<android.app.Fragment> retainNonConfig();
    method @Deprecated public android.os.Parcelable saveAllState();
  }

  @Deprecated public abstract class FragmentHostCallback<E> extends android.app.FragmentContainer {
    ctor @Deprecated public FragmentHostCallback(android.content.Context, android.os.Handler, int);
    method @Deprecated public void onAttachFragment(android.app.Fragment);
    method @Deprecated public void onDump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method @Deprecated @Nullable public <T extends android.view.View> T onFindViewById(int);
    method @Deprecated @Nullable public abstract E onGetHost();
    method @Deprecated public android.view.LayoutInflater onGetLayoutInflater();
    method @Deprecated public int onGetWindowAnimations();
    method @Deprecated public boolean onHasView();
    method @Deprecated public boolean onHasWindowAnimations();
    method @Deprecated public void onInvalidateOptionsMenu();
    method @Deprecated public void onRequestPermissionsFromFragment(@NonNull android.app.Fragment, @NonNull String[], int);
    method @Deprecated public boolean onShouldSaveFragmentState(android.app.Fragment);
    method @Deprecated public void onStartActivityFromFragment(android.app.Fragment, android.content.Intent, int, android.os.Bundle);
    method @Deprecated public void onStartIntentSenderFromFragment(android.app.Fragment, android.content.IntentSender, int, @Nullable android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method @Deprecated public boolean onUseFragmentManagerInflaterFactory();
  }

  @Deprecated public abstract class FragmentManager {
    ctor @Deprecated public FragmentManager();
    method @Deprecated public abstract void addOnBackStackChangedListener(android.app.FragmentManager.OnBackStackChangedListener);
    method @Deprecated public abstract android.app.FragmentTransaction beginTransaction();
    method @Deprecated public abstract void dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method @Deprecated public static void enableDebugLogging(boolean);
    method @Deprecated public abstract boolean executePendingTransactions();
    method @Deprecated public abstract android.app.Fragment findFragmentById(int);
    method @Deprecated public abstract android.app.Fragment findFragmentByTag(String);
    method @Deprecated public abstract android.app.FragmentManager.BackStackEntry getBackStackEntryAt(int);
    method @Deprecated public abstract int getBackStackEntryCount();
    method @Deprecated public abstract android.app.Fragment getFragment(android.os.Bundle, String);
    method @Deprecated public abstract java.util.List<android.app.Fragment> getFragments();
    method @Deprecated public abstract android.app.Fragment getPrimaryNavigationFragment();
    method @Deprecated public void invalidateOptionsMenu();
    method @Deprecated public abstract boolean isDestroyed();
    method @Deprecated public abstract boolean isStateSaved();
    method @Deprecated public abstract void popBackStack();
    method @Deprecated public abstract void popBackStack(String, int);
    method @Deprecated public abstract void popBackStack(int, int);
    method @Deprecated public abstract boolean popBackStackImmediate();
    method @Deprecated public abstract boolean popBackStackImmediate(String, int);
    method @Deprecated public abstract boolean popBackStackImmediate(int, int);
    method @Deprecated public abstract void putFragment(android.os.Bundle, String, android.app.Fragment);
    method @Deprecated public abstract void registerFragmentLifecycleCallbacks(android.app.FragmentManager.FragmentLifecycleCallbacks, boolean);
    method @Deprecated public abstract void removeOnBackStackChangedListener(android.app.FragmentManager.OnBackStackChangedListener);
    method @Deprecated public abstract android.app.Fragment.SavedState saveFragmentInstanceState(android.app.Fragment);
    method @Deprecated public abstract void unregisterFragmentLifecycleCallbacks(android.app.FragmentManager.FragmentLifecycleCallbacks);
    field @Deprecated public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
  }

  @Deprecated public static interface FragmentManager.BackStackEntry {
    method @Deprecated public CharSequence getBreadCrumbShortTitle();
    method @Deprecated public int getBreadCrumbShortTitleRes();
    method @Deprecated public CharSequence getBreadCrumbTitle();
    method @Deprecated public int getBreadCrumbTitleRes();
    method @Deprecated public int getId();
    method @Deprecated public String getName();
  }

  @Deprecated public abstract static class FragmentManager.FragmentLifecycleCallbacks {
    ctor @Deprecated public FragmentManager.FragmentLifecycleCallbacks();
    method @Deprecated public void onFragmentActivityCreated(android.app.FragmentManager, android.app.Fragment, android.os.Bundle);
    method @Deprecated public void onFragmentAttached(android.app.FragmentManager, android.app.Fragment, android.content.Context);
    method @Deprecated public void onFragmentCreated(android.app.FragmentManager, android.app.Fragment, android.os.Bundle);
    method @Deprecated public void onFragmentDestroyed(android.app.FragmentManager, android.app.Fragment);
    method @Deprecated public void onFragmentDetached(android.app.FragmentManager, android.app.Fragment);
    method @Deprecated public void onFragmentPaused(android.app.FragmentManager, android.app.Fragment);
    method @Deprecated public void onFragmentPreAttached(android.app.FragmentManager, android.app.Fragment, android.content.Context);
    method @Deprecated public void onFragmentPreCreated(android.app.FragmentManager, android.app.Fragment, android.os.Bundle);
    method @Deprecated public void onFragmentResumed(android.app.FragmentManager, android.app.Fragment);
    method @Deprecated public void onFragmentSaveInstanceState(android.app.FragmentManager, android.app.Fragment, android.os.Bundle);
    method @Deprecated public void onFragmentStarted(android.app.FragmentManager, android.app.Fragment);
    method @Deprecated public void onFragmentStopped(android.app.FragmentManager, android.app.Fragment);
    method @Deprecated public void onFragmentViewCreated(android.app.FragmentManager, android.app.Fragment, android.view.View, android.os.Bundle);
    method @Deprecated public void onFragmentViewDestroyed(android.app.FragmentManager, android.app.Fragment);
  }

  @Deprecated public static interface FragmentManager.OnBackStackChangedListener {
    method @Deprecated public void onBackStackChanged();
  }

  @Deprecated public class FragmentManagerNonConfig {
  }

  @Deprecated public abstract class FragmentTransaction {
    ctor @Deprecated public FragmentTransaction();
    method @Deprecated public abstract android.app.FragmentTransaction add(android.app.Fragment, String);
    method @Deprecated public abstract android.app.FragmentTransaction add(@IdRes int, android.app.Fragment);
    method @Deprecated public abstract android.app.FragmentTransaction add(@IdRes int, android.app.Fragment, String);
    method @Deprecated public abstract android.app.FragmentTransaction addSharedElement(android.view.View, String);
    method @Deprecated public abstract android.app.FragmentTransaction addToBackStack(@Nullable String);
    method @Deprecated public abstract android.app.FragmentTransaction attach(android.app.Fragment);
    method @Deprecated public abstract int commit();
    method @Deprecated public abstract int commitAllowingStateLoss();
    method @Deprecated public abstract void commitNow();
    method @Deprecated public abstract void commitNowAllowingStateLoss();
    method @Deprecated public abstract android.app.FragmentTransaction detach(android.app.Fragment);
    method @Deprecated public abstract android.app.FragmentTransaction disallowAddToBackStack();
    method @Deprecated public abstract android.app.FragmentTransaction hide(android.app.Fragment);
    method @Deprecated public abstract boolean isAddToBackStackAllowed();
    method @Deprecated public abstract boolean isEmpty();
    method @Deprecated public abstract android.app.FragmentTransaction remove(android.app.Fragment);
    method @Deprecated public abstract android.app.FragmentTransaction replace(@IdRes int, android.app.Fragment);
    method @Deprecated public abstract android.app.FragmentTransaction replace(@IdRes int, android.app.Fragment, String);
    method @Deprecated public abstract android.app.FragmentTransaction runOnCommit(Runnable);
    method @Deprecated public abstract android.app.FragmentTransaction setBreadCrumbShortTitle(@StringRes int);
    method @Deprecated public abstract android.app.FragmentTransaction setBreadCrumbShortTitle(CharSequence);
    method @Deprecated public abstract android.app.FragmentTransaction setBreadCrumbTitle(@StringRes int);
    method @Deprecated public abstract android.app.FragmentTransaction setBreadCrumbTitle(CharSequence);
    method @Deprecated public abstract android.app.FragmentTransaction setCustomAnimations(@AnimatorRes int, @AnimatorRes int);
    method @Deprecated public abstract android.app.FragmentTransaction setCustomAnimations(@AnimatorRes int, @AnimatorRes int, @AnimatorRes int, @AnimatorRes int);
    method @Deprecated public abstract android.app.FragmentTransaction setPrimaryNavigationFragment(android.app.Fragment);
    method @Deprecated public abstract android.app.FragmentTransaction setReorderingAllowed(boolean);
    method @Deprecated public abstract android.app.FragmentTransaction setTransition(int);
    method @Deprecated public abstract android.app.FragmentTransaction setTransitionStyle(@StyleRes int);
    method @Deprecated public abstract android.app.FragmentTransaction show(android.app.Fragment);
    field @Deprecated public static final int TRANSIT_ENTER_MASK = 4096; // 0x1000
    field @Deprecated public static final int TRANSIT_EXIT_MASK = 8192; // 0x2000
    field @Deprecated public static final int TRANSIT_FRAGMENT_CLOSE = 8194; // 0x2002
    field @Deprecated public static final int TRANSIT_FRAGMENT_FADE = 4099; // 0x1003
    field @Deprecated public static final int TRANSIT_FRAGMENT_OPEN = 4097; // 0x1001
    field @Deprecated public static final int TRANSIT_NONE = 0; // 0x0
    field @Deprecated public static final int TRANSIT_UNSET = -1; // 0xffffffff
  }

  public class Instrumentation {
    ctor public Instrumentation();
    method public android.os.TestLooperManager acquireLooperManager(android.os.Looper);
    method public void addMonitor(android.app.Instrumentation.ActivityMonitor);
    method public android.app.Instrumentation.ActivityMonitor addMonitor(android.content.IntentFilter, android.app.Instrumentation.ActivityResult, boolean);
    method public android.app.Instrumentation.ActivityMonitor addMonitor(String, android.app.Instrumentation.ActivityResult, boolean);
    method public void addResults(android.os.Bundle);
    method public void callActivityOnCreate(android.app.Activity, android.os.Bundle);
    method public void callActivityOnCreate(android.app.Activity, android.os.Bundle, android.os.PersistableBundle);
    method public void callActivityOnDestroy(android.app.Activity);
    method public void callActivityOnNewIntent(android.app.Activity, android.content.Intent);
    method public void callActivityOnPause(android.app.Activity);
    method public void callActivityOnPostCreate(android.app.Activity, android.os.Bundle);
    method public void callActivityOnPostCreate(android.app.Activity, android.os.Bundle, android.os.PersistableBundle);
    method public void callActivityOnRestart(android.app.Activity);
    method public void callActivityOnRestoreInstanceState(android.app.Activity, android.os.Bundle);
    method public void callActivityOnRestoreInstanceState(android.app.Activity, android.os.Bundle, android.os.PersistableBundle);
    method public void callActivityOnResume(android.app.Activity);
    method public void callActivityOnSaveInstanceState(android.app.Activity, android.os.Bundle);
    method public void callActivityOnSaveInstanceState(android.app.Activity, android.os.Bundle, android.os.PersistableBundle);
    method public void callActivityOnStart(android.app.Activity);
    method public void callActivityOnStop(android.app.Activity);
    method public void callActivityOnUserLeaving(android.app.Activity);
    method public void callApplicationOnCreate(android.app.Application);
    method public boolean checkMonitorHit(android.app.Instrumentation.ActivityMonitor, int);
    method public void endPerformanceSnapshot();
    method public void finish(int, android.os.Bundle);
    method public android.os.Bundle getAllocCounts();
    method public android.os.Bundle getBinderCounts();
    method public android.content.ComponentName getComponentName();
    method public android.content.Context getContext();
    method public String getProcessName();
    method public android.content.Context getTargetContext();
    method public android.app.UiAutomation getUiAutomation();
    method public android.app.UiAutomation getUiAutomation(int);
    method public boolean invokeContextMenuAction(android.app.Activity, int, int);
    method public boolean invokeMenuActionSync(android.app.Activity, int, int);
    method public boolean isProfiling();
    method public android.app.Activity newActivity(Class<?>, android.content.Context, android.os.IBinder, android.app.Application, android.content.Intent, android.content.pm.ActivityInfo, CharSequence, android.app.Activity, String, Object) throws java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public android.app.Activity newActivity(ClassLoader, String, android.content.Intent) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public android.app.Application newApplication(ClassLoader, String, android.content.Context) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public static android.app.Application newApplication(Class<?>, android.content.Context) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public void onCreate(android.os.Bundle);
    method public void onDestroy();
    method public boolean onException(Object, Throwable);
    method public void onStart();
    method public void removeMonitor(android.app.Instrumentation.ActivityMonitor);
    method public void runOnMainSync(Runnable);
    method public void sendCharacterSync(int);
    method public void sendKeyDownUpSync(int);
    method public void sendKeySync(android.view.KeyEvent);
    method public void sendPointerSync(android.view.MotionEvent);
    method public void sendStatus(int, android.os.Bundle);
    method public void sendStringSync(String);
    method public void sendTrackballEventSync(android.view.MotionEvent);
    method public void setAutomaticPerformanceSnapshots();
    method public void setInTouchMode(boolean);
    method public void start();
    method public android.app.Activity startActivitySync(android.content.Intent);
    method @NonNull public android.app.Activity startActivitySync(@NonNull android.content.Intent, @Nullable android.os.Bundle);
    method @Deprecated public void startAllocCounting();
    method public void startPerformanceSnapshot();
    method public void startProfiling();
    method @Deprecated public void stopAllocCounting();
    method public void stopProfiling();
    method public void waitForIdle(Runnable);
    method public void waitForIdleSync();
    method public android.app.Activity waitForMonitor(android.app.Instrumentation.ActivityMonitor);
    method public android.app.Activity waitForMonitorWithTimeout(android.app.Instrumentation.ActivityMonitor, long);
    field public static final String REPORT_KEY_IDENTIFIER = "id";
    field public static final String REPORT_KEY_STREAMRESULT = "stream";
  }

  public static class Instrumentation.ActivityMonitor {
    ctor public Instrumentation.ActivityMonitor(android.content.IntentFilter, android.app.Instrumentation.ActivityResult, boolean);
    ctor public Instrumentation.ActivityMonitor(String, android.app.Instrumentation.ActivityResult, boolean);
    ctor public Instrumentation.ActivityMonitor();
    method public final android.content.IntentFilter getFilter();
    method public final int getHits();
    method public final android.app.Activity getLastActivity();
    method public final android.app.Instrumentation.ActivityResult getResult();
    method public final boolean isBlocking();
    method public android.app.Instrumentation.ActivityResult onStartActivity(android.content.Intent);
    method public final android.app.Activity waitForActivity();
    method public final android.app.Activity waitForActivityWithTimeout(long);
  }

  public static final class Instrumentation.ActivityResult {
    ctor public Instrumentation.ActivityResult(int, android.content.Intent);
    method public int getResultCode();
    method public android.content.Intent getResultData();
  }

  public abstract class IntentService extends android.app.Service {
    ctor public IntentService(String);
    method @Nullable public android.os.IBinder onBind(android.content.Intent);
    method @WorkerThread protected abstract void onHandleIntent(@Nullable android.content.Intent);
    method public void onStart(@Nullable android.content.Intent, int);
    method public void setIntentRedelivery(boolean);
  }

  public class KeyguardManager {
    method public android.content.Intent createConfirmDeviceCredentialIntent(CharSequence, CharSequence);
    method @Deprecated @RequiresPermission(android.Manifest.permission.DISABLE_KEYGUARD) public void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult);
    method @Deprecated public boolean inKeyguardRestrictedInputMode();
    method public boolean isDeviceLocked();
    method public boolean isDeviceSecure();
    method public boolean isKeyguardLocked();
    method public boolean isKeyguardSecure();
    method @Deprecated public android.app.KeyguardManager.KeyguardLock newKeyguardLock(String);
    method public void requestDismissKeyguard(@NonNull android.app.Activity, @Nullable android.app.KeyguardManager.KeyguardDismissCallback);
  }

  public abstract static class KeyguardManager.KeyguardDismissCallback {
    ctor public KeyguardManager.KeyguardDismissCallback();
    method public void onDismissCancelled();
    method public void onDismissError();
    method public void onDismissSucceeded();
  }

  @Deprecated public class KeyguardManager.KeyguardLock {
    method @Deprecated @RequiresPermission(android.Manifest.permission.DISABLE_KEYGUARD) public void disableKeyguard();
    method @Deprecated @RequiresPermission(android.Manifest.permission.DISABLE_KEYGUARD) public void reenableKeyguard();
  }

  @Deprecated public static interface KeyguardManager.OnKeyguardExitResult {
    method @Deprecated public void onKeyguardExitResult(boolean);
  }

  public abstract class LauncherActivity extends android.app.ListActivity {
    ctor public LauncherActivity();
    method protected android.content.Intent getTargetIntent();
    method protected android.content.Intent intentForPosition(int);
    method protected android.app.LauncherActivity.ListItem itemForPosition(int);
    method public java.util.List<android.app.LauncherActivity.ListItem> makeListItems();
    method protected java.util.List<android.content.pm.ResolveInfo> onQueryPackageManager(android.content.Intent);
    method protected void onSetContentView();
  }

  public class LauncherActivity.IconResizer {
    ctor public LauncherActivity.IconResizer();
    method public android.graphics.drawable.Drawable createIconThumbnail(android.graphics.drawable.Drawable);
  }

  public static class LauncherActivity.ListItem {
    ctor public LauncherActivity.ListItem();
    field public String className;
    field public android.os.Bundle extras;
    field public android.graphics.drawable.Drawable icon;
    field public CharSequence label;
    field public String packageName;
    field public android.content.pm.ResolveInfo resolveInfo;
  }

  public class ListActivity extends android.app.Activity {
    ctor public ListActivity();
    method public android.widget.ListAdapter getListAdapter();
    method public android.widget.ListView getListView();
    method public long getSelectedItemId();
    method public int getSelectedItemPosition();
    method protected void onListItemClick(android.widget.ListView, android.view.View, int, long);
    method public void setListAdapter(android.widget.ListAdapter);
    method public void setSelection(int);
  }

  @Deprecated public class ListFragment extends android.app.Fragment {
    ctor @Deprecated public ListFragment();
    method @Deprecated public android.widget.ListAdapter getListAdapter();
    method @Deprecated public android.widget.ListView getListView();
    method @Deprecated public long getSelectedItemId();
    method @Deprecated public int getSelectedItemPosition();
    method @Deprecated public void onListItemClick(android.widget.ListView, android.view.View, int, long);
    method @Deprecated public void setEmptyText(CharSequence);
    method @Deprecated public void setListAdapter(android.widget.ListAdapter);
    method @Deprecated public void setListShown(boolean);
    method @Deprecated public void setListShownNoAnimation(boolean);
    method @Deprecated public void setSelection(int);
  }

  @Deprecated public abstract class LoaderManager {
    ctor @Deprecated public LoaderManager();
    method @Deprecated public abstract void destroyLoader(int);
    method @Deprecated public abstract void dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method @Deprecated public static void enableDebugLogging(boolean);
    method @Deprecated public abstract <D> android.content.Loader<D> getLoader(int);
    method @Deprecated public abstract <D> android.content.Loader<D> initLoader(int, android.os.Bundle, android.app.LoaderManager.LoaderCallbacks<D>);
    method @Deprecated public abstract <D> android.content.Loader<D> restartLoader(int, android.os.Bundle, android.app.LoaderManager.LoaderCallbacks<D>);
  }

  @Deprecated public static interface LoaderManager.LoaderCallbacks<D> {
    method @Deprecated public android.content.Loader<D> onCreateLoader(int, android.os.Bundle);
    method @Deprecated public void onLoadFinished(android.content.Loader<D>, D);
    method @Deprecated public void onLoaderReset(android.content.Loader<D>);
  }

  @Deprecated public class LocalActivityManager {
    ctor @Deprecated public LocalActivityManager(android.app.Activity, boolean);
    method @Deprecated public android.view.Window destroyActivity(String, boolean);
    method @Deprecated public void dispatchCreate(android.os.Bundle);
    method @Deprecated public void dispatchDestroy(boolean);
    method @Deprecated public void dispatchPause(boolean);
    method @Deprecated public void dispatchResume();
    method @Deprecated public void dispatchStop();
    method @Deprecated public android.app.Activity getActivity(String);
    method @Deprecated public android.app.Activity getCurrentActivity();
    method @Deprecated public String getCurrentId();
    method @Deprecated public void removeAllActivities();
    method @Deprecated public android.os.Bundle saveInstanceState();
    method @Deprecated public android.view.Window startActivity(String, android.content.Intent);
  }

  public class MediaRouteActionProvider extends android.view.ActionProvider {
    ctor public MediaRouteActionProvider(android.content.Context);
    method public android.view.View onCreateActionView();
    method public void setExtendedSettingsClickListener(android.view.View.OnClickListener);
    method public void setRouteTypes(int);
  }

  public class MediaRouteButton extends android.view.View {
    ctor public MediaRouteButton(android.content.Context);
    ctor public MediaRouteButton(android.content.Context, android.util.AttributeSet);
    ctor public MediaRouteButton(android.content.Context, android.util.AttributeSet, int);
    ctor public MediaRouteButton(android.content.Context, android.util.AttributeSet, int, int);
    method public int getRouteTypes();
    method public void onAttachedToWindow();
    method public void onDetachedFromWindow();
    method public void setExtendedSettingsClickListener(android.view.View.OnClickListener);
    method public void setRouteTypes(int);
    method public void showDialog();
  }

  public class NativeActivity extends android.app.Activity implements android.view.InputQueue.Callback android.view.SurfaceHolder.Callback2 android.view.ViewTreeObserver.OnGlobalLayoutListener {
    ctor public NativeActivity();
    method public void onGlobalLayout();
    method public void onInputQueueCreated(android.view.InputQueue);
    method public void onInputQueueDestroyed(android.view.InputQueue);
    method public void surfaceChanged(android.view.SurfaceHolder, int, int, int);
    method public void surfaceCreated(android.view.SurfaceHolder);
    method public void surfaceDestroyed(android.view.SurfaceHolder);
    method public void surfaceRedrawNeeded(android.view.SurfaceHolder);
    field public static final String META_DATA_FUNC_NAME = "android.app.func_name";
    field public static final String META_DATA_LIB_NAME = "android.app.lib_name";
  }

  public class Notification implements android.os.Parcelable {
    ctor public Notification();
    ctor @Deprecated public Notification(int, CharSequence, long);
    ctor public Notification(android.os.Parcel);
    method public android.app.Notification clone();
    method public int describeContents();
    method public int getBadgeIconType();
    method public String getChannelId();
    method public String getGroup();
    method public int getGroupAlertBehavior();
    method public android.graphics.drawable.Icon getLargeIcon();
    method public CharSequence getSettingsText();
    method public String getShortcutId();
    method public android.graphics.drawable.Icon getSmallIcon();
    method public String getSortKey();
    method public long getTimeoutAfter();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT;
    field public static final int BADGE_ICON_LARGE = 2; // 0x2
    field public static final int BADGE_ICON_NONE = 0; // 0x0
    field public static final int BADGE_ICON_SMALL = 1; // 0x1
    field public static final String CATEGORY_ALARM = "alarm";
    field public static final String CATEGORY_CALL = "call";
    field public static final String CATEGORY_EMAIL = "email";
    field public static final String CATEGORY_ERROR = "err";
    field public static final String CATEGORY_EVENT = "event";
    field public static final String CATEGORY_MESSAGE = "msg";
    field public static final String CATEGORY_NAVIGATION = "navigation";
    field public static final String CATEGORY_PROGRESS = "progress";
    field public static final String CATEGORY_PROMO = "promo";
    field public static final String CATEGORY_RECOMMENDATION = "recommendation";
    field public static final String CATEGORY_REMINDER = "reminder";
    field public static final String CATEGORY_SERVICE = "service";
    field public static final String CATEGORY_SOCIAL = "social";
    field public static final String CATEGORY_STATUS = "status";
    field public static final String CATEGORY_SYSTEM = "sys";
    field public static final String CATEGORY_TRANSPORT = "transport";
    field @ColorInt public static final int COLOR_DEFAULT = 0; // 0x0
    field public static final android.os.Parcelable.Creator<android.app.Notification> CREATOR;
    field public static final int DEFAULT_ALL = -1; // 0xffffffff
    field public static final int DEFAULT_LIGHTS = 4; // 0x4
    field public static final int DEFAULT_SOUND = 1; // 0x1
    field public static final int DEFAULT_VIBRATE = 2; // 0x2
    field public static final String EXTRA_AUDIO_CONTENTS_URI = "android.audioContents";
    field public static final String EXTRA_BACKGROUND_IMAGE_URI = "android.backgroundImageUri";
    field public static final String EXTRA_BIG_TEXT = "android.bigText";
    field public static final String EXTRA_CHANNEL_GROUP_ID = "android.intent.extra.CHANNEL_GROUP_ID";
    field public static final String EXTRA_CHANNEL_ID = "android.intent.extra.CHANNEL_ID";
    field public static final String EXTRA_CHRONOMETER_COUNT_DOWN = "android.chronometerCountDown";
    field public static final String EXTRA_COLORIZED = "android.colorized";
    field public static final String EXTRA_COMPACT_ACTIONS = "android.compactActions";
    field public static final String EXTRA_CONVERSATION_TITLE = "android.conversationTitle";
    field public static final String EXTRA_HISTORIC_MESSAGES = "android.messages.historic";
    field public static final String EXTRA_INFO_TEXT = "android.infoText";
    field public static final String EXTRA_IS_GROUP_CONVERSATION = "android.isGroupConversation";
    field @Deprecated public static final String EXTRA_LARGE_ICON = "android.largeIcon";
    field public static final String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big";
    field public static final String EXTRA_MEDIA_SESSION = "android.mediaSession";
    field public static final String EXTRA_MESSAGES = "android.messages";
    field public static final String EXTRA_MESSAGING_PERSON = "android.messagingUser";
    field public static final String EXTRA_NOTIFICATION_ID = "android.intent.extra.NOTIFICATION_ID";
    field public static final String EXTRA_NOTIFICATION_TAG = "android.intent.extra.NOTIFICATION_TAG";
    field @Deprecated public static final String EXTRA_PEOPLE = "android.people";
    field public static final String EXTRA_PEOPLE_LIST = "android.people.list";
    field public static final String EXTRA_PICTURE = "android.picture";
    field public static final String EXTRA_PROGRESS = "android.progress";
    field public static final String EXTRA_PROGRESS_INDETERMINATE = "android.progressIndeterminate";
    field public static final String EXTRA_PROGRESS_MAX = "android.progressMax";
    field public static final String EXTRA_REMOTE_INPUT_DRAFT = "android.remoteInputDraft";
    field public static final String EXTRA_REMOTE_INPUT_HISTORY = "android.remoteInputHistory";
    field @Deprecated public static final String EXTRA_SELF_DISPLAY_NAME = "android.selfDisplayName";
    field public static final String EXTRA_SHOW_CHRONOMETER = "android.showChronometer";
    field public static final String EXTRA_SHOW_WHEN = "android.showWhen";
    field @Deprecated public static final String EXTRA_SMALL_ICON = "android.icon";
    field public static final String EXTRA_SUB_TEXT = "android.subText";
    field public static final String EXTRA_SUMMARY_TEXT = "android.summaryText";
    field public static final String EXTRA_TEMPLATE = "android.template";
    field public static final String EXTRA_TEXT = "android.text";
    field public static final String EXTRA_TEXT_LINES = "android.textLines";
    field public static final String EXTRA_TITLE = "android.title";
    field public static final String EXTRA_TITLE_BIG = "android.title.big";
    field public static final int FLAG_AUTO_CANCEL = 16; // 0x10
    field public static final int FLAG_FOREGROUND_SERVICE = 64; // 0x40
    field public static final int FLAG_GROUP_SUMMARY = 512; // 0x200
    field @Deprecated public static final int FLAG_HIGH_PRIORITY = 128; // 0x80
    field public static final int FLAG_INSISTENT = 4; // 0x4
    field public static final int FLAG_LOCAL_ONLY = 256; // 0x100
    field public static final int FLAG_NO_CLEAR = 32; // 0x20
    field public static final int FLAG_ONGOING_EVENT = 2; // 0x2
    field public static final int FLAG_ONLY_ALERT_ONCE = 8; // 0x8
    field @Deprecated public static final int FLAG_SHOW_LIGHTS = 1; // 0x1
    field public static final int GROUP_ALERT_ALL = 0; // 0x0
    field public static final int GROUP_ALERT_CHILDREN = 2; // 0x2
    field public static final int GROUP_ALERT_SUMMARY = 1; // 0x1
    field public static final String INTENT_CATEGORY_NOTIFICATION_PREFERENCES = "android.intent.category.NOTIFICATION_PREFERENCES";
    field @Deprecated public static final int PRIORITY_DEFAULT = 0; // 0x0
    field @Deprecated public static final int PRIORITY_HIGH = 1; // 0x1
    field @Deprecated public static final int PRIORITY_LOW = -1; // 0xffffffff
    field @Deprecated public static final int PRIORITY_MAX = 2; // 0x2
    field @Deprecated public static final int PRIORITY_MIN = -2; // 0xfffffffe
    field @Deprecated public static final int STREAM_DEFAULT = -1; // 0xffffffff
    field public static final int VISIBILITY_PRIVATE = 0; // 0x0
    field public static final int VISIBILITY_PUBLIC = 1; // 0x1
    field public static final int VISIBILITY_SECRET = -1; // 0xffffffff
    field public android.app.Notification.Action[] actions;
    field @Deprecated public android.media.AudioAttributes audioAttributes;
    field @Deprecated public int audioStreamType;
    field @Deprecated public android.widget.RemoteViews bigContentView;
    field public String category;
    field @ColorInt public int color;
    field public android.app.PendingIntent contentIntent;
    field @Deprecated public android.widget.RemoteViews contentView;
    field @Deprecated public int defaults;
    field public android.app.PendingIntent deleteIntent;
    field public android.os.Bundle extras;
    field public int flags;
    field public android.app.PendingIntent fullScreenIntent;
    field @Deprecated public android.widget.RemoteViews headsUpContentView;
    field @Deprecated @DrawableRes public int icon;
    field public int iconLevel;
    field @Deprecated public android.graphics.Bitmap largeIcon;
    field @Deprecated @ColorInt public int ledARGB;
    field @Deprecated public int ledOffMS;
    field @Deprecated public int ledOnMS;
    field public int number;
    field @Deprecated public int priority;
    field public android.app.Notification publicVersion;
    field @Deprecated public android.net.Uri sound;
    field public CharSequence tickerText;
    field @Deprecated public android.widget.RemoteViews tickerView;
    field @Deprecated public long[] vibrate;
    field public int visibility;
    field public long when;
  }

  public static class Notification.Action implements android.os.Parcelable {
    ctor @Deprecated public Notification.Action(int, CharSequence, android.app.PendingIntent);
    method public android.app.Notification.Action clone();
    method public int describeContents();
    method public boolean getAllowGeneratedReplies();
    method public android.app.RemoteInput[] getDataOnlyRemoteInputs();
    method public android.os.Bundle getExtras();
    method public android.graphics.drawable.Icon getIcon();
    method public android.app.RemoteInput[] getRemoteInputs();
    method public int getSemanticAction();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.Notification.Action> CREATOR;
    field public static final int SEMANTIC_ACTION_ARCHIVE = 5; // 0x5
    field public static final int SEMANTIC_ACTION_CALL = 10; // 0xa
    field public static final int SEMANTIC_ACTION_DELETE = 4; // 0x4
    field public static final int SEMANTIC_ACTION_MARK_AS_READ = 2; // 0x2
    field public static final int SEMANTIC_ACTION_MARK_AS_UNREAD = 3; // 0x3
    field public static final int SEMANTIC_ACTION_MUTE = 6; // 0x6
    field public static final int SEMANTIC_ACTION_NONE = 0; // 0x0
    field public static final int SEMANTIC_ACTION_REPLY = 1; // 0x1
    field public static final int SEMANTIC_ACTION_THUMBS_DOWN = 9; // 0x9
    field public static final int SEMANTIC_ACTION_THUMBS_UP = 8; // 0x8
    field public static final int SEMANTIC_ACTION_UNMUTE = 7; // 0x7
    field public android.app.PendingIntent actionIntent;
    field @Deprecated public int icon;
    field public CharSequence title;
  }

  public static final class Notification.Action.Builder {
    ctor @Deprecated public Notification.Action.Builder(int, CharSequence, android.app.PendingIntent);
    ctor public Notification.Action.Builder(android.graphics.drawable.Icon, CharSequence, android.app.PendingIntent);
    ctor public Notification.Action.Builder(android.app.Notification.Action);
    method public android.app.Notification.Action.Builder addExtras(android.os.Bundle);
    method public android.app.Notification.Action.Builder addRemoteInput(android.app.RemoteInput);
    method public android.app.Notification.Action build();
    method public android.app.Notification.Action.Builder extend(android.app.Notification.Action.Extender);
    method public android.os.Bundle getExtras();
    method public android.app.Notification.Action.Builder setAllowGeneratedReplies(boolean);
    method public android.app.Notification.Action.Builder setSemanticAction(int);
  }

  public static interface Notification.Action.Extender {
    method public android.app.Notification.Action.Builder extend(android.app.Notification.Action.Builder);
  }

  public static final class Notification.Action.WearableExtender implements android.app.Notification.Action.Extender {
    ctor public Notification.Action.WearableExtender();
    ctor public Notification.Action.WearableExtender(android.app.Notification.Action);
    method public android.app.Notification.Action.WearableExtender clone();
    method public android.app.Notification.Action.Builder extend(android.app.Notification.Action.Builder);
    method @Deprecated public CharSequence getCancelLabel();
    method @Deprecated public CharSequence getConfirmLabel();
    method public boolean getHintDisplayActionInline();
    method public boolean getHintLaunchesActivity();
    method @Deprecated public CharSequence getInProgressLabel();
    method public boolean isAvailableOffline();
    method public android.app.Notification.Action.WearableExtender setAvailableOffline(boolean);
    method @Deprecated public android.app.Notification.Action.WearableExtender setCancelLabel(CharSequence);
    method @Deprecated public android.app.Notification.Action.WearableExtender setConfirmLabel(CharSequence);
    method public android.app.Notification.Action.WearableExtender setHintDisplayActionInline(boolean);
    method public android.app.Notification.Action.WearableExtender setHintLaunchesActivity(boolean);
    method @Deprecated public android.app.Notification.Action.WearableExtender setInProgressLabel(CharSequence);
  }

  public static class Notification.BigPictureStyle extends android.app.Notification.Style {
    ctor public Notification.BigPictureStyle();
    ctor @Deprecated public Notification.BigPictureStyle(android.app.Notification.Builder);
    method public android.app.Notification.BigPictureStyle bigLargeIcon(android.graphics.Bitmap);
    method public android.app.Notification.BigPictureStyle bigLargeIcon(android.graphics.drawable.Icon);
    method public android.app.Notification.BigPictureStyle bigPicture(android.graphics.Bitmap);
    method public android.app.Notification.BigPictureStyle setBigContentTitle(CharSequence);
    method public android.app.Notification.BigPictureStyle setSummaryText(CharSequence);
  }

  public static class Notification.BigTextStyle extends android.app.Notification.Style {
    ctor public Notification.BigTextStyle();
    ctor @Deprecated public Notification.BigTextStyle(android.app.Notification.Builder);
    method public android.app.Notification.BigTextStyle bigText(CharSequence);
    method public android.app.Notification.BigTextStyle setBigContentTitle(CharSequence);
    method public android.app.Notification.BigTextStyle setSummaryText(CharSequence);
  }

  public static class Notification.Builder {
    ctor public Notification.Builder(android.content.Context, String);
    ctor @Deprecated public Notification.Builder(android.content.Context);
    method @Deprecated public android.app.Notification.Builder addAction(int, CharSequence, android.app.PendingIntent);
    method public android.app.Notification.Builder addAction(android.app.Notification.Action);
    method public android.app.Notification.Builder addExtras(android.os.Bundle);
    method @Deprecated public android.app.Notification.Builder addPerson(String);
    method public android.app.Notification.Builder addPerson(android.app.Person);
    method public android.app.Notification build();
    method public android.widget.RemoteViews createBigContentView();
    method public android.widget.RemoteViews createContentView();
    method public android.widget.RemoteViews createHeadsUpContentView();
    method public android.app.Notification.Builder extend(android.app.Notification.Extender);
    method public android.os.Bundle getExtras();
    method @Deprecated public android.app.Notification getNotification();
    method public android.app.Notification.Style getStyle();
    method public static android.app.Notification.Builder recoverBuilder(android.content.Context, android.app.Notification);
    method public android.app.Notification.Builder setActions(android.app.Notification.Action...);
    method public android.app.Notification.Builder setAutoCancel(boolean);
    method public android.app.Notification.Builder setBadgeIconType(int);
    method public android.app.Notification.Builder setCategory(String);
    method public android.app.Notification.Builder setChannelId(String);
    method public android.app.Notification.Builder setChronometerCountDown(boolean);
    method public android.app.Notification.Builder setColor(@ColorInt int);
    method public android.app.Notification.Builder setColorized(boolean);
    method @Deprecated public android.app.Notification.Builder setContent(android.widget.RemoteViews);
    method @Deprecated public android.app.Notification.Builder setContentInfo(CharSequence);
    method public android.app.Notification.Builder setContentIntent(android.app.PendingIntent);
    method public android.app.Notification.Builder setContentText(CharSequence);
    method public android.app.Notification.Builder setContentTitle(CharSequence);
    method public android.app.Notification.Builder setCustomBigContentView(android.widget.RemoteViews);
    method public android.app.Notification.Builder setCustomContentView(android.widget.RemoteViews);
    method public android.app.Notification.Builder setCustomHeadsUpContentView(android.widget.RemoteViews);
    method @Deprecated public android.app.Notification.Builder setDefaults(int);
    method public android.app.Notification.Builder setDeleteIntent(android.app.PendingIntent);
    method public android.app.Notification.Builder setExtras(android.os.Bundle);
    method public android.app.Notification.Builder setFullScreenIntent(android.app.PendingIntent, boolean);
    method public android.app.Notification.Builder setGroup(String);
    method public android.app.Notification.Builder setGroupAlertBehavior(int);
    method public android.app.Notification.Builder setGroupSummary(boolean);
    method public android.app.Notification.Builder setLargeIcon(android.graphics.Bitmap);
    method public android.app.Notification.Builder setLargeIcon(android.graphics.drawable.Icon);
    method @Deprecated public android.app.Notification.Builder setLights(@ColorInt int, int, int);
    method public android.app.Notification.Builder setLocalOnly(boolean);
    method public android.app.Notification.Builder setNumber(int);
    method public android.app.Notification.Builder setOngoing(boolean);
    method public android.app.Notification.Builder setOnlyAlertOnce(boolean);
    method @Deprecated public android.app.Notification.Builder setPriority(int);
    method public android.app.Notification.Builder setProgress(int, int, boolean);
    method public android.app.Notification.Builder setPublicVersion(android.app.Notification);
    method public android.app.Notification.Builder setRemoteInputHistory(CharSequence[]);
    method public android.app.Notification.Builder setSettingsText(CharSequence);
    method public android.app.Notification.Builder setShortcutId(String);
    method public android.app.Notification.Builder setShowWhen(boolean);
    method public android.app.Notification.Builder setSmallIcon(@DrawableRes int);
    method public android.app.Notification.Builder setSmallIcon(@DrawableRes int, int);
    method public android.app.Notification.Builder setSmallIcon(android.graphics.drawable.Icon);
    method public android.app.Notification.Builder setSortKey(String);
    method @Deprecated public android.app.Notification.Builder setSound(android.net.Uri);
    method @Deprecated public android.app.Notification.Builder setSound(android.net.Uri, int);
    method @Deprecated public android.app.Notification.Builder setSound(android.net.Uri, android.media.AudioAttributes);
    method public android.app.Notification.Builder setStyle(android.app.Notification.Style);
    method public android.app.Notification.Builder setSubText(CharSequence);
    method public android.app.Notification.Builder setTicker(CharSequence);
    method @Deprecated public android.app.Notification.Builder setTicker(CharSequence, android.widget.RemoteViews);
    method public android.app.Notification.Builder setTimeoutAfter(long);
    method public android.app.Notification.Builder setUsesChronometer(boolean);
    method @Deprecated public android.app.Notification.Builder setVibrate(long[]);
    method public android.app.Notification.Builder setVisibility(int);
    method public android.app.Notification.Builder setWhen(long);
  }

  public static final class Notification.CarExtender implements android.app.Notification.Extender {
    ctor public Notification.CarExtender();
    ctor public Notification.CarExtender(android.app.Notification);
    method public android.app.Notification.Builder extend(android.app.Notification.Builder);
    method @ColorInt public int getColor();
    method public android.graphics.Bitmap getLargeIcon();
    method public android.app.Notification.CarExtender.UnreadConversation getUnreadConversation();
    method public android.app.Notification.CarExtender setColor(@ColorInt int);
    method public android.app.Notification.CarExtender setLargeIcon(android.graphics.Bitmap);
    method public android.app.Notification.CarExtender setUnreadConversation(android.app.Notification.CarExtender.UnreadConversation);
  }

  public static class Notification.CarExtender.Builder {
    ctor public Notification.CarExtender.Builder(String);
    method public android.app.Notification.CarExtender.Builder addMessage(String);
    method public android.app.Notification.CarExtender.UnreadConversation build();
    method public android.app.Notification.CarExtender.Builder setLatestTimestamp(long);
    method public android.app.Notification.CarExtender.Builder setReadPendingIntent(android.app.PendingIntent);
    method public android.app.Notification.CarExtender.Builder setReplyAction(android.app.PendingIntent, android.app.RemoteInput);
  }

  public static class Notification.CarExtender.UnreadConversation {
    method public long getLatestTimestamp();
    method public String[] getMessages();
    method public String getParticipant();
    method public String[] getParticipants();
    method public android.app.PendingIntent getReadPendingIntent();
    method public android.app.RemoteInput getRemoteInput();
    method public android.app.PendingIntent getReplyPendingIntent();
  }

  public static class Notification.DecoratedCustomViewStyle extends android.app.Notification.Style {
    ctor public Notification.DecoratedCustomViewStyle();
  }

  public static class Notification.DecoratedMediaCustomViewStyle extends android.app.Notification.MediaStyle {
    ctor public Notification.DecoratedMediaCustomViewStyle();
  }

  public static interface Notification.Extender {
    method public android.app.Notification.Builder extend(android.app.Notification.Builder);
  }

  public static class Notification.InboxStyle extends android.app.Notification.Style {
    ctor public Notification.InboxStyle();
    ctor @Deprecated public Notification.InboxStyle(android.app.Notification.Builder);
    method public android.app.Notification.InboxStyle addLine(CharSequence);
    method public android.app.Notification.InboxStyle setBigContentTitle(CharSequence);
    method public android.app.Notification.InboxStyle setSummaryText(CharSequence);
  }

  public static class Notification.MediaStyle extends android.app.Notification.Style {
    ctor public Notification.MediaStyle();
    ctor @Deprecated public Notification.MediaStyle(android.app.Notification.Builder);
    method public android.app.Notification.MediaStyle setMediaSession(android.media.session.MediaSession.Token);
    method public android.app.Notification.MediaStyle setShowActionsInCompactView(int...);
  }

  public static class Notification.MessagingStyle extends android.app.Notification.Style {
    ctor @Deprecated public Notification.MessagingStyle(@NonNull CharSequence);
    ctor public Notification.MessagingStyle(@NonNull android.app.Person);
    method public android.app.Notification.MessagingStyle addHistoricMessage(android.app.Notification.MessagingStyle.Message);
    method @Deprecated public android.app.Notification.MessagingStyle addMessage(CharSequence, long, CharSequence);
    method public android.app.Notification.MessagingStyle addMessage(@NonNull CharSequence, long, @Nullable android.app.Person);
    method public android.app.Notification.MessagingStyle addMessage(android.app.Notification.MessagingStyle.Message);
    method @Nullable public CharSequence getConversationTitle();
    method public java.util.List<android.app.Notification.MessagingStyle.Message> getHistoricMessages();
    method public java.util.List<android.app.Notification.MessagingStyle.Message> getMessages();
    method @NonNull public android.app.Person getUser();
    method @Deprecated public CharSequence getUserDisplayName();
    method public boolean isGroupConversation();
    method public android.app.Notification.MessagingStyle setConversationTitle(@Nullable CharSequence);
    method public android.app.Notification.MessagingStyle setGroupConversation(boolean);
    field public static final int MAXIMUM_RETAINED_MESSAGES = 25; // 0x19
  }

  public static final class Notification.MessagingStyle.Message {
    ctor @Deprecated public Notification.MessagingStyle.Message(CharSequence, long, CharSequence);
    ctor public Notification.MessagingStyle.Message(@NonNull CharSequence, long, @Nullable android.app.Person);
    method public String getDataMimeType();
    method public android.net.Uri getDataUri();
    method public android.os.Bundle getExtras();
    method @Deprecated public CharSequence getSender();
    method @Nullable public android.app.Person getSenderPerson();
    method public CharSequence getText();
    method public long getTimestamp();
    method public android.app.Notification.MessagingStyle.Message setData(String, android.net.Uri);
  }

  public abstract static class Notification.Style {
    ctor public Notification.Style();
    method public android.app.Notification build();
    method protected void checkBuilder();
    method protected android.widget.RemoteViews getStandardView(int);
    method protected void internalSetBigContentTitle(CharSequence);
    method protected void internalSetSummaryText(CharSequence);
    method public void setBuilder(android.app.Notification.Builder);
    field protected android.app.Notification.Builder mBuilder;
  }

  public static final class Notification.WearableExtender implements android.app.Notification.Extender {
    ctor public Notification.WearableExtender();
    ctor public Notification.WearableExtender(android.app.Notification);
    method public android.app.Notification.WearableExtender addAction(android.app.Notification.Action);
    method public android.app.Notification.WearableExtender addActions(java.util.List<android.app.Notification.Action>);
    method public android.app.Notification.WearableExtender addPage(android.app.Notification);
    method public android.app.Notification.WearableExtender addPages(java.util.List<android.app.Notification>);
    method public android.app.Notification.WearableExtender clearActions();
    method public android.app.Notification.WearableExtender clearPages();
    method public android.app.Notification.WearableExtender clone();
    method public android.app.Notification.Builder extend(android.app.Notification.Builder);
    method public java.util.List<android.app.Notification.Action> getActions();
    method public android.graphics.Bitmap getBackground();
    method public String getBridgeTag();
    method public int getContentAction();
    method @Deprecated public int getContentIcon();
    method @Deprecated public int getContentIconGravity();
    method public boolean getContentIntentAvailableOffline();
    method @Deprecated public int getCustomContentHeight();
    method @Deprecated public int getCustomSizePreset();
    method public String getDismissalId();
    method public android.app.PendingIntent getDisplayIntent();
    method @Deprecated public int getGravity();
    method public boolean getHintAmbientBigPicture();
    method @Deprecated public boolean getHintAvoidBackgroundClipping();
    method public boolean getHintContentIntentLaunchesActivity();
    method @Deprecated public boolean getHintHideIcon();
    method @Deprecated public int getHintScreenTimeout();
    method @Deprecated public boolean getHintShowBackgroundOnly();
    method public java.util.List<android.app.Notification> getPages();
    method public boolean getStartScrollBottom();
    method public android.app.Notification.WearableExtender setBackground(android.graphics.Bitmap);
    method public android.app.Notification.WearableExtender setBridgeTag(String);
    method public android.app.Notification.WearableExtender setContentAction(int);
    method @Deprecated public android.app.Notification.WearableExtender setContentIcon(int);
    method @Deprecated public android.app.Notification.WearableExtender setContentIconGravity(int);
    method public android.app.Notification.WearableExtender setContentIntentAvailableOffline(boolean);
    method @Deprecated public android.app.Notification.WearableExtender setCustomContentHeight(int);
    method @Deprecated public android.app.Notification.WearableExtender setCustomSizePreset(int);
    method public android.app.Notification.WearableExtender setDismissalId(String);
    method public android.app.Notification.WearableExtender setDisplayIntent(android.app.PendingIntent);
    method @Deprecated public android.app.Notification.WearableExtender setGravity(int);
    method public android.app.Notification.WearableExtender setHintAmbientBigPicture(boolean);
    method @Deprecated public android.app.Notification.WearableExtender setHintAvoidBackgroundClipping(boolean);
    method public android.app.Notification.WearableExtender setHintContentIntentLaunchesActivity(boolean);
    method @Deprecated public android.app.Notification.WearableExtender setHintHideIcon(boolean);
    method @Deprecated public android.app.Notification.WearableExtender setHintScreenTimeout(int);
    method @Deprecated public android.app.Notification.WearableExtender setHintShowBackgroundOnly(boolean);
    method public android.app.Notification.WearableExtender setStartScrollBottom(boolean);
    field public static final int SCREEN_TIMEOUT_LONG = -1; // 0xffffffff
    field public static final int SCREEN_TIMEOUT_SHORT = 0; // 0x0
    field public static final int SIZE_DEFAULT = 0; // 0x0
    field public static final int SIZE_FULL_SCREEN = 5; // 0x5
    field public static final int SIZE_LARGE = 4; // 0x4
    field public static final int SIZE_MEDIUM = 3; // 0x3
    field public static final int SIZE_SMALL = 2; // 0x2
    field public static final int SIZE_XSMALL = 1; // 0x1
    field public static final int UNSET_ACTION_INDEX = -1; // 0xffffffff
  }

  public final class NotificationChannel implements android.os.Parcelable {
    ctor public NotificationChannel(String, CharSequence, int);
    method public boolean canBypassDnd();
    method public boolean canShowBadge();
    method public int describeContents();
    method public void enableLights(boolean);
    method public void enableVibration(boolean);
    method public android.media.AudioAttributes getAudioAttributes();
    method public String getDescription();
    method public String getGroup();
    method public String getId();
    method public int getImportance();
    method public int getLightColor();
    method public int getLockscreenVisibility();
    method public CharSequence getName();
    method public android.net.Uri getSound();
    method public long[] getVibrationPattern();
    method public void setBypassDnd(boolean);
    method public void setDescription(String);
    method public void setGroup(String);
    method public void setImportance(int);
    method public void setLightColor(int);
    method public void setLockscreenVisibility(int);
    method public void setName(CharSequence);
    method public void setShowBadge(boolean);
    method public void setSound(android.net.Uri, android.media.AudioAttributes);
    method public void setVibrationPattern(long[]);
    method public boolean shouldShowLights();
    method public boolean shouldVibrate();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.NotificationChannel> CREATOR;
    field public static final String DEFAULT_CHANNEL_ID = "miscellaneous";
  }

  public final class NotificationChannelGroup implements android.os.Parcelable {
    ctor public NotificationChannelGroup(String, CharSequence);
    method public android.app.NotificationChannelGroup clone();
    method public int describeContents();
    method public java.util.List<android.app.NotificationChannel> getChannels();
    method public String getDescription();
    method public String getId();
    method public CharSequence getName();
    method public boolean isBlocked();
    method public void setDescription(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.NotificationChannelGroup> CREATOR;
  }

  public class NotificationManager {
    method public String addAutomaticZenRule(android.app.AutomaticZenRule);
    method public boolean areNotificationsEnabled();
    method public void cancel(int);
    method public void cancel(String, int);
    method public void cancelAll();
    method public void createNotificationChannel(@NonNull android.app.NotificationChannel);
    method public void createNotificationChannelGroup(@NonNull android.app.NotificationChannelGroup);
    method public void createNotificationChannelGroups(@NonNull java.util.List<android.app.NotificationChannelGroup>);
    method public void createNotificationChannels(@NonNull java.util.List<android.app.NotificationChannel>);
    method public void deleteNotificationChannel(String);
    method public void deleteNotificationChannelGroup(String);
    method public android.service.notification.StatusBarNotification[] getActiveNotifications();
    method public android.app.AutomaticZenRule getAutomaticZenRule(String);
    method public java.util.Map<java.lang.String,android.app.AutomaticZenRule> getAutomaticZenRules();
    method public final int getCurrentInterruptionFilter();
    method public int getImportance();
    method public android.app.NotificationChannel getNotificationChannel(String);
    method public android.app.NotificationChannelGroup getNotificationChannelGroup(String);
    method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups();
    method public java.util.List<android.app.NotificationChannel> getNotificationChannels();
    method public android.app.NotificationManager.Policy getNotificationPolicy();
    method public boolean isNotificationListenerAccessGranted(android.content.ComponentName);
    method public boolean isNotificationPolicyAccessGranted();
    method public void notify(int, android.app.Notification);
    method public void notify(String, int, android.app.Notification);
    method public boolean removeAutomaticZenRule(String);
    method public final void setInterruptionFilter(int);
    method public void setNotificationPolicy(@NonNull android.app.NotificationManager.Policy);
    method public boolean updateAutomaticZenRule(String, android.app.AutomaticZenRule);
    field public static final String ACTION_APP_BLOCK_STATE_CHANGED = "android.app.action.APP_BLOCK_STATE_CHANGED";
    field public static final String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED";
    field public static final String ACTION_NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED = "android.app.action.NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED";
    field public static final String ACTION_NOTIFICATION_CHANNEL_GROUP_BLOCK_STATE_CHANGED = "android.app.action.NOTIFICATION_CHANNEL_GROUP_BLOCK_STATE_CHANGED";
    field public static final String ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED = "android.app.action.NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED";
    field public static final String ACTION_NOTIFICATION_POLICY_CHANGED = "android.app.action.NOTIFICATION_POLICY_CHANGED";
    field public static final String EXTRA_BLOCKED_STATE = "android.app.extra.BLOCKED_STATE";
    field public static final String EXTRA_NOTIFICATION_CHANNEL_GROUP_ID = "android.app.extra.NOTIFICATION_CHANNEL_GROUP_ID";
    field public static final String EXTRA_NOTIFICATION_CHANNEL_ID = "android.app.extra.NOTIFICATION_CHANNEL_ID";
    field public static final int IMPORTANCE_DEFAULT = 3; // 0x3
    field public static final int IMPORTANCE_HIGH = 4; // 0x4
    field public static final int IMPORTANCE_LOW = 2; // 0x2
    field public static final int IMPORTANCE_MAX = 5; // 0x5
    field public static final int IMPORTANCE_MIN = 1; // 0x1
    field public static final int IMPORTANCE_NONE = 0; // 0x0
    field public static final int IMPORTANCE_UNSPECIFIED = -1000; // 0xfffffc18
    field public static final int INTERRUPTION_FILTER_ALARMS = 4; // 0x4
    field public static final int INTERRUPTION_FILTER_ALL = 1; // 0x1
    field public static final int INTERRUPTION_FILTER_NONE = 3; // 0x3
    field public static final int INTERRUPTION_FILTER_PRIORITY = 2; // 0x2
    field public static final int INTERRUPTION_FILTER_UNKNOWN = 0; // 0x0
  }

  public static class NotificationManager.Policy implements android.os.Parcelable {
    ctor public NotificationManager.Policy(int, int, int);
    ctor public NotificationManager.Policy(int, int, int, int);
    method public int describeContents();
    method public static String priorityCategoriesToString(int);
    method public static String prioritySendersToString(int);
    method public static String suppressedEffectsToString(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.NotificationManager.Policy> CREATOR;
    field public static final int PRIORITY_CATEGORY_ALARMS = 32; // 0x20
    field public static final int PRIORITY_CATEGORY_CALLS = 8; // 0x8
    field public static final int PRIORITY_CATEGORY_EVENTS = 2; // 0x2
    field public static final int PRIORITY_CATEGORY_MEDIA = 64; // 0x40
    field public static final int PRIORITY_CATEGORY_MESSAGES = 4; // 0x4
    field public static final int PRIORITY_CATEGORY_REMINDERS = 1; // 0x1
    field public static final int PRIORITY_CATEGORY_REPEAT_CALLERS = 16; // 0x10
    field public static final int PRIORITY_CATEGORY_SYSTEM = 128; // 0x80
    field public static final int PRIORITY_SENDERS_ANY = 0; // 0x0
    field public static final int PRIORITY_SENDERS_CONTACTS = 1; // 0x1
    field public static final int PRIORITY_SENDERS_STARRED = 2; // 0x2
    field public static final int SUPPRESSED_EFFECT_AMBIENT = 128; // 0x80
    field public static final int SUPPRESSED_EFFECT_BADGE = 64; // 0x40
    field public static final int SUPPRESSED_EFFECT_FULL_SCREEN_INTENT = 4; // 0x4
    field public static final int SUPPRESSED_EFFECT_LIGHTS = 8; // 0x8
    field public static final int SUPPRESSED_EFFECT_NOTIFICATION_LIST = 256; // 0x100
    field public static final int SUPPRESSED_EFFECT_PEEK = 16; // 0x10
    field @Deprecated public static final int SUPPRESSED_EFFECT_SCREEN_OFF = 1; // 0x1
    field @Deprecated public static final int SUPPRESSED_EFFECT_SCREEN_ON = 2; // 0x2
    field public static final int SUPPRESSED_EFFECT_STATUS_BAR = 32; // 0x20
    field public final int priorityCallSenders;
    field public final int priorityCategories;
    field public final int priorityMessageSenders;
    field public final int suppressedVisualEffects;
  }

  public final class PendingIntent implements android.os.Parcelable {
    method public void cancel();
    method public int describeContents();
    method public static android.app.PendingIntent getActivities(android.content.Context, int, @NonNull android.content.Intent[], int);
    method public static android.app.PendingIntent getActivities(android.content.Context, int, @NonNull android.content.Intent[], int, @Nullable android.os.Bundle);
    method public static android.app.PendingIntent getActivity(android.content.Context, int, android.content.Intent, int);
    method public static android.app.PendingIntent getActivity(android.content.Context, int, @NonNull android.content.Intent, int, @Nullable android.os.Bundle);
    method public static android.app.PendingIntent getBroadcast(android.content.Context, int, android.content.Intent, int);
    method @Nullable public String getCreatorPackage();
    method public int getCreatorUid();
    method @Nullable public android.os.UserHandle getCreatorUserHandle();
    method public static android.app.PendingIntent getForegroundService(android.content.Context, int, @NonNull android.content.Intent, int);
    method public android.content.IntentSender getIntentSender();
    method public static android.app.PendingIntent getService(android.content.Context, int, @NonNull android.content.Intent, int);
    method @Deprecated public String getTargetPackage();
    method @Nullable public static android.app.PendingIntent readPendingIntentOrNullFromParcel(@NonNull android.os.Parcel);
    method public void send() throws android.app.PendingIntent.CanceledException;
    method public void send(int) throws android.app.PendingIntent.CanceledException;
    method public void send(android.content.Context, int, @Nullable android.content.Intent) throws android.app.PendingIntent.CanceledException;
    method public void send(int, @Nullable android.app.PendingIntent.OnFinished, @Nullable android.os.Handler) throws android.app.PendingIntent.CanceledException;
    method public void send(android.content.Context, int, @Nullable android.content.Intent, @Nullable android.app.PendingIntent.OnFinished, @Nullable android.os.Handler) throws android.app.PendingIntent.CanceledException;
    method public void send(android.content.Context, int, @Nullable android.content.Intent, @Nullable android.app.PendingIntent.OnFinished, @Nullable android.os.Handler, @Nullable String) throws android.app.PendingIntent.CanceledException;
    method public void send(android.content.Context, int, @Nullable android.content.Intent, @Nullable android.app.PendingIntent.OnFinished, @Nullable android.os.Handler, @Nullable String, @Nullable android.os.Bundle) throws android.app.PendingIntent.CanceledException;
    method public static void writePendingIntentOrNullToParcel(@Nullable android.app.PendingIntent, @NonNull android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.PendingIntent> CREATOR;
    field public static final int FLAG_CANCEL_CURRENT = 268435456; // 0x10000000
    field public static final int FLAG_IMMUTABLE = 67108864; // 0x4000000
    field public static final int FLAG_NO_CREATE = 536870912; // 0x20000000
    field public static final int FLAG_ONE_SHOT = 1073741824; // 0x40000000
    field public static final int FLAG_UPDATE_CURRENT = 134217728; // 0x8000000
  }

  public static class PendingIntent.CanceledException extends android.util.AndroidException {
    ctor public PendingIntent.CanceledException();
    ctor public PendingIntent.CanceledException(String);
    ctor public PendingIntent.CanceledException(Exception);
  }

  public static interface PendingIntent.OnFinished {
    method public void onSendFinished(android.app.PendingIntent, android.content.Intent, int, String, android.os.Bundle);
  }

  public final class Person implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.graphics.drawable.Icon getIcon();
    method @Nullable public String getKey();
    method @Nullable public CharSequence getName();
    method @Nullable public String getUri();
    method public boolean isBot();
    method public boolean isImportant();
    method public android.app.Person.Builder toBuilder();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.Person> CREATOR;
  }

  public static class Person.Builder {
    ctor public Person.Builder();
    method @NonNull public android.app.Person build();
    method @NonNull public android.app.Person.Builder setBot(boolean);
    method @NonNull public android.app.Person.Builder setIcon(@Nullable android.graphics.drawable.Icon);
    method @NonNull public android.app.Person.Builder setImportant(boolean);
    method @NonNull public android.app.Person.Builder setKey(@Nullable String);
    method @NonNull public android.app.Person.Builder setName(@Nullable CharSequence);
    method @NonNull public android.app.Person.Builder setUri(@Nullable String);
  }

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

  public static class PictureInPictureParams.Builder {
    ctor public PictureInPictureParams.Builder();
    method public android.app.PictureInPictureParams build();
    method public android.app.PictureInPictureParams.Builder setActions(java.util.List<android.app.RemoteAction>);
    method public android.app.PictureInPictureParams.Builder setAspectRatio(android.util.Rational);
    method public android.app.PictureInPictureParams.Builder setSourceRectHint(android.graphics.Rect);
  }

  public class Presentation extends android.app.Dialog {
    ctor public Presentation(android.content.Context, android.view.Display);
    ctor public Presentation(android.content.Context, android.view.Display, int);
    method public android.view.Display getDisplay();
    method public android.content.res.Resources getResources();
    method public void onDisplayChanged();
    method public void onDisplayRemoved();
  }

  @Deprecated public class ProgressDialog extends android.app.AlertDialog {
    ctor @Deprecated public ProgressDialog(android.content.Context);
    ctor @Deprecated public ProgressDialog(android.content.Context, int);
    method @Deprecated public int getMax();
    method @Deprecated public int getProgress();
    method @Deprecated public int getSecondaryProgress();
    method @Deprecated public void incrementProgressBy(int);
    method @Deprecated public void incrementSecondaryProgressBy(int);
    method @Deprecated public boolean isIndeterminate();
    method @Deprecated public void onStart();
    method @Deprecated public void setIndeterminate(boolean);
    method @Deprecated public void setIndeterminateDrawable(android.graphics.drawable.Drawable);
    method @Deprecated public void setMax(int);
    method @Deprecated public void setProgress(int);
    method @Deprecated public void setProgressDrawable(android.graphics.drawable.Drawable);
    method @Deprecated public void setProgressNumberFormat(String);
    method @Deprecated public void setProgressPercentFormat(java.text.NumberFormat);
    method @Deprecated public void setProgressStyle(int);
    method @Deprecated public void setSecondaryProgress(int);
    method @Deprecated public static android.app.ProgressDialog show(android.content.Context, CharSequence, CharSequence);
    method @Deprecated public static android.app.ProgressDialog show(android.content.Context, CharSequence, CharSequence, boolean);
    method @Deprecated public static android.app.ProgressDialog show(android.content.Context, CharSequence, CharSequence, boolean, boolean);
    method @Deprecated public static android.app.ProgressDialog show(android.content.Context, CharSequence, CharSequence, boolean, boolean, android.content.DialogInterface.OnCancelListener);
    field @Deprecated public static final int STYLE_HORIZONTAL = 1; // 0x1
    field @Deprecated public static final int STYLE_SPINNER = 0; // 0x0
  }

  public final class RemoteAction implements android.os.Parcelable {
    ctor public RemoteAction(@NonNull android.graphics.drawable.Icon, @NonNull CharSequence, @NonNull CharSequence, @NonNull android.app.PendingIntent);
    method public android.app.RemoteAction clone();
    method public int describeContents();
    method public void dump(String, java.io.PrintWriter);
    method @NonNull public android.app.PendingIntent getActionIntent();
    method @NonNull public CharSequence getContentDescription();
    method @NonNull public android.graphics.drawable.Icon getIcon();
    method @NonNull public CharSequence getTitle();
    method public boolean isEnabled();
    method public void setEnabled(boolean);
    method public void setShouldShowIcon(boolean);
    method public boolean shouldShowIcon();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.RemoteAction> CREATOR;
  }

  public final class RemoteInput implements android.os.Parcelable {
    method public static void addDataResultToIntent(android.app.RemoteInput, android.content.Intent, java.util.Map<java.lang.String,android.net.Uri>);
    method public static void addResultsToIntent(android.app.RemoteInput[], android.content.Intent, android.os.Bundle);
    method public int describeContents();
    method public boolean getAllowFreeFormInput();
    method public java.util.Set<java.lang.String> getAllowedDataTypes();
    method public CharSequence[] getChoices();
    method public static java.util.Map<java.lang.String,android.net.Uri> getDataResultsFromIntent(android.content.Intent, String);
    method public android.os.Bundle getExtras();
    method public CharSequence getLabel();
    method public String getResultKey();
    method public static android.os.Bundle getResultsFromIntent(android.content.Intent);
    method public static int getResultsSource(android.content.Intent);
    method public boolean isDataOnly();
    method public static void setResultsSource(android.content.Intent, int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.RemoteInput> CREATOR;
    field public static final String EXTRA_RESULTS_DATA = "android.remoteinput.resultsData";
    field public static final String RESULTS_CLIP_LABEL = "android.remoteinput.results";
    field public static final int SOURCE_CHOICE = 1; // 0x1
    field public static final int SOURCE_FREE_FORM_INPUT = 0; // 0x0
  }

  public static final class RemoteInput.Builder {
    ctor public RemoteInput.Builder(@NonNull String);
    method @NonNull public android.app.RemoteInput.Builder addExtras(@NonNull android.os.Bundle);
    method @NonNull public android.app.RemoteInput build();
    method @NonNull public android.os.Bundle getExtras();
    method @NonNull public android.app.RemoteInput.Builder setAllowDataType(@NonNull String, boolean);
    method @NonNull public android.app.RemoteInput.Builder setAllowFreeFormInput(boolean);
    method @NonNull public android.app.RemoteInput.Builder setChoices(@Nullable CharSequence[]);
    method @NonNull public android.app.RemoteInput.Builder setLabel(@Nullable CharSequence);
  }

  public class SearchManager implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
    method public android.content.ComponentName getGlobalSearchActivity();
    method public android.app.SearchableInfo getSearchableInfo(android.content.ComponentName);
    method public java.util.List<android.app.SearchableInfo> getSearchablesInGlobalSearch();
    method @Deprecated public void onCancel(android.content.DialogInterface);
    method @Deprecated public void onDismiss(android.content.DialogInterface);
    method public void setOnCancelListener(android.app.SearchManager.OnCancelListener);
    method public void setOnDismissListener(android.app.SearchManager.OnDismissListener);
    method public void startSearch(String, boolean, android.content.ComponentName, android.os.Bundle, boolean);
    method public void stopSearch();
    method public void triggerSearch(String, android.content.ComponentName, android.os.Bundle);
    field public static final String ACTION_KEY = "action_key";
    field public static final String ACTION_MSG = "action_msg";
    field public static final String APP_DATA = "app_data";
    field public static final String CURSOR_EXTRA_KEY_IN_PROGRESS = "in_progress";
    field public static final String EXTRA_DATA_KEY = "intent_extra_data_key";
    field public static final String EXTRA_NEW_SEARCH = "new_search";
    field public static final String EXTRA_SELECT_QUERY = "select_query";
    field public static final String EXTRA_WEB_SEARCH_PENDINGINTENT = "web_search_pendingintent";
    field public static final int FLAG_QUERY_REFINEMENT = 1; // 0x1
    field public static final String INTENT_ACTION_GLOBAL_SEARCH = "android.search.action.GLOBAL_SEARCH";
    field public static final String INTENT_ACTION_SEARCHABLES_CHANGED = "android.search.action.SEARCHABLES_CHANGED";
    field public static final String INTENT_ACTION_SEARCH_SETTINGS = "android.search.action.SEARCH_SETTINGS";
    field public static final String INTENT_ACTION_SEARCH_SETTINGS_CHANGED = "android.search.action.SETTINGS_CHANGED";
    field public static final String INTENT_ACTION_WEB_SEARCH_SETTINGS = "android.search.action.WEB_SEARCH_SETTINGS";
    field public static final String INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED = "android.search.action.GLOBAL_SEARCH_ACTIVITY_CHANGED";
    field public static final char MENU_KEY = 115; // 0x0073 's'
    field public static final int MENU_KEYCODE = 47; // 0x2f
    field public static final String QUERY = "query";
    field public static final String SHORTCUT_MIME_TYPE = "vnd.android.cursor.item/vnd.android.search.suggest";
    field public static final String SUGGEST_COLUMN_AUDIO_CHANNEL_CONFIG = "suggest_audio_channel_config";
    field public static final String SUGGEST_COLUMN_CONTENT_TYPE = "suggest_content_type";
    field public static final String SUGGEST_COLUMN_DURATION = "suggest_duration";
    field public static final String SUGGEST_COLUMN_FLAGS = "suggest_flags";
    field public static final String SUGGEST_COLUMN_FORMAT = "suggest_format";
    field public static final String SUGGEST_COLUMN_ICON_1 = "suggest_icon_1";
    field public static final String SUGGEST_COLUMN_ICON_2 = "suggest_icon_2";
    field public static final String SUGGEST_COLUMN_INTENT_ACTION = "suggest_intent_action";
    field public static final String SUGGEST_COLUMN_INTENT_DATA = "suggest_intent_data";
    field public static final String SUGGEST_COLUMN_INTENT_DATA_ID = "suggest_intent_data_id";
    field public static final String SUGGEST_COLUMN_INTENT_EXTRA_DATA = "suggest_intent_extra_data";
    field public static final String SUGGEST_COLUMN_IS_LIVE = "suggest_is_live";
    field public static final String SUGGEST_COLUMN_LAST_ACCESS_HINT = "suggest_last_access_hint";
    field public static final String SUGGEST_COLUMN_PRODUCTION_YEAR = "suggest_production_year";
    field public static final String SUGGEST_COLUMN_PURCHASE_PRICE = "suggest_purchase_price";
    field public static final String SUGGEST_COLUMN_QUERY = "suggest_intent_query";
    field public static final String SUGGEST_COLUMN_RATING_SCORE = "suggest_rating_score";
    field public static final String SUGGEST_COLUMN_RATING_STYLE = "suggest_rating_style";
    field public static final String SUGGEST_COLUMN_RENTAL_PRICE = "suggest_rental_price";
    field public static final String SUGGEST_COLUMN_RESULT_CARD_IMAGE = "suggest_result_card_image";
    field public static final String SUGGEST_COLUMN_SHORTCUT_ID = "suggest_shortcut_id";
    field public static final String SUGGEST_COLUMN_SPINNER_WHILE_REFRESHING = "suggest_spinner_while_refreshing";
    field public static final String SUGGEST_COLUMN_TEXT_1 = "suggest_text_1";
    field public static final String SUGGEST_COLUMN_TEXT_2 = "suggest_text_2";
    field public static final String SUGGEST_COLUMN_TEXT_2_URL = "suggest_text_2_url";
    field public static final String SUGGEST_COLUMN_VIDEO_HEIGHT = "suggest_video_height";
    field public static final String SUGGEST_COLUMN_VIDEO_WIDTH = "suggest_video_width";
    field public static final String SUGGEST_MIME_TYPE = "vnd.android.cursor.dir/vnd.android.search.suggest";
    field public static final String SUGGEST_NEVER_MAKE_SHORTCUT = "_-1";
    field public static final String SUGGEST_PARAMETER_LIMIT = "limit";
    field public static final String SUGGEST_URI_PATH_QUERY = "search_suggest_query";
    field public static final String SUGGEST_URI_PATH_SHORTCUT = "search_suggest_shortcut";
    field public static final String USER_QUERY = "user_query";
  }

  public static interface SearchManager.OnCancelListener {
    method public void onCancel();
  }

  public static interface SearchManager.OnDismissListener {
    method public void onDismiss();
  }

  public final class SearchableInfo implements android.os.Parcelable {
    method public boolean autoUrlDetect();
    method public int describeContents();
    method public int getHintId();
    method public int getImeOptions();
    method public int getInputType();
    method public android.content.ComponentName getSearchActivity();
    method public int getSettingsDescriptionId();
    method public String getSuggestAuthority();
    method public String getSuggestIntentAction();
    method public String getSuggestIntentData();
    method public String getSuggestPackage();
    method public String getSuggestPath();
    method public String getSuggestSelection();
    method public int getSuggestThreshold();
    method @StringRes public int getVoiceLanguageId();
    method @StringRes public int getVoiceLanguageModeId();
    method public int getVoiceMaxResults();
    method @StringRes public int getVoicePromptTextId();
    method public boolean getVoiceSearchEnabled();
    method public boolean getVoiceSearchLaunchRecognizer();
    method public boolean getVoiceSearchLaunchWebSearch();
    method public boolean queryAfterZeroResults();
    method public boolean shouldIncludeInGlobalSearch();
    method public boolean shouldRewriteQueryFromData();
    method public boolean shouldRewriteQueryFromText();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.SearchableInfo> CREATOR;
  }

  public abstract class Service extends android.content.ContextWrapper implements android.content.ComponentCallbacks2 {
    ctor public Service();
    method protected void dump(java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method public final android.app.Application getApplication();
    method @Nullable public abstract android.os.IBinder onBind(android.content.Intent);
    method public void onConfigurationChanged(android.content.res.Configuration);
    method public void onCreate();
    method public void onDestroy();
    method public void onLowMemory();
    method public void onRebind(android.content.Intent);
    method @Deprecated public void onStart(android.content.Intent, int);
    method public int onStartCommand(android.content.Intent, int, int);
    method public void onTaskRemoved(android.content.Intent);
    method public void onTrimMemory(int);
    method public boolean onUnbind(android.content.Intent);
    method public final void startForeground(int, android.app.Notification);
    method public final void stopForeground(boolean);
    method public final void stopForeground(int);
    method public final void stopSelf();
    method public final void stopSelf(int);
    method public final boolean stopSelfResult(int);
    field public static final int START_CONTINUATION_MASK = 15; // 0xf
    field public static final int START_FLAG_REDELIVERY = 1; // 0x1
    field public static final int START_FLAG_RETRY = 2; // 0x2
    field public static final int START_NOT_STICKY = 2; // 0x2
    field public static final int START_REDELIVER_INTENT = 3; // 0x3
    field public static final int START_STICKY = 1; // 0x1
    field public static final int START_STICKY_COMPATIBILITY = 0; // 0x0
    field public static final int STOP_FOREGROUND_DETACH = 2; // 0x2
    field public static final int STOP_FOREGROUND_REMOVE = 1; // 0x1
  }

  public abstract class SharedElementCallback {
    ctor public SharedElementCallback();
    method public android.os.Parcelable onCaptureSharedElementSnapshot(android.view.View, android.graphics.Matrix, android.graphics.RectF);
    method public android.view.View onCreateSnapshotView(android.content.Context, android.os.Parcelable);
    method public void onMapSharedElements(java.util.List<java.lang.String>, java.util.Map<java.lang.String,android.view.View>);
    method public void onRejectSharedElements(java.util.List<android.view.View>);
    method public void onSharedElementEnd(java.util.List<java.lang.String>, java.util.List<android.view.View>, java.util.List<android.view.View>);
    method public void onSharedElementStart(java.util.List<java.lang.String>, java.util.List<android.view.View>, java.util.List<android.view.View>);
    method public void onSharedElementsArrived(java.util.List<java.lang.String>, java.util.List<android.view.View>, android.app.SharedElementCallback.OnSharedElementsReadyListener);
  }

  public static interface SharedElementCallback.OnSharedElementsReadyListener {
    method public void onSharedElementsReady();
  }

  @Deprecated public class TabActivity extends android.app.ActivityGroup {
    ctor @Deprecated public TabActivity();
    method @Deprecated public android.widget.TabHost getTabHost();
    method @Deprecated public android.widget.TabWidget getTabWidget();
    method @Deprecated public void setDefaultTab(String);
    method @Deprecated public void setDefaultTab(int);
  }

  public class TaskStackBuilder {
    method public android.app.TaskStackBuilder addNextIntent(android.content.Intent);
    method public android.app.TaskStackBuilder addNextIntentWithParentStack(android.content.Intent);
    method public android.app.TaskStackBuilder addParentStack(android.app.Activity);
    method public android.app.TaskStackBuilder addParentStack(Class<?>);
    method public android.app.TaskStackBuilder addParentStack(android.content.ComponentName);
    method public static android.app.TaskStackBuilder create(android.content.Context);
    method public android.content.Intent editIntentAt(int);
    method public int getIntentCount();
    method @NonNull public android.content.Intent[] getIntents();
    method public android.app.PendingIntent getPendingIntent(int, int);
    method public android.app.PendingIntent getPendingIntent(int, int, android.os.Bundle);
    method public void startActivities();
    method public void startActivities(android.os.Bundle);
  }

  public class TimePickerDialog extends android.app.AlertDialog implements android.content.DialogInterface.OnClickListener android.widget.TimePicker.OnTimeChangedListener {
    ctor public TimePickerDialog(android.content.Context, android.app.TimePickerDialog.OnTimeSetListener, int, int, boolean);
    ctor public TimePickerDialog(android.content.Context, int, android.app.TimePickerDialog.OnTimeSetListener, int, int, boolean);
    method public void onClick(android.content.DialogInterface, int);
    method public void onTimeChanged(android.widget.TimePicker, int, int);
    method public void updateTime(int, int);
  }

  public static interface TimePickerDialog.OnTimeSetListener {
    method public void onTimeSet(android.widget.TimePicker, int, int);
  }

  public final class UiAutomation {
    method public void clearWindowAnimationFrameStats();
    method public boolean clearWindowContentFrameStats(int);
    method public android.view.accessibility.AccessibilityEvent executeAndWaitForEvent(Runnable, android.app.UiAutomation.AccessibilityEventFilter, long) throws java.util.concurrent.TimeoutException;
    method public android.os.ParcelFileDescriptor executeShellCommand(String);
    method public android.view.accessibility.AccessibilityNodeInfo findFocus(int);
    method public android.view.accessibility.AccessibilityNodeInfo getRootInActiveWindow();
    method public android.accessibilityservice.AccessibilityServiceInfo getServiceInfo();
    method public android.view.WindowAnimationFrameStats getWindowAnimationFrameStats();
    method public android.view.WindowContentFrameStats getWindowContentFrameStats(int);
    method public java.util.List<android.view.accessibility.AccessibilityWindowInfo> getWindows();
    method public void grantRuntimePermission(String, String);
    method public void grantRuntimePermissionAsUser(String, String, android.os.UserHandle);
    method public boolean injectInputEvent(android.view.InputEvent, boolean);
    method public boolean performGlobalAction(int);
    method public void revokeRuntimePermission(String, String);
    method public void revokeRuntimePermissionAsUser(String, String, android.os.UserHandle);
    method public void setOnAccessibilityEventListener(android.app.UiAutomation.OnAccessibilityEventListener);
    method public boolean setRotation(int);
    method public void setRunAsMonkey(boolean);
    method public void setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo);
    method public android.graphics.Bitmap takeScreenshot();
    method public void waitForIdle(long, long) throws java.util.concurrent.TimeoutException;
    field public static final int FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES = 1; // 0x1
    field public static final int ROTATION_FREEZE_0 = 0; // 0x0
    field public static final int ROTATION_FREEZE_180 = 2; // 0x2
    field public static final int ROTATION_FREEZE_270 = 3; // 0x3
    field public static final int ROTATION_FREEZE_90 = 1; // 0x1
    field public static final int ROTATION_FREEZE_CURRENT = -1; // 0xffffffff
    field public static final int ROTATION_UNFREEZE = -2; // 0xfffffffe
  }

  public static interface UiAutomation.AccessibilityEventFilter {
    method public boolean accept(android.view.accessibility.AccessibilityEvent);
  }

  public static interface UiAutomation.OnAccessibilityEventListener {
    method public void onAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
  }

  public class UiModeManager {
    method public void disableCarMode(int);
    method public void enableCarMode(int);
    method public int getCurrentModeType();
    method public int getNightMode();
    method public void setNightMode(int);
    field public static String ACTION_ENTER_CAR_MODE;
    field public static String ACTION_ENTER_DESK_MODE;
    field public static String ACTION_EXIT_CAR_MODE;
    field public static String ACTION_EXIT_DESK_MODE;
    field public static final int DISABLE_CAR_MODE_GO_HOME = 1; // 0x1
    field public static final int ENABLE_CAR_MODE_ALLOW_SLEEP = 2; // 0x2
    field public static final int ENABLE_CAR_MODE_GO_CAR_HOME = 1; // 0x1
    field public static final int MODE_NIGHT_AUTO = 0; // 0x0
    field public static final int MODE_NIGHT_NO = 1; // 0x1
    field public static final int MODE_NIGHT_YES = 2; // 0x2
  }

  public final class VoiceInteractor {
    method public android.app.VoiceInteractor.Request getActiveRequest(String);
    method public android.app.VoiceInteractor.Request[] getActiveRequests();
    method public boolean submitRequest(android.app.VoiceInteractor.Request);
    method public boolean submitRequest(android.app.VoiceInteractor.Request, String);
    method public boolean[] supportsCommands(String[]);
  }

  public static class VoiceInteractor.AbortVoiceRequest extends android.app.VoiceInteractor.Request {
    ctor public VoiceInteractor.AbortVoiceRequest(@Nullable android.app.VoiceInteractor.Prompt, @Nullable android.os.Bundle);
    method public void onAbortResult(android.os.Bundle);
  }

  public static class VoiceInteractor.CommandRequest extends android.app.VoiceInteractor.Request {
    ctor public VoiceInteractor.CommandRequest(String, android.os.Bundle);
    method public void onCommandResult(boolean, android.os.Bundle);
  }

  public static class VoiceInteractor.CompleteVoiceRequest extends android.app.VoiceInteractor.Request {
    ctor public VoiceInteractor.CompleteVoiceRequest(@Nullable android.app.VoiceInteractor.Prompt, @Nullable android.os.Bundle);
    method public void onCompleteResult(android.os.Bundle);
  }

  public static class VoiceInteractor.ConfirmationRequest extends android.app.VoiceInteractor.Request {
    ctor public VoiceInteractor.ConfirmationRequest(@Nullable android.app.VoiceInteractor.Prompt, @Nullable android.os.Bundle);
    method public void onConfirmationResult(boolean, android.os.Bundle);
  }

  public static class VoiceInteractor.PickOptionRequest extends android.app.VoiceInteractor.Request {
    ctor public VoiceInteractor.PickOptionRequest(@Nullable android.app.VoiceInteractor.Prompt, android.app.VoiceInteractor.PickOptionRequest.Option[], @Nullable android.os.Bundle);
    method public void onPickOptionResult(boolean, android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
  }

  public static final class VoiceInteractor.PickOptionRequest.Option implements android.os.Parcelable {
    ctor public VoiceInteractor.PickOptionRequest.Option(CharSequence, int);
    method public android.app.VoiceInteractor.PickOptionRequest.Option addSynonym(CharSequence);
    method public int countSynonyms();
    method public int describeContents();
    method public android.os.Bundle getExtras();
    method public int getIndex();
    method public CharSequence getLabel();
    method public CharSequence getSynonymAt(int);
    method public void setExtras(android.os.Bundle);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.VoiceInteractor.PickOptionRequest.Option> CREATOR;
  }

  public static class VoiceInteractor.Prompt implements android.os.Parcelable {
    ctor public VoiceInteractor.Prompt(@NonNull CharSequence[], @NonNull CharSequence);
    ctor public VoiceInteractor.Prompt(@NonNull CharSequence);
    method public int countVoicePrompts();
    method public int describeContents();
    method @NonNull public CharSequence getVisualPrompt();
    method @NonNull public CharSequence getVoicePromptAt(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.VoiceInteractor.Prompt> CREATOR;
  }

  public abstract static class VoiceInteractor.Request {
    method public void cancel();
    method public android.app.Activity getActivity();
    method public android.content.Context getContext();
    method public String getName();
    method public void onAttached(android.app.Activity);
    method public void onCancel();
    method public void onDetached();
  }

  public final class WallpaperColors implements android.os.Parcelable {
    ctor public WallpaperColors(android.os.Parcel);
    ctor public WallpaperColors(@NonNull android.graphics.Color, @Nullable android.graphics.Color, @Nullable android.graphics.Color);
    method public int describeContents();
    method public static android.app.WallpaperColors fromBitmap(@NonNull android.graphics.Bitmap);
    method public static android.app.WallpaperColors fromDrawable(android.graphics.drawable.Drawable);
    method @NonNull public android.graphics.Color getPrimaryColor();
    method @Nullable public android.graphics.Color getSecondaryColor();
    method @Nullable public android.graphics.Color getTertiaryColor();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.WallpaperColors> CREATOR;
  }

  public final class WallpaperInfo implements android.os.Parcelable {
    ctor public WallpaperInfo(android.content.Context, android.content.pm.ResolveInfo) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public int describeContents();
    method public void dump(android.util.Printer, String);
    method public android.content.ComponentName getComponent();
    method public String getPackageName();
    method public android.content.pm.ServiceInfo getServiceInfo();
    method public String getServiceName();
    method public String getSettingsActivity();
    method public boolean getShowMetadataInPreview();
    method public CharSequence loadAuthor(android.content.pm.PackageManager) throws android.content.res.Resources.NotFoundException;
    method public CharSequence loadContextDescription(android.content.pm.PackageManager) throws android.content.res.Resources.NotFoundException;
    method public android.net.Uri loadContextUri(android.content.pm.PackageManager) throws android.content.res.Resources.NotFoundException;
    method public CharSequence loadDescription(android.content.pm.PackageManager) throws android.content.res.Resources.NotFoundException;
    method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager);
    method public CharSequence loadLabel(android.content.pm.PackageManager);
    method public android.graphics.drawable.Drawable loadThumbnail(android.content.pm.PackageManager);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.WallpaperInfo> CREATOR;
  }

  public class WallpaperManager {
    method public void addOnColorsChangedListener(@NonNull android.app.WallpaperManager.OnColorsChangedListener, @NonNull android.os.Handler);
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public void clear() throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public void clear(int) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public void clearWallpaper();
    method public void clearWallpaperOffsets(android.os.IBinder);
    method public void forgetLoadedWallpaper();
    method public android.graphics.drawable.Drawable getBuiltInDrawable();
    method public android.graphics.drawable.Drawable getBuiltInDrawable(int);
    method public android.graphics.drawable.Drawable getBuiltInDrawable(int, int, boolean, float, float);
    method public android.graphics.drawable.Drawable getBuiltInDrawable(int, int, boolean, float, float, int);
    method public android.content.Intent getCropAndSetWallpaperIntent(android.net.Uri);
    method public int getDesiredMinimumHeight();
    method public int getDesiredMinimumWidth();
    method public android.graphics.drawable.Drawable getDrawable();
    method @RequiresPermission(android.Manifest.permission.READ_EXTERNAL_STORAGE) public android.graphics.drawable.Drawable getFastDrawable();
    method public static android.app.WallpaperManager getInstance(android.content.Context);
    method @Nullable public android.app.WallpaperColors getWallpaperColors(int);
    method @RequiresPermission(android.Manifest.permission.READ_EXTERNAL_STORAGE) public android.os.ParcelFileDescriptor getWallpaperFile(int);
    method public int getWallpaperId(int);
    method public android.app.WallpaperInfo getWallpaperInfo();
    method public boolean hasResourceWallpaper(@RawRes int);
    method public boolean isSetWallpaperAllowed();
    method public boolean isWallpaperSupported();
    method public android.graphics.drawable.Drawable peekDrawable();
    method @RequiresPermission(android.Manifest.permission.READ_EXTERNAL_STORAGE) public android.graphics.drawable.Drawable peekFastDrawable();
    method public void removeOnColorsChangedListener(@NonNull android.app.WallpaperManager.OnColorsChangedListener);
    method public void sendWallpaperCommand(android.os.IBinder, String, int, int, int, android.os.Bundle);
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public void setBitmap(android.graphics.Bitmap) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean, int) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER_HINTS) public void setDisplayPadding(android.graphics.Rect);
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public void setResource(@RawRes int) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public int setResource(@RawRes int, int) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public void setStream(java.io.InputStream) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public int setStream(java.io.InputStream, android.graphics.Rect, boolean) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public int setStream(java.io.InputStream, android.graphics.Rect, boolean, int) throws java.io.IOException;
    method public void setWallpaperOffsetSteps(float, float);
    method public void setWallpaperOffsets(android.os.IBinder, float, float);
    method public void suggestDesiredDimensions(int, int);
    field public static final String ACTION_CHANGE_LIVE_WALLPAPER = "android.service.wallpaper.CHANGE_LIVE_WALLPAPER";
    field public static final String ACTION_CROP_AND_SET_WALLPAPER = "android.service.wallpaper.CROP_AND_SET_WALLPAPER";
    field public static final String ACTION_LIVE_WALLPAPER_CHOOSER = "android.service.wallpaper.LIVE_WALLPAPER_CHOOSER";
    field public static final String COMMAND_DROP = "android.home.drop";
    field public static final String COMMAND_SECONDARY_TAP = "android.wallpaper.secondaryTap";
    field public static final String COMMAND_TAP = "android.wallpaper.tap";
    field public static final String EXTRA_LIVE_WALLPAPER_COMPONENT = "android.service.wallpaper.extra.LIVE_WALLPAPER_COMPONENT";
    field public static final int FLAG_LOCK = 2; // 0x2
    field public static final int FLAG_SYSTEM = 1; // 0x1
    field public static final String WALLPAPER_PREVIEW_META_DATA = "android.wallpaper.preview";
  }

  public static interface WallpaperManager.OnColorsChangedListener {
    method public void onColorsChanged(android.app.WallpaperColors, int);
  }

}

package android.app.admin {

  public final class ConnectEvent extends android.app.admin.NetworkEvent implements android.os.Parcelable {
    method public java.net.InetAddress getInetAddress();
    method public int getPort();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.admin.ConnectEvent> CREATOR;
  }

  public final class DeviceAdminInfo implements android.os.Parcelable {
    ctor public DeviceAdminInfo(android.content.Context, android.content.pm.ResolveInfo) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public int describeContents();
    method public void dump(android.util.Printer, String);
    method public android.content.pm.ActivityInfo getActivityInfo();
    method @NonNull public android.content.ComponentName getComponent();
    method public String getPackageName();
    method public String getReceiverName();
    method public String getTagForPolicy(int);
    method public boolean isVisible();
    method public CharSequence loadDescription(android.content.pm.PackageManager) throws android.content.res.Resources.NotFoundException;
    method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager);
    method public CharSequence loadLabel(android.content.pm.PackageManager);
    method public boolean supportsTransferOwnership();
    method public boolean usesPolicy(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.admin.DeviceAdminInfo> CREATOR;
    field public static final int USES_ENCRYPTED_STORAGE = 7; // 0x7
    field public static final int USES_POLICY_DISABLE_CAMERA = 8; // 0x8
    field public static final int USES_POLICY_DISABLE_KEYGUARD_FEATURES = 9; // 0x9
    field public static final int USES_POLICY_EXPIRE_PASSWORD = 6; // 0x6
    field public static final int USES_POLICY_FORCE_LOCK = 3; // 0x3
    field public static final int USES_POLICY_LIMIT_PASSWORD = 0; // 0x0
    field public static final int USES_POLICY_RESET_PASSWORD = 2; // 0x2
    field public static final int USES_POLICY_WATCH_LOGIN = 1; // 0x1
    field public static final int USES_POLICY_WIPE_DATA = 4; // 0x4
  }

  public class DeviceAdminReceiver extends android.content.BroadcastReceiver {
    ctor public DeviceAdminReceiver();
    method public android.app.admin.DevicePolicyManager getManager(android.content.Context);
    method public android.content.ComponentName getWho(android.content.Context);
    method public void onBugreportFailed(android.content.Context, android.content.Intent, int);
    method public void onBugreportShared(android.content.Context, android.content.Intent, String);
    method public void onBugreportSharingDeclined(android.content.Context, android.content.Intent);
    method public String onChoosePrivateKeyAlias(android.content.Context, android.content.Intent, int, android.net.Uri, String);
    method public CharSequence onDisableRequested(android.content.Context, android.content.Intent);
    method public void onDisabled(android.content.Context, android.content.Intent);
    method public void onEnabled(android.content.Context, android.content.Intent);
    method public void onLockTaskModeEntering(android.content.Context, android.content.Intent, String);
    method public void onLockTaskModeExiting(android.content.Context, android.content.Intent);
    method public void onNetworkLogsAvailable(android.content.Context, android.content.Intent, long, int);
    method @Deprecated public void onPasswordChanged(android.content.Context, android.content.Intent);
    method public void onPasswordChanged(android.content.Context, android.content.Intent, android.os.UserHandle);
    method @Deprecated public void onPasswordExpiring(android.content.Context, android.content.Intent);
    method public void onPasswordExpiring(android.content.Context, android.content.Intent, android.os.UserHandle);
    method @Deprecated public void onPasswordFailed(android.content.Context, android.content.Intent);
    method public void onPasswordFailed(android.content.Context, android.content.Intent, android.os.UserHandle);
    method @Deprecated public void onPasswordSucceeded(android.content.Context, android.content.Intent);
    method public void onPasswordSucceeded(android.content.Context, android.content.Intent, android.os.UserHandle);
    method public void onProfileProvisioningComplete(android.content.Context, android.content.Intent);
    method @Deprecated public void onReadyForUserInitialization(android.content.Context, android.content.Intent);
    method public void onReceive(android.content.Context, android.content.Intent);
    method public void onSecurityLogsAvailable(android.content.Context, android.content.Intent);
    method public void onSystemUpdatePending(android.content.Context, android.content.Intent, long);
    method public void onTransferAffiliatedProfileOwnershipComplete(android.content.Context, android.os.UserHandle);
    method public void onTransferOwnershipComplete(@NonNull android.content.Context, @Nullable android.os.PersistableBundle);
    method public void onUserAdded(android.content.Context, android.content.Intent, @NonNull android.os.UserHandle);
    method public void onUserRemoved(android.content.Context, android.content.Intent, @NonNull android.os.UserHandle);
    method public void onUserStarted(android.content.Context, android.content.Intent, @NonNull android.os.UserHandle);
    method public void onUserStopped(android.content.Context, android.content.Intent, @NonNull android.os.UserHandle);
    method public void onUserSwitched(android.content.Context, android.content.Intent, @NonNull android.os.UserHandle);
    field public static final String ACTION_DEVICE_ADMIN_DISABLED = "android.app.action.DEVICE_ADMIN_DISABLED";
    field public static final String ACTION_DEVICE_ADMIN_DISABLE_REQUESTED = "android.app.action.DEVICE_ADMIN_DISABLE_REQUESTED";
    field public static final String ACTION_DEVICE_ADMIN_ENABLED = "android.app.action.DEVICE_ADMIN_ENABLED";
    field public static final String ACTION_LOCK_TASK_ENTERING = "android.app.action.LOCK_TASK_ENTERING";
    field public static final String ACTION_LOCK_TASK_EXITING = "android.app.action.LOCK_TASK_EXITING";
    field public static final String ACTION_PASSWORD_CHANGED = "android.app.action.ACTION_PASSWORD_CHANGED";
    field public static final String ACTION_PASSWORD_EXPIRING = "android.app.action.ACTION_PASSWORD_EXPIRING";
    field public static final String ACTION_PASSWORD_FAILED = "android.app.action.ACTION_PASSWORD_FAILED";
    field public static final String ACTION_PASSWORD_SUCCEEDED = "android.app.action.ACTION_PASSWORD_SUCCEEDED";
    field public static final String ACTION_PROFILE_PROVISIONING_COMPLETE = "android.app.action.PROFILE_PROVISIONING_COMPLETE";
    field public static final int BUGREPORT_FAILURE_FAILED_COMPLETING = 0; // 0x0
    field public static final int BUGREPORT_FAILURE_FILE_NO_LONGER_AVAILABLE = 1; // 0x1
    field public static final String DEVICE_ADMIN_META_DATA = "android.app.device_admin";
    field public static final String EXTRA_DISABLE_WARNING = "android.app.extra.DISABLE_WARNING";
    field public static final String EXTRA_LOCK_TASK_PACKAGE = "android.app.extra.LOCK_TASK_PACKAGE";
    field public static final String EXTRA_TRANSFER_OWNERSHIP_ADMIN_EXTRAS_BUNDLE = "android.app.extra.TRANSFER_OWNERSHIP_ADMIN_EXTRAS_BUNDLE";
  }

  public class DeviceAdminService extends android.app.Service {
    ctor public DeviceAdminService();
    method public final android.os.IBinder onBind(android.content.Intent);
  }

  public class DevicePolicyManager {
    method public void addCrossProfileIntentFilter(@NonNull android.content.ComponentName, android.content.IntentFilter, int);
    method public boolean addCrossProfileWidgetProvider(@NonNull android.content.ComponentName, String);
    method public int addOverrideApn(@NonNull android.content.ComponentName, @NonNull android.telephony.data.ApnSetting);
    method public void addPersistentPreferredActivity(@NonNull android.content.ComponentName, android.content.IntentFilter, @NonNull android.content.ComponentName);
    method public void addUserRestriction(@NonNull android.content.ComponentName, String);
    method public boolean bindDeviceAdminServiceAsUser(@NonNull android.content.ComponentName, android.content.Intent, @NonNull android.content.ServiceConnection, int, @NonNull android.os.UserHandle);
    method public void clearApplicationUserData(@NonNull android.content.ComponentName, @NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.app.admin.DevicePolicyManager.OnClearApplicationUserDataListener);
    method public void clearCrossProfileIntentFilters(@NonNull android.content.ComponentName);
    method @Deprecated public void clearDeviceOwnerApp(String);
    method public void clearPackagePersistentPreferredActivities(@NonNull android.content.ComponentName, String);
    method @Deprecated public void clearProfileOwner(@NonNull android.content.ComponentName);
    method public boolean clearResetPasswordToken(android.content.ComponentName);
    method public void clearUserRestriction(@NonNull android.content.ComponentName, String);
    method public android.content.Intent createAdminSupportIntent(@NonNull String);
    method @Nullable public android.os.UserHandle createAndManageUser(@NonNull android.content.ComponentName, @NonNull String, @NonNull android.content.ComponentName, @Nullable android.os.PersistableBundle, int);
    method public void enableSystemApp(@NonNull android.content.ComponentName, String);
    method public int enableSystemApp(@NonNull android.content.ComponentName, android.content.Intent);
    method public android.security.AttestedKeyPair generateKeyPair(@Nullable android.content.ComponentName, @NonNull String, @NonNull android.security.keystore.KeyGenParameterSpec, int);
    method @Nullable public String[] getAccountTypesWithManagementDisabled();
    method @Nullable public java.util.List<android.content.ComponentName> getActiveAdmins();
    method @NonNull public java.util.Set<java.lang.String> getAffiliationIds(@NonNull android.content.ComponentName);
    method @Nullable public java.util.List<java.lang.String> getAlwaysOnVpnLockdownWhitelist(@NonNull android.content.ComponentName);
    method @Nullable public String getAlwaysOnVpnPackage(@NonNull android.content.ComponentName);
    method @WorkerThread @NonNull public android.os.Bundle getApplicationRestrictions(@Nullable android.content.ComponentName, String);
    method @Deprecated @Nullable public String getApplicationRestrictionsManagingPackage(@NonNull android.content.ComponentName);
    method public boolean getAutoTimeRequired();
    method @NonNull public java.util.List<android.os.UserHandle> getBindDeviceAdminTargetUsers(@NonNull android.content.ComponentName);
    method public boolean getBluetoothContactSharingDisabled(@NonNull android.content.ComponentName);
    method public boolean getCameraDisabled(@Nullable android.content.ComponentName);
    method @Deprecated @Nullable public String getCertInstallerPackage(@NonNull android.content.ComponentName) throws java.lang.SecurityException;
    method public boolean getCrossProfileCallerIdDisabled(@NonNull android.content.ComponentName);
    method public boolean getCrossProfileContactsSearchDisabled(@NonNull android.content.ComponentName);
    method @NonNull public java.util.List<java.lang.String> getCrossProfileWidgetProviders(@NonNull android.content.ComponentName);
    method public int getCurrentFailedPasswordAttempts();
    method @Nullable public java.util.List<java.lang.String> getDelegatePackages(@NonNull android.content.ComponentName, @NonNull String);
    method @NonNull public java.util.List<java.lang.String> getDelegatedScopes(@Nullable android.content.ComponentName, @NonNull String);
    method public CharSequence getDeviceOwnerLockScreenInfo();
    method public CharSequence getEndUserSessionMessage(@NonNull android.content.ComponentName);
    method @NonNull public java.util.List<byte[]> getInstalledCaCerts(@Nullable android.content.ComponentName);
    method @Nullable public java.util.List<java.lang.String> getKeepUninstalledPackages(@Nullable android.content.ComponentName);
    method public int getKeyguardDisabledFeatures(@Nullable android.content.ComponentName);
    method public int getLockTaskFeatures(@NonNull android.content.ComponentName);
    method @NonNull public String[] getLockTaskPackages(@NonNull android.content.ComponentName);
    method @Nullable public CharSequence getLongSupportMessage(@NonNull android.content.ComponentName);
    method public int getMaximumFailedPasswordsForWipe(@Nullable android.content.ComponentName);
    method public long getMaximumTimeToLock(@Nullable android.content.ComponentName);
    method @NonNull public java.util.List<java.lang.String> getMeteredDataDisabledPackages(@NonNull android.content.ComponentName);
    method @ColorInt public int getOrganizationColor(@NonNull android.content.ComponentName);
    method @Nullable public CharSequence getOrganizationName(@NonNull android.content.ComponentName);
    method public java.util.List<android.telephony.data.ApnSetting> getOverrideApns(@NonNull android.content.ComponentName);
    method @NonNull public android.app.admin.DevicePolicyManager getParentProfileInstance(@NonNull android.content.ComponentName);
    method public long getPasswordExpiration(@Nullable android.content.ComponentName);
    method public long getPasswordExpirationTimeout(@Nullable android.content.ComponentName);
    method public int getPasswordHistoryLength(@Nullable android.content.ComponentName);
    method public int getPasswordMaximumLength(int);
    method public int getPasswordMinimumLength(@Nullable android.content.ComponentName);
    method public int getPasswordMinimumLetters(@Nullable android.content.ComponentName);
    method public int getPasswordMinimumLowerCase(@Nullable android.content.ComponentName);
    method public int getPasswordMinimumNonLetter(@Nullable android.content.ComponentName);
    method public int getPasswordMinimumNumeric(@Nullable android.content.ComponentName);
    method public int getPasswordMinimumSymbols(@Nullable android.content.ComponentName);
    method public int getPasswordMinimumUpperCase(@Nullable android.content.ComponentName);
    method public int getPasswordQuality(@Nullable android.content.ComponentName);
    method @Nullable public android.app.admin.SystemUpdateInfo getPendingSystemUpdate(@NonNull android.content.ComponentName);
    method public int getPermissionGrantState(@Nullable android.content.ComponentName, String, String);
    method public int getPermissionPolicy(android.content.ComponentName);
    method @Nullable public java.util.List<java.lang.String> getPermittedAccessibilityServices(@NonNull android.content.ComponentName);
    method @Nullable public java.util.List<java.lang.String> getPermittedCrossProfileNotificationListeners(@NonNull android.content.ComponentName);
    method @Nullable public java.util.List<java.lang.String> getPermittedInputMethods(@NonNull android.content.ComponentName);
    method public long getRequiredStrongAuthTimeout(@Nullable android.content.ComponentName);
    method public boolean getScreenCaptureDisabled(@Nullable android.content.ComponentName);
    method public java.util.List<android.os.UserHandle> getSecondaryUsers(@NonNull android.content.ComponentName);
    method public CharSequence getShortSupportMessage(@NonNull android.content.ComponentName);
    method public CharSequence getStartUserSessionMessage(@NonNull android.content.ComponentName);
    method public boolean getStorageEncryption(@Nullable android.content.ComponentName);
    method public int getStorageEncryptionStatus();
    method @Nullable public android.app.admin.SystemUpdatePolicy getSystemUpdatePolicy();
    method @Nullable public android.os.PersistableBundle getTransferOwnershipBundle();
    method @Nullable public java.util.List<android.os.PersistableBundle> getTrustAgentConfiguration(@Nullable android.content.ComponentName, @NonNull android.content.ComponentName);
    method @NonNull public android.os.Bundle getUserRestrictions(@NonNull android.content.ComponentName);
    method @Nullable public String getWifiMacAddress(@NonNull android.content.ComponentName);
    method public boolean hasCaCertInstalled(@Nullable android.content.ComponentName, byte[]);
    method public boolean hasGrantedPolicy(@NonNull android.content.ComponentName, int);
    method public boolean installCaCert(@Nullable android.content.ComponentName, byte[]);
    method public boolean installExistingPackage(@NonNull android.content.ComponentName, String);
    method public boolean installKeyPair(@Nullable android.content.ComponentName, @NonNull java.security.PrivateKey, @NonNull java.security.cert.Certificate, @NonNull String);
    method public boolean installKeyPair(@Nullable android.content.ComponentName, @NonNull java.security.PrivateKey, @NonNull java.security.cert.Certificate[], @NonNull String, boolean);
    method public boolean installKeyPair(@Nullable android.content.ComponentName, @NonNull java.security.PrivateKey, @NonNull java.security.cert.Certificate[], @NonNull String, int);
    method public boolean isActivePasswordSufficient();
    method public boolean isAdminActive(@NonNull android.content.ComponentName);
    method public boolean isAffiliatedUser();
    method public boolean isAlwaysOnVpnLockdownEnabled(@NonNull android.content.ComponentName);
    method public boolean isApplicationHidden(@NonNull android.content.ComponentName, String);
    method public boolean isBackupServiceEnabled(@NonNull android.content.ComponentName);
    method @Deprecated public boolean isCallerApplicationRestrictionsManagingPackage();
    method public boolean isDeviceIdAttestationSupported();
    method public boolean isDeviceOwnerApp(String);
    method public boolean isEphemeralUser(@NonNull android.content.ComponentName);
    method public boolean isLockTaskPermitted(String);
    method public boolean isLogoutEnabled();
    method public boolean isManagedProfile(@NonNull android.content.ComponentName);
    method public boolean isMasterVolumeMuted(@NonNull android.content.ComponentName);
    method public boolean isNetworkLoggingEnabled(@Nullable android.content.ComponentName);
    method public boolean isOverrideApnEnabled(@NonNull android.content.ComponentName);
    method public boolean isPackageSuspended(@NonNull android.content.ComponentName, String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public boolean isProfileOwnerApp(String);
    method public boolean isProvisioningAllowed(@NonNull String);
    method public boolean isResetPasswordTokenActive(android.content.ComponentName);
    method public boolean isSecurityLoggingEnabled(@Nullable android.content.ComponentName);
    method public boolean isUninstallBlocked(@Nullable android.content.ComponentName, String);
    method public boolean isUsingUnifiedPassword(@NonNull android.content.ComponentName);
    method public void lockNow();
    method public void lockNow(int);
    method public int logoutUser(@NonNull android.content.ComponentName);
    method public void reboot(@NonNull android.content.ComponentName);
    method public void removeActiveAdmin(@NonNull android.content.ComponentName);
    method public boolean removeCrossProfileWidgetProvider(@NonNull android.content.ComponentName, String);
    method public boolean removeKeyPair(@Nullable android.content.ComponentName, @NonNull String);
    method public boolean removeOverrideApn(@NonNull android.content.ComponentName, int);
    method public boolean removeUser(@NonNull android.content.ComponentName, @NonNull android.os.UserHandle);
    method public boolean requestBugreport(@NonNull android.content.ComponentName);
    method public boolean resetPassword(String, int);
    method public boolean resetPasswordWithToken(@NonNull android.content.ComponentName, String, byte[], int);
    method @Nullable public java.util.List<android.app.admin.NetworkEvent> retrieveNetworkLogs(@NonNull android.content.ComponentName, long);
    method @Nullable public java.util.List<android.app.admin.SecurityLog.SecurityEvent> retrievePreRebootSecurityLogs(@NonNull android.content.ComponentName);
    method @Nullable public java.util.List<android.app.admin.SecurityLog.SecurityEvent> retrieveSecurityLogs(@NonNull android.content.ComponentName);
    method public void setAccountManagementDisabled(@NonNull android.content.ComponentName, String, boolean);
    method public void setAffiliationIds(@NonNull android.content.ComponentName, @NonNull java.util.Set<java.lang.String>);
    method public void setAlwaysOnVpnPackage(@NonNull android.content.ComponentName, @Nullable String, boolean) throws android.content.pm.PackageManager.NameNotFoundException;
    method public void setAlwaysOnVpnPackage(@NonNull android.content.ComponentName, @Nullable String, boolean, @Nullable java.util.List<java.lang.String>) throws android.content.pm.PackageManager.NameNotFoundException;
    method public boolean setApplicationHidden(@NonNull android.content.ComponentName, String, boolean);
    method @WorkerThread public void setApplicationRestrictions(@Nullable android.content.ComponentName, String, android.os.Bundle);
    method @Deprecated public void setApplicationRestrictionsManagingPackage(@NonNull android.content.ComponentName, @Nullable String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public void setAutoTimeRequired(@NonNull android.content.ComponentName, boolean);
    method public void setBackupServiceEnabled(@NonNull android.content.ComponentName, boolean);
    method public void setBluetoothContactSharingDisabled(@NonNull android.content.ComponentName, boolean);
    method public void setCameraDisabled(@NonNull android.content.ComponentName, boolean);
    method @Deprecated public void setCertInstallerPackage(@NonNull android.content.ComponentName, @Nullable String) throws java.lang.SecurityException;
    method public void setCrossProfileCallerIdDisabled(@NonNull android.content.ComponentName, boolean);
    method public void setCrossProfileContactsSearchDisabled(@NonNull android.content.ComponentName, boolean);
    method public void setDelegatedScopes(@NonNull android.content.ComponentName, @NonNull String, @NonNull java.util.List<java.lang.String>);
    method public void setDeviceOwnerLockScreenInfo(@NonNull android.content.ComponentName, CharSequence);
    method public void setEndUserSessionMessage(@NonNull android.content.ComponentName, @Nullable CharSequence);
    method public void setGlobalSetting(@NonNull android.content.ComponentName, String, String);
    method public void setKeepUninstalledPackages(@Nullable android.content.ComponentName, @NonNull java.util.List<java.lang.String>);
    method public boolean setKeyPairCertificate(@Nullable android.content.ComponentName, @NonNull String, @NonNull java.util.List<java.security.cert.Certificate>, boolean);
    method public boolean setKeyguardDisabled(@NonNull android.content.ComponentName, boolean);
    method public void setKeyguardDisabledFeatures(@NonNull android.content.ComponentName, int);
    method public void setLockTaskFeatures(@NonNull android.content.ComponentName, int);
    method public void setLockTaskPackages(@NonNull android.content.ComponentName, @NonNull String[]) throws java.lang.SecurityException;
    method public void setLogoutEnabled(@NonNull android.content.ComponentName, boolean);
    method public void setLongSupportMessage(@NonNull android.content.ComponentName, @Nullable CharSequence);
    method public void setMasterVolumeMuted(@NonNull android.content.ComponentName, boolean);
    method public void setMaximumFailedPasswordsForWipe(@NonNull android.content.ComponentName, int);
    method public void setMaximumTimeToLock(@NonNull android.content.ComponentName, long);
    method @NonNull public java.util.List<java.lang.String> setMeteredDataDisabledPackages(@NonNull android.content.ComponentName, @NonNull java.util.List<java.lang.String>);
    method public void setNetworkLoggingEnabled(@NonNull android.content.ComponentName, boolean);
    method public void setOrganizationColor(@NonNull android.content.ComponentName, int);
    method public void setOrganizationName(@NonNull android.content.ComponentName, @Nullable CharSequence);
    method public void setOverrideApnsEnabled(@NonNull android.content.ComponentName, boolean);
    method @NonNull public String[] setPackagesSuspended(@NonNull android.content.ComponentName, @NonNull String[], boolean);
    method public void setPasswordExpirationTimeout(@NonNull android.content.ComponentName, long);
    method public void setPasswordHistoryLength(@NonNull android.content.ComponentName, int);
    method public void setPasswordMinimumLength(@NonNull android.content.ComponentName, int);
    method public void setPasswordMinimumLetters(@NonNull android.content.ComponentName, int);
    method public void setPasswordMinimumLowerCase(@NonNull android.content.ComponentName, int);
    method public void setPasswordMinimumNonLetter(@NonNull android.content.ComponentName, int);
    method public void setPasswordMinimumNumeric(@NonNull android.content.ComponentName, int);
    method public void setPasswordMinimumSymbols(@NonNull android.content.ComponentName, int);
    method public void setPasswordMinimumUpperCase(@NonNull android.content.ComponentName, int);
    method public void setPasswordQuality(@NonNull android.content.ComponentName, int);
    method public boolean setPermissionGrantState(@NonNull android.content.ComponentName, String, String, int);
    method public void setPermissionPolicy(@NonNull android.content.ComponentName, int);
    method public boolean setPermittedAccessibilityServices(@NonNull android.content.ComponentName, java.util.List<java.lang.String>);
    method public boolean setPermittedCrossProfileNotificationListeners(@NonNull android.content.ComponentName, @Nullable java.util.List<java.lang.String>);
    method public boolean setPermittedInputMethods(@NonNull android.content.ComponentName, java.util.List<java.lang.String>);
    method public void setProfileEnabled(@NonNull android.content.ComponentName);
    method public void setProfileName(@NonNull android.content.ComponentName, String);
    method public void setRecommendedGlobalProxy(@NonNull android.content.ComponentName, @Nullable android.net.ProxyInfo);
    method public void setRequiredStrongAuthTimeout(@NonNull android.content.ComponentName, long);
    method public boolean setResetPasswordToken(android.content.ComponentName, byte[]);
    method public void setRestrictionsProvider(@NonNull android.content.ComponentName, @Nullable android.content.ComponentName);
    method public void setScreenCaptureDisabled(@NonNull android.content.ComponentName, boolean);
    method public void setSecureSetting(@NonNull android.content.ComponentName, String, String);
    method public void setSecurityLoggingEnabled(@NonNull android.content.ComponentName, boolean);
    method public void setShortSupportMessage(@NonNull android.content.ComponentName, @Nullable CharSequence);
    method public void setStartUserSessionMessage(@NonNull android.content.ComponentName, @Nullable CharSequence);
    method public boolean setStatusBarDisabled(@NonNull android.content.ComponentName, boolean);
    method public int setStorageEncryption(@NonNull android.content.ComponentName, boolean);
    method public void setSystemSetting(@NonNull android.content.ComponentName, @NonNull String, String);
    method public void setSystemUpdatePolicy(@NonNull android.content.ComponentName, android.app.admin.SystemUpdatePolicy);
    method public boolean setTime(@NonNull android.content.ComponentName, long);
    method public boolean setTimeZone(@NonNull android.content.ComponentName, String);
    method public void setTrustAgentConfiguration(@NonNull android.content.ComponentName, @NonNull android.content.ComponentName, android.os.PersistableBundle);
    method public void setUninstallBlocked(@Nullable android.content.ComponentName, String, boolean);
    method public void setUserIcon(@NonNull android.content.ComponentName, android.graphics.Bitmap);
    method public int startUserInBackground(@NonNull android.content.ComponentName, @NonNull android.os.UserHandle);
    method public int stopUser(@NonNull android.content.ComponentName, @NonNull android.os.UserHandle);
    method public boolean switchUser(@NonNull android.content.ComponentName, @Nullable android.os.UserHandle);
    method public void transferOwnership(@NonNull android.content.ComponentName, @NonNull android.content.ComponentName, @Nullable android.os.PersistableBundle);
    method public void uninstallAllUserCaCerts(@Nullable android.content.ComponentName);
    method public void uninstallCaCert(@Nullable android.content.ComponentName, byte[]);
    method public boolean updateOverrideApn(@NonNull android.content.ComponentName, int, @NonNull android.telephony.data.ApnSetting);
    method public void wipeData(int);
    method public void wipeData(int, @NonNull CharSequence);
    field public static final String ACTION_ADD_DEVICE_ADMIN = "android.app.action.ADD_DEVICE_ADMIN";
    field public static final String ACTION_APPLICATION_DELEGATION_SCOPES_CHANGED = "android.app.action.APPLICATION_DELEGATION_SCOPES_CHANGED";
    field public static final String ACTION_DEVICE_ADMIN_SERVICE = "android.app.action.DEVICE_ADMIN_SERVICE";
    field public static final String ACTION_DEVICE_OWNER_CHANGED = "android.app.action.DEVICE_OWNER_CHANGED";
    field public static final String ACTION_MANAGED_PROFILE_PROVISIONED = "android.app.action.MANAGED_PROFILE_PROVISIONED";
    field public static final String ACTION_PROFILE_OWNER_CHANGED = "android.app.action.PROFILE_OWNER_CHANGED";
    field public static final String ACTION_PROVISIONING_SUCCESSFUL = "android.app.action.PROVISIONING_SUCCESSFUL";
    field public static final String ACTION_PROVISION_MANAGED_DEVICE = "android.app.action.PROVISION_MANAGED_DEVICE";
    field public static final String ACTION_PROVISION_MANAGED_PROFILE = "android.app.action.PROVISION_MANAGED_PROFILE";
    field public static final String ACTION_SET_NEW_PARENT_PROFILE_PASSWORD = "android.app.action.SET_NEW_PARENT_PROFILE_PASSWORD";
    field public static final String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD";
    field public static final String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION";
    field public static final String ACTION_SYSTEM_UPDATE_POLICY_CHANGED = "android.app.action.SYSTEM_UPDATE_POLICY_CHANGED";
    field public static final String DELEGATION_APP_RESTRICTIONS = "delegation-app-restrictions";
    field public static final String DELEGATION_BLOCK_UNINSTALL = "delegation-block-uninstall";
    field public static final String DELEGATION_CERT_INSTALL = "delegation-cert-install";
    field public static final String DELEGATION_ENABLE_SYSTEM_APP = "delegation-enable-system-app";
    field public static final String DELEGATION_INSTALL_EXISTING_PACKAGE = "delegation-install-existing-package";
    field public static final String DELEGATION_KEEP_UNINSTALLED_PACKAGES = "delegation-keep-uninstalled-packages";
    field public static final String DELEGATION_PACKAGE_ACCESS = "delegation-package-access";
    field public static final String DELEGATION_PERMISSION_GRANT = "delegation-permission-grant";
    field public static final int ENCRYPTION_STATUS_ACTIVATING = 2; // 0x2
    field public static final int ENCRYPTION_STATUS_ACTIVE = 3; // 0x3
    field public static final int ENCRYPTION_STATUS_ACTIVE_DEFAULT_KEY = 4; // 0x4
    field public static final int ENCRYPTION_STATUS_ACTIVE_PER_USER = 5; // 0x5
    field public static final int ENCRYPTION_STATUS_INACTIVE = 1; // 0x1
    field public static final int ENCRYPTION_STATUS_UNSUPPORTED = 0; // 0x0
    field public static final String EXTRA_ADD_EXPLANATION = "android.app.extra.ADD_EXPLANATION";
    field public static final String EXTRA_DELEGATION_SCOPES = "android.app.extra.DELEGATION_SCOPES";
    field public static final String EXTRA_DEVICE_ADMIN = "android.app.extra.DEVICE_ADMIN";
    field public static final String EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE = "android.app.extra.PROVISIONING_ACCOUNT_TO_MIGRATE";
    field public static final String EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE = "android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE";
    field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME = "android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME";
    field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_MINIMUM_VERSION_CODE = "android.app.extra.PROVISIONING_DEVICE_ADMIN_MINIMUM_VERSION_CODE";
    field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM";
    field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER";
    field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION";
    field @Deprecated public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME";
    field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM = "android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM";
    field public static final String EXTRA_PROVISIONING_DISCLAIMERS = "android.app.extra.PROVISIONING_DISCLAIMERS";
    field public static final String EXTRA_PROVISIONING_DISCLAIMER_CONTENT = "android.app.extra.PROVISIONING_DISCLAIMER_CONTENT";
    field public static final String EXTRA_PROVISIONING_DISCLAIMER_HEADER = "android.app.extra.PROVISIONING_DISCLAIMER_HEADER";
    field @Deprecated public static final String EXTRA_PROVISIONING_EMAIL_ADDRESS = "android.app.extra.PROVISIONING_EMAIL_ADDRESS";
    field public static final String EXTRA_PROVISIONING_KEEP_ACCOUNT_ON_MIGRATION = "android.app.extra.PROVISIONING_KEEP_ACCOUNT_ON_MIGRATION";
    field public static final String EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED = "android.app.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED";
    field public static final String EXTRA_PROVISIONING_LOCALE = "android.app.extra.PROVISIONING_LOCALE";
    field public static final String EXTRA_PROVISIONING_LOCAL_TIME = "android.app.extra.PROVISIONING_LOCAL_TIME";
    field public static final String EXTRA_PROVISIONING_LOGO_URI = "android.app.extra.PROVISIONING_LOGO_URI";
    field public static final String EXTRA_PROVISIONING_MAIN_COLOR = "android.app.extra.PROVISIONING_MAIN_COLOR";
    field public static final String EXTRA_PROVISIONING_SKIP_ENCRYPTION = "android.app.extra.PROVISIONING_SKIP_ENCRYPTION";
    field public static final String EXTRA_PROVISIONING_SKIP_USER_CONSENT = "android.app.extra.PROVISIONING_SKIP_USER_CONSENT";
    field public static final String EXTRA_PROVISIONING_TIME_ZONE = "android.app.extra.PROVISIONING_TIME_ZONE";
    field public static final String EXTRA_PROVISIONING_WIFI_HIDDEN = "android.app.extra.PROVISIONING_WIFI_HIDDEN";
    field public static final String EXTRA_PROVISIONING_WIFI_PAC_URL = "android.app.extra.PROVISIONING_WIFI_PAC_URL";
    field public static final String EXTRA_PROVISIONING_WIFI_PASSWORD = "android.app.extra.PROVISIONING_WIFI_PASSWORD";
    field public static final String EXTRA_PROVISIONING_WIFI_PROXY_BYPASS = "android.app.extra.PROVISIONING_WIFI_PROXY_BYPASS";
    field public static final String EXTRA_PROVISIONING_WIFI_PROXY_HOST = "android.app.extra.PROVISIONING_WIFI_PROXY_HOST";
    field public static final String EXTRA_PROVISIONING_WIFI_PROXY_PORT = "android.app.extra.PROVISIONING_WIFI_PROXY_PORT";
    field public static final String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE";
    field public static final String EXTRA_PROVISIONING_WIFI_SSID = "android.app.extra.PROVISIONING_WIFI_SSID";
    field public static final int FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY = 1; // 0x1
    field public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2
    field public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 1; // 0x1
    field public static final int ID_TYPE_BASE_INFO = 1; // 0x1
    field public static final int ID_TYPE_IMEI = 4; // 0x4
    field public static final int ID_TYPE_MEID = 8; // 0x8
    field public static final int ID_TYPE_SERIAL = 2; // 0x2
    field public static final int INSTALLKEY_REQUEST_CREDENTIALS_ACCESS = 1; // 0x1
    field public static final int INSTALLKEY_SET_USER_SELECTABLE = 2; // 0x2
    field public static final int KEYGUARD_DISABLE_BIOMETRICS = 416; // 0x1a0
    field public static final int KEYGUARD_DISABLE_FACE = 128; // 0x80
    field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff
    field public static final int KEYGUARD_DISABLE_FEATURES_NONE = 0; // 0x0
    field public static final int KEYGUARD_DISABLE_FINGERPRINT = 32; // 0x20
    field public static final int KEYGUARD_DISABLE_IRIS = 256; // 0x100
    field public static final int KEYGUARD_DISABLE_REMOTE_INPUT = 64; // 0x40
    field public static final int KEYGUARD_DISABLE_SECURE_CAMERA = 2; // 0x2
    field public static final int KEYGUARD_DISABLE_SECURE_NOTIFICATIONS = 4; // 0x4
    field public static final int KEYGUARD_DISABLE_TRUST_AGENTS = 16; // 0x10
    field public static final int KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS = 8; // 0x8
    field public static final int KEYGUARD_DISABLE_WIDGETS_ALL = 1; // 0x1
    field public static final int LEAVE_ALL_SYSTEM_APPS_ENABLED = 16; // 0x10
    field public static final int LOCK_TASK_FEATURE_GLOBAL_ACTIONS = 16; // 0x10
    field public static final int LOCK_TASK_FEATURE_HOME = 4; // 0x4
    field public static final int LOCK_TASK_FEATURE_KEYGUARD = 32; // 0x20
    field public static final int LOCK_TASK_FEATURE_NONE = 0; // 0x0
    field public static final int LOCK_TASK_FEATURE_NOTIFICATIONS = 2; // 0x2
    field public static final int LOCK_TASK_FEATURE_OVERVIEW = 8; // 0x8
    field public static final int LOCK_TASK_FEATURE_SYSTEM_INFO = 1; // 0x1
    field public static final int MAKE_USER_EPHEMERAL = 2; // 0x2
    field public static final String MIME_TYPE_PROVISIONING_NFC = "application/com.android.managedprovisioning";
    field public static final int PASSWORD_QUALITY_ALPHABETIC = 262144; // 0x40000
    field public static final int PASSWORD_QUALITY_ALPHANUMERIC = 327680; // 0x50000
    field public static final int PASSWORD_QUALITY_BIOMETRIC_WEAK = 32768; // 0x8000
    field public static final int PASSWORD_QUALITY_COMPLEX = 393216; // 0x60000
    field public static final int PASSWORD_QUALITY_NUMERIC = 131072; // 0x20000
    field public static final int PASSWORD_QUALITY_NUMERIC_COMPLEX = 196608; // 0x30000
    field public static final int PASSWORD_QUALITY_SOMETHING = 65536; // 0x10000
    field public static final int PASSWORD_QUALITY_UNSPECIFIED = 0; // 0x0
    field public static final int PERMISSION_GRANT_STATE_DEFAULT = 0; // 0x0
    field public static final int PERMISSION_GRANT_STATE_DENIED = 2; // 0x2
    field public static final int PERMISSION_GRANT_STATE_GRANTED = 1; // 0x1
    field public static final int PERMISSION_POLICY_AUTO_DENY = 2; // 0x2
    field public static final int PERMISSION_POLICY_AUTO_GRANT = 1; // 0x1
    field public static final int PERMISSION_POLICY_PROMPT = 0; // 0x0
    field public static final String POLICY_DISABLE_CAMERA = "policy_disable_camera";
    field public static final String POLICY_DISABLE_SCREEN_CAPTURE = "policy_disable_screen_capture";
    field public static final int RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT = 2; // 0x2
    field public static final int RESET_PASSWORD_REQUIRE_ENTRY = 1; // 0x1
    field public static final int SKIP_SETUP_WIZARD = 1; // 0x1
    field public static final int WIPE_EUICC = 4; // 0x4
    field public static final int WIPE_EXTERNAL_STORAGE = 1; // 0x1
    field public static final int WIPE_RESET_PROTECTION_DATA = 2; // 0x2
  }

  public static interface DevicePolicyManager.OnClearApplicationUserDataListener {
    method public void onApplicationUserDataCleared(String, boolean);
  }

  public final class DnsEvent extends android.app.admin.NetworkEvent implements android.os.Parcelable {
    method public String getHostname();
    method public java.util.List<java.net.InetAddress> getInetAddresses();
    method public int getTotalResolvedAddressCount();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.admin.DnsEvent> CREATOR;
  }

  public class FreezePeriod {
    ctor public FreezePeriod(java.time.MonthDay, java.time.MonthDay);
    method public java.time.MonthDay getEnd();
    method public java.time.MonthDay getStart();
  }

  public abstract class NetworkEvent implements android.os.Parcelable {
    method public int describeContents();
    method public long getId();
    method public String getPackageName();
    method public long getTimestamp();
    field public static final android.os.Parcelable.Creator<android.app.admin.NetworkEvent> CREATOR;
  }

  public class SecurityLog {
    ctor public SecurityLog();
    field public static final int LEVEL_ERROR = 3; // 0x3
    field public static final int LEVEL_INFO = 1; // 0x1
    field public static final int LEVEL_WARNING = 2; // 0x2
    field public static final int TAG_ADB_SHELL_CMD = 210002; // 0x33452
    field public static final int TAG_ADB_SHELL_INTERACTIVE = 210001; // 0x33451
    field public static final int TAG_APP_PROCESS_START = 210005; // 0x33455
    field public static final int TAG_CERT_AUTHORITY_INSTALLED = 210029; // 0x3346d
    field public static final int TAG_CERT_AUTHORITY_REMOVED = 210030; // 0x3346e
    field public static final int TAG_CERT_VALIDATION_FAILURE = 210033; // 0x33471
    field public static final int TAG_CRYPTO_SELF_TEST_COMPLETED = 210031; // 0x3346f
    field public static final int TAG_KEYGUARD_DISABLED_FEATURES_SET = 210021; // 0x33465
    field public static final int TAG_KEYGUARD_DISMISSED = 210006; // 0x33456
    field public static final int TAG_KEYGUARD_DISMISS_AUTH_ATTEMPT = 210007; // 0x33457
    field public static final int TAG_KEYGUARD_SECURED = 210008; // 0x33458
    field public static final int TAG_KEY_DESTRUCTION = 210026; // 0x3346a
    field public static final int TAG_KEY_GENERATED = 210024; // 0x33468
    field public static final int TAG_KEY_IMPORT = 210025; // 0x33469
    field public static final int TAG_KEY_INTEGRITY_VIOLATION = 210032; // 0x33470
    field public static final int TAG_LOGGING_STARTED = 210011; // 0x3345b
    field public static final int TAG_LOGGING_STOPPED = 210012; // 0x3345c
    field public static final int TAG_LOG_BUFFER_SIZE_CRITICAL = 210015; // 0x3345f
    field public static final int TAG_MAX_PASSWORD_ATTEMPTS_SET = 210020; // 0x33464
    field public static final int TAG_MAX_SCREEN_LOCK_TIMEOUT_SET = 210019; // 0x33463
    field public static final int TAG_MEDIA_MOUNT = 210013; // 0x3345d
    field public static final int TAG_MEDIA_UNMOUNT = 210014; // 0x3345e
    field public static final int TAG_OS_SHUTDOWN = 210010; // 0x3345a
    field public static final int TAG_OS_STARTUP = 210009; // 0x33459
    field public static final int TAG_PASSWORD_COMPLEXITY_SET = 210017; // 0x33461
    field public static final int TAG_PASSWORD_EXPIRATION_SET = 210016; // 0x33460
    field public static final int TAG_PASSWORD_HISTORY_LENGTH_SET = 210018; // 0x33462
    field public static final int TAG_REMOTE_LOCK = 210022; // 0x33466
    field public static final int TAG_SYNC_RECV_FILE = 210003; // 0x33453
    field public static final int TAG_SYNC_SEND_FILE = 210004; // 0x33454
    field public static final int TAG_USER_RESTRICTION_ADDED = 210027; // 0x3346b
    field public static final int TAG_USER_RESTRICTION_REMOVED = 210028; // 0x3346c
    field public static final int TAG_WIPE_FAILURE = 210023; // 0x33467
  }

  public static final class SecurityLog.SecurityEvent implements android.os.Parcelable {
    method public int describeContents();
    method public Object getData();
    method public long getId();
    method public int getLogLevel();
    method public int getTag();
    method public long getTimeNanos();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.admin.SecurityLog.SecurityEvent> CREATOR;
  }

  public final class SystemUpdateInfo implements android.os.Parcelable {
    method public int describeContents();
    method public long getReceivedTime();
    method public int getSecurityPatchState();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.admin.SystemUpdateInfo> CREATOR;
    field public static final int SECURITY_PATCH_STATE_FALSE = 1; // 0x1
    field public static final int SECURITY_PATCH_STATE_TRUE = 2; // 0x2
    field public static final int SECURITY_PATCH_STATE_UNKNOWN = 0; // 0x0
  }

  public final class SystemUpdatePolicy implements android.os.Parcelable {
    method public static android.app.admin.SystemUpdatePolicy createAutomaticInstallPolicy();
    method public static android.app.admin.SystemUpdatePolicy createPostponeInstallPolicy();
    method public static android.app.admin.SystemUpdatePolicy createWindowedInstallPolicy(int, int);
    method public int describeContents();
    method public java.util.List<android.app.admin.FreezePeriod> getFreezePeriods();
    method public int getInstallWindowEnd();
    method public int getInstallWindowStart();
    method public int getPolicyType();
    method public android.app.admin.SystemUpdatePolicy setFreezePeriods(java.util.List<android.app.admin.FreezePeriod>);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.admin.SystemUpdatePolicy> CREATOR;
    field public static final int TYPE_INSTALL_AUTOMATIC = 1; // 0x1
    field public static final int TYPE_INSTALL_WINDOWED = 2; // 0x2
    field public static final int TYPE_POSTPONE = 3; // 0x3
  }

  public static final class SystemUpdatePolicy.ValidationFailedException extends java.lang.IllegalArgumentException implements android.os.Parcelable {
    method public int describeContents();
    method public int getErrorCode();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.admin.SystemUpdatePolicy.ValidationFailedException> CREATOR;
    field public static final int ERROR_COMBINED_FREEZE_PERIOD_TOO_CLOSE = 6; // 0x6
    field public static final int ERROR_COMBINED_FREEZE_PERIOD_TOO_LONG = 5; // 0x5
    field public static final int ERROR_DUPLICATE_OR_OVERLAP = 2; // 0x2
    field public static final int ERROR_NEW_FREEZE_PERIOD_TOO_CLOSE = 4; // 0x4
    field public static final int ERROR_NEW_FREEZE_PERIOD_TOO_LONG = 3; // 0x3
    field public static final int ERROR_UNKNOWN = 1; // 0x1
  }

}

package android.app.assist {

  public class AssistContent implements android.os.Parcelable {
    ctor public AssistContent();
    method public int describeContents();
    method public android.content.ClipData getClipData();
    method public android.os.Bundle getExtras();
    method public android.content.Intent getIntent();
    method public String getStructuredData();
    method public android.net.Uri getWebUri();
    method public boolean isAppProvidedIntent();
    method public boolean isAppProvidedWebUri();
    method public void setClipData(android.content.ClipData);
    method public void setIntent(android.content.Intent);
    method public void setStructuredData(String);
    method public void setWebUri(android.net.Uri);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.assist.AssistContent> CREATOR;
  }

  public class AssistStructure implements android.os.Parcelable {
    ctor public AssistStructure();
    method public int describeContents();
    method public long getAcquisitionEndTime();
    method public long getAcquisitionStartTime();
    method public android.content.ComponentName getActivityComponent();
    method public android.app.assist.AssistStructure.WindowNode getWindowNodeAt(int);
    method public int getWindowNodeCount();
    method public boolean isHomeActivity();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.assist.AssistStructure> CREATOR;
  }

  public static class AssistStructure.ViewNode {
    method public float getAlpha();
    method @Nullable public String[] getAutofillHints();
    method @Nullable public android.view.autofill.AutofillId getAutofillId();
    method @Nullable public CharSequence[] getAutofillOptions();
    method public int getAutofillType();
    method @Nullable public android.view.autofill.AutofillValue getAutofillValue();
    method public android.app.assist.AssistStructure.ViewNode getChildAt(int);
    method public int getChildCount();
    method public String getClassName();
    method public CharSequence getContentDescription();
    method public float getElevation();
    method public android.os.Bundle getExtras();
    method public int getHeight();
    method public String getHint();
    method @Nullable public android.view.ViewStructure.HtmlInfo getHtmlInfo();
    method public int getId();
    method public String getIdEntry();
    method public String getIdPackage();
    method public String getIdType();
    method public int getImportantForAutofill();
    method public int getInputType();
    method public int getLeft();
    method @Nullable public android.os.LocaleList getLocaleList();
    method public int getMaxTextEms();
    method public int getMaxTextLength();
    method public int getMinTextEms();
    method public int getScrollX();
    method public int getScrollY();
    method public CharSequence getText();
    method public int getTextBackgroundColor();
    method public int getTextColor();
    method @Nullable public String getTextIdEntry();
    method public int[] getTextLineBaselines();
    method public int[] getTextLineCharOffsets();
    method public int getTextSelectionEnd();
    method public int getTextSelectionStart();
    method public float getTextSize();
    method public int getTextStyle();
    method public int getTop();
    method public android.graphics.Matrix getTransformation();
    method public int getVisibility();
    method @Nullable public String getWebDomain();
    method @Nullable public String getWebScheme();
    method public int getWidth();
    method public boolean isAccessibilityFocused();
    method public boolean isActivated();
    method public boolean isAssistBlocked();
    method public boolean isCheckable();
    method public boolean isChecked();
    method public boolean isClickable();
    method public boolean isContextClickable();
    method public boolean isEnabled();
    method public boolean isFocusable();
    method public boolean isFocused();
    method public boolean isLongClickable();
    method public boolean isOpaque();
    method public boolean isSelected();
    field public static final int TEXT_COLOR_UNDEFINED = 1; // 0x1
    field public static final int TEXT_STYLE_BOLD = 1; // 0x1
    field public static final int TEXT_STYLE_ITALIC = 2; // 0x2
    field public static final int TEXT_STYLE_STRIKE_THRU = 8; // 0x8
    field public static final int TEXT_STYLE_UNDERLINE = 4; // 0x4
  }

  public static class AssistStructure.WindowNode {
    method public int getDisplayId();
    method public int getHeight();
    method public int getLeft();
    method public android.app.assist.AssistStructure.ViewNode getRootViewNode();
    method public CharSequence getTitle();
    method public int getTop();
    method public int getWidth();
  }

}

package android.app.backup {

  public abstract class BackupAgent extends android.content.ContextWrapper {
    ctor public BackupAgent();
    method public final void fullBackupFile(java.io.File, android.app.backup.FullBackupDataOutput);
    method public abstract void onBackup(android.os.ParcelFileDescriptor, android.app.backup.BackupDataOutput, android.os.ParcelFileDescriptor) throws java.io.IOException;
    method public void onCreate();
    method public void onDestroy();
    method public void onFullBackup(android.app.backup.FullBackupDataOutput) throws java.io.IOException;
    method public void onQuotaExceeded(long, long);
    method public abstract void onRestore(android.app.backup.BackupDataInput, int, android.os.ParcelFileDescriptor) throws java.io.IOException;
    method public void onRestore(android.app.backup.BackupDataInput, long, android.os.ParcelFileDescriptor) throws java.io.IOException;
    method public void onRestoreFile(android.os.ParcelFileDescriptor, long, java.io.File, int, long, long) throws java.io.IOException;
    method public void onRestoreFinished();
    field public static final int FLAG_CLIENT_SIDE_ENCRYPTION_ENABLED = 1; // 0x1
    field public static final int FLAG_DEVICE_TO_DEVICE_TRANSFER = 2; // 0x2
    field public static final int TYPE_DIRECTORY = 2; // 0x2
    field public static final int TYPE_FILE = 1; // 0x1
  }

  public class BackupAgentHelper extends android.app.backup.BackupAgent {
    ctor public BackupAgentHelper();
    method public void addHelper(String, android.app.backup.BackupHelper);
    method public void onBackup(android.os.ParcelFileDescriptor, android.app.backup.BackupDataOutput, android.os.ParcelFileDescriptor) throws java.io.IOException;
    method public void onRestore(android.app.backup.BackupDataInput, int, android.os.ParcelFileDescriptor) throws java.io.IOException;
  }

  public class BackupDataInput {
    method public int getDataSize();
    method public String getKey();
    method public int readEntityData(byte[], int, int) throws java.io.IOException;
    method public boolean readNextHeader() throws java.io.IOException;
    method public void skipEntityData() throws java.io.IOException;
  }

  public class BackupDataInputStream extends java.io.InputStream {
    method public String getKey();
    method public int read() throws java.io.IOException;
    method public int size();
  }

  public class BackupDataOutput {
    method public long getQuota();
    method public int getTransportFlags();
    method public int writeEntityData(byte[], int) throws java.io.IOException;
    method public int writeEntityHeader(String, int) throws java.io.IOException;
  }

  public interface BackupHelper {
    method public void performBackup(android.os.ParcelFileDescriptor, android.app.backup.BackupDataOutput, android.os.ParcelFileDescriptor);
    method public void restoreEntity(android.app.backup.BackupDataInputStream);
    method public void writeNewStateDescription(android.os.ParcelFileDescriptor);
  }

  public class BackupManager {
    ctor public BackupManager(android.content.Context);
    method public void dataChanged();
    method public static void dataChanged(String);
    method @Deprecated public int requestRestore(android.app.backup.RestoreObserver);
  }

  public class FileBackupHelper implements android.app.backup.BackupHelper {
    ctor public FileBackupHelper(android.content.Context, java.lang.String...);
    method public void performBackup(android.os.ParcelFileDescriptor, android.app.backup.BackupDataOutput, android.os.ParcelFileDescriptor);
    method public void restoreEntity(android.app.backup.BackupDataInputStream);
    method public void writeNewStateDescription(android.os.ParcelFileDescriptor);
  }

  public class FullBackupDataOutput {
    method public long getQuota();
    method public int getTransportFlags();
  }

  public abstract class RestoreObserver {
    ctor public RestoreObserver();
    method public void onUpdate(int, String);
    method public void restoreFinished(int);
    method public void restoreStarting(int);
  }

  public class SharedPreferencesBackupHelper implements android.app.backup.BackupHelper {
    ctor public SharedPreferencesBackupHelper(android.content.Context, java.lang.String...);
    method public void performBackup(android.os.ParcelFileDescriptor, android.app.backup.BackupDataOutput, android.os.ParcelFileDescriptor);
    method public void restoreEntity(android.app.backup.BackupDataInputStream);
    method public void writeNewStateDescription(android.os.ParcelFileDescriptor);
  }

}

package android.app.job {

  public class JobInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getBackoffPolicy();
    method @Nullable public android.content.ClipData getClipData();
    method public int getClipGrantFlags();
    method public long getEstimatedNetworkDownloadBytes();
    method public long getEstimatedNetworkUploadBytes();
    method @NonNull public android.os.PersistableBundle getExtras();
    method public long getFlexMillis();
    method public int getId();
    method public long getInitialBackoffMillis();
    method public long getIntervalMillis();
    method public long getMaxExecutionDelayMillis();
    method public static final long getMinFlexMillis();
    method public long getMinLatencyMillis();
    method public static final long getMinPeriodMillis();
    method @Deprecated public int getNetworkType();
    method @Nullable public android.net.NetworkRequest getRequiredNetwork();
    method @NonNull public android.content.ComponentName getService();
    method @NonNull public android.os.Bundle getTransientExtras();
    method public long getTriggerContentMaxDelay();
    method public long getTriggerContentUpdateDelay();
    method @Nullable public android.app.job.JobInfo.TriggerContentUri[] getTriggerContentUris();
    method public boolean isImportantWhileForeground();
    method public boolean isPeriodic();
    method public boolean isPersisted();
    method public boolean isPrefetch();
    method public boolean isRequireBatteryNotLow();
    method public boolean isRequireCharging();
    method public boolean isRequireDeviceIdle();
    method public boolean isRequireStorageNotLow();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int BACKOFF_POLICY_EXPONENTIAL = 1; // 0x1
    field public static final int BACKOFF_POLICY_LINEAR = 0; // 0x0
    field public static final android.os.Parcelable.Creator<android.app.job.JobInfo> CREATOR;
    field public static final long DEFAULT_INITIAL_BACKOFF_MILLIS = 30000L; // 0x7530L
    field public static final long MAX_BACKOFF_DELAY_MILLIS = 18000000L; // 0x112a880L
    field public static final int NETWORK_BYTES_UNKNOWN = -1; // 0xffffffff
    field public static final int NETWORK_TYPE_ANY = 1; // 0x1
    field public static final int NETWORK_TYPE_CELLULAR = 4; // 0x4
    field @Deprecated public static final int NETWORK_TYPE_METERED = 4; // 0x4
    field public static final int NETWORK_TYPE_NONE = 0; // 0x0
    field public static final int NETWORK_TYPE_NOT_ROAMING = 3; // 0x3
    field public static final int NETWORK_TYPE_UNMETERED = 2; // 0x2
  }

  public static final class JobInfo.Builder {
    ctor public JobInfo.Builder(int, @NonNull android.content.ComponentName);
    method public android.app.job.JobInfo.Builder addTriggerContentUri(@NonNull android.app.job.JobInfo.TriggerContentUri);
    method public android.app.job.JobInfo build();
    method public android.app.job.JobInfo.Builder setBackoffCriteria(long, int);
    method public android.app.job.JobInfo.Builder setClipData(@Nullable android.content.ClipData, int);
    method public android.app.job.JobInfo.Builder setEstimatedNetworkBytes(long, long);
    method public android.app.job.JobInfo.Builder setExtras(@NonNull android.os.PersistableBundle);
    method public android.app.job.JobInfo.Builder setImportantWhileForeground(boolean);
    method public android.app.job.JobInfo.Builder setMinimumLatency(long);
    method public android.app.job.JobInfo.Builder setOverrideDeadline(long);
    method public android.app.job.JobInfo.Builder setPeriodic(long);
    method public android.app.job.JobInfo.Builder setPeriodic(long, long);
    method @RequiresPermission(android.Manifest.permission.RECEIVE_BOOT_COMPLETED) public android.app.job.JobInfo.Builder setPersisted(boolean);
    method public android.app.job.JobInfo.Builder setPrefetch(boolean);
    method public android.app.job.JobInfo.Builder setRequiredNetwork(@Nullable android.net.NetworkRequest);
    method public android.app.job.JobInfo.Builder setRequiredNetworkType(int);
    method public android.app.job.JobInfo.Builder setRequiresBatteryNotLow(boolean);
    method public android.app.job.JobInfo.Builder setRequiresCharging(boolean);
    method public android.app.job.JobInfo.Builder setRequiresDeviceIdle(boolean);
    method public android.app.job.JobInfo.Builder setRequiresStorageNotLow(boolean);
    method public android.app.job.JobInfo.Builder setTransientExtras(@NonNull android.os.Bundle);
    method public android.app.job.JobInfo.Builder setTriggerContentMaxDelay(long);
    method public android.app.job.JobInfo.Builder setTriggerContentUpdateDelay(long);
  }

  public static final class JobInfo.TriggerContentUri implements android.os.Parcelable {
    ctor public JobInfo.TriggerContentUri(@NonNull android.net.Uri, int);
    method public int describeContents();
    method public int getFlags();
    method public android.net.Uri getUri();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.job.JobInfo.TriggerContentUri> CREATOR;
    field public static final int FLAG_NOTIFY_FOR_DESCENDANTS = 1; // 0x1
  }

  public class JobParameters implements android.os.Parcelable {
    method public void completeWork(@NonNull android.app.job.JobWorkItem);
    method @Nullable public android.app.job.JobWorkItem dequeueWork();
    method public int describeContents();
    method @Nullable public android.content.ClipData getClipData();
    method public int getClipGrantFlags();
    method @NonNull public android.os.PersistableBundle getExtras();
    method public int getJobId();
    method @Nullable public android.net.Network getNetwork();
    method @NonNull public android.os.Bundle getTransientExtras();
    method @Nullable public String[] getTriggeredContentAuthorities();
    method @Nullable public android.net.Uri[] getTriggeredContentUris();
    method public boolean isOverrideDeadlineExpired();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.job.JobParameters> CREATOR;
  }

  public abstract class JobScheduler {
    ctor public JobScheduler();
    method public abstract void cancel(int);
    method public abstract void cancelAll();
    method public abstract int enqueue(@NonNull android.app.job.JobInfo, @NonNull android.app.job.JobWorkItem);
    method @NonNull public abstract java.util.List<android.app.job.JobInfo> getAllPendingJobs();
    method @Nullable public abstract android.app.job.JobInfo getPendingJob(int);
    method public abstract int schedule(@NonNull android.app.job.JobInfo);
    field public static final int RESULT_FAILURE = 0; // 0x0
    field public static final int RESULT_SUCCESS = 1; // 0x1
  }

  public abstract class JobService extends android.app.Service {
    ctor public JobService();
    method public final void jobFinished(android.app.job.JobParameters, boolean);
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract boolean onStartJob(android.app.job.JobParameters);
    method public abstract boolean onStopJob(android.app.job.JobParameters);
    field public static final String PERMISSION_BIND = "android.permission.BIND_JOB_SERVICE";
  }

  public abstract class JobServiceEngine {
    ctor public JobServiceEngine(android.app.Service);
    method public final android.os.IBinder getBinder();
    method public void jobFinished(android.app.job.JobParameters, boolean);
    method public abstract boolean onStartJob(android.app.job.JobParameters);
    method public abstract boolean onStopJob(android.app.job.JobParameters);
  }

  public final class JobWorkItem implements android.os.Parcelable {
    ctor public JobWorkItem(android.content.Intent);
    ctor public JobWorkItem(android.content.Intent, long, long);
    method public int describeContents();
    method public int getDeliveryCount();
    method public long getEstimatedNetworkDownloadBytes();
    method public long getEstimatedNetworkUploadBytes();
    method public android.content.Intent getIntent();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.job.JobWorkItem> CREATOR;
  }

}

package android.app.slice {

  public final class Slice implements android.os.Parcelable {
    ctor protected Slice(android.os.Parcel);
    method public int describeContents();
    method public java.util.List<java.lang.String> getHints();
    method public java.util.List<android.app.slice.SliceItem> getItems();
    method @Nullable public android.app.slice.SliceSpec getSpec();
    method public android.net.Uri getUri();
    method public boolean isCallerNeeded();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.slice.Slice> CREATOR;
    field public static final String EXTRA_RANGE_VALUE = "android.app.slice.extra.RANGE_VALUE";
    field public static final String EXTRA_TOGGLE_STATE = "android.app.slice.extra.TOGGLE_STATE";
    field public static final String HINT_ACTIONS = "actions";
    field public static final String HINT_ERROR = "error";
    field public static final String HINT_HORIZONTAL = "horizontal";
    field public static final String HINT_KEYWORDS = "keywords";
    field public static final String HINT_LARGE = "large";
    field public static final String HINT_LAST_UPDATED = "last_updated";
    field public static final String HINT_LIST = "list";
    field public static final String HINT_LIST_ITEM = "list_item";
    field public static final String HINT_NO_TINT = "no_tint";
    field public static final String HINT_PARTIAL = "partial";
    field public static final String HINT_PERMISSION_REQUEST = "permission_request";
    field public static final String HINT_SEE_MORE = "see_more";
    field public static final String HINT_SELECTED = "selected";
    field public static final String HINT_SHORTCUT = "shortcut";
    field public static final String HINT_SUMMARY = "summary";
    field public static final String HINT_TITLE = "title";
    field public static final String HINT_TTL = "ttl";
    field public static final String SUBTYPE_COLOR = "color";
    field public static final String SUBTYPE_CONTENT_DESCRIPTION = "content_description";
    field public static final String SUBTYPE_LAYOUT_DIRECTION = "layout_direction";
    field public static final String SUBTYPE_MAX = "max";
    field public static final String SUBTYPE_MESSAGE = "message";
    field public static final String SUBTYPE_MILLIS = "millis";
    field public static final String SUBTYPE_PRIORITY = "priority";
    field public static final String SUBTYPE_RANGE = "range";
    field public static final String SUBTYPE_SOURCE = "source";
    field public static final String SUBTYPE_TOGGLE = "toggle";
    field public static final String SUBTYPE_VALUE = "value";
  }

  public static class Slice.Builder {
    ctor public Slice.Builder(@NonNull android.net.Uri, android.app.slice.SliceSpec);
    ctor public Slice.Builder(@NonNull android.app.slice.Slice.Builder);
    method public android.app.slice.Slice.Builder addAction(@NonNull android.app.PendingIntent, @NonNull android.app.slice.Slice, @Nullable String);
    method public android.app.slice.Slice.Builder addBundle(android.os.Bundle, @Nullable String, java.util.List<java.lang.String>);
    method public android.app.slice.Slice.Builder addHints(java.util.List<java.lang.String>);
    method public android.app.slice.Slice.Builder addIcon(android.graphics.drawable.Icon, @Nullable String, java.util.List<java.lang.String>);
    method public android.app.slice.Slice.Builder addInt(int, @Nullable String, java.util.List<java.lang.String>);
    method public android.app.slice.Slice.Builder addLong(long, @Nullable String, java.util.List<java.lang.String>);
    method public android.app.slice.Slice.Builder addRemoteInput(android.app.RemoteInput, @Nullable String, java.util.List<java.lang.String>);
    method public android.app.slice.Slice.Builder addSubSlice(@NonNull android.app.slice.Slice, @Nullable String);
    method public android.app.slice.Slice.Builder addText(CharSequence, @Nullable String, java.util.List<java.lang.String>);
    method public android.app.slice.Slice build();
    method public android.app.slice.Slice.Builder setCallerNeeded(boolean);
  }

  public final class SliceItem implements android.os.Parcelable {
    method public int describeContents();
    method public android.app.PendingIntent getAction();
    method public android.os.Bundle getBundle();
    method public String getFormat();
    method @NonNull public java.util.List<java.lang.String> getHints();
    method public android.graphics.drawable.Icon getIcon();
    method public int getInt();
    method public long getLong();
    method public android.app.RemoteInput getRemoteInput();
    method public android.app.slice.Slice getSlice();
    method public String getSubType();
    method public CharSequence getText();
    method public boolean hasHint(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.slice.SliceItem> CREATOR;
    field public static final String FORMAT_ACTION = "action";
    field public static final String FORMAT_BUNDLE = "bundle";
    field public static final String FORMAT_IMAGE = "image";
    field public static final String FORMAT_INT = "int";
    field public static final String FORMAT_LONG = "long";
    field public static final String FORMAT_REMOTE_INPUT = "input";
    field public static final String FORMAT_SLICE = "slice";
    field public static final String FORMAT_TEXT = "text";
  }

  public class SliceManager {
    method @Nullable public android.app.slice.Slice bindSlice(@NonNull android.net.Uri, @NonNull java.util.Set<android.app.slice.SliceSpec>);
    method @Nullable public android.app.slice.Slice bindSlice(@NonNull android.content.Intent, @NonNull java.util.Set<android.app.slice.SliceSpec>);
    method public int checkSlicePermission(@NonNull android.net.Uri, int, int);
    method @NonNull public java.util.List<android.net.Uri> getPinnedSlices();
    method @NonNull public java.util.Set<android.app.slice.SliceSpec> getPinnedSpecs(android.net.Uri);
    method @WorkerThread @NonNull public java.util.Collection<android.net.Uri> getSliceDescendants(@NonNull android.net.Uri);
    method public void grantSlicePermission(@NonNull String, @NonNull android.net.Uri);
    method @Nullable public android.net.Uri mapIntentToUri(@NonNull android.content.Intent);
    method public void pinSlice(@NonNull android.net.Uri, @NonNull java.util.Set<android.app.slice.SliceSpec>);
    method public void revokeSlicePermission(@NonNull String, @NonNull android.net.Uri);
    method public void unpinSlice(@NonNull android.net.Uri);
    field public static final String CATEGORY_SLICE = "android.app.slice.category.SLICE";
    field public static final String SLICE_METADATA_KEY = "android.metadata.SLICE_URI";
  }

  public class SliceMetrics {
    ctor public SliceMetrics(@NonNull android.content.Context, @NonNull android.net.Uri);
    method public void logHidden();
    method public void logTouch(int, @NonNull android.net.Uri);
    method public void logVisible();
  }

  public abstract class SliceProvider extends android.content.ContentProvider {
    ctor public SliceProvider(@NonNull java.lang.String...);
    ctor public SliceProvider();
    method public final int delete(android.net.Uri, String, String[]);
    method public final String getType(android.net.Uri);
    method public final android.net.Uri insert(android.net.Uri, android.content.ContentValues);
    method public android.app.slice.Slice onBindSlice(android.net.Uri, java.util.Set<android.app.slice.SliceSpec>);
    method @NonNull public android.app.PendingIntent onCreatePermissionRequest(android.net.Uri);
    method @NonNull public java.util.Collection<android.net.Uri> onGetSliceDescendants(@NonNull android.net.Uri);
    method @NonNull public android.net.Uri onMapIntentToUri(android.content.Intent);
    method public void onSlicePinned(android.net.Uri);
    method public void onSliceUnpinned(android.net.Uri);
    method public final android.database.Cursor query(android.net.Uri, String[], String, String[], String);
    method public final android.database.Cursor query(android.net.Uri, String[], String, String[], String, android.os.CancellationSignal);
    method public final android.database.Cursor query(android.net.Uri, String[], android.os.Bundle, android.os.CancellationSignal);
    method public final int update(android.net.Uri, android.content.ContentValues, String, String[]);
    field public static final String SLICE_TYPE = "vnd.android.slice";
  }

  public final class SliceSpec implements android.os.Parcelable {
    ctor public SliceSpec(@NonNull String, int);
    method public boolean canRender(@NonNull android.app.slice.SliceSpec);
    method public int describeContents();
    method public int getRevision();
    method public String getType();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.slice.SliceSpec> CREATOR;
  }

}

package android.app.usage {

  public final class ConfigurationStats implements android.os.Parcelable {
    ctor public ConfigurationStats(android.app.usage.ConfigurationStats);
    method public int describeContents();
    method public int getActivationCount();
    method public android.content.res.Configuration getConfiguration();
    method public long getFirstTimeStamp();
    method public long getLastTimeActive();
    method public long getLastTimeStamp();
    method public long getTotalTimeActive();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.usage.ConfigurationStats> CREATOR;
  }

  public final class EventStats implements android.os.Parcelable {
    ctor public EventStats(android.app.usage.EventStats);
    method public void add(android.app.usage.EventStats);
    method public int describeContents();
    method public int getCount();
    method public int getEventType();
    method public long getFirstTimeStamp();
    method public long getLastEventTime();
    method public long getLastTimeStamp();
    method public long getTotalTime();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.usage.EventStats> CREATOR;
  }

  public final class ExternalStorageStats implements android.os.Parcelable {
    method public int describeContents();
    method public long getAppBytes();
    method public long getAudioBytes();
    method public long getImageBytes();
    method public long getTotalBytes();
    method public long getVideoBytes();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.usage.ExternalStorageStats> CREATOR;
  }

  public final class NetworkStats implements java.lang.AutoCloseable {
    method public void close();
    method public boolean getNextBucket(android.app.usage.NetworkStats.Bucket);
    method public boolean hasNextBucket();
  }

  public static class NetworkStats.Bucket {
    ctor public NetworkStats.Bucket();
    method public int getDefaultNetworkStatus();
    method public long getEndTimeStamp();
    method public int getMetered();
    method public int getRoaming();
    method public long getRxBytes();
    method public long getRxPackets();
    method public long getStartTimeStamp();
    method public int getState();
    method public int getTag();
    method public long getTxBytes();
    method public long getTxPackets();
    method public int getUid();
    field public static final int DEFAULT_NETWORK_ALL = -1; // 0xffffffff
    field public static final int DEFAULT_NETWORK_NO = 1; // 0x1
    field public static final int DEFAULT_NETWORK_YES = 2; // 0x2
    field public static final int METERED_ALL = -1; // 0xffffffff
    field public static final int METERED_NO = 1; // 0x1
    field public static final int METERED_YES = 2; // 0x2
    field public static final int ROAMING_ALL = -1; // 0xffffffff
    field public static final int ROAMING_NO = 1; // 0x1
    field public static final int ROAMING_YES = 2; // 0x2
    field public static final int STATE_ALL = -1; // 0xffffffff
    field public static final int STATE_DEFAULT = 1; // 0x1
    field public static final int STATE_FOREGROUND = 2; // 0x2
    field public static final int TAG_NONE = 0; // 0x0
    field public static final int UID_ALL = -1; // 0xffffffff
    field public static final int UID_REMOVED = -4; // 0xfffffffc
    field public static final int UID_TETHERING = -5; // 0xfffffffb
  }

  public class NetworkStatsManager {
    method public android.app.usage.NetworkStats queryDetails(int, String, long, long) throws android.os.RemoteException, java.lang.SecurityException;
    method public android.app.usage.NetworkStats queryDetailsForUid(int, String, long, long, int) throws java.lang.SecurityException;
    method public android.app.usage.NetworkStats queryDetailsForUidTag(int, String, long, long, int, int) throws java.lang.SecurityException;
    method public android.app.usage.NetworkStats queryDetailsForUidTagState(int, String, long, long, int, int, int) throws java.lang.SecurityException;
    method public android.app.usage.NetworkStats querySummary(int, String, long, long) throws android.os.RemoteException, java.lang.SecurityException;
    method public android.app.usage.NetworkStats.Bucket querySummaryForDevice(int, String, long, long) throws android.os.RemoteException, java.lang.SecurityException;
    method public android.app.usage.NetworkStats.Bucket querySummaryForUser(int, String, long, long) throws android.os.RemoteException, java.lang.SecurityException;
    method public void registerUsageCallback(int, String, long, android.app.usage.NetworkStatsManager.UsageCallback);
    method public void registerUsageCallback(int, String, long, android.app.usage.NetworkStatsManager.UsageCallback, @Nullable android.os.Handler);
    method public void unregisterUsageCallback(android.app.usage.NetworkStatsManager.UsageCallback);
  }

  public abstract static class NetworkStatsManager.UsageCallback {
    ctor public NetworkStatsManager.UsageCallback();
    method public abstract void onThresholdReached(int, String);
  }

  public final class StorageStats implements android.os.Parcelable {
    method public int describeContents();
    method public long getAppBytes();
    method public long getCacheBytes();
    method public long getDataBytes();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.usage.StorageStats> CREATOR;
  }

  public class StorageStatsManager {
    method @WorkerThread public long getFreeBytes(@NonNull java.util.UUID) throws java.io.IOException;
    method @WorkerThread public long getTotalBytes(@NonNull java.util.UUID) throws java.io.IOException;
    method @WorkerThread @NonNull public android.app.usage.ExternalStorageStats queryExternalStatsForUser(@NonNull java.util.UUID, @NonNull android.os.UserHandle) throws java.io.IOException;
    method @WorkerThread @NonNull public android.app.usage.StorageStats queryStatsForPackage(@NonNull java.util.UUID, @NonNull String, @NonNull android.os.UserHandle) throws java.io.IOException, android.content.pm.PackageManager.NameNotFoundException;
    method @WorkerThread @NonNull public android.app.usage.StorageStats queryStatsForUid(@NonNull java.util.UUID, int) throws java.io.IOException;
    method @WorkerThread @NonNull public android.app.usage.StorageStats queryStatsForUser(@NonNull java.util.UUID, @NonNull android.os.UserHandle) throws java.io.IOException;
  }

  public final class UsageEvents implements android.os.Parcelable {
    method public int describeContents();
    method public boolean getNextEvent(android.app.usage.UsageEvents.Event);
    method public boolean hasNextEvent();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.usage.UsageEvents> CREATOR;
  }

  public static final class UsageEvents.Event {
    ctor public UsageEvents.Event();
    method public int getAppStandbyBucket();
    method public String getClassName();
    method public android.content.res.Configuration getConfiguration();
    method public int getEventType();
    method public String getPackageName();
    method public String getShortcutId();
    method public long getTimeStamp();
    field public static final int CONFIGURATION_CHANGE = 5; // 0x5
    field public static final int KEYGUARD_HIDDEN = 18; // 0x12
    field public static final int KEYGUARD_SHOWN = 17; // 0x11
    field public static final int MOVE_TO_BACKGROUND = 2; // 0x2
    field public static final int MOVE_TO_FOREGROUND = 1; // 0x1
    field public static final int NONE = 0; // 0x0
    field public static final int SCREEN_INTERACTIVE = 15; // 0xf
    field public static final int SCREEN_NON_INTERACTIVE = 16; // 0x10
    field public static final int SHORTCUT_INVOCATION = 8; // 0x8
    field public static final int STANDBY_BUCKET_CHANGED = 11; // 0xb
    field public static final int USER_INTERACTION = 7; // 0x7
  }

  public final class UsageStats implements android.os.Parcelable {
    ctor public UsageStats(android.app.usage.UsageStats);
    method public void add(android.app.usage.UsageStats);
    method public int describeContents();
    method public long getFirstTimeStamp();
    method public long getLastTimeStamp();
    method public long getLastTimeUsed();
    method public String getPackageName();
    method public long getTotalTimeInForeground();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.usage.UsageStats> CREATOR;
  }

  public final class UsageStatsManager {
    method public int getAppStandbyBucket();
    method public boolean isAppInactive(String);
    method public java.util.Map<java.lang.String,android.app.usage.UsageStats> queryAndAggregateUsageStats(long, long);
    method public java.util.List<android.app.usage.ConfigurationStats> queryConfigurations(int, long, long);
    method public java.util.List<android.app.usage.EventStats> queryEventStats(int, long, long);
    method public android.app.usage.UsageEvents queryEvents(long, long);
    method public android.app.usage.UsageEvents queryEventsForSelf(long, long);
    method public java.util.List<android.app.usage.UsageStats> queryUsageStats(int, long, long);
    field public static final int INTERVAL_BEST = 4; // 0x4
    field public static final int INTERVAL_DAILY = 0; // 0x0
    field public static final int INTERVAL_MONTHLY = 2; // 0x2
    field public static final int INTERVAL_WEEKLY = 1; // 0x1
    field public static final int INTERVAL_YEARLY = 3; // 0x3
    field public static final int STANDBY_BUCKET_ACTIVE = 10; // 0xa
    field public static final int STANDBY_BUCKET_FREQUENT = 30; // 0x1e
    field public static final int STANDBY_BUCKET_RARE = 40; // 0x28
    field public static final int STANDBY_BUCKET_WORKING_SET = 20; // 0x14
  }

}

package android.appwidget {

  public class AppWidgetHost {
    ctor public AppWidgetHost(android.content.Context, int);
    method public int allocateAppWidgetId();
    method protected void clearViews();
    method public final android.appwidget.AppWidgetHostView createView(android.content.Context, int, android.appwidget.AppWidgetProviderInfo);
    method public static void deleteAllHosts();
    method public void deleteAppWidgetId(int);
    method public void deleteHost();
    method public int[] getAppWidgetIds();
    method protected android.appwidget.AppWidgetHostView onCreateView(android.content.Context, int, android.appwidget.AppWidgetProviderInfo);
    method protected void onProviderChanged(int, android.appwidget.AppWidgetProviderInfo);
    method protected void onProvidersChanged();
    method public final void startAppWidgetConfigureActivityForResult(@NonNull android.app.Activity, int, int, int, @Nullable android.os.Bundle);
    method public void startListening();
    method public void stopListening();
  }

  public class AppWidgetHostView extends android.widget.FrameLayout {
    ctor public AppWidgetHostView(android.content.Context);
    ctor public AppWidgetHostView(android.content.Context, int, int);
    method public int getAppWidgetId();
    method public android.appwidget.AppWidgetProviderInfo getAppWidgetInfo();
    method public static android.graphics.Rect getDefaultPaddingForWidget(android.content.Context, android.content.ComponentName, android.graphics.Rect);
    method protected android.view.View getDefaultView();
    method protected android.view.View getErrorView();
    method protected void prepareView(android.view.View);
    method public void setAppWidget(int, android.appwidget.AppWidgetProviderInfo);
    method public void setExecutor(java.util.concurrent.Executor);
    method public void updateAppWidget(android.widget.RemoteViews);
    method public void updateAppWidgetOptions(android.os.Bundle);
    method public void updateAppWidgetSize(android.os.Bundle, int, int, int, int);
  }

  public class AppWidgetManager {
    method public boolean bindAppWidgetIdIfAllowed(int, android.content.ComponentName);
    method public boolean bindAppWidgetIdIfAllowed(int, android.content.ComponentName, android.os.Bundle);
    method public boolean bindAppWidgetIdIfAllowed(int, android.os.UserHandle, android.content.ComponentName, android.os.Bundle);
    method public int[] getAppWidgetIds(android.content.ComponentName);
    method public android.appwidget.AppWidgetProviderInfo getAppWidgetInfo(int);
    method public android.os.Bundle getAppWidgetOptions(int);
    method public java.util.List<android.appwidget.AppWidgetProviderInfo> getInstalledProviders();
    method @NonNull public java.util.List<android.appwidget.AppWidgetProviderInfo> getInstalledProvidersForPackage(@NonNull String, @Nullable android.os.UserHandle);
    method @NonNull public java.util.List<android.appwidget.AppWidgetProviderInfo> getInstalledProvidersForProfile(@Nullable android.os.UserHandle);
    method public static android.appwidget.AppWidgetManager getInstance(android.content.Context);
    method public boolean isRequestPinAppWidgetSupported();
    method public void notifyAppWidgetViewDataChanged(int[], int);
    method public void notifyAppWidgetViewDataChanged(int, int);
    method public void partiallyUpdateAppWidget(int[], android.widget.RemoteViews);
    method public void partiallyUpdateAppWidget(int, android.widget.RemoteViews);
    method public boolean requestPinAppWidget(@NonNull android.content.ComponentName, @Nullable android.os.Bundle, @Nullable android.app.PendingIntent);
    method public void updateAppWidget(int[], android.widget.RemoteViews);
    method public void updateAppWidget(int, android.widget.RemoteViews);
    method public void updateAppWidget(android.content.ComponentName, android.widget.RemoteViews);
    method public void updateAppWidgetOptions(int, android.os.Bundle);
    method public void updateAppWidgetProviderInfo(android.content.ComponentName, @Nullable String);
    field public static final String ACTION_APPWIDGET_BIND = "android.appwidget.action.APPWIDGET_BIND";
    field public static final String ACTION_APPWIDGET_CONFIGURE = "android.appwidget.action.APPWIDGET_CONFIGURE";
    field public static final String ACTION_APPWIDGET_DELETED = "android.appwidget.action.APPWIDGET_DELETED";
    field public static final String ACTION_APPWIDGET_DISABLED = "android.appwidget.action.APPWIDGET_DISABLED";
    field public static final String ACTION_APPWIDGET_ENABLED = "android.appwidget.action.APPWIDGET_ENABLED";
    field public static final String ACTION_APPWIDGET_HOST_RESTORED = "android.appwidget.action.APPWIDGET_HOST_RESTORED";
    field public static final String ACTION_APPWIDGET_OPTIONS_CHANGED = "android.appwidget.action.APPWIDGET_UPDATE_OPTIONS";
    field public static final String ACTION_APPWIDGET_PICK = "android.appwidget.action.APPWIDGET_PICK";
    field public static final String ACTION_APPWIDGET_RESTORED = "android.appwidget.action.APPWIDGET_RESTORED";
    field public static final String ACTION_APPWIDGET_UPDATE = "android.appwidget.action.APPWIDGET_UPDATE";
    field public static final String EXTRA_APPWIDGET_ID = "appWidgetId";
    field public static final String EXTRA_APPWIDGET_IDS = "appWidgetIds";
    field public static final String EXTRA_APPWIDGET_OLD_IDS = "appWidgetOldIds";
    field public static final String EXTRA_APPWIDGET_OPTIONS = "appWidgetOptions";
    field public static final String EXTRA_APPWIDGET_PREVIEW = "appWidgetPreview";
    field public static final String EXTRA_APPWIDGET_PROVIDER = "appWidgetProvider";
    field public static final String EXTRA_APPWIDGET_PROVIDER_PROFILE = "appWidgetProviderProfile";
    field public static final String EXTRA_CUSTOM_EXTRAS = "customExtras";
    field public static final String EXTRA_CUSTOM_INFO = "customInfo";
    field public static final String EXTRA_HOST_ID = "hostId";
    field public static final int INVALID_APPWIDGET_ID = 0; // 0x0
    field public static final String META_DATA_APPWIDGET_PROVIDER = "android.appwidget.provider";
    field public static final String OPTION_APPWIDGET_HOST_CATEGORY = "appWidgetCategory";
    field public static final String OPTION_APPWIDGET_MAX_HEIGHT = "appWidgetMaxHeight";
    field public static final String OPTION_APPWIDGET_MAX_WIDTH = "appWidgetMaxWidth";
    field public static final String OPTION_APPWIDGET_MIN_HEIGHT = "appWidgetMinHeight";
    field public static final String OPTION_APPWIDGET_MIN_WIDTH = "appWidgetMinWidth";
  }

  public class AppWidgetProvider extends android.content.BroadcastReceiver {
    ctor public AppWidgetProvider();
    method public void onAppWidgetOptionsChanged(android.content.Context, android.appwidget.AppWidgetManager, int, android.os.Bundle);
    method public void onDeleted(android.content.Context, int[]);
    method public void onDisabled(android.content.Context);
    method public void onEnabled(android.content.Context);
    method public void onReceive(android.content.Context, android.content.Intent);
    method public void onRestored(android.content.Context, int[], int[]);
    method public void onUpdate(android.content.Context, android.appwidget.AppWidgetManager, int[]);
  }

  public class AppWidgetProviderInfo implements android.os.Parcelable {
    ctor public AppWidgetProviderInfo();
    ctor public AppWidgetProviderInfo(android.os.Parcel);
    method public android.appwidget.AppWidgetProviderInfo clone();
    method public int describeContents();
    method public final android.os.UserHandle getProfile();
    method public final android.graphics.drawable.Drawable loadIcon(@NonNull android.content.Context, int);
    method public final String loadLabel(android.content.pm.PackageManager);
    method public final android.graphics.drawable.Drawable loadPreviewImage(@NonNull android.content.Context, int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.appwidget.AppWidgetProviderInfo> CREATOR;
    field public static final int RESIZE_BOTH = 3; // 0x3
    field public static final int RESIZE_HORIZONTAL = 1; // 0x1
    field public static final int RESIZE_NONE = 0; // 0x0
    field public static final int RESIZE_VERTICAL = 2; // 0x2
    field public static final int WIDGET_CATEGORY_HOME_SCREEN = 1; // 0x1
    field public static final int WIDGET_CATEGORY_KEYGUARD = 2; // 0x2
    field public static final int WIDGET_CATEGORY_SEARCHBOX = 4; // 0x4
    field public static final int WIDGET_FEATURE_HIDE_FROM_PICKER = 2; // 0x2
    field public static final int WIDGET_FEATURE_RECONFIGURABLE = 1; // 0x1
    field public int autoAdvanceViewId;
    field public android.content.ComponentName configure;
    field public int icon;
    field public int initialKeyguardLayout;
    field public int initialLayout;
    field @Deprecated public String label;
    field public int minHeight;
    field public int minResizeHeight;
    field public int minResizeWidth;
    field public int minWidth;
    field public int previewImage;
    field public android.content.ComponentName provider;
    field public int resizeMode;
    field public int updatePeriodMillis;
    field public int widgetCategory;
    field public int widgetFeatures;
  }

}

package android.bluetooth {

  public final class BluetoothA2dp implements android.bluetooth.BluetoothProfile {
    method public void finalize();
    method public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method public int getConnectionState(android.bluetooth.BluetoothDevice);
    method public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    method public boolean isA2dpPlaying(android.bluetooth.BluetoothDevice);
    field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.a2dp.profile.action.CONNECTION_STATE_CHANGED";
    field public static final String ACTION_PLAYING_STATE_CHANGED = "android.bluetooth.a2dp.profile.action.PLAYING_STATE_CHANGED";
    field public static final int STATE_NOT_PLAYING = 11; // 0xb
    field public static final int STATE_PLAYING = 10; // 0xa
  }

  public final class BluetoothAdapter {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean cancelDiscovery();
    method public static boolean checkBluetoothAddress(String);
    method public void closeProfileProxy(int, android.bluetooth.BluetoothProfile);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean disable();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean enable();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public String getAddress();
    method public android.bluetooth.le.BluetoothLeAdvertiser getBluetoothLeAdvertiser();
    method public android.bluetooth.le.BluetoothLeScanner getBluetoothLeScanner();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public java.util.Set<android.bluetooth.BluetoothDevice> getBondedDevices();
    method public static android.bluetooth.BluetoothAdapter getDefaultAdapter();
    method public int getLeMaximumAdvertisingDataLength();
    method public String getName();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getProfileConnectionState(int);
    method public boolean getProfileProxy(android.content.Context, android.bluetooth.BluetoothProfile.ServiceListener, int);
    method public android.bluetooth.BluetoothDevice getRemoteDevice(String);
    method public android.bluetooth.BluetoothDevice getRemoteDevice(byte[]);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getScanMode();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getState();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean isDiscovering();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean isEnabled();
    method public boolean isLe2MPhySupported();
    method public boolean isLeCodedPhySupported();
    method public boolean isLeExtendedAdvertisingSupported();
    method public boolean isLePeriodicAdvertisingSupported();
    method public boolean isMultipleAdvertisementSupported();
    method public boolean isOffloadedFilteringSupported();
    method public boolean isOffloadedScanBatchingSupported();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.bluetooth.BluetoothServerSocket listenUsingInsecureL2capChannel() throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.bluetooth.BluetoothServerSocket listenUsingInsecureRfcommWithServiceRecord(String, java.util.UUID) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.bluetooth.BluetoothServerSocket listenUsingL2capChannel() throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.bluetooth.BluetoothServerSocket listenUsingRfcommWithServiceRecord(String, java.util.UUID) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setName(String);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean startDiscovery();
    method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean startLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback);
    method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean startLeScan(java.util.UUID[], android.bluetooth.BluetoothAdapter.LeScanCallback);
    method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public void stopLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback);
    field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.adapter.action.CONNECTION_STATE_CHANGED";
    field public static final String ACTION_DISCOVERY_FINISHED = "android.bluetooth.adapter.action.DISCOVERY_FINISHED";
    field public static final String ACTION_DISCOVERY_STARTED = "android.bluetooth.adapter.action.DISCOVERY_STARTED";
    field public static final String ACTION_LOCAL_NAME_CHANGED = "android.bluetooth.adapter.action.LOCAL_NAME_CHANGED";
    field public static final String ACTION_REQUEST_DISCOVERABLE = "android.bluetooth.adapter.action.REQUEST_DISCOVERABLE";
    field public static final String ACTION_REQUEST_ENABLE = "android.bluetooth.adapter.action.REQUEST_ENABLE";
    field public static final String ACTION_SCAN_MODE_CHANGED = "android.bluetooth.adapter.action.SCAN_MODE_CHANGED";
    field public static final String ACTION_STATE_CHANGED = "android.bluetooth.adapter.action.STATE_CHANGED";
    field public static final int ERROR = -2147483648; // 0x80000000
    field public static final String EXTRA_CONNECTION_STATE = "android.bluetooth.adapter.extra.CONNECTION_STATE";
    field public static final String EXTRA_DISCOVERABLE_DURATION = "android.bluetooth.adapter.extra.DISCOVERABLE_DURATION";
    field public static final String EXTRA_LOCAL_NAME = "android.bluetooth.adapter.extra.LOCAL_NAME";
    field public static final String EXTRA_PREVIOUS_CONNECTION_STATE = "android.bluetooth.adapter.extra.PREVIOUS_CONNECTION_STATE";
    field public static final String EXTRA_PREVIOUS_SCAN_MODE = "android.bluetooth.adapter.extra.PREVIOUS_SCAN_MODE";
    field public static final String EXTRA_PREVIOUS_STATE = "android.bluetooth.adapter.extra.PREVIOUS_STATE";
    field public static final String EXTRA_SCAN_MODE = "android.bluetooth.adapter.extra.SCAN_MODE";
    field public static final String EXTRA_STATE = "android.bluetooth.adapter.extra.STATE";
    field public static final int SCAN_MODE_CONNECTABLE = 21; // 0x15
    field public static final int SCAN_MODE_CONNECTABLE_DISCOVERABLE = 23; // 0x17
    field public static final int SCAN_MODE_NONE = 20; // 0x14
    field public static final int STATE_CONNECTED = 2; // 0x2
    field public static final int STATE_CONNECTING = 1; // 0x1
    field public static final int STATE_DISCONNECTED = 0; // 0x0
    field public static final int STATE_DISCONNECTING = 3; // 0x3
    field public static final int STATE_OFF = 10; // 0xa
    field public static final int STATE_ON = 12; // 0xc
    field public static final int STATE_TURNING_OFF = 13; // 0xd
    field public static final int STATE_TURNING_ON = 11; // 0xb
  }

  public static interface BluetoothAdapter.LeScanCallback {
    method public void onLeScan(android.bluetooth.BluetoothDevice, int, byte[]);
  }

  public class BluetoothAssignedNumbers {
    field public static final int AAMP_OF_AMERICA = 190; // 0xbe
    field public static final int ACCEL_SEMICONDUCTOR = 74; // 0x4a
    field public static final int ACE_SENSOR = 188; // 0xbc
    field public static final int ADIDAS = 195; // 0xc3
    field public static final int ADVANCED_PANMOBIL_SYSTEMS = 145; // 0x91
    field public static final int AIROHA_TECHNOLOGY = 148; // 0x94
    field public static final int ALCATEL = 36; // 0x24
    field public static final int ALPWISE = 154; // 0x9a
    field public static final int AMICCOM_ELECTRONICS = 192; // 0xc0
    field public static final int APLIX = 189; // 0xbd
    field public static final int APPLE = 76; // 0x4c
    field public static final int APT_LICENSING = 79; // 0x4f
    field public static final int ARCHOS = 207; // 0xcf
    field public static final int ARP_DEVICES = 168; // 0xa8
    field public static final int ATHEROS_COMMUNICATIONS = 69; // 0x45
    field public static final int ATMEL = 19; // 0x13
    field public static final int AUSTCO_COMMUNICATION_SYSTEMS = 213; // 0xd5
    field public static final int AUTONET_MOBILE = 127; // 0x7f
    field public static final int AVAGO = 78; // 0x4e
    field public static final int AVM_BERLIN = 31; // 0x1f
    field public static final int A_AND_D_ENGINEERING = 105; // 0x69
    field public static final int A_AND_R_CAMBRIDGE = 124; // 0x7c
    field public static final int BANDSPEED = 32; // 0x20
    field public static final int BAND_XI_INTERNATIONAL = 100; // 0x64
    field public static final int BDE_TECHNOLOGY = 180; // 0xb4
    field public static final int BEATS_ELECTRONICS = 204; // 0xcc
    field public static final int BEAUTIFUL_ENTERPRISE = 108; // 0x6c
    field public static final int BEKEY = 178; // 0xb2
    field public static final int BELKIN_INTERNATIONAL = 92; // 0x5c
    field public static final int BINAURIC = 203; // 0xcb
    field public static final int BIOSENTRONICS = 219; // 0xdb
    field public static final int BLUEGIGA = 71; // 0x47
    field public static final int BLUERADIOS = 133; // 0x85
    field public static final int BLUETOOTH_SIG = 63; // 0x3f
    field public static final int BLUETREK_TECHNOLOGIES = 151; // 0x97
    field public static final int BOSE = 158; // 0x9e
    field public static final int BRIARTEK = 109; // 0x6d
    field public static final int BROADCOM = 15; // 0xf
    field public static final int CAEN_RFID = 170; // 0xaa
    field public static final int CAMBRIDGE_SILICON_RADIO = 10; // 0xa
    field public static final int CATC = 52; // 0x34
    field public static final int CINETIX = 175; // 0xaf
    field public static final int CLARINOX_TECHNOLOGIES = 179; // 0xb3
    field public static final int COLORFY = 156; // 0x9c
    field public static final int COMMIL = 51; // 0x33
    field public static final int CONEXANT_SYSTEMS = 28; // 0x1c
    field public static final int CONNECTBLUE = 113; // 0x71
    field public static final int CONTINENTAL_AUTOMOTIVE = 75; // 0x4b
    field public static final int CONWISE_TECHNOLOGY = 66; // 0x42
    field public static final int CREATIVE_TECHNOLOGY = 118; // 0x76
    field public static final int C_TECHNOLOGIES = 38; // 0x26
    field public static final int DANLERS = 225; // 0xe1
    field public static final int DELORME_PUBLISHING_COMPANY = 128; // 0x80
    field public static final int DEXCOM = 208; // 0xd0
    field public static final int DIALOG_SEMICONDUCTOR = 210; // 0xd2
    field public static final int DIGIANSWER = 12; // 0xc
    field public static final int ECLIPSE = 53; // 0x35
    field public static final int ECOTEST = 136; // 0x88
    field public static final int ELGATO_SYSTEMS = 206; // 0xce
    field public static final int EM_MICROELECTRONIC_MARIN = 90; // 0x5a
    field public static final int EQUINOX_AG = 134; // 0x86
    field public static final int ERICSSON_TECHNOLOGY = 0; // 0x0
    field public static final int EVLUMA = 201; // 0xc9
    field public static final int FREE2MOVE = 83; // 0x53
    field public static final int FUNAI_ELECTRIC = 144; // 0x90
    field public static final int GARMIN_INTERNATIONAL = 135; // 0x87
    field public static final int GCT_SEMICONDUCTOR = 45; // 0x2d
    field public static final int GELO = 200; // 0xc8
    field public static final int GENEQ = 194; // 0xc2
    field public static final int GENERAL_MOTORS = 104; // 0x68
    field public static final int GENNUM = 59; // 0x3b
    field public static final int GEOFORCE = 157; // 0x9d
    field public static final int GIBSON_GUITARS = 98; // 0x62
    field public static final int GN_NETCOM = 103; // 0x67
    field public static final int GN_RESOUND = 137; // 0x89
    field public static final int GOOGLE = 224; // 0xe0
    field public static final int GREEN_THROTTLE_GAMES = 172; // 0xac
    field public static final int GROUP_SENSE = 115; // 0x73
    field public static final int HANLYNN_TECHNOLOGIES = 123; // 0x7b
    field public static final int HARMAN_INTERNATIONAL = 87; // 0x57
    field public static final int HEWLETT_PACKARD = 101; // 0x65
    field public static final int HITACHI = 41; // 0x29
    field public static final int HOSIDEN = 221; // 0xdd
    field public static final int IBM = 3; // 0x3
    field public static final int INFINEON_TECHNOLOGIES = 9; // 0x9
    field public static final int INGENIEUR_SYSTEMGRUPPE_ZAHN = 171; // 0xab
    field public static final int INTEGRATED_SILICON_SOLUTION = 65; // 0x41
    field public static final int INTEGRATED_SYSTEM_SOLUTION = 57; // 0x39
    field public static final int INTEL = 2; // 0x2
    field public static final int INVENTEL = 30; // 0x1e
    field public static final int IPEXTREME = 61; // 0x3d
    field public static final int I_TECH_DYNAMIC_GLOBAL_DISTRIBUTION = 153; // 0x99
    field public static final int JAWBONE = 138; // 0x8a
    field public static final int JIANGSU_TOPPOWER_AUTOMOTIVE_ELECTRONICS = 155; // 0x9b
    field public static final int JOHNSON_CONTROLS = 185; // 0xb9
    field public static final int J_AND_M = 82; // 0x52
    field public static final int KAWANTECH = 212; // 0xd4
    field public static final int KC_TECHNOLOGY = 22; // 0x16
    field public static final int KENSINGTON_COMPUTER_PRODUCTS_GROUP = 160; // 0xa0
    field public static final int LAIRD_TECHNOLOGIES = 119; // 0x77
    field public static final int LESSWIRE = 121; // 0x79
    field public static final int LG_ELECTRONICS = 196; // 0xc4
    field public static final int LINAK = 164; // 0xa4
    field public static final int LUCENT = 7; // 0x7
    field public static final int LUDUS_HELSINKI = 132; // 0x84
    field public static final int MACRONIX = 44; // 0x2c
    field public static final int MAGNETI_MARELLI = 169; // 0xa9
    field public static final int MANSELLA = 33; // 0x21
    field public static final int MARVELL = 72; // 0x48
    field public static final int MATSUSHITA_ELECTRIC = 58; // 0x3a
    field public static final int MC10 = 202; // 0xca
    field public static final int MEDIATEK = 70; // 0x46
    field public static final int MESO_INTERNATIONAL = 182; // 0xb6
    field public static final int META_WATCH = 163; // 0xa3
    field public static final int MEWTEL_TECHNOLOGY = 47; // 0x2f
    field public static final int MICOMMAND = 99; // 0x63
    field public static final int MICROCHIP_TECHNOLOGY = 205; // 0xcd
    field public static final int MICROSOFT = 6; // 0x6
    field public static final int MINDTREE = 106; // 0x6a
    field public static final int MISFIT_WEARABLES = 223; // 0xdf
    field public static final int MITEL_SEMICONDUCTOR = 16; // 0x10
    field public static final int MITSUBISHI_ELECTRIC = 20; // 0x14
    field public static final int MOBILIAN_CORPORATION = 55; // 0x37
    field public static final int MONSTER = 112; // 0x70
    field public static final int MOTOROLA = 8; // 0x8
    field public static final int MSTAR_SEMICONDUCTOR = 122; // 0x7a
    field public static final int MUZIK = 222; // 0xde
    field public static final int NEC = 34; // 0x22
    field public static final int NEC_LIGHTING = 149; // 0x95
    field public static final int NEWLOGIC = 23; // 0x17
    field public static final int NIKE = 120; // 0x78
    field public static final int NINE_SOLUTIONS = 102; // 0x66
    field public static final int NOKIA_MOBILE_PHONES = 1; // 0x1
    field public static final int NORDIC_SEMICONDUCTOR = 89; // 0x59
    field public static final int NORWOOD_SYSTEMS = 46; // 0x2e
    field public static final int ODM_TECHNOLOGY = 150; // 0x96
    field public static final int OMEGAWAVE = 174; // 0xae
    field public static final int ONSET_COMPUTER = 197; // 0xc5
    field public static final int OPEN_INTERFACE = 39; // 0x27
    field public static final int OTL_DYNAMICS = 165; // 0xa5
    field public static final int PANDA_OCEAN = 166; // 0xa6
    field public static final int PARROT = 67; // 0x43
    field public static final int PARTHUS_TECHNOLOGIES = 14; // 0xe
    field public static final int PASSIF_SEMICONDUCTOR = 176; // 0xb0
    field public static final int PETER_SYSTEMTECHNIK = 173; // 0xad
    field public static final int PHILIPS_SEMICONDUCTORS = 37; // 0x25
    field public static final int PLANTRONICS = 85; // 0x55
    field public static final int POLAR_ELECTRO = 107; // 0x6b
    field public static final int POLAR_ELECTRO_EUROPE = 209; // 0xd1
    field public static final int PROCTER_AND_GAMBLE = 220; // 0xdc
    field public static final int QUALCOMM = 29; // 0x1d
    field public static final int QUALCOMM_CONNECTED_EXPERIENCES = 216; // 0xd8
    field public static final int QUALCOMM_INNOVATION_CENTER = 184; // 0xb8
    field public static final int QUALCOMM_LABS = 140; // 0x8c
    field public static final int QUALCOMM_TECHNOLOGIES = 215; // 0xd7
    field public static final int QUINTIC = 142; // 0x8e
    field public static final int QUUPPA = 199; // 0xc7
    field public static final int RALINK_TECHNOLOGY = 91; // 0x5b
    field public static final int RDA_MICROELECTRONICS = 97; // 0x61
    field public static final int REALTEK_SEMICONDUCTOR = 93; // 0x5d
    field public static final int RED_M = 50; // 0x32
    field public static final int RENESAS_TECHNOLOGY = 54; // 0x36
    field public static final int RESEARCH_IN_MOTION = 60; // 0x3c
    field public static final int RF_MICRO_DEVICES = 40; // 0x28
    field public static final int RIVIERAWAVES = 96; // 0x60
    field public static final int ROHDE_AND_SCHWARZ = 25; // 0x19
    field public static final int RTX_TELECOM = 21; // 0x15
    field public static final int SAMSUNG_ELECTRONICS = 117; // 0x75
    field public static final int SARIS_CYCLING_GROUP = 177; // 0xb1
    field public static final int SEERS_TECHNOLOGY = 125; // 0x7d
    field public static final int SEIKO_EPSON = 64; // 0x40
    field public static final int SELFLY = 198; // 0xc6
    field public static final int SEMILINK = 226; // 0xe2
    field public static final int SENNHEISER_COMMUNICATIONS = 130; // 0x82
    field public static final int SHANGHAI_SUPER_SMART_ELECTRONICS = 114; // 0x72
    field public static final int SHENZHEN_EXCELSECU_DATA_TECHNOLOGY = 193; // 0xc1
    field public static final int SIGNIA_TECHNOLOGIES = 27; // 0x1b
    field public static final int SILICON_WAVE = 11; // 0xb
    field public static final int SIRF_TECHNOLOGY = 80; // 0x50
    field public static final int SOCKET_MOBILE = 68; // 0x44
    field public static final int SONY_ERICSSON = 86; // 0x56
    field public static final int SOUND_ID = 111; // 0x6f
    field public static final int SPORTS_TRACKING_TECHNOLOGIES = 126; // 0x7e
    field public static final int SR_MEDIZINELEKTRONIK = 161; // 0xa1
    field public static final int STACCATO_COMMUNICATIONS = 77; // 0x4d
    field public static final int STALMART_TECHNOLOGY = 191; // 0xbf
    field public static final int STARKEY_LABORATORIES = 186; // 0xba
    field public static final int STOLLMAN_E_PLUS_V = 143; // 0x8f
    field public static final int STONESTREET_ONE = 94; // 0x5e
    field public static final int ST_MICROELECTRONICS = 48; // 0x30
    field public static final int SUMMIT_DATA_COMMUNICATIONS = 110; // 0x6e
    field public static final int SUUNTO = 159; // 0x9f
    field public static final int SWIRL_NETWORKS = 181; // 0xb5
    field public static final int SYMBOL_TECHNOLOGIES = 42; // 0x2a
    field public static final int SYNOPSYS = 49; // 0x31
    field public static final int SYSTEMS_AND_CHIPS = 62; // 0x3e
    field public static final int S_POWER_ELECTRONICS = 187; // 0xbb
    field public static final int TAIXINGBANG_TECHNOLOGY = 211; // 0xd3
    field public static final int TENOVIS = 43; // 0x2b
    field public static final int TERAX = 56; // 0x38
    field public static final int TEXAS_INSTRUMENTS = 13; // 0xd
    field public static final int THINKOPTICS = 146; // 0x92
    field public static final int THREECOM = 5; // 0x5
    field public static final int THREE_DIJOY = 84; // 0x54
    field public static final int THREE_DSP = 73; // 0x49
    field public static final int TIMEKEEPING_SYSTEMS = 131; // 0x83
    field public static final int TIMEX_GROUP_USA = 214; // 0xd6
    field public static final int TOPCORN_POSITIONING_SYSTEMS = 139; // 0x8b
    field public static final int TOSHIBA = 4; // 0x4
    field public static final int TRANSILICA = 24; // 0x18
    field public static final int TRELAB = 183; // 0xb7
    field public static final int TTPCOM = 26; // 0x1a
    field public static final int TXTR = 218; // 0xda
    field public static final int TZERO_TECHNOLOGIES = 81; // 0x51
    field public static final int UNIVERSAL_ELECTRONICS = 147; // 0x93
    field public static final int VERTU = 162; // 0xa2
    field public static final int VISTEON = 167; // 0xa7
    field public static final int VIZIO = 88; // 0x58
    field public static final int VOYETRA_TURTLE_BEACH = 217; // 0xd9
    field public static final int WAVEPLUS_TECHNOLOGY = 35; // 0x23
    field public static final int WICENTRIC = 95; // 0x5f
    field public static final int WIDCOMM = 17; // 0x11
    field public static final int WUXI_VIMICRO = 129; // 0x81
    field public static final int ZEEVO = 18; // 0x12
    field public static final int ZER01_TV = 152; // 0x98
    field public static final int ZOMM = 116; // 0x74
    field public static final int ZSCAN_SOFTWARE = 141; // 0x8d
  }

  public final class BluetoothClass implements android.os.Parcelable {
    method public int describeContents();
    method public int getDeviceClass();
    method public int getMajorDeviceClass();
    method public boolean hasService(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothClass> CREATOR;
  }

  public static class BluetoothClass.Device {
    ctor public BluetoothClass.Device();
    field public static final int AUDIO_VIDEO_CAMCORDER = 1076; // 0x434
    field public static final int AUDIO_VIDEO_CAR_AUDIO = 1056; // 0x420
    field public static final int AUDIO_VIDEO_HANDSFREE = 1032; // 0x408
    field public static final int AUDIO_VIDEO_HEADPHONES = 1048; // 0x418
    field public static final int AUDIO_VIDEO_HIFI_AUDIO = 1064; // 0x428
    field public static final int AUDIO_VIDEO_LOUDSPEAKER = 1044; // 0x414
    field public static final int AUDIO_VIDEO_MICROPHONE = 1040; // 0x410
    field public static final int AUDIO_VIDEO_PORTABLE_AUDIO = 1052; // 0x41c
    field public static final int AUDIO_VIDEO_SET_TOP_BOX = 1060; // 0x424
    field public static final int AUDIO_VIDEO_UNCATEGORIZED = 1024; // 0x400
    field public static final int AUDIO_VIDEO_VCR = 1068; // 0x42c
    field public static final int AUDIO_VIDEO_VIDEO_CAMERA = 1072; // 0x430
    field public static final int AUDIO_VIDEO_VIDEO_CONFERENCING = 1088; // 0x440
    field public static final int AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER = 1084; // 0x43c
    field public static final int AUDIO_VIDEO_VIDEO_GAMING_TOY = 1096; // 0x448
    field public static final int AUDIO_VIDEO_VIDEO_MONITOR = 1080; // 0x438
    field public static final int AUDIO_VIDEO_WEARABLE_HEADSET = 1028; // 0x404
    field public static final int COMPUTER_DESKTOP = 260; // 0x104
    field public static final int COMPUTER_HANDHELD_PC_PDA = 272; // 0x110
    field public static final int COMPUTER_LAPTOP = 268; // 0x10c
    field public static final int COMPUTER_PALM_SIZE_PC_PDA = 276; // 0x114
    field public static final int COMPUTER_SERVER = 264; // 0x108
    field public static final int COMPUTER_UNCATEGORIZED = 256; // 0x100
    field public static final int COMPUTER_WEARABLE = 280; // 0x118
    field public static final int HEALTH_BLOOD_PRESSURE = 2308; // 0x904
    field public static final int HEALTH_DATA_DISPLAY = 2332; // 0x91c
    field public static final int HEALTH_GLUCOSE = 2320; // 0x910
    field public static final int HEALTH_PULSE_OXIMETER = 2324; // 0x914
    field public static final int HEALTH_PULSE_RATE = 2328; // 0x918
    field public static final int HEALTH_THERMOMETER = 2312; // 0x908
    field public static final int HEALTH_UNCATEGORIZED = 2304; // 0x900
    field public static final int HEALTH_WEIGHING = 2316; // 0x90c
    field public static final int PHONE_CELLULAR = 516; // 0x204
    field public static final int PHONE_CORDLESS = 520; // 0x208
    field public static final int PHONE_ISDN = 532; // 0x214
    field public static final int PHONE_MODEM_OR_GATEWAY = 528; // 0x210
    field public static final int PHONE_SMART = 524; // 0x20c
    field public static final int PHONE_UNCATEGORIZED = 512; // 0x200
    field public static final int TOY_CONTROLLER = 2064; // 0x810
    field public static final int TOY_DOLL_ACTION_FIGURE = 2060; // 0x80c
    field public static final int TOY_GAME = 2068; // 0x814
    field public static final int TOY_ROBOT = 2052; // 0x804
    field public static final int TOY_UNCATEGORIZED = 2048; // 0x800
    field public static final int TOY_VEHICLE = 2056; // 0x808
    field public static final int WEARABLE_GLASSES = 1812; // 0x714
    field public static final int WEARABLE_HELMET = 1808; // 0x710
    field public static final int WEARABLE_JACKET = 1804; // 0x70c
    field public static final int WEARABLE_PAGER = 1800; // 0x708
    field public static final int WEARABLE_UNCATEGORIZED = 1792; // 0x700
    field public static final int WEARABLE_WRIST_WATCH = 1796; // 0x704
  }

  public static class BluetoothClass.Device.Major {
    ctor public BluetoothClass.Device.Major();
    field public static final int AUDIO_VIDEO = 1024; // 0x400
    field public static final int COMPUTER = 256; // 0x100
    field public static final int HEALTH = 2304; // 0x900
    field public static final int IMAGING = 1536; // 0x600
    field public static final int MISC = 0; // 0x0
    field public static final int NETWORKING = 768; // 0x300
    field public static final int PERIPHERAL = 1280; // 0x500
    field public static final int PHONE = 512; // 0x200
    field public static final int TOY = 2048; // 0x800
    field public static final int UNCATEGORIZED = 7936; // 0x1f00
    field public static final int WEARABLE = 1792; // 0x700
  }

  public static final class BluetoothClass.Service {
    ctor public BluetoothClass.Service();
    field public static final int AUDIO = 2097152; // 0x200000
    field public static final int CAPTURE = 524288; // 0x80000
    field public static final int INFORMATION = 8388608; // 0x800000
    field public static final int LIMITED_DISCOVERABILITY = 8192; // 0x2000
    field public static final int NETWORKING = 131072; // 0x20000
    field public static final int OBJECT_TRANSFER = 1048576; // 0x100000
    field public static final int POSITIONING = 65536; // 0x10000
    field public static final int RENDER = 262144; // 0x40000
    field public static final int TELEPHONY = 4194304; // 0x400000
  }

  public final class BluetoothDevice implements android.os.Parcelable {
    method public android.bluetooth.BluetoothGatt connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback);
    method public android.bluetooth.BluetoothGatt connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int);
    method public android.bluetooth.BluetoothGatt connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int, int);
    method public android.bluetooth.BluetoothGatt connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int, int, android.os.Handler);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean createBond();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.bluetooth.BluetoothSocket createInsecureL2capChannel(int) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.bluetooth.BluetoothSocket createInsecureRfcommSocketToServiceRecord(java.util.UUID) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.bluetooth.BluetoothSocket createL2capChannel(int) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.bluetooth.BluetoothSocket createRfcommSocketToServiceRecord(java.util.UUID) throws java.io.IOException;
    method public int describeContents();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean fetchUuidsWithSdp();
    method public String getAddress();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.bluetooth.BluetoothClass getBluetoothClass();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getBondState();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public String getName();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getType();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.os.ParcelUuid[] getUuids();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setPairingConfirmation(boolean);
    method public boolean setPin(byte[]);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final String ACTION_ACL_CONNECTED = "android.bluetooth.device.action.ACL_CONNECTED";
    field public static final String ACTION_ACL_DISCONNECTED = "android.bluetooth.device.action.ACL_DISCONNECTED";
    field public static final String ACTION_ACL_DISCONNECT_REQUESTED = "android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED";
    field public static final String ACTION_BOND_STATE_CHANGED = "android.bluetooth.device.action.BOND_STATE_CHANGED";
    field public static final String ACTION_CLASS_CHANGED = "android.bluetooth.device.action.CLASS_CHANGED";
    field public static final String ACTION_FOUND = "android.bluetooth.device.action.FOUND";
    field public static final String ACTION_NAME_CHANGED = "android.bluetooth.device.action.NAME_CHANGED";
    field public static final String ACTION_PAIRING_REQUEST = "android.bluetooth.device.action.PAIRING_REQUEST";
    field public static final String ACTION_UUID = "android.bluetooth.device.action.UUID";
    field public static final int BOND_BONDED = 12; // 0xc
    field public static final int BOND_BONDING = 11; // 0xb
    field public static final int BOND_NONE = 10; // 0xa
    field public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothDevice> CREATOR;
    field public static final int DEVICE_TYPE_CLASSIC = 1; // 0x1
    field public static final int DEVICE_TYPE_DUAL = 3; // 0x3
    field public static final int DEVICE_TYPE_LE = 2; // 0x2
    field public static final int DEVICE_TYPE_UNKNOWN = 0; // 0x0
    field public static final int ERROR = -2147483648; // 0x80000000
    field public static final String EXTRA_BOND_STATE = "android.bluetooth.device.extra.BOND_STATE";
    field public static final String EXTRA_CLASS = "android.bluetooth.device.extra.CLASS";
    field public static final String EXTRA_DEVICE = "android.bluetooth.device.extra.DEVICE";
    field public static final String EXTRA_NAME = "android.bluetooth.device.extra.NAME";
    field public static final String EXTRA_PAIRING_KEY = "android.bluetooth.device.extra.PAIRING_KEY";
    field public static final String EXTRA_PAIRING_VARIANT = "android.bluetooth.device.extra.PAIRING_VARIANT";
    field public static final String EXTRA_PREVIOUS_BOND_STATE = "android.bluetooth.device.extra.PREVIOUS_BOND_STATE";
    field public static final String EXTRA_RSSI = "android.bluetooth.device.extra.RSSI";
    field public static final String EXTRA_UUID = "android.bluetooth.device.extra.UUID";
    field public static final int PAIRING_VARIANT_PASSKEY_CONFIRMATION = 2; // 0x2
    field public static final int PAIRING_VARIANT_PIN = 0; // 0x0
    field public static final int PHY_LE_1M = 1; // 0x1
    field public static final int PHY_LE_1M_MASK = 1; // 0x1
    field public static final int PHY_LE_2M = 2; // 0x2
    field public static final int PHY_LE_2M_MASK = 2; // 0x2
    field public static final int PHY_LE_CODED = 3; // 0x3
    field public static final int PHY_LE_CODED_MASK = 4; // 0x4
    field public static final int PHY_OPTION_NO_PREFERRED = 0; // 0x0
    field public static final int PHY_OPTION_S2 = 1; // 0x1
    field public static final int PHY_OPTION_S8 = 2; // 0x2
    field public static final int TRANSPORT_AUTO = 0; // 0x0
    field public static final int TRANSPORT_BREDR = 1; // 0x1
    field public static final int TRANSPORT_LE = 2; // 0x2
  }

  public final class BluetoothGatt implements android.bluetooth.BluetoothProfile {
    method public void abortReliableWrite();
    method @Deprecated public void abortReliableWrite(android.bluetooth.BluetoothDevice);
    method public boolean beginReliableWrite();
    method public void close();
    method public boolean connect();
    method public void disconnect();
    method public boolean discoverServices();
    method public boolean executeReliableWrite();
    method public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method public int getConnectionState(android.bluetooth.BluetoothDevice);
    method public android.bluetooth.BluetoothDevice getDevice();
    method public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    method public android.bluetooth.BluetoothGattService getService(java.util.UUID);
    method public java.util.List<android.bluetooth.BluetoothGattService> getServices();
    method public boolean readCharacteristic(android.bluetooth.BluetoothGattCharacteristic);
    method public boolean readDescriptor(android.bluetooth.BluetoothGattDescriptor);
    method public void readPhy();
    method public boolean readRemoteRssi();
    method public boolean requestConnectionPriority(int);
    method public boolean requestMtu(int);
    method public boolean setCharacteristicNotification(android.bluetooth.BluetoothGattCharacteristic, boolean);
    method public void setPreferredPhy(int, int, int);
    method public boolean writeCharacteristic(android.bluetooth.BluetoothGattCharacteristic);
    method public boolean writeDescriptor(android.bluetooth.BluetoothGattDescriptor);
    field public static final int CONNECTION_PRIORITY_BALANCED = 0; // 0x0
    field public static final int CONNECTION_PRIORITY_HIGH = 1; // 0x1
    field public static final int CONNECTION_PRIORITY_LOW_POWER = 2; // 0x2
    field public static final int GATT_CONNECTION_CONGESTED = 143; // 0x8f
    field public static final int GATT_FAILURE = 257; // 0x101
    field public static final int GATT_INSUFFICIENT_AUTHENTICATION = 5; // 0x5
    field public static final int GATT_INSUFFICIENT_ENCRYPTION = 15; // 0xf
    field public static final int GATT_INVALID_ATTRIBUTE_LENGTH = 13; // 0xd
    field public static final int GATT_INVALID_OFFSET = 7; // 0x7
    field public static final int GATT_READ_NOT_PERMITTED = 2; // 0x2
    field public static final int GATT_REQUEST_NOT_SUPPORTED = 6; // 0x6
    field public static final int GATT_SUCCESS = 0; // 0x0
    field public static final int GATT_WRITE_NOT_PERMITTED = 3; // 0x3
  }

  public abstract class BluetoothGattCallback {
    ctor public BluetoothGattCallback();
    method public void onCharacteristicChanged(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattCharacteristic);
    method public void onCharacteristicRead(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattCharacteristic, int);
    method public void onCharacteristicWrite(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattCharacteristic, int);
    method public void onConnectionStateChange(android.bluetooth.BluetoothGatt, int, int);
    method public void onDescriptorRead(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattDescriptor, int);
    method public void onDescriptorWrite(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattDescriptor, int);
    method public void onMtuChanged(android.bluetooth.BluetoothGatt, int, int);
    method public void onPhyRead(android.bluetooth.BluetoothGatt, int, int, int);
    method public void onPhyUpdate(android.bluetooth.BluetoothGatt, int, int, int);
    method public void onReadRemoteRssi(android.bluetooth.BluetoothGatt, int, int);
    method public void onReliableWriteCompleted(android.bluetooth.BluetoothGatt, int);
    method public void onServicesDiscovered(android.bluetooth.BluetoothGatt, int);
  }

  public class BluetoothGattCharacteristic implements android.os.Parcelable {
    ctor public BluetoothGattCharacteristic(java.util.UUID, int, int);
    method public boolean addDescriptor(android.bluetooth.BluetoothGattDescriptor);
    method public int describeContents();
    method public android.bluetooth.BluetoothGattDescriptor getDescriptor(java.util.UUID);
    method public java.util.List<android.bluetooth.BluetoothGattDescriptor> getDescriptors();
    method public Float getFloatValue(int, int);
    method public int getInstanceId();
    method public Integer getIntValue(int, int);
    method public int getPermissions();
    method public int getProperties();
    method public android.bluetooth.BluetoothGattService getService();
    method public String getStringValue(int);
    method public java.util.UUID getUuid();
    method public byte[] getValue();
    method public int getWriteType();
    method public boolean setValue(byte[]);
    method public boolean setValue(int, int, int);
    method public boolean setValue(int, int, int, int);
    method public boolean setValue(String);
    method public void setWriteType(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothGattCharacteristic> CREATOR;
    field public static final int FORMAT_FLOAT = 52; // 0x34
    field public static final int FORMAT_SFLOAT = 50; // 0x32
    field public static final int FORMAT_SINT16 = 34; // 0x22
    field public static final int FORMAT_SINT32 = 36; // 0x24
    field public static final int FORMAT_SINT8 = 33; // 0x21
    field public static final int FORMAT_UINT16 = 18; // 0x12
    field public static final int FORMAT_UINT32 = 20; // 0x14
    field public static final int FORMAT_UINT8 = 17; // 0x11
    field public static final int PERMISSION_READ = 1; // 0x1
    field public static final int PERMISSION_READ_ENCRYPTED = 2; // 0x2
    field public static final int PERMISSION_READ_ENCRYPTED_MITM = 4; // 0x4
    field public static final int PERMISSION_WRITE = 16; // 0x10
    field public static final int PERMISSION_WRITE_ENCRYPTED = 32; // 0x20
    field public static final int PERMISSION_WRITE_ENCRYPTED_MITM = 64; // 0x40
    field public static final int PERMISSION_WRITE_SIGNED = 128; // 0x80
    field public static final int PERMISSION_WRITE_SIGNED_MITM = 256; // 0x100
    field public static final int PROPERTY_BROADCAST = 1; // 0x1
    field public static final int PROPERTY_EXTENDED_PROPS = 128; // 0x80
    field public static final int PROPERTY_INDICATE = 32; // 0x20
    field public static final int PROPERTY_NOTIFY = 16; // 0x10
    field public static final int PROPERTY_READ = 2; // 0x2
    field public static final int PROPERTY_SIGNED_WRITE = 64; // 0x40
    field public static final int PROPERTY_WRITE = 8; // 0x8
    field public static final int PROPERTY_WRITE_NO_RESPONSE = 4; // 0x4
    field public static final int WRITE_TYPE_DEFAULT = 2; // 0x2
    field public static final int WRITE_TYPE_NO_RESPONSE = 1; // 0x1
    field public static final int WRITE_TYPE_SIGNED = 4; // 0x4
    field protected java.util.List<android.bluetooth.BluetoothGattDescriptor> mDescriptors;
  }

  public class BluetoothGattDescriptor implements android.os.Parcelable {
    ctor public BluetoothGattDescriptor(java.util.UUID, int);
    method public int describeContents();
    method public android.bluetooth.BluetoothGattCharacteristic getCharacteristic();
    method public int getPermissions();
    method public java.util.UUID getUuid();
    method public byte[] getValue();
    method public boolean setValue(byte[]);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothGattDescriptor> CREATOR;
    field public static final byte[] DISABLE_NOTIFICATION_VALUE;
    field public static final byte[] ENABLE_INDICATION_VALUE;
    field public static final byte[] ENABLE_NOTIFICATION_VALUE;
    field public static final int PERMISSION_READ = 1; // 0x1
    field public static final int PERMISSION_READ_ENCRYPTED = 2; // 0x2
    field public static final int PERMISSION_READ_ENCRYPTED_MITM = 4; // 0x4
    field public static final int PERMISSION_WRITE = 16; // 0x10
    field public static final int PERMISSION_WRITE_ENCRYPTED = 32; // 0x20
    field public static final int PERMISSION_WRITE_ENCRYPTED_MITM = 64; // 0x40
    field public static final int PERMISSION_WRITE_SIGNED = 128; // 0x80
    field public static final int PERMISSION_WRITE_SIGNED_MITM = 256; // 0x100
  }

  public final class BluetoothGattServer implements android.bluetooth.BluetoothProfile {
    method public boolean addService(android.bluetooth.BluetoothGattService);
    method public void cancelConnection(android.bluetooth.BluetoothDevice);
    method public void clearServices();
    method public void close();
    method public boolean connect(android.bluetooth.BluetoothDevice, boolean);
    method public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method public int getConnectionState(android.bluetooth.BluetoothDevice);
    method public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    method public android.bluetooth.BluetoothGattService getService(java.util.UUID);
    method public java.util.List<android.bluetooth.BluetoothGattService> getServices();
    method public boolean notifyCharacteristicChanged(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothGattCharacteristic, boolean);
    method public void readPhy(android.bluetooth.BluetoothDevice);
    method public boolean removeService(android.bluetooth.BluetoothGattService);
    method public boolean sendResponse(android.bluetooth.BluetoothDevice, int, int, int, byte[]);
    method public void setPreferredPhy(android.bluetooth.BluetoothDevice, int, int, int);
  }

  public abstract class BluetoothGattServerCallback {
    ctor public BluetoothGattServerCallback();
    method public void onCharacteristicReadRequest(android.bluetooth.BluetoothDevice, int, int, android.bluetooth.BluetoothGattCharacteristic);
    method public void onCharacteristicWriteRequest(android.bluetooth.BluetoothDevice, int, android.bluetooth.BluetoothGattCharacteristic, boolean, boolean, int, byte[]);
    method public void onConnectionStateChange(android.bluetooth.BluetoothDevice, int, int);
    method public void onDescriptorReadRequest(android.bluetooth.BluetoothDevice, int, int, android.bluetooth.BluetoothGattDescriptor);
    method public void onDescriptorWriteRequest(android.bluetooth.BluetoothDevice, int, android.bluetooth.BluetoothGattDescriptor, boolean, boolean, int, byte[]);
    method public void onExecuteWrite(android.bluetooth.BluetoothDevice, int, boolean);
    method public void onMtuChanged(android.bluetooth.BluetoothDevice, int);
    method public void onNotificationSent(android.bluetooth.BluetoothDevice, int);
    method public void onPhyRead(android.bluetooth.BluetoothDevice, int, int, int);
    method public void onPhyUpdate(android.bluetooth.BluetoothDevice, int, int, int);
    method public void onServiceAdded(int, android.bluetooth.BluetoothGattService);
  }

  public class BluetoothGattService implements android.os.Parcelable {
    ctor public BluetoothGattService(java.util.UUID, int);
    method public boolean addCharacteristic(android.bluetooth.BluetoothGattCharacteristic);
    method public boolean addService(android.bluetooth.BluetoothGattService);
    method public int describeContents();
    method public android.bluetooth.BluetoothGattCharacteristic getCharacteristic(java.util.UUID);
    method public java.util.List<android.bluetooth.BluetoothGattCharacteristic> getCharacteristics();
    method public java.util.List<android.bluetooth.BluetoothGattService> getIncludedServices();
    method public int getInstanceId();
    method public int getType();
    method public java.util.UUID getUuid();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothGattService> CREATOR;
    field public static final int SERVICE_TYPE_PRIMARY = 0; // 0x0
    field public static final int SERVICE_TYPE_SECONDARY = 1; // 0x1
    field protected java.util.List<android.bluetooth.BluetoothGattCharacteristic> mCharacteristics;
    field protected java.util.List<android.bluetooth.BluetoothGattService> mIncludedServices;
  }

  public final class BluetoothHeadset implements android.bluetooth.BluetoothProfile {
    method public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method public int getConnectionState(android.bluetooth.BluetoothDevice);
    method public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    method public boolean isAudioConnected(android.bluetooth.BluetoothDevice);
    method public boolean sendVendorSpecificResultCode(android.bluetooth.BluetoothDevice, String, String);
    method public boolean startVoiceRecognition(android.bluetooth.BluetoothDevice);
    method public boolean stopVoiceRecognition(android.bluetooth.BluetoothDevice);
    field public static final String ACTION_AUDIO_STATE_CHANGED = "android.bluetooth.headset.profile.action.AUDIO_STATE_CHANGED";
    field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED";
    field public static final String ACTION_VENDOR_SPECIFIC_HEADSET_EVENT = "android.bluetooth.headset.action.VENDOR_SPECIFIC_HEADSET_EVENT";
    field public static final int AT_CMD_TYPE_ACTION = 4; // 0x4
    field public static final int AT_CMD_TYPE_BASIC = 3; // 0x3
    field public static final int AT_CMD_TYPE_READ = 0; // 0x0
    field public static final int AT_CMD_TYPE_SET = 2; // 0x2
    field public static final int AT_CMD_TYPE_TEST = 1; // 0x1
    field public static final String EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_ARGS = "android.bluetooth.headset.extra.VENDOR_SPECIFIC_HEADSET_EVENT_ARGS";
    field public static final String EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD = "android.bluetooth.headset.extra.VENDOR_SPECIFIC_HEADSET_EVENT_CMD";
    field public static final String EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD_TYPE = "android.bluetooth.headset.extra.VENDOR_SPECIFIC_HEADSET_EVENT_CMD_TYPE";
    field public static final int STATE_AUDIO_CONNECTED = 12; // 0xc
    field public static final int STATE_AUDIO_CONNECTING = 11; // 0xb
    field public static final int STATE_AUDIO_DISCONNECTED = 10; // 0xa
    field public static final String VENDOR_RESULT_CODE_COMMAND_ANDROID = "+ANDROID";
    field public static final String VENDOR_SPECIFIC_HEADSET_EVENT_COMPANY_ID_CATEGORY = "android.bluetooth.headset.intent.category.companyid";
  }

  @Deprecated public final class BluetoothHealth implements android.bluetooth.BluetoothProfile {
    ctor @Deprecated public BluetoothHealth();
    method @Deprecated public boolean connectChannelToSource(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothHealthAppConfiguration);
    method @Deprecated public boolean disconnectChannel(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothHealthAppConfiguration, int);
    method @Deprecated public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @Deprecated public int getConnectionState(android.bluetooth.BluetoothDevice);
    method @Deprecated public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    method @Deprecated public android.os.ParcelFileDescriptor getMainChannelFd(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothHealthAppConfiguration);
    method @Deprecated public boolean registerSinkAppConfiguration(String, int, android.bluetooth.BluetoothHealthCallback);
    method @Deprecated public boolean unregisterAppConfiguration(android.bluetooth.BluetoothHealthAppConfiguration);
    field @Deprecated public static final int APP_CONFIG_REGISTRATION_FAILURE = 1; // 0x1
    field @Deprecated public static final int APP_CONFIG_REGISTRATION_SUCCESS = 0; // 0x0
    field @Deprecated public static final int APP_CONFIG_UNREGISTRATION_FAILURE = 3; // 0x3
    field @Deprecated public static final int APP_CONFIG_UNREGISTRATION_SUCCESS = 2; // 0x2
    field @Deprecated public static final int CHANNEL_TYPE_RELIABLE = 10; // 0xa
    field @Deprecated public static final int CHANNEL_TYPE_STREAMING = 11; // 0xb
    field @Deprecated public static final int SINK_ROLE = 2; // 0x2
    field @Deprecated public static final int SOURCE_ROLE = 1; // 0x1
    field @Deprecated public static final int STATE_CHANNEL_CONNECTED = 2; // 0x2
    field @Deprecated public static final int STATE_CHANNEL_CONNECTING = 1; // 0x1
    field @Deprecated public static final int STATE_CHANNEL_DISCONNECTED = 0; // 0x0
    field @Deprecated public static final int STATE_CHANNEL_DISCONNECTING = 3; // 0x3
  }

  @Deprecated public final class BluetoothHealthAppConfiguration implements android.os.Parcelable {
    ctor @Deprecated public BluetoothHealthAppConfiguration();
    method @Deprecated public int describeContents();
    method @Deprecated public int getDataType();
    method @Deprecated public String getName();
    method @Deprecated public int getRole();
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHealthAppConfiguration> CREATOR;
  }

  @Deprecated public abstract class BluetoothHealthCallback {
    ctor @Deprecated public BluetoothHealthCallback();
    method @Deprecated @BinderThread public void onHealthAppConfigurationStatusChange(android.bluetooth.BluetoothHealthAppConfiguration, int);
    method @Deprecated @BinderThread public void onHealthChannelStateChange(android.bluetooth.BluetoothHealthAppConfiguration, android.bluetooth.BluetoothDevice, int, int, android.os.ParcelFileDescriptor, int);
  }

  public final class BluetoothHearingAid implements android.bluetooth.BluetoothProfile {
    method public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method public int getConnectionState(android.bluetooth.BluetoothDevice);
    method public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.hearingaid.profile.action.CONNECTION_STATE_CHANGED";
  }

  public final class BluetoothHidDevice implements android.bluetooth.BluetoothProfile {
    method public boolean connect(android.bluetooth.BluetoothDevice);
    method public boolean disconnect(android.bluetooth.BluetoothDevice);
    method public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method public int getConnectionState(android.bluetooth.BluetoothDevice);
    method public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    method public boolean registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings, android.bluetooth.BluetoothHidDeviceAppQosSettings, android.bluetooth.BluetoothHidDeviceAppQosSettings, java.util.concurrent.Executor, android.bluetooth.BluetoothHidDevice.Callback);
    method public boolean replyReport(android.bluetooth.BluetoothDevice, byte, byte, byte[]);
    method public boolean reportError(android.bluetooth.BluetoothDevice, byte);
    method public boolean sendReport(android.bluetooth.BluetoothDevice, int, byte[]);
    method public boolean unregisterApp();
    field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.hiddevice.profile.action.CONNECTION_STATE_CHANGED";
    field public static final byte ERROR_RSP_INVALID_PARAM = 4; // 0x4
    field public static final byte ERROR_RSP_INVALID_RPT_ID = 2; // 0x2
    field public static final byte ERROR_RSP_NOT_READY = 1; // 0x1
    field public static final byte ERROR_RSP_SUCCESS = 0; // 0x0
    field public static final byte ERROR_RSP_UNKNOWN = 14; // 0xe
    field public static final byte ERROR_RSP_UNSUPPORTED_REQ = 3; // 0x3
    field public static final byte PROTOCOL_BOOT_MODE = 0; // 0x0
    field public static final byte PROTOCOL_REPORT_MODE = 1; // 0x1
    field public static final byte REPORT_TYPE_FEATURE = 3; // 0x3
    field public static final byte REPORT_TYPE_INPUT = 1; // 0x1
    field public static final byte REPORT_TYPE_OUTPUT = 2; // 0x2
    field public static final byte SUBCLASS1_COMBO = -64; // 0xffffffc0
    field public static final byte SUBCLASS1_KEYBOARD = 64; // 0x40
    field public static final byte SUBCLASS1_MOUSE = -128; // 0xffffff80
    field public static final byte SUBCLASS1_NONE = 0; // 0x0
    field public static final byte SUBCLASS2_CARD_READER = 6; // 0x6
    field public static final byte SUBCLASS2_DIGITIZER_TABLET = 5; // 0x5
    field public static final byte SUBCLASS2_GAMEPAD = 2; // 0x2
    field public static final byte SUBCLASS2_JOYSTICK = 1; // 0x1
    field public static final byte SUBCLASS2_REMOTE_CONTROL = 3; // 0x3
    field public static final byte SUBCLASS2_SENSING_DEVICE = 4; // 0x4
    field public static final byte SUBCLASS2_UNCATEGORIZED = 0; // 0x0
  }

  public abstract static class BluetoothHidDevice.Callback {
    ctor public BluetoothHidDevice.Callback();
    method public void onAppStatusChanged(android.bluetooth.BluetoothDevice, boolean);
    method public void onConnectionStateChanged(android.bluetooth.BluetoothDevice, int);
    method public void onGetReport(android.bluetooth.BluetoothDevice, byte, byte, int);
    method public void onInterruptData(android.bluetooth.BluetoothDevice, byte, byte[]);
    method public void onSetProtocol(android.bluetooth.BluetoothDevice, byte);
    method public void onSetReport(android.bluetooth.BluetoothDevice, byte, byte, byte[]);
    method public void onVirtualCableUnplug(android.bluetooth.BluetoothDevice);
  }

  public final class BluetoothHidDeviceAppQosSettings implements android.os.Parcelable {
    ctor public BluetoothHidDeviceAppQosSettings(int, int, int, int, int, int);
    method public int describeContents();
    method public int getDelayVariation();
    method public int getLatency();
    method public int getPeakBandwidth();
    method public int getServiceType();
    method public int getTokenBucketSize();
    method public int getTokenRate();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHidDeviceAppQosSettings> CREATOR;
    field public static final int MAX = -1; // 0xffffffff
    field public static final int SERVICE_BEST_EFFORT = 1; // 0x1
    field public static final int SERVICE_GUARANTEED = 2; // 0x2
    field public static final int SERVICE_NO_TRAFFIC = 0; // 0x0
  }

  public final class BluetoothHidDeviceAppSdpSettings implements android.os.Parcelable {
    ctor public BluetoothHidDeviceAppSdpSettings(String, String, String, byte, byte[]);
    method public int describeContents();
    method public String getDescription();
    method public byte[] getDescriptors();
    method public String getName();
    method public String getProvider();
    method public byte getSubclass();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHidDeviceAppSdpSettings> CREATOR;
  }

  public final class BluetoothManager {
    method public android.bluetooth.BluetoothAdapter getAdapter();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices(int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getConnectionState(android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int, int[]);
    method public android.bluetooth.BluetoothGattServer openGattServer(android.content.Context, android.bluetooth.BluetoothGattServerCallback);
  }

  public interface BluetoothProfile {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getConnectionState(android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    field public static final int A2DP = 2; // 0x2
    field public static final String EXTRA_PREVIOUS_STATE = "android.bluetooth.profile.extra.PREVIOUS_STATE";
    field public static final String EXTRA_STATE = "android.bluetooth.profile.extra.STATE";
    field public static final int GATT = 7; // 0x7
    field public static final int GATT_SERVER = 8; // 0x8
    field public static final int HEADSET = 1; // 0x1
    field @Deprecated public static final int HEALTH = 3; // 0x3
    field public static final int HEARING_AID = 21; // 0x15
    field public static final int HID_DEVICE = 19; // 0x13
    field public static final int SAP = 10; // 0xa
    field public static final int STATE_CONNECTED = 2; // 0x2
    field public static final int STATE_CONNECTING = 1; // 0x1
    field public static final int STATE_DISCONNECTED = 0; // 0x0
    field public static final int STATE_DISCONNECTING = 3; // 0x3
  }

  public static interface BluetoothProfile.ServiceListener {
    method public void onServiceConnected(int, android.bluetooth.BluetoothProfile);
    method public void onServiceDisconnected(int);
  }

  public final class BluetoothServerSocket implements java.io.Closeable {
    method public android.bluetooth.BluetoothSocket accept() throws java.io.IOException;
    method public android.bluetooth.BluetoothSocket accept(int) throws java.io.IOException;
    method public void close() throws java.io.IOException;
    method public int getPsm();
  }

  public final class BluetoothSocket implements java.io.Closeable {
    method public void close() throws java.io.IOException;
    method public void connect() throws java.io.IOException;
    method public int getConnectionType();
    method public java.io.InputStream getInputStream() throws java.io.IOException;
    method public int getMaxReceivePacketSize();
    method public int getMaxTransmitPacketSize();
    method public java.io.OutputStream getOutputStream() throws java.io.IOException;
    method public android.bluetooth.BluetoothDevice getRemoteDevice();
    method public boolean isConnected();
    field public static final int TYPE_L2CAP = 3; // 0x3
    field public static final int TYPE_RFCOMM = 1; // 0x1
    field public static final int TYPE_SCO = 2; // 0x2
  }

}

package android.bluetooth.le {

  public abstract class AdvertiseCallback {
    ctor public AdvertiseCallback();
    method public void onStartFailure(int);
    method public void onStartSuccess(android.bluetooth.le.AdvertiseSettings);
    field public static final int ADVERTISE_FAILED_ALREADY_STARTED = 3; // 0x3
    field public static final int ADVERTISE_FAILED_DATA_TOO_LARGE = 1; // 0x1
    field public static final int ADVERTISE_FAILED_FEATURE_UNSUPPORTED = 5; // 0x5
    field public static final int ADVERTISE_FAILED_INTERNAL_ERROR = 4; // 0x4
    field public static final int ADVERTISE_FAILED_TOO_MANY_ADVERTISERS = 2; // 0x2
  }

  public final class AdvertiseData implements android.os.Parcelable {
    method public int describeContents();
    method public boolean getIncludeDeviceName();
    method public boolean getIncludeTxPowerLevel();
    method public android.util.SparseArray<byte[]> getManufacturerSpecificData();
    method public java.util.Map<android.os.ParcelUuid,byte[]> getServiceData();
    method public java.util.List<android.os.ParcelUuid> getServiceUuids();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.le.AdvertiseData> CREATOR;
  }

  public static final class AdvertiseData.Builder {
    ctor public AdvertiseData.Builder();
    method public android.bluetooth.le.AdvertiseData.Builder addManufacturerData(int, byte[]);
    method public android.bluetooth.le.AdvertiseData.Builder addServiceData(android.os.ParcelUuid, byte[]);
    method public android.bluetooth.le.AdvertiseData.Builder addServiceUuid(android.os.ParcelUuid);
    method public android.bluetooth.le.AdvertiseData build();
    method public android.bluetooth.le.AdvertiseData.Builder setIncludeDeviceName(boolean);
    method public android.bluetooth.le.AdvertiseData.Builder setIncludeTxPowerLevel(boolean);
  }

  public final class AdvertiseSettings implements android.os.Parcelable {
    method public int describeContents();
    method public int getMode();
    method public int getTimeout();
    method public int getTxPowerLevel();
    method public boolean isConnectable();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ADVERTISE_MODE_BALANCED = 1; // 0x1
    field public static final int ADVERTISE_MODE_LOW_LATENCY = 2; // 0x2
    field public static final int ADVERTISE_MODE_LOW_POWER = 0; // 0x0
    field public static final int ADVERTISE_TX_POWER_HIGH = 3; // 0x3
    field public static final int ADVERTISE_TX_POWER_LOW = 1; // 0x1
    field public static final int ADVERTISE_TX_POWER_MEDIUM = 2; // 0x2
    field public static final int ADVERTISE_TX_POWER_ULTRA_LOW = 0; // 0x0
    field public static final android.os.Parcelable.Creator<android.bluetooth.le.AdvertiseSettings> CREATOR;
  }

  public static final class AdvertiseSettings.Builder {
    ctor public AdvertiseSettings.Builder();
    method public android.bluetooth.le.AdvertiseSettings build();
    method public android.bluetooth.le.AdvertiseSettings.Builder setAdvertiseMode(int);
    method public android.bluetooth.le.AdvertiseSettings.Builder setConnectable(boolean);
    method public android.bluetooth.le.AdvertiseSettings.Builder setTimeout(int);
    method public android.bluetooth.le.AdvertiseSettings.Builder setTxPowerLevel(int);
  }

  public final class AdvertisingSet {
    method public void enableAdvertising(boolean, int, int);
    method public void setAdvertisingData(android.bluetooth.le.AdvertiseData);
    method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters);
    method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData);
    method public void setPeriodicAdvertisingEnabled(boolean);
    method public void setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters);
    method public void setScanResponseData(android.bluetooth.le.AdvertiseData);
  }

  public abstract class AdvertisingSetCallback {
    ctor public AdvertisingSetCallback();
    method public void onAdvertisingDataSet(android.bluetooth.le.AdvertisingSet, int);
    method public void onAdvertisingEnabled(android.bluetooth.le.AdvertisingSet, boolean, int);
    method public void onAdvertisingParametersUpdated(android.bluetooth.le.AdvertisingSet, int, int);
    method public void onAdvertisingSetStarted(android.bluetooth.le.AdvertisingSet, int, int);
    method public void onAdvertisingSetStopped(android.bluetooth.le.AdvertisingSet);
    method public void onPeriodicAdvertisingDataSet(android.bluetooth.le.AdvertisingSet, int);
    method public void onPeriodicAdvertisingEnabled(android.bluetooth.le.AdvertisingSet, boolean, int);
    method public void onPeriodicAdvertisingParametersUpdated(android.bluetooth.le.AdvertisingSet, int);
    method public void onScanResponseDataSet(android.bluetooth.le.AdvertisingSet, int);
    field public static final int ADVERTISE_FAILED_ALREADY_STARTED = 3; // 0x3
    field public static final int ADVERTISE_FAILED_DATA_TOO_LARGE = 1; // 0x1
    field public static final int ADVERTISE_FAILED_FEATURE_UNSUPPORTED = 5; // 0x5
    field public static final int ADVERTISE_FAILED_INTERNAL_ERROR = 4; // 0x4
    field public static final int ADVERTISE_FAILED_TOO_MANY_ADVERTISERS = 2; // 0x2
    field public static final int ADVERTISE_SUCCESS = 0; // 0x0
  }

  public final class AdvertisingSetParameters implements android.os.Parcelable {
    method public int describeContents();
    method public int getInterval();
    method public int getPrimaryPhy();
    method public int getSecondaryPhy();
    method public int getTxPowerLevel();
    method public boolean includeTxPower();
    method public boolean isAnonymous();
    method public boolean isConnectable();
    method public boolean isLegacy();
    method public boolean isScannable();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.le.AdvertisingSetParameters> CREATOR;
    field public static final int INTERVAL_HIGH = 1600; // 0x640
    field public static final int INTERVAL_LOW = 160; // 0xa0
    field public static final int INTERVAL_MAX = 16777215; // 0xffffff
    field public static final int INTERVAL_MEDIUM = 400; // 0x190
    field public static final int INTERVAL_MIN = 160; // 0xa0
    field public static final int TX_POWER_HIGH = 1; // 0x1
    field public static final int TX_POWER_LOW = -15; // 0xfffffff1
    field public static final int TX_POWER_MAX = 1; // 0x1
    field public static final int TX_POWER_MEDIUM = -7; // 0xfffffff9
    field public static final int TX_POWER_MIN = -127; // 0xffffff81
    field public static final int TX_POWER_ULTRA_LOW = -21; // 0xffffffeb
  }

  public static final class AdvertisingSetParameters.Builder {
    ctor public AdvertisingSetParameters.Builder();
    method public android.bluetooth.le.AdvertisingSetParameters build();
    method public android.bluetooth.le.AdvertisingSetParameters.Builder setAnonymous(boolean);
    method public android.bluetooth.le.AdvertisingSetParameters.Builder setConnectable(boolean);
    method public android.bluetooth.le.AdvertisingSetParameters.Builder setIncludeTxPower(boolean);
    method public android.bluetooth.le.AdvertisingSetParameters.Builder setInterval(int);
    method public android.bluetooth.le.AdvertisingSetParameters.Builder setLegacyMode(boolean);
    method public android.bluetooth.le.AdvertisingSetParameters.Builder setPrimaryPhy(int);
    method public android.bluetooth.le.AdvertisingSetParameters.Builder setScannable(boolean);
    method public android.bluetooth.le.AdvertisingSetParameters.Builder setSecondaryPhy(int);
    method public android.bluetooth.le.AdvertisingSetParameters.Builder setTxPowerLevel(int);
  }

  public final class BluetoothLeAdvertiser {
    method public void startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback);
    method public void startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
    method public void stopAdvertising(android.bluetooth.le.AdvertiseCallback);
    method public void stopAdvertisingSet(android.bluetooth.le.AdvertisingSetCallback);
  }

  public final class BluetoothLeScanner {
    method public void flushPendingScanResults(android.bluetooth.le.ScanCallback);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public void startScan(android.bluetooth.le.ScanCallback);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public void startScan(java.util.List<android.bluetooth.le.ScanFilter>, android.bluetooth.le.ScanSettings, android.bluetooth.le.ScanCallback);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public int startScan(@Nullable java.util.List<android.bluetooth.le.ScanFilter>, @Nullable android.bluetooth.le.ScanSettings, @NonNull android.app.PendingIntent);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public void stopScan(android.bluetooth.le.ScanCallback);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public void stopScan(android.app.PendingIntent);
    field public static final String EXTRA_CALLBACK_TYPE = "android.bluetooth.le.extra.CALLBACK_TYPE";
    field public static final String EXTRA_ERROR_CODE = "android.bluetooth.le.extra.ERROR_CODE";
    field public static final String EXTRA_LIST_SCAN_RESULT = "android.bluetooth.le.extra.LIST_SCAN_RESULT";
  }

  public final class PeriodicAdvertisingParameters implements android.os.Parcelable {
    method public int describeContents();
    method public boolean getIncludeTxPower();
    method public int getInterval();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.le.PeriodicAdvertisingParameters> CREATOR;
  }

  public static final class PeriodicAdvertisingParameters.Builder {
    ctor public PeriodicAdvertisingParameters.Builder();
    method public android.bluetooth.le.PeriodicAdvertisingParameters build();
    method public android.bluetooth.le.PeriodicAdvertisingParameters.Builder setIncludeTxPower(boolean);
    method public android.bluetooth.le.PeriodicAdvertisingParameters.Builder setInterval(int);
  }

  public abstract class ScanCallback {
    ctor public ScanCallback();
    method public void onBatchScanResults(java.util.List<android.bluetooth.le.ScanResult>);
    method public void onScanFailed(int);
    method public void onScanResult(int, android.bluetooth.le.ScanResult);
    field public static final int SCAN_FAILED_ALREADY_STARTED = 1; // 0x1
    field public static final int SCAN_FAILED_APPLICATION_REGISTRATION_FAILED = 2; // 0x2
    field public static final int SCAN_FAILED_FEATURE_UNSUPPORTED = 4; // 0x4
    field public static final int SCAN_FAILED_INTERNAL_ERROR = 3; // 0x3
  }

  public final class ScanFilter implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getDeviceAddress();
    method @Nullable public String getDeviceName();
    method @Nullable public byte[] getManufacturerData();
    method @Nullable public byte[] getManufacturerDataMask();
    method public int getManufacturerId();
    method @Nullable public byte[] getServiceData();
    method @Nullable public byte[] getServiceDataMask();
    method @Nullable public android.os.ParcelUuid getServiceDataUuid();
    method @Nullable public android.os.ParcelUuid getServiceSolicitationUuid();
    method @Nullable public android.os.ParcelUuid getServiceSolicitationUuidMask();
    method @Nullable public android.os.ParcelUuid getServiceUuid();
    method @Nullable public android.os.ParcelUuid getServiceUuidMask();
    method public boolean matches(android.bluetooth.le.ScanResult);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.le.ScanFilter> CREATOR;
  }

  public static final class ScanFilter.Builder {
    ctor public ScanFilter.Builder();
    method public android.bluetooth.le.ScanFilter build();
    method public android.bluetooth.le.ScanFilter.Builder setDeviceAddress(String);
    method public android.bluetooth.le.ScanFilter.Builder setDeviceName(String);
    method public android.bluetooth.le.ScanFilter.Builder setManufacturerData(int, byte[]);
    method public android.bluetooth.le.ScanFilter.Builder setManufacturerData(int, byte[], byte[]);
    method public android.bluetooth.le.ScanFilter.Builder setServiceData(android.os.ParcelUuid, byte[]);
    method public android.bluetooth.le.ScanFilter.Builder setServiceData(android.os.ParcelUuid, byte[], byte[]);
    method public android.bluetooth.le.ScanFilter.Builder setServiceSolicitationUuid(android.os.ParcelUuid);
    method public android.bluetooth.le.ScanFilter.Builder setServiceSolicitationUuid(android.os.ParcelUuid, android.os.ParcelUuid);
    method public android.bluetooth.le.ScanFilter.Builder setServiceUuid(android.os.ParcelUuid);
    method public android.bluetooth.le.ScanFilter.Builder setServiceUuid(android.os.ParcelUuid, android.os.ParcelUuid);
  }

  public final class ScanRecord {
    method public int getAdvertiseFlags();
    method public byte[] getBytes();
    method @Nullable public String getDeviceName();
    method public android.util.SparseArray<byte[]> getManufacturerSpecificData();
    method @Nullable public byte[] getManufacturerSpecificData(int);
    method public java.util.Map<android.os.ParcelUuid,byte[]> getServiceData();
    method @Nullable public byte[] getServiceData(android.os.ParcelUuid);
    method @Nullable public java.util.List<android.os.ParcelUuid> getServiceSolicitationUuids();
    method public java.util.List<android.os.ParcelUuid> getServiceUuids();
    method public int getTxPowerLevel();
  }

  public final class ScanResult implements android.os.Parcelable {
    ctor @Deprecated public ScanResult(android.bluetooth.BluetoothDevice, android.bluetooth.le.ScanRecord, int, long);
    ctor public ScanResult(android.bluetooth.BluetoothDevice, int, int, int, int, int, int, int, android.bluetooth.le.ScanRecord, long);
    method public int describeContents();
    method public int getAdvertisingSid();
    method public int getDataStatus();
    method public android.bluetooth.BluetoothDevice getDevice();
    method public int getPeriodicAdvertisingInterval();
    method public int getPrimaryPhy();
    method public int getRssi();
    method @Nullable public android.bluetooth.le.ScanRecord getScanRecord();
    method public int getSecondaryPhy();
    method public long getTimestampNanos();
    method public int getTxPower();
    method public boolean isConnectable();
    method public boolean isLegacy();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.le.ScanResult> CREATOR;
    field public static final int DATA_COMPLETE = 0; // 0x0
    field public static final int DATA_TRUNCATED = 2; // 0x2
    field public static final int PERIODIC_INTERVAL_NOT_PRESENT = 0; // 0x0
    field public static final int PHY_UNUSED = 0; // 0x0
    field public static final int SID_NOT_PRESENT = 255; // 0xff
    field public static final int TX_POWER_NOT_PRESENT = 127; // 0x7f
  }

  public final class ScanSettings implements android.os.Parcelable {
    method public int describeContents();
    method public int getCallbackType();
    method public boolean getLegacy();
    method public int getPhy();
    method public long getReportDelayMillis();
    method public int getScanMode();
    method public int getScanResultType();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CALLBACK_TYPE_ALL_MATCHES = 1; // 0x1
    field public static final int CALLBACK_TYPE_FIRST_MATCH = 2; // 0x2
    field public static final int CALLBACK_TYPE_MATCH_LOST = 4; // 0x4
    field public static final android.os.Parcelable.Creator<android.bluetooth.le.ScanSettings> CREATOR;
    field public static final int MATCH_MODE_AGGRESSIVE = 1; // 0x1
    field public static final int MATCH_MODE_STICKY = 2; // 0x2
    field public static final int MATCH_NUM_FEW_ADVERTISEMENT = 2; // 0x2
    field public static final int MATCH_NUM_MAX_ADVERTISEMENT = 3; // 0x3
    field public static final int MATCH_NUM_ONE_ADVERTISEMENT = 1; // 0x1
    field public static final int PHY_LE_ALL_SUPPORTED = 255; // 0xff
    field public static final int SCAN_MODE_BALANCED = 1; // 0x1
    field public static final int SCAN_MODE_LOW_LATENCY = 2; // 0x2
    field public static final int SCAN_MODE_LOW_POWER = 0; // 0x0
    field public static final int SCAN_MODE_OPPORTUNISTIC = -1; // 0xffffffff
  }

  public static final class ScanSettings.Builder {
    ctor public ScanSettings.Builder();
    method public android.bluetooth.le.ScanSettings build();
    method public android.bluetooth.le.ScanSettings.Builder setCallbackType(int);
    method public android.bluetooth.le.ScanSettings.Builder setLegacy(boolean);
    method public android.bluetooth.le.ScanSettings.Builder setMatchMode(int);
    method public android.bluetooth.le.ScanSettings.Builder setNumOfMatches(int);
    method public android.bluetooth.le.ScanSettings.Builder setPhy(int);
    method public android.bluetooth.le.ScanSettings.Builder setReportDelay(long);
    method public android.bluetooth.le.ScanSettings.Builder setScanMode(int);
  }

}

package android.companion {

  public final class AssociationRequest implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.companion.AssociationRequest> CREATOR;
  }

  public static final class AssociationRequest.Builder {
    ctor public AssociationRequest.Builder();
    method @NonNull public android.companion.AssociationRequest.Builder addDeviceFilter(@Nullable android.companion.DeviceFilter<?>);
    method @NonNull public android.companion.AssociationRequest build();
    method @NonNull public android.companion.AssociationRequest.Builder setSingleDevice(boolean);
  }

  public final class BluetoothDeviceFilter implements android.companion.DeviceFilter<android.bluetooth.BluetoothDevice> {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.companion.BluetoothDeviceFilter> CREATOR;
  }

  public static final class BluetoothDeviceFilter.Builder {
    ctor public BluetoothDeviceFilter.Builder();
    method @NonNull public android.companion.BluetoothDeviceFilter.Builder addServiceUuid(@Nullable android.os.ParcelUuid, @Nullable android.os.ParcelUuid);
    method @NonNull public android.companion.BluetoothDeviceFilter build();
    method @NonNull public android.companion.BluetoothDeviceFilter.Builder setAddress(@Nullable String);
    method public android.companion.BluetoothDeviceFilter.Builder setNamePattern(@Nullable java.util.regex.Pattern);
  }

  public final class BluetoothLeDeviceFilter implements android.companion.DeviceFilter<android.bluetooth.le.ScanResult> {
    method public int describeContents();
    method public static int getRenamePrefixLengthLimit();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.companion.BluetoothLeDeviceFilter> CREATOR;
  }

  public static final class BluetoothLeDeviceFilter.Builder {
    ctor public BluetoothLeDeviceFilter.Builder();
    method @NonNull public android.companion.BluetoothLeDeviceFilter build();
    method public android.companion.BluetoothLeDeviceFilter.Builder setNamePattern(@Nullable java.util.regex.Pattern);
    method @NonNull public android.companion.BluetoothLeDeviceFilter.Builder setRawDataFilter(@NonNull byte[], @Nullable byte[]);
    method @NonNull public android.companion.BluetoothLeDeviceFilter.Builder setRenameFromBytes(@NonNull String, @NonNull String, int, int, java.nio.ByteOrder);
    method @NonNull public android.companion.BluetoothLeDeviceFilter.Builder setRenameFromName(@NonNull String, @NonNull String, int, int);
    method @NonNull public android.companion.BluetoothLeDeviceFilter.Builder setScanFilter(@Nullable android.bluetooth.le.ScanFilter);
  }

  public final class CompanionDeviceManager {
    method public void associate(@NonNull android.companion.AssociationRequest, @NonNull android.companion.CompanionDeviceManager.Callback, @Nullable android.os.Handler);
    method public void disassociate(@NonNull String);
    method @NonNull public java.util.List<java.lang.String> getAssociations();
    method public boolean hasNotificationAccess(android.content.ComponentName);
    method public void requestNotificationAccess(android.content.ComponentName);
    field public static final String EXTRA_DEVICE = "android.companion.extra.DEVICE";
  }

  public abstract static class CompanionDeviceManager.Callback {
    ctor public CompanionDeviceManager.Callback();
    method public abstract void onDeviceFound(android.content.IntentSender);
    method public abstract void onFailure(CharSequence);
  }

  public interface DeviceFilter<D extends android.os.Parcelable> extends android.os.Parcelable {
  }

  public final class WifiDeviceFilter implements android.companion.DeviceFilter<android.net.wifi.ScanResult> {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.companion.WifiDeviceFilter> CREATOR;
  }

  public static final class WifiDeviceFilter.Builder {
    ctor public WifiDeviceFilter.Builder();
    method @NonNull public android.companion.WifiDeviceFilter build();
    method public android.companion.WifiDeviceFilter.Builder setNamePattern(@Nullable java.util.regex.Pattern);
  }

}

package android.content {

  public abstract class AbstractThreadedSyncAdapter {
    ctor public AbstractThreadedSyncAdapter(android.content.Context, boolean);
    ctor public AbstractThreadedSyncAdapter(android.content.Context, boolean, boolean);
    method public android.content.Context getContext();
    method public final android.os.IBinder getSyncAdapterBinder();
    method public abstract void onPerformSync(android.accounts.Account, android.os.Bundle, String, android.content.ContentProviderClient, android.content.SyncResult);
    method public void onSecurityException(android.accounts.Account, android.os.Bundle, String, android.content.SyncResult);
    method public void onSyncCanceled();
    method public void onSyncCanceled(Thread);
    method @MainThread public boolean onUnsyncableAccount();
    field @Deprecated public static final int LOG_SYNC_DETAILS = 2743; // 0xab7
  }

  public class ActivityNotFoundException extends java.lang.RuntimeException {
    ctor public ActivityNotFoundException();
    ctor public ActivityNotFoundException(String);
  }

  public abstract class AsyncQueryHandler extends android.os.Handler {
    ctor public AsyncQueryHandler(android.content.ContentResolver);
    method public final void cancelOperation(int);
    method protected android.os.Handler createHandler(android.os.Looper);
    method protected void onDeleteComplete(int, Object, int);
    method protected void onInsertComplete(int, Object, android.net.Uri);
    method protected void onQueryComplete(int, Object, android.database.Cursor);
    method protected void onUpdateComplete(int, Object, int);
    method public final void startDelete(int, Object, android.net.Uri, String, String[]);
    method public final void startInsert(int, Object, android.net.Uri, android.content.ContentValues);
    method public void startQuery(int, Object, android.net.Uri, String[], String, String[], String);
    method public final void startUpdate(int, Object, android.net.Uri, android.content.ContentValues, String, String[]);
  }

  protected static final class AsyncQueryHandler.WorkerArgs {
    ctor protected AsyncQueryHandler.WorkerArgs();
    field public Object cookie;
    field public android.os.Handler handler;
    field public String orderBy;
    field public String[] projection;
    field public Object result;
    field public String selection;
    field public String[] selectionArgs;
    field public android.net.Uri uri;
    field public android.content.ContentValues values;
  }

  protected class AsyncQueryHandler.WorkerHandler extends android.os.Handler {
    ctor public AsyncQueryHandler.WorkerHandler(android.os.Looper);
  }

  @Deprecated public abstract class AsyncTaskLoader<D> extends android.content.Loader<D> {
    ctor @Deprecated public AsyncTaskLoader(android.content.Context);
    method @Deprecated public void cancelLoadInBackground();
    method @Deprecated public boolean isLoadInBackgroundCanceled();
    method @Deprecated public abstract D loadInBackground();
    method @Deprecated public void onCanceled(D);
    method @Deprecated protected D onLoadInBackground();
    method @Deprecated public void setUpdateThrottle(long);
  }

  public abstract class BroadcastReceiver {
    ctor public BroadcastReceiver();
    method public final void abortBroadcast();
    method public final void clearAbortBroadcast();
    method public final boolean getAbortBroadcast();
    method public final boolean getDebugUnregister();
    method public final int getResultCode();
    method public final String getResultData();
    method public final android.os.Bundle getResultExtras(boolean);
    method public final android.content.BroadcastReceiver.PendingResult goAsync();
    method public final boolean isInitialStickyBroadcast();
    method public final boolean isOrderedBroadcast();
    method public abstract void onReceive(android.content.Context, android.content.Intent);
    method public android.os.IBinder peekService(android.content.Context, android.content.Intent);
    method public final void setDebugUnregister(boolean);
    method public final void setOrderedHint(boolean);
    method public final void setResult(int, String, android.os.Bundle);
    method public final void setResultCode(int);
    method public final void setResultData(String);
    method public final void setResultExtras(android.os.Bundle);
  }

  public static class BroadcastReceiver.PendingResult {
    method public final void abortBroadcast();
    method public final void clearAbortBroadcast();
    method public final void finish();
    method public final boolean getAbortBroadcast();
    method public final int getResultCode();
    method public final String getResultData();
    method public final android.os.Bundle getResultExtras(boolean);
    method public final void setResult(int, String, android.os.Bundle);
    method public final void setResultCode(int);
    method public final void setResultData(String);
    method public final void setResultExtras(android.os.Bundle);
  }

  public class ClipData implements android.os.Parcelable {
    ctor public ClipData(CharSequence, String[], android.content.ClipData.Item);
    ctor public ClipData(android.content.ClipDescription, android.content.ClipData.Item);
    ctor public ClipData(android.content.ClipData);
    method public void addItem(android.content.ClipData.Item);
    method public void addItem(android.content.ContentResolver, android.content.ClipData.Item);
    method public int describeContents();
    method public android.content.ClipDescription getDescription();
    method public android.content.ClipData.Item getItemAt(int);
    method public int getItemCount();
    method public static android.content.ClipData newHtmlText(CharSequence, CharSequence, String);
    method public static android.content.ClipData newIntent(CharSequence, android.content.Intent);
    method public static android.content.ClipData newPlainText(CharSequence, CharSequence);
    method public static android.content.ClipData newRawUri(CharSequence, android.net.Uri);
    method public static android.content.ClipData newUri(android.content.ContentResolver, CharSequence, android.net.Uri);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.ClipData> CREATOR;
  }

  public static class ClipData.Item {
    ctor public ClipData.Item(CharSequence);
    ctor public ClipData.Item(CharSequence, String);
    ctor public ClipData.Item(android.content.Intent);
    ctor public ClipData.Item(android.net.Uri);
    ctor public ClipData.Item(CharSequence, android.content.Intent, android.net.Uri);
    ctor public ClipData.Item(CharSequence, String, android.content.Intent, android.net.Uri);
    method public String coerceToHtmlText(android.content.Context);
    method public CharSequence coerceToStyledText(android.content.Context);
    method public CharSequence coerceToText(android.content.Context);
    method public String getHtmlText();
    method public android.content.Intent getIntent();
    method public CharSequence getText();
    method public android.net.Uri getUri();
  }

  public class ClipDescription implements android.os.Parcelable {
    ctor public ClipDescription(CharSequence, String[]);
    ctor public ClipDescription(android.content.ClipDescription);
    method public static boolean compareMimeTypes(String, String);
    method public int describeContents();
    method public String[] filterMimeTypes(String);
    method public android.os.PersistableBundle getExtras();
    method public CharSequence getLabel();
    method public String getMimeType(int);
    method public int getMimeTypeCount();
    method public long getTimestamp();
    method public boolean hasMimeType(String);
    method public void setExtras(android.os.PersistableBundle);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.ClipDescription> CREATOR;
    field public static final String MIMETYPE_TEXT_HTML = "text/html";
    field public static final String MIMETYPE_TEXT_INTENT = "text/vnd.android.intent";
    field public static final String MIMETYPE_TEXT_PLAIN = "text/plain";
    field public static final String MIMETYPE_TEXT_URILIST = "text/uri-list";
  }

  public class ClipboardManager extends android.text.ClipboardManager {
    method public void addPrimaryClipChangedListener(android.content.ClipboardManager.OnPrimaryClipChangedListener);
    method public void clearPrimaryClip();
    method @Nullable public android.content.ClipData getPrimaryClip();
    method @Nullable public android.content.ClipDescription getPrimaryClipDescription();
    method @Deprecated public CharSequence getText();
    method public boolean hasPrimaryClip();
    method @Deprecated public boolean hasText();
    method public void removePrimaryClipChangedListener(android.content.ClipboardManager.OnPrimaryClipChangedListener);
    method public void setPrimaryClip(@NonNull android.content.ClipData);
    method @Deprecated public void setText(CharSequence);
  }

  public static interface ClipboardManager.OnPrimaryClipChangedListener {
    method public void onPrimaryClipChanged();
  }

  public interface ComponentCallbacks {
    method public void onConfigurationChanged(android.content.res.Configuration);
    method public void onLowMemory();
  }

  public interface ComponentCallbacks2 extends android.content.ComponentCallbacks {
    method public void onTrimMemory(int);
    field public static final int TRIM_MEMORY_BACKGROUND = 40; // 0x28
    field public static final int TRIM_MEMORY_COMPLETE = 80; // 0x50
    field public static final int TRIM_MEMORY_MODERATE = 60; // 0x3c
    field public static final int TRIM_MEMORY_RUNNING_CRITICAL = 15; // 0xf
    field public static final int TRIM_MEMORY_RUNNING_LOW = 10; // 0xa
    field public static final int TRIM_MEMORY_RUNNING_MODERATE = 5; // 0x5
    field public static final int TRIM_MEMORY_UI_HIDDEN = 20; // 0x14
  }

  public final class ComponentName implements java.lang.Cloneable java.lang.Comparable<android.content.ComponentName> android.os.Parcelable {
    ctor public ComponentName(@NonNull String, @NonNull String);
    ctor public ComponentName(@NonNull android.content.Context, @NonNull String);
    ctor public ComponentName(@NonNull android.content.Context, @NonNull Class<?>);
    ctor public ComponentName(android.os.Parcel);
    method public android.content.ComponentName clone();
    method public int compareTo(android.content.ComponentName);
    method @NonNull public static android.content.ComponentName createRelative(@NonNull String, @NonNull String);
    method @NonNull public static android.content.ComponentName createRelative(@NonNull android.content.Context, @NonNull String);
    method public int describeContents();
    method @NonNull public String flattenToShortString();
    method @NonNull public String flattenToString();
    method @NonNull public String getClassName();
    method @NonNull public String getPackageName();
    method public String getShortClassName();
    method public static android.content.ComponentName readFromParcel(android.os.Parcel);
    method public String toShortString();
    method @Nullable public static android.content.ComponentName unflattenFromString(@NonNull String);
    method public void writeToParcel(android.os.Parcel, int);
    method public static void writeToParcel(android.content.ComponentName, android.os.Parcel);
    field public static final android.os.Parcelable.Creator<android.content.ComponentName> CREATOR;
  }

  public abstract class ContentProvider implements android.content.ComponentCallbacks2 {
    ctor public ContentProvider();
    method @NonNull public android.content.ContentProviderResult[] applyBatch(@NonNull java.util.ArrayList<android.content.ContentProviderOperation>) throws android.content.OperationApplicationException;
    method public void attachInfo(android.content.Context, android.content.pm.ProviderInfo);
    method public int bulkInsert(@NonNull android.net.Uri, @NonNull android.content.ContentValues[]);
    method @Nullable public android.os.Bundle call(@NonNull String, @Nullable String, @Nullable android.os.Bundle);
    method @Nullable public android.net.Uri canonicalize(@NonNull android.net.Uri);
    method public abstract int delete(@NonNull android.net.Uri, @Nullable String, @Nullable String[]);
    method public void dump(java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method @Nullable public final String getCallingPackage();
    method @Nullable public final android.content.Context getContext();
    method @Nullable public final android.content.pm.PathPermission[] getPathPermissions();
    method @Nullable public final String getReadPermission();
    method @Nullable public String[] getStreamTypes(@NonNull android.net.Uri, @NonNull String);
    method @Nullable public abstract String getType(@NonNull android.net.Uri);
    method @Nullable public final String getWritePermission();
    method @Nullable public abstract android.net.Uri insert(@NonNull android.net.Uri, @Nullable android.content.ContentValues);
    method protected boolean isTemporary();
    method public void onConfigurationChanged(android.content.res.Configuration);
    method public abstract boolean onCreate();
    method public void onLowMemory();
    method public void onTrimMemory(int);
    method @Nullable public android.content.res.AssetFileDescriptor openAssetFile(@NonNull android.net.Uri, @NonNull String) throws java.io.FileNotFoundException;
    method @Nullable public android.content.res.AssetFileDescriptor openAssetFile(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method @Nullable public android.os.ParcelFileDescriptor openFile(@NonNull android.net.Uri, @NonNull String) throws java.io.FileNotFoundException;
    method @Nullable public android.os.ParcelFileDescriptor openFile(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method @NonNull protected final android.os.ParcelFileDescriptor openFileHelper(@NonNull android.net.Uri, @NonNull String) throws java.io.FileNotFoundException;
    method @NonNull public <T> android.os.ParcelFileDescriptor openPipeHelper(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.Bundle, @Nullable T, @NonNull android.content.ContentProvider.PipeDataWriter<T>) throws java.io.FileNotFoundException;
    method @Nullable public android.content.res.AssetFileDescriptor openTypedAssetFile(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.Bundle) throws java.io.FileNotFoundException;
    method @Nullable public android.content.res.AssetFileDescriptor openTypedAssetFile(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method @Nullable public abstract android.database.Cursor query(@NonNull android.net.Uri, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String);
    method @Nullable public android.database.Cursor query(@NonNull android.net.Uri, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String, @Nullable android.os.CancellationSignal);
    method @Nullable public android.database.Cursor query(@NonNull android.net.Uri, @Nullable String[], @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal);
    method public boolean refresh(android.net.Uri, @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal);
    method protected final void setPathPermissions(@Nullable android.content.pm.PathPermission[]);
    method protected final void setReadPermission(@Nullable String);
    method protected final void setWritePermission(@Nullable String);
    method public void shutdown();
    method @Nullable public android.net.Uri uncanonicalize(@NonNull android.net.Uri);
    method public abstract int update(@NonNull android.net.Uri, @Nullable android.content.ContentValues, @Nullable String, @Nullable String[]);
  }

  public static interface ContentProvider.PipeDataWriter<T> {
    method public void writeDataToPipe(@NonNull android.os.ParcelFileDescriptor, @NonNull android.net.Uri, @NonNull String, @Nullable android.os.Bundle, @Nullable T);
  }

  public class ContentProviderClient implements java.lang.AutoCloseable {
    method @NonNull public android.content.ContentProviderResult[] applyBatch(@NonNull java.util.ArrayList<android.content.ContentProviderOperation>) throws android.content.OperationApplicationException, android.os.RemoteException;
    method public int bulkInsert(@NonNull android.net.Uri, @NonNull android.content.ContentValues[]) throws android.os.RemoteException;
    method @Nullable public android.os.Bundle call(@NonNull String, @Nullable String, @Nullable android.os.Bundle) throws android.os.RemoteException;
    method @Nullable public final android.net.Uri canonicalize(@NonNull android.net.Uri) throws android.os.RemoteException;
    method public void close();
    method public int delete(@NonNull android.net.Uri, @Nullable String, @Nullable String[]) throws android.os.RemoteException;
    method @Nullable public android.content.ContentProvider getLocalContentProvider();
    method @Nullable public String[] getStreamTypes(@NonNull android.net.Uri, @NonNull String) throws android.os.RemoteException;
    method @Nullable public String getType(@NonNull android.net.Uri) throws android.os.RemoteException;
    method @Nullable public android.net.Uri insert(@NonNull android.net.Uri, @Nullable android.content.ContentValues) throws android.os.RemoteException;
    method @Nullable public android.content.res.AssetFileDescriptor openAssetFile(@NonNull android.net.Uri, @NonNull String) throws java.io.FileNotFoundException, android.os.RemoteException;
    method @Nullable public android.content.res.AssetFileDescriptor openAssetFile(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException, android.os.RemoteException;
    method @Nullable public android.os.ParcelFileDescriptor openFile(@NonNull android.net.Uri, @NonNull String) throws java.io.FileNotFoundException, android.os.RemoteException;
    method @Nullable public android.os.ParcelFileDescriptor openFile(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException, android.os.RemoteException;
    method @Nullable public final android.content.res.AssetFileDescriptor openTypedAssetFileDescriptor(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.Bundle) throws java.io.FileNotFoundException, android.os.RemoteException;
    method @Nullable public final android.content.res.AssetFileDescriptor openTypedAssetFileDescriptor(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException, android.os.RemoteException;
    method @Nullable public android.database.Cursor query(@NonNull android.net.Uri, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String) throws android.os.RemoteException;
    method @Nullable public android.database.Cursor query(@NonNull android.net.Uri, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String, @Nullable android.os.CancellationSignal) throws android.os.RemoteException;
    method @Nullable public android.database.Cursor query(@NonNull android.net.Uri, @Nullable String[], android.os.Bundle, @Nullable android.os.CancellationSignal) throws android.os.RemoteException;
    method public boolean refresh(android.net.Uri, @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal) throws android.os.RemoteException;
    method @Deprecated public boolean release();
    method @Nullable public final android.net.Uri uncanonicalize(@NonNull android.net.Uri) throws android.os.RemoteException;
    method public int update(@NonNull android.net.Uri, @Nullable android.content.ContentValues, @Nullable String, @Nullable String[]) throws android.os.RemoteException;
  }

  public class ContentProviderOperation implements android.os.Parcelable {
    method public android.content.ContentProviderResult apply(android.content.ContentProvider, android.content.ContentProviderResult[], int) throws android.content.OperationApplicationException;
    method public int describeContents();
    method public android.net.Uri getUri();
    method public boolean isAssertQuery();
    method public boolean isDelete();
    method public boolean isInsert();
    method public boolean isReadOperation();
    method public boolean isUpdate();
    method public boolean isWriteOperation();
    method public boolean isYieldAllowed();
    method public static android.content.ContentProviderOperation.Builder newAssertQuery(android.net.Uri);
    method public static android.content.ContentProviderOperation.Builder newDelete(android.net.Uri);
    method public static android.content.ContentProviderOperation.Builder newInsert(android.net.Uri);
    method public static android.content.ContentProviderOperation.Builder newUpdate(android.net.Uri);
    method public String[] resolveSelectionArgsBackReferences(android.content.ContentProviderResult[], int);
    method public android.content.ContentValues resolveValueBackReferences(android.content.ContentProviderResult[], int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.ContentProviderOperation> CREATOR;
  }

  public static class ContentProviderOperation.Builder {
    method public android.content.ContentProviderOperation build();
    method public android.content.ContentProviderOperation.Builder withExpectedCount(int);
    method public android.content.ContentProviderOperation.Builder withSelection(String, String[]);
    method public android.content.ContentProviderOperation.Builder withSelectionBackReference(int, int);
    method public android.content.ContentProviderOperation.Builder withValue(String, Object);
    method public android.content.ContentProviderOperation.Builder withValueBackReference(String, int);
    method public android.content.ContentProviderOperation.Builder withValueBackReferences(android.content.ContentValues);
    method public android.content.ContentProviderOperation.Builder withValues(android.content.ContentValues);
    method public android.content.ContentProviderOperation.Builder withYieldAllowed(boolean);
  }

  public class ContentProviderResult implements android.os.Parcelable {
    ctor public ContentProviderResult(android.net.Uri);
    ctor public ContentProviderResult(int);
    ctor public ContentProviderResult(android.os.Parcel);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.ContentProviderResult> CREATOR;
    field public final Integer count;
    field public final android.net.Uri uri;
  }

  public class ContentQueryMap extends java.util.Observable {
    ctor public ContentQueryMap(android.database.Cursor, String, boolean, android.os.Handler);
    method public void close();
    method public java.util.Map<java.lang.String,android.content.ContentValues> getRows();
    method public android.content.ContentValues getValues(String);
    method public void requery();
    method public void setKeepUpdated(boolean);
  }

  public abstract class ContentResolver {
    ctor public ContentResolver(android.content.Context);
    method @Nullable public final android.content.ContentProviderClient acquireContentProviderClient(@NonNull android.net.Uri);
    method @Nullable public final android.content.ContentProviderClient acquireContentProviderClient(@NonNull String);
    method @Nullable public final android.content.ContentProviderClient acquireUnstableContentProviderClient(@NonNull android.net.Uri);
    method @Nullable public final android.content.ContentProviderClient acquireUnstableContentProviderClient(@NonNull String);
    method public static void addPeriodicSync(android.accounts.Account, String, android.os.Bundle, long);
    method public static Object addStatusChangeListener(int, android.content.SyncStatusObserver);
    method @NonNull public android.content.ContentProviderResult[] applyBatch(@NonNull String, @NonNull java.util.ArrayList<android.content.ContentProviderOperation>) throws android.content.OperationApplicationException, android.os.RemoteException;
    method public final int bulkInsert(@RequiresPermission.Write @NonNull android.net.Uri, @NonNull android.content.ContentValues[]);
    method @Nullable public final android.os.Bundle call(@NonNull android.net.Uri, @NonNull String, @Nullable String, @Nullable android.os.Bundle);
    method @Deprecated public void cancelSync(android.net.Uri);
    method public static void cancelSync(android.accounts.Account, String);
    method public static void cancelSync(android.content.SyncRequest);
    method @Nullable public final android.net.Uri canonicalize(@NonNull android.net.Uri);
    method public final int delete(@RequiresPermission.Write @NonNull android.net.Uri, @Nullable String, @Nullable String[]);
    method @Deprecated public static android.content.SyncInfo getCurrentSync();
    method public static java.util.List<android.content.SyncInfo> getCurrentSyncs();
    method public static int getIsSyncable(android.accounts.Account, String);
    method public static boolean getMasterSyncAutomatically();
    method @NonNull public java.util.List<android.content.UriPermission> getOutgoingPersistedUriPermissions();
    method public static java.util.List<android.content.PeriodicSync> getPeriodicSyncs(android.accounts.Account, String);
    method @NonNull public java.util.List<android.content.UriPermission> getPersistedUriPermissions();
    method @Nullable public String[] getStreamTypes(@NonNull android.net.Uri, @NonNull String);
    method public static android.content.SyncAdapterType[] getSyncAdapterTypes();
    method public static boolean getSyncAutomatically(android.accounts.Account, String);
    method @Nullable public final String getType(@NonNull android.net.Uri);
    method @Nullable public final android.net.Uri insert(@RequiresPermission.Write @NonNull android.net.Uri, @Nullable android.content.ContentValues);
    method public static boolean isSyncActive(android.accounts.Account, String);
    method public static boolean isSyncPending(android.accounts.Account, String);
    method public void notifyChange(@NonNull android.net.Uri, @Nullable android.database.ContentObserver);
    method public void notifyChange(@NonNull android.net.Uri, @Nullable android.database.ContentObserver, boolean);
    method public void notifyChange(@NonNull android.net.Uri, @Nullable android.database.ContentObserver, int);
    method @Nullable public final android.content.res.AssetFileDescriptor openAssetFileDescriptor(@NonNull android.net.Uri, @NonNull String) throws java.io.FileNotFoundException;
    method @Nullable public final android.content.res.AssetFileDescriptor openAssetFileDescriptor(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method @Nullable public final android.os.ParcelFileDescriptor openFileDescriptor(@NonNull android.net.Uri, @NonNull String) throws java.io.FileNotFoundException;
    method @Nullable public final android.os.ParcelFileDescriptor openFileDescriptor(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method @Nullable public final java.io.InputStream openInputStream(@NonNull android.net.Uri) throws java.io.FileNotFoundException;
    method @Nullable public final java.io.OutputStream openOutputStream(@NonNull android.net.Uri) throws java.io.FileNotFoundException;
    method @Nullable public final java.io.OutputStream openOutputStream(@NonNull android.net.Uri, @NonNull String) throws java.io.FileNotFoundException;
    method @Nullable public final android.content.res.AssetFileDescriptor openTypedAssetFileDescriptor(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.Bundle) throws java.io.FileNotFoundException;
    method @Nullable public final android.content.res.AssetFileDescriptor openTypedAssetFileDescriptor(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method @Nullable public final android.database.Cursor query(@RequiresPermission.Read @NonNull android.net.Uri, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String);
    method @Nullable public final android.database.Cursor query(@RequiresPermission.Read @NonNull android.net.Uri, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String, @Nullable android.os.CancellationSignal);
    method @Nullable public final android.database.Cursor query(@RequiresPermission.Read @NonNull android.net.Uri, @Nullable String[], @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal);
    method public final boolean refresh(@NonNull android.net.Uri, @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal);
    method public final void registerContentObserver(@NonNull android.net.Uri, boolean, @NonNull android.database.ContentObserver);
    method public void releasePersistableUriPermission(@NonNull android.net.Uri, int);
    method public static void removePeriodicSync(android.accounts.Account, String, android.os.Bundle);
    method public static void removeStatusChangeListener(Object);
    method public static void requestSync(android.accounts.Account, String, android.os.Bundle);
    method public static void requestSync(android.content.SyncRequest);
    method public static void setIsSyncable(android.accounts.Account, String, int);
    method public static void setMasterSyncAutomatically(boolean);
    method public static void setSyncAutomatically(android.accounts.Account, String, boolean);
    method @Deprecated public void startSync(android.net.Uri, android.os.Bundle);
    method public void takePersistableUriPermission(@NonNull android.net.Uri, int);
    method @Nullable public final android.net.Uri uncanonicalize(@NonNull android.net.Uri);
    method public final void unregisterContentObserver(@NonNull android.database.ContentObserver);
    method public final int update(@RequiresPermission.Write @NonNull android.net.Uri, @Nullable android.content.ContentValues, @Nullable String, @Nullable String[]);
    method public static void validateSyncExtrasBundle(android.os.Bundle);
    field public static final String ANY_CURSOR_ITEM_TYPE = "vnd.android.cursor.item/*";
    field public static final String CURSOR_DIR_BASE_TYPE = "vnd.android.cursor.dir";
    field public static final String CURSOR_ITEM_BASE_TYPE = "vnd.android.cursor.item";
    field public static final String EXTRA_HONORED_ARGS = "android.content.extra.HONORED_ARGS";
    field public static final String EXTRA_REFRESH_SUPPORTED = "android.content.extra.REFRESH_SUPPORTED";
    field public static final String EXTRA_SIZE = "android.content.extra.SIZE";
    field public static final String EXTRA_TOTAL_COUNT = "android.content.extra.TOTAL_COUNT";
    field public static final int NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS = 2; // 0x2
    field public static final int NOTIFY_SYNC_TO_NETWORK = 1; // 0x1
    field public static final String QUERY_ARG_LIMIT = "android:query-arg-limit";
    field public static final String QUERY_ARG_OFFSET = "android:query-arg-offset";
    field public static final String QUERY_ARG_SORT_COLLATION = "android:query-arg-sort-collation";
    field public static final String QUERY_ARG_SORT_COLUMNS = "android:query-arg-sort-columns";
    field public static final String QUERY_ARG_SORT_DIRECTION = "android:query-arg-sort-direction";
    field public static final String QUERY_ARG_SQL_SELECTION = "android:query-arg-sql-selection";
    field public static final String QUERY_ARG_SQL_SELECTION_ARGS = "android:query-arg-sql-selection-args";
    field public static final String QUERY_ARG_SQL_SORT_ORDER = "android:query-arg-sql-sort-order";
    field public static final int QUERY_SORT_DIRECTION_ASCENDING = 0; // 0x0
    field public static final int QUERY_SORT_DIRECTION_DESCENDING = 1; // 0x1
    field public static final String SCHEME_ANDROID_RESOURCE = "android.resource";
    field public static final String SCHEME_CONTENT = "content";
    field public static final String SCHEME_FILE = "file";
    field @Deprecated public static final String SYNC_EXTRAS_ACCOUNT = "account";
    field public static final String SYNC_EXTRAS_DISCARD_LOCAL_DELETIONS = "discard_deletions";
    field public static final String SYNC_EXTRAS_DO_NOT_RETRY = "do_not_retry";
    field public static final String SYNC_EXTRAS_EXPEDITED = "expedited";
    field @Deprecated public static final String SYNC_EXTRAS_FORCE = "force";
    field public static final String SYNC_EXTRAS_IGNORE_BACKOFF = "ignore_backoff";
    field public static final String SYNC_EXTRAS_IGNORE_SETTINGS = "ignore_settings";
    field public static final String SYNC_EXTRAS_INITIALIZE = "initialize";
    field public static final String SYNC_EXTRAS_MANUAL = "force";
    field public static final String SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS = "deletions_override";
    field public static final String SYNC_EXTRAS_REQUIRE_CHARGING = "require_charging";
    field public static final String SYNC_EXTRAS_UPLOAD = "upload";
    field public static final int SYNC_OBSERVER_TYPE_ACTIVE = 4; // 0x4
    field public static final int SYNC_OBSERVER_TYPE_PENDING = 2; // 0x2
    field public static final int SYNC_OBSERVER_TYPE_SETTINGS = 1; // 0x1
  }

  public class ContentUris {
    ctor public ContentUris();
    method public static android.net.Uri.Builder appendId(android.net.Uri.Builder, long);
    method public static long parseId(android.net.Uri);
    method public static android.net.Uri withAppendedId(android.net.Uri, long);
  }

  public final class ContentValues implements android.os.Parcelable {
    ctor public ContentValues();
    ctor public ContentValues(int);
    ctor public ContentValues(android.content.ContentValues);
    method public void clear();
    method public boolean containsKey(String);
    method public int describeContents();
    method public Object get(String);
    method public Boolean getAsBoolean(String);
    method public Byte getAsByte(String);
    method public byte[] getAsByteArray(String);
    method public Double getAsDouble(String);
    method public Float getAsFloat(String);
    method public Integer getAsInteger(String);
    method public Long getAsLong(String);
    method public Short getAsShort(String);
    method public String getAsString(String);
    method public java.util.Set<java.lang.String> keySet();
    method public void put(String, String);
    method public void put(String, Byte);
    method public void put(String, Short);
    method public void put(String, Integer);
    method public void put(String, Long);
    method public void put(String, Float);
    method public void put(String, Double);
    method public void put(String, Boolean);
    method public void put(String, byte[]);
    method public void putAll(android.content.ContentValues);
    method public void putNull(String);
    method public void remove(String);
    method public int size();
    method public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> valueSet();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.ContentValues> CREATOR;
    field public static final String TAG = "ContentValues";
  }

  public abstract class Context {
    ctor public Context();
    method public abstract boolean bindService(@RequiresPermission android.content.Intent, @NonNull android.content.ServiceConnection, int);
    method @CheckResult(suggest="#enforceCallingOrSelfPermission(String,String)") public abstract int checkCallingOrSelfPermission(@NonNull String);
    method @CheckResult(suggest="#enforceCallingOrSelfUriPermission(Uri,int,String)") public abstract int checkCallingOrSelfUriPermission(android.net.Uri, int);
    method @CheckResult(suggest="#enforceCallingPermission(String,String)") public abstract int checkCallingPermission(@NonNull String);
    method @CheckResult(suggest="#enforceCallingUriPermission(Uri,int,String)") public abstract int checkCallingUriPermission(android.net.Uri, int);
    method @CheckResult(suggest="#enforcePermission(String,int,int,String)") public abstract int checkPermission(@NonNull String, int, int);
    method public abstract int checkSelfPermission(@NonNull String);
    method @CheckResult(suggest="#enforceUriPermission(Uri,int,int,String)") public abstract int checkUriPermission(android.net.Uri, int, int, int);
    method @CheckResult(suggest="#enforceUriPermission(Uri,String,String,int,int,int,String)") public abstract int checkUriPermission(@Nullable android.net.Uri, @Nullable String, @Nullable String, int, int, int);
    method @Deprecated public abstract void clearWallpaper() throws java.io.IOException;
    method public abstract android.content.Context createConfigurationContext(@NonNull android.content.res.Configuration);
    method public abstract android.content.Context createContextForSplit(String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.Context createDeviceProtectedStorageContext();
    method public abstract android.content.Context createDisplayContext(@NonNull android.view.Display);
    method public abstract android.content.Context createPackageContext(String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract String[] databaseList();
    method public abstract boolean deleteDatabase(String);
    method public abstract boolean deleteFile(String);
    method public abstract boolean deleteSharedPreferences(String);
    method public abstract void enforceCallingOrSelfPermission(@NonNull String, @Nullable String);
    method public abstract void enforceCallingOrSelfUriPermission(android.net.Uri, int, String);
    method public abstract void enforceCallingPermission(@NonNull String, @Nullable String);
    method public abstract void enforceCallingUriPermission(android.net.Uri, int, String);
    method public abstract void enforcePermission(@NonNull String, int, int, @Nullable String);
    method public abstract void enforceUriPermission(android.net.Uri, int, int, int, String);
    method public abstract void enforceUriPermission(@Nullable android.net.Uri, @Nullable String, @Nullable String, int, int, int, @Nullable String);
    method public abstract String[] fileList();
    method public abstract android.content.Context getApplicationContext();
    method public abstract android.content.pm.ApplicationInfo getApplicationInfo();
    method public abstract android.content.res.AssetManager getAssets();
    method public abstract java.io.File getCacheDir();
    method public abstract ClassLoader getClassLoader();
    method public abstract java.io.File getCodeCacheDir();
    method @ColorInt public final int getColor(@ColorRes int);
    method @NonNull public final android.content.res.ColorStateList getColorStateList(@ColorRes int);
    method public abstract android.content.ContentResolver getContentResolver();
    method public abstract java.io.File getDataDir();
    method public abstract java.io.File getDatabasePath(String);
    method public abstract java.io.File getDir(String, int);
    method @Nullable public final android.graphics.drawable.Drawable getDrawable(@DrawableRes int);
    method @Nullable public abstract java.io.File getExternalCacheDir();
    method public abstract java.io.File[] getExternalCacheDirs();
    method @Nullable public abstract java.io.File getExternalFilesDir(@Nullable String);
    method public abstract java.io.File[] getExternalFilesDirs(String);
    method public abstract java.io.File[] getExternalMediaDirs();
    method public abstract java.io.File getFileStreamPath(String);
    method public abstract java.io.File getFilesDir();
    method public java.util.concurrent.Executor getMainExecutor();
    method public abstract android.os.Looper getMainLooper();
    method public abstract java.io.File getNoBackupFilesDir();
    method public abstract java.io.File getObbDir();
    method public abstract java.io.File[] getObbDirs();
    method public abstract String getPackageCodePath();
    method public abstract android.content.pm.PackageManager getPackageManager();
    method public abstract String getPackageName();
    method public abstract String getPackageResourcePath();
    method public abstract android.content.res.Resources getResources();
    method public abstract android.content.SharedPreferences getSharedPreferences(String, int);
    method @NonNull public final String getString(@StringRes int);
    method @NonNull public final String getString(@StringRes int, java.lang.Object...);
    method public abstract Object getSystemService(@NonNull String);
    method public final <T> T getSystemService(@NonNull Class<T>);
    method @Nullable public abstract String getSystemServiceName(@NonNull Class<?>);
    method @NonNull public final CharSequence getText(@StringRes int);
    method @android.view.ViewDebug.ExportedProperty(deepExport=true) public abstract android.content.res.Resources.Theme getTheme();
    method @Deprecated public abstract android.graphics.drawable.Drawable getWallpaper();
    method @Deprecated public abstract int getWallpaperDesiredMinimumHeight();
    method @Deprecated public abstract int getWallpaperDesiredMinimumWidth();
    method public abstract void grantUriPermission(String, android.net.Uri, int);
    method public abstract boolean isDeviceProtectedStorage();
    method public boolean isRestricted();
    method public abstract boolean moveDatabaseFrom(android.content.Context, String);
    method public abstract boolean moveSharedPreferencesFrom(android.content.Context, String);
    method public final android.content.res.TypedArray obtainStyledAttributes(@StyleableRes int[]);
    method public final android.content.res.TypedArray obtainStyledAttributes(@StyleRes int, @StyleableRes int[]) throws android.content.res.Resources.NotFoundException;
    method public final android.content.res.TypedArray obtainStyledAttributes(android.util.AttributeSet, @StyleableRes int[]);
    method public final android.content.res.TypedArray obtainStyledAttributes(android.util.AttributeSet, @StyleableRes int[], @AttrRes int, @StyleRes int);
    method public abstract java.io.FileInputStream openFileInput(String) throws java.io.FileNotFoundException;
    method public abstract java.io.FileOutputStream openFileOutput(String, int) throws java.io.FileNotFoundException;
    method public abstract android.database.sqlite.SQLiteDatabase openOrCreateDatabase(String, int, android.database.sqlite.SQLiteDatabase.CursorFactory);
    method public abstract android.database.sqlite.SQLiteDatabase openOrCreateDatabase(String, int, android.database.sqlite.SQLiteDatabase.CursorFactory, @Nullable android.database.DatabaseErrorHandler);
    method @Deprecated public abstract android.graphics.drawable.Drawable peekWallpaper();
    method public void registerComponentCallbacks(android.content.ComponentCallbacks);
    method @Nullable public abstract android.content.Intent registerReceiver(@Nullable android.content.BroadcastReceiver, android.content.IntentFilter);
    method @Nullable public abstract android.content.Intent registerReceiver(@Nullable android.content.BroadcastReceiver, android.content.IntentFilter, int);
    method @Nullable public abstract android.content.Intent registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, @Nullable String, @Nullable android.os.Handler);
    method @Nullable public abstract android.content.Intent registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, @Nullable String, @Nullable android.os.Handler, int);
    method @Deprecated @RequiresPermission(android.Manifest.permission.BROADCAST_STICKY) public abstract void removeStickyBroadcast(@RequiresPermission android.content.Intent);
    method @Deprecated @RequiresPermission(allOf={"android.permission.INTERACT_ACROSS_USERS", android.Manifest.permission.BROADCAST_STICKY}) public abstract void removeStickyBroadcastAsUser(@RequiresPermission android.content.Intent, android.os.UserHandle);
    method public abstract void revokeUriPermission(android.net.Uri, int);
    method public abstract void revokeUriPermission(String, android.net.Uri, int);
    method public abstract void sendBroadcast(@RequiresPermission android.content.Intent);
    method public abstract void sendBroadcast(@RequiresPermission android.content.Intent, @Nullable String);
    method @RequiresPermission("android.permission.INTERACT_ACROSS_USERS") public abstract void sendBroadcastAsUser(@RequiresPermission android.content.Intent, android.os.UserHandle);
    method @RequiresPermission("android.permission.INTERACT_ACROSS_USERS") public abstract void sendBroadcastAsUser(@RequiresPermission android.content.Intent, android.os.UserHandle, @Nullable String);
    method public abstract void sendOrderedBroadcast(@RequiresPermission android.content.Intent, @Nullable String);
    method public abstract void sendOrderedBroadcast(@RequiresPermission @NonNull android.content.Intent, @Nullable String, @Nullable android.content.BroadcastReceiver, @Nullable android.os.Handler, int, @Nullable String, @Nullable android.os.Bundle);
    method @RequiresPermission("android.permission.INTERACT_ACROSS_USERS") public abstract void sendOrderedBroadcastAsUser(@RequiresPermission android.content.Intent, android.os.UserHandle, @Nullable String, android.content.BroadcastReceiver, @Nullable android.os.Handler, int, @Nullable String, @Nullable android.os.Bundle);
    method @Deprecated @RequiresPermission(android.Manifest.permission.BROADCAST_STICKY) public abstract void sendStickyBroadcast(@RequiresPermission android.content.Intent);
    method @Deprecated @RequiresPermission(allOf={"android.permission.INTERACT_ACROSS_USERS", android.Manifest.permission.BROADCAST_STICKY}) public abstract void sendStickyBroadcastAsUser(@RequiresPermission android.content.Intent, android.os.UserHandle);
    method @Deprecated @RequiresPermission(android.Manifest.permission.BROADCAST_STICKY) public abstract void sendStickyOrderedBroadcast(@RequiresPermission android.content.Intent, android.content.BroadcastReceiver, @Nullable android.os.Handler, int, @Nullable String, @Nullable android.os.Bundle);
    method @Deprecated @RequiresPermission(allOf={"android.permission.INTERACT_ACROSS_USERS", android.Manifest.permission.BROADCAST_STICKY}) public abstract void sendStickyOrderedBroadcastAsUser(@RequiresPermission android.content.Intent, android.os.UserHandle, android.content.BroadcastReceiver, @Nullable android.os.Handler, int, @Nullable String, @Nullable android.os.Bundle);
    method public abstract void setTheme(@StyleRes int);
    method @Deprecated public abstract void setWallpaper(android.graphics.Bitmap) throws java.io.IOException;
    method @Deprecated public abstract void setWallpaper(java.io.InputStream) throws java.io.IOException;
    method public abstract void startActivities(@RequiresPermission android.content.Intent[]);
    method public abstract void startActivities(@RequiresPermission android.content.Intent[], android.os.Bundle);
    method public abstract void startActivity(@RequiresPermission android.content.Intent);
    method public abstract void startActivity(@RequiresPermission android.content.Intent, @Nullable android.os.Bundle);
    method @Nullable public abstract android.content.ComponentName startForegroundService(android.content.Intent);
    method public abstract boolean startInstrumentation(@NonNull android.content.ComponentName, @Nullable String, @Nullable android.os.Bundle);
    method public abstract void startIntentSender(android.content.IntentSender, @Nullable android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException;
    method public abstract void startIntentSender(android.content.IntentSender, @Nullable android.content.Intent, int, int, int, @Nullable android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method @Nullable public abstract android.content.ComponentName startService(android.content.Intent);
    method public abstract boolean stopService(android.content.Intent);
    method public abstract void unbindService(@NonNull android.content.ServiceConnection);
    method public void unregisterComponentCallbacks(android.content.ComponentCallbacks);
    method public abstract void unregisterReceiver(android.content.BroadcastReceiver);
    field public static final String ACCESSIBILITY_SERVICE = "accessibility";
    field public static final String ACCOUNT_SERVICE = "account";
    field public static final String ACTIVITY_SERVICE = "activity";
    field public static final String ALARM_SERVICE = "alarm";
    field public static final String APPWIDGET_SERVICE = "appwidget";
    field public static final String APP_OPS_SERVICE = "appops";
    field public static final String AUDIO_SERVICE = "audio";
    field public static final String BATTERY_SERVICE = "batterymanager";
    field public static final int BIND_ABOVE_CLIENT = 8; // 0x8
    field public static final int BIND_ADJUST_WITH_ACTIVITY = 128; // 0x80
    field public static final int BIND_ALLOW_OOM_MANAGEMENT = 16; // 0x10
    field public static final int BIND_AUTO_CREATE = 1; // 0x1
    field public static final int BIND_DEBUG_UNBIND = 2; // 0x2
    field public static final int BIND_EXTERNAL_SERVICE = -2147483648; // 0x80000000
    field public static final int BIND_IMPORTANT = 64; // 0x40
    field public static final int BIND_NOT_FOREGROUND = 4; // 0x4
    field public static final int BIND_WAIVE_PRIORITY = 32; // 0x20
    field public static final String BLUETOOTH_SERVICE = "bluetooth";
    field public static final String CAMERA_SERVICE = "camera";
    field public static final String CAPTIONING_SERVICE = "captioning";
    field public static final String CARRIER_CONFIG_SERVICE = "carrier_config";
    field public static final String CLIPBOARD_SERVICE = "clipboard";
    field public static final String COMPANION_DEVICE_SERVICE = "companiondevice";
    field public static final String CONNECTIVITY_SERVICE = "connectivity";
    field public static final String CONSUMER_IR_SERVICE = "consumer_ir";
    field public static final int CONTEXT_IGNORE_SECURITY = 2; // 0x2
    field public static final int CONTEXT_INCLUDE_CODE = 1; // 0x1
    field public static final int CONTEXT_RESTRICTED = 4; // 0x4
    field public static final String CROSS_PROFILE_APPS_SERVICE = "crossprofileapps";
    field public static final String DEVICE_POLICY_SERVICE = "device_policy";
    field public static final String DISPLAY_SERVICE = "display";
    field public static final String DOWNLOAD_SERVICE = "download";
    field public static final String DROPBOX_SERVICE = "dropbox";
    field public static final String EUICC_SERVICE = "euicc";
    field public static final String FINGERPRINT_SERVICE = "fingerprint";
    field public static final String HARDWARE_PROPERTIES_SERVICE = "hardware_properties";
    field public static final String INPUT_METHOD_SERVICE = "input_method";
    field public static final String INPUT_SERVICE = "input";
    field public static final String IPSEC_SERVICE = "ipsec";
    field public static final String JOB_SCHEDULER_SERVICE = "jobscheduler";
    field public static final String KEYGUARD_SERVICE = "keyguard";
    field public static final String LAUNCHER_APPS_SERVICE = "launcherapps";
    field public static final String LAYOUT_INFLATER_SERVICE = "layout_inflater";
    field public static final String LOCATION_SERVICE = "location";
    field public static final String MEDIA_PROJECTION_SERVICE = "media_projection";
    field public static final String MEDIA_ROUTER_SERVICE = "media_router";
    field public static final String MEDIA_SESSION_SERVICE = "media_session";
    field public static final String MIDI_SERVICE = "midi";
    field public static final int MODE_APPEND = 32768; // 0x8000
    field public static final int MODE_ENABLE_WRITE_AHEAD_LOGGING = 8; // 0x8
    field @Deprecated public static final int MODE_MULTI_PROCESS = 4; // 0x4
    field public static final int MODE_NO_LOCALIZED_COLLATORS = 16; // 0x10
    field public static final int MODE_PRIVATE = 0; // 0x0
    field @Deprecated public static final int MODE_WORLD_READABLE = 1; // 0x1
    field @Deprecated public static final int MODE_WORLD_WRITEABLE = 2; // 0x2
    field public static final String NETWORK_STATS_SERVICE = "netstats";
    field public static final String NFC_SERVICE = "nfc";
    field public static final String NOTIFICATION_SERVICE = "notification";
    field public static final String NSD_SERVICE = "servicediscovery";
    field public static final String POWER_SERVICE = "power";
    field public static final String PRINT_SERVICE = "print";
    field public static final int RECEIVER_VISIBLE_TO_INSTANT_APPS = 1; // 0x1
    field public static final String RESTRICTIONS_SERVICE = "restrictions";
    field public static final String SEARCH_SERVICE = "search";
    field public static final String SENSOR_SERVICE = "sensor";
    field public static final String SHORTCUT_SERVICE = "shortcut";
    field public static final String STORAGE_SERVICE = "storage";
    field public static final String STORAGE_STATS_SERVICE = "storagestats";
    field public static final String SYSTEM_HEALTH_SERVICE = "systemhealth";
    field public static final String TELECOM_SERVICE = "telecom";
    field public static final String TELEPHONY_SERVICE = "phone";
    field public static final String TELEPHONY_SUBSCRIPTION_SERVICE = "telephony_subscription_service";
    field public static final String TEXT_CLASSIFICATION_SERVICE = "textclassification";
    field public static final String TEXT_SERVICES_MANAGER_SERVICE = "textservices";
    field public static final String TV_INPUT_SERVICE = "tv_input";
    field public static final String UI_MODE_SERVICE = "uimode";
    field public static final String USAGE_STATS_SERVICE = "usagestats";
    field public static final String USB_SERVICE = "usb";
    field public static final String USER_SERVICE = "user";
    field public static final String VIBRATOR_SERVICE = "vibrator";
    field public static final String WALLPAPER_SERVICE = "wallpaper";
    field public static final String WIFI_AWARE_SERVICE = "wifiaware";
    field public static final String WIFI_P2P_SERVICE = "wifip2p";
    field public static final String WIFI_RTT_RANGING_SERVICE = "wifirtt";
    field public static final String WIFI_SERVICE = "wifi";
    field public static final String WINDOW_SERVICE = "window";
  }

  public class ContextWrapper extends android.content.Context {
    ctor public ContextWrapper(android.content.Context);
    method protected void attachBaseContext(android.content.Context);
    method public boolean bindService(android.content.Intent, android.content.ServiceConnection, int);
    method public int checkCallingOrSelfPermission(String);
    method public int checkCallingOrSelfUriPermission(android.net.Uri, int);
    method public int checkCallingPermission(String);
    method public int checkCallingUriPermission(android.net.Uri, int);
    method public int checkPermission(String, int, int);
    method public int checkSelfPermission(String);
    method public int checkUriPermission(android.net.Uri, int, int, int);
    method public int checkUriPermission(android.net.Uri, String, String, int, int, int);
    method @Deprecated public void clearWallpaper() throws java.io.IOException;
    method public android.content.Context createConfigurationContext(android.content.res.Configuration);
    method public android.content.Context createContextForSplit(String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.Context createDeviceProtectedStorageContext();
    method public android.content.Context createDisplayContext(android.view.Display);
    method public android.content.Context createPackageContext(String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public String[] databaseList();
    method public boolean deleteDatabase(String);
    method public boolean deleteFile(String);
    method public boolean deleteSharedPreferences(String);
    method public void enforceCallingOrSelfPermission(String, String);
    method public void enforceCallingOrSelfUriPermission(android.net.Uri, int, String);
    method public void enforceCallingPermission(String, String);
    method public void enforceCallingUriPermission(android.net.Uri, int, String);
    method public void enforcePermission(String, int, int, String);
    method public void enforceUriPermission(android.net.Uri, int, int, int, String);
    method public void enforceUriPermission(android.net.Uri, String, String, int, int, int, String);
    method public String[] fileList();
    method public android.content.Context getApplicationContext();
    method public android.content.pm.ApplicationInfo getApplicationInfo();
    method public android.content.res.AssetManager getAssets();
    method public android.content.Context getBaseContext();
    method public java.io.File getCacheDir();
    method public ClassLoader getClassLoader();
    method public java.io.File getCodeCacheDir();
    method public android.content.ContentResolver getContentResolver();
    method public java.io.File getDataDir();
    method public java.io.File getDatabasePath(String);
    method public java.io.File getDir(String, int);
    method public java.io.File getExternalCacheDir();
    method public java.io.File[] getExternalCacheDirs();
    method public java.io.File getExternalFilesDir(String);
    method public java.io.File[] getExternalFilesDirs(String);
    method public java.io.File[] getExternalMediaDirs();
    method public java.io.File getFileStreamPath(String);
    method public java.io.File getFilesDir();
    method public android.os.Looper getMainLooper();
    method public java.io.File getNoBackupFilesDir();
    method public java.io.File getObbDir();
    method public java.io.File[] getObbDirs();
    method public String getPackageCodePath();
    method public android.content.pm.PackageManager getPackageManager();
    method public String getPackageName();
    method public String getPackageResourcePath();
    method public android.content.res.Resources getResources();
    method public android.content.SharedPreferences getSharedPreferences(String, int);
    method public Object getSystemService(String);
    method public String getSystemServiceName(Class<?>);
    method public android.content.res.Resources.Theme getTheme();
    method @Deprecated public android.graphics.drawable.Drawable getWallpaper();
    method @Deprecated public int getWallpaperDesiredMinimumHeight();
    method @Deprecated public int getWallpaperDesiredMinimumWidth();
    method public void grantUriPermission(String, android.net.Uri, int);
    method public boolean isDeviceProtectedStorage();
    method public boolean moveDatabaseFrom(android.content.Context, String);
    method public boolean moveSharedPreferencesFrom(android.content.Context, String);
    method public java.io.FileInputStream openFileInput(String) throws java.io.FileNotFoundException;
    method public java.io.FileOutputStream openFileOutput(String, int) throws java.io.FileNotFoundException;
    method public android.database.sqlite.SQLiteDatabase openOrCreateDatabase(String, int, android.database.sqlite.SQLiteDatabase.CursorFactory);
    method public android.database.sqlite.SQLiteDatabase openOrCreateDatabase(String, int, android.database.sqlite.SQLiteDatabase.CursorFactory, android.database.DatabaseErrorHandler);
    method @Deprecated public android.graphics.drawable.Drawable peekWallpaper();
    method public android.content.Intent registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter);
    method public android.content.Intent registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, int);
    method public android.content.Intent registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, String, android.os.Handler);
    method public android.content.Intent registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, String, android.os.Handler, int);
    method @Deprecated public void removeStickyBroadcast(android.content.Intent);
    method @Deprecated public void removeStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle);
    method public void revokeUriPermission(android.net.Uri, int);
    method public void revokeUriPermission(String, android.net.Uri, int);
    method public void sendBroadcast(android.content.Intent);
    method public void sendBroadcast(android.content.Intent, String);
    method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle);
    method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, String);
    method public void sendOrderedBroadcast(android.content.Intent, String);
    method public void sendOrderedBroadcast(android.content.Intent, String, android.content.BroadcastReceiver, android.os.Handler, int, String, android.os.Bundle);
    method public void sendOrderedBroadcastAsUser(android.content.Intent, android.os.UserHandle, String, android.content.BroadcastReceiver, android.os.Handler, int, String, android.os.Bundle);
    method @Deprecated public void sendStickyBroadcast(android.content.Intent);
    method @Deprecated public void sendStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle);
    method @Deprecated public void sendStickyOrderedBroadcast(android.content.Intent, android.content.BroadcastReceiver, android.os.Handler, int, String, android.os.Bundle);
    method @Deprecated public void sendStickyOrderedBroadcastAsUser(android.content.Intent, android.os.UserHandle, android.content.BroadcastReceiver, android.os.Handler, int, String, android.os.Bundle);
    method public void setTheme(int);
    method @Deprecated public void setWallpaper(android.graphics.Bitmap) throws java.io.IOException;
    method @Deprecated public void setWallpaper(java.io.InputStream) throws java.io.IOException;
    method public void startActivities(android.content.Intent[]);
    method public void startActivities(android.content.Intent[], android.os.Bundle);
    method public void startActivity(android.content.Intent);
    method public void startActivity(android.content.Intent, android.os.Bundle);
    method public android.content.ComponentName startForegroundService(android.content.Intent);
    method public boolean startInstrumentation(android.content.ComponentName, String, android.os.Bundle);
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method public android.content.ComponentName startService(android.content.Intent);
    method public boolean stopService(android.content.Intent);
    method public void unbindService(android.content.ServiceConnection);
    method public void unregisterReceiver(android.content.BroadcastReceiver);
  }

  @Deprecated public class CursorLoader extends android.content.AsyncTaskLoader<android.database.Cursor> {
    ctor @Deprecated public CursorLoader(android.content.Context);
    ctor @Deprecated public CursorLoader(android.content.Context, android.net.Uri, String[], String, String[], String);
    method @Deprecated public void deliverResult(android.database.Cursor);
    method @Deprecated public String[] getProjection();
    method @Deprecated public String getSelection();
    method @Deprecated public String[] getSelectionArgs();
    method @Deprecated public String getSortOrder();
    method @Deprecated public android.net.Uri getUri();
    method @Deprecated public android.database.Cursor loadInBackground();
    method @Deprecated public void onCanceled(android.database.Cursor);
    method @Deprecated public void setProjection(String[]);
    method @Deprecated public void setSelection(String);
    method @Deprecated public void setSelectionArgs(String[]);
    method @Deprecated public void setSortOrder(String);
    method @Deprecated public void setUri(android.net.Uri);
  }

  public interface DialogInterface {
    method public void cancel();
    method public void dismiss();
    field @Deprecated public static final int BUTTON1 = -1; // 0xffffffff
    field @Deprecated public static final int BUTTON2 = -2; // 0xfffffffe
    field @Deprecated public static final int BUTTON3 = -3; // 0xfffffffd
    field public static final int BUTTON_NEGATIVE = -2; // 0xfffffffe
    field public static final int BUTTON_NEUTRAL = -3; // 0xfffffffd
    field public static final int BUTTON_POSITIVE = -1; // 0xffffffff
  }

  public static interface DialogInterface.OnCancelListener {
    method public void onCancel(android.content.DialogInterface);
  }

  public static interface DialogInterface.OnClickListener {
    method public void onClick(android.content.DialogInterface, int);
  }

  public static interface DialogInterface.OnDismissListener {
    method public void onDismiss(android.content.DialogInterface);
  }

  public static interface DialogInterface.OnKeyListener {
    method public boolean onKey(android.content.DialogInterface, int, android.view.KeyEvent);
  }

  public static interface DialogInterface.OnMultiChoiceClickListener {
    method public void onClick(android.content.DialogInterface, int, boolean);
  }

  public static interface DialogInterface.OnShowListener {
    method public void onShow(android.content.DialogInterface);
  }

  public final class Entity {
    ctor public Entity(android.content.ContentValues);
    method public void addSubValue(android.net.Uri, android.content.ContentValues);
    method public android.content.ContentValues getEntityValues();
    method public java.util.ArrayList<android.content.Entity.NamedContentValues> getSubValues();
  }

  public static class Entity.NamedContentValues {
    ctor public Entity.NamedContentValues(android.net.Uri, android.content.ContentValues);
    field public final android.net.Uri uri;
    field public final android.content.ContentValues values;
  }

  public interface EntityIterator extends java.util.Iterator<android.content.Entity> {
    method public void close();
    method public void reset();
  }

  public class Intent implements java.lang.Cloneable android.os.Parcelable {
    ctor public Intent();
    ctor public Intent(android.content.Intent);
    ctor public Intent(String);
    ctor public Intent(String, android.net.Uri);
    ctor public Intent(android.content.Context, Class<?>);
    ctor public Intent(String, android.net.Uri, android.content.Context, Class<?>);
    method @NonNull public android.content.Intent addCategory(String);
    method @NonNull public android.content.Intent addFlags(int);
    method public Object clone();
    method @NonNull public android.content.Intent cloneFilter();
    method public static android.content.Intent createChooser(android.content.Intent, CharSequence);
    method public static android.content.Intent createChooser(android.content.Intent, CharSequence, android.content.IntentSender);
    method public int describeContents();
    method public int fillIn(@NonNull android.content.Intent, int);
    method public boolean filterEquals(android.content.Intent);
    method public int filterHashCode();
    method @Nullable public String getAction();
    method public boolean[] getBooleanArrayExtra(String);
    method public boolean getBooleanExtra(String, boolean);
    method public android.os.Bundle getBundleExtra(String);
    method public byte[] getByteArrayExtra(String);
    method public byte getByteExtra(String, byte);
    method public java.util.Set<java.lang.String> getCategories();
    method public char[] getCharArrayExtra(String);
    method public char getCharExtra(String, char);
    method public CharSequence[] getCharSequenceArrayExtra(String);
    method public java.util.ArrayList<java.lang.CharSequence> getCharSequenceArrayListExtra(String);
    method public CharSequence getCharSequenceExtra(String);
    method @Nullable public android.content.ClipData getClipData();
    method @Nullable public android.content.ComponentName getComponent();
    method @Nullable public android.net.Uri getData();
    method @Nullable public String getDataString();
    method public double[] getDoubleArrayExtra(String);
    method public double getDoubleExtra(String, double);
    method @Nullable public android.os.Bundle getExtras();
    method public int getFlags();
    method public float[] getFloatArrayExtra(String);
    method public float getFloatExtra(String, float);
    method public int[] getIntArrayExtra(String);
    method public int getIntExtra(String, int);
    method public java.util.ArrayList<java.lang.Integer> getIntegerArrayListExtra(String);
    method @Deprecated public static android.content.Intent getIntent(String) throws java.net.URISyntaxException;
    method public static android.content.Intent getIntentOld(String) throws java.net.URISyntaxException;
    method public long[] getLongArrayExtra(String);
    method public long getLongExtra(String, long);
    method @Nullable public String getPackage();
    method public android.os.Parcelable[] getParcelableArrayExtra(String);
    method public <T extends android.os.Parcelable> java.util.ArrayList<T> getParcelableArrayListExtra(String);
    method public <T extends android.os.Parcelable> T getParcelableExtra(String);
    method @Nullable public String getScheme();
    method @Nullable public android.content.Intent getSelector();
    method public java.io.Serializable getSerializableExtra(String);
    method public short[] getShortArrayExtra(String);
    method public short getShortExtra(String, short);
    method @Nullable public android.graphics.Rect getSourceBounds();
    method public String[] getStringArrayExtra(String);
    method public java.util.ArrayList<java.lang.String> getStringArrayListExtra(String);
    method public String getStringExtra(String);
    method @Nullable public String getType();
    method public boolean hasCategory(String);
    method public boolean hasExtra(String);
    method public boolean hasFileDescriptors();
    method public static android.content.Intent makeMainActivity(android.content.ComponentName);
    method public static android.content.Intent makeMainSelectorActivity(String, String);
    method public static android.content.Intent makeRestartActivityTask(android.content.ComponentName);
    method @Nullable public static String normalizeMimeType(@Nullable String);
    method @NonNull public static android.content.Intent parseIntent(@NonNull android.content.res.Resources, @NonNull org.xmlpull.v1.XmlPullParser, android.util.AttributeSet) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static android.content.Intent parseUri(String, int) throws java.net.URISyntaxException;
    method @NonNull public android.content.Intent putCharSequenceArrayListExtra(String, java.util.ArrayList<java.lang.CharSequence>);
    method @NonNull public android.content.Intent putExtra(String, boolean);
    method @NonNull public android.content.Intent putExtra(String, byte);
    method @NonNull public android.content.Intent putExtra(String, char);
    method @NonNull public android.content.Intent putExtra(String, short);
    method @NonNull public android.content.Intent putExtra(String, int);
    method @NonNull public android.content.Intent putExtra(String, long);
    method @NonNull public android.content.Intent putExtra(String, float);
    method @NonNull public android.content.Intent putExtra(String, double);
    method @NonNull public android.content.Intent putExtra(String, String);
    method @NonNull public android.content.Intent putExtra(String, CharSequence);
    method @NonNull public android.content.Intent putExtra(String, android.os.Parcelable);
    method @NonNull public android.content.Intent putExtra(String, android.os.Parcelable[]);
    method @NonNull public android.content.Intent putExtra(String, java.io.Serializable);
    method @NonNull public android.content.Intent putExtra(String, boolean[]);
    method @NonNull public android.content.Intent putExtra(String, byte[]);
    method @NonNull public android.content.Intent putExtra(String, short[]);
    method @NonNull public android.content.Intent putExtra(String, char[]);
    method @NonNull public android.content.Intent putExtra(String, int[]);
    method @NonNull public android.content.Intent putExtra(String, long[]);
    method @NonNull public android.content.Intent putExtra(String, float[]);
    method @NonNull public android.content.Intent putExtra(String, double[]);
    method @NonNull public android.content.Intent putExtra(String, String[]);
    method @NonNull public android.content.Intent putExtra(String, CharSequence[]);
    method @NonNull public android.content.Intent putExtra(String, android.os.Bundle);
    method @NonNull public android.content.Intent putExtras(@NonNull android.content.Intent);
    method @NonNull public android.content.Intent putExtras(@NonNull android.os.Bundle);
    method @NonNull public android.content.Intent putIntegerArrayListExtra(String, java.util.ArrayList<java.lang.Integer>);
    method @NonNull public android.content.Intent putParcelableArrayListExtra(String, java.util.ArrayList<? extends android.os.Parcelable>);
    method @NonNull public android.content.Intent putStringArrayListExtra(String, java.util.ArrayList<java.lang.String>);
    method public void readFromParcel(android.os.Parcel);
    method public void removeCategory(String);
    method public void removeExtra(String);
    method public void removeFlags(int);
    method @NonNull public android.content.Intent replaceExtras(@NonNull android.content.Intent);
    method @NonNull public android.content.Intent replaceExtras(@Nullable android.os.Bundle);
    method public android.content.ComponentName resolveActivity(@NonNull android.content.pm.PackageManager);
    method public android.content.pm.ActivityInfo resolveActivityInfo(@NonNull android.content.pm.PackageManager, int);
    method @Nullable public String resolveType(@NonNull android.content.Context);
    method @Nullable public String resolveType(@NonNull android.content.ContentResolver);
    method @Nullable public String resolveTypeIfNeeded(@NonNull android.content.ContentResolver);
    method @NonNull public android.content.Intent setAction(@Nullable String);
    method @NonNull public android.content.Intent setClass(@NonNull android.content.Context, @NonNull Class<?>);
    method @NonNull public android.content.Intent setClassName(@NonNull android.content.Context, @NonNull String);
    method @NonNull public android.content.Intent setClassName(@NonNull String, @NonNull String);
    method public void setClipData(@Nullable android.content.ClipData);
    method @NonNull public android.content.Intent setComponent(@Nullable android.content.ComponentName);
    method @NonNull public android.content.Intent setData(@Nullable android.net.Uri);
    method @NonNull public android.content.Intent setDataAndNormalize(@NonNull android.net.Uri);
    method @NonNull public android.content.Intent setDataAndType(@Nullable android.net.Uri, @Nullable String);
    method @NonNull public android.content.Intent setDataAndTypeAndNormalize(@NonNull android.net.Uri, @Nullable String);
    method public void setExtrasClassLoader(@Nullable ClassLoader);
    method @NonNull public android.content.Intent setFlags(int);
    method @NonNull public android.content.Intent setPackage(@Nullable String);
    method public void setSelector(@Nullable android.content.Intent);
    method public void setSourceBounds(@Nullable android.graphics.Rect);
    method @NonNull public android.content.Intent setType(@Nullable String);
    method @NonNull public android.content.Intent setTypeAndNormalize(@Nullable String);
    method @Deprecated public String toURI();
    method public String toUri(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final String ACTION_AIRPLANE_MODE_CHANGED = "android.intent.action.AIRPLANE_MODE";
    field public static final String ACTION_ALL_APPS = "android.intent.action.ALL_APPS";
    field public static final String ACTION_ANSWER = "android.intent.action.ANSWER";
    field public static final String ACTION_APPLICATION_PREFERENCES = "android.intent.action.APPLICATION_PREFERENCES";
    field public static final String ACTION_APPLICATION_RESTRICTIONS_CHANGED = "android.intent.action.APPLICATION_RESTRICTIONS_CHANGED";
    field public static final String ACTION_APP_ERROR = "android.intent.action.APP_ERROR";
    field public static final String ACTION_ASSIST = "android.intent.action.ASSIST";
    field public static final String ACTION_ATTACH_DATA = "android.intent.action.ATTACH_DATA";
    field public static final String ACTION_BATTERY_CHANGED = "android.intent.action.BATTERY_CHANGED";
    field public static final String ACTION_BATTERY_LOW = "android.intent.action.BATTERY_LOW";
    field public static final String ACTION_BATTERY_OKAY = "android.intent.action.BATTERY_OKAY";
    field public static final String ACTION_BOOT_COMPLETED = "android.intent.action.BOOT_COMPLETED";
    field public static final String ACTION_BUG_REPORT = "android.intent.action.BUG_REPORT";
    field public static final String ACTION_CALL = "android.intent.action.CALL";
    field public static final String ACTION_CALL_BUTTON = "android.intent.action.CALL_BUTTON";
    field public static final String ACTION_CAMERA_BUTTON = "android.intent.action.CAMERA_BUTTON";
    field public static final String ACTION_CARRIER_SETUP = "android.intent.action.CARRIER_SETUP";
    field public static final String ACTION_CHOOSER = "android.intent.action.CHOOSER";
    field public static final String ACTION_CLOSE_SYSTEM_DIALOGS = "android.intent.action.CLOSE_SYSTEM_DIALOGS";
    field public static final String ACTION_CONFIGURATION_CHANGED = "android.intent.action.CONFIGURATION_CHANGED";
    field public static final String ACTION_CREATE_DOCUMENT = "android.intent.action.CREATE_DOCUMENT";
    field public static final String ACTION_CREATE_SHORTCUT = "android.intent.action.CREATE_SHORTCUT";
    field public static final String ACTION_DATE_CHANGED = "android.intent.action.DATE_CHANGED";
    field public static final String ACTION_DEFAULT = "android.intent.action.VIEW";
    field public static final String ACTION_DELETE = "android.intent.action.DELETE";
    field @Deprecated public static final String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
    field @Deprecated public static final String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK";
    field public static final String ACTION_DIAL = "android.intent.action.DIAL";
    field public static final String ACTION_DOCK_EVENT = "android.intent.action.DOCK_EVENT";
    field public static final String ACTION_DREAMING_STARTED = "android.intent.action.DREAMING_STARTED";
    field public static final String ACTION_DREAMING_STOPPED = "android.intent.action.DREAMING_STOPPED";
    field public static final String ACTION_EDIT = "android.intent.action.EDIT";
    field public static final String ACTION_EXTERNAL_APPLICATIONS_AVAILABLE = "android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE";
    field public static final String ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE = "android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE";
    field public static final String ACTION_FACTORY_TEST = "android.intent.action.FACTORY_TEST";
    field public static final String ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT";
    field public static final String ACTION_GET_RESTRICTION_ENTRIES = "android.intent.action.GET_RESTRICTION_ENTRIES";
    field public static final String ACTION_GTALK_SERVICE_CONNECTED = "android.intent.action.GTALK_CONNECTED";
    field public static final String ACTION_GTALK_SERVICE_DISCONNECTED = "android.intent.action.GTALK_DISCONNECTED";
    field public static final String ACTION_HEADSET_PLUG = "android.intent.action.HEADSET_PLUG";
    field public static final String ACTION_INPUT_METHOD_CHANGED = "android.intent.action.INPUT_METHOD_CHANGED";
    field public static final String ACTION_INSERT = "android.intent.action.INSERT";
    field public static final String ACTION_INSERT_OR_EDIT = "android.intent.action.INSERT_OR_EDIT";
    field public static final String ACTION_INSTALL_FAILURE = "android.intent.action.INSTALL_FAILURE";
    field public static final String ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE";
    field public static final String ACTION_LOCALE_CHANGED = "android.intent.action.LOCALE_CHANGED";
    field public static final String ACTION_LOCKED_BOOT_COMPLETED = "android.intent.action.LOCKED_BOOT_COMPLETED";
    field public static final String ACTION_MAIN = "android.intent.action.MAIN";
    field public static final String ACTION_MANAGED_PROFILE_ADDED = "android.intent.action.MANAGED_PROFILE_ADDED";
    field public static final String ACTION_MANAGED_PROFILE_AVAILABLE = "android.intent.action.MANAGED_PROFILE_AVAILABLE";
    field public static final String ACTION_MANAGED_PROFILE_REMOVED = "android.intent.action.MANAGED_PROFILE_REMOVED";
    field public static final String ACTION_MANAGED_PROFILE_UNAVAILABLE = "android.intent.action.MANAGED_PROFILE_UNAVAILABLE";
    field public static final String ACTION_MANAGED_PROFILE_UNLOCKED = "android.intent.action.MANAGED_PROFILE_UNLOCKED";
    field public static final String ACTION_MANAGE_NETWORK_USAGE = "android.intent.action.MANAGE_NETWORK_USAGE";
    field public static final String ACTION_MANAGE_PACKAGE_STORAGE = "android.intent.action.MANAGE_PACKAGE_STORAGE";
    field public static final String ACTION_MEDIA_BAD_REMOVAL = "android.intent.action.MEDIA_BAD_REMOVAL";
    field public static final String ACTION_MEDIA_BUTTON = "android.intent.action.MEDIA_BUTTON";
    field public static final String ACTION_MEDIA_CHECKING = "android.intent.action.MEDIA_CHECKING";
    field public static final String ACTION_MEDIA_EJECT = "android.intent.action.MEDIA_EJECT";
    field public static final String ACTION_MEDIA_MOUNTED = "android.intent.action.MEDIA_MOUNTED";
    field public static final String ACTION_MEDIA_NOFS = "android.intent.action.MEDIA_NOFS";
    field public static final String ACTION_MEDIA_REMOVED = "android.intent.action.MEDIA_REMOVED";
    field public static final String ACTION_MEDIA_SCANNER_FINISHED = "android.intent.action.MEDIA_SCANNER_FINISHED";
    field public static final String ACTION_MEDIA_SCANNER_SCAN_FILE = "android.intent.action.MEDIA_SCANNER_SCAN_FILE";
    field public static final String ACTION_MEDIA_SCANNER_STARTED = "android.intent.action.MEDIA_SCANNER_STARTED";
    field public static final String ACTION_MEDIA_SHARED = "android.intent.action.MEDIA_SHARED";
    field public static final String ACTION_MEDIA_UNMOUNTABLE = "android.intent.action.MEDIA_UNMOUNTABLE";
    field public static final String ACTION_MEDIA_UNMOUNTED = "android.intent.action.MEDIA_UNMOUNTED";
    field public static final String ACTION_MY_PACKAGE_REPLACED = "android.intent.action.MY_PACKAGE_REPLACED";
    field public static final String ACTION_MY_PACKAGE_SUSPENDED = "android.intent.action.MY_PACKAGE_SUSPENDED";
    field public static final String ACTION_MY_PACKAGE_UNSUSPENDED = "android.intent.action.MY_PACKAGE_UNSUSPENDED";
    field @Deprecated public static final String ACTION_NEW_OUTGOING_CALL = "android.intent.action.NEW_OUTGOING_CALL";
    field public static final String ACTION_OPEN_DOCUMENT = "android.intent.action.OPEN_DOCUMENT";
    field public static final String ACTION_OPEN_DOCUMENT_TREE = "android.intent.action.OPEN_DOCUMENT_TREE";
    field public static final String ACTION_PACKAGES_SUSPENDED = "android.intent.action.PACKAGES_SUSPENDED";
    field public static final String ACTION_PACKAGES_UNSUSPENDED = "android.intent.action.PACKAGES_UNSUSPENDED";
    field public static final String ACTION_PACKAGE_ADDED = "android.intent.action.PACKAGE_ADDED";
    field public static final String ACTION_PACKAGE_CHANGED = "android.intent.action.PACKAGE_CHANGED";
    field public static final String ACTION_PACKAGE_DATA_CLEARED = "android.intent.action.PACKAGE_DATA_CLEARED";
    field public static final String ACTION_PACKAGE_FIRST_LAUNCH = "android.intent.action.PACKAGE_FIRST_LAUNCH";
    field public static final String ACTION_PACKAGE_FULLY_REMOVED = "android.intent.action.PACKAGE_FULLY_REMOVED";
    field @Deprecated public static final String ACTION_PACKAGE_INSTALL = "android.intent.action.PACKAGE_INSTALL";
    field public static final String ACTION_PACKAGE_NEEDS_VERIFICATION = "android.intent.action.PACKAGE_NEEDS_VERIFICATION";
    field public static final String ACTION_PACKAGE_REMOVED = "android.intent.action.PACKAGE_REMOVED";
    field public static final String ACTION_PACKAGE_REPLACED = "android.intent.action.PACKAGE_REPLACED";
    field public static final String ACTION_PACKAGE_RESTARTED = "android.intent.action.PACKAGE_RESTARTED";
    field public static final String ACTION_PACKAGE_VERIFIED = "android.intent.action.PACKAGE_VERIFIED";
    field public static final String ACTION_PASTE = "android.intent.action.PASTE";
    field public static final String ACTION_PICK = "android.intent.action.PICK";
    field public static final String ACTION_PICK_ACTIVITY = "android.intent.action.PICK_ACTIVITY";
    field public static final String ACTION_POWER_CONNECTED = "android.intent.action.ACTION_POWER_CONNECTED";
    field public static final String ACTION_POWER_DISCONNECTED = "android.intent.action.ACTION_POWER_DISCONNECTED";
    field public static final String ACTION_POWER_USAGE_SUMMARY = "android.intent.action.POWER_USAGE_SUMMARY";
    field public static final String ACTION_PROCESS_TEXT = "android.intent.action.PROCESS_TEXT";
    field public static final String ACTION_PROVIDER_CHANGED = "android.intent.action.PROVIDER_CHANGED";
    field public static final String ACTION_QUICK_CLOCK = "android.intent.action.QUICK_CLOCK";
    field public static final String ACTION_QUICK_VIEW = "android.intent.action.QUICK_VIEW";
    field public static final String ACTION_REBOOT = "android.intent.action.REBOOT";
    field public static final String ACTION_RUN = "android.intent.action.RUN";
    field public static final String ACTION_SCREEN_OFF = "android.intent.action.SCREEN_OFF";
    field public static final String ACTION_SCREEN_ON = "android.intent.action.SCREEN_ON";
    field public static final String ACTION_SEARCH = "android.intent.action.SEARCH";
    field public static final String ACTION_SEARCH_LONG_PRESS = "android.intent.action.SEARCH_LONG_PRESS";
    field public static final String ACTION_SEND = "android.intent.action.SEND";
    field public static final String ACTION_SENDTO = "android.intent.action.SENDTO";
    field public static final String ACTION_SEND_MULTIPLE = "android.intent.action.SEND_MULTIPLE";
    field public static final String ACTION_SET_WALLPAPER = "android.intent.action.SET_WALLPAPER";
    field public static final String ACTION_SHOW_APP_INFO = "android.intent.action.SHOW_APP_INFO";
    field public static final String ACTION_SHUTDOWN = "android.intent.action.ACTION_SHUTDOWN";
    field public static final String ACTION_SYNC = "android.intent.action.SYNC";
    field public static final String ACTION_SYSTEM_TUTORIAL = "android.intent.action.SYSTEM_TUTORIAL";
    field public static final String ACTION_TIMEZONE_CHANGED = "android.intent.action.TIMEZONE_CHANGED";
    field public static final String ACTION_TIME_CHANGED = "android.intent.action.TIME_SET";
    field public static final String ACTION_TIME_TICK = "android.intent.action.TIME_TICK";
    field public static final String ACTION_UID_REMOVED = "android.intent.action.UID_REMOVED";
    field @Deprecated public static final String ACTION_UMS_CONNECTED = "android.intent.action.UMS_CONNECTED";
    field @Deprecated public static final String ACTION_UMS_DISCONNECTED = "android.intent.action.UMS_DISCONNECTED";
    field public static final String ACTION_UNINSTALL_PACKAGE = "android.intent.action.UNINSTALL_PACKAGE";
    field public static final String ACTION_USER_BACKGROUND = "android.intent.action.USER_BACKGROUND";
    field public static final String ACTION_USER_FOREGROUND = "android.intent.action.USER_FOREGROUND";
    field public static final String ACTION_USER_INITIALIZE = "android.intent.action.USER_INITIALIZE";
    field public static final String ACTION_USER_PRESENT = "android.intent.action.USER_PRESENT";
    field public static final String ACTION_USER_UNLOCKED = "android.intent.action.USER_UNLOCKED";
    field public static final String ACTION_VIEW = "android.intent.action.VIEW";
    field public static final String ACTION_VOICE_COMMAND = "android.intent.action.VOICE_COMMAND";
    field @Deprecated public static final String ACTION_WALLPAPER_CHANGED = "android.intent.action.WALLPAPER_CHANGED";
    field public static final String ACTION_WEB_SEARCH = "android.intent.action.WEB_SEARCH";
    field public static final String CATEGORY_ALTERNATIVE = "android.intent.category.ALTERNATIVE";
    field public static final String CATEGORY_APP_BROWSER = "android.intent.category.APP_BROWSER";
    field public static final String CATEGORY_APP_CALCULATOR = "android.intent.category.APP_CALCULATOR";
    field public static final String CATEGORY_APP_CALENDAR = "android.intent.category.APP_CALENDAR";
    field public static final String CATEGORY_APP_CONTACTS = "android.intent.category.APP_CONTACTS";
    field public static final String CATEGORY_APP_EMAIL = "android.intent.category.APP_EMAIL";
    field public static final String CATEGORY_APP_GALLERY = "android.intent.category.APP_GALLERY";
    field public static final String CATEGORY_APP_MAPS = "android.intent.category.APP_MAPS";
    field public static final String CATEGORY_APP_MARKET = "android.intent.category.APP_MARKET";
    field public static final String CATEGORY_APP_MESSAGING = "android.intent.category.APP_MESSAGING";
    field public static final String CATEGORY_APP_MUSIC = "android.intent.category.APP_MUSIC";
    field public static final String CATEGORY_BROWSABLE = "android.intent.category.BROWSABLE";
    field public static final String CATEGORY_CAR_DOCK = "android.intent.category.CAR_DOCK";
    field public static final String CATEGORY_CAR_MODE = "android.intent.category.CAR_MODE";
    field public static final String CATEGORY_DEFAULT = "android.intent.category.DEFAULT";
    field public static final String CATEGORY_DESK_DOCK = "android.intent.category.DESK_DOCK";
    field public static final String CATEGORY_DEVELOPMENT_PREFERENCE = "android.intent.category.DEVELOPMENT_PREFERENCE";
    field public static final String CATEGORY_EMBED = "android.intent.category.EMBED";
    field public static final String CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST = "android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST";
    field public static final String CATEGORY_HE_DESK_DOCK = "android.intent.category.HE_DESK_DOCK";
    field public static final String CATEGORY_HOME = "android.intent.category.HOME";
    field public static final String CATEGORY_INFO = "android.intent.category.INFO";
    field public static final String CATEGORY_LAUNCHER = "android.intent.category.LAUNCHER";
    field public static final String CATEGORY_LEANBACK_LAUNCHER = "android.intent.category.LEANBACK_LAUNCHER";
    field public static final String CATEGORY_LE_DESK_DOCK = "android.intent.category.LE_DESK_DOCK";
    field public static final String CATEGORY_MONKEY = "android.intent.category.MONKEY";
    field public static final String CATEGORY_OPENABLE = "android.intent.category.OPENABLE";
    field public static final String CATEGORY_PREFERENCE = "android.intent.category.PREFERENCE";
    field public static final String CATEGORY_SAMPLE_CODE = "android.intent.category.SAMPLE_CODE";
    field public static final String CATEGORY_SELECTED_ALTERNATIVE = "android.intent.category.SELECTED_ALTERNATIVE";
    field public static final String CATEGORY_TAB = "android.intent.category.TAB";
    field public static final String CATEGORY_TEST = "android.intent.category.TEST";
    field public static final String CATEGORY_TYPED_OPENABLE = "android.intent.category.TYPED_OPENABLE";
    field public static final String CATEGORY_UNIT_TEST = "android.intent.category.UNIT_TEST";
    field public static final String CATEGORY_VOICE = "android.intent.category.VOICE";
    field public static final String CATEGORY_VR_HOME = "android.intent.category.VR_HOME";
    field public static final android.os.Parcelable.Creator<android.content.Intent> CREATOR;
    field public static final String EXTRA_ALARM_COUNT = "android.intent.extra.ALARM_COUNT";
    field public static final String EXTRA_ALLOW_MULTIPLE = "android.intent.extra.ALLOW_MULTIPLE";
    field @Deprecated public static final String EXTRA_ALLOW_REPLACE = "android.intent.extra.ALLOW_REPLACE";
    field public static final String EXTRA_ALTERNATE_INTENTS = "android.intent.extra.ALTERNATE_INTENTS";
    field public static final String EXTRA_ASSIST_CONTEXT = "android.intent.extra.ASSIST_CONTEXT";
    field public static final String EXTRA_ASSIST_INPUT_DEVICE_ID = "android.intent.extra.ASSIST_INPUT_DEVICE_ID";
    field public static final String EXTRA_ASSIST_INPUT_HINT_KEYBOARD = "android.intent.extra.ASSIST_INPUT_HINT_KEYBOARD";
    field public static final String EXTRA_ASSIST_PACKAGE = "android.intent.extra.ASSIST_PACKAGE";
    field public static final String EXTRA_ASSIST_UID = "android.intent.extra.ASSIST_UID";
    field public static final String EXTRA_BCC = "android.intent.extra.BCC";
    field public static final String EXTRA_BUG_REPORT = "android.intent.extra.BUG_REPORT";
    field public static final String EXTRA_CC = "android.intent.extra.CC";
    field @Deprecated public static final String EXTRA_CHANGED_COMPONENT_NAME = "android.intent.extra.changed_component_name";
    field public static final String EXTRA_CHANGED_COMPONENT_NAME_LIST = "android.intent.extra.changed_component_name_list";
    field public static final String EXTRA_CHANGED_PACKAGE_LIST = "android.intent.extra.changed_package_list";
    field public static final String EXTRA_CHANGED_UID_LIST = "android.intent.extra.changed_uid_list";
    field public static final String EXTRA_CHOOSER_REFINEMENT_INTENT_SENDER = "android.intent.extra.CHOOSER_REFINEMENT_INTENT_SENDER";
    field public static final String EXTRA_CHOOSER_TARGETS = "android.intent.extra.CHOOSER_TARGETS";
    field public static final String EXTRA_CHOSEN_COMPONENT = "android.intent.extra.CHOSEN_COMPONENT";
    field public static final String EXTRA_CHOSEN_COMPONENT_INTENT_SENDER = "android.intent.extra.CHOSEN_COMPONENT_INTENT_SENDER";
    field public static final String EXTRA_COMPONENT_NAME = "android.intent.extra.COMPONENT_NAME";
    field public static final String EXTRA_CONTENT_ANNOTATIONS = "android.intent.extra.CONTENT_ANNOTATIONS";
    field public static final String EXTRA_DATA_REMOVED = "android.intent.extra.DATA_REMOVED";
    field public static final String EXTRA_DOCK_STATE = "android.intent.extra.DOCK_STATE";
    field public static final int EXTRA_DOCK_STATE_CAR = 2; // 0x2
    field public static final int EXTRA_DOCK_STATE_DESK = 1; // 0x1
    field public static final int EXTRA_DOCK_STATE_HE_DESK = 4; // 0x4
    field public static final int EXTRA_DOCK_STATE_LE_DESK = 3; // 0x3
    field public static final int EXTRA_DOCK_STATE_UNDOCKED = 0; // 0x0
    field public static final String EXTRA_DONT_KILL_APP = "android.intent.extra.DONT_KILL_APP";
    field public static final String EXTRA_EMAIL = "android.intent.extra.EMAIL";
    field public static final String EXTRA_EXCLUDE_COMPONENTS = "android.intent.extra.EXCLUDE_COMPONENTS";
    field public static final String EXTRA_FROM_STORAGE = "android.intent.extra.FROM_STORAGE";
    field public static final String EXTRA_HTML_TEXT = "android.intent.extra.HTML_TEXT";
    field public static final String EXTRA_INDEX = "android.intent.extra.INDEX";
    field public static final String EXTRA_INITIAL_INTENTS = "android.intent.extra.INITIAL_INTENTS";
    field public static final String EXTRA_INSTALLER_PACKAGE_NAME = "android.intent.extra.INSTALLER_PACKAGE_NAME";
    field public static final String EXTRA_INTENT = "android.intent.extra.INTENT";
    field public static final String EXTRA_KEY_EVENT = "android.intent.extra.KEY_EVENT";
    field public static final String EXTRA_LOCAL_ONLY = "android.intent.extra.LOCAL_ONLY";
    field public static final String EXTRA_MIME_TYPES = "android.intent.extra.MIME_TYPES";
    field public static final String EXTRA_NOT_UNKNOWN_SOURCE = "android.intent.extra.NOT_UNKNOWN_SOURCE";
    field public static final String EXTRA_ORIGINATING_URI = "android.intent.extra.ORIGINATING_URI";
    field public static final String EXTRA_PACKAGE_NAME = "android.intent.extra.PACKAGE_NAME";
    field public static final String EXTRA_PHONE_NUMBER = "android.intent.extra.PHONE_NUMBER";
    field public static final String EXTRA_PROCESS_TEXT = "android.intent.extra.PROCESS_TEXT";
    field public static final String EXTRA_PROCESS_TEXT_READONLY = "android.intent.extra.PROCESS_TEXT_READONLY";
    field public static final String EXTRA_QUICK_VIEW_FEATURES = "android.intent.extra.QUICK_VIEW_FEATURES";
    field public static final String EXTRA_QUIET_MODE = "android.intent.extra.QUIET_MODE";
    field public static final String EXTRA_REFERRER = "android.intent.extra.REFERRER";
    field public static final String EXTRA_REFERRER_NAME = "android.intent.extra.REFERRER_NAME";
    field public static final String EXTRA_REMOTE_INTENT_TOKEN = "android.intent.extra.remote_intent_token";
    field public static final String EXTRA_REPLACEMENT_EXTRAS = "android.intent.extra.REPLACEMENT_EXTRAS";
    field public static final String EXTRA_REPLACING = "android.intent.extra.REPLACING";
    field public static final String EXTRA_RESTRICTIONS_BUNDLE = "android.intent.extra.restrictions_bundle";
    field public static final String EXTRA_RESTRICTIONS_INTENT = "android.intent.extra.restrictions_intent";
    field public static final String EXTRA_RESTRICTIONS_LIST = "android.intent.extra.restrictions_list";
    field public static final String EXTRA_RESULT_RECEIVER = "android.intent.extra.RESULT_RECEIVER";
    field public static final String EXTRA_RETURN_RESULT = "android.intent.extra.RETURN_RESULT";
    field @Deprecated public static final String EXTRA_SHORTCUT_ICON = "android.intent.extra.shortcut.ICON";
    field @Deprecated public static final String EXTRA_SHORTCUT_ICON_RESOURCE = "android.intent.extra.shortcut.ICON_RESOURCE";
    field @Deprecated public static final String EXTRA_SHORTCUT_INTENT = "android.intent.extra.shortcut.INTENT";
    field @Deprecated public static final String EXTRA_SHORTCUT_NAME = "android.intent.extra.shortcut.NAME";
    field public static final String EXTRA_SHUTDOWN_USERSPACE_ONLY = "android.intent.extra.SHUTDOWN_USERSPACE_ONLY";
    field public static final String EXTRA_SPLIT_NAME = "android.intent.extra.SPLIT_NAME";
    field public static final String EXTRA_STREAM = "android.intent.extra.STREAM";
    field public static final String EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
    field public static final String EXTRA_SUSPENDED_PACKAGE_EXTRAS = "android.intent.extra.SUSPENDED_PACKAGE_EXTRAS";
    field public static final String EXTRA_TEMPLATE = "android.intent.extra.TEMPLATE";
    field public static final String EXTRA_TEXT = "android.intent.extra.TEXT";
    field public static final String EXTRA_TITLE = "android.intent.extra.TITLE";
    field public static final String EXTRA_UID = "android.intent.extra.UID";
    field public static final String EXTRA_USER = "android.intent.extra.USER";
    field public static final int FILL_IN_ACTION = 1; // 0x1
    field public static final int FILL_IN_CATEGORIES = 4; // 0x4
    field public static final int FILL_IN_CLIP_DATA = 128; // 0x80
    field public static final int FILL_IN_COMPONENT = 8; // 0x8
    field public static final int FILL_IN_DATA = 2; // 0x2
    field public static final int FILL_IN_PACKAGE = 16; // 0x10
    field public static final int FILL_IN_SELECTOR = 64; // 0x40
    field public static final int FILL_IN_SOURCE_BOUNDS = 32; // 0x20
    field public static final int FLAG_ACTIVITY_BROUGHT_TO_FRONT = 4194304; // 0x400000
    field public static final int FLAG_ACTIVITY_CLEAR_TASK = 32768; // 0x8000
    field public static final int FLAG_ACTIVITY_CLEAR_TOP = 67108864; // 0x4000000
    field @Deprecated public static final int FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET = 524288; // 0x80000
    field public static final int FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS = 8388608; // 0x800000
    field public static final int FLAG_ACTIVITY_FORWARD_RESULT = 33554432; // 0x2000000
    field public static final int FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY = 1048576; // 0x100000
    field public static final int FLAG_ACTIVITY_LAUNCH_ADJACENT = 4096; // 0x1000
    field public static final int FLAG_ACTIVITY_MATCH_EXTERNAL = 2048; // 0x800
    field public static final int FLAG_ACTIVITY_MULTIPLE_TASK = 134217728; // 0x8000000
    field public static final int FLAG_ACTIVITY_NEW_DOCUMENT = 524288; // 0x80000
    field public static final int FLAG_ACTIVITY_NEW_TASK = 268435456; // 0x10000000
    field public static final int FLAG_ACTIVITY_NO_ANIMATION = 65536; // 0x10000
    field public static final int FLAG_ACTIVITY_NO_HISTORY = 1073741824; // 0x40000000
    field public static final int FLAG_ACTIVITY_NO_USER_ACTION = 262144; // 0x40000
    field public static final int FLAG_ACTIVITY_PREVIOUS_IS_TOP = 16777216; // 0x1000000
    field public static final int FLAG_ACTIVITY_REORDER_TO_FRONT = 131072; // 0x20000
    field public static final int FLAG_ACTIVITY_RESET_TASK_IF_NEEDED = 2097152; // 0x200000
    field public static final int FLAG_ACTIVITY_RETAIN_IN_RECENTS = 8192; // 0x2000
    field public static final int FLAG_ACTIVITY_SINGLE_TOP = 536870912; // 0x20000000
    field public static final int FLAG_ACTIVITY_TASK_ON_HOME = 16384; // 0x4000
    field public static final int FLAG_DEBUG_LOG_RESOLUTION = 8; // 0x8
    field public static final int FLAG_EXCLUDE_STOPPED_PACKAGES = 16; // 0x10
    field public static final int FLAG_FROM_BACKGROUND = 4; // 0x4
    field public static final int FLAG_GRANT_PERSISTABLE_URI_PERMISSION = 64; // 0x40
    field public static final int FLAG_GRANT_PREFIX_URI_PERMISSION = 128; // 0x80
    field public static final int FLAG_GRANT_READ_URI_PERMISSION = 1; // 0x1
    field public static final int FLAG_GRANT_WRITE_URI_PERMISSION = 2; // 0x2
    field public static final int FLAG_INCLUDE_STOPPED_PACKAGES = 32; // 0x20
    field public static final int FLAG_RECEIVER_FOREGROUND = 268435456; // 0x10000000
    field public static final int FLAG_RECEIVER_NO_ABORT = 134217728; // 0x8000000
    field public static final int FLAG_RECEIVER_REGISTERED_ONLY = 1073741824; // 0x40000000
    field public static final int FLAG_RECEIVER_REPLACE_PENDING = 536870912; // 0x20000000
    field public static final int FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS = 2097152; // 0x200000
    field public static final String METADATA_DOCK_HOME = "android.dock_home";
    field public static final int URI_ALLOW_UNSAFE = 4; // 0x4
    field public static final int URI_ANDROID_APP_SCHEME = 2; // 0x2
    field public static final int URI_INTENT_SCHEME = 1; // 0x1
  }

  public static final class Intent.FilterComparison {
    ctor public Intent.FilterComparison(android.content.Intent);
    method public android.content.Intent getIntent();
  }

  public static class Intent.ShortcutIconResource implements android.os.Parcelable {
    ctor public Intent.ShortcutIconResource();
    method public int describeContents();
    method public static android.content.Intent.ShortcutIconResource fromContext(android.content.Context, @AnyRes int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.Intent.ShortcutIconResource> CREATOR;
    field public String packageName;
    field public String resourceName;
  }

  public class IntentFilter implements android.os.Parcelable {
    ctor public IntentFilter();
    ctor public IntentFilter(String);
    ctor public IntentFilter(String, String) throws android.content.IntentFilter.MalformedMimeTypeException;
    ctor public IntentFilter(android.content.IntentFilter);
    method public final java.util.Iterator<java.lang.String> actionsIterator();
    method public final void addAction(String);
    method public final void addCategory(String);
    method public final void addDataAuthority(String, String);
    method public final void addDataPath(String, int);
    method public final void addDataScheme(String);
    method public final void addDataSchemeSpecificPart(String, int);
    method public final void addDataType(String) throws android.content.IntentFilter.MalformedMimeTypeException;
    method public final java.util.Iterator<android.content.IntentFilter.AuthorityEntry> authoritiesIterator();
    method public final java.util.Iterator<java.lang.String> categoriesIterator();
    method public final int countActions();
    method public final int countCategories();
    method public final int countDataAuthorities();
    method public final int countDataPaths();
    method public final int countDataSchemeSpecificParts();
    method public final int countDataSchemes();
    method public final int countDataTypes();
    method public static android.content.IntentFilter create(String, String);
    method public final int describeContents();
    method public void dump(android.util.Printer, String);
    method public final String getAction(int);
    method public final String getCategory(int);
    method public final android.content.IntentFilter.AuthorityEntry getDataAuthority(int);
    method public final android.os.PatternMatcher getDataPath(int);
    method public final String getDataScheme(int);
    method public final android.os.PatternMatcher getDataSchemeSpecificPart(int);
    method public final String getDataType(int);
    method public final int getPriority();
    method public final boolean hasAction(String);
    method public final boolean hasCategory(String);
    method public final boolean hasDataAuthority(android.net.Uri);
    method public final boolean hasDataPath(String);
    method public final boolean hasDataScheme(String);
    method public final boolean hasDataSchemeSpecificPart(String);
    method public final boolean hasDataType(String);
    method public final int match(android.content.ContentResolver, android.content.Intent, boolean, String);
    method public final int match(String, String, String, android.net.Uri, java.util.Set<java.lang.String>, String);
    method public final boolean matchAction(String);
    method public final String matchCategories(java.util.Set<java.lang.String>);
    method public final int matchData(String, String, android.net.Uri);
    method public final int matchDataAuthority(android.net.Uri);
    method public final java.util.Iterator<android.os.PatternMatcher> pathsIterator();
    method public void readFromXml(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public final java.util.Iterator<android.os.PatternMatcher> schemeSpecificPartsIterator();
    method public final java.util.Iterator<java.lang.String> schemesIterator();
    method public final void setPriority(int);
    method public final java.util.Iterator<java.lang.String> typesIterator();
    method public final void writeToParcel(android.os.Parcel, int);
    method public void writeToXml(org.xmlpull.v1.XmlSerializer) throws java.io.IOException;
    field public static final android.os.Parcelable.Creator<android.content.IntentFilter> CREATOR;
    field public static final int MATCH_ADJUSTMENT_MASK = 65535; // 0xffff
    field public static final int MATCH_ADJUSTMENT_NORMAL = 32768; // 0x8000
    field public static final int MATCH_CATEGORY_EMPTY = 1048576; // 0x100000
    field public static final int MATCH_CATEGORY_HOST = 3145728; // 0x300000
    field public static final int MATCH_CATEGORY_MASK = 268369920; // 0xfff0000
    field public static final int MATCH_CATEGORY_PATH = 5242880; // 0x500000
    field public static final int MATCH_CATEGORY_PORT = 4194304; // 0x400000
    field public static final int MATCH_CATEGORY_SCHEME = 2097152; // 0x200000
    field public static final int MATCH_CATEGORY_SCHEME_SPECIFIC_PART = 5767168; // 0x580000
    field public static final int MATCH_CATEGORY_TYPE = 6291456; // 0x600000
    field public static final int NO_MATCH_ACTION = -3; // 0xfffffffd
    field public static final int NO_MATCH_CATEGORY = -4; // 0xfffffffc
    field public static final int NO_MATCH_DATA = -2; // 0xfffffffe
    field public static final int NO_MATCH_TYPE = -1; // 0xffffffff
    field public static final int SYSTEM_HIGH_PRIORITY = 1000; // 0x3e8
    field public static final int SYSTEM_LOW_PRIORITY = -1000; // 0xfffffc18
  }

  public static final class IntentFilter.AuthorityEntry {
    ctor public IntentFilter.AuthorityEntry(String, String);
    method public String getHost();
    method public int getPort();
    method public int match(android.net.Uri);
  }

  public static class IntentFilter.MalformedMimeTypeException extends android.util.AndroidException {
    ctor public IntentFilter.MalformedMimeTypeException();
    ctor public IntentFilter.MalformedMimeTypeException(String);
  }

  public class IntentSender implements android.os.Parcelable {
    method public int describeContents();
    method public String getCreatorPackage();
    method public int getCreatorUid();
    method public android.os.UserHandle getCreatorUserHandle();
    method @Deprecated public String getTargetPackage();
    method public static android.content.IntentSender readIntentSenderOrNullFromParcel(android.os.Parcel);
    method public void sendIntent(android.content.Context, int, android.content.Intent, android.content.IntentSender.OnFinished, android.os.Handler) throws android.content.IntentSender.SendIntentException;
    method public void sendIntent(android.content.Context, int, android.content.Intent, android.content.IntentSender.OnFinished, android.os.Handler, String) throws android.content.IntentSender.SendIntentException;
    method public static void writeIntentSenderOrNullToParcel(android.content.IntentSender, android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.IntentSender> CREATOR;
  }

  public static interface IntentSender.OnFinished {
    method public void onSendFinished(android.content.IntentSender, android.content.Intent, int, String, android.os.Bundle);
  }

  public static class IntentSender.SendIntentException extends android.util.AndroidException {
    ctor public IntentSender.SendIntentException();
    ctor public IntentSender.SendIntentException(String);
    ctor public IntentSender.SendIntentException(Exception);
  }

  @Deprecated public class Loader<D> {
    ctor @Deprecated public Loader(android.content.Context);
    method @Deprecated public void abandon();
    method @Deprecated public boolean cancelLoad();
    method @Deprecated public void commitContentChanged();
    method @Deprecated public String dataToString(D);
    method @Deprecated public void deliverCancellation();
    method @Deprecated public void deliverResult(D);
    method @Deprecated public void dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method @Deprecated public void forceLoad();
    method @Deprecated public android.content.Context getContext();
    method @Deprecated public int getId();
    method @Deprecated public boolean isAbandoned();
    method @Deprecated public boolean isReset();
    method @Deprecated public boolean isStarted();
    method @Deprecated protected void onAbandon();
    method @Deprecated protected boolean onCancelLoad();
    method @Deprecated public void onContentChanged();
    method @Deprecated protected void onForceLoad();
    method @Deprecated protected void onReset();
    method @Deprecated protected void onStartLoading();
    method @Deprecated protected void onStopLoading();
    method @Deprecated public void registerListener(int, android.content.Loader.OnLoadCompleteListener<D>);
    method @Deprecated public void registerOnLoadCanceledListener(android.content.Loader.OnLoadCanceledListener<D>);
    method @Deprecated public void reset();
    method @Deprecated public void rollbackContentChanged();
    method @Deprecated public final void startLoading();
    method @Deprecated public void stopLoading();
    method @Deprecated public boolean takeContentChanged();
    method @Deprecated public void unregisterListener(android.content.Loader.OnLoadCompleteListener<D>);
    method @Deprecated public void unregisterOnLoadCanceledListener(android.content.Loader.OnLoadCanceledListener<D>);
  }

  @Deprecated public final class Loader.ForceLoadContentObserver extends android.database.ContentObserver {
    ctor @Deprecated public Loader.ForceLoadContentObserver();
  }

  @Deprecated public static interface Loader.OnLoadCanceledListener<D> {
    method @Deprecated public void onLoadCanceled(android.content.Loader<D>);
  }

  @Deprecated public static interface Loader.OnLoadCompleteListener<D> {
    method @Deprecated public void onLoadComplete(android.content.Loader<D>, D);
  }

  public class MutableContextWrapper extends android.content.ContextWrapper {
    ctor public MutableContextWrapper(android.content.Context);
    method public void setBaseContext(android.content.Context);
  }

  public class OperationApplicationException extends java.lang.Exception {
    ctor public OperationApplicationException();
    ctor public OperationApplicationException(String);
    ctor public OperationApplicationException(String, Throwable);
    ctor public OperationApplicationException(Throwable);
    ctor public OperationApplicationException(int);
    ctor public OperationApplicationException(String, int);
    method public int getNumSuccessfulYieldPoints();
  }

  public class PeriodicSync implements android.os.Parcelable {
    ctor public PeriodicSync(android.accounts.Account, String, android.os.Bundle, long);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.PeriodicSync> CREATOR;
    field public final android.accounts.Account account;
    field public final String authority;
    field public final android.os.Bundle extras;
    field public final long period;
  }

  public class QuickViewConstants {
    field public static final String FEATURE_DELETE = "android:delete";
    field public static final String FEATURE_DOWNLOAD = "android:download";
    field public static final String FEATURE_EDIT = "android:edit";
    field public static final String FEATURE_PRINT = "android:print";
    field public static final String FEATURE_SEND = "android:send";
    field public static final String FEATURE_VIEW = "android:view";
  }

  public class ReceiverCallNotAllowedException extends android.util.AndroidRuntimeException {
    ctor public ReceiverCallNotAllowedException(String);
  }

  public class RestrictionEntry implements android.os.Parcelable {
    ctor public RestrictionEntry(int, String);
    ctor public RestrictionEntry(String, String);
    ctor public RestrictionEntry(String, boolean);
    ctor public RestrictionEntry(String, String[]);
    ctor public RestrictionEntry(String, int);
    ctor public RestrictionEntry(android.os.Parcel);
    method public static android.content.RestrictionEntry createBundleArrayEntry(String, android.content.RestrictionEntry[]);
    method public static android.content.RestrictionEntry createBundleEntry(String, android.content.RestrictionEntry[]);
    method public int describeContents();
    method public String[] getAllSelectedStrings();
    method public String[] getChoiceEntries();
    method public String[] getChoiceValues();
    method public String getDescription();
    method public int getIntValue();
    method public String getKey();
    method public android.content.RestrictionEntry[] getRestrictions();
    method public boolean getSelectedState();
    method public String getSelectedString();
    method public String getTitle();
    method public int getType();
    method public void setAllSelectedStrings(String[]);
    method public void setChoiceEntries(String[]);
    method public void setChoiceEntries(android.content.Context, @ArrayRes int);
    method public void setChoiceValues(String[]);
    method public void setChoiceValues(android.content.Context, @ArrayRes int);
    method public void setDescription(String);
    method public void setIntValue(int);
    method public void setRestrictions(android.content.RestrictionEntry[]);
    method public void setSelectedState(boolean);
    method public void setSelectedString(String);
    method public void setTitle(String);
    method public void setType(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.RestrictionEntry> CREATOR;
    field public static final int TYPE_BOOLEAN = 1; // 0x1
    field public static final int TYPE_BUNDLE = 7; // 0x7
    field public static final int TYPE_BUNDLE_ARRAY = 8; // 0x8
    field public static final int TYPE_CHOICE = 2; // 0x2
    field public static final int TYPE_INTEGER = 5; // 0x5
    field public static final int TYPE_MULTI_SELECT = 4; // 0x4
    field public static final int TYPE_NULL = 0; // 0x0
    field public static final int TYPE_STRING = 6; // 0x6
  }

  public class RestrictionsManager {
    method public static android.os.Bundle convertRestrictionsToBundle(java.util.List<android.content.RestrictionEntry>);
    method public android.content.Intent createLocalApprovalIntent();
    method public android.os.Bundle getApplicationRestrictions();
    method public java.util.List<android.content.RestrictionEntry> getManifestRestrictions(String);
    method public boolean hasRestrictionsProvider();
    method public void notifyPermissionResponse(String, android.os.PersistableBundle);
    method public void requestPermission(String, String, android.os.PersistableBundle);
    field public static final String ACTION_PERMISSION_RESPONSE_RECEIVED = "android.content.action.PERMISSION_RESPONSE_RECEIVED";
    field public static final String ACTION_REQUEST_LOCAL_APPROVAL = "android.content.action.REQUEST_LOCAL_APPROVAL";
    field public static final String ACTION_REQUEST_PERMISSION = "android.content.action.REQUEST_PERMISSION";
    field public static final String EXTRA_PACKAGE_NAME = "android.content.extra.PACKAGE_NAME";
    field public static final String EXTRA_REQUEST_BUNDLE = "android.content.extra.REQUEST_BUNDLE";
    field public static final String EXTRA_REQUEST_ID = "android.content.extra.REQUEST_ID";
    field public static final String EXTRA_REQUEST_TYPE = "android.content.extra.REQUEST_TYPE";
    field public static final String EXTRA_RESPONSE_BUNDLE = "android.content.extra.RESPONSE_BUNDLE";
    field public static final String META_DATA_APP_RESTRICTIONS = "android.content.APP_RESTRICTIONS";
    field public static final String REQUEST_KEY_APPROVE_LABEL = "android.request.approve_label";
    field public static final String REQUEST_KEY_DATA = "android.request.data";
    field public static final String REQUEST_KEY_DENY_LABEL = "android.request.deny_label";
    field public static final String REQUEST_KEY_ICON = "android.request.icon";
    field public static final String REQUEST_KEY_ID = "android.request.id";
    field public static final String REQUEST_KEY_MESSAGE = "android.request.mesg";
    field public static final String REQUEST_KEY_NEW_REQUEST = "android.request.new_request";
    field public static final String REQUEST_KEY_TITLE = "android.request.title";
    field public static final String REQUEST_TYPE_APPROVAL = "android.request.type.approval";
    field public static final String RESPONSE_KEY_ERROR_CODE = "android.response.errorcode";
    field public static final String RESPONSE_KEY_MESSAGE = "android.response.msg";
    field public static final String RESPONSE_KEY_RESPONSE_TIMESTAMP = "android.response.timestamp";
    field public static final String RESPONSE_KEY_RESULT = "android.response.result";
    field public static final int RESULT_APPROVED = 1; // 0x1
    field public static final int RESULT_DENIED = 2; // 0x2
    field public static final int RESULT_ERROR = 5; // 0x5
    field public static final int RESULT_ERROR_BAD_REQUEST = 1; // 0x1
    field public static final int RESULT_ERROR_INTERNAL = 3; // 0x3
    field public static final int RESULT_ERROR_NETWORK = 2; // 0x2
    field public static final int RESULT_NO_RESPONSE = 3; // 0x3
    field public static final int RESULT_UNKNOWN_REQUEST = 4; // 0x4
  }

  public class SearchRecentSuggestionsProvider extends android.content.ContentProvider {
    ctor public SearchRecentSuggestionsProvider();
    method public int delete(android.net.Uri, String, String[]);
    method public String getType(android.net.Uri);
    method public android.net.Uri insert(android.net.Uri, android.content.ContentValues);
    method public boolean onCreate();
    method public android.database.Cursor query(android.net.Uri, String[], String, String[], String);
    method protected void setupSuggestions(String, int);
    method public int update(android.net.Uri, android.content.ContentValues, String, String[]);
    field public static final int DATABASE_MODE_2LINES = 2; // 0x2
    field public static final int DATABASE_MODE_QUERIES = 1; // 0x1
  }

  public interface ServiceConnection {
    method public default void onBindingDied(android.content.ComponentName);
    method public default void onNullBinding(android.content.ComponentName);
    method public void onServiceConnected(android.content.ComponentName, android.os.IBinder);
    method public void onServiceDisconnected(android.content.ComponentName);
  }

  public interface SharedPreferences {
    method public boolean contains(String);
    method public android.content.SharedPreferences.Editor edit();
    method public java.util.Map<java.lang.String,?> getAll();
    method public boolean getBoolean(String, boolean);
    method public float getFloat(String, float);
    method public int getInt(String, int);
    method public long getLong(String, long);
    method @Nullable public String getString(String, @Nullable String);
    method @Nullable public java.util.Set<java.lang.String> getStringSet(String, @Nullable java.util.Set<java.lang.String>);
    method public void registerOnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener);
    method public void unregisterOnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener);
  }

  public static interface SharedPreferences.Editor {
    method public void apply();
    method public android.content.SharedPreferences.Editor clear();
    method public boolean commit();
    method public android.content.SharedPreferences.Editor putBoolean(String, boolean);
    method public android.content.SharedPreferences.Editor putFloat(String, float);
    method public android.content.SharedPreferences.Editor putInt(String, int);
    method public android.content.SharedPreferences.Editor putLong(String, long);
    method public android.content.SharedPreferences.Editor putString(String, @Nullable String);
    method public android.content.SharedPreferences.Editor putStringSet(String, @Nullable java.util.Set<java.lang.String>);
    method public android.content.SharedPreferences.Editor remove(String);
  }

  public static interface SharedPreferences.OnSharedPreferenceChangeListener {
    method public void onSharedPreferenceChanged(android.content.SharedPreferences, String);
  }

  public class SyncAdapterType implements android.os.Parcelable {
    ctor public SyncAdapterType(String, String, boolean, boolean);
    ctor public SyncAdapterType(android.os.Parcel);
    method public boolean allowParallelSyncs();
    method public int describeContents();
    method public String getSettingsActivity();
    method public boolean isAlwaysSyncable();
    method public boolean isUserVisible();
    method public static android.content.SyncAdapterType newKey(String, String);
    method public boolean supportsUploading();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.SyncAdapterType> CREATOR;
    field public final String accountType;
    field public final String authority;
    field public final boolean isKey;
  }

  public class SyncContext {
    method public android.os.IBinder getSyncContextBinder();
    method public void onFinished(android.content.SyncResult);
  }

  public class SyncInfo implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public final android.accounts.Account account;
    field public final String authority;
    field public final long startTime;
  }

  public class SyncRequest implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.SyncRequest> CREATOR;
  }

  public static class SyncRequest.Builder {
    ctor public SyncRequest.Builder();
    method public android.content.SyncRequest build();
    method public android.content.SyncRequest.Builder setDisallowMetered(boolean);
    method public android.content.SyncRequest.Builder setExpedited(boolean);
    method public android.content.SyncRequest.Builder setExtras(android.os.Bundle);
    method public android.content.SyncRequest.Builder setIgnoreBackoff(boolean);
    method public android.content.SyncRequest.Builder setIgnoreSettings(boolean);
    method public android.content.SyncRequest.Builder setManual(boolean);
    method public android.content.SyncRequest.Builder setNoRetry(boolean);
    method public android.content.SyncRequest.Builder setRequiresCharging(boolean);
    method public android.content.SyncRequest.Builder setSyncAdapter(android.accounts.Account, String);
    method public android.content.SyncRequest.Builder syncOnce();
    method public android.content.SyncRequest.Builder syncPeriodic(long, long);
  }

  public final class SyncResult implements android.os.Parcelable {
    ctor public SyncResult();
    method public void clear();
    method public int describeContents();
    method public boolean hasError();
    method public boolean hasHardError();
    method public boolean hasSoftError();
    method public boolean madeSomeProgress();
    method public String toDebugString();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.content.SyncResult ALREADY_IN_PROGRESS;
    field public static final android.os.Parcelable.Creator<android.content.SyncResult> CREATOR;
    field public boolean databaseError;
    field public long delayUntil;
    field public boolean fullSyncRequested;
    field public boolean moreRecordsToGet;
    field public boolean partialSyncUnavailable;
    field public final android.content.SyncStats stats;
    field public final boolean syncAlreadyInProgress;
    field public boolean tooManyDeletions;
    field public boolean tooManyRetries;
  }

  public class SyncStats implements android.os.Parcelable {
    ctor public SyncStats();
    ctor public SyncStats(android.os.Parcel);
    method public void clear();
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.SyncStats> CREATOR;
    field public long numAuthExceptions;
    field public long numConflictDetectedExceptions;
    field public long numDeletes;
    field public long numEntries;
    field public long numInserts;
    field public long numIoExceptions;
    field public long numParseExceptions;
    field public long numSkippedEntries;
    field public long numUpdates;
  }

  public interface SyncStatusObserver {
    method public void onStatusChanged(int);
  }

  public class UriMatcher {
    ctor public UriMatcher(int);
    method public void addURI(String, String, int);
    method public int match(android.net.Uri);
    field public static final int NO_MATCH = -1; // 0xffffffff
  }

  public final class UriPermission implements android.os.Parcelable {
    method public int describeContents();
    method public long getPersistedTime();
    method public android.net.Uri getUri();
    method public boolean isReadPermission();
    method public boolean isWritePermission();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.UriPermission> CREATOR;
    field public static final long INVALID_TIME = -9223372036854775808L; // 0x8000000000000000L
  }

}

package android.content.pm {

  public class ActivityInfo extends android.content.pm.ComponentInfo implements android.os.Parcelable {
    ctor public ActivityInfo();
    ctor public ActivityInfo(android.content.pm.ActivityInfo);
    method public int describeContents();
    method public void dump(android.util.Printer, String);
    method public final int getThemeResource();
    field public static final int COLOR_MODE_DEFAULT = 0; // 0x0
    field public static final int COLOR_MODE_HDR = 2; // 0x2
    field public static final int COLOR_MODE_WIDE_COLOR_GAMUT = 1; // 0x1
    field public static final int CONFIG_COLOR_MODE = 16384; // 0x4000
    field public static final int CONFIG_DENSITY = 4096; // 0x1000
    field public static final int CONFIG_FONT_SCALE = 1073741824; // 0x40000000
    field public static final int CONFIG_KEYBOARD = 16; // 0x10
    field public static final int CONFIG_KEYBOARD_HIDDEN = 32; // 0x20
    field public static final int CONFIG_LAYOUT_DIRECTION = 8192; // 0x2000
    field public static final int CONFIG_LOCALE = 4; // 0x4
    field public static final int CONFIG_MCC = 1; // 0x1
    field public static final int CONFIG_MNC = 2; // 0x2
    field public static final int CONFIG_NAVIGATION = 64; // 0x40
    field public static final int CONFIG_ORIENTATION = 128; // 0x80
    field public static final int CONFIG_SCREEN_LAYOUT = 256; // 0x100
    field public static final int CONFIG_SCREEN_SIZE = 1024; // 0x400
    field public static final int CONFIG_SMALLEST_SCREEN_SIZE = 2048; // 0x800
    field public static final int CONFIG_TOUCHSCREEN = 8; // 0x8
    field public static final int CONFIG_UI_MODE = 512; // 0x200
    field public static final android.os.Parcelable.Creator<android.content.pm.ActivityInfo> CREATOR;
    field public static final int DOCUMENT_LAUNCH_ALWAYS = 2; // 0x2
    field public static final int DOCUMENT_LAUNCH_INTO_EXISTING = 1; // 0x1
    field public static final int DOCUMENT_LAUNCH_NEVER = 3; // 0x3
    field public static final int DOCUMENT_LAUNCH_NONE = 0; // 0x0
    field public static final int FLAG_ALLOW_TASK_REPARENTING = 64; // 0x40
    field public static final int FLAG_ALWAYS_RETAIN_TASK_STATE = 8; // 0x8
    field public static final int FLAG_AUTO_REMOVE_FROM_RECENTS = 8192; // 0x2000
    field public static final int FLAG_CLEAR_TASK_ON_LAUNCH = 4; // 0x4
    field public static final int FLAG_ENABLE_VR_MODE = 32768; // 0x8000
    field public static final int FLAG_EXCLUDE_FROM_RECENTS = 32; // 0x20
    field public static final int FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS = 256; // 0x100
    field public static final int FLAG_FINISH_ON_TASK_LAUNCH = 2; // 0x2
    field public static final int FLAG_HARDWARE_ACCELERATED = 512; // 0x200
    field public static final int FLAG_IMMERSIVE = 2048; // 0x800
    field public static final int FLAG_MULTIPROCESS = 1; // 0x1
    field public static final int FLAG_NO_HISTORY = 128; // 0x80
    field public static final int FLAG_RELINQUISH_TASK_IDENTITY = 4096; // 0x1000
    field public static final int FLAG_RESUME_WHILE_PAUSING = 16384; // 0x4000
    field public static final int FLAG_SINGLE_USER = 1073741824; // 0x40000000
    field public static final int FLAG_STATE_NOT_NEEDED = 16; // 0x10
    field public static final int LAUNCH_MULTIPLE = 0; // 0x0
    field public static final int LAUNCH_SINGLE_INSTANCE = 3; // 0x3
    field public static final int LAUNCH_SINGLE_TASK = 2; // 0x2
    field public static final int LAUNCH_SINGLE_TOP = 1; // 0x1
    field public static final int PERSIST_ACROSS_REBOOTS = 2; // 0x2
    field public static final int PERSIST_NEVER = 1; // 0x1
    field public static final int PERSIST_ROOT_ONLY = 0; // 0x0
    field public static final int SCREEN_ORIENTATION_BEHIND = 3; // 0x3
    field public static final int SCREEN_ORIENTATION_FULL_SENSOR = 10; // 0xa
    field public static final int SCREEN_ORIENTATION_FULL_USER = 13; // 0xd
    field public static final int SCREEN_ORIENTATION_LANDSCAPE = 0; // 0x0
    field public static final int SCREEN_ORIENTATION_LOCKED = 14; // 0xe
    field public static final int SCREEN_ORIENTATION_NOSENSOR = 5; // 0x5
    field public static final int SCREEN_ORIENTATION_PORTRAIT = 1; // 0x1
    field public static final int SCREEN_ORIENTATION_REVERSE_LANDSCAPE = 8; // 0x8
    field public static final int SCREEN_ORIENTATION_REVERSE_PORTRAIT = 9; // 0x9
    field public static final int SCREEN_ORIENTATION_SENSOR = 4; // 0x4
    field public static final int SCREEN_ORIENTATION_SENSOR_LANDSCAPE = 6; // 0x6
    field public static final int SCREEN_ORIENTATION_SENSOR_PORTRAIT = 7; // 0x7
    field public static final int SCREEN_ORIENTATION_UNSPECIFIED = -1; // 0xffffffff
    field public static final int SCREEN_ORIENTATION_USER = 2; // 0x2
    field public static final int SCREEN_ORIENTATION_USER_LANDSCAPE = 11; // 0xb
    field public static final int SCREEN_ORIENTATION_USER_PORTRAIT = 12; // 0xc
    field public static final int UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW = 1; // 0x1
    field public int colorMode;
    field public int configChanges;
    field public int documentLaunchMode;
    field public int flags;
    field public int launchMode;
    field public int maxRecents;
    field public String parentActivityName;
    field public String permission;
    field public int persistableMode;
    field public int screenOrientation;
    field public int softInputMode;
    field public String targetActivity;
    field public String taskAffinity;
    field public int theme;
    field public int uiOptions;
    field public android.content.pm.ActivityInfo.WindowLayout windowLayout;
  }

  public static final class ActivityInfo.WindowLayout {
    ctor public ActivityInfo.WindowLayout(int, float, int, float, int, int, int);
    field public final int gravity;
    field public final int height;
    field public final float heightFraction;
    field public final int minHeight;
    field public final int minWidth;
    field public final int width;
    field public final float widthFraction;
  }

  public class ApplicationInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
    ctor public ApplicationInfo();
    ctor public ApplicationInfo(android.content.pm.ApplicationInfo);
    method public int describeContents();
    method public void dump(android.util.Printer, String);
    method public static CharSequence getCategoryTitle(android.content.Context, int);
    method public boolean isVirtualPreload();
    method public CharSequence loadDescription(android.content.pm.PackageManager);
    field public static final int CATEGORY_AUDIO = 1; // 0x1
    field public static final int CATEGORY_GAME = 0; // 0x0
    field public static final int CATEGORY_IMAGE = 3; // 0x3
    field public static final int CATEGORY_MAPS = 6; // 0x6
    field public static final int CATEGORY_NEWS = 5; // 0x5
    field public static final int CATEGORY_PRODUCTIVITY = 7; // 0x7
    field public static final int CATEGORY_SOCIAL = 4; // 0x4
    field public static final int CATEGORY_UNDEFINED = -1; // 0xffffffff
    field public static final int CATEGORY_VIDEO = 2; // 0x2
    field public static final android.os.Parcelable.Creator<android.content.pm.ApplicationInfo> CREATOR;
    field public static final int FLAG_ALLOW_BACKUP = 32768; // 0x8000
    field public static final int FLAG_ALLOW_CLEAR_USER_DATA = 64; // 0x40
    field public static final int FLAG_ALLOW_TASK_REPARENTING = 32; // 0x20
    field public static final int FLAG_DEBUGGABLE = 2; // 0x2
    field public static final int FLAG_EXTERNAL_STORAGE = 262144; // 0x40000
    field public static final int FLAG_EXTRACT_NATIVE_LIBS = 268435456; // 0x10000000
    field public static final int FLAG_FACTORY_TEST = 16; // 0x10
    field public static final int FLAG_FULL_BACKUP_ONLY = 67108864; // 0x4000000
    field public static final int FLAG_HARDWARE_ACCELERATED = 536870912; // 0x20000000
    field public static final int FLAG_HAS_CODE = 4; // 0x4
    field public static final int FLAG_INSTALLED = 8388608; // 0x800000
    field public static final int FLAG_IS_DATA_ONLY = 16777216; // 0x1000000
    field @Deprecated public static final int FLAG_IS_GAME = 33554432; // 0x2000000
    field public static final int FLAG_KILL_AFTER_RESTORE = 65536; // 0x10000
    field public static final int FLAG_LARGE_HEAP = 1048576; // 0x100000
    field public static final int FLAG_MULTIARCH = -2147483648; // 0x80000000
    field public static final int FLAG_PERSISTENT = 8; // 0x8
    field public static final int FLAG_RESIZEABLE_FOR_SCREENS = 4096; // 0x1000
    field public static final int FLAG_RESTORE_ANY_VERSION = 131072; // 0x20000
    field public static final int FLAG_STOPPED = 2097152; // 0x200000
    field public static final int FLAG_SUPPORTS_LARGE_SCREENS = 2048; // 0x800
    field public static final int FLAG_SUPPORTS_NORMAL_SCREENS = 1024; // 0x400
    field public static final int FLAG_SUPPORTS_RTL = 4194304; // 0x400000
    field public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 8192; // 0x2000
    field public static final int FLAG_SUPPORTS_SMALL_SCREENS = 512; // 0x200
    field public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 524288; // 0x80000
    field public static final int FLAG_SUSPENDED = 1073741824; // 0x40000000
    field public static final int FLAG_SYSTEM = 1; // 0x1
    field public static final int FLAG_TEST_ONLY = 256; // 0x100
    field public static final int FLAG_UPDATED_SYSTEM_APP = 128; // 0x80
    field public static final int FLAG_USES_CLEARTEXT_TRAFFIC = 134217728; // 0x8000000
    field public static final int FLAG_VM_SAFE_MODE = 16384; // 0x4000
    field public String appComponentFactory;
    field public String backupAgentName;
    field public int category;
    field public String className;
    field public int compatibleWidthLimitDp;
    field public String dataDir;
    field public int descriptionRes;
    field public String deviceProtectedDataDir;
    field public boolean enabled;
    field public int flags;
    field public int largestWidthLimitDp;
    field public String manageSpaceActivityName;
    field public int minSdkVersion;
    field public String nativeLibraryDir;
    field public String permission;
    field public String processName;
    field public String publicSourceDir;
    field public int requiresSmallestWidthDp;
    field public String[] sharedLibraryFiles;
    field public String sourceDir;
    field public String[] splitNames;
    field public String[] splitPublicSourceDirs;
    field public String[] splitSourceDirs;
    field public java.util.UUID storageUuid;
    field public int targetSdkVersion;
    field public String taskAffinity;
    field public int theme;
    field public int uiOptions;
    field public int uid;
  }

  public static class ApplicationInfo.DisplayNameComparator implements java.util.Comparator<android.content.pm.ApplicationInfo> {
    ctor public ApplicationInfo.DisplayNameComparator(android.content.pm.PackageManager);
    method public final int compare(android.content.pm.ApplicationInfo, android.content.pm.ApplicationInfo);
  }

  public final class ChangedPackages implements android.os.Parcelable {
    ctor public ChangedPackages(int, @NonNull java.util.List<java.lang.String>);
    method public int describeContents();
    method @NonNull public java.util.List<java.lang.String> getPackageNames();
    method public int getSequenceNumber();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.ChangedPackages> CREATOR;
  }

  public class ComponentInfo extends android.content.pm.PackageItemInfo {
    ctor public ComponentInfo();
    ctor public ComponentInfo(android.content.pm.ComponentInfo);
    ctor protected ComponentInfo(android.os.Parcel);
    method public final int getBannerResource();
    method public final int getIconResource();
    method public final int getLogoResource();
    method public boolean isEnabled();
    field public android.content.pm.ApplicationInfo applicationInfo;
    field public int descriptionRes;
    field public boolean directBootAware;
    field public boolean enabled;
    field public boolean exported;
    field public String processName;
    field public String splitName;
  }

  public class ConfigurationInfo implements android.os.Parcelable {
    ctor public ConfigurationInfo();
    ctor public ConfigurationInfo(android.content.pm.ConfigurationInfo);
    method public int describeContents();
    method public String getGlEsVersion();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.ConfigurationInfo> CREATOR;
    field public static final int GL_ES_VERSION_UNDEFINED = 0; // 0x0
    field public static final int INPUT_FEATURE_FIVE_WAY_NAV = 2; // 0x2
    field public static final int INPUT_FEATURE_HARD_KEYBOARD = 1; // 0x1
    field public int reqGlEsVersion;
    field public int reqInputFeatures;
    field public int reqKeyboardType;
    field public int reqNavigation;
    field public int reqTouchScreen;
  }

  public class CrossProfileApps {
    method @NonNull public android.graphics.drawable.Drawable getProfileSwitchingIconDrawable(@NonNull android.os.UserHandle);
    method @NonNull public CharSequence getProfileSwitchingLabel(@NonNull android.os.UserHandle);
    method @NonNull public java.util.List<android.os.UserHandle> getTargetUserProfiles();
    method public void startMainActivity(@NonNull android.content.ComponentName, @NonNull android.os.UserHandle);
  }

  public final class FeatureGroupInfo implements android.os.Parcelable {
    ctor public FeatureGroupInfo();
    ctor public FeatureGroupInfo(android.content.pm.FeatureGroupInfo);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.FeatureGroupInfo> CREATOR;
    field public android.content.pm.FeatureInfo[] features;
  }

  public class FeatureInfo implements android.os.Parcelable {
    ctor public FeatureInfo();
    ctor public FeatureInfo(android.content.pm.FeatureInfo);
    method public int describeContents();
    method public String getGlEsVersion();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.FeatureInfo> CREATOR;
    field public static final int FLAG_REQUIRED = 1; // 0x1
    field public static final int GL_ES_VERSION_UNDEFINED = 0; // 0x0
    field public int flags;
    field public String name;
    field public int reqGlEsVersion;
    field public int version;
  }

  public class InstrumentationInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
    ctor public InstrumentationInfo();
    ctor public InstrumentationInfo(android.content.pm.InstrumentationInfo);
    method public int describeContents();
    field public static final android.os.Parcelable.Creator<android.content.pm.InstrumentationInfo> CREATOR;
    field public String dataDir;
    field public boolean functionalTest;
    field public boolean handleProfiling;
    field public String publicSourceDir;
    field public String sourceDir;
    field public String[] splitNames;
    field public String[] splitPublicSourceDirs;
    field public String[] splitSourceDirs;
    field public String targetPackage;
    field public String targetProcesses;
  }

  public class LabeledIntent extends android.content.Intent {
    ctor public LabeledIntent(android.content.Intent, String, int, int);
    ctor public LabeledIntent(android.content.Intent, String, CharSequence, int);
    ctor public LabeledIntent(String, int, int);
    ctor public LabeledIntent(String, CharSequence, int);
    method public int getIconResource();
    method public int getLabelResource();
    method public CharSequence getNonLocalizedLabel();
    method public String getSourcePackage();
    method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager);
    method public CharSequence loadLabel(android.content.pm.PackageManager);
    field public static final android.os.Parcelable.Creator<android.content.pm.LabeledIntent> CREATOR;
  }

  public class LauncherActivityInfo {
    method public android.content.pm.ApplicationInfo getApplicationInfo();
    method public android.graphics.drawable.Drawable getBadgedIcon(int);
    method public android.content.ComponentName getComponentName();
    method public long getFirstInstallTime();
    method public android.graphics.drawable.Drawable getIcon(int);
    method public CharSequence getLabel();
    method public String getName();
    method public android.os.UserHandle getUser();
  }

  public class LauncherApps {
    method public java.util.List<android.content.pm.LauncherActivityInfo> getActivityList(String, android.os.UserHandle);
    method public android.content.pm.ApplicationInfo getApplicationInfo(@NonNull String, int, @NonNull android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.pm.LauncherApps.PinItemRequest getPinItemRequest(android.content.Intent);
    method public java.util.List<android.os.UserHandle> getProfiles();
    method public android.graphics.drawable.Drawable getShortcutBadgedIconDrawable(android.content.pm.ShortcutInfo, int);
    method @Nullable public android.content.IntentSender getShortcutConfigActivityIntent(@NonNull android.content.pm.LauncherActivityInfo);
    method public java.util.List<android.content.pm.LauncherActivityInfo> getShortcutConfigActivityList(@Nullable String, @NonNull android.os.UserHandle);
    method public android.graphics.drawable.Drawable getShortcutIconDrawable(@NonNull android.content.pm.ShortcutInfo, int);
    method @Nullable public java.util.List<android.content.pm.ShortcutInfo> getShortcuts(@NonNull android.content.pm.LauncherApps.ShortcutQuery, @NonNull android.os.UserHandle);
    method @Nullable public android.os.Bundle getSuspendedPackageLauncherExtras(String, android.os.UserHandle);
    method public boolean hasShortcutHostPermission();
    method public boolean isActivityEnabled(android.content.ComponentName, android.os.UserHandle);
    method public boolean isPackageEnabled(String, android.os.UserHandle);
    method public void pinShortcuts(@NonNull String, @NonNull java.util.List<java.lang.String>, @NonNull android.os.UserHandle);
    method public void registerCallback(android.content.pm.LauncherApps.Callback);
    method public void registerCallback(android.content.pm.LauncherApps.Callback, android.os.Handler);
    method public android.content.pm.LauncherActivityInfo resolveActivity(android.content.Intent, android.os.UserHandle);
    method public void startAppDetailsActivity(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle);
    method public void startMainActivity(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle);
    method public void startShortcut(@NonNull String, @NonNull String, @Nullable android.graphics.Rect, @Nullable android.os.Bundle, @NonNull android.os.UserHandle);
    method public void startShortcut(@NonNull android.content.pm.ShortcutInfo, @Nullable android.graphics.Rect, @Nullable android.os.Bundle);
    method public void unregisterCallback(android.content.pm.LauncherApps.Callback);
    field public static final String ACTION_CONFIRM_PIN_APPWIDGET = "android.content.pm.action.CONFIRM_PIN_APPWIDGET";
    field public static final String ACTION_CONFIRM_PIN_SHORTCUT = "android.content.pm.action.CONFIRM_PIN_SHORTCUT";
    field public static final String EXTRA_PIN_ITEM_REQUEST = "android.content.pm.extra.PIN_ITEM_REQUEST";
  }

  public abstract static class LauncherApps.Callback {
    ctor public LauncherApps.Callback();
    method public abstract void onPackageAdded(String, android.os.UserHandle);
    method public abstract void onPackageChanged(String, android.os.UserHandle);
    method public abstract void onPackageRemoved(String, android.os.UserHandle);
    method public abstract void onPackagesAvailable(String[], android.os.UserHandle, boolean);
    method public void onPackagesSuspended(String[], android.os.UserHandle);
    method public void onPackagesSuspended(String[], android.os.UserHandle, @Nullable android.os.Bundle);
    method public abstract void onPackagesUnavailable(String[], android.os.UserHandle, boolean);
    method public void onPackagesUnsuspended(String[], android.os.UserHandle);
    method public void onShortcutsChanged(@NonNull String, @NonNull java.util.List<android.content.pm.ShortcutInfo>, @NonNull android.os.UserHandle);
  }

  public static final class LauncherApps.PinItemRequest implements android.os.Parcelable {
    method public boolean accept(@Nullable android.os.Bundle);
    method public boolean accept();
    method public int describeContents();
    method @Nullable public android.appwidget.AppWidgetProviderInfo getAppWidgetProviderInfo(android.content.Context);
    method @Nullable public android.os.Bundle getExtras();
    method public int getRequestType();
    method @Nullable public android.content.pm.ShortcutInfo getShortcutInfo();
    method public boolean isValid();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.LauncherApps.PinItemRequest> CREATOR;
    field public static final int REQUEST_TYPE_APPWIDGET = 2; // 0x2
    field public static final int REQUEST_TYPE_SHORTCUT = 1; // 0x1
  }

  public static class LauncherApps.ShortcutQuery {
    ctor public LauncherApps.ShortcutQuery();
    method public android.content.pm.LauncherApps.ShortcutQuery setActivity(@Nullable android.content.ComponentName);
    method public android.content.pm.LauncherApps.ShortcutQuery setChangedSince(long);
    method public android.content.pm.LauncherApps.ShortcutQuery setPackage(@Nullable String);
    method public android.content.pm.LauncherApps.ShortcutQuery setQueryFlags(int);
    method public android.content.pm.LauncherApps.ShortcutQuery setShortcutIds(@Nullable java.util.List<java.lang.String>);
    field public static final int FLAG_GET_KEY_FIELDS_ONLY = 4; // 0x4
    field public static final int FLAG_MATCH_DYNAMIC = 1; // 0x1
    field public static final int FLAG_MATCH_MANIFEST = 8; // 0x8
    field public static final int FLAG_MATCH_PINNED = 2; // 0x2
    field public static final int FLAG_MATCH_PINNED_BY_ANY_LAUNCHER = 1024; // 0x400
  }

  public class PackageInfo implements android.os.Parcelable {
    ctor public PackageInfo();
    method public int describeContents();
    method public long getLongVersionCode();
    method public void setLongVersionCode(long);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.PackageInfo> CREATOR;
    field public static final int INSTALL_LOCATION_AUTO = 0; // 0x0
    field public static final int INSTALL_LOCATION_INTERNAL_ONLY = 1; // 0x1
    field public static final int INSTALL_LOCATION_PREFER_EXTERNAL = 2; // 0x2
    field public static final int REQUESTED_PERMISSION_GRANTED = 2; // 0x2
    field public android.content.pm.ActivityInfo[] activities;
    field public android.content.pm.ApplicationInfo applicationInfo;
    field public int baseRevisionCode;
    field public android.content.pm.ConfigurationInfo[] configPreferences;
    field public android.content.pm.FeatureGroupInfo[] featureGroups;
    field public long firstInstallTime;
    field public int[] gids;
    field public int installLocation;
    field public android.content.pm.InstrumentationInfo[] instrumentation;
    field public boolean isApex;
    field public long lastUpdateTime;
    field public String packageName;
    field public android.content.pm.PermissionInfo[] permissions;
    field public android.content.pm.ProviderInfo[] providers;
    field public android.content.pm.ActivityInfo[] receivers;
    field public android.content.pm.FeatureInfo[] reqFeatures;
    field public String[] requestedPermissions;
    field public int[] requestedPermissionsFlags;
    field public android.content.pm.ServiceInfo[] services;
    field public String sharedUserId;
    field public int sharedUserLabel;
    field @Deprecated public android.content.pm.Signature[] signatures;
    field public android.content.pm.SigningInfo signingInfo;
    field public String[] splitNames;
    field public int[] splitRevisionCodes;
    field @Deprecated public int versionCode;
    field public String versionName;
  }

  public class PackageInstaller {
    method public void abandonSession(int);
    method public int createSession(@NonNull android.content.pm.PackageInstaller.SessionParams) throws java.io.IOException;
    method @NonNull public java.util.List<android.content.pm.PackageInstaller.SessionInfo> getAllSessions();
    method @NonNull public java.util.List<android.content.pm.PackageInstaller.SessionInfo> getMySessions();
    method @Nullable public android.content.pm.PackageInstaller.SessionInfo getSessionInfo(int);
    method @NonNull public android.content.pm.PackageInstaller.Session openSession(int) throws java.io.IOException;
    method public void registerSessionCallback(@NonNull android.content.pm.PackageInstaller.SessionCallback);
    method public void registerSessionCallback(@NonNull android.content.pm.PackageInstaller.SessionCallback, @NonNull android.os.Handler);
    method @RequiresPermission(anyOf={android.Manifest.permission.DELETE_PACKAGES, android.Manifest.permission.REQUEST_DELETE_PACKAGES}) public void uninstall(@NonNull String, @NonNull android.content.IntentSender);
    method @RequiresPermission(anyOf={android.Manifest.permission.DELETE_PACKAGES, android.Manifest.permission.REQUEST_DELETE_PACKAGES}) public void uninstall(@NonNull android.content.pm.VersionedPackage, @NonNull android.content.IntentSender);
    method public void unregisterSessionCallback(@NonNull android.content.pm.PackageInstaller.SessionCallback);
    method public void updateSessionAppIcon(int, @Nullable android.graphics.Bitmap);
    method public void updateSessionAppLabel(int, @Nullable CharSequence);
    field public static final String ACTION_SESSION_COMMITTED = "android.content.pm.action.SESSION_COMMITTED";
    field public static final String ACTION_SESSION_DETAILS = "android.content.pm.action.SESSION_DETAILS";
    field public static final String EXTRA_OTHER_PACKAGE_NAME = "android.content.pm.extra.OTHER_PACKAGE_NAME";
    field public static final String EXTRA_PACKAGE_NAME = "android.content.pm.extra.PACKAGE_NAME";
    field public static final String EXTRA_SESSION = "android.content.pm.extra.SESSION";
    field public static final String EXTRA_SESSION_ID = "android.content.pm.extra.SESSION_ID";
    field public static final String EXTRA_STATUS = "android.content.pm.extra.STATUS";
    field public static final String EXTRA_STATUS_MESSAGE = "android.content.pm.extra.STATUS_MESSAGE";
    field public static final String EXTRA_STORAGE_PATH = "android.content.pm.extra.STORAGE_PATH";
    field public static final int STATUS_FAILURE = 1; // 0x1
    field public static final int STATUS_FAILURE_ABORTED = 3; // 0x3
    field public static final int STATUS_FAILURE_BLOCKED = 2; // 0x2
    field public static final int STATUS_FAILURE_CONFLICT = 5; // 0x5
    field public static final int STATUS_FAILURE_INCOMPATIBLE = 7; // 0x7
    field public static final int STATUS_FAILURE_INVALID = 4; // 0x4
    field public static final int STATUS_FAILURE_STORAGE = 6; // 0x6
    field public static final int STATUS_PENDING_USER_ACTION = -1; // 0xffffffff
    field public static final int STATUS_SUCCESS = 0; // 0x0
  }

  public static class PackageInstaller.Session implements java.io.Closeable {
    method public void abandon();
    method public void close();
    method public void commit(@NonNull android.content.IntentSender);
    method public void fsync(@NonNull java.io.OutputStream) throws java.io.IOException;
    method @NonNull public String[] getNames() throws java.io.IOException;
    method @NonNull public java.io.InputStream openRead(@NonNull String) throws java.io.IOException;
    method @NonNull public java.io.OutputStream openWrite(@NonNull String, long, long) throws java.io.IOException;
    method public void removeSplit(@NonNull String) throws java.io.IOException;
    method public void setStagingProgress(float);
    method public void transfer(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException;
  }

  public abstract static class PackageInstaller.SessionCallback {
    ctor public PackageInstaller.SessionCallback();
    method public abstract void onActiveChanged(int, boolean);
    method public abstract void onBadgingChanged(int);
    method public abstract void onCreated(int);
    method public abstract void onFinished(int, boolean);
    method public abstract void onProgressChanged(int, float);
  }

  public static class PackageInstaller.SessionInfo implements android.os.Parcelable {
    method @Nullable public android.content.Intent createDetailsIntent();
    method public int describeContents();
    method @Nullable public android.graphics.Bitmap getAppIcon();
    method @Nullable public CharSequence getAppLabel();
    method @Nullable public String getAppPackageName();
    method public int getInstallLocation();
    method public int getInstallReason();
    method @Nullable public String getInstallerPackageName();
    method public int getMode();
    method public int getOriginatingUid();
    method @Nullable public android.net.Uri getOriginatingUri();
    method public float getProgress();
    method @Nullable public android.net.Uri getReferrerUri();
    method public int getSessionId();
    method public long getSize();
    method public boolean isActive();
    method public boolean isSealed();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.PackageInstaller.SessionInfo> CREATOR;
  }

  public static class PackageInstaller.SessionParams implements android.os.Parcelable {
    ctor public PackageInstaller.SessionParams(int);
    method public int describeContents();
    method public void setAppIcon(@Nullable android.graphics.Bitmap);
    method public void setAppLabel(@Nullable CharSequence);
    method public void setAppPackageName(@Nullable String);
    method public void setInstallLocation(int);
    method public void setInstallReason(int);
    method public void setOriginatingUid(int);
    method public void setOriginatingUri(@Nullable android.net.Uri);
    method public void setReferrerUri(@Nullable android.net.Uri);
    method public void setSize(long);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.PackageInstaller.SessionParams> CREATOR;
    field public static final int MODE_FULL_INSTALL = 1; // 0x1
    field public static final int MODE_INHERIT_EXISTING = 2; // 0x2
  }

  public class PackageItemInfo {
    ctor public PackageItemInfo();
    ctor public PackageItemInfo(android.content.pm.PackageItemInfo);
    ctor protected PackageItemInfo(android.os.Parcel);
    method protected void dumpBack(android.util.Printer, String);
    method protected void dumpFront(android.util.Printer, String);
    method public android.graphics.drawable.Drawable loadBanner(android.content.pm.PackageManager);
    method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager);
    method @NonNull public CharSequence loadLabel(@NonNull android.content.pm.PackageManager);
    method public android.graphics.drawable.Drawable loadLogo(android.content.pm.PackageManager);
    method public android.graphics.drawable.Drawable loadUnbadgedIcon(android.content.pm.PackageManager);
    method public android.content.res.XmlResourceParser loadXmlMetaData(android.content.pm.PackageManager, String);
    method public void writeToParcel(android.os.Parcel, int);
    field public int banner;
    field public int icon;
    field public int labelRes;
    field public int logo;
    field public android.os.Bundle metaData;
    field public String name;
    field public CharSequence nonLocalizedLabel;
    field public String packageName;
  }

  public static class PackageItemInfo.DisplayNameComparator implements java.util.Comparator<android.content.pm.PackageItemInfo> {
    ctor public PackageItemInfo.DisplayNameComparator(android.content.pm.PackageManager);
    method public final int compare(android.content.pm.PackageItemInfo, android.content.pm.PackageItemInfo);
  }

  public abstract class PackageManager {
    ctor public PackageManager();
    method @Deprecated public abstract void addPackageToPreferred(String);
    method public abstract boolean addPermission(android.content.pm.PermissionInfo);
    method public abstract boolean addPermissionAsync(android.content.pm.PermissionInfo);
    method @Deprecated public abstract void addPreferredActivity(android.content.IntentFilter, int, android.content.ComponentName[], android.content.ComponentName);
    method public abstract boolean canRequestPackageInstalls();
    method public abstract String[] canonicalToCurrentPackageNames(String[]);
    method @CheckResult public abstract int checkPermission(String, String);
    method @CheckResult public abstract int checkSignatures(String, String);
    method @CheckResult public abstract int checkSignatures(int, int);
    method public abstract void clearInstantAppCookie();
    method public abstract void clearPackagePreferredActivities(String);
    method public abstract String[] currentToCanonicalPackageNames(String[]);
    method public abstract void extendVerificationTimeout(int, int, long);
    method public abstract android.graphics.drawable.Drawable getActivityBanner(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.graphics.drawable.Drawable getActivityBanner(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.graphics.drawable.Drawable getActivityIcon(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.graphics.drawable.Drawable getActivityIcon(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.pm.ActivityInfo getActivityInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.graphics.drawable.Drawable getActivityLogo(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.graphics.drawable.Drawable getActivityLogo(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract java.util.List<android.content.pm.PermissionGroupInfo> getAllPermissionGroups(int);
    method public abstract android.graphics.drawable.Drawable getApplicationBanner(android.content.pm.ApplicationInfo);
    method public abstract android.graphics.drawable.Drawable getApplicationBanner(String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract int getApplicationEnabledSetting(@NonNull String);
    method public abstract android.graphics.drawable.Drawable getApplicationIcon(android.content.pm.ApplicationInfo);
    method public abstract android.graphics.drawable.Drawable getApplicationIcon(String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.pm.ApplicationInfo getApplicationInfo(String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract CharSequence getApplicationLabel(android.content.pm.ApplicationInfo);
    method public abstract android.graphics.drawable.Drawable getApplicationLogo(android.content.pm.ApplicationInfo);
    method public abstract android.graphics.drawable.Drawable getApplicationLogo(String) throws android.content.pm.PackageManager.NameNotFoundException;
    method @Nullable public abstract android.content.pm.ChangedPackages getChangedPackages(@IntRange(from=0) int);
    method public abstract int getComponentEnabledSetting(@NonNull android.content.ComponentName);
    method public abstract android.graphics.drawable.Drawable getDefaultActivityIcon();
    method public abstract android.graphics.drawable.Drawable getDrawable(String, @DrawableRes int, android.content.pm.ApplicationInfo);
    method public abstract java.util.List<android.content.pm.ApplicationInfo> getInstalledApplications(int);
    method public abstract java.util.List<android.content.pm.PackageInfo> getInstalledPackages(int);
    method @Nullable public abstract String getInstallerPackageName(String);
    method @NonNull public abstract byte[] getInstantAppCookie();
    method public abstract int getInstantAppCookieMaxBytes();
    method public abstract android.content.pm.InstrumentationInfo getInstrumentationInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method @Nullable public abstract android.content.Intent getLaunchIntentForPackage(@NonNull String);
    method @Nullable public abstract android.content.Intent getLeanbackLaunchIntentForPackage(@NonNull String);
    method @Nullable public abstract String getNameForUid(int);
    method public android.content.pm.PackageInfo getPackageArchiveInfo(String, int);
    method public abstract int[] getPackageGids(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract int[] getPackageGids(String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.pm.PackageInfo getPackageInfo(String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.pm.PackageInfo getPackageInfo(android.content.pm.VersionedPackage, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method @NonNull public abstract android.content.pm.PackageInstaller getPackageInstaller();
    method public abstract int getPackageUid(String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method @Nullable public abstract String[] getPackagesForUid(int);
    method public abstract java.util.List<android.content.pm.PackageInfo> getPackagesHoldingPermissions(String[], int);
    method public abstract android.content.pm.PermissionGroupInfo getPermissionGroupInfo(String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.pm.PermissionInfo getPermissionInfo(String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract int getPreferredActivities(@NonNull java.util.List<android.content.IntentFilter>, @NonNull java.util.List<android.content.ComponentName>, String);
    method public abstract java.util.List<android.content.pm.PackageInfo> getPreferredPackages(int);
    method public abstract android.content.pm.ProviderInfo getProviderInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.pm.ActivityInfo getReceiverInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.res.Resources getResourcesForActivity(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.res.Resources getResourcesForApplication(android.content.pm.ApplicationInfo) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.res.Resources getResourcesForApplication(String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.pm.ServiceInfo getServiceInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method @NonNull public abstract java.util.List<android.content.pm.SharedLibraryInfo> getSharedLibraries(int);
    method @Nullable public android.os.Bundle getSuspendedPackageAppExtras();
    method public abstract android.content.pm.FeatureInfo[] getSystemAvailableFeatures();
    method public abstract String[] getSystemSharedLibraryNames();
    method public abstract CharSequence getText(String, @StringRes int, android.content.pm.ApplicationInfo);
    method public abstract android.graphics.drawable.Drawable getUserBadgedDrawableForDensity(android.graphics.drawable.Drawable, android.os.UserHandle, android.graphics.Rect, int);
    method public abstract android.graphics.drawable.Drawable getUserBadgedIcon(android.graphics.drawable.Drawable, android.os.UserHandle);
    method public abstract CharSequence getUserBadgedLabel(CharSequence, android.os.UserHandle);
    method public abstract android.content.res.XmlResourceParser getXml(String, @XmlRes int, android.content.pm.ApplicationInfo);
    method public boolean hasSigningCertificate(String, byte[], int);
    method public boolean hasSigningCertificate(int, byte[], int);
    method public abstract boolean hasSystemFeature(String);
    method public abstract boolean hasSystemFeature(String, int);
    method public abstract boolean isInstantApp();
    method public abstract boolean isInstantApp(String);
    method public boolean isPackageSuspended();
    method @CheckResult public abstract boolean isPermissionRevokedByPolicy(@NonNull String, @NonNull String);
    method public abstract boolean isSafeMode();
    method public abstract java.util.List<android.content.pm.ResolveInfo> queryBroadcastReceivers(android.content.Intent, int);
    method public abstract java.util.List<android.content.pm.ProviderInfo> queryContentProviders(String, int, int);
    method public abstract java.util.List<android.content.pm.InstrumentationInfo> queryInstrumentation(String, int);
    method public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentActivities(android.content.Intent, int);
    method public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentActivityOptions(@Nullable android.content.ComponentName, @Nullable android.content.Intent[], android.content.Intent, int);
    method public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentContentProviders(android.content.Intent, int);
    method public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentServices(android.content.Intent, int);
    method public abstract java.util.List<android.content.pm.PermissionInfo> queryPermissionsByGroup(String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method @Deprecated public abstract void removePackageFromPreferred(String);
    method public abstract void removePermission(String);
    method public abstract android.content.pm.ResolveInfo resolveActivity(android.content.Intent, int);
    method public abstract android.content.pm.ProviderInfo resolveContentProvider(String, int);
    method public abstract android.content.pm.ResolveInfo resolveService(android.content.Intent, int);
    method public abstract void setApplicationCategoryHint(@NonNull String, int);
    method @RequiresPermission(value=android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE, conditional=true) public abstract void setApplicationEnabledSetting(@NonNull String, int, int);
    method @RequiresPermission(value=android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE, conditional=true) public abstract void setComponentEnabledSetting(@NonNull android.content.ComponentName, int, int);
    method public abstract void setInstallerPackageName(String, String);
    method public abstract void updateInstantAppCookie(@Nullable byte[]);
    method public abstract void verifyPendingInstall(int, int);
    field public static final int CERT_INPUT_RAW_X509 = 0; // 0x0
    field public static final int CERT_INPUT_SHA256 = 1; // 0x1
    field public static final int COMPONENT_ENABLED_STATE_DEFAULT = 0; // 0x0
    field public static final int COMPONENT_ENABLED_STATE_DISABLED = 2; // 0x2
    field public static final int COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED = 4; // 0x4
    field public static final int COMPONENT_ENABLED_STATE_DISABLED_USER = 3; // 0x3
    field public static final int COMPONENT_ENABLED_STATE_ENABLED = 1; // 0x1
    field public static final int DONT_KILL_APP = 1; // 0x1
    field public static final String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID";
    field public static final String EXTRA_VERIFICATION_RESULT = "android.content.pm.extra.VERIFICATION_RESULT";
    field public static final String FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS = "android.software.activities_on_secondary_displays";
    field public static final String FEATURE_APP_WIDGETS = "android.software.app_widgets";
    field public static final String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency";
    field public static final String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output";
    field public static final String FEATURE_AUDIO_PRO = "android.hardware.audio.pro";
    field public static final String FEATURE_AUTOFILL = "android.software.autofill";
    field public static final String FEATURE_AUTOMOTIVE = "android.hardware.type.automotive";
    field public static final String FEATURE_BACKUP = "android.software.backup";
    field public static final String FEATURE_BLUETOOTH = "android.hardware.bluetooth";
    field public static final String FEATURE_BLUETOOTH_LE = "android.hardware.bluetooth_le";
    field public static final String FEATURE_CAMERA = "android.hardware.camera";
    field public static final String FEATURE_CAMERA_ANY = "android.hardware.camera.any";
    field public static final String FEATURE_CAMERA_AR = "android.hardware.camera.ar";
    field public static final String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus";
    field public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING = "android.hardware.camera.capability.manual_post_processing";
    field public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR = "android.hardware.camera.capability.manual_sensor";
    field public static final String FEATURE_CAMERA_CAPABILITY_RAW = "android.hardware.camera.capability.raw";
    field public static final String FEATURE_CAMERA_EXTERNAL = "android.hardware.camera.external";
    field public static final String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash";
    field public static final String FEATURE_CAMERA_FRONT = "android.hardware.camera.front";
    field public static final String FEATURE_CAMERA_LEVEL_FULL = "android.hardware.camera.level.full";
    field public static final String FEATURE_CANT_SAVE_STATE = "android.software.cant_save_state";
    field public static final String FEATURE_COMPANION_DEVICE_SETUP = "android.software.companion_device_setup";
    field public static final String FEATURE_CONNECTION_SERVICE = "android.software.connectionservice";
    field public static final String FEATURE_CONSUMER_IR = "android.hardware.consumerir";
    field public static final String FEATURE_DEVICE_ADMIN = "android.software.device_admin";
    field public static final String FEATURE_EMBEDDED = "android.hardware.type.embedded";
    field public static final String FEATURE_ETHERNET = "android.hardware.ethernet";
    field public static final String FEATURE_FAKETOUCH = "android.hardware.faketouch";
    field public static final String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT = "android.hardware.faketouch.multitouch.distinct";
    field public static final String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND = "android.hardware.faketouch.multitouch.jazzhand";
    field public static final String FEATURE_FINGERPRINT = "android.hardware.fingerprint";
    field public static final String FEATURE_FREEFORM_WINDOW_MANAGEMENT = "android.software.freeform_window_management";
    field public static final String FEATURE_GAMEPAD = "android.hardware.gamepad";
    field public static final String FEATURE_HIFI_SENSORS = "android.hardware.sensor.hifi_sensors";
    field public static final String FEATURE_HOME_SCREEN = "android.software.home_screen";
    field public static final String FEATURE_INPUT_METHODS = "android.software.input_methods";
    field public static final String FEATURE_LEANBACK = "android.software.leanback";
    field public static final String FEATURE_LEANBACK_ONLY = "android.software.leanback_only";
    field public static final String FEATURE_LIVE_TV = "android.software.live_tv";
    field public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper";
    field public static final String FEATURE_LOCATION = "android.hardware.location";
    field public static final String FEATURE_LOCATION_GPS = "android.hardware.location.gps";
    field public static final String FEATURE_LOCATION_NETWORK = "android.hardware.location.network";
    field public static final String FEATURE_MANAGED_USERS = "android.software.managed_users";
    field public static final String FEATURE_MICROPHONE = "android.hardware.microphone";
    field public static final String FEATURE_MIDI = "android.software.midi";
    field public static final String FEATURE_NFC = "android.hardware.nfc";
    field public static final String FEATURE_NFC_BEAM = "android.sofware.nfc.beam";
    field public static final String FEATURE_NFC_HOST_CARD_EMULATION = "android.hardware.nfc.hce";
    field public static final String FEATURE_NFC_HOST_CARD_EMULATION_NFCF = "android.hardware.nfc.hcef";
    field public static final String FEATURE_NFC_OFF_HOST_CARD_EMULATION_ESE = "android.hardware.nfc.ese";
    field public static final String FEATURE_NFC_OFF_HOST_CARD_EMULATION_UICC = "android.hardware.nfc.uicc";
    field public static final String FEATURE_OPENGLES_EXTENSION_PACK = "android.hardware.opengles.aep";
    field public static final String FEATURE_PC = "android.hardware.type.pc";
    field public static final String FEATURE_PICTURE_IN_PICTURE = "android.software.picture_in_picture";
    field public static final String FEATURE_PRINTING = "android.software.print";
    field public static final String FEATURE_RAM_LOW = "android.hardware.ram.low";
    field public static final String FEATURE_RAM_NORMAL = "android.hardware.ram.normal";
    field public static final String FEATURE_SCREEN_LANDSCAPE = "android.hardware.screen.landscape";
    field public static final String FEATURE_SCREEN_PORTRAIT = "android.hardware.screen.portrait";
    field public static final String FEATURE_SECURELY_REMOVES_USERS = "android.software.securely_removes_users";
    field public static final String FEATURE_SENSOR_ACCELEROMETER = "android.hardware.sensor.accelerometer";
    field public static final String FEATURE_SENSOR_AMBIENT_TEMPERATURE = "android.hardware.sensor.ambient_temperature";
    field public static final String FEATURE_SENSOR_BAROMETER = "android.hardware.sensor.barometer";
    field public static final String FEATURE_SENSOR_COMPASS = "android.hardware.sensor.compass";
    field public static final String FEATURE_SENSOR_GYROSCOPE = "android.hardware.sensor.gyroscope";
    field public static final String FEATURE_SENSOR_HEART_RATE = "android.hardware.sensor.heartrate";
    field public static final String FEATURE_SENSOR_HEART_RATE_ECG = "android.hardware.sensor.heartrate.ecg";
    field public static final String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light";
    field public static final String FEATURE_SENSOR_PROXIMITY = "android.hardware.sensor.proximity";
    field public static final String FEATURE_SENSOR_RELATIVE_HUMIDITY = "android.hardware.sensor.relative_humidity";
    field public static final String FEATURE_SENSOR_STEP_COUNTER = "android.hardware.sensor.stepcounter";
    field public static final String FEATURE_SENSOR_STEP_DETECTOR = "android.hardware.sensor.stepdetector";
    field public static final String FEATURE_SIP = "android.software.sip";
    field public static final String FEATURE_SIP_VOIP = "android.software.sip.voip";
    field public static final String FEATURE_STRONGBOX_KEYSTORE = "android.hardware.strongbox_keystore";
    field public static final String FEATURE_TELEPHONY = "android.hardware.telephony";
    field public static final String FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma";
    field public static final String FEATURE_TELEPHONY_EUICC = "android.hardware.telephony.euicc";
    field public static final String FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm";
    field public static final String FEATURE_TELEPHONY_IMS = "android.hardware.telephony.ims";
    field public static final String FEATURE_TELEPHONY_MBMS = "android.hardware.telephony.mbms";
    field @Deprecated public static final String FEATURE_TELEVISION = "android.hardware.type.television";
    field public static final String FEATURE_TOUCHSCREEN = "android.hardware.touchscreen";
    field public static final String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch";
    field public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT = "android.hardware.touchscreen.multitouch.distinct";
    field public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND = "android.hardware.touchscreen.multitouch.jazzhand";
    field public static final String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory";
    field public static final String FEATURE_USB_HOST = "android.hardware.usb.host";
    field public static final String FEATURE_VERIFIED_BOOT = "android.software.verified_boot";
    field public static final String FEATURE_VR_HEADTRACKING = "android.hardware.vr.headtracking";
    field @Deprecated public static final String FEATURE_VR_MODE = "android.software.vr.mode";
    field public static final String FEATURE_VR_MODE_HIGH_PERFORMANCE = "android.hardware.vr.high_performance";
    field public static final String FEATURE_VULKAN_HARDWARE_COMPUTE = "android.hardware.vulkan.compute";
    field public static final String FEATURE_VULKAN_HARDWARE_LEVEL = "android.hardware.vulkan.level";
    field public static final String FEATURE_VULKAN_HARDWARE_VERSION = "android.hardware.vulkan.version";
    field public static final String FEATURE_WATCH = "android.hardware.type.watch";
    field public static final String FEATURE_WEBVIEW = "android.software.webview";
    field public static final String FEATURE_WIFI = "android.hardware.wifi";
    field public static final String FEATURE_WIFI_AWARE = "android.hardware.wifi.aware";
    field public static final String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct";
    field public static final String FEATURE_WIFI_PASSPOINT = "android.hardware.wifi.passpoint";
    field public static final String FEATURE_WIFI_RTT = "android.hardware.wifi.rtt";
    field public static final int GET_ACTIVITIES = 1; // 0x1
    field public static final int GET_CONFIGURATIONS = 16384; // 0x4000
    field @Deprecated public static final int GET_DISABLED_COMPONENTS = 512; // 0x200
    field @Deprecated public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
    field public static final int GET_GIDS = 256; // 0x100
    field public static final int GET_INSTRUMENTATION = 16; // 0x10
    field public static final int GET_INTENT_FILTERS = 32; // 0x20
    field public static final int GET_META_DATA = 128; // 0x80
    field public static final int GET_PERMISSIONS = 4096; // 0x1000
    field public static final int GET_PROVIDERS = 8; // 0x8
    field public static final int GET_RECEIVERS = 2; // 0x2
    field public static final int GET_RESOLVED_FILTER = 64; // 0x40
    field public static final int GET_SERVICES = 4; // 0x4
    field public static final int GET_SHARED_LIBRARY_FILES = 1024; // 0x400
    field @Deprecated public static final int GET_SIGNATURES = 64; // 0x40
    field public static final int GET_SIGNING_CERTIFICATES = 134217728; // 0x8000000
    field @Deprecated public static final int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
    field public static final int GET_URI_PERMISSION_PATTERNS = 2048; // 0x800
    field public static final int INSTALL_REASON_DEVICE_RESTORE = 2; // 0x2
    field public static final int INSTALL_REASON_DEVICE_SETUP = 3; // 0x3
    field public static final int INSTALL_REASON_POLICY = 1; // 0x1
    field public static final int INSTALL_REASON_UNKNOWN = 0; // 0x0
    field public static final int INSTALL_REASON_USER = 4; // 0x4
    field public static final int MATCH_ALL = 131072; // 0x20000
    field public static final int MATCH_APEX = 1073741824; // 0x40000000
    field public static final int MATCH_DEFAULT_ONLY = 65536; // 0x10000
    field public static final int MATCH_DIRECT_BOOT_AWARE = 524288; // 0x80000
    field public static final int MATCH_DIRECT_BOOT_UNAWARE = 262144; // 0x40000
    field public static final int MATCH_DISABLED_COMPONENTS = 512; // 0x200
    field public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
    field public static final int MATCH_SYSTEM_ONLY = 1048576; // 0x100000
    field public static final int MATCH_UNINSTALLED_PACKAGES = 8192; // 0x2000
    field public static final long MAXIMUM_VERIFICATION_TIMEOUT = 3600000L; // 0x36ee80L
    field public static final int PERMISSION_DENIED = -1; // 0xffffffff
    field public static final int PERMISSION_GRANTED = 0; // 0x0
    field public static final int SIGNATURE_FIRST_NOT_SIGNED = -1; // 0xffffffff
    field public static final int SIGNATURE_MATCH = 0; // 0x0
    field public static final int SIGNATURE_NEITHER_SIGNED = 1; // 0x1
    field public static final int SIGNATURE_NO_MATCH = -3; // 0xfffffffd
    field public static final int SIGNATURE_SECOND_NOT_SIGNED = -2; // 0xfffffffe
    field public static final int SIGNATURE_UNKNOWN_PACKAGE = -4; // 0xfffffffc
    field public static final int VERIFICATION_ALLOW = 1; // 0x1
    field public static final int VERIFICATION_REJECT = -1; // 0xffffffff
    field public static final int VERSION_CODE_HIGHEST = -1; // 0xffffffff
  }

  public static class PackageManager.NameNotFoundException extends android.util.AndroidException {
    ctor public PackageManager.NameNotFoundException();
    ctor public PackageManager.NameNotFoundException(String);
  }

  @Deprecated public class PackageStats implements android.os.Parcelable {
    ctor @Deprecated public PackageStats(String);
    ctor @Deprecated public PackageStats(android.os.Parcel);
    ctor @Deprecated public PackageStats(android.content.pm.PackageStats);
    method @Deprecated public int describeContents();
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public static final android.os.Parcelable.Creator<android.content.pm.PackageStats> CREATOR;
    field @Deprecated public long cacheSize;
    field @Deprecated public long codeSize;
    field @Deprecated public long dataSize;
    field @Deprecated public long externalCacheSize;
    field @Deprecated public long externalCodeSize;
    field @Deprecated public long externalDataSize;
    field @Deprecated public long externalMediaSize;
    field @Deprecated public long externalObbSize;
    field @Deprecated public String packageName;
  }

  public class PathPermission extends android.os.PatternMatcher {
    ctor public PathPermission(String, int, String, String);
    ctor public PathPermission(android.os.Parcel);
    method public String getReadPermission();
    method public String getWritePermission();
    field public static final android.os.Parcelable.Creator<android.content.pm.PathPermission> CREATOR;
  }

  public class PermissionGroupInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
    ctor public PermissionGroupInfo();
    ctor public PermissionGroupInfo(android.content.pm.PermissionGroupInfo);
    method public int describeContents();
    method public CharSequence loadDescription(android.content.pm.PackageManager);
    field public static final android.os.Parcelable.Creator<android.content.pm.PermissionGroupInfo> CREATOR;
    field public static final int FLAG_PERSONAL_INFO = 1; // 0x1
    field public int descriptionRes;
    field public int flags;
    field public CharSequence nonLocalizedDescription;
    field public int priority;
  }

  public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
    ctor public PermissionInfo();
    ctor public PermissionInfo(android.content.pm.PermissionInfo);
    method public int describeContents();
    method public int getProtection();
    method public int getProtectionFlags();
    method public CharSequence loadDescription(android.content.pm.PackageManager);
    field public static final android.os.Parcelable.Creator<android.content.pm.PermissionInfo> CREATOR;
    field public static final int FLAG_COSTS_MONEY = 1; // 0x1
    field public static final int FLAG_INSTALLED = 1073741824; // 0x40000000
    field public static final int PROTECTION_DANGEROUS = 1; // 0x1
    field public static final int PROTECTION_FLAG_APPOP = 64; // 0x40
    field public static final int PROTECTION_FLAG_DEVELOPMENT = 32; // 0x20
    field public static final int PROTECTION_FLAG_INSTALLER = 256; // 0x100
    field public static final int PROTECTION_FLAG_INSTANT = 4096; // 0x1000
    field public static final int PROTECTION_FLAG_PRE23 = 128; // 0x80
    field public static final int PROTECTION_FLAG_PREINSTALLED = 1024; // 0x400
    field public static final int PROTECTION_FLAG_PRIVILEGED = 16; // 0x10
    field public static final int PROTECTION_FLAG_RUNTIME_ONLY = 8192; // 0x2000
    field public static final int PROTECTION_FLAG_SETUP = 2048; // 0x800
    field @Deprecated public static final int PROTECTION_FLAG_SYSTEM = 16; // 0x10
    field public static final int PROTECTION_FLAG_VERIFIER = 512; // 0x200
    field @Deprecated public static final int PROTECTION_MASK_BASE = 15; // 0xf
    field @Deprecated public static final int PROTECTION_MASK_FLAGS = 65520; // 0xfff0
    field public static final int PROTECTION_NORMAL = 0; // 0x0
    field public static final int PROTECTION_SIGNATURE = 2; // 0x2
    field @Deprecated public static final int PROTECTION_SIGNATURE_OR_SYSTEM = 3; // 0x3
    field public int descriptionRes;
    field public int flags;
    field public String group;
    field public CharSequence nonLocalizedDescription;
    field @Deprecated public int protectionLevel;
  }

  public final class ProviderInfo extends android.content.pm.ComponentInfo implements android.os.Parcelable {
    ctor public ProviderInfo();
    ctor public ProviderInfo(android.content.pm.ProviderInfo);
    method public int describeContents();
    method public void dump(android.util.Printer, String);
    field public static final android.os.Parcelable.Creator<android.content.pm.ProviderInfo> CREATOR;
    field public static final int FLAG_SINGLE_USER = 1073741824; // 0x40000000
    field public String authority;
    field public int flags;
    field public boolean grantUriPermissions;
    field public int initOrder;
    field @Deprecated public boolean isSyncable;
    field public boolean multiprocess;
    field public android.content.pm.PathPermission[] pathPermissions;
    field public String readPermission;
    field public android.os.PatternMatcher[] uriPermissionPatterns;
    field public String writePermission;
  }

  public class ResolveInfo implements android.os.Parcelable {
    ctor public ResolveInfo();
    ctor public ResolveInfo(android.content.pm.ResolveInfo);
    method public int describeContents();
    method public void dump(android.util.Printer, String);
    method public final int getIconResource();
    method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager);
    method public CharSequence loadLabel(android.content.pm.PackageManager);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.ResolveInfo> CREATOR;
    field public android.content.pm.ActivityInfo activityInfo;
    field public android.content.IntentFilter filter;
    field public int icon;
    field public boolean isDefault;
    field public boolean isInstantAppAvailable;
    field public int labelRes;
    field public int match;
    field public CharSequence nonLocalizedLabel;
    field public int preferredOrder;
    field public int priority;
    field public android.content.pm.ProviderInfo providerInfo;
    field public String resolvePackageName;
    field public android.content.pm.ServiceInfo serviceInfo;
    field public int specificIndex;
  }

  public static class ResolveInfo.DisplayNameComparator implements java.util.Comparator<android.content.pm.ResolveInfo> {
    ctor public ResolveInfo.DisplayNameComparator(android.content.pm.PackageManager);
    method public final int compare(android.content.pm.ResolveInfo, android.content.pm.ResolveInfo);
  }

  public class ServiceInfo extends android.content.pm.ComponentInfo implements android.os.Parcelable {
    ctor public ServiceInfo();
    ctor public ServiceInfo(android.content.pm.ServiceInfo);
    method public int describeContents();
    method public void dump(android.util.Printer, String);
    field public static final android.os.Parcelable.Creator<android.content.pm.ServiceInfo> CREATOR;
    field public static final int FLAG_EXTERNAL_SERVICE = 4; // 0x4
    field public static final int FLAG_ISOLATED_PROCESS = 2; // 0x2
    field public static final int FLAG_SINGLE_USER = 1073741824; // 0x40000000
    field public static final int FLAG_STOP_WITH_TASK = 1; // 0x1
    field public int flags;
    field public String permission;
  }

  public final class SharedLibraryInfo implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.content.pm.VersionedPackage getDeclaringPackage();
    method @NonNull public java.util.List<android.content.pm.VersionedPackage> getDependentPackages();
    method @IntRange(from=0xffffffff) public long getLongVersion();
    method public String getName();
    method public int getType();
    method @Deprecated @IntRange(from=0xffffffff) public int getVersion();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.SharedLibraryInfo> CREATOR;
    field public static final int TYPE_BUILTIN = 0; // 0x0
    field public static final int TYPE_DYNAMIC = 1; // 0x1
    field public static final int TYPE_STATIC = 2; // 0x2
    field public static final int VERSION_UNDEFINED = -1; // 0xffffffff
  }

  public final class ShortcutInfo implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.content.ComponentName getActivity();
    method @Nullable public java.util.Set<java.lang.String> getCategories();
    method @Nullable public CharSequence getDisabledMessage();
    method public int getDisabledReason();
    method @Nullable public android.os.PersistableBundle getExtras();
    method @NonNull public String getId();
    method @Nullable public android.content.Intent getIntent();
    method @Nullable public android.content.Intent[] getIntents();
    method public long getLastChangedTimestamp();
    method @Nullable public CharSequence getLongLabel();
    method @NonNull public String getPackage();
    method public int getRank();
    method @Nullable public CharSequence getShortLabel();
    method public android.os.UserHandle getUserHandle();
    method public boolean hasKeyFieldsOnly();
    method public boolean isDeclaredInManifest();
    method public boolean isDynamic();
    method public boolean isEnabled();
    method public boolean isImmutable();
    method public boolean isPinned();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.ShortcutInfo> CREATOR;
    field public static final int DISABLED_REASON_APP_CHANGED = 2; // 0x2
    field public static final int DISABLED_REASON_BACKUP_NOT_SUPPORTED = 101; // 0x65
    field public static final int DISABLED_REASON_BY_APP = 1; // 0x1
    field public static final int DISABLED_REASON_NOT_DISABLED = 0; // 0x0
    field public static final int DISABLED_REASON_OTHER_RESTORE_ISSUE = 103; // 0x67
    field public static final int DISABLED_REASON_SIGNATURE_MISMATCH = 102; // 0x66
    field public static final int DISABLED_REASON_UNKNOWN = 3; // 0x3
    field public static final int DISABLED_REASON_VERSION_LOWER = 100; // 0x64
    field public static final String SHORTCUT_CATEGORY_CONVERSATION = "android.shortcut.conversation";
  }

  public static class ShortcutInfo.Builder {
    ctor public ShortcutInfo.Builder(android.content.Context, String);
    method @NonNull public android.content.pm.ShortcutInfo build();
    method @NonNull public android.content.pm.ShortcutInfo.Builder setActivity(@NonNull android.content.ComponentName);
    method @NonNull public android.content.pm.ShortcutInfo.Builder setCategories(java.util.Set<java.lang.String>);
    method @NonNull public android.content.pm.ShortcutInfo.Builder setDisabledMessage(@NonNull CharSequence);
    method @NonNull public android.content.pm.ShortcutInfo.Builder setExtras(@NonNull android.os.PersistableBundle);
    method @NonNull public android.content.pm.ShortcutInfo.Builder setIcon(android.graphics.drawable.Icon);
    method @NonNull public android.content.pm.ShortcutInfo.Builder setIntent(@NonNull android.content.Intent);
    method @NonNull public android.content.pm.ShortcutInfo.Builder setIntents(@NonNull android.content.Intent[]);
    method @NonNull public android.content.pm.ShortcutInfo.Builder setLongLabel(@NonNull CharSequence);
    method @NonNull public android.content.pm.ShortcutInfo.Builder setRank(int);
    method @NonNull public android.content.pm.ShortcutInfo.Builder setShortLabel(@NonNull CharSequence);
  }

  public class ShortcutManager {
    method public boolean addDynamicShortcuts(@NonNull java.util.List<android.content.pm.ShortcutInfo>);
    method public android.content.Intent createShortcutResultIntent(@NonNull android.content.pm.ShortcutInfo);
    method public void disableShortcuts(@NonNull java.util.List<java.lang.String>);
    method public void disableShortcuts(@NonNull java.util.List<java.lang.String>, CharSequence);
    method public void enableShortcuts(@NonNull java.util.List<java.lang.String>);
    method @NonNull public java.util.List<android.content.pm.ShortcutInfo> getDynamicShortcuts();
    method public int getIconMaxHeight();
    method public int getIconMaxWidth();
    method @NonNull public java.util.List<android.content.pm.ShortcutInfo> getManifestShortcuts();
    method public int getMaxShortcutCountPerActivity();
    method @NonNull public java.util.List<android.content.pm.ShortcutInfo> getPinnedShortcuts();
    method public boolean isRateLimitingActive();
    method public boolean isRequestPinShortcutSupported();
    method public void removeAllDynamicShortcuts();
    method public void removeDynamicShortcuts(@NonNull java.util.List<java.lang.String>);
    method public void reportShortcutUsed(String);
    method public boolean requestPinShortcut(@NonNull android.content.pm.ShortcutInfo, @Nullable android.content.IntentSender);
    method public boolean setDynamicShortcuts(@NonNull java.util.List<android.content.pm.ShortcutInfo>);
    method public boolean updateShortcuts(@NonNull java.util.List<android.content.pm.ShortcutInfo>);
  }

  public class Signature implements android.os.Parcelable {
    ctor public Signature(byte[]);
    ctor public Signature(String);
    method public int describeContents();
    method public byte[] toByteArray();
    method public char[] toChars();
    method public char[] toChars(char[], int[]);
    method public String toCharsString();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.Signature> CREATOR;
  }

  public final class SigningInfo implements android.os.Parcelable {
    ctor public SigningInfo();
    ctor public SigningInfo(android.content.pm.SigningInfo);
    method public int describeContents();
    method public android.content.pm.Signature[] getApkContentsSigners();
    method public android.content.pm.Signature[] getSigningCertificateHistory();
    method public boolean hasMultipleSigners();
    method public boolean hasPastSigningCertificates();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.SigningInfo> CREATOR;
  }

  public final class VersionedPackage implements android.os.Parcelable {
    ctor public VersionedPackage(@NonNull String, int);
    ctor public VersionedPackage(@NonNull String, long);
    method public int describeContents();
    method public long getLongVersionCode();
    method @NonNull public String getPackageName();
    method @Deprecated public int getVersionCode();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.VersionedPackage> CREATOR;
  }

}

package android.content.res {

  public class AssetFileDescriptor implements java.io.Closeable android.os.Parcelable {
    ctor public AssetFileDescriptor(android.os.ParcelFileDescriptor, long, long);
    ctor public AssetFileDescriptor(android.os.ParcelFileDescriptor, long, long, android.os.Bundle);
    method public void close() throws java.io.IOException;
    method public java.io.FileInputStream createInputStream() throws java.io.IOException;
    method public java.io.FileOutputStream createOutputStream() throws java.io.IOException;
    method public int describeContents();
    method public long getDeclaredLength();
    method public android.os.Bundle getExtras();
    method public java.io.FileDescriptor getFileDescriptor();
    method public long getLength();
    method public android.os.ParcelFileDescriptor getParcelFileDescriptor();
    method public long getStartOffset();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.res.AssetFileDescriptor> CREATOR;
    field public static final long UNKNOWN_LENGTH = -1L; // 0xffffffffffffffffL
  }

  public static class AssetFileDescriptor.AutoCloseInputStream extends android.os.ParcelFileDescriptor.AutoCloseInputStream {
    ctor public AssetFileDescriptor.AutoCloseInputStream(android.content.res.AssetFileDescriptor) throws java.io.IOException;
  }

  public static class AssetFileDescriptor.AutoCloseOutputStream extends android.os.ParcelFileDescriptor.AutoCloseOutputStream {
    ctor public AssetFileDescriptor.AutoCloseOutputStream(android.content.res.AssetFileDescriptor) throws java.io.IOException;
  }

  public final class AssetManager implements java.lang.AutoCloseable {
    method public void close();
    method public String[] getLocales();
    method @Nullable public String[] list(@NonNull String) throws java.io.IOException;
    method @NonNull public java.io.InputStream open(@NonNull String) throws java.io.IOException;
    method @NonNull public java.io.InputStream open(@NonNull String, int) throws java.io.IOException;
    method @NonNull public android.content.res.AssetFileDescriptor openFd(@NonNull String) throws java.io.IOException;
    method @NonNull public android.content.res.AssetFileDescriptor openNonAssetFd(@NonNull String) throws java.io.IOException;
    method @NonNull public android.content.res.AssetFileDescriptor openNonAssetFd(int, @NonNull String) throws java.io.IOException;
    method @NonNull public android.content.res.XmlResourceParser openXmlResourceParser(@NonNull String) throws java.io.IOException;
    method @NonNull public android.content.res.XmlResourceParser openXmlResourceParser(int, @NonNull String) throws java.io.IOException;
    field public static final int ACCESS_BUFFER = 3; // 0x3
    field public static final int ACCESS_RANDOM = 1; // 0x1
    field public static final int ACCESS_STREAMING = 2; // 0x2
    field public static final int ACCESS_UNKNOWN = 0; // 0x0
  }

  public final class AssetManager.AssetInputStream extends java.io.InputStream {
    method public int read() throws java.io.IOException;
  }

  public class ColorStateList implements android.os.Parcelable {
    ctor public ColorStateList(int[][], @ColorInt int[]);
    method @Deprecated @NonNull public static android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method @NonNull public static android.content.res.ColorStateList createFromXml(@NonNull android.content.res.Resources, @NonNull org.xmlpull.v1.XmlPullParser, @Nullable android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public int describeContents();
    method public int getChangingConfigurations();
    method public int getColorForState(@Nullable int[], int);
    method @ColorInt public int getDefaultColor();
    method public boolean isOpaque();
    method public boolean isStateful();
    method @NonNull public static android.content.res.ColorStateList valueOf(@ColorInt int);
    method @NonNull public android.content.res.ColorStateList withAlpha(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.res.ColorStateList> CREATOR;
  }

  public final class Configuration implements java.lang.Comparable<android.content.res.Configuration> android.os.Parcelable {
    ctor public Configuration();
    ctor public Configuration(android.content.res.Configuration);
    method public int compareTo(android.content.res.Configuration);
    method public int describeContents();
    method public int diff(android.content.res.Configuration);
    method public boolean equals(android.content.res.Configuration);
    method public int getLayoutDirection();
    method @NonNull public android.os.LocaleList getLocales();
    method public boolean isLayoutSizeAtLeast(int);
    method public boolean isScreenHdr();
    method public boolean isScreenRound();
    method public boolean isScreenWideColorGamut();
    method public static boolean needNewResources(int, int);
    method public void readFromParcel(android.os.Parcel);
    method public void setLayoutDirection(java.util.Locale);
    method public void setLocale(@Nullable java.util.Locale);
    method public void setLocales(@Nullable android.os.LocaleList);
    method public void setTo(android.content.res.Configuration);
    method public void setToDefaults();
    method public int updateFrom(@NonNull android.content.res.Configuration);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int COLOR_MODE_HDR_MASK = 12; // 0xc
    field public static final int COLOR_MODE_HDR_NO = 4; // 0x4
    field public static final int COLOR_MODE_HDR_SHIFT = 2; // 0x2
    field public static final int COLOR_MODE_HDR_UNDEFINED = 0; // 0x0
    field public static final int COLOR_MODE_HDR_YES = 8; // 0x8
    field public static final int COLOR_MODE_UNDEFINED = 0; // 0x0
    field public static final int COLOR_MODE_WIDE_COLOR_GAMUT_MASK = 3; // 0x3
    field public static final int COLOR_MODE_WIDE_COLOR_GAMUT_NO = 1; // 0x1
    field public static final int COLOR_MODE_WIDE_COLOR_GAMUT_UNDEFINED = 0; // 0x0
    field public static final int COLOR_MODE_WIDE_COLOR_GAMUT_YES = 2; // 0x2
    field public static final android.os.Parcelable.Creator<android.content.res.Configuration> CREATOR;
    field public static final int DENSITY_DPI_UNDEFINED = 0; // 0x0
    field public static final int HARDKEYBOARDHIDDEN_NO = 1; // 0x1
    field public static final int HARDKEYBOARDHIDDEN_UNDEFINED = 0; // 0x0
    field public static final int HARDKEYBOARDHIDDEN_YES = 2; // 0x2
    field public static final int KEYBOARDHIDDEN_NO = 1; // 0x1
    field public static final int KEYBOARDHIDDEN_UNDEFINED = 0; // 0x0
    field public static final int KEYBOARDHIDDEN_YES = 2; // 0x2
    field public static final int KEYBOARD_12KEY = 3; // 0x3
    field public static final int KEYBOARD_NOKEYS = 1; // 0x1
    field public static final int KEYBOARD_QWERTY = 2; // 0x2
    field public static final int KEYBOARD_UNDEFINED = 0; // 0x0
    field public static final int MNC_ZERO = 65535; // 0xffff
    field public static final int NAVIGATIONHIDDEN_NO = 1; // 0x1
    field public static final int NAVIGATIONHIDDEN_UNDEFINED = 0; // 0x0
    field public static final int NAVIGATIONHIDDEN_YES = 2; // 0x2
    field public static final int NAVIGATION_DPAD = 2; // 0x2
    field public static final int NAVIGATION_NONAV = 1; // 0x1
    field public static final int NAVIGATION_TRACKBALL = 3; // 0x3
    field public static final int NAVIGATION_UNDEFINED = 0; // 0x0
    field public static final int NAVIGATION_WHEEL = 4; // 0x4
    field public static final int ORIENTATION_LANDSCAPE = 2; // 0x2
    field public static final int ORIENTATION_PORTRAIT = 1; // 0x1
    field @Deprecated public static final int ORIENTATION_SQUARE = 3; // 0x3
    field public static final int ORIENTATION_UNDEFINED = 0; // 0x0
    field public static final int SCREENLAYOUT_LAYOUTDIR_LTR = 64; // 0x40
    field public static final int SCREENLAYOUT_LAYOUTDIR_MASK = 192; // 0xc0
    field public static final int SCREENLAYOUT_LAYOUTDIR_RTL = 128; // 0x80
    field public static final int SCREENLAYOUT_LAYOUTDIR_SHIFT = 6; // 0x6
    field public static final int SCREENLAYOUT_LAYOUTDIR_UNDEFINED = 0; // 0x0
    field public static final int SCREENLAYOUT_LONG_MASK = 48; // 0x30
    field public static final int SCREENLAYOUT_LONG_NO = 16; // 0x10
    field public static final int SCREENLAYOUT_LONG_UNDEFINED = 0; // 0x0
    field public static final int SCREENLAYOUT_LONG_YES = 32; // 0x20
    field public static final int SCREENLAYOUT_ROUND_MASK = 768; // 0x300
    field public static final int SCREENLAYOUT_ROUND_NO = 256; // 0x100
    field public static final int SCREENLAYOUT_ROUND_UNDEFINED = 0; // 0x0
    field public static final int SCREENLAYOUT_ROUND_YES = 512; // 0x200
    field public static final int SCREENLAYOUT_SIZE_LARGE = 3; // 0x3
    field public static final int SCREENLAYOUT_SIZE_MASK = 15; // 0xf
    field public static final int SCREENLAYOUT_SIZE_NORMAL = 2; // 0x2
    field public static final int SCREENLAYOUT_SIZE_SMALL = 1; // 0x1
    field public static final int SCREENLAYOUT_SIZE_UNDEFINED = 0; // 0x0
    field public static final int SCREENLAYOUT_SIZE_XLARGE = 4; // 0x4
    field public static final int SCREENLAYOUT_UNDEFINED = 0; // 0x0
    field public static final int SCREEN_HEIGHT_DP_UNDEFINED = 0; // 0x0
    field public static final int SCREEN_WIDTH_DP_UNDEFINED = 0; // 0x0
    field public static final int SMALLEST_SCREEN_WIDTH_DP_UNDEFINED = 0; // 0x0
    field public static final int TOUCHSCREEN_FINGER = 3; // 0x3
    field public static final int TOUCHSCREEN_NOTOUCH = 1; // 0x1
    field @Deprecated public static final int TOUCHSCREEN_STYLUS = 2; // 0x2
    field public static final int TOUCHSCREEN_UNDEFINED = 0; // 0x0
    field public static final int UI_MODE_NIGHT_MASK = 48; // 0x30
    field public static final int UI_MODE_NIGHT_NO = 16; // 0x10
    field public static final int UI_MODE_NIGHT_UNDEFINED = 0; // 0x0
    field public static final int UI_MODE_NIGHT_YES = 32; // 0x20
    field public static final int UI_MODE_TYPE_APPLIANCE = 5; // 0x5
    field public static final int UI_MODE_TYPE_CAR = 3; // 0x3
    field public static final int UI_MODE_TYPE_DESK = 2; // 0x2
    field public static final int UI_MODE_TYPE_MASK = 15; // 0xf
    field public static final int UI_MODE_TYPE_NORMAL = 1; // 0x1
    field public static final int UI_MODE_TYPE_TELEVISION = 4; // 0x4
    field public static final int UI_MODE_TYPE_UNDEFINED = 0; // 0x0
    field public static final int UI_MODE_TYPE_VR_HEADSET = 7; // 0x7
    field public static final int UI_MODE_TYPE_WATCH = 6; // 0x6
    field public int colorMode;
    field public int densityDpi;
    field public float fontScale;
    field public int hardKeyboardHidden;
    field public int keyboard;
    field public int keyboardHidden;
    field @Deprecated public java.util.Locale locale;
    field public int mcc;
    field public int mnc;
    field public int navigation;
    field public int navigationHidden;
    field public int orientation;
    field public int screenHeightDp;
    field public int screenLayout;
    field public int screenWidthDp;
    field public int smallestScreenWidthDp;
    field public int touchscreen;
    field public int uiMode;
  }

  public class ObbInfo implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.res.ObbInfo> CREATOR;
    field public static final int OBB_OVERLAY = 1; // 0x1
    field public String filename;
    field public int flags;
    field public String packageName;
    field public int version;
  }

  public class ObbScanner {
    method public static android.content.res.ObbInfo getObbInfo(String) throws java.io.IOException;
  }

  public class Resources {
    ctor @Deprecated public Resources(android.content.res.AssetManager, android.util.DisplayMetrics, android.content.res.Configuration);
    method public final void finishPreloading();
    method public final void flushLayoutCache();
    method @NonNull public android.content.res.XmlResourceParser getAnimation(@AnimatorRes @AnimRes int) throws android.content.res.Resources.NotFoundException;
    method public final android.content.res.AssetManager getAssets();
    method public boolean getBoolean(@BoolRes int) throws android.content.res.Resources.NotFoundException;
    method @Deprecated @ColorInt public int getColor(@ColorRes int) throws android.content.res.Resources.NotFoundException;
    method @ColorInt public int getColor(@ColorRes int, @Nullable android.content.res.Resources.Theme) throws android.content.res.Resources.NotFoundException;
    method @Deprecated @NonNull public android.content.res.ColorStateList getColorStateList(@ColorRes int) throws android.content.res.Resources.NotFoundException;
    method @NonNull public android.content.res.ColorStateList getColorStateList(@ColorRes int, @Nullable android.content.res.Resources.Theme) throws android.content.res.Resources.NotFoundException;
    method public android.content.res.Configuration getConfiguration();
    method public float getDimension(@DimenRes int) throws android.content.res.Resources.NotFoundException;
    method public int getDimensionPixelOffset(@DimenRes int) throws android.content.res.Resources.NotFoundException;
    method public int getDimensionPixelSize(@DimenRes int) throws android.content.res.Resources.NotFoundException;
    method public android.util.DisplayMetrics getDisplayMetrics();
    method @Deprecated public android.graphics.drawable.Drawable getDrawable(@DrawableRes int) throws android.content.res.Resources.NotFoundException;
    method public android.graphics.drawable.Drawable getDrawable(@DrawableRes int, @Nullable android.content.res.Resources.Theme) throws android.content.res.Resources.NotFoundException;
    method @Deprecated @Nullable public android.graphics.drawable.Drawable getDrawableForDensity(@DrawableRes int, int) throws android.content.res.Resources.NotFoundException;
    method @Nullable public android.graphics.drawable.Drawable getDrawableForDensity(@DrawableRes int, int, @Nullable android.content.res.Resources.Theme);
    method @NonNull public android.graphics.Typeface getFont(@FontRes int) throws android.content.res.Resources.NotFoundException;
    method public float getFraction(@FractionRes int, int, int);
    method public int getIdentifier(String, String, String);
    method @NonNull public int[] getIntArray(@ArrayRes int) throws android.content.res.Resources.NotFoundException;
    method public int getInteger(@IntegerRes int) throws android.content.res.Resources.NotFoundException;
    method @NonNull public android.content.res.XmlResourceParser getLayout(@LayoutRes int) throws android.content.res.Resources.NotFoundException;
    method public android.graphics.Movie getMovie(@RawRes int) throws android.content.res.Resources.NotFoundException;
    method @NonNull public String getQuantityString(@PluralsRes int, int, java.lang.Object...) throws android.content.res.Resources.NotFoundException;
    method @NonNull public String getQuantityString(@PluralsRes int, int) throws android.content.res.Resources.NotFoundException;
    method @NonNull public CharSequence getQuantityText(@PluralsRes int, int) throws android.content.res.Resources.NotFoundException;
    method public String getResourceEntryName(@AnyRes int) throws android.content.res.Resources.NotFoundException;
    method public String getResourceName(@AnyRes int) throws android.content.res.Resources.NotFoundException;
    method public String getResourcePackageName(@AnyRes int) throws android.content.res.Resources.NotFoundException;
    method public String getResourceTypeName(@AnyRes int) throws android.content.res.Resources.NotFoundException;
    method @NonNull public String getString(@StringRes int) throws android.content.res.Resources.NotFoundException;
    method @NonNull public String getString(@StringRes int, java.lang.Object...) throws android.content.res.Resources.NotFoundException;
    method @NonNull public String[] getStringArray(@ArrayRes int) throws android.content.res.Resources.NotFoundException;
    method public static android.content.res.Resources getSystem();
    method @NonNull public CharSequence getText(@StringRes int) throws android.content.res.Resources.NotFoundException;
    method public CharSequence getText(@StringRes int, CharSequence);
    method @NonNull public CharSequence[] getTextArray(@ArrayRes int) throws android.content.res.Resources.NotFoundException;
    method public void getValue(@AnyRes int, android.util.TypedValue, boolean) throws android.content.res.Resources.NotFoundException;
    method public void getValue(String, android.util.TypedValue, boolean) throws android.content.res.Resources.NotFoundException;
    method public void getValueForDensity(@AnyRes int, int, android.util.TypedValue, boolean) throws android.content.res.Resources.NotFoundException;
    method @NonNull public android.content.res.XmlResourceParser getXml(@XmlRes int) throws android.content.res.Resources.NotFoundException;
    method public final android.content.res.Resources.Theme newTheme();
    method public android.content.res.TypedArray obtainAttributes(android.util.AttributeSet, @StyleableRes int[]);
    method @NonNull public android.content.res.TypedArray obtainTypedArray(@ArrayRes int) throws android.content.res.Resources.NotFoundException;
    method @NonNull public java.io.InputStream openRawResource(@RawRes int) throws android.content.res.Resources.NotFoundException;
    method @NonNull public java.io.InputStream openRawResource(@RawRes int, android.util.TypedValue) throws android.content.res.Resources.NotFoundException;
    method public android.content.res.AssetFileDescriptor openRawResourceFd(@RawRes int) throws android.content.res.Resources.NotFoundException;
    method public void parseBundleExtra(String, android.util.AttributeSet, android.os.Bundle) throws org.xmlpull.v1.XmlPullParserException;
    method public void parseBundleExtras(android.content.res.XmlResourceParser, android.os.Bundle) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method @Deprecated public void updateConfiguration(android.content.res.Configuration, android.util.DisplayMetrics);
  }

  public static class Resources.NotFoundException extends java.lang.RuntimeException {
    ctor public Resources.NotFoundException();
    ctor public Resources.NotFoundException(String);
    ctor public Resources.NotFoundException(String, Exception);
  }

  public final class Resources.Theme {
    method public void applyStyle(int, boolean);
    method public void dump(int, String, String);
    method public int getChangingConfigurations();
    method public android.graphics.drawable.Drawable getDrawable(@DrawableRes int) throws android.content.res.Resources.NotFoundException;
    method public android.content.res.Resources getResources();
    method public android.content.res.TypedArray obtainStyledAttributes(@StyleableRes int[]);
    method public android.content.res.TypedArray obtainStyledAttributes(@StyleRes int, @StyleableRes int[]) throws android.content.res.Resources.NotFoundException;
    method public android.content.res.TypedArray obtainStyledAttributes(android.util.AttributeSet, @StyleableRes int[], @AttrRes int, @StyleRes int);
    method public boolean resolveAttribute(int, android.util.TypedValue, boolean);
    method public void setTo(android.content.res.Resources.Theme);
  }

  public class TypedArray {
    method public boolean getBoolean(@StyleableRes int, boolean);
    method public int getChangingConfigurations();
    method @ColorInt public int getColor(@StyleableRes int, @ColorInt int);
    method @Nullable public android.content.res.ColorStateList getColorStateList(@StyleableRes int);
    method public float getDimension(@StyleableRes int, float);
    method public int getDimensionPixelOffset(@StyleableRes int, int);
    method public int getDimensionPixelSize(@StyleableRes int, int);
    method @Nullable public android.graphics.drawable.Drawable getDrawable(@StyleableRes int);
    method public float getFloat(@StyleableRes int, float);
    method @Nullable public android.graphics.Typeface getFont(@StyleableRes int);
    method public float getFraction(@StyleableRes int, int, int, float);
    method public int getIndex(int);
    method public int getIndexCount();
    method public int getInt(@StyleableRes int, int);
    method public int getInteger(@StyleableRes int, int);
    method public int getLayoutDimension(@StyleableRes int, String);
    method public int getLayoutDimension(@StyleableRes int, int);
    method public String getNonResourceString(@StyleableRes int);
    method public String getPositionDescription();
    method @AnyRes public int getResourceId(@StyleableRes int, int);
    method public android.content.res.Resources getResources();
    method @Nullable public String getString(@StyleableRes int);
    method public CharSequence getText(@StyleableRes int);
    method public CharSequence[] getTextArray(@StyleableRes int);
    method public int getType(@StyleableRes int);
    method public boolean getValue(@StyleableRes int, android.util.TypedValue);
    method public boolean hasValue(@StyleableRes int);
    method public boolean hasValueOrEmpty(@StyleableRes int);
    method public int length();
    method public android.util.TypedValue peekValue(@StyleableRes int);
    method public void recycle();
  }

  public interface XmlResourceParser extends org.xmlpull.v1.XmlPullParser android.util.AttributeSet java.lang.AutoCloseable {
    method public void close();
  }

}

package android.database {

  public abstract class AbstractCursor implements android.database.CrossProcessCursor {
    ctor public AbstractCursor();
    method protected void checkPosition();
    method public void close();
    method public void copyStringToBuffer(int, android.database.CharArrayBuffer);
    method public void deactivate();
    method public void fillWindow(int, android.database.CursorWindow);
    method protected void finalize();
    method public byte[] getBlob(int);
    method public int getColumnCount();
    method public int getColumnIndex(String);
    method public int getColumnIndexOrThrow(String);
    method public String getColumnName(int);
    method public android.os.Bundle getExtras();
    method public android.net.Uri getNotificationUri();
    method public final int getPosition();
    method public int getType(int);
    method @Deprecated protected Object getUpdatedField(int);
    method public boolean getWantsAllOnMoveCalls();
    method public android.database.CursorWindow getWindow();
    method public final boolean isAfterLast();
    method public final boolean isBeforeFirst();
    method public boolean isClosed();
    method @Deprecated protected boolean isFieldUpdated(int);
    method public final boolean isFirst();
    method public final boolean isLast();
    method public final boolean move(int);
    method public final boolean moveToFirst();
    method public final boolean moveToLast();
    method public final boolean moveToNext();
    method public final boolean moveToPosition(int);
    method public final boolean moveToPrevious();
    method protected void onChange(boolean);
    method public boolean onMove(int, int);
    method public void registerContentObserver(android.database.ContentObserver);
    method public void registerDataSetObserver(android.database.DataSetObserver);
    method public boolean requery();
    method public android.os.Bundle respond(android.os.Bundle);
    method public void setExtras(android.os.Bundle);
    method public void setNotificationUri(android.content.ContentResolver, android.net.Uri);
    method public void unregisterContentObserver(android.database.ContentObserver);
    method public void unregisterDataSetObserver(android.database.DataSetObserver);
    field @Deprecated protected boolean mClosed;
    field @Deprecated protected android.content.ContentResolver mContentResolver;
    field @Deprecated protected int mPos;
  }

  protected static class AbstractCursor.SelfContentObserver extends android.database.ContentObserver {
    ctor public AbstractCursor.SelfContentObserver(android.database.AbstractCursor);
  }

  public abstract class AbstractWindowedCursor extends android.database.AbstractCursor {
    ctor public AbstractWindowedCursor();
    method public double getDouble(int);
    method public float getFloat(int);
    method public int getInt(int);
    method public long getLong(int);
    method public short getShort(int);
    method public String getString(int);
    method public boolean hasWindow();
    method @Deprecated public boolean isBlob(int);
    method @Deprecated public boolean isFloat(int);
    method @Deprecated public boolean isLong(int);
    method public boolean isNull(int);
    method @Deprecated public boolean isString(int);
    method public void setWindow(android.database.CursorWindow);
    field protected android.database.CursorWindow mWindow;
  }

  public final class CharArrayBuffer {
    ctor public CharArrayBuffer(int);
    ctor public CharArrayBuffer(char[]);
    field public char[] data;
    field public int sizeCopied;
  }

  public class ContentObservable extends android.database.Observable<android.database.ContentObserver> {
    ctor public ContentObservable();
    method @Deprecated public void dispatchChange(boolean);
    method public void dispatchChange(boolean, android.net.Uri);
    method @Deprecated public void notifyChange(boolean);
    method public void registerObserver(android.database.ContentObserver);
  }

  public abstract class ContentObserver {
    ctor public ContentObserver(android.os.Handler);
    method public boolean deliverSelfNotifications();
    method @Deprecated public final void dispatchChange(boolean);
    method public final void dispatchChange(boolean, android.net.Uri);
    method public void onChange(boolean);
    method public void onChange(boolean, android.net.Uri);
  }

  public interface CrossProcessCursor extends android.database.Cursor {
    method public void fillWindow(int, android.database.CursorWindow);
    method public android.database.CursorWindow getWindow();
    method public boolean onMove(int, int);
  }

  public class CrossProcessCursorWrapper extends android.database.CursorWrapper implements android.database.CrossProcessCursor {
    ctor public CrossProcessCursorWrapper(android.database.Cursor);
    method public void fillWindow(int, android.database.CursorWindow);
    method public android.database.CursorWindow getWindow();
    method public boolean onMove(int, int);
  }

  public interface Cursor extends java.io.Closeable {
    method public void close();
    method public void copyStringToBuffer(int, android.database.CharArrayBuffer);
    method @Deprecated public void deactivate();
    method public byte[] getBlob(int);
    method public int getColumnCount();
    method public int getColumnIndex(String);
    method public int getColumnIndexOrThrow(String) throws java.lang.IllegalArgumentException;
    method public String getColumnName(int);
    method public String[] getColumnNames();
    method public int getCount();
    method public double getDouble(int);
    method public android.os.Bundle getExtras();
    method public float getFloat(int);
    method public int getInt(int);
    method public long getLong(int);
    method public android.net.Uri getNotificationUri();
    method public int getPosition();
    method public short getShort(int);
    method public String getString(int);
    method public int getType(int);
    method public boolean getWantsAllOnMoveCalls();
    method public boolean isAfterLast();
    method public boolean isBeforeFirst();
    method public boolean isClosed();
    method public boolean isFirst();
    method public boolean isLast();
    method public boolean isNull(int);
    method public boolean move(int);
    method public boolean moveToFirst();
    method public boolean moveToLast();
    method public boolean moveToNext();
    method public boolean moveToPosition(int);
    method public boolean moveToPrevious();
    method public void registerContentObserver(android.database.ContentObserver);
    method public void registerDataSetObserver(android.database.DataSetObserver);
    method @Deprecated public boolean requery();
    method public android.os.Bundle respond(android.os.Bundle);
    method public void setExtras(android.os.Bundle);
    method public void setNotificationUri(android.content.ContentResolver, android.net.Uri);
    method public void unregisterContentObserver(android.database.ContentObserver);
    method public void unregisterDataSetObserver(android.database.DataSetObserver);
    field public static final int FIELD_TYPE_BLOB = 4; // 0x4
    field public static final int FIELD_TYPE_FLOAT = 2; // 0x2
    field public static final int FIELD_TYPE_INTEGER = 1; // 0x1
    field public static final int FIELD_TYPE_NULL = 0; // 0x0
    field public static final int FIELD_TYPE_STRING = 3; // 0x3
  }

  public class CursorIndexOutOfBoundsException extends java.lang.IndexOutOfBoundsException {
    ctor public CursorIndexOutOfBoundsException(int, int);
    ctor public CursorIndexOutOfBoundsException(String);
  }

  public final class CursorJoiner implements java.lang.Iterable<android.database.CursorJoiner.Result> java.util.Iterator<android.database.CursorJoiner.Result> {
    ctor public CursorJoiner(android.database.Cursor, String[], android.database.Cursor, String[]);
    method public boolean hasNext();
    method public java.util.Iterator<android.database.CursorJoiner.Result> iterator();
    method public android.database.CursorJoiner.Result next();
  }

  public enum CursorJoiner.Result {
    enum_constant public static final android.database.CursorJoiner.Result BOTH;
    enum_constant public static final android.database.CursorJoiner.Result LEFT;
    enum_constant public static final android.database.CursorJoiner.Result RIGHT;
  }

  public class CursorWindow extends android.database.sqlite.SQLiteClosable implements android.os.Parcelable {
    ctor public CursorWindow(String);
    ctor public CursorWindow(String, long);
    ctor @Deprecated public CursorWindow(boolean);
    method public boolean allocRow();
    method public void clear();
    method public void copyStringToBuffer(int, int, android.database.CharArrayBuffer);
    method public int describeContents();
    method public void freeLastRow();
    method public byte[] getBlob(int, int);
    method public double getDouble(int, int);
    method public float getFloat(int, int);
    method public int getInt(int, int);
    method public long getLong(int, int);
    method public int getNumRows();
    method public short getShort(int, int);
    method public int getStartPosition();
    method public String getString(int, int);
    method public int getType(int, int);
    method @Deprecated public boolean isBlob(int, int);
    method @Deprecated public boolean isFloat(int, int);
    method @Deprecated public boolean isLong(int, int);
    method @Deprecated public boolean isNull(int, int);
    method @Deprecated public boolean isString(int, int);
    method public static android.database.CursorWindow newFromParcel(android.os.Parcel);
    method protected void onAllReferencesReleased();
    method public boolean putBlob(byte[], int, int);
    method public boolean putDouble(double, int, int);
    method public boolean putLong(long, int, int);
    method public boolean putNull(int, int);
    method public boolean putString(String, int, int);
    method public boolean setNumColumns(int);
    method public void setStartPosition(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.database.CursorWindow> CREATOR;
  }

  public class CursorWrapper implements android.database.Cursor {
    ctor public CursorWrapper(android.database.Cursor);
    method public void close();
    method public void copyStringToBuffer(int, android.database.CharArrayBuffer);
    method @Deprecated public void deactivate();
    method public byte[] getBlob(int);
    method public int getColumnCount();
    method public int getColumnIndex(String);
    method public int getColumnIndexOrThrow(String) throws java.lang.IllegalArgumentException;
    method public String getColumnName(int);
    method public String[] getColumnNames();
    method public int getCount();
    method public double getDouble(int);
    method public android.os.Bundle getExtras();
    method public float getFloat(int);
    method public int getInt(int);
    method public long getLong(int);
    method public android.net.Uri getNotificationUri();
    method public int getPosition();
    method public short getShort(int);
    method public String getString(int);
    method public int getType(int);
    method public boolean getWantsAllOnMoveCalls();
    method public android.database.Cursor getWrappedCursor();
    method public boolean isAfterLast();
    method public boolean isBeforeFirst();
    method public boolean isClosed();
    method public boolean isFirst();
    method public boolean isLast();
    method public boolean isNull(int);
    method public boolean move(int);
    method public boolean moveToFirst();
    method public boolean moveToLast();
    method public boolean moveToNext();
    method public boolean moveToPosition(int);
    method public boolean moveToPrevious();
    method public void registerContentObserver(android.database.ContentObserver);
    method public void registerDataSetObserver(android.database.DataSetObserver);
    method @Deprecated public boolean requery();
    method public android.os.Bundle respond(android.os.Bundle);
    method public void setExtras(android.os.Bundle);
    method public void setNotificationUri(android.content.ContentResolver, android.net.Uri);
    method public void unregisterContentObserver(android.database.ContentObserver);
    method public void unregisterDataSetObserver(android.database.DataSetObserver);
  }

  public class DataSetObservable extends android.database.Observable<android.database.DataSetObserver> {
    ctor public DataSetObservable();
    method public void notifyChanged();
    method public void notifyInvalidated();
  }

  public abstract class DataSetObserver {
    ctor public DataSetObserver();
    method public void onChanged();
    method public void onInvalidated();
  }

  public interface DatabaseErrorHandler {
    method public void onCorruption(android.database.sqlite.SQLiteDatabase);
  }

  public class DatabaseUtils {
    ctor public DatabaseUtils();
    method public static void appendEscapedSQLString(StringBuilder, String);
    method public static String[] appendSelectionArgs(String[], String[]);
    method public static final void appendValueToSql(StringBuilder, Object);
    method public static void bindObjectToProgram(android.database.sqlite.SQLiteProgram, int, Object);
    method public static android.os.ParcelFileDescriptor blobFileDescriptorForQuery(android.database.sqlite.SQLiteDatabase, String, String[]);
    method public static android.os.ParcelFileDescriptor blobFileDescriptorForQuery(android.database.sqlite.SQLiteStatement, String[]);
    method public static String concatenateWhere(String, String);
    method public static void createDbFromSqlStatements(android.content.Context, String, int, String);
    method public static void cursorDoubleToContentValues(android.database.Cursor, String, android.content.ContentValues, String);
    method public static void cursorDoubleToContentValuesIfPresent(android.database.Cursor, android.content.ContentValues, String);
    method public static void cursorDoubleToCursorValues(android.database.Cursor, String, android.content.ContentValues);
    method public static void cursorFloatToContentValuesIfPresent(android.database.Cursor, android.content.ContentValues, String);
    method public static void cursorIntToContentValues(android.database.Cursor, String, android.content.ContentValues);
    method public static void cursorIntToContentValues(android.database.Cursor, String, android.content.ContentValues, String);
    method public static void cursorIntToContentValuesIfPresent(android.database.Cursor, android.content.ContentValues, String);
    method public static void cursorLongToContentValues(android.database.Cursor, String, android.content.ContentValues);
    method public static void cursorLongToContentValues(android.database.Cursor, String, android.content.ContentValues, String);
    method public static void cursorLongToContentValuesIfPresent(android.database.Cursor, android.content.ContentValues, String);
    method public static void cursorRowToContentValues(android.database.Cursor, android.content.ContentValues);
    method public static void cursorShortToContentValuesIfPresent(android.database.Cursor, android.content.ContentValues, String);
    method public static void cursorStringToContentValues(android.database.Cursor, String, android.content.ContentValues);
    method public static void cursorStringToContentValues(android.database.Cursor, String, android.content.ContentValues, String);
    method public static void cursorStringToContentValuesIfPresent(android.database.Cursor, android.content.ContentValues, String);
    method public static void cursorStringToInsertHelper(android.database.Cursor, String, android.database.DatabaseUtils.InsertHelper, int);
    method public static void dumpCurrentRow(android.database.Cursor);
    method public static void dumpCurrentRow(android.database.Cursor, java.io.PrintStream);
    method public static void dumpCurrentRow(android.database.Cursor, StringBuilder);
    method public static String dumpCurrentRowToString(android.database.Cursor);
    method public static void dumpCursor(android.database.Cursor);
    method public static void dumpCursor(android.database.Cursor, java.io.PrintStream);
    method public static void dumpCursor(android.database.Cursor, StringBuilder);
    method public static String dumpCursorToString(android.database.Cursor);
    method public static String getCollationKey(String);
    method public static String getHexCollationKey(String);
    method public static int getSqlStatementType(String);
    method public static long longForQuery(android.database.sqlite.SQLiteDatabase, String, String[]);
    method public static long longForQuery(android.database.sqlite.SQLiteStatement, String[]);
    method public static long queryNumEntries(android.database.sqlite.SQLiteDatabase, String);
    method public static long queryNumEntries(android.database.sqlite.SQLiteDatabase, String, String);
    method public static long queryNumEntries(android.database.sqlite.SQLiteDatabase, String, String, String[]);
    method public static final void readExceptionFromParcel(android.os.Parcel);
    method public static void readExceptionWithFileNotFoundExceptionFromParcel(android.os.Parcel) throws java.io.FileNotFoundException;
    method public static void readExceptionWithOperationApplicationExceptionFromParcel(android.os.Parcel) throws android.content.OperationApplicationException;
    method public static String sqlEscapeString(String);
    method public static String stringForQuery(android.database.sqlite.SQLiteDatabase, String, String[]);
    method public static String stringForQuery(android.database.sqlite.SQLiteStatement, String[]);
    method public static final void writeExceptionToParcel(android.os.Parcel, Exception);
    field public static final int STATEMENT_ABORT = 6; // 0x6
    field public static final int STATEMENT_ATTACH = 3; // 0x3
    field public static final int STATEMENT_BEGIN = 4; // 0x4
    field public static final int STATEMENT_COMMIT = 5; // 0x5
    field public static final int STATEMENT_DDL = 8; // 0x8
    field public static final int STATEMENT_OTHER = 99; // 0x63
    field public static final int STATEMENT_PRAGMA = 7; // 0x7
    field public static final int STATEMENT_SELECT = 1; // 0x1
    field public static final int STATEMENT_UNPREPARED = 9; // 0x9
    field public static final int STATEMENT_UPDATE = 2; // 0x2
  }

  @Deprecated public static class DatabaseUtils.InsertHelper {
    ctor @Deprecated public DatabaseUtils.InsertHelper(android.database.sqlite.SQLiteDatabase, String);
    method @Deprecated public void bind(int, double);
    method @Deprecated public void bind(int, float);
    method @Deprecated public void bind(int, long);
    method @Deprecated public void bind(int, int);
    method @Deprecated public void bind(int, boolean);
    method @Deprecated public void bind(int, byte[]);
    method @Deprecated public void bind(int, String);
    method @Deprecated public void bindNull(int);
    method @Deprecated public void close();
    method @Deprecated public long execute();
    method @Deprecated public int getColumnIndex(String);
    method @Deprecated public long insert(android.content.ContentValues);
    method @Deprecated public void prepareForInsert();
    method @Deprecated public void prepareForReplace();
    method @Deprecated public long replace(android.content.ContentValues);
  }

  public final class DefaultDatabaseErrorHandler implements android.database.DatabaseErrorHandler {
    ctor public DefaultDatabaseErrorHandler();
    method public void onCorruption(android.database.sqlite.SQLiteDatabase);
  }

  public class MatrixCursor extends android.database.AbstractCursor {
    ctor public MatrixCursor(String[], int);
    ctor public MatrixCursor(String[]);
    method public void addRow(Object[]);
    method public void addRow(Iterable<?>);
    method public String[] getColumnNames();
    method public int getCount();
    method public double getDouble(int);
    method public float getFloat(int);
    method public int getInt(int);
    method public long getLong(int);
    method public short getShort(int);
    method public String getString(int);
    method public boolean isNull(int);
    method public android.database.MatrixCursor.RowBuilder newRow();
  }

  public class MatrixCursor.RowBuilder {
    method public android.database.MatrixCursor.RowBuilder add(Object);
    method public android.database.MatrixCursor.RowBuilder add(String, Object);
  }

  public class MergeCursor extends android.database.AbstractCursor {
    ctor public MergeCursor(android.database.Cursor[]);
    method public String[] getColumnNames();
    method public int getCount();
    method public double getDouble(int);
    method public float getFloat(int);
    method public int getInt(int);
    method public long getLong(int);
    method public short getShort(int);
    method public String getString(int);
    method public boolean isNull(int);
  }

  public abstract class Observable<T> {
    ctor public Observable();
    method public void registerObserver(T);
    method public void unregisterAll();
    method public void unregisterObserver(T);
    field protected final java.util.ArrayList<T> mObservers;
  }

  public class SQLException extends java.lang.RuntimeException {
    ctor public SQLException();
    ctor public SQLException(String);
    ctor public SQLException(String, Throwable);
  }

  public class StaleDataException extends java.lang.RuntimeException {
    ctor public StaleDataException();
    ctor public StaleDataException(String);
  }

}

package android.database.sqlite {

  public class SQLiteAbortException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteAbortException();
    ctor public SQLiteAbortException(String);
  }

  public class SQLiteAccessPermException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteAccessPermException();
    ctor public SQLiteAccessPermException(String);
  }

  public class SQLiteBindOrColumnIndexOutOfRangeException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteBindOrColumnIndexOutOfRangeException();
    ctor public SQLiteBindOrColumnIndexOutOfRangeException(String);
  }

  public class SQLiteBlobTooBigException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteBlobTooBigException();
    ctor public SQLiteBlobTooBigException(String);
  }

  public class SQLiteCantOpenDatabaseException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteCantOpenDatabaseException();
    ctor public SQLiteCantOpenDatabaseException(String);
  }

  public abstract class SQLiteClosable implements java.io.Closeable {
    ctor public SQLiteClosable();
    method public void acquireReference();
    method public void close();
    method protected abstract void onAllReferencesReleased();
    method @Deprecated protected void onAllReferencesReleasedFromContainer();
    method public void releaseReference();
    method @Deprecated public void releaseReferenceFromContainer();
  }

  public class SQLiteConstraintException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteConstraintException();
    ctor public SQLiteConstraintException(String);
  }

  public class SQLiteCursor extends android.database.AbstractWindowedCursor {
    ctor @Deprecated public SQLiteCursor(android.database.sqlite.SQLiteDatabase, android.database.sqlite.SQLiteCursorDriver, String, android.database.sqlite.SQLiteQuery);
    ctor public SQLiteCursor(android.database.sqlite.SQLiteCursorDriver, String, android.database.sqlite.SQLiteQuery);
    method public String[] getColumnNames();
    method public int getCount();
    method public android.database.sqlite.SQLiteDatabase getDatabase();
    method public void setFillWindowForwardOnly(boolean);
    method public void setSelectionArguments(String[]);
  }

  public interface SQLiteCursorDriver {
    method public void cursorClosed();
    method public void cursorDeactivated();
    method public void cursorRequeried(android.database.Cursor);
    method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase.CursorFactory, String[]);
    method public void setBindArguments(String[]);
  }

  public final class SQLiteDatabase extends android.database.sqlite.SQLiteClosable {
    method public void beginTransaction();
    method public void beginTransactionNonExclusive();
    method public void beginTransactionWithListener(android.database.sqlite.SQLiteTransactionListener);
    method public void beginTransactionWithListenerNonExclusive(android.database.sqlite.SQLiteTransactionListener);
    method public android.database.sqlite.SQLiteStatement compileStatement(String) throws android.database.SQLException;
    method @NonNull public static android.database.sqlite.SQLiteDatabase create(@Nullable android.database.sqlite.SQLiteDatabase.CursorFactory);
    method @NonNull public static android.database.sqlite.SQLiteDatabase createInMemory(@NonNull android.database.sqlite.SQLiteDatabase.OpenParams);
    method public int delete(String, String, String[]);
    method public static boolean deleteDatabase(@NonNull java.io.File);
    method public void disableWriteAheadLogging();
    method public boolean enableWriteAheadLogging();
    method public void endTransaction();
    method public void execSQL(String) throws android.database.SQLException;
    method public void execSQL(String, Object[]) throws android.database.SQLException;
    method public static String findEditTable(String);
    method public java.util.List<android.util.Pair<java.lang.String,java.lang.String>> getAttachedDbs();
    method public long getMaximumSize();
    method public long getPageSize();
    method public String getPath();
    method @Deprecated public java.util.Map<java.lang.String,java.lang.String> getSyncedTables();
    method public int getVersion();
    method public boolean inTransaction();
    method public long insert(String, String, android.content.ContentValues);
    method public long insertOrThrow(String, String, android.content.ContentValues) throws android.database.SQLException;
    method public long insertWithOnConflict(String, String, android.content.ContentValues, int);
    method public boolean isDatabaseIntegrityOk();
    method public boolean isDbLockedByCurrentThread();
    method @Deprecated public boolean isDbLockedByOtherThreads();
    method public boolean isOpen();
    method public boolean isReadOnly();
    method public boolean isWriteAheadLoggingEnabled();
    method @Deprecated public void markTableSyncable(String, String);
    method @Deprecated public void markTableSyncable(String, String, String);
    method public boolean needUpgrade(int);
    method protected void onAllReferencesReleased();
    method public static android.database.sqlite.SQLiteDatabase openDatabase(@NonNull String, @Nullable android.database.sqlite.SQLiteDatabase.CursorFactory, int);
    method public static android.database.sqlite.SQLiteDatabase openDatabase(@NonNull java.io.File, @NonNull android.database.sqlite.SQLiteDatabase.OpenParams);
    method public static android.database.sqlite.SQLiteDatabase openDatabase(@NonNull String, @Nullable android.database.sqlite.SQLiteDatabase.CursorFactory, int, @Nullable android.database.DatabaseErrorHandler);
    method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(@NonNull java.io.File, @Nullable android.database.sqlite.SQLiteDatabase.CursorFactory);
    method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(@NonNull String, @Nullable android.database.sqlite.SQLiteDatabase.CursorFactory);
    method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(@NonNull String, @Nullable android.database.sqlite.SQLiteDatabase.CursorFactory, @Nullable android.database.DatabaseErrorHandler);
    method public android.database.Cursor query(boolean, String, String[], String, String[], String, String, String, String);
    method public android.database.Cursor query(boolean, String, String[], String, String[], String, String, String, String, android.os.CancellationSignal);
    method public android.database.Cursor query(String, String[], String, String[], String, String, String);
    method public android.database.Cursor query(String, String[], String, String[], String, String, String, String);
    method public android.database.Cursor queryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, boolean, String, String[], String, String[], String, String, String, String);
    method public android.database.Cursor queryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, boolean, String, String[], String, String[], String, String, String, String, android.os.CancellationSignal);
    method public android.database.Cursor rawQuery(String, String[]);
    method public android.database.Cursor rawQuery(String, String[], android.os.CancellationSignal);
    method public android.database.Cursor rawQueryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, String, String[], String);
    method public android.database.Cursor rawQueryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, String, String[], String, android.os.CancellationSignal);
    method public static int releaseMemory();
    method public long replace(String, String, android.content.ContentValues);
    method public long replaceOrThrow(String, String, android.content.ContentValues) throws android.database.SQLException;
    method public void setForeignKeyConstraintsEnabled(boolean);
    method public void setLocale(java.util.Locale);
    method @Deprecated public void setLockingEnabled(boolean);
    method public void setMaxSqlCacheSize(int);
    method public long setMaximumSize(long);
    method public void setPageSize(long);
    method public void setTransactionSuccessful();
    method public void setVersion(int);
    method public int update(String, android.content.ContentValues, String, String[]);
    method public int updateWithOnConflict(String, android.content.ContentValues, String, String[], int);
    method public void validateSql(@NonNull String, @Nullable android.os.CancellationSignal);
    method @Deprecated public boolean yieldIfContended();
    method public boolean yieldIfContendedSafely();
    method public boolean yieldIfContendedSafely(long);
    field public static final int CONFLICT_ABORT = 2; // 0x2
    field public static final int CONFLICT_FAIL = 3; // 0x3
    field public static final int CONFLICT_IGNORE = 4; // 0x4
    field public static final int CONFLICT_NONE = 0; // 0x0
    field public static final int CONFLICT_REPLACE = 5; // 0x5
    field public static final int CONFLICT_ROLLBACK = 1; // 0x1
    field public static final int CREATE_IF_NECESSARY = 268435456; // 0x10000000
    field public static final int ENABLE_WRITE_AHEAD_LOGGING = 536870912; // 0x20000000
    field public static final int MAX_SQL_CACHE_SIZE = 100; // 0x64
    field public static final int NO_LOCALIZED_COLLATORS = 16; // 0x10
    field public static final int OPEN_READONLY = 1; // 0x1
    field public static final int OPEN_READWRITE = 0; // 0x0
    field public static final int SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000; // 0xc350
  }

  public static interface SQLiteDatabase.CursorFactory {
    method public android.database.Cursor newCursor(android.database.sqlite.SQLiteDatabase, android.database.sqlite.SQLiteCursorDriver, String, android.database.sqlite.SQLiteQuery);
  }

  public static final class SQLiteDatabase.OpenParams {
    method @Nullable public android.database.sqlite.SQLiteDatabase.CursorFactory getCursorFactory();
    method @Nullable public android.database.DatabaseErrorHandler getErrorHandler();
    method public long getIdleConnectionTimeout();
    method @Nullable public String getJournalMode();
    method @IntRange(from=0xffffffff) public int getLookasideSlotCount();
    method @IntRange(from=0xffffffff) public int getLookasideSlotSize();
    method public int getOpenFlags();
    method @Nullable public String getSynchronousMode();
  }

  public static final class SQLiteDatabase.OpenParams.Builder {
    ctor public SQLiteDatabase.OpenParams.Builder();
    ctor public SQLiteDatabase.OpenParams.Builder(android.database.sqlite.SQLiteDatabase.OpenParams);
    method @NonNull public android.database.sqlite.SQLiteDatabase.OpenParams.Builder addOpenFlags(int);
    method @NonNull public android.database.sqlite.SQLiteDatabase.OpenParams build();
    method @NonNull public android.database.sqlite.SQLiteDatabase.OpenParams.Builder removeOpenFlags(int);
    method @NonNull public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setCursorFactory(@Nullable android.database.sqlite.SQLiteDatabase.CursorFactory);
    method @NonNull public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setErrorHandler(@Nullable android.database.DatabaseErrorHandler);
    method @NonNull public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setIdleConnectionTimeout(@IntRange(from=0) long);
    method @NonNull public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setJournalMode(@NonNull String);
    method public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setLookasideConfig(@IntRange(from=0) int, @IntRange(from=0) int);
    method @NonNull public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setOpenFlags(int);
    method @NonNull public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setSynchronousMode(@NonNull String);
  }

  public class SQLiteDatabaseCorruptException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteDatabaseCorruptException();
    ctor public SQLiteDatabaseCorruptException(String);
  }

  public class SQLiteDatabaseLockedException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteDatabaseLockedException();
    ctor public SQLiteDatabaseLockedException(String);
  }

  public class SQLiteDatatypeMismatchException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteDatatypeMismatchException();
    ctor public SQLiteDatatypeMismatchException(String);
  }

  public class SQLiteDiskIOException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteDiskIOException();
    ctor public SQLiteDiskIOException(String);
  }

  public class SQLiteDoneException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteDoneException();
    ctor public SQLiteDoneException(String);
  }

  public class SQLiteException extends android.database.SQLException {
    ctor public SQLiteException();
    ctor public SQLiteException(String);
    ctor public SQLiteException(String, Throwable);
  }

  public class SQLiteFullException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteFullException();
    ctor public SQLiteFullException(String);
  }

  public class SQLiteMisuseException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteMisuseException();
    ctor public SQLiteMisuseException(String);
  }

  public abstract class SQLiteOpenHelper {
    ctor public SQLiteOpenHelper(@Nullable android.content.Context, @Nullable String, @Nullable android.database.sqlite.SQLiteDatabase.CursorFactory, int);
    ctor public SQLiteOpenHelper(@Nullable android.content.Context, @Nullable String, @Nullable android.database.sqlite.SQLiteDatabase.CursorFactory, int, @Nullable android.database.DatabaseErrorHandler);
    ctor public SQLiteOpenHelper(@Nullable android.content.Context, @Nullable String, int, @NonNull android.database.sqlite.SQLiteDatabase.OpenParams);
    method public void close();
    method public String getDatabaseName();
    method public android.database.sqlite.SQLiteDatabase getReadableDatabase();
    method public android.database.sqlite.SQLiteDatabase getWritableDatabase();
    method public void onConfigure(android.database.sqlite.SQLiteDatabase);
    method public abstract void onCreate(android.database.sqlite.SQLiteDatabase);
    method public void onDowngrade(android.database.sqlite.SQLiteDatabase, int, int);
    method public void onOpen(android.database.sqlite.SQLiteDatabase);
    method public abstract void onUpgrade(android.database.sqlite.SQLiteDatabase, int, int);
    method public void setIdleConnectionTimeout(@IntRange(from=0) long);
    method public void setLookasideConfig(@IntRange(from=0) int, @IntRange(from=0) int);
    method public void setOpenParams(@NonNull android.database.sqlite.SQLiteDatabase.OpenParams);
    method public void setWriteAheadLoggingEnabled(boolean);
  }

  public class SQLiteOutOfMemoryException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteOutOfMemoryException();
    ctor public SQLiteOutOfMemoryException(String);
  }

  public abstract class SQLiteProgram extends android.database.sqlite.SQLiteClosable {
    method public void bindAllArgsAsStrings(String[]);
    method public void bindBlob(int, byte[]);
    method public void bindDouble(int, double);
    method public void bindLong(int, long);
    method public void bindNull(int);
    method public void bindString(int, String);
    method public void clearBindings();
    method @Deprecated public final int getUniqueId();
    method protected void onAllReferencesReleased();
  }

  public final class SQLiteQuery extends android.database.sqlite.SQLiteProgram {
  }

  public class SQLiteQueryBuilder {
    ctor public SQLiteQueryBuilder();
    method public static void appendColumns(StringBuilder, String[]);
    method public void appendWhere(@NonNull CharSequence);
    method public void appendWhereEscapeString(@NonNull String);
    method public void appendWhereStandalone(@NonNull CharSequence);
    method public String buildQuery(String[], String, String, String, String, String);
    method @Deprecated public String buildQuery(String[], String, String[], String, String, String, String);
    method public static String buildQueryString(boolean, String, String[], String, String, String, String, String);
    method public String buildUnionQuery(String[], String, String);
    method public String buildUnionSubQuery(String, String[], java.util.Set<java.lang.String>, int, String, String, String, String);
    method @Deprecated public String buildUnionSubQuery(String, String[], java.util.Set<java.lang.String>, int, String, String, String[], String, String);
    method public String getTables();
    method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, String[], String, String[], String, String, String);
    method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, String[], String, String[], String, String, String, String);
    method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, String[], String, String[], String, String, String, String, android.os.CancellationSignal);
    method public void setCursorFactory(android.database.sqlite.SQLiteDatabase.CursorFactory);
    method public void setDistinct(boolean);
    method public void setProjectionMap(java.util.Map<java.lang.String,java.lang.String>);
    method public void setStrict(boolean);
    method public void setTables(String);
  }

  public class SQLiteReadOnlyDatabaseException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteReadOnlyDatabaseException();
    ctor public SQLiteReadOnlyDatabaseException(String);
  }

  public final class SQLiteStatement extends android.database.sqlite.SQLiteProgram {
    method public void execute();
    method public long executeInsert();
    method public int executeUpdateDelete();
    method public android.os.ParcelFileDescriptor simpleQueryForBlobFileDescriptor();
    method public long simpleQueryForLong();
    method public String simpleQueryForString();
  }

  public class SQLiteTableLockedException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteTableLockedException();
    ctor public SQLiteTableLockedException(String);
  }

  public interface SQLiteTransactionListener {
    method public void onBegin();
    method public void onCommit();
    method public void onRollback();
  }

}

package android.drm {

  public class DrmConvertedStatus {
    ctor public DrmConvertedStatus(int, byte[], int);
    field public static final int STATUS_ERROR = 3; // 0x3
    field public static final int STATUS_INPUTDATA_ERROR = 2; // 0x2
    field public static final int STATUS_OK = 1; // 0x1
    field public final byte[] convertedData;
    field public final int offset;
    field public final int statusCode;
  }

  public class DrmErrorEvent extends android.drm.DrmEvent {
    ctor public DrmErrorEvent(int, int, String);
    ctor public DrmErrorEvent(int, int, String, java.util.HashMap<java.lang.String,java.lang.Object>);
    field public static final int TYPE_ACQUIRE_DRM_INFO_FAILED = 2008; // 0x7d8
    field public static final int TYPE_NOT_SUPPORTED = 2003; // 0x7d3
    field public static final int TYPE_NO_INTERNET_CONNECTION = 2005; // 0x7d5
    field public static final int TYPE_OUT_OF_MEMORY = 2004; // 0x7d4
    field public static final int TYPE_PROCESS_DRM_INFO_FAILED = 2006; // 0x7d6
    field public static final int TYPE_REMOVE_ALL_RIGHTS_FAILED = 2007; // 0x7d7
    field public static final int TYPE_RIGHTS_NOT_INSTALLED = 2001; // 0x7d1
    field public static final int TYPE_RIGHTS_RENEWAL_NOT_ALLOWED = 2002; // 0x7d2
  }

  public class DrmEvent {
    ctor protected DrmEvent(int, int, String, java.util.HashMap<java.lang.String,java.lang.Object>);
    ctor protected DrmEvent(int, int, String);
    method public Object getAttribute(String);
    method public String getMessage();
    method public int getType();
    method public int getUniqueId();
    field public static final String DRM_INFO_OBJECT = "drm_info_object";
    field public static final String DRM_INFO_STATUS_OBJECT = "drm_info_status_object";
    field public static final int TYPE_ALL_RIGHTS_REMOVED = 1001; // 0x3e9
    field public static final int TYPE_DRM_INFO_PROCESSED = 1002; // 0x3ea
  }

  public class DrmInfo {
    ctor public DrmInfo(int, byte[], String);
    ctor public DrmInfo(int, String, String);
    method public Object get(String);
    method public byte[] getData();
    method public int getInfoType();
    method public String getMimeType();
    method public java.util.Iterator<java.lang.Object> iterator();
    method public java.util.Iterator<java.lang.String> keyIterator();
    method public void put(String, Object);
  }

  public class DrmInfoEvent extends android.drm.DrmEvent {
    ctor public DrmInfoEvent(int, int, String);
    ctor public DrmInfoEvent(int, int, String, java.util.HashMap<java.lang.String,java.lang.Object>);
    field public static final int TYPE_ACCOUNT_ALREADY_REGISTERED = 5; // 0x5
    field public static final int TYPE_ALREADY_REGISTERED_BY_ANOTHER_ACCOUNT = 1; // 0x1
    field public static final int TYPE_REMOVE_RIGHTS = 2; // 0x2
    field public static final int TYPE_RIGHTS_INSTALLED = 3; // 0x3
    field public static final int TYPE_RIGHTS_REMOVED = 6; // 0x6
    field public static final int TYPE_WAIT_FOR_RIGHTS = 4; // 0x4
  }

  public class DrmInfoRequest {
    ctor public DrmInfoRequest(int, String);
    method public Object get(String);
    method public int getInfoType();
    method public String getMimeType();
    method public java.util.Iterator<java.lang.Object> iterator();
    method public java.util.Iterator<java.lang.String> keyIterator();
    method public void put(String, Object);
    field public static final String ACCOUNT_ID = "account_id";
    field public static final String SUBSCRIPTION_ID = "subscription_id";
    field public static final int TYPE_REGISTRATION_INFO = 1; // 0x1
    field public static final int TYPE_RIGHTS_ACQUISITION_INFO = 3; // 0x3
    field public static final int TYPE_RIGHTS_ACQUISITION_PROGRESS_INFO = 4; // 0x4
    field public static final int TYPE_UNREGISTRATION_INFO = 2; // 0x2
  }

  public class DrmInfoStatus {
    ctor public DrmInfoStatus(int, int, android.drm.ProcessedData, String);
    field public static final int STATUS_ERROR = 2; // 0x2
    field public static final int STATUS_OK = 1; // 0x1
    field public final android.drm.ProcessedData data;
    field public final int infoType;
    field public final String mimeType;
    field public final int statusCode;
  }

  public class DrmManagerClient implements java.lang.AutoCloseable {
    ctor public DrmManagerClient(android.content.Context);
    method public android.drm.DrmInfo acquireDrmInfo(android.drm.DrmInfoRequest);
    method public int acquireRights(android.drm.DrmInfoRequest);
    method public boolean canHandle(String, String);
    method public boolean canHandle(android.net.Uri, String);
    method public int checkRightsStatus(String);
    method public int checkRightsStatus(android.net.Uri);
    method public int checkRightsStatus(String, int);
    method public int checkRightsStatus(android.net.Uri, int);
    method public void close();
    method public android.drm.DrmConvertedStatus closeConvertSession(int);
    method public android.drm.DrmConvertedStatus convertData(int, byte[]);
    method public String[] getAvailableDrmEngines();
    method public android.content.ContentValues getConstraints(String, int);
    method public android.content.ContentValues getConstraints(android.net.Uri, int);
    method public int getDrmObjectType(String, String);
    method public int getDrmObjectType(android.net.Uri, String);
    method public android.content.ContentValues getMetadata(String);
    method public android.content.ContentValues getMetadata(android.net.Uri);
    method public String getOriginalMimeType(String);
    method public String getOriginalMimeType(android.net.Uri);
    method public int openConvertSession(String);
    method public int processDrmInfo(android.drm.DrmInfo);
    method @Deprecated public void release();
    method public int removeAllRights();
    method public int removeRights(String);
    method public int removeRights(android.net.Uri);
    method public int saveRights(android.drm.DrmRights, String, String) throws java.io.IOException;
    method public void setOnErrorListener(android.drm.DrmManagerClient.OnErrorListener);
    method public void setOnEventListener(android.drm.DrmManagerClient.OnEventListener);
    method public void setOnInfoListener(android.drm.DrmManagerClient.OnInfoListener);
    field public static final int ERROR_NONE = 0; // 0x0
    field public static final int ERROR_UNKNOWN = -2000; // 0xfffff830
  }

  public static interface DrmManagerClient.OnErrorListener {
    method public void onError(android.drm.DrmManagerClient, android.drm.DrmErrorEvent);
  }

  public static interface DrmManagerClient.OnEventListener {
    method public void onEvent(android.drm.DrmManagerClient, android.drm.DrmEvent);
  }

  public static interface DrmManagerClient.OnInfoListener {
    method public void onInfo(android.drm.DrmManagerClient, android.drm.DrmInfoEvent);
  }

  public class DrmRights {
    ctor public DrmRights(String, String);
    ctor public DrmRights(String, String, String);
    ctor public DrmRights(String, String, String, String);
    ctor public DrmRights(java.io.File, String);
    ctor public DrmRights(android.drm.ProcessedData, String);
    method public String getAccountId();
    method public byte[] getData();
    method public String getMimeType();
    method public String getSubscriptionId();
  }

  public class DrmStore {
    ctor @Deprecated public DrmStore();
  }

  public static class DrmStore.Action {
    ctor @Deprecated public DrmStore.Action();
    field public static final int DEFAULT = 0; // 0x0
    field public static final int DISPLAY = 7; // 0x7
    field public static final int EXECUTE = 6; // 0x6
    field public static final int OUTPUT = 4; // 0x4
    field public static final int PLAY = 1; // 0x1
    field public static final int PREVIEW = 5; // 0x5
    field public static final int RINGTONE = 2; // 0x2
    field public static final int TRANSFER = 3; // 0x3
  }

  public static interface DrmStore.ConstraintsColumns {
    field public static final String EXTENDED_METADATA = "extended_metadata";
    field public static final String LICENSE_AVAILABLE_TIME = "license_available_time";
    field public static final String LICENSE_EXPIRY_TIME = "license_expiry_time";
    field public static final String LICENSE_START_TIME = "license_start_time";
    field public static final String MAX_REPEAT_COUNT = "max_repeat_count";
    field public static final String REMAINING_REPEAT_COUNT = "remaining_repeat_count";
  }

  public static class DrmStore.DrmObjectType {
    ctor @Deprecated public DrmStore.DrmObjectType();
    field public static final int CONTENT = 1; // 0x1
    field public static final int RIGHTS_OBJECT = 2; // 0x2
    field public static final int TRIGGER_OBJECT = 3; // 0x3
    field public static final int UNKNOWN = 0; // 0x0
  }

  public static class DrmStore.Playback {
    ctor @Deprecated public DrmStore.Playback();
    field public static final int PAUSE = 2; // 0x2
    field public static final int RESUME = 3; // 0x3
    field public static final int START = 0; // 0x0
    field public static final int STOP = 1; // 0x1
  }

  public static class DrmStore.RightsStatus {
    ctor @Deprecated public DrmStore.RightsStatus();
    field public static final int RIGHTS_EXPIRED = 2; // 0x2
    field public static final int RIGHTS_INVALID = 1; // 0x1
    field public static final int RIGHTS_NOT_ACQUIRED = 3; // 0x3
    field public static final int RIGHTS_VALID = 0; // 0x0
  }

  public class DrmSupportInfo {
    ctor public DrmSupportInfo();
    method public void addFileSuffix(String);
    method public void addMimeType(String);
    method @Deprecated public String getDescriprition();
    method public String getDescription();
    method public java.util.Iterator<java.lang.String> getFileSuffixIterator();
    method public java.util.Iterator<java.lang.String> getMimeTypeIterator();
    method public void setDescription(String);
  }

  public class DrmUtils {
    ctor public DrmUtils();
    method public static android.drm.DrmUtils.ExtendedMetadataParser getExtendedMetadataParser(byte[]);
  }

  public static class DrmUtils.ExtendedMetadataParser {
    method public String get(String);
    method public java.util.Iterator<java.lang.String> iterator();
    method public java.util.Iterator<java.lang.String> keyIterator();
  }

  public class ProcessedData {
    method public String getAccountId();
    method public byte[] getData();
    method public String getSubscriptionId();
  }

}

package android.gesture {

  public class Gesture implements android.os.Parcelable {
    ctor public Gesture();
    method public void addStroke(android.gesture.GestureStroke);
    method public Object clone();
    method public int describeContents();
    method public android.graphics.RectF getBoundingBox();
    method public long getID();
    method public float getLength();
    method public java.util.ArrayList<android.gesture.GestureStroke> getStrokes();
    method public int getStrokesCount();
    method public android.graphics.Bitmap toBitmap(int, int, int, int, int);
    method public android.graphics.Bitmap toBitmap(int, int, int, int);
    method public android.graphics.Path toPath();
    method public android.graphics.Path toPath(android.graphics.Path);
    method public android.graphics.Path toPath(int, int, int, int);
    method public android.graphics.Path toPath(android.graphics.Path, int, int, int, int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.gesture.Gesture> CREATOR;
  }

  public final class GestureLibraries {
    method public static android.gesture.GestureLibrary fromFile(String);
    method public static android.gesture.GestureLibrary fromFile(java.io.File);
    method public static android.gesture.GestureLibrary fromPrivateFile(android.content.Context, String);
    method public static android.gesture.GestureLibrary fromRawResource(android.content.Context, @RawRes int);
  }

  public abstract class GestureLibrary {
    ctor protected GestureLibrary();
    method public void addGesture(String, android.gesture.Gesture);
    method public java.util.Set<java.lang.String> getGestureEntries();
    method public java.util.ArrayList<android.gesture.Gesture> getGestures(String);
    method public int getOrientationStyle();
    method public int getSequenceType();
    method public boolean isReadOnly();
    method public abstract boolean load();
    method public java.util.ArrayList<android.gesture.Prediction> recognize(android.gesture.Gesture);
    method public void removeEntry(String);
    method public void removeGesture(String, android.gesture.Gesture);
    method public abstract boolean save();
    method public void setOrientationStyle(int);
    method public void setSequenceType(int);
    field protected final android.gesture.GestureStore mStore;
  }

  public class GestureOverlayView extends android.widget.FrameLayout {
    ctor public GestureOverlayView(android.content.Context);
    ctor public GestureOverlayView(android.content.Context, android.util.AttributeSet);
    ctor public GestureOverlayView(android.content.Context, android.util.AttributeSet, int);
    ctor public GestureOverlayView(android.content.Context, android.util.AttributeSet, int, int);
    method public void addOnGestureListener(android.gesture.GestureOverlayView.OnGestureListener);
    method public void addOnGesturePerformedListener(android.gesture.GestureOverlayView.OnGesturePerformedListener);
    method public void addOnGesturingListener(android.gesture.GestureOverlayView.OnGesturingListener);
    method public void cancelClearAnimation();
    method public void cancelGesture();
    method public void clear(boolean);
    method public java.util.ArrayList<android.gesture.GesturePoint> getCurrentStroke();
    method public long getFadeOffset();
    method public android.gesture.Gesture getGesture();
    method @ColorInt public int getGestureColor();
    method public android.graphics.Path getGesturePath();
    method public android.graphics.Path getGesturePath(android.graphics.Path);
    method public float getGestureStrokeAngleThreshold();
    method public float getGestureStrokeLengthThreshold();
    method public float getGestureStrokeSquarenessTreshold();
    method public int getGestureStrokeType();
    method public float getGestureStrokeWidth();
    method public int getOrientation();
    method @ColorInt public int getUncertainGestureColor();
    method public boolean isEventsInterceptionEnabled();
    method public boolean isFadeEnabled();
    method public boolean isGestureVisible();
    method public boolean isGesturing();
    method public void removeAllOnGestureListeners();
    method public void removeAllOnGesturePerformedListeners();
    method public void removeAllOnGesturingListeners();
    method public void removeOnGestureListener(android.gesture.GestureOverlayView.OnGestureListener);
    method public void removeOnGesturePerformedListener(android.gesture.GestureOverlayView.OnGesturePerformedListener);
    method public void removeOnGesturingListener(android.gesture.GestureOverlayView.OnGesturingListener);
    method public void setEventsInterceptionEnabled(boolean);
    method public void setFadeEnabled(boolean);
    method public void setFadeOffset(long);
    method public void setGesture(android.gesture.Gesture);
    method public void setGestureColor(@ColorInt int);
    method public void setGestureStrokeAngleThreshold(float);
    method public void setGestureStrokeLengthThreshold(float);
    method public void setGestureStrokeSquarenessTreshold(float);
    method public void setGestureStrokeType(int);
    method public void setGestureStrokeWidth(float);
    method public void setGestureVisible(boolean);
    method public void setOrientation(int);
    method public void setUncertainGestureColor(@ColorInt int);
    field public static final int GESTURE_STROKE_TYPE_MULTIPLE = 1; // 0x1
    field public static final int GESTURE_STROKE_TYPE_SINGLE = 0; // 0x0
    field public static final int ORIENTATION_HORIZONTAL = 0; // 0x0
    field public static final int ORIENTATION_VERTICAL = 1; // 0x1
  }

  public static interface GestureOverlayView.OnGestureListener {
    method public void onGesture(android.gesture.GestureOverlayView, android.view.MotionEvent);
    method public void onGestureCancelled(android.gesture.GestureOverlayView, android.view.MotionEvent);
    method public void onGestureEnded(android.gesture.GestureOverlayView, android.view.MotionEvent);
    method public void onGestureStarted(android.gesture.GestureOverlayView, android.view.MotionEvent);
  }

  public static interface GestureOverlayView.OnGesturePerformedListener {
    method public void onGesturePerformed(android.gesture.GestureOverlayView, android.gesture.Gesture);
  }

  public static interface GestureOverlayView.OnGesturingListener {
    method public void onGesturingEnded(android.gesture.GestureOverlayView);
    method public void onGesturingStarted(android.gesture.GestureOverlayView);
  }

  public class GesturePoint {
    ctor public GesturePoint(float, float, long);
    method public Object clone();
    field public final long timestamp;
    field public final float x;
    field public final float y;
  }

  public class GestureStore {
    ctor public GestureStore();
    method public void addGesture(String, android.gesture.Gesture);
    method public java.util.Set<java.lang.String> getGestureEntries();
    method public java.util.ArrayList<android.gesture.Gesture> getGestures(String);
    method public int getOrientationStyle();
    method public int getSequenceType();
    method public boolean hasChanged();
    method public void load(java.io.InputStream) throws java.io.IOException;
    method public void load(java.io.InputStream, boolean) throws java.io.IOException;
    method public java.util.ArrayList<android.gesture.Prediction> recognize(android.gesture.Gesture);
    method public void removeEntry(String);
    method public void removeGesture(String, android.gesture.Gesture);
    method public void save(java.io.OutputStream) throws java.io.IOException;
    method public void save(java.io.OutputStream, boolean) throws java.io.IOException;
    method public void setOrientationStyle(int);
    method public void setSequenceType(int);
    field public static final int ORIENTATION_INVARIANT = 1; // 0x1
    field public static final int ORIENTATION_SENSITIVE = 2; // 0x2
    field public static final int SEQUENCE_INVARIANT = 1; // 0x1
    field public static final int SEQUENCE_SENSITIVE = 2; // 0x2
  }

  public class GestureStroke {
    ctor public GestureStroke(java.util.ArrayList<android.gesture.GesturePoint>);
    method public void clearPath();
    method public Object clone();
    method public android.gesture.OrientedBoundingBox computeOrientedBoundingBox();
    method public android.graphics.Path getPath();
    method public android.graphics.Path toPath(float, float, int);
    field public final android.graphics.RectF boundingBox;
    field public final float length;
    field public final float[] points;
  }

  public final class GestureUtils {
    method public static android.gesture.OrientedBoundingBox computeOrientedBoundingBox(java.util.ArrayList<android.gesture.GesturePoint>);
    method public static android.gesture.OrientedBoundingBox computeOrientedBoundingBox(float[]);
    method public static float[] spatialSampling(android.gesture.Gesture, int);
    method public static float[] spatialSampling(android.gesture.Gesture, int, boolean);
    method public static float[] temporalSampling(android.gesture.GestureStroke, int);
  }

  public class OrientedBoundingBox {
    field public final float centerX;
    field public final float centerY;
    field public final float height;
    field public final float orientation;
    field public final float squareness;
    field public final float width;
  }

  public class Prediction {
    field public final String name;
    field public double score;
  }

}

package android.graphics {

  public final class Bitmap implements android.os.Parcelable {
    method @WorkerThread public boolean compress(android.graphics.Bitmap.CompressFormat, int, java.io.OutputStream);
    method public android.graphics.Bitmap copy(android.graphics.Bitmap.Config, boolean);
    method public void copyPixelsFromBuffer(java.nio.Buffer);
    method public void copyPixelsToBuffer(java.nio.Buffer);
    method public static android.graphics.Bitmap createBitmap(@NonNull android.graphics.Bitmap);
    method public static android.graphics.Bitmap createBitmap(@NonNull android.graphics.Bitmap, int, int, int, int);
    method public static android.graphics.Bitmap createBitmap(@NonNull android.graphics.Bitmap, int, int, int, int, @Nullable android.graphics.Matrix, boolean);
    method public static android.graphics.Bitmap createBitmap(int, int, @NonNull android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createBitmap(@Nullable android.util.DisplayMetrics, int, int, @NonNull android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createBitmap(int, int, @NonNull android.graphics.Bitmap.Config, boolean);
    method public static android.graphics.Bitmap createBitmap(int, int, @NonNull android.graphics.Bitmap.Config, boolean, @NonNull android.graphics.ColorSpace);
    method public static android.graphics.Bitmap createBitmap(@Nullable android.util.DisplayMetrics, int, int, @NonNull android.graphics.Bitmap.Config, boolean);
    method public static android.graphics.Bitmap createBitmap(@Nullable android.util.DisplayMetrics, int, int, @NonNull android.graphics.Bitmap.Config, boolean, @NonNull android.graphics.ColorSpace);
    method public static android.graphics.Bitmap createBitmap(@NonNull @ColorInt int[], int, int, int, int, @NonNull android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createBitmap(@NonNull android.util.DisplayMetrics, @NonNull @ColorInt int[], int, int, int, int, @NonNull android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createBitmap(@NonNull @ColorInt int[], int, int, android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createBitmap(@Nullable android.util.DisplayMetrics, @NonNull @ColorInt int[], int, int, @NonNull android.graphics.Bitmap.Config);
    method @NonNull public static android.graphics.Bitmap createBitmap(@NonNull android.graphics.Picture);
    method @NonNull public static android.graphics.Bitmap createBitmap(@NonNull android.graphics.Picture, int, int, @NonNull android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createScaledBitmap(@NonNull android.graphics.Bitmap, int, int, boolean);
    method public int describeContents();
    method public void eraseColor(@ColorInt int);
    method @CheckResult public android.graphics.Bitmap extractAlpha();
    method @CheckResult public android.graphics.Bitmap extractAlpha(android.graphics.Paint, int[]);
    method public int getAllocationByteCount();
    method public int getByteCount();
    method @Nullable public android.graphics.ColorSpace getColorSpace();
    method public android.graphics.Bitmap.Config getConfig();
    method public int getDensity();
    method public int getGenerationId();
    method public int getHeight();
    method public byte[] getNinePatchChunk();
    method @ColorInt public int getPixel(int, int);
    method public void getPixels(@ColorInt int[], int, int, int, int, int, int);
    method public int getRowBytes();
    method public int getScaledHeight(android.graphics.Canvas);
    method public int getScaledHeight(android.util.DisplayMetrics);
    method public int getScaledHeight(int);
    method public int getScaledWidth(android.graphics.Canvas);
    method public int getScaledWidth(android.util.DisplayMetrics);
    method public int getScaledWidth(int);
    method public int getWidth();
    method public boolean hasAlpha();
    method public boolean hasMipMap();
    method public boolean isMutable();
    method public boolean isPremultiplied();
    method public boolean isRecycled();
    method public void prepareToDraw();
    method public void reconfigure(int, int, android.graphics.Bitmap.Config);
    method public void recycle();
    method public boolean sameAs(android.graphics.Bitmap);
    method public void setConfig(android.graphics.Bitmap.Config);
    method public void setDensity(int);
    method public void setHasAlpha(boolean);
    method public void setHasMipMap(boolean);
    method public void setHeight(int);
    method public void setPixel(int, int, @ColorInt int);
    method public void setPixels(@ColorInt int[], int, int, int, int, int, int);
    method public void setPremultiplied(boolean);
    method public void setWidth(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.graphics.Bitmap> CREATOR;
    field public static final int DENSITY_NONE = 0; // 0x0
  }

  public enum Bitmap.CompressFormat {
    enum_constant public static final android.graphics.Bitmap.CompressFormat JPEG;
    enum_constant public static final android.graphics.Bitmap.CompressFormat PNG;
    enum_constant public static final android.graphics.Bitmap.CompressFormat WEBP;
  }

  public enum Bitmap.Config {
    enum_constant public static final android.graphics.Bitmap.Config ALPHA_8;
    enum_constant @Deprecated public static final android.graphics.Bitmap.Config ARGB_4444;
    enum_constant public static final android.graphics.Bitmap.Config ARGB_8888;
    enum_constant public static final android.graphics.Bitmap.Config HARDWARE;
    enum_constant public static final android.graphics.Bitmap.Config RGBA_F16;
    enum_constant public static final android.graphics.Bitmap.Config RGB_565;
  }

  public class BitmapFactory {
    ctor public BitmapFactory();
    method public static android.graphics.Bitmap decodeByteArray(byte[], int, int, android.graphics.BitmapFactory.Options);
    method public static android.graphics.Bitmap decodeByteArray(byte[], int, int);
    method public static android.graphics.Bitmap decodeFile(String, android.graphics.BitmapFactory.Options);
    method public static android.graphics.Bitmap decodeFile(String);
    method public static android.graphics.Bitmap decodeFileDescriptor(java.io.FileDescriptor, android.graphics.Rect, android.graphics.BitmapFactory.Options);
    method public static android.graphics.Bitmap decodeFileDescriptor(java.io.FileDescriptor);
    method public static android.graphics.Bitmap decodeResource(android.content.res.Resources, int, android.graphics.BitmapFactory.Options);
    method public static android.graphics.Bitmap decodeResource(android.content.res.Resources, int);
    method @Nullable public static android.graphics.Bitmap decodeResourceStream(@Nullable android.content.res.Resources, @Nullable android.util.TypedValue, @Nullable java.io.InputStream, @Nullable android.graphics.Rect, @Nullable android.graphics.BitmapFactory.Options);
    method @Nullable public static android.graphics.Bitmap decodeStream(@Nullable java.io.InputStream, @Nullable android.graphics.Rect, @Nullable android.graphics.BitmapFactory.Options);
    method public static android.graphics.Bitmap decodeStream(java.io.InputStream);
  }

  public static class BitmapFactory.Options {
    ctor public BitmapFactory.Options();
    method @Deprecated public void requestCancelDecode();
    field public android.graphics.Bitmap inBitmap;
    field public int inDensity;
    field @Deprecated public boolean inDither;
    field @Deprecated public boolean inInputShareable;
    field public boolean inJustDecodeBounds;
    field public boolean inMutable;
    field @Deprecated public boolean inPreferQualityOverSpeed;
    field public android.graphics.ColorSpace inPreferredColorSpace;
    field public android.graphics.Bitmap.Config inPreferredConfig;
    field public boolean inPremultiplied;
    field @Deprecated public boolean inPurgeable;
    field public int inSampleSize;
    field public boolean inScaled;
    field public int inScreenDensity;
    field public int inTargetDensity;
    field public byte[] inTempStorage;
    field @Deprecated public boolean mCancel;
    field public android.graphics.ColorSpace outColorSpace;
    field public android.graphics.Bitmap.Config outConfig;
    field public int outHeight;
    field public String outMimeType;
    field public int outWidth;
  }

  public final class BitmapRegionDecoder {
    method public android.graphics.Bitmap decodeRegion(android.graphics.Rect, android.graphics.BitmapFactory.Options);
    method public int getHeight();
    method public int getWidth();
    method public boolean isRecycled();
    method public static android.graphics.BitmapRegionDecoder newInstance(byte[], int, int, boolean) throws java.io.IOException;
    method public static android.graphics.BitmapRegionDecoder newInstance(java.io.FileDescriptor, boolean) throws java.io.IOException;
    method public static android.graphics.BitmapRegionDecoder newInstance(java.io.InputStream, boolean) throws java.io.IOException;
    method public static android.graphics.BitmapRegionDecoder newInstance(String, boolean) throws java.io.IOException;
    method public void recycle();
  }

  public class BitmapShader extends android.graphics.Shader {
    ctor public BitmapShader(@NonNull android.graphics.Bitmap, @NonNull android.graphics.Shader.TileMode, @NonNull android.graphics.Shader.TileMode);
  }

  public class BlurMaskFilter extends android.graphics.MaskFilter {
    ctor public BlurMaskFilter(float, android.graphics.BlurMaskFilter.Blur);
  }

  public enum BlurMaskFilter.Blur {
    enum_constant public static final android.graphics.BlurMaskFilter.Blur INNER;
    enum_constant public static final android.graphics.BlurMaskFilter.Blur NORMAL;
    enum_constant public static final android.graphics.BlurMaskFilter.Blur OUTER;
    enum_constant public static final android.graphics.BlurMaskFilter.Blur SOLID;
  }

  public class Camera {
    ctor public Camera();
    method public void applyToCanvas(android.graphics.Canvas);
    method public float dotWithNormal(float, float, float);
    method public float getLocationX();
    method public float getLocationY();
    method public float getLocationZ();
    method public void getMatrix(android.graphics.Matrix);
    method public void restore();
    method public void rotate(float, float, float);
    method public void rotateX(float);
    method public void rotateY(float);
    method public void rotateZ(float);
    method public void save();
    method public void setLocation(float, float, float);
    method public void translate(float, float, float);
  }

  public class Canvas {
    ctor public Canvas();
    ctor public Canvas(@NonNull android.graphics.Bitmap);
    method public boolean clipOutPath(@NonNull android.graphics.Path);
    method public boolean clipOutRect(@NonNull android.graphics.RectF);
    method public boolean clipOutRect(@NonNull android.graphics.Rect);
    method public boolean clipOutRect(float, float, float, float);
    method public boolean clipOutRect(int, int, int, int);
    method @Deprecated public boolean clipPath(@NonNull android.graphics.Path, @NonNull android.graphics.Region.Op);
    method public boolean clipPath(@NonNull android.graphics.Path);
    method @Deprecated public boolean clipRect(@NonNull android.graphics.RectF, @NonNull android.graphics.Region.Op);
    method @Deprecated public boolean clipRect(@NonNull android.graphics.Rect, @NonNull android.graphics.Region.Op);
    method public boolean clipRect(@NonNull android.graphics.RectF);
    method public boolean clipRect(@NonNull android.graphics.Rect);
    method @Deprecated public boolean clipRect(float, float, float, float, @NonNull android.graphics.Region.Op);
    method public boolean clipRect(float, float, float, float);
    method public boolean clipRect(int, int, int, int);
    method public void concat(@Nullable android.graphics.Matrix);
    method public void drawARGB(int, int, int, int);
    method public void drawArc(@NonNull android.graphics.RectF, float, float, boolean, @NonNull android.graphics.Paint);
    method public void drawArc(float, float, float, float, float, float, boolean, @NonNull android.graphics.Paint);
    method public void drawBitmap(@NonNull android.graphics.Bitmap, float, float, @Nullable android.graphics.Paint);
    method public void drawBitmap(@NonNull android.graphics.Bitmap, @Nullable android.graphics.Rect, @NonNull android.graphics.RectF, @Nullable android.graphics.Paint);
    method public void drawBitmap(@NonNull android.graphics.Bitmap, @Nullable android.graphics.Rect, @NonNull android.graphics.Rect, @Nullable android.graphics.Paint);
    method @Deprecated public void drawBitmap(@NonNull int[], int, int, float, float, int, int, boolean, @Nullable android.graphics.Paint);
    method @Deprecated public void drawBitmap(@NonNull int[], int, int, int, int, int, int, boolean, @Nullable android.graphics.Paint);
    method public void drawBitmap(@NonNull android.graphics.Bitmap, @NonNull android.graphics.Matrix, @Nullable android.graphics.Paint);
    method public void drawBitmapMesh(@NonNull android.graphics.Bitmap, int, int, @NonNull float[], int, @Nullable int[], int, @Nullable android.graphics.Paint);
    method public void drawCircle(float, float, float, @NonNull android.graphics.Paint);
    method public void drawColor(@ColorInt int);
    method public void drawColor(@ColorInt int, @NonNull android.graphics.PorterDuff.Mode);
    method public void drawLine(float, float, float, float, @NonNull android.graphics.Paint);
    method public void drawLines(@Size(multiple=4) @NonNull float[], int, int, @NonNull android.graphics.Paint);
    method public void drawLines(@Size(multiple=4) @NonNull float[], @NonNull android.graphics.Paint);
    method public void drawOval(@NonNull android.graphics.RectF, @NonNull android.graphics.Paint);
    method public void drawOval(float, float, float, float, @NonNull android.graphics.Paint);
    method public void drawPaint(@NonNull android.graphics.Paint);
    method public void drawPath(@NonNull android.graphics.Path, @NonNull android.graphics.Paint);
    method public void drawPicture(@NonNull android.graphics.Picture);
    method public void drawPicture(@NonNull android.graphics.Picture, @NonNull android.graphics.RectF);
    method public void drawPicture(@NonNull android.graphics.Picture, @NonNull android.graphics.Rect);
    method public void drawPoint(float, float, @NonNull android.graphics.Paint);
    method public void drawPoints(@Size(multiple=2) float[], int, int, @NonNull android.graphics.Paint);
    method public void drawPoints(@Size(multiple=2) @NonNull float[], @NonNull android.graphics.Paint);
    method @Deprecated public void drawPosText(@NonNull char[], int, int, @NonNull @Size(multiple=2) float[], @NonNull android.graphics.Paint);
    method @Deprecated public void drawPosText(@NonNull String, @NonNull @Size(multiple=2) float[], @NonNull android.graphics.Paint);
    method public void drawRGB(int, int, int);
    method public void drawRect(@NonNull android.graphics.RectF, @NonNull android.graphics.Paint);
    method public void drawRect(@NonNull android.graphics.Rect, @NonNull android.graphics.Paint);
    method public void drawRect(float, float, float, float, @NonNull android.graphics.Paint);
    method public void drawRoundRect(@NonNull android.graphics.RectF, float, float, @NonNull android.graphics.Paint);
    method public void drawRoundRect(float, float, float, float, float, float, @NonNull android.graphics.Paint);
    method public void drawText(@NonNull char[], int, int, float, float, @NonNull android.graphics.Paint);
    method public void drawText(@NonNull String, float, float, @NonNull android.graphics.Paint);
    method public void drawText(@NonNull String, int, int, float, float, @NonNull android.graphics.Paint);
    method public void drawText(@NonNull CharSequence, int, int, float, float, @NonNull android.graphics.Paint);
    method public void drawTextOnPath(@NonNull char[], int, int, @NonNull android.graphics.Path, float, float, @NonNull android.graphics.Paint);
    method public void drawTextOnPath(@NonNull String, @NonNull android.graphics.Path, float, float, @NonNull android.graphics.Paint);
    method public void drawTextRun(@NonNull char[], int, int, int, int, float, float, boolean, @NonNull android.graphics.Paint);
    method public void drawTextRun(@NonNull CharSequence, int, int, int, int, float, float, boolean, @NonNull android.graphics.Paint);
    method public void drawVertices(@NonNull android.graphics.Canvas.VertexMode, int, @NonNull float[], int, @Nullable float[], int, @Nullable int[], int, @Nullable short[], int, int, @NonNull android.graphics.Paint);
    method public boolean getClipBounds(@Nullable android.graphics.Rect);
    method @NonNull public final android.graphics.Rect getClipBounds();
    method public int getDensity();
    method @Nullable public android.graphics.DrawFilter getDrawFilter();
    method public int getHeight();
    method @Deprecated public void getMatrix(@NonNull android.graphics.Matrix);
    method @Deprecated @NonNull public final android.graphics.Matrix getMatrix();
    method public int getMaximumBitmapHeight();
    method public int getMaximumBitmapWidth();
    method public int getSaveCount();
    method public int getWidth();
    method public boolean isHardwareAccelerated();
    method public boolean isOpaque();
    method public boolean quickReject(@NonNull android.graphics.RectF, @NonNull android.graphics.Canvas.EdgeType);
    method public boolean quickReject(@NonNull android.graphics.Path, @NonNull android.graphics.Canvas.EdgeType);
    method public boolean quickReject(float, float, float, float, @NonNull android.graphics.Canvas.EdgeType);
    method public void restore();
    method public void restoreToCount(int);
    method public void rotate(float);
    method public final void rotate(float, float, float);
    method public int save();
    method @Deprecated public int saveLayer(@Nullable android.graphics.RectF, @Nullable android.graphics.Paint, int);
    method public int saveLayer(@Nullable android.graphics.RectF, @Nullable android.graphics.Paint);
    method @Deprecated public int saveLayer(float, float, float, float, @Nullable android.graphics.Paint, int);
    method public int saveLayer(float, float, float, float, @Nullable android.graphics.Paint);
    method @Deprecated public int saveLayerAlpha(@Nullable android.graphics.RectF, int, int);
    method public int saveLayerAlpha(@Nullable android.graphics.RectF, int);
    method @Deprecated public int saveLayerAlpha(float, float, float, float, int, int);
    method public int saveLayerAlpha(float, float, float, float, int);
    method public void scale(float, float);
    method public final void scale(float, float, float, float);
    method public void setBitmap(@Nullable android.graphics.Bitmap);
    method public void setDensity(int);
    method public void setDrawFilter(@Nullable android.graphics.DrawFilter);
    method public void setMatrix(@Nullable android.graphics.Matrix);
    method public void skew(float, float);
    method public void translate(float, float);
    field public static final int ALL_SAVE_FLAG = 31; // 0x1f
  }

  public enum Canvas.EdgeType {
    enum_constant public static final android.graphics.Canvas.EdgeType AA;
    enum_constant public static final android.graphics.Canvas.EdgeType BW;
  }

  public enum Canvas.VertexMode {
    enum_constant public static final android.graphics.Canvas.VertexMode TRIANGLES;
    enum_constant public static final android.graphics.Canvas.VertexMode TRIANGLE_FAN;
    enum_constant public static final android.graphics.Canvas.VertexMode TRIANGLE_STRIP;
  }

  @AnyThread public class Color {
    ctor public Color();
    method @ColorInt public static int HSVToColor(@Size(3) float[]);
    method @ColorInt public static int HSVToColor(@IntRange(from=0, to=255) int, @Size(3) float[]);
    method public static void RGBToHSV(@IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int, @Size(3) float[]);
    method public float alpha();
    method public static float alpha(@ColorLong long);
    method @IntRange(from=0, to=255) public static int alpha(int);
    method @ColorInt public static int argb(@IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int);
    method @ColorInt public static int argb(float, float, float, float);
    method public float blue();
    method public static float blue(@ColorLong long);
    method @IntRange(from=0, to=255) public static int blue(int);
    method @NonNull public static android.graphics.ColorSpace colorSpace(@ColorLong long);
    method public static void colorToHSV(@ColorInt int, @Size(3) float[]);
    method @NonNull public android.graphics.Color convert(@NonNull android.graphics.ColorSpace);
    method @ColorLong public static long convert(@ColorInt int, @NonNull android.graphics.ColorSpace);
    method @ColorLong public static long convert(@ColorLong long, @NonNull android.graphics.ColorSpace);
    method @ColorLong public static long convert(float, float, float, float, @NonNull android.graphics.ColorSpace, @NonNull android.graphics.ColorSpace);
    method @ColorLong public static long convert(@ColorLong long, @NonNull android.graphics.ColorSpace.Connector);
    method @ColorLong public static long convert(float, float, float, float, @NonNull android.graphics.ColorSpace.Connector);
    method @NonNull public android.graphics.ColorSpace getColorSpace();
    method public float getComponent(@IntRange(from=0, to=4) int);
    method @IntRange(from=4, to=5) public int getComponentCount();
    method @NonNull @Size(min=4, max=5) public float[] getComponents();
    method @NonNull @Size(min=4) public float[] getComponents(@Nullable @Size(min=4) float[]);
    method public android.graphics.ColorSpace.Model getModel();
    method public float green();
    method public static float green(@ColorLong long);
    method @IntRange(from=0, to=255) public static int green(int);
    method public static boolean isInColorSpace(@ColorLong long, @NonNull android.graphics.ColorSpace);
    method public boolean isSrgb();
    method public static boolean isSrgb(@ColorLong long);
    method public boolean isWideGamut();
    method public static boolean isWideGamut(@ColorLong long);
    method public float luminance();
    method public static float luminance(@ColorLong long);
    method public static float luminance(@ColorInt int);
    method @ColorLong public long pack();
    method @ColorLong public static long pack(@ColorInt int);
    method @ColorLong public static long pack(float, float, float);
    method @ColorLong public static long pack(float, float, float, float);
    method @ColorLong public static long pack(float, float, float, float, @NonNull android.graphics.ColorSpace);
    method @ColorInt public static int parseColor(@Size(min=1) String);
    method public float red();
    method public static float red(@ColorLong long);
    method @IntRange(from=0, to=255) public static int red(int);
    method @ColorInt public static int rgb(@IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int);
    method @ColorInt public static int rgb(float, float, float);
    method @ColorInt public int toArgb();
    method @ColorInt public static int toArgb(@ColorLong long);
    method @NonNull public static android.graphics.Color valueOf(@ColorInt int);
    method @NonNull public static android.graphics.Color valueOf(@ColorLong long);
    method @NonNull public static android.graphics.Color valueOf(float, float, float);
    method @NonNull public static android.graphics.Color valueOf(float, float, float, float);
    method @NonNull public static android.graphics.Color valueOf(float, float, float, float, @NonNull android.graphics.ColorSpace);
    method @NonNull public static android.graphics.Color valueOf(@NonNull @Size(min=4, max=5) float[], @NonNull android.graphics.ColorSpace);
    field @ColorInt public static final int BLACK = -16777216; // 0xff000000
    field @ColorInt public static final int BLUE = -16776961; // 0xff0000ff
    field @ColorInt public static final int CYAN = -16711681; // 0xff00ffff
    field @ColorInt public static final int DKGRAY = -12303292; // 0xff444444
    field @ColorInt public static final int GRAY = -7829368; // 0xff888888
    field @ColorInt public static final int GREEN = -16711936; // 0xff00ff00
    field @ColorInt public static final int LTGRAY = -3355444; // 0xffcccccc
    field @ColorInt public static final int MAGENTA = -65281; // 0xffff00ff
    field @ColorInt public static final int RED = -65536; // 0xffff0000
    field @ColorInt public static final int TRANSPARENT = 0; // 0x0
    field @ColorInt public static final int WHITE = -1; // 0xffffffff
    field @ColorInt public static final int YELLOW = -256; // 0xffffff00
  }

  public class ColorFilter {
    ctor @Deprecated public ColorFilter();
  }

  public class ColorMatrix {
    ctor public ColorMatrix();
    ctor public ColorMatrix(float[]);
    ctor public ColorMatrix(android.graphics.ColorMatrix);
    method public final float[] getArray();
    method public void postConcat(android.graphics.ColorMatrix);
    method public void preConcat(android.graphics.ColorMatrix);
    method public void reset();
    method public void set(android.graphics.ColorMatrix);
    method public void set(float[]);
    method public void setConcat(android.graphics.ColorMatrix, android.graphics.ColorMatrix);
    method public void setRGB2YUV();
    method public void setRotate(int, float);
    method public void setSaturation(float);
    method public void setScale(float, float, float, float);
    method public void setYUV2RGB();
  }

  public class ColorMatrixColorFilter extends android.graphics.ColorFilter {
    ctor public ColorMatrixColorFilter(@NonNull android.graphics.ColorMatrix);
    ctor public ColorMatrixColorFilter(@NonNull float[]);
    method public void getColorMatrix(android.graphics.ColorMatrix);
  }

  @AnyThread public abstract class ColorSpace {
    method @NonNull public static android.graphics.ColorSpace adapt(@NonNull android.graphics.ColorSpace, @NonNull @Size(min=2, max=3) float[]);
    method @NonNull public static android.graphics.ColorSpace adapt(@NonNull android.graphics.ColorSpace, @NonNull @Size(min=2, max=3) float[], @NonNull android.graphics.ColorSpace.Adaptation);
    method @NonNull public static android.graphics.ColorSpace.Connector connect(@NonNull android.graphics.ColorSpace, @NonNull android.graphics.ColorSpace);
    method @NonNull public static android.graphics.ColorSpace.Connector connect(@NonNull android.graphics.ColorSpace, @NonNull android.graphics.ColorSpace, @NonNull android.graphics.ColorSpace.RenderIntent);
    method @NonNull public static android.graphics.ColorSpace.Connector connect(@NonNull android.graphics.ColorSpace);
    method @NonNull public static android.graphics.ColorSpace.Connector connect(@NonNull android.graphics.ColorSpace, @NonNull android.graphics.ColorSpace.RenderIntent);
    method @NonNull @Size(min=3) public float[] fromXyz(float, float, float);
    method @NonNull @Size(min=3) public abstract float[] fromXyz(@NonNull @Size(min=3) float[]);
    method @NonNull public static android.graphics.ColorSpace get(@NonNull android.graphics.ColorSpace.Named);
    method @IntRange(from=1, to=4) public int getComponentCount();
    method @IntRange(from=android.graphics.ColorSpace.MIN_ID, to=android.graphics.ColorSpace.MAX_ID) public int getId();
    method public abstract float getMaxValue(@IntRange(from=0, to=3) int);
    method public abstract float getMinValue(@IntRange(from=0, to=3) int);
    method @NonNull public android.graphics.ColorSpace.Model getModel();
    method @NonNull public String getName();
    method public boolean isSrgb();
    method public abstract boolean isWideGamut();
    method @Nullable public static android.graphics.ColorSpace match(@NonNull @Size(9) float[], @NonNull android.graphics.ColorSpace.Rgb.TransferParameters);
    method @NonNull @Size(3) public float[] toXyz(float, float, float);
    method @NonNull @Size(min=3) public abstract float[] toXyz(@NonNull @Size(min=3) float[]);
    field public static final float[] ILLUMINANT_A;
    field public static final float[] ILLUMINANT_B;
    field public static final float[] ILLUMINANT_C;
    field public static final float[] ILLUMINANT_D50;
    field public static final float[] ILLUMINANT_D55;
    field public static final float[] ILLUMINANT_D60;
    field public static final float[] ILLUMINANT_D65;
    field public static final float[] ILLUMINANT_D75;
    field public static final float[] ILLUMINANT_E;
    field public static final int MAX_ID = 63; // 0x3f
    field public static final int MIN_ID = -1; // 0xffffffff
  }

  public enum ColorSpace.Adaptation {
    enum_constant public static final android.graphics.ColorSpace.Adaptation BRADFORD;
    enum_constant public static final android.graphics.ColorSpace.Adaptation CIECAT02;
    enum_constant public static final android.graphics.ColorSpace.Adaptation VON_KRIES;
  }

  @AnyThread public static class ColorSpace.Connector {
    method @NonNull public android.graphics.ColorSpace getDestination();
    method public android.graphics.ColorSpace.RenderIntent getRenderIntent();
    method @NonNull public android.graphics.ColorSpace getSource();
    method @NonNull @Size(3) public float[] transform(float, float, float);
    method @NonNull @Size(min=3) public float[] transform(@NonNull @Size(min=3) float[]);
  }

  public enum ColorSpace.Model {
    method @IntRange(from=1, to=4) public int getComponentCount();
    enum_constant public static final android.graphics.ColorSpace.Model CMYK;
    enum_constant public static final android.graphics.ColorSpace.Model LAB;
    enum_constant public static final android.graphics.ColorSpace.Model RGB;
    enum_constant public static final android.graphics.ColorSpace.Model XYZ;
  }

  public enum ColorSpace.Named {
    enum_constant public static final android.graphics.ColorSpace.Named ACES;
    enum_constant public static final android.graphics.ColorSpace.Named ACESCG;
    enum_constant public static final android.graphics.ColorSpace.Named ADOBE_RGB;
    enum_constant public static final android.graphics.ColorSpace.Named BT2020;
    enum_constant public static final android.graphics.ColorSpace.Named BT709;
    enum_constant public static final android.graphics.ColorSpace.Named CIE_LAB;
    enum_constant public static final android.graphics.ColorSpace.Named CIE_XYZ;
    enum_constant public static final android.graphics.ColorSpace.Named DCI_P3;
    enum_constant public static final android.graphics.ColorSpace.Named DISPLAY_P3;
    enum_constant public static final android.graphics.ColorSpace.Named EXTENDED_SRGB;
    enum_constant public static final android.graphics.ColorSpace.Named LINEAR_EXTENDED_SRGB;
    enum_constant public static final android.graphics.ColorSpace.Named LINEAR_SRGB;
    enum_constant public static final android.graphics.ColorSpace.Named NTSC_1953;
    enum_constant public static final android.graphics.ColorSpace.Named PRO_PHOTO_RGB;
    enum_constant public static final android.graphics.ColorSpace.Named SMPTE_C;
    enum_constant public static final android.graphics.ColorSpace.Named SRGB;
  }

  public enum ColorSpace.RenderIntent {
    enum_constant public static final android.graphics.ColorSpace.RenderIntent ABSOLUTE;
    enum_constant public static final android.graphics.ColorSpace.RenderIntent PERCEPTUAL;
    enum_constant public static final android.graphics.ColorSpace.RenderIntent RELATIVE;
    enum_constant public static final android.graphics.ColorSpace.RenderIntent SATURATION;
  }

  @AnyThread public static class ColorSpace.Rgb extends android.graphics.ColorSpace {
    ctor public ColorSpace.Rgb(@NonNull @Size(min=1) String, @NonNull @Size(9) float[], @NonNull java.util.function.DoubleUnaryOperator, @NonNull java.util.function.DoubleUnaryOperator);
    ctor public ColorSpace.Rgb(@NonNull @Size(min=1) String, @NonNull @Size(min=6, max=9) float[], @NonNull @Size(min=2, max=3) float[], @NonNull java.util.function.DoubleUnaryOperator, @NonNull java.util.function.DoubleUnaryOperator, float, float);
    ctor public ColorSpace.Rgb(@NonNull @Size(min=1) String, @NonNull @Size(9) float[], @NonNull android.graphics.ColorSpace.Rgb.TransferParameters);
    ctor public ColorSpace.Rgb(@NonNull @Size(min=1) String, @NonNull @Size(min=6, max=9) float[], @NonNull @Size(min=2, max=3) float[], @NonNull android.graphics.ColorSpace.Rgb.TransferParameters);
    ctor public ColorSpace.Rgb(@NonNull @Size(min=1) String, @NonNull @Size(9) float[], double);
    ctor public ColorSpace.Rgb(@NonNull @Size(min=1) String, @NonNull @Size(min=6, max=9) float[], @NonNull @Size(min=2, max=3) float[], double);
    method @NonNull @Size(3) public float[] fromLinear(float, float, float);
    method @NonNull @Size(min=3) public float[] fromLinear(@NonNull @Size(min=3) float[]);
    method @NonNull @Size(min=3) public float[] fromXyz(@NonNull @Size(min=3) float[]);
    method @NonNull public java.util.function.DoubleUnaryOperator getEotf();
    method @NonNull @Size(min=9) public float[] getInverseTransform(@NonNull @Size(min=9) float[]);
    method @NonNull @Size(9) public float[] getInverseTransform();
    method public float getMaxValue(int);
    method public float getMinValue(int);
    method @NonNull public java.util.function.DoubleUnaryOperator getOetf();
    method @NonNull @Size(min=6) public float[] getPrimaries(@NonNull @Size(min=6) float[]);
    method @NonNull @Size(6) public float[] getPrimaries();
    method @Nullable public android.graphics.ColorSpace.Rgb.TransferParameters getTransferParameters();
    method @NonNull @Size(min=9) public float[] getTransform(@NonNull @Size(min=9) float[]);
    method @NonNull @Size(9) public float[] getTransform();
    method @NonNull @Size(min=2) public float[] getWhitePoint(@NonNull @Size(min=2) float[]);
    method @NonNull @Size(2) public float[] getWhitePoint();
    method public boolean isWideGamut();
    method @NonNull @Size(3) public float[] toLinear(float, float, float);
    method @NonNull @Size(min=3) public float[] toLinear(@NonNull @Size(min=3) float[]);
    method @NonNull @Size(min=3) public float[] toXyz(@NonNull @Size(min=3) float[]);
  }

  public static class ColorSpace.Rgb.TransferParameters {
    ctor public ColorSpace.Rgb.TransferParameters(double, double, double, double, double);
    ctor public ColorSpace.Rgb.TransferParameters(double, double, double, double, double, double, double);
    field public final double a;
    field public final double b;
    field public final double c;
    field public final double d;
    field public final double e;
    field public final double f;
    field public final double g;
  }

  public class ComposePathEffect extends android.graphics.PathEffect {
    ctor public ComposePathEffect(android.graphics.PathEffect, android.graphics.PathEffect);
  }

  public class ComposeShader extends android.graphics.Shader {
    ctor public ComposeShader(@NonNull android.graphics.Shader, @NonNull android.graphics.Shader, @NonNull android.graphics.Xfermode);
    ctor public ComposeShader(@NonNull android.graphics.Shader, @NonNull android.graphics.Shader, @NonNull android.graphics.PorterDuff.Mode);
  }

  public class CornerPathEffect extends android.graphics.PathEffect {
    ctor public CornerPathEffect(float);
  }

  public class DashPathEffect extends android.graphics.PathEffect {
    ctor public DashPathEffect(float[], float);
  }

  public class DiscretePathEffect extends android.graphics.PathEffect {
    ctor public DiscretePathEffect(float, float);
  }

  public class DrawFilter {
    ctor public DrawFilter();
  }

  public class EmbossMaskFilter extends android.graphics.MaskFilter {
    ctor @Deprecated public EmbossMaskFilter(float[], float, float, float);
  }

  public final class ImageDecoder implements java.lang.AutoCloseable {
    method public void close();
    method @AnyThread @NonNull public static android.graphics.ImageDecoder.Source createSource(@NonNull android.content.res.Resources, int);
    method @AnyThread @NonNull public static android.graphics.ImageDecoder.Source createSource(@NonNull android.content.ContentResolver, @NonNull android.net.Uri);
    method @AnyThread @NonNull public static android.graphics.ImageDecoder.Source createSource(@NonNull android.content.res.AssetManager, @NonNull String);
    method @AnyThread @NonNull public static android.graphics.ImageDecoder.Source createSource(@NonNull java.nio.ByteBuffer);
    method @AnyThread @NonNull public static android.graphics.ImageDecoder.Source createSource(@NonNull java.io.File);
    method @WorkerThread @NonNull public static android.graphics.Bitmap decodeBitmap(@NonNull android.graphics.ImageDecoder.Source, @NonNull android.graphics.ImageDecoder.OnHeaderDecodedListener) throws java.io.IOException;
    method @WorkerThread @NonNull public static android.graphics.Bitmap decodeBitmap(@NonNull android.graphics.ImageDecoder.Source) throws java.io.IOException;
    method @WorkerThread @NonNull public static android.graphics.drawable.Drawable decodeDrawable(@NonNull android.graphics.ImageDecoder.Source, @NonNull android.graphics.ImageDecoder.OnHeaderDecodedListener) throws java.io.IOException;
    method @WorkerThread @NonNull public static android.graphics.drawable.Drawable decodeDrawable(@NonNull android.graphics.ImageDecoder.Source) throws java.io.IOException;
    method public int getAllocator();
    method @Nullable public android.graphics.Rect getCrop();
    method public int getMemorySizePolicy();
    method @Nullable public android.graphics.ImageDecoder.OnPartialImageListener getOnPartialImageListener();
    method @Nullable public android.graphics.PostProcessor getPostProcessor();
    method public boolean isDecodeAsAlphaMaskEnabled();
    method public boolean isMutableRequired();
    method public boolean isUnpremultipliedRequired();
    method public void setAllocator(int);
    method public void setCrop(@Nullable android.graphics.Rect);
    method public void setDecodeAsAlphaMaskEnabled(boolean);
    method public void setMemorySizePolicy(int);
    method public void setMutableRequired(boolean);
    method public void setOnPartialImageListener(@Nullable android.graphics.ImageDecoder.OnPartialImageListener);
    method public void setPostProcessor(@Nullable android.graphics.PostProcessor);
    method public void setTargetColorSpace(android.graphics.ColorSpace);
    method public void setTargetSampleSize(@IntRange(from=1) int);
    method public void setTargetSize(@Px @IntRange(from=1) int, @Px @IntRange(from=1) int);
    method public void setUnpremultipliedRequired(boolean);
    field public static final int ALLOCATOR_DEFAULT = 0; // 0x0
    field public static final int ALLOCATOR_HARDWARE = 3; // 0x3
    field public static final int ALLOCATOR_SHARED_MEMORY = 2; // 0x2
    field public static final int ALLOCATOR_SOFTWARE = 1; // 0x1
    field public static final int MEMORY_POLICY_DEFAULT = 1; // 0x1
    field public static final int MEMORY_POLICY_LOW_RAM = 0; // 0x0
  }

  public static final class ImageDecoder.DecodeException extends java.io.IOException {
    method public int getError();
    method @NonNull public android.graphics.ImageDecoder.Source getSource();
    field public static final int SOURCE_EXCEPTION = 1; // 0x1
    field public static final int SOURCE_INCOMPLETE = 2; // 0x2
    field public static final int SOURCE_MALFORMED_DATA = 3; // 0x3
  }

  public static class ImageDecoder.ImageInfo {
    method @Nullable public android.graphics.ColorSpace getColorSpace();
    method @NonNull public String getMimeType();
    method @NonNull public android.util.Size getSize();
    method public boolean isAnimated();
  }

  public static interface ImageDecoder.OnHeaderDecodedListener {
    method public void onHeaderDecoded(@NonNull android.graphics.ImageDecoder, @NonNull android.graphics.ImageDecoder.ImageInfo, @NonNull android.graphics.ImageDecoder.Source);
  }

  public static interface ImageDecoder.OnPartialImageListener {
    method public boolean onPartialImage(@NonNull android.graphics.ImageDecoder.DecodeException);
  }

  public abstract static class ImageDecoder.Source {
  }

  public class ImageFormat {
    ctor public ImageFormat();
    method public static int getBitsPerPixel(int);
    field public static final int DEPTH16 = 1144402265; // 0x44363159
    field public static final int DEPTH_POINT_CLOUD = 257; // 0x101
    field public static final int FLEX_RGBA_8888 = 42; // 0x2a
    field public static final int FLEX_RGB_888 = 41; // 0x29
    field public static final int JPEG = 256; // 0x100
    field public static final int NV16 = 16; // 0x10
    field public static final int NV21 = 17; // 0x11
    field public static final int PRIVATE = 34; // 0x22
    field public static final int RAW10 = 37; // 0x25
    field public static final int RAW12 = 38; // 0x26
    field public static final int RAW_PRIVATE = 36; // 0x24
    field public static final int RAW_SENSOR = 32; // 0x20
    field public static final int RGB_565 = 4; // 0x4
    field public static final int UNKNOWN = 0; // 0x0
    field public static final int YUV_420_888 = 35; // 0x23
    field public static final int YUV_422_888 = 39; // 0x27
    field public static final int YUV_444_888 = 40; // 0x28
    field public static final int YUY2 = 20; // 0x14
    field public static final int YV12 = 842094169; // 0x32315659
  }

  public class Interpolator {
    ctor public Interpolator(int);
    ctor public Interpolator(int, int);
    method public final int getKeyFrameCount();
    method public final int getValueCount();
    method public void reset(int);
    method public void reset(int, int);
    method public void setKeyFrame(int, int, float[]);
    method public void setKeyFrame(int, int, float[], float[]);
    method public void setRepeatMirror(float, boolean);
    method public android.graphics.Interpolator.Result timeToValues(float[]);
    method public android.graphics.Interpolator.Result timeToValues(int, float[]);
  }

  public enum Interpolator.Result {
    enum_constant public static final android.graphics.Interpolator.Result FREEZE_END;
    enum_constant public static final android.graphics.Interpolator.Result FREEZE_START;
    enum_constant public static final android.graphics.Interpolator.Result NORMAL;
  }

  public class LightingColorFilter extends android.graphics.ColorFilter {
    ctor public LightingColorFilter(@ColorInt int, @ColorInt int);
    method @ColorInt public int getColorAdd();
    method @ColorInt public int getColorMultiply();
  }

  public class LinearGradient extends android.graphics.Shader {
    ctor public LinearGradient(float, float, float, float, @NonNull @ColorInt int[], @Nullable float[], @NonNull android.graphics.Shader.TileMode);
    ctor public LinearGradient(float, float, float, float, @ColorInt int, @ColorInt int, @NonNull android.graphics.Shader.TileMode);
  }

  public class MaskFilter {
    ctor public MaskFilter();
  }

  public class Matrix {
    ctor public Matrix();
    ctor public Matrix(android.graphics.Matrix);
    method public void getValues(float[]);
    method public boolean invert(android.graphics.Matrix);
    method public boolean isAffine();
    method public boolean isIdentity();
    method public void mapPoints(float[], int, float[], int, int);
    method public void mapPoints(float[], float[]);
    method public void mapPoints(float[]);
    method public float mapRadius(float);
    method public boolean mapRect(android.graphics.RectF, android.graphics.RectF);
    method public boolean mapRect(android.graphics.RectF);
    method public void mapVectors(float[], int, float[], int, int);
    method public void mapVectors(float[], float[]);
    method public void mapVectors(float[]);
    method public boolean postConcat(android.graphics.Matrix);
    method public boolean postRotate(float, float, float);
    method public boolean postRotate(float);
    method public boolean postScale(float, float, float, float);
    method public boolean postScale(float, float);
    method public boolean postSkew(float, float, float, float);
    method public boolean postSkew(float, float);
    method public boolean postTranslate(float, float);
    method public boolean preConcat(android.graphics.Matrix);
    method public boolean preRotate(float, float, float);
    method public boolean preRotate(float);
    method public boolean preScale(float, float, float, float);
    method public boolean preScale(float, float);
    method public boolean preSkew(float, float, float, float);
    method public boolean preSkew(float, float);
    method public boolean preTranslate(float, float);
    method public boolean rectStaysRect();
    method public void reset();
    method public void set(android.graphics.Matrix);
    method public boolean setConcat(android.graphics.Matrix, android.graphics.Matrix);
    method public boolean setPolyToPoly(float[], int, float[], int, int);
    method public boolean setRectToRect(android.graphics.RectF, android.graphics.RectF, android.graphics.Matrix.ScaleToFit);
    method public void setRotate(float, float, float);
    method public void setRotate(float);
    method public void setScale(float, float, float, float);
    method public void setScale(float, float);
    method public void setSinCos(float, float, float, float);
    method public void setSinCos(float, float);
    method public void setSkew(float, float, float, float);
    method public void setSkew(float, float);
    method public void setTranslate(float, float);
    method public void setValues(float[]);
    method public String toShortString();
    field public static final int MPERSP_0 = 6; // 0x6
    field public static final int MPERSP_1 = 7; // 0x7
    field public static final int MPERSP_2 = 8; // 0x8
    field public static final int MSCALE_X = 0; // 0x0
    field public static final int MSCALE_Y = 4; // 0x4
    field public static final int MSKEW_X = 1; // 0x1
    field public static final int MSKEW_Y = 3; // 0x3
    field public static final int MTRANS_X = 2; // 0x2
    field public static final int MTRANS_Y = 5; // 0x5
  }

  public enum Matrix.ScaleToFit {
    enum_constant public static final android.graphics.Matrix.ScaleToFit CENTER;
    enum_constant public static final android.graphics.Matrix.ScaleToFit END;
    enum_constant public static final android.graphics.Matrix.ScaleToFit FILL;
    enum_constant public static final android.graphics.Matrix.ScaleToFit START;
  }

  @Deprecated public class Movie {
    method @Deprecated public static android.graphics.Movie decodeByteArray(byte[], int, int);
    method @Deprecated public static android.graphics.Movie decodeFile(String);
    method @Deprecated public static android.graphics.Movie decodeStream(java.io.InputStream);
    method @Deprecated public void draw(android.graphics.Canvas, float, float, android.graphics.Paint);
    method @Deprecated public void draw(android.graphics.Canvas, float, float);
    method @Deprecated public int duration();
    method @Deprecated public int height();
    method @Deprecated public boolean isOpaque();
    method @Deprecated public boolean setTime(int);
    method @Deprecated public int width();
  }

  public class NinePatch {
    ctor public NinePatch(android.graphics.Bitmap, byte[]);
    ctor public NinePatch(android.graphics.Bitmap, byte[], String);
    method public void draw(android.graphics.Canvas, android.graphics.RectF);
    method public void draw(android.graphics.Canvas, android.graphics.Rect);
    method public void draw(android.graphics.Canvas, android.graphics.Rect, android.graphics.Paint);
    method public android.graphics.Bitmap getBitmap();
    method public int getDensity();
    method public int getHeight();
    method public String getName();
    method public android.graphics.Paint getPaint();
    method public final android.graphics.Region getTransparentRegion(android.graphics.Rect);
    method public int getWidth();
    method public final boolean hasAlpha();
    method public static boolean isNinePatchChunk(byte[]);
    method public void setPaint(android.graphics.Paint);
  }

  public final class Outline {
    ctor public Outline();
    ctor public Outline(@NonNull android.graphics.Outline);
    method public boolean canClip();
    method public float getAlpha();
    method public float getRadius();
    method public boolean getRect(@NonNull android.graphics.Rect);
    method public boolean isEmpty();
    method public void offset(int, int);
    method public void set(@NonNull android.graphics.Outline);
    method public void setAlpha(@FloatRange(from=0.0, to=1.0) float);
    method public void setConvexPath(@NonNull android.graphics.Path);
    method public void setEmpty();
    method public void setOval(int, int, int, int);
    method public void setOval(@NonNull android.graphics.Rect);
    method public void setRect(int, int, int, int);
    method public void setRect(@NonNull android.graphics.Rect);
    method public void setRoundRect(int, int, int, int, float);
    method public void setRoundRect(@NonNull android.graphics.Rect, float);
  }

  public class Paint {
    ctor public Paint();
    ctor public Paint(int);
    ctor public Paint(android.graphics.Paint);
    method public float ascent();
    method public int breakText(char[], int, int, float, float[]);
    method public int breakText(CharSequence, int, int, boolean, float, float[]);
    method public int breakText(String, boolean, float, float[]);
    method public void clearShadowLayer();
    method public float descent();
    method public boolean equalsForTextMeasurement(@NonNull android.graphics.Paint);
    method public int getAlpha();
    method @ColorInt public int getColor();
    method public android.graphics.ColorFilter getColorFilter();
    method public boolean getFillPath(android.graphics.Path, android.graphics.Path);
    method public int getFlags();
    method public String getFontFeatureSettings();
    method public float getFontMetrics(android.graphics.Paint.FontMetrics);
    method public android.graphics.Paint.FontMetrics getFontMetrics();
    method public int getFontMetricsInt(android.graphics.Paint.FontMetricsInt);
    method public android.graphics.Paint.FontMetricsInt getFontMetricsInt();
    method public float getFontSpacing();
    method public String getFontVariationSettings();
    method public int getHinting();
    method public float getLetterSpacing();
    method public android.graphics.MaskFilter getMaskFilter();
    method public int getOffsetForAdvance(char[], int, int, int, int, boolean, float);
    method public int getOffsetForAdvance(CharSequence, int, int, int, int, boolean, float);
    method public android.graphics.PathEffect getPathEffect();
    method public float getRunAdvance(char[], int, int, int, int, boolean, int);
    method public float getRunAdvance(CharSequence, int, int, int, int, boolean, int);
    method public android.graphics.Shader getShader();
    method public android.graphics.Paint.Cap getStrokeCap();
    method public android.graphics.Paint.Join getStrokeJoin();
    method public float getStrokeMiter();
    method public float getStrokeWidth();
    method public android.graphics.Paint.Style getStyle();
    method public android.graphics.Paint.Align getTextAlign();
    method public void getTextBounds(String, int, int, android.graphics.Rect);
    method public void getTextBounds(char[], int, int, android.graphics.Rect);
    method @NonNull public java.util.Locale getTextLocale();
    method @NonNull @Size(min=1) public android.os.LocaleList getTextLocales();
    method public void getTextPath(char[], int, int, float, float, android.graphics.Path);
    method public void getTextPath(String, int, int, float, float, android.graphics.Path);
    method public float getTextScaleX();
    method public float getTextSize();
    method public float getTextSkewX();
    method public int getTextWidths(char[], int, int, float[]);
    method public int getTextWidths(CharSequence, int, int, float[]);
    method public int getTextWidths(String, int, int, float[]);
    method public int getTextWidths(String, float[]);
    method public android.graphics.Typeface getTypeface();
    method public android.graphics.Xfermode getXfermode();
    method public boolean hasGlyph(String);
    method public final boolean isAntiAlias();
    method public final boolean isDither();
    method public boolean isElegantTextHeight();
    method public final boolean isFakeBoldText();
    method public final boolean isFilterBitmap();
    method public final boolean isLinearText();
    method public final boolean isStrikeThruText();
    method public final boolean isSubpixelText();
    method public final boolean isUnderlineText();
    method public float measureText(char[], int, int);
    method public float measureText(String, int, int);
    method public float measureText(String);
    method public float measureText(CharSequence, int, int);
    method public void reset();
    method public void set(android.graphics.Paint);
    method public void setARGB(int, int, int, int);
    method public void setAlpha(int);
    method public void setAntiAlias(boolean);
    method public void setColor(@ColorInt int);
    method public android.graphics.ColorFilter setColorFilter(android.graphics.ColorFilter);
    method public void setDither(boolean);
    method public void setElegantTextHeight(boolean);
    method public void setFakeBoldText(boolean);
    method public void setFilterBitmap(boolean);
    method public void setFlags(int);
    method public void setFontFeatureSettings(String);
    method public boolean setFontVariationSettings(String);
    method public void setHinting(int);
    method public void setLetterSpacing(float);
    method public void setLinearText(boolean);
    method public android.graphics.MaskFilter setMaskFilter(android.graphics.MaskFilter);
    method public android.graphics.PathEffect setPathEffect(android.graphics.PathEffect);
    method public android.graphics.Shader setShader(android.graphics.Shader);
    method public void setShadowLayer(float, float, float, int);
    method public void setStrikeThruText(boolean);
    method public void setStrokeCap(android.graphics.Paint.Cap);
    method public void setStrokeJoin(android.graphics.Paint.Join);
    method public void setStrokeMiter(float);
    method public void setStrokeWidth(float);
    method public void setStyle(android.graphics.Paint.Style);
    method public void setSubpixelText(boolean);
    method public void setTextAlign(android.graphics.Paint.Align);
    method public void setTextLocale(@NonNull java.util.Locale);
    method public void setTextLocales(@NonNull @Size(min=1) android.os.LocaleList);
    method public void setTextScaleX(float);
    method public void setTextSize(float);
    method public void setTextSkewX(float);
    method public android.graphics.Typeface setTypeface(android.graphics.Typeface);
    method public void setUnderlineText(boolean);
    method public android.graphics.Xfermode setXfermode(android.graphics.Xfermode);
    field public static final int ANTI_ALIAS_FLAG = 1; // 0x1
    field public static final int DEV_KERN_TEXT_FLAG = 256; // 0x100
    field public static final int DITHER_FLAG = 4; // 0x4
    field public static final int EMBEDDED_BITMAP_TEXT_FLAG = 1024; // 0x400
    field public static final int FAKE_BOLD_TEXT_FLAG = 32; // 0x20
    field public static final int FILTER_BITMAP_FLAG = 2; // 0x2
    field public static final int HINTING_OFF = 0; // 0x0
    field public static final int HINTING_ON = 1; // 0x1
    field public static final int LINEAR_TEXT_FLAG = 64; // 0x40
    field public static final int STRIKE_THRU_TEXT_FLAG = 16; // 0x10
    field public static final int SUBPIXEL_TEXT_FLAG = 128; // 0x80
    field public static final int UNDERLINE_TEXT_FLAG = 8; // 0x8
  }

  public enum Paint.Align {
    enum_constant public static final android.graphics.Paint.Align CENTER;
    enum_constant public static final android.graphics.Paint.Align LEFT;
    enum_constant public static final android.graphics.Paint.Align RIGHT;
  }

  public enum Paint.Cap {
    enum_constant public static final android.graphics.Paint.Cap BUTT;
    enum_constant public static final android.graphics.Paint.Cap ROUND;
    enum_constant public static final android.graphics.Paint.Cap SQUARE;
  }

  public static class Paint.FontMetrics {
    ctor public Paint.FontMetrics();
    field public float ascent;
    field public float bottom;
    field public float descent;
    field public float leading;
    field public float top;
  }

  public static class Paint.FontMetricsInt {
    ctor public Paint.FontMetricsInt();
    field public int ascent;
    field public int bottom;
    field public int descent;
    field public int leading;
    field public int top;
  }

  public enum Paint.Join {
    enum_constant public static final android.graphics.Paint.Join BEVEL;
    enum_constant public static final android.graphics.Paint.Join MITER;
    enum_constant public static final android.graphics.Paint.Join ROUND;
  }

  public enum Paint.Style {
    enum_constant public static final android.graphics.Paint.Style FILL;
    enum_constant public static final android.graphics.Paint.Style FILL_AND_STROKE;
    enum_constant public static final android.graphics.Paint.Style STROKE;
  }

  public class PaintFlagsDrawFilter extends android.graphics.DrawFilter {
    ctor public PaintFlagsDrawFilter(int, int);
  }

  public class Path {
    ctor public Path();
    ctor public Path(android.graphics.Path);
    method public void addArc(android.graphics.RectF, float, float);
    method public void addArc(float, float, float, float, float, float);
    method public void addCircle(float, float, float, android.graphics.Path.Direction);
    method public void addOval(android.graphics.RectF, android.graphics.Path.Direction);
    method public void addOval(float, float, float, float, android.graphics.Path.Direction);
    method public void addPath(android.graphics.Path, float, float);
    method public void addPath(android.graphics.Path);
    method public void addPath(android.graphics.Path, android.graphics.Matrix);
    method public void addRect(android.graphics.RectF, android.graphics.Path.Direction);
    method public void addRect(float, float, float, float, android.graphics.Path.Direction);
    method public void addRoundRect(android.graphics.RectF, float, float, android.graphics.Path.Direction);
    method public void addRoundRect(float, float, float, float, float, float, android.graphics.Path.Direction);
    method public void addRoundRect(android.graphics.RectF, float[], android.graphics.Path.Direction);
    method public void addRoundRect(float, float, float, float, float[], android.graphics.Path.Direction);
    method @NonNull @Size(min=6, multiple=3) public float[] approximate(@FloatRange(from=0) float);
    method public void arcTo(android.graphics.RectF, float, float, boolean);
    method public void arcTo(android.graphics.RectF, float, float);
    method public void arcTo(float, float, float, float, float, float, boolean);
    method public void close();
    method public void computeBounds(android.graphics.RectF, boolean);
    method public void cubicTo(float, float, float, float, float, float);
    method @NonNull public android.graphics.Path.FillType getFillType();
    method public void incReserve(int);
    method public boolean isConvex();
    method public boolean isEmpty();
    method public boolean isInverseFillType();
    method public boolean isRect(@Nullable android.graphics.RectF);
    method public void lineTo(float, float);
    method public void moveTo(float, float);
    method public void offset(float, float, @Nullable android.graphics.Path);
    method public void offset(float, float);
    method public boolean op(android.graphics.Path, android.graphics.Path.Op);
    method public boolean op(android.graphics.Path, android.graphics.Path, android.graphics.Path.Op);
    method public void quadTo(float, float, float, float);
    method public void rCubicTo(float, float, float, float, float, float);
    method public void rLineTo(float, float);
    method public void rMoveTo(float, float);
    method public void rQuadTo(float, float, float, float);
    method public void reset();
    method public void rewind();
    method public void set(@NonNull android.graphics.Path);
    method public void setFillType(android.graphics.Path.FillType);
    method public void setLastPoint(float, float);
    method public void toggleInverseFillType();
    method public void transform(android.graphics.Matrix, android.graphics.Path);
    method public void transform(android.graphics.Matrix);
  }

  public enum Path.Direction {
    enum_constant public static final android.graphics.Path.Direction CCW;
    enum_constant public static final android.graphics.Path.Direction CW;
  }

  public enum Path.FillType {
    enum_constant public static final android.graphics.Path.FillType EVEN_ODD;
    enum_constant public static final android.graphics.Path.FillType INVERSE_EVEN_ODD;
    enum_constant public static final android.graphics.Path.FillType INVERSE_WINDING;
    enum_constant public static final android.graphics.Path.FillType WINDING;
  }

  public enum Path.Op {
    enum_constant public static final android.graphics.Path.Op DIFFERENCE;
    enum_constant public static final android.graphics.Path.Op INTERSECT;
    enum_constant public static final android.graphics.Path.Op REVERSE_DIFFERENCE;
    enum_constant public static final android.graphics.Path.Op UNION;
    enum_constant public static final android.graphics.Path.Op XOR;
  }

  public class PathDashPathEffect extends android.graphics.PathEffect {
    ctor public PathDashPathEffect(android.graphics.Path, float, float, android.graphics.PathDashPathEffect.Style);
  }

  public enum PathDashPathEffect.Style {
    enum_constant public static final android.graphics.PathDashPathEffect.Style MORPH;
    enum_constant public static final android.graphics.PathDashPathEffect.Style ROTATE;
    enum_constant public static final android.graphics.PathDashPathEffect.Style TRANSLATE;
  }

  public class PathEffect {
    ctor public PathEffect();
  }

  public class PathMeasure {
    ctor public PathMeasure();
    ctor public PathMeasure(android.graphics.Path, boolean);
    method public float getLength();
    method public boolean getMatrix(float, android.graphics.Matrix, int);
    method public boolean getPosTan(float, float[], float[]);
    method public boolean getSegment(float, float, android.graphics.Path, boolean);
    method public boolean isClosed();
    method public boolean nextContour();
    method public void setPath(android.graphics.Path, boolean);
    field public static final int POSITION_MATRIX_FLAG = 1; // 0x1
    field public static final int TANGENT_MATRIX_FLAG = 2; // 0x2
  }

  public class Picture {
    ctor public Picture();
    ctor public Picture(android.graphics.Picture);
    method public android.graphics.Canvas beginRecording(int, int);
    method @Deprecated public static android.graphics.Picture createFromStream(java.io.InputStream);
    method public void draw(android.graphics.Canvas);
    method public void endRecording();
    method public int getHeight();
    method public int getWidth();
    method public boolean requiresHardwareAcceleration();
    method @Deprecated public void writeToStream(java.io.OutputStream);
  }

  public class PixelFormat {
    ctor public PixelFormat();
    method public static boolean formatHasAlpha(int);
    method public static void getPixelFormatInfo(int, android.graphics.PixelFormat);
    field @Deprecated public static final int A_8 = 8; // 0x8
    field @Deprecated public static final int JPEG = 256; // 0x100
    field @Deprecated public static final int LA_88 = 10; // 0xa
    field @Deprecated public static final int L_8 = 9; // 0x9
    field public static final int OPAQUE = -1; // 0xffffffff
    field public static final int RGBA_1010102 = 43; // 0x2b
    field @Deprecated public static final int RGBA_4444 = 7; // 0x7
    field @Deprecated public static final int RGBA_5551 = 6; // 0x6
    field public static final int RGBA_8888 = 1; // 0x1
    field public static final int RGBA_F16 = 22; // 0x16
    field public static final int RGBX_8888 = 2; // 0x2
    field @Deprecated public static final int RGB_332 = 11; // 0xb
    field public static final int RGB_565 = 4; // 0x4
    field public static final int RGB_888 = 3; // 0x3
    field public static final int TRANSLUCENT = -3; // 0xfffffffd
    field public static final int TRANSPARENT = -2; // 0xfffffffe
    field public static final int UNKNOWN = 0; // 0x0
    field @Deprecated public static final int YCbCr_420_SP = 17; // 0x11
    field @Deprecated public static final int YCbCr_422_I = 20; // 0x14
    field @Deprecated public static final int YCbCr_422_SP = 16; // 0x10
    field public int bitsPerPixel;
    field public int bytesPerPixel;
  }

  public class Point implements android.os.Parcelable {
    ctor public Point();
    ctor public Point(int, int);
    ctor public Point(android.graphics.Point);
    method public int describeContents();
    method public final boolean equals(int, int);
    method public final void negate();
    method public final void offset(int, int);
    method public void readFromParcel(android.os.Parcel);
    method public void set(int, int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.graphics.Point> CREATOR;
    field public int x;
    field public int y;
  }

  public class PointF implements android.os.Parcelable {
    ctor public PointF();
    ctor public PointF(float, float);
    ctor public PointF(android.graphics.Point);
    method public int describeContents();
    method public final boolean equals(float, float);
    method public final float length();
    method public static float length(float, float);
    method public final void negate();
    method public final void offset(float, float);
    method public void readFromParcel(android.os.Parcel);
    method public final void set(float, float);
    method public final void set(android.graphics.PointF);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.graphics.PointF> CREATOR;
    field public float x;
    field public float y;
  }

  public class PorterDuff {
    ctor public PorterDuff();
  }

  public enum PorterDuff.Mode {
    enum_constant public static final android.graphics.PorterDuff.Mode ADD;
    enum_constant public static final android.graphics.PorterDuff.Mode CLEAR;
    enum_constant public static final android.graphics.PorterDuff.Mode DARKEN;
    enum_constant public static final android.graphics.PorterDuff.Mode DST;
    enum_constant public static final android.graphics.PorterDuff.Mode DST_ATOP;
    enum_constant public static final android.graphics.PorterDuff.Mode DST_IN;
    enum_constant public static final android.graphics.PorterDuff.Mode DST_OUT;
    enum_constant public static final android.graphics.PorterDuff.Mode DST_OVER;
    enum_constant public static final android.graphics.PorterDuff.Mode LIGHTEN;
    enum_constant public static final android.graphics.PorterDuff.Mode MULTIPLY;
    enum_constant public static final android.graphics.PorterDuff.Mode OVERLAY;
    enum_constant public static final android.graphics.PorterDuff.Mode SCREEN;
    enum_constant public static final android.graphics.PorterDuff.Mode SRC;
    enum_constant public static final android.graphics.PorterDuff.Mode SRC_ATOP;
    enum_constant public static final android.graphics.PorterDuff.Mode SRC_IN;
    enum_constant public static final android.graphics.PorterDuff.Mode SRC_OUT;
    enum_constant public static final android.graphics.PorterDuff.Mode SRC_OVER;
    enum_constant public static final android.graphics.PorterDuff.Mode XOR;
  }

  public class PorterDuffColorFilter extends android.graphics.ColorFilter {
    ctor public PorterDuffColorFilter(@ColorInt int, @NonNull android.graphics.PorterDuff.Mode);
  }

  public class PorterDuffXfermode extends android.graphics.Xfermode {
    ctor public PorterDuffXfermode(android.graphics.PorterDuff.Mode);
  }

  public interface PostProcessor {
    method public int onPostProcess(@NonNull android.graphics.Canvas);
  }

  public class RadialGradient extends android.graphics.Shader {
    ctor public RadialGradient(float, float, float, @NonNull @ColorInt int[], @Nullable float[], @NonNull android.graphics.Shader.TileMode);
    ctor public RadialGradient(float, float, float, @ColorInt int, @ColorInt int, @NonNull android.graphics.Shader.TileMode);
  }

  public final class Rect implements android.os.Parcelable {
    ctor public Rect();
    ctor public Rect(int, int, int, int);
    ctor public Rect(android.graphics.Rect);
    method public int centerX();
    method public int centerY();
    method public boolean contains(int, int);
    method public boolean contains(int, int, int, int);
    method public boolean contains(android.graphics.Rect);
    method public int describeContents();
    method public float exactCenterX();
    method public float exactCenterY();
    method @NonNull public String flattenToString();
    method public int height();
    method public void inset(int, int);
    method @CheckResult public boolean intersect(int, int, int, int);
    method @CheckResult public boolean intersect(android.graphics.Rect);
    method public boolean intersects(int, int, int, int);
    method public static boolean intersects(android.graphics.Rect, android.graphics.Rect);
    method public boolean isEmpty();
    method public void offset(int, int);
    method public void offsetTo(int, int);
    method public void readFromParcel(android.os.Parcel);
    method public void set(int, int, int, int);
    method public void set(android.graphics.Rect);
    method public void setEmpty();
    method @CheckResult public boolean setIntersect(android.graphics.Rect, android.graphics.Rect);
    method public void sort();
    method @NonNull public String toShortString();
    method @Nullable public static android.graphics.Rect unflattenFromString(@Nullable String);
    method public void union(int, int, int, int);
    method public void union(android.graphics.Rect);
    method public void union(int, int);
    method public int width();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.graphics.Rect> CREATOR;
    field public int bottom;
    field public int left;
    field public int right;
    field public int top;
  }

  public class RectF implements android.os.Parcelable {
    ctor public RectF();
    ctor public RectF(float, float, float, float);
    ctor public RectF(android.graphics.RectF);
    ctor public RectF(android.graphics.Rect);
    method public final float centerX();
    method public final float centerY();
    method public boolean contains(float, float);
    method public boolean contains(float, float, float, float);
    method public boolean contains(android.graphics.RectF);
    method public int describeContents();
    method public final float height();
    method public void inset(float, float);
    method public boolean intersect(float, float, float, float);
    method public boolean intersect(android.graphics.RectF);
    method public boolean intersects(float, float, float, float);
    method public static boolean intersects(android.graphics.RectF, android.graphics.RectF);
    method public final boolean isEmpty();
    method public void offset(float, float);
    method public void offsetTo(float, float);
    method public void readFromParcel(android.os.Parcel);
    method public void round(android.graphics.Rect);
    method public void roundOut(android.graphics.Rect);
    method public void set(float, float, float, float);
    method public void set(android.graphics.RectF);
    method public void set(android.graphics.Rect);
    method public void setEmpty();
    method public boolean setIntersect(android.graphics.RectF, android.graphics.RectF);
    method public void sort();
    method @NonNull public String toShortString();
    method public void union(float, float, float, float);
    method public void union(android.graphics.RectF);
    method public void union(float, float);
    method public final float width();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.graphics.RectF> CREATOR;
    field public float bottom;
    field public float left;
    field public float right;
    field public float top;
  }

  public class Region implements android.os.Parcelable {
    ctor public Region();
    ctor public Region(android.graphics.Region);
    ctor public Region(android.graphics.Rect);
    ctor public Region(int, int, int, int);
    method public boolean contains(int, int);
    method public int describeContents();
    method public android.graphics.Path getBoundaryPath();
    method public boolean getBoundaryPath(android.graphics.Path);
    method public android.graphics.Rect getBounds();
    method public boolean getBounds(android.graphics.Rect);
    method public boolean isComplex();
    method public boolean isEmpty();
    method public boolean isRect();
    method public boolean op(android.graphics.Rect, android.graphics.Region.Op);
    method public boolean op(int, int, int, int, android.graphics.Region.Op);
    method public boolean op(android.graphics.Region, android.graphics.Region.Op);
    method public boolean op(android.graphics.Rect, android.graphics.Region, android.graphics.Region.Op);
    method public boolean op(android.graphics.Region, android.graphics.Region, android.graphics.Region.Op);
    method public boolean quickContains(android.graphics.Rect);
    method public boolean quickContains(int, int, int, int);
    method public boolean quickReject(android.graphics.Rect);
    method public boolean quickReject(int, int, int, int);
    method public boolean quickReject(android.graphics.Region);
    method public boolean set(android.graphics.Region);
    method public boolean set(android.graphics.Rect);
    method public boolean set(int, int, int, int);
    method public void setEmpty();
    method public boolean setPath(android.graphics.Path, android.graphics.Region);
    method public void translate(int, int);
    method public void translate(int, int, android.graphics.Region);
    method public final boolean union(android.graphics.Rect);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.graphics.Region> CREATOR;
  }

  public enum Region.Op {
    enum_constant public static final android.graphics.Region.Op DIFFERENCE;
    enum_constant public static final android.graphics.Region.Op INTERSECT;
    enum_constant public static final android.graphics.Region.Op REPLACE;
    enum_constant public static final android.graphics.Region.Op REVERSE_DIFFERENCE;
    enum_constant public static final android.graphics.Region.Op UNION;
    enum_constant public static final android.graphics.Region.Op XOR;
  }

  public class RegionIterator {
    ctor public RegionIterator(android.graphics.Region);
    method public final boolean next(android.graphics.Rect);
  }

  public class Shader {
    ctor @Deprecated public Shader();
    method public boolean getLocalMatrix(@NonNull android.graphics.Matrix);
    method public void setLocalMatrix(@Nullable android.graphics.Matrix);
  }

  public enum Shader.TileMode {
    enum_constant public static final android.graphics.Shader.TileMode CLAMP;
    enum_constant public static final android.graphics.Shader.TileMode MIRROR;
    enum_constant public static final android.graphics.Shader.TileMode REPEAT;
  }

  public class SumPathEffect extends android.graphics.PathEffect {
    ctor public SumPathEffect(android.graphics.PathEffect, android.graphics.PathEffect);
  }

  public class SurfaceTexture {
    ctor public SurfaceTexture(int);
    ctor public SurfaceTexture(int, boolean);
    ctor public SurfaceTexture(boolean);
    method public void attachToGLContext(int);
    method public void detachFromGLContext();
    method public long getTimestamp();
    method public void getTransformMatrix(float[]);
    method public boolean isReleased();
    method public void release();
    method public void releaseTexImage();
    method public void setDefaultBufferSize(int, int);
    method public void setOnFrameAvailableListener(@Nullable android.graphics.SurfaceTexture.OnFrameAvailableListener);
    method public void setOnFrameAvailableListener(@Nullable android.graphics.SurfaceTexture.OnFrameAvailableListener, @Nullable android.os.Handler);
    method public void updateTexImage();
  }

  public static interface SurfaceTexture.OnFrameAvailableListener {
    method public void onFrameAvailable(android.graphics.SurfaceTexture);
  }

  @Deprecated public static class SurfaceTexture.OutOfResourcesException extends java.lang.Exception {
    ctor @Deprecated public SurfaceTexture.OutOfResourcesException();
    ctor @Deprecated public SurfaceTexture.OutOfResourcesException(String);
  }

  public class SweepGradient extends android.graphics.Shader {
    ctor public SweepGradient(float, float, @NonNull @ColorInt int[], @Nullable float[]);
    ctor public SweepGradient(float, float, @ColorInt int, @ColorInt int);
  }

  public class Typeface {
    method public static android.graphics.Typeface create(String, int);
    method public static android.graphics.Typeface create(android.graphics.Typeface, int);
    method @NonNull public static android.graphics.Typeface create(@Nullable android.graphics.Typeface, @IntRange(from=1, to=1000) int, boolean);
    method public static android.graphics.Typeface createFromAsset(android.content.res.AssetManager, String);
    method public static android.graphics.Typeface createFromFile(@Nullable java.io.File);
    method public static android.graphics.Typeface createFromFile(@Nullable String);
    method public static android.graphics.Typeface defaultFromStyle(int);
    method public int getStyle();
    method @IntRange(from=0, to=1000) public int getWeight();
    method public final boolean isBold();
    method public final boolean isItalic();
    field public static final int BOLD = 1; // 0x1
    field public static final int BOLD_ITALIC = 3; // 0x3
    field public static final android.graphics.Typeface DEFAULT;
    field public static final android.graphics.Typeface DEFAULT_BOLD;
    field public static final int ITALIC = 2; // 0x2
    field public static final android.graphics.Typeface MONOSPACE;
    field public static final int NORMAL = 0; // 0x0
    field public static final android.graphics.Typeface SANS_SERIF;
    field public static final android.graphics.Typeface SERIF;
  }

  public static final class Typeface.Builder {
    ctor public Typeface.Builder(@NonNull java.io.File);
    ctor public Typeface.Builder(@NonNull java.io.FileDescriptor);
    ctor public Typeface.Builder(@NonNull String);
    ctor public Typeface.Builder(@NonNull android.content.res.AssetManager, @NonNull String);
    method public android.graphics.Typeface build();
    method public android.graphics.Typeface.Builder setFallback(@Nullable String);
    method public android.graphics.Typeface.Builder setFontVariationSettings(@Nullable String);
    method public android.graphics.Typeface.Builder setFontVariationSettings(@Nullable android.graphics.fonts.FontVariationAxis[]);
    method public android.graphics.Typeface.Builder setItalic(boolean);
    method public android.graphics.Typeface.Builder setTtcIndex(@IntRange(from=0) int);
    method public android.graphics.Typeface.Builder setWeight(@IntRange(from=1, to=1000) int);
  }

  public class Xfermode {
    ctor public Xfermode();
  }

  public class YuvImage {
    ctor public YuvImage(byte[], int, int, int, int[]);
    method public boolean compressToJpeg(android.graphics.Rect, int, java.io.OutputStream);
    method public int getHeight();
    method public int[] getStrides();
    method public int getWidth();
    method public byte[] getYuvData();
    method public int getYuvFormat();
  }

}

package android.graphics.drawable {

  public class AdaptiveIconDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
    ctor public AdaptiveIconDrawable(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable);
    method public void draw(android.graphics.Canvas);
    method public android.graphics.drawable.Drawable getBackground();
    method public static float getExtraInsetFraction();
    method public android.graphics.drawable.Drawable getForeground();
    method public android.graphics.Path getIconMask();
    method public int getOpacity();
    method public void invalidateDrawable(@NonNull android.graphics.drawable.Drawable);
    method public void scheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable, long);
    method public void setAlpha(int);
    method public void setColorFilter(android.graphics.ColorFilter);
    method public void setDither(boolean);
    method public void setOpacity(int);
    method public void unscheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable);
  }

  public interface Animatable {
    method public boolean isRunning();
    method public void start();
    method public void stop();
  }

  public interface Animatable2 extends android.graphics.drawable.Animatable {
    method public void clearAnimationCallbacks();
    method public void registerAnimationCallback(@NonNull android.graphics.drawable.Animatable2.AnimationCallback);
    method public boolean unregisterAnimationCallback(@NonNull android.graphics.drawable.Animatable2.AnimationCallback);
  }

  public abstract static class Animatable2.AnimationCallback {
    ctor public Animatable2.AnimationCallback();
    method public void onAnimationEnd(android.graphics.drawable.Drawable);
    method public void onAnimationStart(android.graphics.drawable.Drawable);
  }

  public class AnimatedImageDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Animatable2 {
    ctor public AnimatedImageDrawable();
    method public void clearAnimationCallbacks();
    method public void draw(@NonNull android.graphics.Canvas);
    method public int getOpacity();
    method public int getRepeatCount();
    method public final boolean isAutoMirrored();
    method public boolean isRunning();
    method public void registerAnimationCallback(@NonNull android.graphics.drawable.Animatable2.AnimationCallback);
    method public void setAlpha(@IntRange(from=0, to=255) int);
    method public void setColorFilter(@Nullable android.graphics.ColorFilter);
    method public void setRepeatCount(@IntRange(from=android.graphics.drawable.AnimatedImageDrawable.REPEAT_INFINITE) int);
    method public void start();
    method public void stop();
    method public boolean unregisterAnimationCallback(@NonNull android.graphics.drawable.Animatable2.AnimationCallback);
    field public static final int REPEAT_INFINITE = -1; // 0xffffffff
  }

  public class AnimatedStateListDrawable extends android.graphics.drawable.StateListDrawable {
    ctor public AnimatedStateListDrawable();
    method public void addState(@NonNull int[], @NonNull android.graphics.drawable.Drawable, int);
    method public <T extends android.graphics.drawable.Drawable & android.graphics.drawable.Animatable> void addTransition(int, int, @NonNull T, boolean);
  }

  public class AnimatedVectorDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Animatable2 {
    ctor public AnimatedVectorDrawable();
    method public void clearAnimationCallbacks();
    method public void draw(android.graphics.Canvas);
    method public int getOpacity();
    method public boolean isRunning();
    method public void registerAnimationCallback(@NonNull android.graphics.drawable.Animatable2.AnimationCallback);
    method public void reset();
    method public void setAlpha(int);
    method public void setColorFilter(android.graphics.ColorFilter);
    method public void start();
    method public void stop();
    method public boolean unregisterAnimationCallback(@NonNull android.graphics.drawable.Animatable2.AnimationCallback);
  }

  public class AnimationDrawable extends android.graphics.drawable.DrawableContainer implements android.graphics.drawable.Animatable java.lang.Runnable {
    ctor public AnimationDrawable();
    method public void addFrame(@NonNull android.graphics.drawable.Drawable, int);
    method public int getDuration(int);
    method public android.graphics.drawable.Drawable getFrame(int);
    method public int getNumberOfFrames();
    method public boolean isOneShot();
    method public boolean isRunning();
    method public void run();
    method public void setOneShot(boolean);
    method public void start();
    method public void stop();
  }

  public class BitmapDrawable extends android.graphics.drawable.Drawable {
    ctor @Deprecated public BitmapDrawable();
    ctor @Deprecated public BitmapDrawable(android.content.res.Resources);
    ctor @Deprecated public BitmapDrawable(android.graphics.Bitmap);
    ctor public BitmapDrawable(android.content.res.Resources, android.graphics.Bitmap);
    ctor @Deprecated public BitmapDrawable(String);
    ctor public BitmapDrawable(android.content.res.Resources, String);
    ctor @Deprecated public BitmapDrawable(java.io.InputStream);
    ctor public BitmapDrawable(android.content.res.Resources, java.io.InputStream);
    method public void draw(android.graphics.Canvas);
    method public final android.graphics.Bitmap getBitmap();
    method public final android.graphics.drawable.Drawable.ConstantState getConstantState();
    method public int getGravity();
    method public int getOpacity();
    method public final android.graphics.Paint getPaint();
    method public android.graphics.Shader.TileMode getTileModeX();
    method public android.graphics.Shader.TileMode getTileModeY();
    method public boolean hasAntiAlias();
    method public boolean hasMipMap();
    method public final boolean isAutoMirrored();
    method public void setAlpha(int);
    method public void setAntiAlias(boolean);
    method public void setColorFilter(android.graphics.ColorFilter);
    method public void setDither(boolean);
    method public void setGravity(int);
    method public void setMipMap(boolean);
    method public void setTargetDensity(android.graphics.Canvas);
    method public void setTargetDensity(android.util.DisplayMetrics);
    method public void setTargetDensity(int);
    method public void setTileModeX(android.graphics.Shader.TileMode);
    method public void setTileModeXY(android.graphics.Shader.TileMode, android.graphics.Shader.TileMode);
    method public final void setTileModeY(android.graphics.Shader.TileMode);
  }

  public class ClipDrawable extends android.graphics.drawable.DrawableWrapper {
    ctor public ClipDrawable(android.graphics.drawable.Drawable, int, int);
    field public static final int HORIZONTAL = 1; // 0x1
    field public static final int VERTICAL = 2; // 0x2
  }

  public class ColorDrawable extends android.graphics.drawable.Drawable {
    ctor public ColorDrawable();
    ctor public ColorDrawable(@ColorInt int);
    method public void draw(android.graphics.Canvas);
    method @ColorInt public int getColor();
    method public int getOpacity();
    method public void setAlpha(int);
    method public void setColor(@ColorInt int);
    method public void setColorFilter(android.graphics.ColorFilter);
  }

  public abstract class Drawable {
    ctor public Drawable();
    method public void applyTheme(@NonNull android.content.res.Resources.Theme);
    method public boolean canApplyTheme();
    method public void clearColorFilter();
    method public final void copyBounds(@NonNull android.graphics.Rect);
    method @NonNull public final android.graphics.Rect copyBounds();
    method @Nullable public static android.graphics.drawable.Drawable createFromPath(String);
    method public static android.graphics.drawable.Drawable createFromResourceStream(android.content.res.Resources, android.util.TypedValue, java.io.InputStream, String);
    method @Deprecated @Nullable public static android.graphics.drawable.Drawable createFromResourceStream(@Nullable android.content.res.Resources, @Nullable android.util.TypedValue, @Nullable java.io.InputStream, @Nullable String, @Nullable android.graphics.BitmapFactory.Options);
    method public static android.graphics.drawable.Drawable createFromStream(java.io.InputStream, String);
    method @NonNull public static android.graphics.drawable.Drawable createFromXml(@NonNull android.content.res.Resources, @NonNull org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method @NonNull public static android.graphics.drawable.Drawable createFromXml(@NonNull android.content.res.Resources, @NonNull org.xmlpull.v1.XmlPullParser, @Nullable android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method @NonNull public static android.graphics.drawable.Drawable createFromXmlInner(@NonNull android.content.res.Resources, @NonNull org.xmlpull.v1.XmlPullParser, @NonNull android.util.AttributeSet) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method @NonNull public static android.graphics.drawable.Drawable createFromXmlInner(@NonNull android.content.res.Resources, @NonNull org.xmlpull.v1.XmlPullParser, @NonNull android.util.AttributeSet, @Nullable android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public abstract void draw(@NonNull android.graphics.Canvas);
    method @IntRange(from=0, to=255) public int getAlpha();
    method @NonNull public final android.graphics.Rect getBounds();
    method @Nullable public android.graphics.drawable.Drawable.Callback getCallback();
    method public int getChangingConfigurations();
    method @Nullable public android.graphics.ColorFilter getColorFilter();
    method @Nullable public android.graphics.drawable.Drawable.ConstantState getConstantState();
    method @NonNull public android.graphics.drawable.Drawable getCurrent();
    method @NonNull public android.graphics.Rect getDirtyBounds();
    method public void getHotspotBounds(@NonNull android.graphics.Rect);
    method public int getIntrinsicHeight();
    method public int getIntrinsicWidth();
    method public int getLayoutDirection();
    method @IntRange(from=0, to=10000) public final int getLevel();
    method public int getMinimumHeight();
    method public int getMinimumWidth();
    method public abstract int getOpacity();
    method public void getOutline(@NonNull android.graphics.Outline);
    method public boolean getPadding(@NonNull android.graphics.Rect);
    method @NonNull public int[] getState();
    method @Nullable public android.graphics.Region getTransparentRegion();
    method public void inflate(@NonNull android.content.res.Resources, @NonNull org.xmlpull.v1.XmlPullParser, @NonNull android.util.AttributeSet) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public void inflate(@NonNull android.content.res.Resources, @NonNull org.xmlpull.v1.XmlPullParser, @NonNull android.util.AttributeSet, @Nullable android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public void invalidateSelf();
    method public boolean isAutoMirrored();
    method public boolean isFilterBitmap();
    method public boolean isStateful();
    method public final boolean isVisible();
    method public void jumpToCurrentState();
    method @NonNull public android.graphics.drawable.Drawable mutate();
    method protected void onBoundsChange(android.graphics.Rect);
    method public boolean onLayoutDirectionChanged(int);
    method protected boolean onLevelChange(int);
    method protected boolean onStateChange(int[]);
    method public static int resolveOpacity(int, int);
    method public void scheduleSelf(@NonNull Runnable, long);
    method public abstract void setAlpha(@IntRange(from=0, to=255) int);
    method public void setAutoMirrored(boolean);
    method public void setBounds(int, int, int, int);
    method public void setBounds(@NonNull android.graphics.Rect);
    method public final void setCallback(@Nullable android.graphics.drawable.Drawable.Callback);
    method public void setChangingConfigurations(int);
    method public abstract void setColorFilter(@Nullable android.graphics.ColorFilter);
    method public void setColorFilter(@ColorInt int, @NonNull android.graphics.PorterDuff.Mode);
    method @Deprecated public void setDither(boolean);
    method public void setFilterBitmap(boolean);
    method public void setHotspot(float, float);
    method public void setHotspotBounds(int, int, int, int);
    method public final boolean setLayoutDirection(int);
    method public final boolean setLevel(@IntRange(from=0, to=10000) int);
    method public boolean setState(@NonNull int[]);
    method public void setTint(@ColorInt int);
    method public void setTintList(@Nullable android.content.res.ColorStateList);
    method public void setTintMode(@NonNull android.graphics.PorterDuff.Mode);
    method public boolean setVisible(boolean, boolean);
    method public void unscheduleSelf(@NonNull Runnable);
  }

  public static interface Drawable.Callback {
    method public void invalidateDrawable(@NonNull android.graphics.drawable.Drawable);
    method public void scheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable, long);
    method public void unscheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable);
  }

  public abstract static class Drawable.ConstantState {
    ctor public Drawable.ConstantState();
    method public boolean canApplyTheme();
    method public abstract int getChangingConfigurations();
    method @NonNull public abstract android.graphics.drawable.Drawable newDrawable();
    method @NonNull public android.graphics.drawable.Drawable newDrawable(@Nullable android.content.res.Resources);
    method @NonNull public android.graphics.drawable.Drawable newDrawable(@Nullable android.content.res.Resources, @Nullable android.content.res.Resources.Theme);
  }

  public class DrawableContainer extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
    ctor public DrawableContainer();
    method public void draw(android.graphics.Canvas);
    method public int getOpacity();
    method public void invalidateDrawable(@NonNull android.graphics.drawable.Drawable);
    method public void scheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable, long);
    method public boolean selectDrawable(int);
    method public void setAlpha(int);
    method public void setColorFilter(android.graphics.ColorFilter);
    method protected void setConstantState(android.graphics.drawable.DrawableContainer.DrawableContainerState);
    method public void setDither(boolean);
    method public void setEnterFadeDuration(int);
    method public void setExitFadeDuration(int);
    method public void unscheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable);
  }

  public abstract static class DrawableContainer.DrawableContainerState extends android.graphics.drawable.Drawable.ConstantState {
    method public final int addChild(android.graphics.drawable.Drawable);
    method public boolean canConstantState();
    method protected void computeConstantSize();
    method public int getChangingConfigurations();
    method public final android.graphics.drawable.Drawable getChild(int);
    method public final int getChildCount();
    method public final android.graphics.drawable.Drawable[] getChildren();
    method public final int getConstantHeight();
    method public final int getConstantMinimumHeight();
    method public final int getConstantMinimumWidth();
    method public final android.graphics.Rect getConstantPadding();
    method public final int getConstantWidth();
    method public final int getEnterFadeDuration();
    method public final int getExitFadeDuration();
    method public final int getOpacity();
    method public void growArray(int, int);
    method public final boolean isConstantSize();
    method public final boolean isStateful();
    method public final void setConstantSize(boolean);
    method public final void setEnterFadeDuration(int);
    method public final void setExitFadeDuration(int);
    method public final void setVariablePadding(boolean);
  }

  public abstract class DrawableWrapper extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
    ctor public DrawableWrapper(@Nullable android.graphics.drawable.Drawable);
    method public void draw(@NonNull android.graphics.Canvas);
    method @Nullable public android.graphics.drawable.Drawable getDrawable();
    method public int getOpacity();
    method public void invalidateDrawable(@NonNull android.graphics.drawable.Drawable);
    method public void scheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable, long);
    method public void setAlpha(int);
    method public void setColorFilter(@Nullable android.graphics.ColorFilter);
    method public void setDrawable(@Nullable android.graphics.drawable.Drawable);
    method public void unscheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable);
  }

  public class GradientDrawable extends android.graphics.drawable.Drawable {
    ctor public GradientDrawable();
    ctor public GradientDrawable(android.graphics.drawable.GradientDrawable.Orientation, @ColorInt int[]);
    method public void draw(android.graphics.Canvas);
    method @Nullable public android.content.res.ColorStateList getColor();
    method @Nullable public int[] getColors();
    method @Nullable public float[] getCornerRadii();
    method public float getCornerRadius();
    method public float getGradientCenterX();
    method public float getGradientCenterY();
    method public float getGradientRadius();
    method public int getGradientType();
    method public int getOpacity();
    method public android.graphics.drawable.GradientDrawable.Orientation getOrientation();
    method public int getShape();
    method public boolean getUseLevel();
    method public void setAlpha(int);
    method public void setColor(@ColorInt int);
    method public void setColor(@Nullable android.content.res.ColorStateList);
    method public void setColorFilter(@Nullable android.graphics.ColorFilter);
    method public void setColors(@ColorInt int[]);
    method public void setCornerRadii(@Nullable float[]);
    method public void setCornerRadius(float);
    method public void setDither(boolean);
    method public void setGradientCenter(float, float);
    method public void setGradientRadius(float);
    method public void setGradientType(int);
    method public void setOrientation(android.graphics.drawable.GradientDrawable.Orientation);
    method public void setShape(int);
    method public void setSize(int, int);
    method public void setStroke(int, @ColorInt int);
    method public void setStroke(int, android.content.res.ColorStateList);
    method public void setStroke(int, @ColorInt int, float, float);
    method public void setStroke(int, android.content.res.ColorStateList, float, float);
    method public void setUseLevel(boolean);
    field public static final int LINE = 2; // 0x2
    field public static final int LINEAR_GRADIENT = 0; // 0x0
    field public static final int OVAL = 1; // 0x1
    field public static final int RADIAL_GRADIENT = 1; // 0x1
    field public static final int RECTANGLE = 0; // 0x0
    field public static final int RING = 3; // 0x3
    field public static final int SWEEP_GRADIENT = 2; // 0x2
  }

  public enum GradientDrawable.Orientation {
    enum_constant public static final android.graphics.drawable.GradientDrawable.Orientation BL_TR;
    enum_constant public static final android.graphics.drawable.GradientDrawable.Orientation BOTTOM_TOP;
    enum_constant public static final android.graphics.drawable.GradientDrawable.Orientation BR_TL;
    enum_constant public static final android.graphics.drawable.GradientDrawable.Orientation LEFT_RIGHT;
    enum_constant public static final android.graphics.drawable.GradientDrawable.Orientation RIGHT_LEFT;
    enum_constant public static final android.graphics.drawable.GradientDrawable.Orientation TL_BR;
    enum_constant public static final android.graphics.drawable.GradientDrawable.Orientation TOP_BOTTOM;
    enum_constant public static final android.graphics.drawable.GradientDrawable.Orientation TR_BL;
  }

  public final class Icon implements android.os.Parcelable {
    method public static android.graphics.drawable.Icon createWithAdaptiveBitmap(android.graphics.Bitmap);
    method public static android.graphics.drawable.Icon createWithBitmap(android.graphics.Bitmap);
    method public static android.graphics.drawable.Icon createWithContentUri(String);
    method public static android.graphics.drawable.Icon createWithContentUri(android.net.Uri);
    method public static android.graphics.drawable.Icon createWithData(byte[], int, int);
    method public static android.graphics.drawable.Icon createWithFilePath(String);
    method public static android.graphics.drawable.Icon createWithResource(android.content.Context, @DrawableRes int);
    method public static android.graphics.drawable.Icon createWithResource(String, @DrawableRes int);
    method public int describeContents();
    method @IdRes public int getResId();
    method @NonNull public String getResPackage();
    method public int getType();
    method @NonNull public android.net.Uri getUri();
    method public android.graphics.drawable.Drawable loadDrawable(android.content.Context);
    method public void loadDrawableAsync(android.content.Context, android.os.Message);
    method public void loadDrawableAsync(android.content.Context, android.graphics.drawable.Icon.OnDrawableLoadedListener, android.os.Handler);
    method public android.graphics.drawable.Icon setTint(@ColorInt int);
    method public android.graphics.drawable.Icon setTintList(android.content.res.ColorStateList);
    method public android.graphics.drawable.Icon setTintMode(android.graphics.PorterDuff.Mode);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.graphics.drawable.Icon> CREATOR;
    field public static final int TYPE_ADAPTIVE_BITMAP = 5; // 0x5
    field public static final int TYPE_BITMAP = 1; // 0x1
    field public static final int TYPE_DATA = 3; // 0x3
    field public static final int TYPE_RESOURCE = 2; // 0x2
    field public static final int TYPE_URI = 4; // 0x4
  }

  public static interface Icon.OnDrawableLoadedListener {
    method public void onDrawableLoaded(android.graphics.drawable.Drawable);
  }

  public class InsetDrawable extends android.graphics.drawable.DrawableWrapper {
    ctor public InsetDrawable(@Nullable android.graphics.drawable.Drawable, int);
    ctor public InsetDrawable(@Nullable android.graphics.drawable.Drawable, float);
    ctor public InsetDrawable(@Nullable android.graphics.drawable.Drawable, int, int, int, int);
    ctor public InsetDrawable(@Nullable android.graphics.drawable.Drawable, float, float, float, float);
  }

  public class LayerDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
    ctor public LayerDrawable(@NonNull android.graphics.drawable.Drawable[]);
    method public int addLayer(android.graphics.drawable.Drawable);
    method public void draw(android.graphics.Canvas);
    method public android.graphics.drawable.Drawable findDrawableByLayerId(int);
    method public int findIndexByLayerId(int);
    method public int getBottomPadding();
    method public android.graphics.drawable.Drawable getDrawable(int);
    method public int getEndPadding();
    method public int getId(int);
    method public int getLayerGravity(int);
    method public int getLayerHeight(int);
    method public int getLayerInsetBottom(int);
    method public int getLayerInsetEnd(int);
    method public int getLayerInsetLeft(int);
    method public int getLayerInsetRight(int);
    method public int getLayerInsetStart(int);
    method public int getLayerInsetTop(int);
    method public int getLayerWidth(int);
    method public int getLeftPadding();
    method public int getNumberOfLayers();
    method public int getOpacity();
    method public int getPaddingMode();
    method public int getRightPadding();
    method public int getStartPadding();
    method public int getTopPadding();
    method public void invalidateDrawable(@NonNull android.graphics.drawable.Drawable);
    method public void scheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable, long);
    method public void setAlpha(int);
    method public void setColorFilter(android.graphics.ColorFilter);
    method public void setDither(boolean);
    method public void setDrawable(int, android.graphics.drawable.Drawable);
    method public boolean setDrawableByLayerId(int, android.graphics.drawable.Drawable);
    method public void setId(int, int);
    method public void setLayerGravity(int, int);
    method public void setLayerHeight(int, int);
    method public void setLayerInset(int, int, int, int, int);
    method public void setLayerInsetBottom(int, int);
    method public void setLayerInsetEnd(int, int);
    method public void setLayerInsetLeft(int, int);
    method public void setLayerInsetRelative(int, int, int, int, int);
    method public void setLayerInsetRight(int, int);
    method public void setLayerInsetStart(int, int);
    method public void setLayerInsetTop(int, int);
    method public void setLayerSize(int, int, int);
    method public void setLayerWidth(int, int);
    method public void setOpacity(int);
    method public void setPadding(int, int, int, int);
    method public void setPaddingMode(int);
    method public void setPaddingRelative(int, int, int, int);
    method public void unscheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable);
    field public static final int INSET_UNDEFINED = -2147483648; // 0x80000000
    field public static final int PADDING_MODE_NEST = 0; // 0x0
    field public static final int PADDING_MODE_STACK = 1; // 0x1
  }

  public class LevelListDrawable extends android.graphics.drawable.DrawableContainer {
    ctor public LevelListDrawable();
    method public void addLevel(int, int, android.graphics.drawable.Drawable);
  }

  public class NinePatchDrawable extends android.graphics.drawable.Drawable {
    ctor @Deprecated public NinePatchDrawable(android.graphics.Bitmap, byte[], android.graphics.Rect, String);
    ctor public NinePatchDrawable(android.content.res.Resources, android.graphics.Bitmap, byte[], android.graphics.Rect, String);
    ctor @Deprecated public NinePatchDrawable(@NonNull android.graphics.NinePatch);
    ctor public NinePatchDrawable(@Nullable android.content.res.Resources, @NonNull android.graphics.NinePatch);
    method public void draw(android.graphics.Canvas);
    method public int getOpacity();
    method @NonNull public android.graphics.Paint getPaint();
    method public void setAlpha(int);
    method public void setColorFilter(@Nullable android.graphics.ColorFilter);
    method public void setDither(boolean);
    method public void setTargetDensity(@NonNull android.graphics.Canvas);
    method public void setTargetDensity(@NonNull android.util.DisplayMetrics);
    method public void setTargetDensity(int);
  }

  public class PaintDrawable extends android.graphics.drawable.ShapeDrawable {
    ctor public PaintDrawable();
    ctor public PaintDrawable(int);
    method public void setCornerRadii(float[]);
    method public void setCornerRadius(float);
  }

  public class PictureDrawable extends android.graphics.drawable.Drawable {
    ctor public PictureDrawable(android.graphics.Picture);
    method public void draw(android.graphics.Canvas);
    method public int getOpacity();
    method public android.graphics.Picture getPicture();
    method public void setAlpha(int);
    method public void setColorFilter(android.graphics.ColorFilter);
    method public void setPicture(android.graphics.Picture);
  }

  public class RippleDrawable extends android.graphics.drawable.LayerDrawable {
    ctor public RippleDrawable(@NonNull android.content.res.ColorStateList, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable);
    method public int getRadius();
    method public void setColor(android.content.res.ColorStateList);
    method public void setRadius(int);
    field public static final int RADIUS_AUTO = -1; // 0xffffffff
  }

  public class RotateDrawable extends android.graphics.drawable.DrawableWrapper {
    ctor public RotateDrawable();
    method public float getFromDegrees();
    method public float getPivotX();
    method public float getPivotY();
    method public float getToDegrees();
    method public boolean isPivotXRelative();
    method public boolean isPivotYRelative();
    method public void setFromDegrees(float);
    method public void setPivotX(float);
    method public void setPivotXRelative(boolean);
    method public void setPivotY(float);
    method public void setPivotYRelative(boolean);
    method public void setToDegrees(float);
  }

  public class ScaleDrawable extends android.graphics.drawable.DrawableWrapper {
    ctor public ScaleDrawable(android.graphics.drawable.Drawable, int, float, float);
  }

  public class ShapeDrawable extends android.graphics.drawable.Drawable {
    ctor public ShapeDrawable();
    ctor public ShapeDrawable(android.graphics.drawable.shapes.Shape);
    method public void draw(android.graphics.Canvas);
    method public int getOpacity();
    method public android.graphics.Paint getPaint();
    method public android.graphics.drawable.ShapeDrawable.ShaderFactory getShaderFactory();
    method public android.graphics.drawable.shapes.Shape getShape();
    method protected boolean inflateTag(String, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet);
    method protected void onDraw(android.graphics.drawable.shapes.Shape, android.graphics.Canvas, android.graphics.Paint);
    method public void setAlpha(int);
    method public void setColorFilter(android.graphics.ColorFilter);
    method public void setDither(boolean);
    method public void setIntrinsicHeight(int);
    method public void setIntrinsicWidth(int);
    method public void setPadding(int, int, int, int);
    method public void setPadding(android.graphics.Rect);
    method public void setShaderFactory(android.graphics.drawable.ShapeDrawable.ShaderFactory);
    method public void setShape(android.graphics.drawable.shapes.Shape);
  }

  public abstract static class ShapeDrawable.ShaderFactory {
    ctor public ShapeDrawable.ShaderFactory();
    method public abstract android.graphics.Shader resize(int, int);
  }

  public class StateListDrawable extends android.graphics.drawable.DrawableContainer {
    ctor public StateListDrawable();
    method public void addState(int[], android.graphics.drawable.Drawable);
  }

  public class TransitionDrawable extends android.graphics.drawable.LayerDrawable implements android.graphics.drawable.Drawable.Callback {
    ctor public TransitionDrawable(android.graphics.drawable.Drawable[]);
    method public boolean isCrossFadeEnabled();
    method public void resetTransition();
    method public void reverseTransition(int);
    method public void setCrossFadeEnabled(boolean);
    method public void startTransition(int);
  }

  public class VectorDrawable extends android.graphics.drawable.Drawable {
    ctor public VectorDrawable();
    method public void draw(android.graphics.Canvas);
    method public int getOpacity();
    method public void setAlpha(int);
    method public void setColorFilter(android.graphics.ColorFilter);
  }

}

package android.graphics.drawable.shapes {

  public class ArcShape extends android.graphics.drawable.shapes.RectShape {
    ctor public ArcShape(float, float);
    method public android.graphics.drawable.shapes.ArcShape clone() throws java.lang.CloneNotSupportedException;
    method public final float getStartAngle();
    method public final float getSweepAngle();
  }

  public class OvalShape extends android.graphics.drawable.shapes.RectShape {
    ctor public OvalShape();
    method public android.graphics.drawable.shapes.OvalShape clone() throws java.lang.CloneNotSupportedException;
  }

  public class PathShape extends android.graphics.drawable.shapes.Shape {
    ctor public PathShape(@NonNull android.graphics.Path, float, float);
    method public android.graphics.drawable.shapes.PathShape clone() throws java.lang.CloneNotSupportedException;
    method public void draw(android.graphics.Canvas, android.graphics.Paint);
  }

  public class RectShape extends android.graphics.drawable.shapes.Shape {
    ctor public RectShape();
    method public android.graphics.drawable.shapes.RectShape clone() throws java.lang.CloneNotSupportedException;
    method public void draw(android.graphics.Canvas, android.graphics.Paint);
    method protected final android.graphics.RectF rect();
  }

  public class RoundRectShape extends android.graphics.drawable.shapes.RectShape {
    ctor public RoundRectShape(@Nullable float[], @Nullable android.graphics.RectF, @Nullable float[]);
    method public android.graphics.drawable.shapes.RoundRectShape clone() throws java.lang.CloneNotSupportedException;
  }

  public abstract class Shape implements java.lang.Cloneable {
    ctor public Shape();
    method public android.graphics.drawable.shapes.Shape clone() throws java.lang.CloneNotSupportedException;
    method public abstract void draw(android.graphics.Canvas, android.graphics.Paint);
    method public final float getHeight();
    method public void getOutline(@NonNull android.graphics.Outline);
    method public final float getWidth();
    method public boolean hasAlpha();
    method protected void onResize(float, float);
    method public final void resize(float, float);
  }

}

package android.graphics.fonts {

  public final class FontVariationAxis {
    ctor public FontVariationAxis(@NonNull String, float);
    method @Nullable public static android.graphics.fonts.FontVariationAxis[] fromFontVariationSettings(@Nullable String);
    method public float getStyleValue();
    method public String getTag();
    method @NonNull public static String toFontVariationSettings(@Nullable android.graphics.fonts.FontVariationAxis[]);
  }

}

package android.graphics.pdf {

  public class PdfDocument {
    ctor public PdfDocument();
    method public void close();
    method public void finishPage(android.graphics.pdf.PdfDocument.Page);
    method public java.util.List<android.graphics.pdf.PdfDocument.PageInfo> getPages();
    method public android.graphics.pdf.PdfDocument.Page startPage(android.graphics.pdf.PdfDocument.PageInfo);
    method public void writeTo(java.io.OutputStream) throws java.io.IOException;
  }

  public static final class PdfDocument.Page {
    method public android.graphics.Canvas getCanvas();
    method public android.graphics.pdf.PdfDocument.PageInfo getInfo();
  }

  public static final class PdfDocument.PageInfo {
    method public android.graphics.Rect getContentRect();
    method public int getPageHeight();
    method public int getPageNumber();
    method public int getPageWidth();
  }

  public static final class PdfDocument.PageInfo.Builder {
    ctor public PdfDocument.PageInfo.Builder(int, int, int);
    method public android.graphics.pdf.PdfDocument.PageInfo create();
    method public android.graphics.pdf.PdfDocument.PageInfo.Builder setContentRect(android.graphics.Rect);
  }

  public final class PdfRenderer implements java.lang.AutoCloseable {
    ctor public PdfRenderer(@NonNull android.os.ParcelFileDescriptor) throws java.io.IOException;
    method public void close();
    method public int getPageCount();
    method public android.graphics.pdf.PdfRenderer.Page openPage(int);
    method public boolean shouldScaleForPrinting();
  }

  public final class PdfRenderer.Page implements java.lang.AutoCloseable {
    method public void close();
    method public int getHeight();
    method public int getIndex();
    method public int getWidth();
    method public void render(@NonNull android.graphics.Bitmap, @Nullable android.graphics.Rect, @Nullable android.graphics.Matrix, int);
    field public static final int RENDER_MODE_FOR_DISPLAY = 1; // 0x1
    field public static final int RENDER_MODE_FOR_PRINT = 2; // 0x2
  }

}

package android.hardware {

  @Deprecated public class Camera {
    method @Deprecated public final void addCallbackBuffer(byte[]);
    method @Deprecated public final void autoFocus(android.hardware.Camera.AutoFocusCallback);
    method @Deprecated public final void cancelAutoFocus();
    method @Deprecated public final boolean enableShutterSound(boolean);
    method @Deprecated protected void finalize();
    method @Deprecated public static void getCameraInfo(int, android.hardware.Camera.CameraInfo);
    method @Deprecated public static int getNumberOfCameras();
    method @Deprecated public android.hardware.Camera.Parameters getParameters();
    method @Deprecated public final void lock();
    method @Deprecated public static android.hardware.Camera open(int);
    method @Deprecated public static android.hardware.Camera open();
    method @Deprecated public final void reconnect() throws java.io.IOException;
    method @Deprecated public final void release();
    method @Deprecated public void setAutoFocusMoveCallback(android.hardware.Camera.AutoFocusMoveCallback);
    method @Deprecated public final void setDisplayOrientation(int);
    method @Deprecated public final void setErrorCallback(android.hardware.Camera.ErrorCallback);
    method @Deprecated public final void setFaceDetectionListener(android.hardware.Camera.FaceDetectionListener);
    method @Deprecated public final void setOneShotPreviewCallback(android.hardware.Camera.PreviewCallback);
    method @Deprecated public void setParameters(android.hardware.Camera.Parameters);
    method @Deprecated public final void setPreviewCallback(android.hardware.Camera.PreviewCallback);
    method @Deprecated public final void setPreviewCallbackWithBuffer(android.hardware.Camera.PreviewCallback);
    method @Deprecated public final void setPreviewDisplay(android.view.SurfaceHolder) throws java.io.IOException;
    method @Deprecated public final void setPreviewTexture(android.graphics.SurfaceTexture) throws java.io.IOException;
    method @Deprecated public final void setZoomChangeListener(android.hardware.Camera.OnZoomChangeListener);
    method @Deprecated public final void startFaceDetection();
    method @Deprecated public final void startPreview();
    method @Deprecated public final void startSmoothZoom(int);
    method @Deprecated public final void stopFaceDetection();
    method @Deprecated public final void stopPreview();
    method @Deprecated public final void stopSmoothZoom();
    method @Deprecated public final void takePicture(android.hardware.Camera.ShutterCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback);
    method @Deprecated public final void takePicture(android.hardware.Camera.ShutterCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback);
    method @Deprecated public final void unlock();
    field @Deprecated public static final String ACTION_NEW_PICTURE = "android.hardware.action.NEW_PICTURE";
    field @Deprecated public static final String ACTION_NEW_VIDEO = "android.hardware.action.NEW_VIDEO";
    field @Deprecated public static final int CAMERA_ERROR_EVICTED = 2; // 0x2
    field @Deprecated public static final int CAMERA_ERROR_SERVER_DIED = 100; // 0x64
    field @Deprecated public static final int CAMERA_ERROR_UNKNOWN = 1; // 0x1
  }

  @Deprecated public static class Camera.Area {
    ctor @Deprecated public Camera.Area(android.graphics.Rect, int);
    field @Deprecated public android.graphics.Rect rect;
    field @Deprecated public int weight;
  }

  @Deprecated public static interface Camera.AutoFocusCallback {
    method @Deprecated public void onAutoFocus(boolean, android.hardware.Camera);
  }

  @Deprecated public static interface Camera.AutoFocusMoveCallback {
    method @Deprecated public void onAutoFocusMoving(boolean, android.hardware.Camera);
  }

  @Deprecated public static class Camera.CameraInfo {
    ctor @Deprecated public Camera.CameraInfo();
    field @Deprecated public static final int CAMERA_FACING_BACK = 0; // 0x0
    field @Deprecated public static final int CAMERA_FACING_FRONT = 1; // 0x1
    field @Deprecated public boolean canDisableShutterSound;
    field @Deprecated public int facing;
    field @Deprecated public int orientation;
  }

  @Deprecated public static interface Camera.ErrorCallback {
    method @Deprecated public void onError(int, android.hardware.Camera);
  }

  @Deprecated public static class Camera.Face {
    ctor @Deprecated public Camera.Face();
    field @Deprecated public int id;
    field @Deprecated public android.graphics.Point leftEye;
    field @Deprecated public android.graphics.Point mouth;
    field @Deprecated public android.graphics.Rect rect;
    field @Deprecated public android.graphics.Point rightEye;
    field @Deprecated public int score;
  }

  @Deprecated public static interface Camera.FaceDetectionListener {
    method @Deprecated public void onFaceDetection(android.hardware.Camera.Face[], android.hardware.Camera);
  }

  @Deprecated public static interface Camera.OnZoomChangeListener {
    method @Deprecated public void onZoomChange(int, boolean, android.hardware.Camera);
  }

  @Deprecated public class Camera.Parameters {
    method @Deprecated public String flatten();
    method @Deprecated public String get(String);
    method @Deprecated public String getAntibanding();
    method @Deprecated public boolean getAutoExposureLock();
    method @Deprecated public boolean getAutoWhiteBalanceLock();
    method @Deprecated public String getColorEffect();
    method @Deprecated public int getExposureCompensation();
    method @Deprecated public float getExposureCompensationStep();
    method @Deprecated public String getFlashMode();
    method @Deprecated public float getFocalLength();
    method @Deprecated public java.util.List<android.hardware.Camera.Area> getFocusAreas();
    method @Deprecated public void getFocusDistances(float[]);
    method @Deprecated public String getFocusMode();
    method @Deprecated public float getHorizontalViewAngle();
    method @Deprecated public int getInt(String);
    method @Deprecated public int getJpegQuality();
    method @Deprecated public int getJpegThumbnailQuality();
    method @Deprecated public android.hardware.Camera.Size getJpegThumbnailSize();
    method @Deprecated public int getMaxExposureCompensation();
    method @Deprecated public int getMaxNumDetectedFaces();
    method @Deprecated public int getMaxNumFocusAreas();
    method @Deprecated public int getMaxNumMeteringAreas();
    method @Deprecated public int getMaxZoom();
    method @Deprecated public java.util.List<android.hardware.Camera.Area> getMeteringAreas();
    method @Deprecated public int getMinExposureCompensation();
    method @Deprecated public int getPictureFormat();
    method @Deprecated public android.hardware.Camera.Size getPictureSize();
    method @Deprecated public android.hardware.Camera.Size getPreferredPreviewSizeForVideo();
    method @Deprecated public int getPreviewFormat();
    method @Deprecated public void getPreviewFpsRange(int[]);
    method @Deprecated public int getPreviewFrameRate();
    method @Deprecated public android.hardware.Camera.Size getPreviewSize();
    method @Deprecated public String getSceneMode();
    method @Deprecated public java.util.List<java.lang.String> getSupportedAntibanding();
    method @Deprecated public java.util.List<java.lang.String> getSupportedColorEffects();
    method @Deprecated public java.util.List<java.lang.String> getSupportedFlashModes();
    method @Deprecated public java.util.List<java.lang.String> getSupportedFocusModes();
    method @Deprecated public java.util.List<android.hardware.Camera.Size> getSupportedJpegThumbnailSizes();
    method @Deprecated public java.util.List<java.lang.Integer> getSupportedPictureFormats();
    method @Deprecated public java.util.List<android.hardware.Camera.Size> getSupportedPictureSizes();
    method @Deprecated public java.util.List<java.lang.Integer> getSupportedPreviewFormats();
    method @Deprecated public java.util.List<int[]> getSupportedPreviewFpsRange();
    method @Deprecated public java.util.List<java.lang.Integer> getSupportedPreviewFrameRates();
    method @Deprecated public java.util.List<android.hardware.Camera.Size> getSupportedPreviewSizes();
    method @Deprecated public java.util.List<java.lang.String> getSupportedSceneModes();
    method @Deprecated public java.util.List<android.hardware.Camera.Size> getSupportedVideoSizes();
    method @Deprecated public java.util.List<java.lang.String> getSupportedWhiteBalance();
    method @Deprecated public float getVerticalViewAngle();
    method @Deprecated public boolean getVideoStabilization();
    method @Deprecated public String getWhiteBalance();
    method @Deprecated public int getZoom();
    method @Deprecated public java.util.List<java.lang.Integer> getZoomRatios();
    method @Deprecated public boolean isAutoExposureLockSupported();
    method @Deprecated public boolean isAutoWhiteBalanceLockSupported();
    method @Deprecated public boolean isSmoothZoomSupported();
    method @Deprecated public boolean isVideoSnapshotSupported();
    method @Deprecated public boolean isVideoStabilizationSupported();
    method @Deprecated public boolean isZoomSupported();
    method @Deprecated public void remove(String);
    method @Deprecated public void removeGpsData();
    method @Deprecated public void set(String, String);
    method @Deprecated public void set(String, int);
    method @Deprecated public void setAntibanding(String);
    method @Deprecated public void setAutoExposureLock(boolean);
    method @Deprecated public void setAutoWhiteBalanceLock(boolean);
    method @Deprecated public void setColorEffect(String);
    method @Deprecated public void setExposureCompensation(int);
    method @Deprecated public void setFlashMode(String);
    method @Deprecated public void setFocusAreas(java.util.List<android.hardware.Camera.Area>);
    method @Deprecated public void setFocusMode(String);
    method @Deprecated public void setGpsAltitude(double);
    method @Deprecated public void setGpsLatitude(double);
    method @Deprecated public void setGpsLongitude(double);
    method @Deprecated public void setGpsProcessingMethod(String);
    method @Deprecated public void setGpsTimestamp(long);
    method @Deprecated public void setJpegQuality(int);
    method @Deprecated public void setJpegThumbnailQuality(int);
    method @Deprecated public void setJpegThumbnailSize(int, int);
    method @Deprecated public void setMeteringAreas(java.util.List<android.hardware.Camera.Area>);
    method @Deprecated public void setPictureFormat(int);
    method @Deprecated public void setPictureSize(int, int);
    method @Deprecated public void setPreviewFormat(int);
    method @Deprecated public void setPreviewFpsRange(int, int);
    method @Deprecated public void setPreviewFrameRate(int);
    method @Deprecated public void setPreviewSize(int, int);
    method @Deprecated public void setRecordingHint(boolean);
    method @Deprecated public void setRotation(int);
    method @Deprecated public void setSceneMode(String);
    method @Deprecated public void setVideoStabilization(boolean);
    method @Deprecated public void setWhiteBalance(String);
    method @Deprecated public void setZoom(int);
    method @Deprecated public void unflatten(String);
    field @Deprecated public static final String ANTIBANDING_50HZ = "50hz";
    field @Deprecated public static final String ANTIBANDING_60HZ = "60hz";
    field @Deprecated public static final String ANTIBANDING_AUTO = "auto";
    field @Deprecated public static final String ANTIBANDING_OFF = "off";
    field @Deprecated public static final String EFFECT_AQUA = "aqua";
    field @Deprecated public static final String EFFECT_BLACKBOARD = "blackboard";
    field @Deprecated public static final String EFFECT_MONO = "mono";
    field @Deprecated public static final String EFFECT_NEGATIVE = "negative";
    field @Deprecated public static final String EFFECT_NONE = "none";
    field @Deprecated public static final String EFFECT_POSTERIZE = "posterize";
    field @Deprecated public static final String EFFECT_SEPIA = "sepia";
    field @Deprecated public static final String EFFECT_SOLARIZE = "solarize";
    field @Deprecated public static final String EFFECT_WHITEBOARD = "whiteboard";
    field @Deprecated public static final String FLASH_MODE_AUTO = "auto";
    field @Deprecated public static final String FLASH_MODE_OFF = "off";
    field @Deprecated public static final String FLASH_MODE_ON = "on";
    field @Deprecated public static final String FLASH_MODE_RED_EYE = "red-eye";
    field @Deprecated public static final String FLASH_MODE_TORCH = "torch";
    field @Deprecated public static final int FOCUS_DISTANCE_FAR_INDEX = 2; // 0x2
    field @Deprecated public static final int FOCUS_DISTANCE_NEAR_INDEX = 0; // 0x0
    field @Deprecated public static final int FOCUS_DISTANCE_OPTIMAL_INDEX = 1; // 0x1
    field @Deprecated public static final String FOCUS_MODE_AUTO = "auto";
    field @Deprecated public static final String FOCUS_MODE_CONTINUOUS_PICTURE = "continuous-picture";
    field @Deprecated public static final String FOCUS_MODE_CONTINUOUS_VIDEO = "continuous-video";
    field @Deprecated public static final String FOCUS_MODE_EDOF = "edof";
    field @Deprecated public static final String FOCUS_MODE_FIXED = "fixed";
    field @Deprecated public static final String FOCUS_MODE_INFINITY = "infinity";
    field @Deprecated public static final String FOCUS_MODE_MACRO = "macro";
    field @Deprecated public static final int PREVIEW_FPS_MAX_INDEX = 1; // 0x1
    field @Deprecated public static final int PREVIEW_FPS_MIN_INDEX = 0; // 0x0
    field @Deprecated public static final String SCENE_MODE_ACTION = "action";
    field @Deprecated public static final String SCENE_MODE_AUTO = "auto";
    field @Deprecated public static final String SCENE_MODE_BARCODE = "barcode";
    field @Deprecated public static final String SCENE_MODE_BEACH = "beach";
    field @Deprecated public static final String SCENE_MODE_CANDLELIGHT = "candlelight";
    field @Deprecated public static final String SCENE_MODE_FIREWORKS = "fireworks";
    field @Deprecated public static final String SCENE_MODE_HDR = "hdr";
    field @Deprecated public static final String SCENE_MODE_LANDSCAPE = "landscape";
    field @Deprecated public static final String SCENE_MODE_NIGHT = "night";
    field @Deprecated public static final String SCENE_MODE_NIGHT_PORTRAIT = "night-portrait";
    field @Deprecated public static final String SCENE_MODE_PARTY = "party";
    field @Deprecated public static final String SCENE_MODE_PORTRAIT = "portrait";
    field @Deprecated public static final String SCENE_MODE_SNOW = "snow";
    field @Deprecated public static final String SCENE_MODE_SPORTS = "sports";
    field @Deprecated public static final String SCENE_MODE_STEADYPHOTO = "steadyphoto";
    field @Deprecated public static final String SCENE_MODE_SUNSET = "sunset";
    field @Deprecated public static final String SCENE_MODE_THEATRE = "theatre";
    field @Deprecated public static final String WHITE_BALANCE_AUTO = "auto";
    field @Deprecated public static final String WHITE_BALANCE_CLOUDY_DAYLIGHT = "cloudy-daylight";
    field @Deprecated public static final String WHITE_BALANCE_DAYLIGHT = "daylight";
    field @Deprecated public static final String WHITE_BALANCE_FLUORESCENT = "fluorescent";
    field @Deprecated public static final String WHITE_BALANCE_INCANDESCENT = "incandescent";
    field @Deprecated public static final String WHITE_BALANCE_SHADE = "shade";
    field @Deprecated public static final String WHITE_BALANCE_TWILIGHT = "twilight";
    field @Deprecated public static final String WHITE_BALANCE_WARM_FLUORESCENT = "warm-fluorescent";
  }

  @Deprecated public static interface Camera.PictureCallback {
    method @Deprecated public void onPictureTaken(byte[], android.hardware.Camera);
  }

  @Deprecated public static interface Camera.PreviewCallback {
    method @Deprecated public void onPreviewFrame(byte[], android.hardware.Camera);
  }

  @Deprecated public static interface Camera.ShutterCallback {
    method @Deprecated public void onShutter();
  }

  @Deprecated public class Camera.Size {
    ctor @Deprecated public Camera.Size(int, int);
    field @Deprecated public int height;
    field @Deprecated public int width;
  }

  public final class ConsumerIrManager {
    method public android.hardware.ConsumerIrManager.CarrierFrequencyRange[] getCarrierFrequencies();
    method public boolean hasIrEmitter();
    method public void transmit(int, int[]);
  }

  public final class ConsumerIrManager.CarrierFrequencyRange {
    ctor public ConsumerIrManager.CarrierFrequencyRange(int, int);
    method public int getMaxFrequency();
    method public int getMinFrequency();
  }

  public class GeomagneticField {
    ctor public GeomagneticField(float, float, float, long);
    method public float getDeclination();
    method public float getFieldStrength();
    method public float getHorizontalStrength();
    method public float getInclination();
    method public float getX();
    method public float getY();
    method public float getZ();
  }

  public final class HardwareBuffer implements java.lang.AutoCloseable android.os.Parcelable {
    method public void close();
    method @NonNull public static android.hardware.HardwareBuffer create(int, int, int, int, long);
    method public int describeContents();
    method public int getFormat();
    method public int getHeight();
    method public int getLayers();
    method public long getUsage();
    method public int getWidth();
    method public boolean isClosed();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int BLOB = 33; // 0x21
    field public static final android.os.Parcelable.Creator<android.hardware.HardwareBuffer> CREATOR;
    field public static final int DS_24UI8 = 50; // 0x32
    field public static final int DS_FP32UI8 = 52; // 0x34
    field public static final int D_16 = 48; // 0x30
    field public static final int D_24 = 49; // 0x31
    field public static final int D_FP32 = 51; // 0x33
    field public static final int RGBA_1010102 = 43; // 0x2b
    field public static final int RGBA_8888 = 1; // 0x1
    field public static final int RGBA_FP16 = 22; // 0x16
    field public static final int RGBX_8888 = 2; // 0x2
    field public static final int RGB_565 = 4; // 0x4
    field public static final int RGB_888 = 3; // 0x3
    field public static final int S_UI8 = 53; // 0x35
    field public static final long USAGE_CPU_READ_OFTEN = 3L; // 0x3L
    field public static final long USAGE_CPU_READ_RARELY = 2L; // 0x2L
    field public static final long USAGE_CPU_WRITE_OFTEN = 48L; // 0x30L
    field public static final long USAGE_CPU_WRITE_RARELY = 32L; // 0x20L
    field public static final long USAGE_GPU_COLOR_OUTPUT = 512L; // 0x200L
    field public static final long USAGE_GPU_CUBE_MAP = 33554432L; // 0x2000000L
    field public static final long USAGE_GPU_DATA_BUFFER = 16777216L; // 0x1000000L
    field public static final long USAGE_GPU_MIPMAP_COMPLETE = 67108864L; // 0x4000000L
    field public static final long USAGE_GPU_SAMPLED_IMAGE = 256L; // 0x100L
    field public static final long USAGE_PROTECTED_CONTENT = 16384L; // 0x4000L
    field public static final long USAGE_SENSOR_DIRECT_DATA = 8388608L; // 0x800000L
    field public static final long USAGE_VIDEO_ENCODE = 65536L; // 0x10000L
  }

  public final class Sensor {
    method public int getFifoMaxEventCount();
    method public int getFifoReservedEventCount();
    method public int getHighestDirectReportRateLevel();
    method public int getId();
    method public int getMaxDelay();
    method public float getMaximumRange();
    method public int getMinDelay();
    method public String getName();
    method public float getPower();
    method public int getReportingMode();
    method public float getResolution();
    method public String getStringType();
    method public int getType();
    method public String getVendor();
    method public int getVersion();
    method public boolean isAdditionalInfoSupported();
    method public boolean isDirectChannelTypeSupported(int);
    method public boolean isDynamicSensor();
    method public boolean isWakeUpSensor();
    field public static final int REPORTING_MODE_CONTINUOUS = 0; // 0x0
    field public static final int REPORTING_MODE_ONE_SHOT = 2; // 0x2
    field public static final int REPORTING_MODE_ON_CHANGE = 1; // 0x1
    field public static final int REPORTING_MODE_SPECIAL_TRIGGER = 3; // 0x3
    field public static final String STRING_TYPE_ACCELEROMETER = "android.sensor.accelerometer";
    field public static final String STRING_TYPE_ACCELEROMETER_UNCALIBRATED = "android.sensor.accelerometer_uncalibrated";
    field public static final String STRING_TYPE_AMBIENT_TEMPERATURE = "android.sensor.ambient_temperature";
    field public static final String STRING_TYPE_GAME_ROTATION_VECTOR = "android.sensor.game_rotation_vector";
    field public static final String STRING_TYPE_GEOMAGNETIC_ROTATION_VECTOR = "android.sensor.geomagnetic_rotation_vector";
    field public static final String STRING_TYPE_GRAVITY = "android.sensor.gravity";
    field public static final String STRING_TYPE_GYROSCOPE = "android.sensor.gyroscope";
    field public static final String STRING_TYPE_GYROSCOPE_UNCALIBRATED = "android.sensor.gyroscope_uncalibrated";
    field public static final String STRING_TYPE_HEART_BEAT = "android.sensor.heart_beat";
    field public static final String STRING_TYPE_HEART_RATE = "android.sensor.heart_rate";
    field public static final String STRING_TYPE_LIGHT = "android.sensor.light";
    field public static final String STRING_TYPE_LINEAR_ACCELERATION = "android.sensor.linear_acceleration";
    field public static final String STRING_TYPE_LOW_LATENCY_OFFBODY_DETECT = "android.sensor.low_latency_offbody_detect";
    field public static final String STRING_TYPE_MAGNETIC_FIELD = "android.sensor.magnetic_field";
    field public static final String STRING_TYPE_MAGNETIC_FIELD_UNCALIBRATED = "android.sensor.magnetic_field_uncalibrated";
    field public static final String STRING_TYPE_MOTION_DETECT = "android.sensor.motion_detect";
    field @Deprecated public static final String STRING_TYPE_ORIENTATION = "android.sensor.orientation";
    field public static final String STRING_TYPE_POSE_6DOF = "android.sensor.pose_6dof";
    field public static final String STRING_TYPE_PRESSURE = "android.sensor.pressure";
    field public static final String STRING_TYPE_PROXIMITY = "android.sensor.proximity";
    field public static final String STRING_TYPE_RELATIVE_HUMIDITY = "android.sensor.relative_humidity";
    field public static final String STRING_TYPE_ROTATION_VECTOR = "android.sensor.rotation_vector";
    field public static final String STRING_TYPE_SIGNIFICANT_MOTION = "android.sensor.significant_motion";
    field public static final String STRING_TYPE_STATIONARY_DETECT = "android.sensor.stationary_detect";
    field public static final String STRING_TYPE_STEP_COUNTER = "android.sensor.step_counter";
    field public static final String STRING_TYPE_STEP_DETECTOR = "android.sensor.step_detector";
    field @Deprecated public static final String STRING_TYPE_TEMPERATURE = "android.sensor.temperature";
    field public static final int TYPE_ACCELEROMETER = 1; // 0x1
    field public static final int TYPE_ACCELEROMETER_UNCALIBRATED = 35; // 0x23
    field public static final int TYPE_ALL = -1; // 0xffffffff
    field public static final int TYPE_AMBIENT_TEMPERATURE = 13; // 0xd
    field public static final int TYPE_DEVICE_PRIVATE_BASE = 65536; // 0x10000
    field public static final int TYPE_GAME_ROTATION_VECTOR = 15; // 0xf
    field public static final int TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20; // 0x14
    field public static final int TYPE_GRAVITY = 9; // 0x9
    field public static final int TYPE_GYROSCOPE = 4; // 0x4
    field public static final int TYPE_GYROSCOPE_UNCALIBRATED = 16; // 0x10
    field public static final int TYPE_HEART_BEAT = 31; // 0x1f
    field public static final int TYPE_HEART_RATE = 21; // 0x15
    field public static final int TYPE_LIGHT = 5; // 0x5
    field public static final int TYPE_LINEAR_ACCELERATION = 10; // 0xa
    field public static final int TYPE_LOW_LATENCY_OFFBODY_DETECT = 34; // 0x22
    field public static final int TYPE_MAGNETIC_FIELD = 2; // 0x2
    field public static final int TYPE_MAGNETIC_FIELD_UNCALIBRATED = 14; // 0xe
    field public static final int TYPE_MOTION_DETECT = 30; // 0x1e
    field @Deprecated public static final int TYPE_ORIENTATION = 3; // 0x3
    field public static final int TYPE_POSE_6DOF = 28; // 0x1c
    field public static final int TYPE_PRESSURE = 6; // 0x6
    field public static final int TYPE_PROXIMITY = 8; // 0x8
    field public static final int TYPE_RELATIVE_HUMIDITY = 12; // 0xc
    field public static final int TYPE_ROTATION_VECTOR = 11; // 0xb
    field public static final int TYPE_SIGNIFICANT_MOTION = 17; // 0x11
    field public static final int TYPE_STATIONARY_DETECT = 29; // 0x1d
    field public static final int TYPE_STEP_COUNTER = 19; // 0x13
    field public static final int TYPE_STEP_DETECTOR = 18; // 0x12
    field @Deprecated public static final int TYPE_TEMPERATURE = 7; // 0x7
  }

  public class SensorAdditionalInfo {
    field public static final int TYPE_FRAME_BEGIN = 0; // 0x0
    field public static final int TYPE_FRAME_END = 1; // 0x1
    field public static final int TYPE_INTERNAL_TEMPERATURE = 65537; // 0x10001
    field public static final int TYPE_SAMPLING = 65540; // 0x10004
    field public static final int TYPE_SENSOR_PLACEMENT = 65539; // 0x10003
    field public static final int TYPE_UNTRACKED_DELAY = 65536; // 0x10000
    field public static final int TYPE_VEC3_CALIBRATION = 65538; // 0x10002
    field public final float[] floatValues;
    field public final int[] intValues;
    field public final android.hardware.Sensor sensor;
    field public final int serial;
    field public final int type;
  }

  public final class SensorDirectChannel implements java.nio.channels.Channel {
    method public void close();
    method public int configure(android.hardware.Sensor, int);
    method public boolean isOpen();
    field public static final int RATE_FAST = 2; // 0x2
    field public static final int RATE_NORMAL = 1; // 0x1
    field public static final int RATE_STOP = 0; // 0x0
    field public static final int RATE_VERY_FAST = 3; // 0x3
    field public static final int TYPE_HARDWARE_BUFFER = 2; // 0x2
    field public static final int TYPE_MEMORY_FILE = 1; // 0x1
  }

  public class SensorEvent {
    field public int accuracy;
    field public android.hardware.Sensor sensor;
    field public long timestamp;
    field public final float[] values;
  }

  public abstract class SensorEventCallback implements android.hardware.SensorEventListener2 {
    ctor public SensorEventCallback();
    method public void onAccuracyChanged(android.hardware.Sensor, int);
    method public void onFlushCompleted(android.hardware.Sensor);
    method public void onSensorAdditionalInfo(android.hardware.SensorAdditionalInfo);
    method public void onSensorChanged(android.hardware.SensorEvent);
  }

  public interface SensorEventListener {
    method public void onAccuracyChanged(android.hardware.Sensor, int);
    method public void onSensorChanged(android.hardware.SensorEvent);
  }

  public interface SensorEventListener2 extends android.hardware.SensorEventListener {
    method public void onFlushCompleted(android.hardware.Sensor);
  }

  @Deprecated public interface SensorListener {
    method @Deprecated public void onAccuracyChanged(int, int);
    method @Deprecated public void onSensorChanged(int, float[]);
  }

  public abstract class SensorManager {
    method public boolean cancelTriggerSensor(android.hardware.TriggerEventListener, android.hardware.Sensor);
    method public android.hardware.SensorDirectChannel createDirectChannel(android.os.MemoryFile);
    method public android.hardware.SensorDirectChannel createDirectChannel(android.hardware.HardwareBuffer);
    method public boolean flush(android.hardware.SensorEventListener);
    method public static float getAltitude(float, float);
    method public static void getAngleChange(float[], float[], float[]);
    method public android.hardware.Sensor getDefaultSensor(int);
    method public android.hardware.Sensor getDefaultSensor(int, boolean);
    method public java.util.List<android.hardware.Sensor> getDynamicSensorList(int);
    method public static float getInclination(float[]);
    method public static float[] getOrientation(float[], float[]);
    method public static void getQuaternionFromVector(float[], float[]);
    method public static boolean getRotationMatrix(float[], float[], float[], float[]);
    method public static void getRotationMatrixFromVector(float[], float[]);
    method public java.util.List<android.hardware.Sensor> getSensorList(int);
    method @Deprecated public int getSensors();
    method public boolean isDynamicSensorDiscoverySupported();
    method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorCallback);
    method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorCallback, android.os.Handler);
    method @Deprecated public boolean registerListener(android.hardware.SensorListener, int);
    method @Deprecated public boolean registerListener(android.hardware.SensorListener, int, int);
    method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int);
    method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int, int);
    method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int, android.os.Handler);
    method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int, int, android.os.Handler);
    method public static boolean remapCoordinateSystem(float[], int, int, float[]);
    method public boolean requestTriggerSensor(android.hardware.TriggerEventListener, android.hardware.Sensor);
    method public void unregisterDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorCallback);
    method @Deprecated public void unregisterListener(android.hardware.SensorListener);
    method @Deprecated public void unregisterListener(android.hardware.SensorListener, int);
    method public void unregisterListener(android.hardware.SensorEventListener, android.hardware.Sensor);
    method public void unregisterListener(android.hardware.SensorEventListener);
    field public static final int AXIS_MINUS_X = 129; // 0x81
    field public static final int AXIS_MINUS_Y = 130; // 0x82
    field public static final int AXIS_MINUS_Z = 131; // 0x83
    field public static final int AXIS_X = 1; // 0x1
    field public static final int AXIS_Y = 2; // 0x2
    field public static final int AXIS_Z = 3; // 0x3
    field @Deprecated public static final int DATA_X = 0; // 0x0
    field @Deprecated public static final int DATA_Y = 1; // 0x1
    field @Deprecated public static final int DATA_Z = 2; // 0x2
    field public static final float GRAVITY_DEATH_STAR_I = 3.5303614E-7f;
    field public static final float GRAVITY_EARTH = 9.80665f;
    field public static final float GRAVITY_JUPITER = 23.12f;
    field public static final float GRAVITY_MARS = 3.71f;
    field public static final float GRAVITY_MERCURY = 3.7f;
    field public static final float GRAVITY_MOON = 1.6f;
    field public static final float GRAVITY_NEPTUNE = 11.0f;
    field public static final float GRAVITY_PLUTO = 0.6f;
    field public static final float GRAVITY_SATURN = 8.96f;
    field public static final float GRAVITY_SUN = 275.0f;
    field public static final float GRAVITY_THE_ISLAND = 4.815162f;
    field public static final float GRAVITY_URANUS = 8.69f;
    field public static final float GRAVITY_VENUS = 8.87f;
    field public static final float LIGHT_CLOUDY = 100.0f;
    field public static final float LIGHT_FULLMOON = 0.25f;
    field public static final float LIGHT_NO_MOON = 0.001f;
    field public static final float LIGHT_OVERCAST = 10000.0f;
    field public static final float LIGHT_SHADE = 20000.0f;
    field public static final float LIGHT_SUNLIGHT = 110000.0f;
    field public static final float LIGHT_SUNLIGHT_MAX = 120000.0f;
    field public static final float LIGHT_SUNRISE = 400.0f;
    field public static final float MAGNETIC_FIELD_EARTH_MAX = 60.0f;
    field public static final float MAGNETIC_FIELD_EARTH_MIN = 30.0f;
    field public static final float PRESSURE_STANDARD_ATMOSPHERE = 1013.25f;
    field @Deprecated public static final int RAW_DATA_INDEX = 3; // 0x3
    field @Deprecated public static final int RAW_DATA_X = 3; // 0x3
    field @Deprecated public static final int RAW_DATA_Y = 4; // 0x4
    field @Deprecated public static final int RAW_DATA_Z = 5; // 0x5
    field @Deprecated public static final int SENSOR_ACCELEROMETER = 2; // 0x2
    field @Deprecated public static final int SENSOR_ALL = 127; // 0x7f
    field public static final int SENSOR_DELAY_FASTEST = 0; // 0x0
    field public static final int SENSOR_DELAY_GAME = 1; // 0x1
    field public static final int SENSOR_DELAY_NORMAL = 3; // 0x3
    field public static final int SENSOR_DELAY_UI = 2; // 0x2
    field @Deprecated public static final int SENSOR_LIGHT = 16; // 0x10
    field @Deprecated public static final int SENSOR_MAGNETIC_FIELD = 8; // 0x8
    field @Deprecated public static final int SENSOR_MAX = 64; // 0x40
    field @Deprecated public static final int SENSOR_MIN = 1; // 0x1
    field @Deprecated public static final int SENSOR_ORIENTATION = 1; // 0x1
    field @Deprecated public static final int SENSOR_ORIENTATION_RAW = 128; // 0x80
    field @Deprecated public static final int SENSOR_PROXIMITY = 32; // 0x20
    field public static final int SENSOR_STATUS_ACCURACY_HIGH = 3; // 0x3
    field public static final int SENSOR_STATUS_ACCURACY_LOW = 1; // 0x1
    field public static final int SENSOR_STATUS_ACCURACY_MEDIUM = 2; // 0x2
    field public static final int SENSOR_STATUS_NO_CONTACT = -1; // 0xffffffff
    field public static final int SENSOR_STATUS_UNRELIABLE = 0; // 0x0
    field @Deprecated public static final int SENSOR_TEMPERATURE = 4; // 0x4
    field @Deprecated public static final int SENSOR_TRICORDER = 64; // 0x40
    field public static final float STANDARD_GRAVITY = 9.80665f;
  }

  public abstract static class SensorManager.DynamicSensorCallback {
    ctor public SensorManager.DynamicSensorCallback();
    method public void onDynamicSensorConnected(android.hardware.Sensor);
    method public void onDynamicSensorDisconnected(android.hardware.Sensor);
  }

  public final class TriggerEvent {
    field public android.hardware.Sensor sensor;
    field public long timestamp;
    field public final float[] values;
  }

  public abstract class TriggerEventListener {
    ctor public TriggerEventListener();
    method public abstract void onTrigger(android.hardware.TriggerEvent);
  }

}

package android.hardware.biometrics {

  public class BiometricPrompt {
    method @RequiresPermission(android.Manifest.permission.USE_BIOMETRIC) public void authenticate(@NonNull android.hardware.biometrics.BiometricPrompt.CryptoObject, @NonNull android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.biometrics.BiometricPrompt.AuthenticationCallback);
    method @RequiresPermission(android.Manifest.permission.USE_BIOMETRIC) public void authenticate(@NonNull android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.biometrics.BiometricPrompt.AuthenticationCallback);
    field public static final int BIOMETRIC_ACQUIRED_GOOD = 0; // 0x0
    field public static final int BIOMETRIC_ACQUIRED_IMAGER_DIRTY = 3; // 0x3
    field public static final int BIOMETRIC_ACQUIRED_INSUFFICIENT = 2; // 0x2
    field public static final int BIOMETRIC_ACQUIRED_PARTIAL = 1; // 0x1
    field public static final int BIOMETRIC_ACQUIRED_TOO_FAST = 5; // 0x5
    field public static final int BIOMETRIC_ACQUIRED_TOO_SLOW = 4; // 0x4
    field public static final int BIOMETRIC_ERROR_CANCELED = 5; // 0x5
    field public static final int BIOMETRIC_ERROR_HW_NOT_PRESENT = 12; // 0xc
    field public static final int BIOMETRIC_ERROR_HW_UNAVAILABLE = 1; // 0x1
    field public static final int BIOMETRIC_ERROR_LOCKOUT = 7; // 0x7
    field public static final int BIOMETRIC_ERROR_LOCKOUT_PERMANENT = 9; // 0x9
    field public static final int BIOMETRIC_ERROR_NO_BIOMETRICS = 11; // 0xb
    field public static final int BIOMETRIC_ERROR_NO_SPACE = 4; // 0x4
    field public static final int BIOMETRIC_ERROR_TIMEOUT = 3; // 0x3
    field public static final int BIOMETRIC_ERROR_UNABLE_TO_PROCESS = 2; // 0x2
    field public static final int BIOMETRIC_ERROR_USER_CANCELED = 10; // 0xa
    field public static final int BIOMETRIC_ERROR_VENDOR = 8; // 0x8
  }

  public abstract static class BiometricPrompt.AuthenticationCallback {
    ctor public BiometricPrompt.AuthenticationCallback();
    method public void onAuthenticationError(int, CharSequence);
    method public void onAuthenticationFailed();
    method public void onAuthenticationHelp(int, CharSequence);
    method public void onAuthenticationSucceeded(android.hardware.biometrics.BiometricPrompt.AuthenticationResult);
  }

  public static class BiometricPrompt.AuthenticationResult {
    method public android.hardware.biometrics.BiometricPrompt.CryptoObject getCryptoObject();
  }

  public static class BiometricPrompt.Builder {
    ctor public BiometricPrompt.Builder(android.content.Context);
    method public android.hardware.biometrics.BiometricPrompt build();
    method public android.hardware.biometrics.BiometricPrompt.Builder setDescription(@NonNull CharSequence);
    method public android.hardware.biometrics.BiometricPrompt.Builder setNegativeButton(@NonNull CharSequence, @NonNull java.util.concurrent.Executor, @NonNull android.content.DialogInterface.OnClickListener);
    method public android.hardware.biometrics.BiometricPrompt.Builder setSubtitle(@NonNull CharSequence);
    method public android.hardware.biometrics.BiometricPrompt.Builder setTitle(@NonNull CharSequence);
  }

  public static final class BiometricPrompt.CryptoObject {
    ctor public BiometricPrompt.CryptoObject(@NonNull java.security.Signature);
    ctor public BiometricPrompt.CryptoObject(@NonNull javax.crypto.Cipher);
    ctor public BiometricPrompt.CryptoObject(@NonNull javax.crypto.Mac);
    method public javax.crypto.Cipher getCipher();
    method public javax.crypto.Mac getMac();
    method public java.security.Signature getSignature();
  }

}

package android.hardware.camera2 {

  public class CameraAccessException extends android.util.AndroidException {
    ctor public CameraAccessException(int);
    ctor public CameraAccessException(int, String);
    ctor public CameraAccessException(int, String, Throwable);
    ctor public CameraAccessException(int, Throwable);
    method public final int getReason();
    field public static final int CAMERA_DISABLED = 1; // 0x1
    field public static final int CAMERA_DISCONNECTED = 2; // 0x2
    field public static final int CAMERA_ERROR = 3; // 0x3
    field public static final int CAMERA_IN_USE = 4; // 0x4
    field public static final int MAX_CAMERAS_IN_USE = 5; // 0x5
  }

  public abstract class CameraCaptureSession implements java.lang.AutoCloseable {
    ctor public CameraCaptureSession();
    method public abstract void abortCaptures() throws android.hardware.camera2.CameraAccessException;
    method public abstract int capture(@NonNull android.hardware.camera2.CaptureRequest, @Nullable android.hardware.camera2.CameraCaptureSession.CaptureCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract int captureBurst(@NonNull java.util.List<android.hardware.camera2.CaptureRequest>, @Nullable android.hardware.camera2.CameraCaptureSession.CaptureCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public int captureBurstRequests(@NonNull java.util.List<android.hardware.camera2.CaptureRequest>, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraCaptureSession.CaptureCallback) throws android.hardware.camera2.CameraAccessException;
    method public int captureSingleRequest(@NonNull android.hardware.camera2.CaptureRequest, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraCaptureSession.CaptureCallback) throws android.hardware.camera2.CameraAccessException;
    method public abstract void close();
    method public abstract void finalizeOutputConfigurations(java.util.List<android.hardware.camera2.params.OutputConfiguration>) throws android.hardware.camera2.CameraAccessException;
    method @NonNull public abstract android.hardware.camera2.CameraDevice getDevice();
    method @Nullable public abstract android.view.Surface getInputSurface();
    method public abstract boolean isReprocessable();
    method public abstract void prepare(@NonNull android.view.Surface) throws android.hardware.camera2.CameraAccessException;
    method public abstract int setRepeatingBurst(@NonNull java.util.List<android.hardware.camera2.CaptureRequest>, @Nullable android.hardware.camera2.CameraCaptureSession.CaptureCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public int setRepeatingBurstRequests(@NonNull java.util.List<android.hardware.camera2.CaptureRequest>, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraCaptureSession.CaptureCallback) throws android.hardware.camera2.CameraAccessException;
    method public abstract int setRepeatingRequest(@NonNull android.hardware.camera2.CaptureRequest, @Nullable android.hardware.camera2.CameraCaptureSession.CaptureCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public int setSingleRepeatingRequest(@NonNull android.hardware.camera2.CaptureRequest, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraCaptureSession.CaptureCallback) throws android.hardware.camera2.CameraAccessException;
    method public abstract void stopRepeating() throws android.hardware.camera2.CameraAccessException;
    method public void updateOutputConfiguration(android.hardware.camera2.params.OutputConfiguration) throws android.hardware.camera2.CameraAccessException;
  }

  public abstract static class CameraCaptureSession.CaptureCallback {
    ctor public CameraCaptureSession.CaptureCallback();
    method public void onCaptureBufferLost(@NonNull android.hardware.camera2.CameraCaptureSession, @NonNull android.hardware.camera2.CaptureRequest, @NonNull android.view.Surface, long);
    method public void onCaptureCompleted(@NonNull android.hardware.camera2.CameraCaptureSession, @NonNull android.hardware.camera2.CaptureRequest, @NonNull android.hardware.camera2.TotalCaptureResult);
    method public void onCaptureFailed(@NonNull android.hardware.camera2.CameraCaptureSession, @NonNull android.hardware.camera2.CaptureRequest, @NonNull android.hardware.camera2.CaptureFailure);
    method public void onCaptureProgressed(@NonNull android.hardware.camera2.CameraCaptureSession, @NonNull android.hardware.camera2.CaptureRequest, @NonNull android.hardware.camera2.CaptureResult);
    method public void onCaptureSequenceAborted(@NonNull android.hardware.camera2.CameraCaptureSession, int);
    method public void onCaptureSequenceCompleted(@NonNull android.hardware.camera2.CameraCaptureSession, int, long);
    method public void onCaptureStarted(@NonNull android.hardware.camera2.CameraCaptureSession, @NonNull android.hardware.camera2.CaptureRequest, long, long);
  }

  public abstract static class CameraCaptureSession.StateCallback {
    ctor public CameraCaptureSession.StateCallback();
    method public void onActive(@NonNull android.hardware.camera2.CameraCaptureSession);
    method public void onCaptureQueueEmpty(@NonNull android.hardware.camera2.CameraCaptureSession);
    method public void onClosed(@NonNull android.hardware.camera2.CameraCaptureSession);
    method public abstract void onConfigureFailed(@NonNull android.hardware.camera2.CameraCaptureSession);
    method public abstract void onConfigured(@NonNull android.hardware.camera2.CameraCaptureSession);
    method public void onReady(@NonNull android.hardware.camera2.CameraCaptureSession);
    method public void onSurfacePrepared(@NonNull android.hardware.camera2.CameraCaptureSession, @NonNull android.view.Surface);
  }

  public final class CameraCharacteristics extends android.hardware.camera2.CameraMetadata<android.hardware.camera2.CameraCharacteristics.Key<?>> {
    method @Nullable public <T> T get(android.hardware.camera2.CameraCharacteristics.Key<T>);
    method @NonNull public java.util.List<android.hardware.camera2.CaptureRequest.Key<?>> getAvailableCaptureRequestKeys();
    method @NonNull public java.util.List<android.hardware.camera2.CaptureResult.Key<?>> getAvailableCaptureResultKeys();
    method public java.util.List<android.hardware.camera2.CaptureRequest.Key<?>> getAvailablePhysicalCameraRequestKeys();
    method public java.util.List<android.hardware.camera2.CaptureRequest.Key<?>> getAvailableSessionKeys();
    method @NonNull public java.util.List<android.hardware.camera2.CameraCharacteristics.Key<?>> getKeys();
    method @NonNull public java.util.Set<java.lang.String> getPhysicalCameraIds();
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AE_AVAILABLE_ANTIBANDING_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AE_AVAILABLE_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Range<java.lang.Integer>[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Range<java.lang.Integer>> CONTROL_AE_COMPENSATION_RANGE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Rational> CONTROL_AE_COMPENSATION_STEP;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Boolean> CONTROL_AE_LOCK_AVAILABLE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AF_AVAILABLE_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_EFFECTS;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_SCENE_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AWB_AVAILABLE_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Boolean> CONTROL_AWB_LOCK_AVAILABLE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> CONTROL_MAX_REGIONS_AE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> CONTROL_MAX_REGIONS_AF;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> CONTROL_MAX_REGIONS_AWB;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Range<java.lang.Integer>> CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Boolean> DEPTH_DEPTH_IS_EXCLUSIVE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> DISTORTION_CORRECTION_AVAILABLE_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> EDGE_AVAILABLE_EDGE_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Boolean> FLASH_INFO_AVAILABLE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> INFO_SUPPORTED_HARDWARE_LEVEL;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.String> INFO_VERSION;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<float[]> LENS_DISTORTION;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> LENS_FACING;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<float[]> LENS_INFO_AVAILABLE_APERTURES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> LENS_INFO_FOCUS_DISTANCE_CALIBRATION;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Float> LENS_INFO_HYPERFOCAL_DISTANCE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<float[]> LENS_INTRINSIC_CALIBRATION;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> LENS_POSE_REFERENCE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<float[]> LENS_POSE_ROTATION;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<float[]> LENS_POSE_TRANSLATION;
    field @Deprecated public static final android.hardware.camera2.CameraCharacteristics.Key<float[]> LENS_RADIAL_DISTORTION;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REPROCESS_MAX_CAPTURE_STALL;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> REQUEST_AVAILABLE_CAPABILITIES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REQUEST_MAX_NUM_INPUT_STREAMS;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REQUEST_MAX_NUM_OUTPUT_PROC;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REQUEST_MAX_NUM_OUTPUT_RAW;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REQUEST_PARTIAL_RESULT_COUNT;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Byte> REQUEST_PIPELINE_MAX_DEPTH;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SCALER_CROPPING_TYPE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> SENSOR_AVAILABLE_TEST_PATTERN_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.BlackLevelPattern> SENSOR_BLACK_LEVEL_PATTERN;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM1;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM2;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM1;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM2;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX1;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX2;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_INFO_COLOR_FILTER_ARRANGEMENT;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Range<java.lang.Long>> SENSOR_INFO_EXPOSURE_TIME_RANGE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Boolean> SENSOR_INFO_LENS_SHADING_APPLIED;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Long> SENSOR_INFO_MAX_FRAME_DURATION;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Range<java.lang.Integer>> SENSOR_INFO_SENSITIVITY_RANGE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_INFO_TIMESTAMP_SOURCE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_INFO_WHITE_LEVEL;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_MAX_ANALOG_SENSITIVITY;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<android.graphics.Rect[]> SENSOR_OPTICAL_BLACK_REGIONS;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_ORIENTATION;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_REFERENCE_ILLUMINANT1;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Byte> SENSOR_REFERENCE_ILLUMINANT2;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> SHADING_AVAILABLE_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<boolean[]> STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> STATISTICS_INFO_MAX_FACE_COUNT;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SYNC_MAX_LATENCY;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> TONEMAP_AVAILABLE_TONE_MAP_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> TONEMAP_MAX_CURVE_POINTS;
  }

  public static final class CameraCharacteristics.Key<T> {
    method @NonNull public String getName();
  }

  public abstract class CameraConstrainedHighSpeedCaptureSession extends android.hardware.camera2.CameraCaptureSession {
    ctor public CameraConstrainedHighSpeedCaptureSession();
    method @NonNull public abstract java.util.List<android.hardware.camera2.CaptureRequest> createHighSpeedRequestList(@NonNull android.hardware.camera2.CaptureRequest) throws android.hardware.camera2.CameraAccessException;
  }

  public abstract class CameraDevice implements java.lang.AutoCloseable {
    method public abstract void close();
    method @NonNull public abstract android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(int) throws android.hardware.camera2.CameraAccessException;
    method @NonNull public android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(int, java.util.Set<java.lang.String>) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createCaptureSession(@NonNull java.util.List<android.view.Surface>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public void createCaptureSession(android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createCaptureSessionByOutputConfigurations(java.util.List<android.hardware.camera2.params.OutputConfiguration>, android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createConstrainedHighSpeedCaptureSession(@NonNull java.util.List<android.view.Surface>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method @NonNull public abstract android.hardware.camera2.CaptureRequest.Builder createReprocessCaptureRequest(@NonNull android.hardware.camera2.TotalCaptureResult) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createReprocessableCaptureSession(@NonNull android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.view.Surface>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createReprocessableCaptureSessionByConfigurations(@NonNull android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method @NonNull public abstract String getId();
    field public static final int TEMPLATE_MANUAL = 6; // 0x6
    field public static final int TEMPLATE_PREVIEW = 1; // 0x1
    field public static final int TEMPLATE_RECORD = 3; // 0x3
    field public static final int TEMPLATE_STILL_CAPTURE = 2; // 0x2
    field public static final int TEMPLATE_VIDEO_SNAPSHOT = 4; // 0x4
    field public static final int TEMPLATE_ZERO_SHUTTER_LAG = 5; // 0x5
  }

  public abstract static class CameraDevice.StateCallback {
    ctor public CameraDevice.StateCallback();
    method public void onClosed(@NonNull android.hardware.camera2.CameraDevice);
    method public abstract void onDisconnected(@NonNull android.hardware.camera2.CameraDevice);
    method public abstract void onError(@NonNull android.hardware.camera2.CameraDevice, int);
    method public abstract void onOpened(@NonNull android.hardware.camera2.CameraDevice);
    field public static final int ERROR_CAMERA_DEVICE = 4; // 0x4
    field public static final int ERROR_CAMERA_DISABLED = 3; // 0x3
    field public static final int ERROR_CAMERA_IN_USE = 1; // 0x1
    field public static final int ERROR_CAMERA_SERVICE = 5; // 0x5
    field public static final int ERROR_MAX_CAMERAS_IN_USE = 2; // 0x2
  }

  public final class CameraManager {
    method @NonNull public android.hardware.camera2.CameraCharacteristics getCameraCharacteristics(@NonNull String) throws android.hardware.camera2.CameraAccessException;
    method @NonNull public String[] getCameraIdList() throws android.hardware.camera2.CameraAccessException;
    method @RequiresPermission(android.Manifest.permission.CAMERA) public void openCamera(@NonNull String, @NonNull android.hardware.camera2.CameraDevice.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method @RequiresPermission(android.Manifest.permission.CAMERA) public void openCamera(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraDevice.StateCallback) throws android.hardware.camera2.CameraAccessException;
    method public void registerAvailabilityCallback(@NonNull android.hardware.camera2.CameraManager.AvailabilityCallback, @Nullable android.os.Handler);
    method public void registerAvailabilityCallback(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraManager.AvailabilityCallback);
    method public void registerTorchCallback(@NonNull android.hardware.camera2.CameraManager.TorchCallback, @Nullable android.os.Handler);
    method public void registerTorchCallback(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraManager.TorchCallback);
    method public void setTorchMode(@NonNull String, boolean) throws android.hardware.camera2.CameraAccessException;
    method public void unregisterAvailabilityCallback(@NonNull android.hardware.camera2.CameraManager.AvailabilityCallback);
    method public void unregisterTorchCallback(@NonNull android.hardware.camera2.CameraManager.TorchCallback);
  }

  public abstract static class CameraManager.AvailabilityCallback {
    ctor public CameraManager.AvailabilityCallback();
    method public void onCameraAvailable(@NonNull String);
    method public void onCameraUnavailable(@NonNull String);
  }

  public abstract static class CameraManager.TorchCallback {
    ctor public CameraManager.TorchCallback();
    method public void onTorchModeChanged(@NonNull String, boolean);
    method public void onTorchModeUnavailable(@NonNull String);
  }

  public abstract class CameraMetadata<TKey> {
    method @NonNull public java.util.List<TKey> getKeys();
    field public static final int COLOR_CORRECTION_ABERRATION_MODE_FAST = 1; // 0x1
    field public static final int COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY = 2; // 0x2
    field public static final int COLOR_CORRECTION_ABERRATION_MODE_OFF = 0; // 0x0
    field public static final int COLOR_CORRECTION_MODE_FAST = 1; // 0x1
    field public static final int COLOR_CORRECTION_MODE_HIGH_QUALITY = 2; // 0x2
    field public static final int COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0; // 0x0
    field public static final int CONTROL_AE_ANTIBANDING_MODE_50HZ = 1; // 0x1
    field public static final int CONTROL_AE_ANTIBANDING_MODE_60HZ = 2; // 0x2
    field public static final int CONTROL_AE_ANTIBANDING_MODE_AUTO = 3; // 0x3
    field public static final int CONTROL_AE_ANTIBANDING_MODE_OFF = 0; // 0x0
    field public static final int CONTROL_AE_MODE_OFF = 0; // 0x0
    field public static final int CONTROL_AE_MODE_ON = 1; // 0x1
    field public static final int CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3; // 0x3
    field public static final int CONTROL_AE_MODE_ON_AUTO_FLASH = 2; // 0x2
    field public static final int CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE = 4; // 0x4
    field public static final int CONTROL_AE_MODE_ON_EXTERNAL_FLASH = 5; // 0x5
    field public static final int CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL = 2; // 0x2
    field public static final int CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0; // 0x0
    field public static final int CONTROL_AE_PRECAPTURE_TRIGGER_START = 1; // 0x1
    field public static final int CONTROL_AE_STATE_CONVERGED = 2; // 0x2
    field public static final int CONTROL_AE_STATE_FLASH_REQUIRED = 4; // 0x4
    field public static final int CONTROL_AE_STATE_INACTIVE = 0; // 0x0
    field public static final int CONTROL_AE_STATE_LOCKED = 3; // 0x3
    field public static final int CONTROL_AE_STATE_PRECAPTURE = 5; // 0x5
    field public static final int CONTROL_AE_STATE_SEARCHING = 1; // 0x1
    field public static final int CONTROL_AF_MODE_AUTO = 1; // 0x1
    field public static final int CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4; // 0x4
    field public static final int CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3; // 0x3
    field public static final int CONTROL_AF_MODE_EDOF = 5; // 0x5
    field public static final int CONTROL_AF_MODE_MACRO = 2; // 0x2
    field public static final int CONTROL_AF_MODE_OFF = 0; // 0x0
    field public static final int CONTROL_AF_SCENE_CHANGE_DETECTED = 1; // 0x1
    field public static final int CONTROL_AF_SCENE_CHANGE_NOT_DETECTED = 0; // 0x0
    field public static final int CONTROL_AF_STATE_ACTIVE_SCAN = 3; // 0x3
    field public static final int CONTROL_AF_STATE_FOCUSED_LOCKED = 4; // 0x4
    field public static final int CONTROL_AF_STATE_INACTIVE = 0; // 0x0
    field public static final int CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5; // 0x5
    field public static final int CONTROL_AF_STATE_PASSIVE_FOCUSED = 2; // 0x2
    field public static final int CONTROL_AF_STATE_PASSIVE_SCAN = 1; // 0x1
    field public static final int CONTROL_AF_STATE_PASSIVE_UNFOCUSED = 6; // 0x6
    field public static final int CONTROL_AF_TRIGGER_CANCEL = 2; // 0x2
    field public static final int CONTROL_AF_TRIGGER_IDLE = 0; // 0x0
    field public static final int CONTROL_AF_TRIGGER_START = 1; // 0x1
    field public static final int CONTROL_AWB_MODE_AUTO = 1; // 0x1
    field public static final int CONTROL_AWB_MODE_CLOUDY_DAYLIGHT = 6; // 0x6
    field public static final int CONTROL_AWB_MODE_DAYLIGHT = 5; // 0x5
    field public static final int CONTROL_AWB_MODE_FLUORESCENT = 3; // 0x3
    field public static final int CONTROL_AWB_MODE_INCANDESCENT = 2; // 0x2
    field public static final int CONTROL_AWB_MODE_OFF = 0; // 0x0
    field public static final int CONTROL_AWB_MODE_SHADE = 8; // 0x8
    field public static final int CONTROL_AWB_MODE_TWILIGHT = 7; // 0x7
    field public static final int CONTROL_AWB_MODE_WARM_FLUORESCENT = 4; // 0x4
    field public static final int CONTROL_AWB_STATE_CONVERGED = 2; // 0x2
    field public static final int CONTROL_AWB_STATE_INACTIVE = 0; // 0x0
    field public static final int CONTROL_AWB_STATE_LOCKED = 3; // 0x3
    field public static final int CONTROL_AWB_STATE_SEARCHING = 1; // 0x1
    field public static final int CONTROL_CAPTURE_INTENT_CUSTOM = 0; // 0x0
    field public static final int CONTROL_CAPTURE_INTENT_MANUAL = 6; // 0x6
    field public static final int CONTROL_CAPTURE_INTENT_MOTION_TRACKING = 7; // 0x7
    field public static final int CONTROL_CAPTURE_INTENT_PREVIEW = 1; // 0x1
    field public static final int CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2; // 0x2
    field public static final int CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3; // 0x3
    field public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4; // 0x4
    field public static final int CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG = 5; // 0x5
    field public static final int CONTROL_EFFECT_MODE_AQUA = 8; // 0x8
    field public static final int CONTROL_EFFECT_MODE_BLACKBOARD = 7; // 0x7
    field public static final int CONTROL_EFFECT_MODE_MONO = 1; // 0x1
    field public static final int CONTROL_EFFECT_MODE_NEGATIVE = 2; // 0x2
    field public static final int CONTROL_EFFECT_MODE_OFF = 0; // 0x0
    field public static final int CONTROL_EFFECT_MODE_POSTERIZE = 5; // 0x5
    field public static final int CONTROL_EFFECT_MODE_SEPIA = 4; // 0x4
    field public static final int CONTROL_EFFECT_MODE_SOLARIZE = 3; // 0x3
    field public static final int CONTROL_EFFECT_MODE_WHITEBOARD = 6; // 0x6
    field public static final int CONTROL_MODE_AUTO = 1; // 0x1
    field public static final int CONTROL_MODE_OFF = 0; // 0x0
    field public static final int CONTROL_MODE_OFF_KEEP_STATE = 3; // 0x3
    field public static final int CONTROL_MODE_USE_SCENE_MODE = 2; // 0x2
    field public static final int CONTROL_SCENE_MODE_ACTION = 2; // 0x2
    field public static final int CONTROL_SCENE_MODE_BARCODE = 16; // 0x10
    field public static final int CONTROL_SCENE_MODE_BEACH = 8; // 0x8
    field public static final int CONTROL_SCENE_MODE_CANDLELIGHT = 15; // 0xf
    field public static final int CONTROL_SCENE_MODE_DISABLED = 0; // 0x0
    field public static final int CONTROL_SCENE_MODE_FACE_PRIORITY = 1; // 0x1
    field public static final int CONTROL_SCENE_MODE_FIREWORKS = 12; // 0xc
    field public static final int CONTROL_SCENE_MODE_HDR = 18; // 0x12
    field @Deprecated public static final int CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO = 17; // 0x11
    field public static final int CONTROL_SCENE_MODE_LANDSCAPE = 4; // 0x4
    field public static final int CONTROL_SCENE_MODE_NIGHT = 5; // 0x5
    field public static final int CONTROL_SCENE_MODE_NIGHT_PORTRAIT = 6; // 0x6
    field public static final int CONTROL_SCENE_MODE_PARTY = 14; // 0xe
    field public static final int CONTROL_SCENE_MODE_PORTRAIT = 3; // 0x3
    field public static final int CONTROL_SCENE_MODE_SNOW = 9; // 0x9
    field public static final int CONTROL_SCENE_MODE_SPORTS = 13; // 0xd
    field public static final int CONTROL_SCENE_MODE_STEADYPHOTO = 11; // 0xb
    field public static final int CONTROL_SCENE_MODE_SUNSET = 10; // 0xa
    field public static final int CONTROL_SCENE_MODE_THEATRE = 7; // 0x7
    field public static final int CONTROL_VIDEO_STABILIZATION_MODE_OFF = 0; // 0x0
    field public static final int CONTROL_VIDEO_STABILIZATION_MODE_ON = 1; // 0x1
    field public static final int DISTORTION_CORRECTION_MODE_FAST = 1; // 0x1
    field public static final int DISTORTION_CORRECTION_MODE_HIGH_QUALITY = 2; // 0x2
    field public static final int DISTORTION_CORRECTION_MODE_OFF = 0; // 0x0
    field public static final int EDGE_MODE_FAST = 1; // 0x1
    field public static final int EDGE_MODE_HIGH_QUALITY = 2; // 0x2
    field public static final int EDGE_MODE_OFF = 0; // 0x0
    field public static final int EDGE_MODE_ZERO_SHUTTER_LAG = 3; // 0x3
    field public static final int FLASH_MODE_OFF = 0; // 0x0
    field public static final int FLASH_MODE_SINGLE = 1; // 0x1
    field public static final int FLASH_MODE_TORCH = 2; // 0x2
    field public static final int FLASH_STATE_CHARGING = 1; // 0x1
    field public static final int FLASH_STATE_FIRED = 3; // 0x3
    field public static final int FLASH_STATE_PARTIAL = 4; // 0x4
    field public static final int FLASH_STATE_READY = 2; // 0x2
    field public static final int FLASH_STATE_UNAVAILABLE = 0; // 0x0
    field public static final int HOT_PIXEL_MODE_FAST = 1; // 0x1
    field public static final int HOT_PIXEL_MODE_HIGH_QUALITY = 2; // 0x2
    field public static final int HOT_PIXEL_MODE_OFF = 0; // 0x0
    field public static final int INFO_SUPPORTED_HARDWARE_LEVEL_3 = 3; // 0x3
    field public static final int INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL = 4; // 0x4
    field public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1; // 0x1
    field public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY = 2; // 0x2
    field public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0; // 0x0
    field public static final int LENS_FACING_BACK = 1; // 0x1
    field public static final int LENS_FACING_EXTERNAL = 2; // 0x2
    field public static final int LENS_FACING_FRONT = 0; // 0x0
    field public static final int LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE = 1; // 0x1
    field public static final int LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED = 2; // 0x2
    field public static final int LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED = 0; // 0x0
    field public static final int LENS_OPTICAL_STABILIZATION_MODE_OFF = 0; // 0x0
    field public static final int LENS_OPTICAL_STABILIZATION_MODE_ON = 1; // 0x1
    field public static final int LENS_POSE_REFERENCE_GYROSCOPE = 1; // 0x1
    field public static final int LENS_POSE_REFERENCE_PRIMARY_CAMERA = 0; // 0x0
    field public static final int LENS_STATE_MOVING = 1; // 0x1
    field public static final int LENS_STATE_STATIONARY = 0; // 0x0
    field public static final int LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE = 0; // 0x0
    field public static final int LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED = 1; // 0x1
    field public static final int NOISE_REDUCTION_MODE_FAST = 1; // 0x1
    field public static final int NOISE_REDUCTION_MODE_HIGH_QUALITY = 2; // 0x2
    field public static final int NOISE_REDUCTION_MODE_MINIMAL = 3; // 0x3
    field public static final int NOISE_REDUCTION_MODE_OFF = 0; // 0x0
    field public static final int NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG = 4; // 0x4
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE = 0; // 0x0
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE = 6; // 0x6
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO = 9; // 0x9
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT = 8; // 0x8
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA = 11; // 0xb
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2; // 0x2
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1; // 0x1
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME = 12; // 0xc
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING = 10; // 0xa
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING = 4; // 0x4
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_RAW = 3; // 0x3
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS = 5; // 0x5
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING = 7; // 0x7
    field public static final int SCALER_CROPPING_TYPE_CENTER_ONLY = 0; // 0x0
    field public static final int SCALER_CROPPING_TYPE_FREEFORM = 1; // 0x1
    field public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR = 3; // 0x3
    field public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG = 2; // 0x2
    field public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG = 1; // 0x1
    field public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB = 4; // 0x4
    field public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB = 0; // 0x0
    field public static final int SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME = 1; // 0x1
    field public static final int SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN = 0; // 0x0
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER = 10; // 0xa
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT = 14; // 0xe
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_D50 = 23; // 0x17
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_D55 = 20; // 0x14
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_D65 = 21; // 0x15
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_D75 = 22; // 0x16
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT = 1; // 0x1
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT = 12; // 0xc
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT = 13; // 0xd
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER = 9; // 0x9
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_FLASH = 4; // 0x4
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT = 2; // 0x2
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN = 24; // 0x18
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_SHADE = 11; // 0xb
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A = 17; // 0x11
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B = 18; // 0x12
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C = 19; // 0x13
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN = 3; // 0x3
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT = 15; // 0xf
    field public static final int SENSOR_TEST_PATTERN_MODE_COLOR_BARS = 2; // 0x2
    field public static final int SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY = 3; // 0x3
    field public static final int SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256; // 0x100
    field public static final int SENSOR_TEST_PATTERN_MODE_OFF = 0; // 0x0
    field public static final int SENSOR_TEST_PATTERN_MODE_PN9 = 4; // 0x4
    field public static final int SENSOR_TEST_PATTERN_MODE_SOLID_COLOR = 1; // 0x1
    field public static final int SHADING_MODE_FAST = 1; // 0x1
    field public static final int SHADING_MODE_HIGH_QUALITY = 2; // 0x2
    field public static final int SHADING_MODE_OFF = 0; // 0x0
    field public static final int STATISTICS_FACE_DETECT_MODE_FULL = 2; // 0x2
    field public static final int STATISTICS_FACE_DETECT_MODE_OFF = 0; // 0x0
    field public static final int STATISTICS_FACE_DETECT_MODE_SIMPLE = 1; // 0x1
    field public static final int STATISTICS_LENS_SHADING_MAP_MODE_OFF = 0; // 0x0
    field public static final int STATISTICS_LENS_SHADING_MAP_MODE_ON = 1; // 0x1
    field public static final int STATISTICS_OIS_DATA_MODE_OFF = 0; // 0x0
    field public static final int STATISTICS_OIS_DATA_MODE_ON = 1; // 0x1
    field public static final int STATISTICS_SCENE_FLICKER_50HZ = 1; // 0x1
    field public static final int STATISTICS_SCENE_FLICKER_60HZ = 2; // 0x2
    field public static final int STATISTICS_SCENE_FLICKER_NONE = 0; // 0x0
    field public static final int SYNC_MAX_LATENCY_PER_FRAME_CONTROL = 0; // 0x0
    field public static final int SYNC_MAX_LATENCY_UNKNOWN = -1; // 0xffffffff
    field public static final int TONEMAP_MODE_CONTRAST_CURVE = 0; // 0x0
    field public static final int TONEMAP_MODE_FAST = 1; // 0x1
    field public static final int TONEMAP_MODE_GAMMA_VALUE = 3; // 0x3
    field public static final int TONEMAP_MODE_HIGH_QUALITY = 2; // 0x2
    field public static final int TONEMAP_MODE_PRESET_CURVE = 4; // 0x4
    field public static final int TONEMAP_PRESET_CURVE_REC709 = 1; // 0x1
    field public static final int TONEMAP_PRESET_CURVE_SRGB = 0; // 0x0
  }

  public class CaptureFailure {
    method public long getFrameNumber();
    method public int getReason();
    method @NonNull public android.hardware.camera2.CaptureRequest getRequest();
    method public int getSequenceId();
    method public boolean wasImageCaptured();
    field public static final int REASON_ERROR = 0; // 0x0
    field public static final int REASON_FLUSHED = 1; // 0x1
  }

  public final class CaptureRequest extends android.hardware.camera2.CameraMetadata<android.hardware.camera2.CaptureRequest.Key<?>> implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public <T> T get(android.hardware.camera2.CaptureRequest.Key<T>);
    method @NonNull public java.util.List<android.hardware.camera2.CaptureRequest.Key<?>> getKeys();
    method @Nullable public Object getTag();
    method public boolean isReprocess();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Boolean> BLACK_LEVEL_LOCK;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> COLOR_CORRECTION_ABERRATION_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> COLOR_CORRECTION_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_AE_ANTIBANDING_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_AE_EXPOSURE_COMPENSATION;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Boolean> CONTROL_AE_LOCK;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_AE_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_AE_PRECAPTURE_TRIGGER;
    field public static final android.hardware.camera2.CaptureRequest.Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS;
    field public static final android.hardware.camera2.CaptureRequest.Key<android.util.Range<java.lang.Integer>> CONTROL_AE_TARGET_FPS_RANGE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_AF_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_AF_TRIGGER;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Boolean> CONTROL_AWB_LOCK;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_AWB_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_CAPTURE_INTENT;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_EFFECT_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Boolean> CONTROL_ENABLE_ZSL;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_SCENE_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_VIDEO_STABILIZATION_MODE;
    field public static final android.os.Parcelable.Creator<android.hardware.camera2.CaptureRequest> CREATOR;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> DISTORTION_CORRECTION_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> EDGE_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> FLASH_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> HOT_PIXEL_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<android.location.Location> JPEG_GPS_LOCATION;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> JPEG_ORIENTATION;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Byte> JPEG_QUALITY;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Byte> JPEG_THUMBNAIL_QUALITY;
    field public static final android.hardware.camera2.CaptureRequest.Key<android.util.Size> JPEG_THUMBNAIL_SIZE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Float> LENS_APERTURE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Float> LENS_FILTER_DENSITY;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Float> LENS_FOCAL_LENGTH;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Float> LENS_FOCUS_DISTANCE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> LENS_OPTICAL_STABILIZATION_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> NOISE_REDUCTION_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR;
    field public static final android.hardware.camera2.CaptureRequest.Key<android.graphics.Rect> SCALER_CROP_REGION;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Long> SENSOR_EXPOSURE_TIME;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Long> SENSOR_FRAME_DURATION;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> SENSOR_SENSITIVITY;
    field public static final android.hardware.camera2.CaptureRequest.Key<int[]> SENSOR_TEST_PATTERN_DATA;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> SENSOR_TEST_PATTERN_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> SHADING_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> STATISTICS_FACE_DETECT_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Boolean> STATISTICS_HOT_PIXEL_MAP_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> STATISTICS_LENS_SHADING_MAP_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> STATISTICS_OIS_DATA_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Float> TONEMAP_GAMMA;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> TONEMAP_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> TONEMAP_PRESET_CURVE;
  }

  public static final class CaptureRequest.Builder {
    method public void addTarget(@NonNull android.view.Surface);
    method @NonNull public android.hardware.camera2.CaptureRequest build();
    method @Nullable public <T> T get(android.hardware.camera2.CaptureRequest.Key<T>);
    method @Nullable public <T> T getPhysicalCameraKey(android.hardware.camera2.CaptureRequest.Key<T>, @NonNull String);
    method public void removeTarget(@NonNull android.view.Surface);
    method public <T> void set(@NonNull android.hardware.camera2.CaptureRequest.Key<T>, T);
    method public <T> android.hardware.camera2.CaptureRequest.Builder setPhysicalCameraKey(@NonNull android.hardware.camera2.CaptureRequest.Key<T>, T, @NonNull String);
    method public void setTag(@Nullable Object);
  }

  public static final class CaptureRequest.Key<T> {
    method @NonNull public String getName();
  }

  public class CaptureResult extends android.hardware.camera2.CameraMetadata<android.hardware.camera2.CaptureResult.Key<?>> {
    method @Nullable public <T> T get(android.hardware.camera2.CaptureResult.Key<T>);
    method public long getFrameNumber();
    method @NonNull public java.util.List<android.hardware.camera2.CaptureResult.Key<?>> getKeys();
    method @NonNull public android.hardware.camera2.CaptureRequest getRequest();
    method public int getSequenceId();
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Boolean> BLACK_LEVEL_LOCK;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> COLOR_CORRECTION_ABERRATION_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> COLOR_CORRECTION_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AE_ANTIBANDING_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AE_EXPOSURE_COMPENSATION;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Boolean> CONTROL_AE_LOCK;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AE_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AE_PRECAPTURE_TRIGGER;
    field public static final android.hardware.camera2.CaptureResult.Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AE_STATE;
    field public static final android.hardware.camera2.CaptureResult.Key<android.util.Range<java.lang.Integer>> CONTROL_AE_TARGET_FPS_RANGE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AF_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AF_SCENE_CHANGE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AF_STATE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AF_TRIGGER;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Boolean> CONTROL_AWB_LOCK;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AWB_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AWB_STATE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_CAPTURE_INTENT;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_EFFECT_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Boolean> CONTROL_ENABLE_ZSL;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_SCENE_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_VIDEO_STABILIZATION_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> DISTORTION_CORRECTION_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> EDGE_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> FLASH_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> FLASH_STATE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> HOT_PIXEL_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<android.location.Location> JPEG_GPS_LOCATION;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> JPEG_ORIENTATION;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Byte> JPEG_QUALITY;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Byte> JPEG_THUMBNAIL_QUALITY;
    field public static final android.hardware.camera2.CaptureResult.Key<android.util.Size> JPEG_THUMBNAIL_SIZE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Float> LENS_APERTURE;
    field public static final android.hardware.camera2.CaptureResult.Key<float[]> LENS_DISTORTION;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Float> LENS_FILTER_DENSITY;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Float> LENS_FOCAL_LENGTH;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Float> LENS_FOCUS_DISTANCE;
    field public static final android.hardware.camera2.CaptureResult.Key<android.util.Pair<java.lang.Float,java.lang.Float>> LENS_FOCUS_RANGE;
    field public static final android.hardware.camera2.CaptureResult.Key<float[]> LENS_INTRINSIC_CALIBRATION;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> LENS_OPTICAL_STABILIZATION_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<float[]> LENS_POSE_ROTATION;
    field public static final android.hardware.camera2.CaptureResult.Key<float[]> LENS_POSE_TRANSLATION;
    field @Deprecated public static final android.hardware.camera2.CaptureResult.Key<float[]> LENS_RADIAL_DISTORTION;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> LENS_STATE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> NOISE_REDUCTION_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Byte> REQUEST_PIPELINE_DEPTH;
    field public static final android.hardware.camera2.CaptureResult.Key<android.graphics.Rect> SCALER_CROP_REGION;
    field public static final android.hardware.camera2.CaptureResult.Key<float[]> SENSOR_DYNAMIC_BLACK_LEVEL;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> SENSOR_DYNAMIC_WHITE_LEVEL;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Long> SENSOR_EXPOSURE_TIME;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Long> SENSOR_FRAME_DURATION;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Float> SENSOR_GREEN_SPLIT;
    field public static final android.hardware.camera2.CaptureResult.Key<android.util.Rational[]> SENSOR_NEUTRAL_COLOR_POINT;
    field public static final android.hardware.camera2.CaptureResult.Key<android.util.Pair<java.lang.Double,java.lang.Double>[]> SENSOR_NOISE_PROFILE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Long> SENSOR_ROLLING_SHUTTER_SKEW;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> SENSOR_SENSITIVITY;
    field public static final android.hardware.camera2.CaptureResult.Key<int[]> SENSOR_TEST_PATTERN_DATA;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> SENSOR_TEST_PATTERN_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Long> SENSOR_TIMESTAMP;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> SHADING_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> STATISTICS_FACE_DETECT_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Boolean> STATISTICS_HOT_PIXEL_MAP_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> STATISTICS_LENS_SHADING_MAP_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> STATISTICS_OIS_DATA_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<android.hardware.camera2.params.OisSample[]> STATISTICS_OIS_SAMPLES;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> STATISTICS_SCENE_FLICKER;
    field public static final android.hardware.camera2.CaptureResult.Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Float> TONEMAP_GAMMA;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> TONEMAP_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> TONEMAP_PRESET_CURVE;
  }

  public static final class CaptureResult.Key<T> {
    method @NonNull public String getName();
  }

  public final class DngCreator implements java.lang.AutoCloseable {
    ctor public DngCreator(@NonNull android.hardware.camera2.CameraCharacteristics, @NonNull android.hardware.camera2.CaptureResult);
    method public void close();
    method @NonNull public android.hardware.camera2.DngCreator setDescription(@NonNull String);
    method @NonNull public android.hardware.camera2.DngCreator setLocation(@NonNull android.location.Location);
    method @NonNull public android.hardware.camera2.DngCreator setOrientation(int);
    method @NonNull public android.hardware.camera2.DngCreator setThumbnail(@NonNull android.graphics.Bitmap);
    method @NonNull public android.hardware.camera2.DngCreator setThumbnail(@NonNull android.media.Image);
    method public void writeByteBuffer(@NonNull java.io.OutputStream, @NonNull android.util.Size, @NonNull java.nio.ByteBuffer, @IntRange(from=0) long) throws java.io.IOException;
    method public void writeImage(@NonNull java.io.OutputStream, @NonNull android.media.Image) throws java.io.IOException;
    method public void writeInputStream(@NonNull java.io.OutputStream, @NonNull android.util.Size, @NonNull java.io.InputStream, @IntRange(from=0) long) throws java.io.IOException;
    field public static final int MAX_THUMBNAIL_DIMENSION = 256; // 0x100
  }

  public final class TotalCaptureResult extends android.hardware.camera2.CaptureResult {
    method @NonNull public java.util.List<android.hardware.camera2.CaptureResult> getPartialResults();
    method public java.util.Map<java.lang.String,android.hardware.camera2.CaptureResult> getPhysicalCameraResults();
  }

}

package android.hardware.camera2.params {

  public final class BlackLevelPattern {
    method public void copyTo(int[], int);
    method public int getOffsetForIndex(int, int);
    field public static final int COUNT = 4; // 0x4
  }

  public final class ColorSpaceTransform {
    ctor public ColorSpaceTransform(android.util.Rational[]);
    ctor public ColorSpaceTransform(int[]);
    method public void copyElements(android.util.Rational[], int);
    method public void copyElements(int[], int);
    method public android.util.Rational getElement(int, int);
  }

  public final class Face {
    method public android.graphics.Rect getBounds();
    method public int getId();
    method public android.graphics.Point getLeftEyePosition();
    method public android.graphics.Point getMouthPosition();
    method public android.graphics.Point getRightEyePosition();
    method public int getScore();
    field public static final int ID_UNSUPPORTED = -1; // 0xffffffff
    field public static final int SCORE_MAX = 100; // 0x64
    field public static final int SCORE_MIN = 1; // 0x1
  }

  public final class InputConfiguration {
    ctor public InputConfiguration(int, int, int);
    method public int getFormat();
    method public int getHeight();
    method public int getWidth();
  }

  public final class LensShadingMap {
    method public void copyGainFactors(float[], int);
    method public int getColumnCount();
    method public float getGainFactor(int, int, int);
    method public int getGainFactorCount();
    method public android.hardware.camera2.params.RggbChannelVector getGainFactorVector(int, int);
    method public int getRowCount();
    field public static final float MINIMUM_GAIN_FACTOR = 1.0f;
  }

  public final class MeteringRectangle {
    ctor public MeteringRectangle(int, int, int, int, int);
    ctor public MeteringRectangle(android.graphics.Point, android.util.Size, int);
    ctor public MeteringRectangle(android.graphics.Rect, int);
    method public boolean equals(android.hardware.camera2.params.MeteringRectangle);
    method public int getHeight();
    method public int getMeteringWeight();
    method public android.graphics.Rect getRect();
    method public android.util.Size getSize();
    method public android.graphics.Point getUpperLeftPoint();
    method public int getWidth();
    method public int getX();
    method public int getY();
    field public static final int METERING_WEIGHT_DONT_CARE = 0; // 0x0
    field public static final int METERING_WEIGHT_MAX = 1000; // 0x3e8
    field public static final int METERING_WEIGHT_MIN = 0; // 0x0
  }

  public final class OisSample {
    ctor public OisSample(long, float, float);
    method public long getTimestamp();
    method public float getXshift();
    method public float getYshift();
  }

  public final class OutputConfiguration implements android.os.Parcelable {
    ctor public OutputConfiguration(@NonNull android.view.Surface);
    ctor public OutputConfiguration(int, @NonNull android.view.Surface);
    ctor public OutputConfiguration(@NonNull android.util.Size, @NonNull Class<T>);
    method public void addSurface(@NonNull android.view.Surface);
    method public int describeContents();
    method public void enableSurfaceSharing();
    method public int getMaxSharedSurfaceCount();
    method @Nullable public android.view.Surface getSurface();
    method public int getSurfaceGroupId();
    method @NonNull public java.util.List<android.view.Surface> getSurfaces();
    method public void removeSurface(@NonNull android.view.Surface);
    method public void setPhysicalCameraId(@Nullable String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.camera2.params.OutputConfiguration> CREATOR;
    field public static final int SURFACE_GROUP_ID_NONE = -1; // 0xffffffff
  }

  public final class RggbChannelVector {
    ctor public RggbChannelVector(float, float, float, float);
    method public void copyTo(float[], int);
    method public float getBlue();
    method public float getComponent(int);
    method public float getGreenEven();
    method public float getGreenOdd();
    method public float getRed();
    field public static final int BLUE = 3; // 0x3
    field public static final int COUNT = 4; // 0x4
    field public static final int GREEN_EVEN = 1; // 0x1
    field public static final int GREEN_ODD = 2; // 0x2
    field public static final int RED = 0; // 0x0
  }

  public final class SessionConfiguration {
    ctor public SessionConfiguration(int, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback);
    method public java.util.concurrent.Executor getExecutor();
    method public android.hardware.camera2.params.InputConfiguration getInputConfiguration();
    method public java.util.List<android.hardware.camera2.params.OutputConfiguration> getOutputConfigurations();
    method public android.hardware.camera2.CaptureRequest getSessionParameters();
    method public int getSessionType();
    method public android.hardware.camera2.CameraCaptureSession.StateCallback getStateCallback();
    method public void setInputConfiguration(@NonNull android.hardware.camera2.params.InputConfiguration);
    method public void setSessionParameters(android.hardware.camera2.CaptureRequest);
    field public static final int SESSION_HIGH_SPEED = 1; // 0x1
    field public static final int SESSION_REGULAR = 0; // 0x0
  }

  public final class StreamConfigurationMap {
    method public android.util.Size[] getHighResolutionOutputSizes(int);
    method public android.util.Range<java.lang.Integer>[] getHighSpeedVideoFpsRanges();
    method public android.util.Range<java.lang.Integer>[] getHighSpeedVideoFpsRangesFor(android.util.Size);
    method public android.util.Size[] getHighSpeedVideoSizes();
    method public android.util.Size[] getHighSpeedVideoSizesFor(android.util.Range<java.lang.Integer>);
    method public int[] getInputFormats();
    method public android.util.Size[] getInputSizes(int);
    method public int[] getOutputFormats();
    method public long getOutputMinFrameDuration(int, android.util.Size);
    method public <T> long getOutputMinFrameDuration(Class<T>, android.util.Size);
    method public <T> android.util.Size[] getOutputSizes(Class<T>);
    method public android.util.Size[] getOutputSizes(int);
    method public long getOutputStallDuration(int, android.util.Size);
    method public <T> long getOutputStallDuration(Class<T>, android.util.Size);
    method public int[] getValidOutputFormatsForInput(int);
    method public boolean isOutputSupportedFor(int);
    method public static <T> boolean isOutputSupportedFor(Class<T>);
    method public boolean isOutputSupportedFor(android.view.Surface);
  }

  public final class TonemapCurve {
    ctor public TonemapCurve(float[], float[], float[]);
    method public void copyColorCurve(int, float[], int);
    method public android.graphics.PointF getPoint(int, int);
    method public int getPointCount(int);
    field public static final int CHANNEL_BLUE = 2; // 0x2
    field public static final int CHANNEL_GREEN = 1; // 0x1
    field public static final int CHANNEL_RED = 0; // 0x0
    field public static final float LEVEL_BLACK = 0.0f;
    field public static final float LEVEL_WHITE = 1.0f;
    field public static final int POINT_SIZE = 2; // 0x2
  }

}

package android.hardware.display {

  public final class DisplayManager {
    method public android.hardware.display.VirtualDisplay createVirtualDisplay(@NonNull String, int, int, int, @Nullable android.view.Surface, int);
    method public android.hardware.display.VirtualDisplay createVirtualDisplay(@NonNull String, int, int, int, @Nullable android.view.Surface, int, @Nullable android.hardware.display.VirtualDisplay.Callback, @Nullable android.os.Handler);
    method public android.view.Display getDisplay(int);
    method public android.view.Display[] getDisplays();
    method public android.view.Display[] getDisplays(String);
    method public void registerDisplayListener(android.hardware.display.DisplayManager.DisplayListener, android.os.Handler);
    method public void unregisterDisplayListener(android.hardware.display.DisplayManager.DisplayListener);
    field public static final String DISPLAY_CATEGORY_PRESENTATION = "android.hardware.display.category.PRESENTATION";
    field public static final int VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR = 16; // 0x10
    field public static final int VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY = 8; // 0x8
    field public static final int VIRTUAL_DISPLAY_FLAG_PRESENTATION = 2; // 0x2
    field public static final int VIRTUAL_DISPLAY_FLAG_PUBLIC = 1; // 0x1
    field public static final int VIRTUAL_DISPLAY_FLAG_SECURE = 4; // 0x4
  }

  public static interface DisplayManager.DisplayListener {
    method public void onDisplayAdded(int);
    method public void onDisplayChanged(int);
    method public void onDisplayRemoved(int);
  }

  public final class VirtualDisplay {
    method public android.view.Display getDisplay();
    method public android.view.Surface getSurface();
    method public void release();
    method public void resize(int, int, int);
    method public void setSurface(android.view.Surface);
  }

  public abstract static class VirtualDisplay.Callback {
    ctor public VirtualDisplay.Callback();
    method public void onPaused();
    method public void onResumed();
    method public void onStopped();
  }

}

package android.hardware.fingerprint {

  @Deprecated public class FingerprintManager {
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.USE_BIOMETRIC, android.Manifest.permission.USE_FINGERPRINT}) public void authenticate(@Nullable android.hardware.fingerprint.FingerprintManager.CryptoObject, @Nullable android.os.CancellationSignal, int, @NonNull android.hardware.fingerprint.FingerprintManager.AuthenticationCallback, @Nullable android.os.Handler);
    method @Deprecated @RequiresPermission(android.Manifest.permission.USE_FINGERPRINT) public boolean hasEnrolledFingerprints();
    method @Deprecated @RequiresPermission(android.Manifest.permission.USE_FINGERPRINT) public boolean isHardwareDetected();
    field public static final int FINGERPRINT_ACQUIRED_GOOD = 0; // 0x0
    field public static final int FINGERPRINT_ACQUIRED_IMAGER_DIRTY = 3; // 0x3
    field public static final int FINGERPRINT_ACQUIRED_INSUFFICIENT = 2; // 0x2
    field public static final int FINGERPRINT_ACQUIRED_PARTIAL = 1; // 0x1
    field public static final int FINGERPRINT_ACQUIRED_TOO_FAST = 5; // 0x5
    field public static final int FINGERPRINT_ACQUIRED_TOO_SLOW = 4; // 0x4
    field public static final int FINGERPRINT_ERROR_CANCELED = 5; // 0x5
    field public static final int FINGERPRINT_ERROR_HW_NOT_PRESENT = 12; // 0xc
    field public static final int FINGERPRINT_ERROR_HW_UNAVAILABLE = 1; // 0x1
    field public static final int FINGERPRINT_ERROR_LOCKOUT = 7; // 0x7
    field public static final int FINGERPRINT_ERROR_LOCKOUT_PERMANENT = 9; // 0x9
    field public static final int FINGERPRINT_ERROR_NO_FINGERPRINTS = 11; // 0xb
    field public static final int FINGERPRINT_ERROR_NO_SPACE = 4; // 0x4
    field public static final int FINGERPRINT_ERROR_TIMEOUT = 3; // 0x3
    field public static final int FINGERPRINT_ERROR_UNABLE_TO_PROCESS = 2; // 0x2
    field public static final int FINGERPRINT_ERROR_USER_CANCELED = 10; // 0xa
    field public static final int FINGERPRINT_ERROR_VENDOR = 8; // 0x8
  }

  @Deprecated public abstract static class FingerprintManager.AuthenticationCallback {
    ctor @Deprecated public FingerprintManager.AuthenticationCallback();
    method @Deprecated public void onAuthenticationError(int, CharSequence);
    method @Deprecated public void onAuthenticationFailed();
    method @Deprecated public void onAuthenticationHelp(int, CharSequence);
    method @Deprecated public void onAuthenticationSucceeded(android.hardware.fingerprint.FingerprintManager.AuthenticationResult);
  }

  @Deprecated public static class FingerprintManager.AuthenticationResult {
    method @Deprecated public android.hardware.fingerprint.FingerprintManager.CryptoObject getCryptoObject();
  }

  @Deprecated public static final class FingerprintManager.CryptoObject {
    ctor @Deprecated public FingerprintManager.CryptoObject(@NonNull java.security.Signature);
    ctor @Deprecated public FingerprintManager.CryptoObject(@NonNull javax.crypto.Cipher);
    ctor @Deprecated public FingerprintManager.CryptoObject(@NonNull javax.crypto.Mac);
    method @Deprecated public javax.crypto.Cipher getCipher();
    method @Deprecated public javax.crypto.Mac getMac();
    method @Deprecated public java.security.Signature getSignature();
  }

}

package android.hardware.input {

  public final class InputManager {
    method public android.view.InputDevice getInputDevice(int);
    method public int[] getInputDeviceIds();
    method public void registerInputDeviceListener(android.hardware.input.InputManager.InputDeviceListener, android.os.Handler);
    method public void unregisterInputDeviceListener(android.hardware.input.InputManager.InputDeviceListener);
    field public static final String ACTION_QUERY_KEYBOARD_LAYOUTS = "android.hardware.input.action.QUERY_KEYBOARD_LAYOUTS";
    field public static final String META_DATA_KEYBOARD_LAYOUTS = "android.hardware.input.metadata.KEYBOARD_LAYOUTS";
  }

  public static interface InputManager.InputDeviceListener {
    method public void onInputDeviceAdded(int);
    method public void onInputDeviceChanged(int);
    method public void onInputDeviceRemoved(int);
  }

}

package android.hardware.usb {

  public class UsbAccessory implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getDescription();
    method @NonNull public String getManufacturer();
    method @NonNull public String getModel();
    method @Nullable public String getSerial();
    method @Nullable public String getUri();
    method @Nullable public String getVersion();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.usb.UsbAccessory> CREATOR;
  }

  public class UsbConfiguration implements android.os.Parcelable {
    method public int describeContents();
    method public int getId();
    method @NonNull public android.hardware.usb.UsbInterface getInterface(int);
    method public int getInterfaceCount();
    method public int getMaxPower();
    method @Nullable public String getName();
    method public boolean isRemoteWakeup();
    method public boolean isSelfPowered();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.usb.UsbConfiguration> CREATOR;
  }

  public final class UsbConstants {
    ctor public UsbConstants();
    field public static final int USB_CLASS_APP_SPEC = 254; // 0xfe
    field public static final int USB_CLASS_AUDIO = 1; // 0x1
    field public static final int USB_CLASS_CDC_DATA = 10; // 0xa
    field public static final int USB_CLASS_COMM = 2; // 0x2
    field public static final int USB_CLASS_CONTENT_SEC = 13; // 0xd
    field public static final int USB_CLASS_CSCID = 11; // 0xb
    field public static final int USB_CLASS_HID = 3; // 0x3
    field public static final int USB_CLASS_HUB = 9; // 0x9
    field public static final int USB_CLASS_MASS_STORAGE = 8; // 0x8
    field public static final int USB_CLASS_MISC = 239; // 0xef
    field public static final int USB_CLASS_PER_INTERFACE = 0; // 0x0
    field public static final int USB_CLASS_PHYSICA = 5; // 0x5
    field public static final int USB_CLASS_PRINTER = 7; // 0x7
    field public static final int USB_CLASS_STILL_IMAGE = 6; // 0x6
    field public static final int USB_CLASS_VENDOR_SPEC = 255; // 0xff
    field public static final int USB_CLASS_VIDEO = 14; // 0xe
    field public static final int USB_CLASS_WIRELESS_CONTROLLER = 224; // 0xe0
    field public static final int USB_DIR_IN = 128; // 0x80
    field public static final int USB_DIR_OUT = 0; // 0x0
    field public static final int USB_ENDPOINT_DIR_MASK = 128; // 0x80
    field public static final int USB_ENDPOINT_NUMBER_MASK = 15; // 0xf
    field public static final int USB_ENDPOINT_XFERTYPE_MASK = 3; // 0x3
    field public static final int USB_ENDPOINT_XFER_BULK = 2; // 0x2
    field public static final int USB_ENDPOINT_XFER_CONTROL = 0; // 0x0
    field public static final int USB_ENDPOINT_XFER_INT = 3; // 0x3
    field public static final int USB_ENDPOINT_XFER_ISOC = 1; // 0x1
    field public static final int USB_INTERFACE_SUBCLASS_BOOT = 1; // 0x1
    field public static final int USB_SUBCLASS_VENDOR_SPEC = 255; // 0xff
    field public static final int USB_TYPE_CLASS = 32; // 0x20
    field public static final int USB_TYPE_MASK = 96; // 0x60
    field public static final int USB_TYPE_RESERVED = 96; // 0x60
    field public static final int USB_TYPE_STANDARD = 0; // 0x0
    field public static final int USB_TYPE_VENDOR = 64; // 0x40
  }

  public class UsbDevice implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.hardware.usb.UsbConfiguration getConfiguration(int);
    method public int getConfigurationCount();
    method public int getDeviceClass();
    method public int getDeviceId();
    method public static int getDeviceId(String);
    method @NonNull public String getDeviceName();
    method public static String getDeviceName(int);
    method public int getDeviceProtocol();
    method public int getDeviceSubclass();
    method @NonNull public android.hardware.usb.UsbInterface getInterface(int);
    method public int getInterfaceCount();
    method @Nullable public String getManufacturerName();
    method public int getProductId();
    method @Nullable public String getProductName();
    method @Nullable public String getSerialNumber();
    method public int getVendorId();
    method @NonNull public String getVersion();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.usb.UsbDevice> CREATOR;
  }

  public class UsbDeviceConnection {
    method public int bulkTransfer(android.hardware.usb.UsbEndpoint, byte[], int, int);
    method public int bulkTransfer(android.hardware.usb.UsbEndpoint, byte[], int, int, int);
    method public boolean claimInterface(android.hardware.usb.UsbInterface, boolean);
    method public void close();
    method public int controlTransfer(int, int, int, int, byte[], int, int);
    method public int controlTransfer(int, int, int, int, byte[], int, int, int);
    method public int getFileDescriptor();
    method public byte[] getRawDescriptors();
    method public String getSerial();
    method public boolean releaseInterface(android.hardware.usb.UsbInterface);
    method public android.hardware.usb.UsbRequest requestWait();
    method public android.hardware.usb.UsbRequest requestWait(long) throws java.util.concurrent.TimeoutException;
    method public boolean setConfiguration(android.hardware.usb.UsbConfiguration);
    method public boolean setInterface(android.hardware.usb.UsbInterface);
  }

  public class UsbEndpoint implements android.os.Parcelable {
    method public int describeContents();
    method public int getAddress();
    method public int getAttributes();
    method public int getDirection();
    method public int getEndpointNumber();
    method public int getInterval();
    method public int getMaxPacketSize();
    method public int getType();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.usb.UsbEndpoint> CREATOR;
  }

  public class UsbInterface implements android.os.Parcelable {
    method public int describeContents();
    method public int getAlternateSetting();
    method public android.hardware.usb.UsbEndpoint getEndpoint(int);
    method public int getEndpointCount();
    method public int getId();
    method public int getInterfaceClass();
    method public int getInterfaceProtocol();
    method public int getInterfaceSubclass();
    method @Nullable public String getName();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.usb.UsbInterface> CREATOR;
  }

  public class UsbManager {
    method public android.hardware.usb.UsbAccessory[] getAccessoryList();
    method public java.util.HashMap<java.lang.String,android.hardware.usb.UsbDevice> getDeviceList();
    method public boolean hasPermission(android.hardware.usb.UsbDevice);
    method public boolean hasPermission(android.hardware.usb.UsbAccessory);
    method public android.os.ParcelFileDescriptor openAccessory(android.hardware.usb.UsbAccessory);
    method public android.hardware.usb.UsbDeviceConnection openDevice(android.hardware.usb.UsbDevice);
    method public void requestPermission(android.hardware.usb.UsbDevice, android.app.PendingIntent);
    method public void requestPermission(android.hardware.usb.UsbAccessory, android.app.PendingIntent);
    field public static final String ACTION_USB_ACCESSORY_ATTACHED = "android.hardware.usb.action.USB_ACCESSORY_ATTACHED";
    field public static final String ACTION_USB_ACCESSORY_DETACHED = "android.hardware.usb.action.USB_ACCESSORY_DETACHED";
    field public static final String ACTION_USB_DEVICE_ATTACHED = "android.hardware.usb.action.USB_DEVICE_ATTACHED";
    field public static final String ACTION_USB_DEVICE_DETACHED = "android.hardware.usb.action.USB_DEVICE_DETACHED";
    field public static final String EXTRA_ACCESSORY = "accessory";
    field public static final String EXTRA_DEVICE = "device";
    field public static final String EXTRA_PERMISSION_GRANTED = "permission";
  }

  public class UsbRequest {
    ctor public UsbRequest();
    method public boolean cancel();
    method public void close();
    method public Object getClientData();
    method public android.hardware.usb.UsbEndpoint getEndpoint();
    method public boolean initialize(android.hardware.usb.UsbDeviceConnection, android.hardware.usb.UsbEndpoint);
    method @Deprecated public boolean queue(java.nio.ByteBuffer, int);
    method public boolean queue(@Nullable java.nio.ByteBuffer);
    method public void setClientData(Object);
  }

}

package android.icu.lang {

  public final class UCharacter implements android.icu.lang.UCharacterEnums.ECharacterCategory android.icu.lang.UCharacterEnums.ECharacterDirection {
    method public static int charCount(int);
    method public static int codePointAt(CharSequence, int);
    method public static int codePointAt(char[], int);
    method public static int codePointAt(char[], int, int);
    method public static int codePointBefore(CharSequence, int);
    method public static int codePointBefore(char[], int);
    method public static int codePointBefore(char[], int, int);
    method public static int codePointCount(CharSequence, int, int);
    method public static int codePointCount(char[], int, int);
    method public static int digit(int, int);
    method public static int digit(int);
    method public static int foldCase(int, boolean);
    method public static String foldCase(String, boolean);
    method public static int foldCase(int, int);
    method public static String foldCase(String, int);
    method public static char forDigit(int, int);
    method public static android.icu.util.VersionInfo getAge(int);
    method public static int getBidiPairedBracket(int);
    method public static int getCharFromExtendedName(String);
    method public static int getCharFromName(String);
    method public static int getCharFromNameAlias(String);
    method public static int getCodePoint(char, char);
    method public static int getCodePoint(char);
    method public static int getCombiningClass(int);
    method public static int getDirection(int);
    method public static byte getDirectionality(int);
    method public static String getExtendedName(int);
    method public static android.icu.util.ValueIterator getExtendedNameIterator();
    method public static int getHanNumericValue(int);
    method public static int getIntPropertyMaxValue(int);
    method public static int getIntPropertyMinValue(int);
    method public static int getIntPropertyValue(int, int);
    method public static int getMirror(int);
    method public static String getName(int);
    method public static String getName(String, String);
    method public static String getNameAlias(int);
    method public static android.icu.util.ValueIterator getNameIterator();
    method public static int getNumericValue(int);
    method public static int getPropertyEnum(CharSequence);
    method public static String getPropertyName(int, int);
    method public static int getPropertyValueEnum(int, CharSequence);
    method public static String getPropertyValueName(int, int, int);
    method public static int getType(int);
    method public static android.icu.util.RangeValueIterator getTypeIterator();
    method public static double getUnicodeNumericValue(int);
    method public static android.icu.util.VersionInfo getUnicodeVersion();
    method public static boolean hasBinaryProperty(int, int);
    method public static boolean isBMP(int);
    method public static boolean isBaseForm(int);
    method public static boolean isDefined(int);
    method public static boolean isDigit(int);
    method public static boolean isHighSurrogate(char);
    method public static boolean isISOControl(int);
    method public static boolean isIdentifierIgnorable(int);
    method public static boolean isJavaIdentifierPart(int);
    method public static boolean isJavaIdentifierStart(int);
    method public static boolean isLegal(int);
    method public static boolean isLegal(String);
    method public static boolean isLetter(int);
    method public static boolean isLetterOrDigit(int);
    method public static boolean isLowSurrogate(char);
    method public static boolean isLowerCase(int);
    method public static boolean isMirrored(int);
    method public static boolean isPrintable(int);
    method public static boolean isSpaceChar(int);
    method public static boolean isSupplementary(int);
    method public static boolean isSupplementaryCodePoint(int);
    method public static boolean isSurrogatePair(char, char);
    method public static boolean isTitleCase(int);
    method public static boolean isUAlphabetic(int);
    method public static boolean isULowercase(int);
    method public static boolean isUUppercase(int);
    method public static boolean isUWhiteSpace(int);
    method public static boolean isUnicodeIdentifierPart(int);
    method public static boolean isUnicodeIdentifierStart(int);
    method public static boolean isUpperCase(int);
    method public static boolean isValidCodePoint(int);
    method public static boolean isWhitespace(int);
    method public static int offsetByCodePoints(CharSequence, int, int);
    method public static int offsetByCodePoints(char[], int, int, int, int);
    method public static int toChars(int, char[], int);
    method public static char[] toChars(int);
    method public static int toCodePoint(char, char);
    method public static int toLowerCase(int);
    method public static String toLowerCase(String);
    method public static String toLowerCase(java.util.Locale, String);
    method public static String toLowerCase(android.icu.util.ULocale, String);
    method public static String toString(int);
    method public static int toTitleCase(int);
    method public static String toTitleCase(String, android.icu.text.BreakIterator);
    method public static String toTitleCase(java.util.Locale, String, android.icu.text.BreakIterator);
    method public static String toTitleCase(android.icu.util.ULocale, String, android.icu.text.BreakIterator);
    method public static String toTitleCase(android.icu.util.ULocale, String, android.icu.text.BreakIterator, int);
    method public static String toTitleCase(java.util.Locale, String, android.icu.text.BreakIterator, int);
    method public static int toUpperCase(int);
    method public static String toUpperCase(String);
    method public static String toUpperCase(java.util.Locale, String);
    method public static String toUpperCase(android.icu.util.ULocale, String);
    field public static final int FOLD_CASE_DEFAULT = 0; // 0x0
    field public static final int FOLD_CASE_EXCLUDE_SPECIAL_I = 1; // 0x1
    field public static final int MAX_CODE_POINT = 1114111; // 0x10ffff
    field public static final char MAX_HIGH_SURROGATE = 56319; // 0xdbff '\udbff'
    field public static final char MAX_LOW_SURROGATE = 57343; // 0xdfff '\udfff'
    field public static final int MAX_RADIX = 36; // 0x24
    field public static final char MAX_SURROGATE = 57343; // 0xdfff '\udfff'
    field public static final int MAX_VALUE = 1114111; // 0x10ffff
    field public static final int MIN_CODE_POINT = 0; // 0x0
    field public static final char MIN_HIGH_SURROGATE = 55296; // 0xd800 '\ud800'
    field public static final char MIN_LOW_SURROGATE = 56320; // 0xdc00 '\udc00'
    field public static final int MIN_RADIX = 2; // 0x2
    field public static final int MIN_SUPPLEMENTARY_CODE_POINT = 65536; // 0x10000
    field public static final char MIN_SURROGATE = 55296; // 0xd800 '\ud800'
    field public static final int MIN_VALUE = 0; // 0x0
    field public static final double NO_NUMERIC_VALUE = -1.23456789E8;
    field public static final int REPLACEMENT_CHAR = 65533; // 0xfffd
    field public static final int SUPPLEMENTARY_MIN_VALUE = 65536; // 0x10000
    field public static final int TITLECASE_NO_BREAK_ADJUSTMENT = 512; // 0x200
    field public static final int TITLECASE_NO_LOWERCASE = 256; // 0x100
  }

  public static interface UCharacter.BidiPairedBracketType {
    field public static final int CLOSE = 2; // 0x2
    field public static final int NONE = 0; // 0x0
    field public static final int OPEN = 1; // 0x1
  }

  public static interface UCharacter.DecompositionType {
    field public static final int CANONICAL = 1; // 0x1
    field public static final int CIRCLE = 3; // 0x3
    field public static final int COMPAT = 2; // 0x2
    field public static final int FINAL = 4; // 0x4
    field public static final int FONT = 5; // 0x5
    field public static final int FRACTION = 6; // 0x6
    field public static final int INITIAL = 7; // 0x7
    field public static final int ISOLATED = 8; // 0x8
    field public static final int MEDIAL = 9; // 0x9
    field public static final int NARROW = 10; // 0xa
    field public static final int NOBREAK = 11; // 0xb
    field public static final int NONE = 0; // 0x0
    field public static final int SMALL = 12; // 0xc
    field public static final int SQUARE = 13; // 0xd
    field public static final int SUB = 14; // 0xe
    field public static final int SUPER = 15; // 0xf
    field public static final int VERTICAL = 16; // 0x10
    field public static final int WIDE = 17; // 0x11
  }

  public static interface UCharacter.EastAsianWidth {
    field public static final int AMBIGUOUS = 1; // 0x1
    field public static final int FULLWIDTH = 3; // 0x3
    field public static final int HALFWIDTH = 2; // 0x2
    field public static final int NARROW = 4; // 0x4
    field public static final int NEUTRAL = 0; // 0x0
    field public static final int WIDE = 5; // 0x5
  }

  public static interface UCharacter.GraphemeClusterBreak {
    field public static final int CONTROL = 1; // 0x1
    field public static final int CR = 2; // 0x2
    field public static final int EXTEND = 3; // 0x3
    field public static final int E_BASE = 13; // 0xd
    field public static final int E_BASE_GAZ = 14; // 0xe
    field public static final int E_MODIFIER = 15; // 0xf
    field public static final int GLUE_AFTER_ZWJ = 16; // 0x10
    field public static final int L = 4; // 0x4
    field public static final int LF = 5; // 0x5
    field public static final int LV = 6; // 0x6
    field public static final int LVT = 7; // 0x7
    field public static final int OTHER = 0; // 0x0
    field public static final int PREPEND = 11; // 0xb
    field public static final int REGIONAL_INDICATOR = 12; // 0xc
    field public static final int SPACING_MARK = 10; // 0xa
    field public static final int T = 8; // 0x8
    field public static final int V = 9; // 0x9
    field public static final int ZWJ = 17; // 0x11
  }

  public static interface UCharacter.HangulSyllableType {
    field public static final int LEADING_JAMO = 1; // 0x1
    field public static final int LVT_SYLLABLE = 5; // 0x5
    field public static final int LV_SYLLABLE = 4; // 0x4
    field public static final int NOT_APPLICABLE = 0; // 0x0
    field public static final int TRAILING_JAMO = 3; // 0x3
    field public static final int VOWEL_JAMO = 2; // 0x2
  }

  public static interface UCharacter.IndicPositionalCategory {
    field public static final int BOTTOM = 1; // 0x1
    field public static final int BOTTOM_AND_LEFT = 2; // 0x2
    field public static final int BOTTOM_AND_RIGHT = 3; // 0x3
    field public static final int LEFT = 4; // 0x4
    field public static final int LEFT_AND_RIGHT = 5; // 0x5
    field public static final int NA = 0; // 0x0
    field public static final int OVERSTRUCK = 6; // 0x6
    field public static final int RIGHT = 7; // 0x7
    field public static final int TOP = 8; // 0x8
    field public static final int TOP_AND_BOTTOM = 9; // 0x9
    field public static final int TOP_AND_BOTTOM_AND_RIGHT = 10; // 0xa
    field public static final int TOP_AND_LEFT = 11; // 0xb
    field public static final int TOP_AND_LEFT_AND_RIGHT = 12; // 0xc
    field public static final int TOP_AND_RIGHT = 13; // 0xd
    field public static final int VISUAL_ORDER_LEFT = 14; // 0xe
  }

  public static interface UCharacter.IndicSyllabicCategory {
    field public static final int AVAGRAHA = 1; // 0x1
    field public static final int BINDU = 2; // 0x2
    field public static final int BRAHMI_JOINING_NUMBER = 3; // 0x3
    field public static final int CANTILLATION_MARK = 4; // 0x4
    field public static final int CONSONANT = 5; // 0x5
    field public static final int CONSONANT_DEAD = 6; // 0x6
    field public static final int CONSONANT_FINAL = 7; // 0x7
    field public static final int CONSONANT_HEAD_LETTER = 8; // 0x8
    field public static final int CONSONANT_INITIAL_POSTFIXED = 9; // 0x9
    field public static final int CONSONANT_KILLER = 10; // 0xa
    field public static final int CONSONANT_MEDIAL = 11; // 0xb
    field public static final int CONSONANT_PLACEHOLDER = 12; // 0xc
    field public static final int CONSONANT_PRECEDING_REPHA = 13; // 0xd
    field public static final int CONSONANT_PREFIXED = 14; // 0xe
    field public static final int CONSONANT_SUBJOINED = 15; // 0xf
    field public static final int CONSONANT_SUCCEEDING_REPHA = 16; // 0x10
    field public static final int CONSONANT_WITH_STACKER = 17; // 0x11
    field public static final int GEMINATION_MARK = 18; // 0x12
    field public static final int INVISIBLE_STACKER = 19; // 0x13
    field public static final int JOINER = 20; // 0x14
    field public static final int MODIFYING_LETTER = 21; // 0x15
    field public static final int NON_JOINER = 22; // 0x16
    field public static final int NUKTA = 23; // 0x17
    field public static final int NUMBER = 24; // 0x18
    field public static final int NUMBER_JOINER = 25; // 0x19
    field public static final int OTHER = 0; // 0x0
    field public static final int PURE_KILLER = 26; // 0x1a
    field public static final int REGISTER_SHIFTER = 27; // 0x1b
    field public static final int SYLLABLE_MODIFIER = 28; // 0x1c
    field public static final int TONE_LETTER = 29; // 0x1d
    field public static final int TONE_MARK = 30; // 0x1e
    field public static final int VIRAMA = 31; // 0x1f
    field public static final int VISARGA = 32; // 0x20
    field public static final int VOWEL = 33; // 0x21
    field public static final int VOWEL_DEPENDENT = 34; // 0x22
    field public static final int VOWEL_INDEPENDENT = 35; // 0x23
  }

  public static interface UCharacter.JoiningGroup {
    field public static final int AFRICAN_FEH = 86; // 0x56
    field public static final int AFRICAN_NOON = 87; // 0x57
    field public static final int AFRICAN_QAF = 88; // 0x58
    field public static final int AIN = 1; // 0x1
    field public static final int ALAPH = 2; // 0x2
    field public static final int ALEF = 3; // 0x3
    field public static final int BEH = 4; // 0x4
    field public static final int BETH = 5; // 0x5
    field public static final int BURUSHASKI_YEH_BARREE = 54; // 0x36
    field public static final int DAL = 6; // 0x6
    field public static final int DALATH_RISH = 7; // 0x7
    field public static final int E = 8; // 0x8
    field public static final int FARSI_YEH = 55; // 0x37
    field public static final int FE = 51; // 0x33
    field public static final int FEH = 9; // 0x9
    field public static final int FINAL_SEMKATH = 10; // 0xa
    field public static final int GAF = 11; // 0xb
    field public static final int GAMAL = 12; // 0xc
    field public static final int HAH = 13; // 0xd
    field public static final int HAMZA_ON_HEH_GOAL = 14; // 0xe
    field public static final int HANIFI_ROHINGYA_KINNA_YA = 100; // 0x64
    field public static final int HANIFI_ROHINGYA_PA = 101; // 0x65
    field public static final int HE = 15; // 0xf
    field public static final int HEH = 16; // 0x10
    field public static final int HEH_GOAL = 17; // 0x11
    field public static final int HETH = 18; // 0x12
    field public static final int KAF = 19; // 0x13
    field public static final int KAPH = 20; // 0x14
    field public static final int KHAPH = 52; // 0x34
    field public static final int KNOTTED_HEH = 21; // 0x15
    field public static final int LAM = 22; // 0x16
    field public static final int LAMADH = 23; // 0x17
    field public static final int MALAYALAM_BHA = 89; // 0x59
    field public static final int MALAYALAM_JA = 90; // 0x5a
    field public static final int MALAYALAM_LLA = 91; // 0x5b
    field public static final int MALAYALAM_LLLA = 92; // 0x5c
    field public static final int MALAYALAM_NGA = 93; // 0x5d
    field public static final int MALAYALAM_NNA = 94; // 0x5e
    field public static final int MALAYALAM_NNNA = 95; // 0x5f
    field public static final int MALAYALAM_NYA = 96; // 0x60
    field public static final int MALAYALAM_RA = 97; // 0x61
    field public static final int MALAYALAM_SSA = 98; // 0x62
    field public static final int MALAYALAM_TTA = 99; // 0x63
    field public static final int MANICHAEAN_ALEPH = 58; // 0x3a
    field public static final int MANICHAEAN_AYIN = 59; // 0x3b
    field public static final int MANICHAEAN_BETH = 60; // 0x3c
    field public static final int MANICHAEAN_DALETH = 61; // 0x3d
    field public static final int MANICHAEAN_DHAMEDH = 62; // 0x3e
    field public static final int MANICHAEAN_FIVE = 63; // 0x3f
    field public static final int MANICHAEAN_GIMEL = 64; // 0x40
    field public static final int MANICHAEAN_HETH = 65; // 0x41
    field public static final int MANICHAEAN_HUNDRED = 66; // 0x42
    field public static final int MANICHAEAN_KAPH = 67; // 0x43
    field public static final int MANICHAEAN_LAMEDH = 68; // 0x44
    field public static final int MANICHAEAN_MEM = 69; // 0x45
    field public static final int MANICHAEAN_NUN = 70; // 0x46
    field public static final int MANICHAEAN_ONE = 71; // 0x47
    field public static final int MANICHAEAN_PE = 72; // 0x48
    field public static final int MANICHAEAN_QOPH = 73; // 0x49
    field public static final int MANICHAEAN_RESH = 74; // 0x4a
    field public static final int MANICHAEAN_SADHE = 75; // 0x4b
    field public static final int MANICHAEAN_SAMEKH = 76; // 0x4c
    field public static final int MANICHAEAN_TAW = 77; // 0x4d
    field public static final int MANICHAEAN_TEN = 78; // 0x4e
    field public static final int MANICHAEAN_TETH = 79; // 0x4f
    field public static final int MANICHAEAN_THAMEDH = 80; // 0x50
    field public static final int MANICHAEAN_TWENTY = 81; // 0x51
    field public static final int MANICHAEAN_WAW = 82; // 0x52
    field public static final int MANICHAEAN_YODH = 83; // 0x53
    field public static final int MANICHAEAN_ZAYIN = 84; // 0x54
    field public static final int MEEM = 24; // 0x18
    field public static final int MIM = 25; // 0x19
    field public static final int NOON = 26; // 0x1a
    field public static final int NO_JOINING_GROUP = 0; // 0x0
    field public static final int NUN = 27; // 0x1b
    field public static final int NYA = 56; // 0x38
    field public static final int PE = 28; // 0x1c
    field public static final int QAF = 29; // 0x1d
    field public static final int QAPH = 30; // 0x1e
    field public static final int REH = 31; // 0x1f
    field public static final int REVERSED_PE = 32; // 0x20
    field public static final int ROHINGYA_YEH = 57; // 0x39
    field public static final int SAD = 33; // 0x21
    field public static final int SADHE = 34; // 0x22
    field public static final int SEEN = 35; // 0x23
    field public static final int SEMKATH = 36; // 0x24
    field public static final int SHIN = 37; // 0x25
    field public static final int STRAIGHT_WAW = 85; // 0x55
    field public static final int SWASH_KAF = 38; // 0x26
    field public static final int SYRIAC_WAW = 39; // 0x27
    field public static final int TAH = 40; // 0x28
    field public static final int TAW = 41; // 0x29
    field public static final int TEH_MARBUTA = 42; // 0x2a
    field public static final int TEH_MARBUTA_GOAL = 14; // 0xe
    field public static final int TETH = 43; // 0x2b
    field public static final int WAW = 44; // 0x2c
    field public static final int YEH = 45; // 0x2d
    field public static final int YEH_BARREE = 46; // 0x2e
    field public static final int YEH_WITH_TAIL = 47; // 0x2f
    field public static final int YUDH = 48; // 0x30
    field public static final int YUDH_HE = 49; // 0x31
    field public static final int ZAIN = 50; // 0x32
    field public static final int ZHAIN = 53; // 0x35
  }

  public static interface UCharacter.JoiningType {
    field public static final int DUAL_JOINING = 2; // 0x2
    field public static final int JOIN_CAUSING = 1; // 0x1
    field public static final int LEFT_JOINING = 3; // 0x3
    field public static final int NON_JOINING = 0; // 0x0
    field public static final int RIGHT_JOINING = 4; // 0x4
    field public static final int TRANSPARENT = 5; // 0x5
  }

  public static interface UCharacter.LineBreak {
    field public static final int ALPHABETIC = 2; // 0x2
    field public static final int AMBIGUOUS = 1; // 0x1
    field public static final int BREAK_AFTER = 4; // 0x4
    field public static final int BREAK_BEFORE = 5; // 0x5
    field public static final int BREAK_BOTH = 3; // 0x3
    field public static final int BREAK_SYMBOLS = 27; // 0x1b
    field public static final int CARRIAGE_RETURN = 10; // 0xa
    field public static final int CLOSE_PARENTHESIS = 36; // 0x24
    field public static final int CLOSE_PUNCTUATION = 8; // 0x8
    field public static final int COMBINING_MARK = 9; // 0x9
    field public static final int COMPLEX_CONTEXT = 24; // 0x18
    field public static final int CONDITIONAL_JAPANESE_STARTER = 37; // 0x25
    field public static final int CONTINGENT_BREAK = 7; // 0x7
    field public static final int EXCLAMATION = 11; // 0xb
    field public static final int E_BASE = 40; // 0x28
    field public static final int E_MODIFIER = 41; // 0x29
    field public static final int GLUE = 12; // 0xc
    field public static final int H2 = 31; // 0x1f
    field public static final int H3 = 32; // 0x20
    field public static final int HEBREW_LETTER = 38; // 0x26
    field public static final int HYPHEN = 13; // 0xd
    field public static final int IDEOGRAPHIC = 14; // 0xe
    field public static final int INFIX_NUMERIC = 16; // 0x10
    field public static final int INSEPARABLE = 15; // 0xf
    field public static final int INSEPERABLE = 15; // 0xf
    field public static final int JL = 33; // 0x21
    field public static final int JT = 34; // 0x22
    field public static final int JV = 35; // 0x23
    field public static final int LINE_FEED = 17; // 0x11
    field public static final int MANDATORY_BREAK = 6; // 0x6
    field public static final int NEXT_LINE = 29; // 0x1d
    field public static final int NONSTARTER = 18; // 0x12
    field public static final int NUMERIC = 19; // 0x13
    field public static final int OPEN_PUNCTUATION = 20; // 0x14
    field public static final int POSTFIX_NUMERIC = 21; // 0x15
    field public static final int PREFIX_NUMERIC = 22; // 0x16
    field public static final int QUOTATION = 23; // 0x17
    field public static final int REGIONAL_INDICATOR = 39; // 0x27
    field public static final int SPACE = 26; // 0x1a
    field public static final int SURROGATE = 25; // 0x19
    field public static final int UNKNOWN = 0; // 0x0
    field public static final int WORD_JOINER = 30; // 0x1e
    field public static final int ZWJ = 42; // 0x2a
    field public static final int ZWSPACE = 28; // 0x1c
  }

  public static interface UCharacter.NumericType {
    field public static final int DECIMAL = 1; // 0x1
    field public static final int DIGIT = 2; // 0x2
    field public static final int NONE = 0; // 0x0
    field public static final int NUMERIC = 3; // 0x3
  }

  public static interface UCharacter.SentenceBreak {
    field public static final int ATERM = 1; // 0x1
    field public static final int CLOSE = 2; // 0x2
    field public static final int CR = 11; // 0xb
    field public static final int EXTEND = 12; // 0xc
    field public static final int FORMAT = 3; // 0x3
    field public static final int LF = 13; // 0xd
    field public static final int LOWER = 4; // 0x4
    field public static final int NUMERIC = 5; // 0x5
    field public static final int OLETTER = 6; // 0x6
    field public static final int OTHER = 0; // 0x0
    field public static final int SCONTINUE = 14; // 0xe
    field public static final int SEP = 7; // 0x7
    field public static final int SP = 8; // 0x8
    field public static final int STERM = 9; // 0x9
    field public static final int UPPER = 10; // 0xa
  }

  public static final class UCharacter.UnicodeBlock extends java.lang.Character.Subset {
    method public static android.icu.lang.UCharacter.UnicodeBlock forName(String);
    method public int getID();
    method public static android.icu.lang.UCharacter.UnicodeBlock getInstance(int);
    method public static android.icu.lang.UCharacter.UnicodeBlock of(int);
    field public static final android.icu.lang.UCharacter.UnicodeBlock ADLAM;
    field public static final int ADLAM_ID = 263; // 0x107
    field public static final android.icu.lang.UCharacter.UnicodeBlock AEGEAN_NUMBERS;
    field public static final int AEGEAN_NUMBERS_ID = 119; // 0x77
    field public static final android.icu.lang.UCharacter.UnicodeBlock AHOM;
    field public static final int AHOM_ID = 253; // 0xfd
    field public static final android.icu.lang.UCharacter.UnicodeBlock ALCHEMICAL_SYMBOLS;
    field public static final int ALCHEMICAL_SYMBOLS_ID = 208; // 0xd0
    field public static final android.icu.lang.UCharacter.UnicodeBlock ALPHABETIC_PRESENTATION_FORMS;
    field public static final int ALPHABETIC_PRESENTATION_FORMS_ID = 80; // 0x50
    field public static final android.icu.lang.UCharacter.UnicodeBlock ANATOLIAN_HIEROGLYPHS;
    field public static final int ANATOLIAN_HIEROGLYPHS_ID = 254; // 0xfe
    field public static final android.icu.lang.UCharacter.UnicodeBlock ANCIENT_GREEK_MUSICAL_NOTATION;
    field public static final int ANCIENT_GREEK_MUSICAL_NOTATION_ID = 126; // 0x7e
    field public static final android.icu.lang.UCharacter.UnicodeBlock ANCIENT_GREEK_NUMBERS;
    field public static final int ANCIENT_GREEK_NUMBERS_ID = 127; // 0x7f
    field public static final android.icu.lang.UCharacter.UnicodeBlock ANCIENT_SYMBOLS;
    field public static final int ANCIENT_SYMBOLS_ID = 165; // 0xa5
    field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC;
    field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_EXTENDED_A;
    field public static final int ARABIC_EXTENDED_A_ID = 210; // 0xd2
    field public static final int ARABIC_ID = 12; // 0xc
    field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS;
    field public static final int ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS_ID = 211; // 0xd3
    field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_PRESENTATION_FORMS_A;
    field public static final int ARABIC_PRESENTATION_FORMS_A_ID = 81; // 0x51
    field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_PRESENTATION_FORMS_B;
    field public static final int ARABIC_PRESENTATION_FORMS_B_ID = 85; // 0x55
    field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_SUPPLEMENT;
    field public static final int ARABIC_SUPPLEMENT_ID = 128; // 0x80
    field public static final android.icu.lang.UCharacter.UnicodeBlock ARMENIAN;
    field public static final int ARMENIAN_ID = 10; // 0xa
    field public static final android.icu.lang.UCharacter.UnicodeBlock ARROWS;
    field public static final int ARROWS_ID = 46; // 0x2e
    field public static final android.icu.lang.UCharacter.UnicodeBlock AVESTAN;
    field public static final int AVESTAN_ID = 188; // 0xbc
    field public static final android.icu.lang.UCharacter.UnicodeBlock BALINESE;
    field public static final int BALINESE_ID = 147; // 0x93
    field public static final android.icu.lang.UCharacter.UnicodeBlock BAMUM;
    field public static final int BAMUM_ID = 177; // 0xb1
    field public static final android.icu.lang.UCharacter.UnicodeBlock BAMUM_SUPPLEMENT;
    field public static final int BAMUM_SUPPLEMENT_ID = 202; // 0xca
    field public static final android.icu.lang.UCharacter.UnicodeBlock BASIC_LATIN;
    field public static final int BASIC_LATIN_ID = 1; // 0x1
    field public static final android.icu.lang.UCharacter.UnicodeBlock BASSA_VAH;
    field public static final int BASSA_VAH_ID = 221; // 0xdd
    field public static final android.icu.lang.UCharacter.UnicodeBlock BATAK;
    field public static final int BATAK_ID = 199; // 0xc7
    field public static final android.icu.lang.UCharacter.UnicodeBlock BENGALI;
    field public static final int BENGALI_ID = 16; // 0x10
    field public static final android.icu.lang.UCharacter.UnicodeBlock BHAIKSUKI;
    field public static final int BHAIKSUKI_ID = 264; // 0x108
    field public static final android.icu.lang.UCharacter.UnicodeBlock BLOCK_ELEMENTS;
    field public static final int BLOCK_ELEMENTS_ID = 53; // 0x35
    field public static final android.icu.lang.UCharacter.UnicodeBlock BOPOMOFO;
    field public static final android.icu.lang.UCharacter.UnicodeBlock BOPOMOFO_EXTENDED;
    field public static final int BOPOMOFO_EXTENDED_ID = 67; // 0x43
    field public static final int BOPOMOFO_ID = 64; // 0x40
    field public static final android.icu.lang.UCharacter.UnicodeBlock BOX_DRAWING;
    field public static final int BOX_DRAWING_ID = 52; // 0x34
    field public static final android.icu.lang.UCharacter.UnicodeBlock BRAHMI;
    field public static final int BRAHMI_ID = 201; // 0xc9
    field public static final android.icu.lang.UCharacter.UnicodeBlock BRAILLE_PATTERNS;
    field public static final int BRAILLE_PATTERNS_ID = 57; // 0x39
    field public static final android.icu.lang.UCharacter.UnicodeBlock BUGINESE;
    field public static final int BUGINESE_ID = 129; // 0x81
    field public static final android.icu.lang.UCharacter.UnicodeBlock BUHID;
    field public static final int BUHID_ID = 100; // 0x64
    field public static final android.icu.lang.UCharacter.UnicodeBlock BYZANTINE_MUSICAL_SYMBOLS;
    field public static final int BYZANTINE_MUSICAL_SYMBOLS_ID = 91; // 0x5b
    field public static final android.icu.lang.UCharacter.UnicodeBlock CARIAN;
    field public static final int CARIAN_ID = 168; // 0xa8
    field public static final android.icu.lang.UCharacter.UnicodeBlock CAUCASIAN_ALBANIAN;
    field public static final int CAUCASIAN_ALBANIAN_ID = 222; // 0xde
    field public static final android.icu.lang.UCharacter.UnicodeBlock CHAKMA;
    field public static final int CHAKMA_ID = 212; // 0xd4
    field public static final android.icu.lang.UCharacter.UnicodeBlock CHAM;
    field public static final int CHAM_ID = 164; // 0xa4
    field public static final android.icu.lang.UCharacter.UnicodeBlock CHEROKEE;
    field public static final int CHEROKEE_ID = 32; // 0x20
    field public static final android.icu.lang.UCharacter.UnicodeBlock CHEROKEE_SUPPLEMENT;
    field public static final int CHEROKEE_SUPPLEMENT_ID = 255; // 0xff
    field public static final android.icu.lang.UCharacter.UnicodeBlock CHESS_SYMBOLS;
    field public static final int CHESS_SYMBOLS_ID = 281; // 0x119
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_COMPATIBILITY;
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_COMPATIBILITY_FORMS;
    field public static final int CJK_COMPATIBILITY_FORMS_ID = 83; // 0x53
    field public static final int CJK_COMPATIBILITY_ID = 69; // 0x45
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS;
    field public static final int CJK_COMPATIBILITY_IDEOGRAPHS_ID = 79; // 0x4f
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT;
    field public static final int CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_ID = 95; // 0x5f
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_RADICALS_SUPPLEMENT;
    field public static final int CJK_RADICALS_SUPPLEMENT_ID = 58; // 0x3a
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_STROKES;
    field public static final int CJK_STROKES_ID = 130; // 0x82
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_SYMBOLS_AND_PUNCTUATION;
    field public static final int CJK_SYMBOLS_AND_PUNCTUATION_ID = 61; // 0x3d
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS;
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A;
    field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_ID = 70; // 0x46
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B;
    field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_ID = 94; // 0x5e
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C;
    field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_ID = 197; // 0xc5
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D;
    field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_ID = 209; // 0xd1
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E;
    field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E_ID = 256; // 0x100
    field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F;
    field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F_ID = 274; // 0x112
    field public static final int CJK_UNIFIED_IDEOGRAPHS_ID = 71; // 0x47
    field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_DIACRITICAL_MARKS;
    field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_DIACRITICAL_MARKS_EXTENDED;
    field public static final int COMBINING_DIACRITICAL_MARKS_EXTENDED_ID = 224; // 0xe0
    field public static final int COMBINING_DIACRITICAL_MARKS_ID = 7; // 0x7
    field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_DIACRITICAL_MARKS_SUPPLEMENT;
    field public static final int COMBINING_DIACRITICAL_MARKS_SUPPLEMENT_ID = 131; // 0x83
    field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_HALF_MARKS;
    field public static final int COMBINING_HALF_MARKS_ID = 82; // 0x52
    field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_MARKS_FOR_SYMBOLS;
    field public static final int COMBINING_MARKS_FOR_SYMBOLS_ID = 43; // 0x2b
    field public static final android.icu.lang.UCharacter.UnicodeBlock COMMON_INDIC_NUMBER_FORMS;
    field public static final int COMMON_INDIC_NUMBER_FORMS_ID = 178; // 0xb2
    field public static final android.icu.lang.UCharacter.UnicodeBlock CONTROL_PICTURES;
    field public static final int CONTROL_PICTURES_ID = 49; // 0x31
    field public static final android.icu.lang.UCharacter.UnicodeBlock COPTIC;
    field public static final android.icu.lang.UCharacter.UnicodeBlock COPTIC_EPACT_NUMBERS;
    field public static final int COPTIC_EPACT_NUMBERS_ID = 223; // 0xdf
    field public static final int COPTIC_ID = 132; // 0x84
    field public static final android.icu.lang.UCharacter.UnicodeBlock COUNTING_ROD_NUMERALS;
    field public static final int COUNTING_ROD_NUMERALS_ID = 154; // 0x9a
    field public static final android.icu.lang.UCharacter.UnicodeBlock CUNEIFORM;
    field public static final int CUNEIFORM_ID = 152; // 0x98
    field public static final android.icu.lang.UCharacter.UnicodeBlock CUNEIFORM_NUMBERS_AND_PUNCTUATION;
    field public static final int CUNEIFORM_NUMBERS_AND_PUNCTUATION_ID = 153; // 0x99
    field public static final android.icu.lang.UCharacter.UnicodeBlock CURRENCY_SYMBOLS;
    field public static final int CURRENCY_SYMBOLS_ID = 42; // 0x2a
    field public static final android.icu.lang.UCharacter.UnicodeBlock CYPRIOT_SYLLABARY;
    field public static final int CYPRIOT_SYLLABARY_ID = 123; // 0x7b
    field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC;
    field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_EXTENDED_A;
    field public static final int CYRILLIC_EXTENDED_A_ID = 158; // 0x9e
    field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_EXTENDED_B;
    field public static final int CYRILLIC_EXTENDED_B_ID = 160; // 0xa0
    field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_EXTENDED_C;
    field public static final int CYRILLIC_EXTENDED_C_ID = 265; // 0x109
    field public static final int CYRILLIC_ID = 9; // 0x9
    field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_SUPPLEMENT;
    field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_SUPPLEMENTARY;
    field public static final int CYRILLIC_SUPPLEMENTARY_ID = 97; // 0x61
    field public static final int CYRILLIC_SUPPLEMENT_ID = 97; // 0x61
    field public static final android.icu.lang.UCharacter.UnicodeBlock DESERET;
    field public static final int DESERET_ID = 90; // 0x5a
    field public static final android.icu.lang.UCharacter.UnicodeBlock DEVANAGARI;
    field public static final android.icu.lang.UCharacter.UnicodeBlock DEVANAGARI_EXTENDED;
    field public static final int DEVANAGARI_EXTENDED_ID = 179; // 0xb3
    field public static final int DEVANAGARI_ID = 15; // 0xf
    field public static final android.icu.lang.UCharacter.UnicodeBlock DINGBATS;
    field public static final int DINGBATS_ID = 56; // 0x38
    field public static final android.icu.lang.UCharacter.UnicodeBlock DOGRA;
    field public static final int DOGRA_ID = 282; // 0x11a
    field public static final android.icu.lang.UCharacter.UnicodeBlock DOMINO_TILES;
    field public static final int DOMINO_TILES_ID = 171; // 0xab
    field public static final android.icu.lang.UCharacter.UnicodeBlock DUPLOYAN;
    field public static final int DUPLOYAN_ID = 225; // 0xe1
    field public static final android.icu.lang.UCharacter.UnicodeBlock EARLY_DYNASTIC_CUNEIFORM;
    field public static final int EARLY_DYNASTIC_CUNEIFORM_ID = 257; // 0x101
    field public static final android.icu.lang.UCharacter.UnicodeBlock EGYPTIAN_HIEROGLYPHS;
    field public static final int EGYPTIAN_HIEROGLYPHS_ID = 194; // 0xc2
    field public static final android.icu.lang.UCharacter.UnicodeBlock ELBASAN;
    field public static final int ELBASAN_ID = 226; // 0xe2
    field public static final android.icu.lang.UCharacter.UnicodeBlock EMOTICONS;
    field public static final int EMOTICONS_ID = 206; // 0xce
    field public static final android.icu.lang.UCharacter.UnicodeBlock ENCLOSED_ALPHANUMERICS;
    field public static final int ENCLOSED_ALPHANUMERICS_ID = 51; // 0x33
    field public static final android.icu.lang.UCharacter.UnicodeBlock ENCLOSED_ALPHANUMERIC_SUPPLEMENT;
    field public static final int ENCLOSED_ALPHANUMERIC_SUPPLEMENT_ID = 195; // 0xc3
    field public static final android.icu.lang.UCharacter.UnicodeBlock ENCLOSED_CJK_LETTERS_AND_MONTHS;
    field public static final int ENCLOSED_CJK_LETTERS_AND_MONTHS_ID = 68; // 0x44
    field public static final android.icu.lang.UCharacter.UnicodeBlock ENCLOSED_IDEOGRAPHIC_SUPPLEMENT;
    field public static final int ENCLOSED_IDEOGRAPHIC_SUPPLEMENT_ID = 196; // 0xc4
    field public static final android.icu.lang.UCharacter.UnicodeBlock ETHIOPIC;
    field public static final android.icu.lang.UCharacter.UnicodeBlock ETHIOPIC_EXTENDED;
    field public static final android.icu.lang.UCharacter.UnicodeBlock ETHIOPIC_EXTENDED_A;
    field public static final int ETHIOPIC_EXTENDED_A_ID = 200; // 0xc8
    field public static final int ETHIOPIC_EXTENDED_ID = 133; // 0x85
    field public static final int ETHIOPIC_ID = 31; // 0x1f
    field public static final android.icu.lang.UCharacter.UnicodeBlock ETHIOPIC_SUPPLEMENT;
    field public static final int ETHIOPIC_SUPPLEMENT_ID = 134; // 0x86
    field public static final android.icu.lang.UCharacter.UnicodeBlock GENERAL_PUNCTUATION;
    field public static final int GENERAL_PUNCTUATION_ID = 40; // 0x28
    field public static final android.icu.lang.UCharacter.UnicodeBlock GEOMETRIC_SHAPES;
    field public static final android.icu.lang.UCharacter.UnicodeBlock GEOMETRIC_SHAPES_EXTENDED;
    field public static final int GEOMETRIC_SHAPES_EXTENDED_ID = 227; // 0xe3
    field public static final int GEOMETRIC_SHAPES_ID = 54; // 0x36
    field public static final android.icu.lang.UCharacter.UnicodeBlock GEORGIAN;
    field public static final android.icu.lang.UCharacter.UnicodeBlock GEORGIAN_EXTENDED;
    field public static final int GEORGIAN_EXTENDED_ID = 283; // 0x11b
    field public static final int GEORGIAN_ID = 29; // 0x1d
    field public static final android.icu.lang.UCharacter.UnicodeBlock GEORGIAN_SUPPLEMENT;
    field public static final int GEORGIAN_SUPPLEMENT_ID = 135; // 0x87
    field public static final android.icu.lang.UCharacter.UnicodeBlock GLAGOLITIC;
    field public static final int GLAGOLITIC_ID = 136; // 0x88
    field public static final android.icu.lang.UCharacter.UnicodeBlock GLAGOLITIC_SUPPLEMENT;
    field public static final int GLAGOLITIC_SUPPLEMENT_ID = 266; // 0x10a
    field public static final android.icu.lang.UCharacter.UnicodeBlock GOTHIC;
    field public static final int GOTHIC_ID = 89; // 0x59
    field public static final android.icu.lang.UCharacter.UnicodeBlock GRANTHA;
    field public static final int GRANTHA_ID = 228; // 0xe4
    field public static final android.icu.lang.UCharacter.UnicodeBlock GREEK;
    field public static final android.icu.lang.UCharacter.UnicodeBlock GREEK_EXTENDED;
    field public static final int GREEK_EXTENDED_ID = 39; // 0x27
    field public static final int GREEK_ID = 8; // 0x8
    field public static final android.icu.lang.UCharacter.UnicodeBlock GUJARATI;
    field public static final int GUJARATI_ID = 18; // 0x12
    field public static final android.icu.lang.UCharacter.UnicodeBlock GUNJALA_GONDI;
    field public static final int GUNJALA_GONDI_ID = 284; // 0x11c
    field public static final android.icu.lang.UCharacter.UnicodeBlock GURMUKHI;
    field public static final int GURMUKHI_ID = 17; // 0x11
    field public static final android.icu.lang.UCharacter.UnicodeBlock HALFWIDTH_AND_FULLWIDTH_FORMS;
    field public static final int HALFWIDTH_AND_FULLWIDTH_FORMS_ID = 87; // 0x57
    field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_COMPATIBILITY_JAMO;
    field public static final int HANGUL_COMPATIBILITY_JAMO_ID = 65; // 0x41
    field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_JAMO;
    field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_JAMO_EXTENDED_A;
    field public static final int HANGUL_JAMO_EXTENDED_A_ID = 180; // 0xb4
    field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_JAMO_EXTENDED_B;
    field public static final int HANGUL_JAMO_EXTENDED_B_ID = 185; // 0xb9
    field public static final int HANGUL_JAMO_ID = 30; // 0x1e
    field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_SYLLABLES;
    field public static final int HANGUL_SYLLABLES_ID = 74; // 0x4a
    field public static final android.icu.lang.UCharacter.UnicodeBlock HANIFI_ROHINGYA;
    field public static final int HANIFI_ROHINGYA_ID = 285; // 0x11d
    field public static final android.icu.lang.UCharacter.UnicodeBlock HANUNOO;
    field public static final int HANUNOO_ID = 99; // 0x63
    field public static final android.icu.lang.UCharacter.UnicodeBlock HATRAN;
    field public static final int HATRAN_ID = 258; // 0x102
    field public static final android.icu.lang.UCharacter.UnicodeBlock HEBREW;
    field public static final int HEBREW_ID = 11; // 0xb
    field public static final android.icu.lang.UCharacter.UnicodeBlock HIGH_PRIVATE_USE_SURROGATES;
    field public static final int HIGH_PRIVATE_USE_SURROGATES_ID = 76; // 0x4c
    field public static final android.icu.lang.UCharacter.UnicodeBlock HIGH_SURROGATES;
    field public static final int HIGH_SURROGATES_ID = 75; // 0x4b
    field public static final android.icu.lang.UCharacter.UnicodeBlock HIRAGANA;
    field public static final int HIRAGANA_ID = 62; // 0x3e
    field public static final android.icu.lang.UCharacter.UnicodeBlock IDEOGRAPHIC_DESCRIPTION_CHARACTERS;
    field public static final int IDEOGRAPHIC_DESCRIPTION_CHARACTERS_ID = 60; // 0x3c
    field public static final android.icu.lang.UCharacter.UnicodeBlock IDEOGRAPHIC_SYMBOLS_AND_PUNCTUATION;
    field public static final int IDEOGRAPHIC_SYMBOLS_AND_PUNCTUATION_ID = 267; // 0x10b
    field public static final android.icu.lang.UCharacter.UnicodeBlock IMPERIAL_ARAMAIC;
    field public static final int IMPERIAL_ARAMAIC_ID = 186; // 0xba
    field public static final android.icu.lang.UCharacter.UnicodeBlock INDIC_SIYAQ_NUMBERS;
    field public static final int INDIC_SIYAQ_NUMBERS_ID = 286; // 0x11e
    field public static final android.icu.lang.UCharacter.UnicodeBlock INSCRIPTIONAL_PAHLAVI;
    field public static final int INSCRIPTIONAL_PAHLAVI_ID = 190; // 0xbe
    field public static final android.icu.lang.UCharacter.UnicodeBlock INSCRIPTIONAL_PARTHIAN;
    field public static final int INSCRIPTIONAL_PARTHIAN_ID = 189; // 0xbd
    field public static final android.icu.lang.UCharacter.UnicodeBlock INVALID_CODE;
    field public static final int INVALID_CODE_ID = -1; // 0xffffffff
    field public static final android.icu.lang.UCharacter.UnicodeBlock IPA_EXTENSIONS;
    field public static final int IPA_EXTENSIONS_ID = 5; // 0x5
    field public static final android.icu.lang.UCharacter.UnicodeBlock JAVANESE;
    field public static final int JAVANESE_ID = 181; // 0xb5
    field public static final android.icu.lang.UCharacter.UnicodeBlock KAITHI;
    field public static final int KAITHI_ID = 193; // 0xc1
    field public static final android.icu.lang.UCharacter.UnicodeBlock KANA_EXTENDED_A;
    field public static final int KANA_EXTENDED_A_ID = 275; // 0x113
    field public static final android.icu.lang.UCharacter.UnicodeBlock KANA_SUPPLEMENT;
    field public static final int KANA_SUPPLEMENT_ID = 203; // 0xcb
    field public static final android.icu.lang.UCharacter.UnicodeBlock KANBUN;
    field public static final int KANBUN_ID = 66; // 0x42
    field public static final android.icu.lang.UCharacter.UnicodeBlock KANGXI_RADICALS;
    field public static final int KANGXI_RADICALS_ID = 59; // 0x3b
    field public static final android.icu.lang.UCharacter.UnicodeBlock KANNADA;
    field public static final int KANNADA_ID = 22; // 0x16
    field public static final android.icu.lang.UCharacter.UnicodeBlock KATAKANA;
    field public static final int KATAKANA_ID = 63; // 0x3f
    field public static final android.icu.lang.UCharacter.UnicodeBlock KATAKANA_PHONETIC_EXTENSIONS;
    field public static final int KATAKANA_PHONETIC_EXTENSIONS_ID = 107; // 0x6b
    field public static final android.icu.lang.UCharacter.UnicodeBlock KAYAH_LI;
    field public static final int KAYAH_LI_ID = 162; // 0xa2
    field public static final android.icu.lang.UCharacter.UnicodeBlock KHAROSHTHI;
    field public static final int KHAROSHTHI_ID = 137; // 0x89
    field public static final android.icu.lang.UCharacter.UnicodeBlock KHMER;
    field public static final int KHMER_ID = 36; // 0x24
    field public static final android.icu.lang.UCharacter.UnicodeBlock KHMER_SYMBOLS;
    field public static final int KHMER_SYMBOLS_ID = 113; // 0x71
    field public static final android.icu.lang.UCharacter.UnicodeBlock KHOJKI;
    field public static final int KHOJKI_ID = 229; // 0xe5
    field public static final android.icu.lang.UCharacter.UnicodeBlock KHUDAWADI;
    field public static final int KHUDAWADI_ID = 230; // 0xe6
    field public static final android.icu.lang.UCharacter.UnicodeBlock LAO;
    field public static final int LAO_ID = 26; // 0x1a
    field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_1_SUPPLEMENT;
    field public static final int LATIN_1_SUPPLEMENT_ID = 2; // 0x2
    field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_A;
    field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_ADDITIONAL;
    field public static final int LATIN_EXTENDED_ADDITIONAL_ID = 38; // 0x26
    field public static final int LATIN_EXTENDED_A_ID = 3; // 0x3
    field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_B;
    field public static final int LATIN_EXTENDED_B_ID = 4; // 0x4
    field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_C;
    field public static final int LATIN_EXTENDED_C_ID = 148; // 0x94
    field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_D;
    field public static final int LATIN_EXTENDED_D_ID = 149; // 0x95
    field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_E;
    field public static final int LATIN_EXTENDED_E_ID = 231; // 0xe7
    field public static final android.icu.lang.UCharacter.UnicodeBlock LEPCHA;
    field public static final int LEPCHA_ID = 156; // 0x9c
    field public static final android.icu.lang.UCharacter.UnicodeBlock LETTERLIKE_SYMBOLS;
    field public static final int LETTERLIKE_SYMBOLS_ID = 44; // 0x2c
    field public static final android.icu.lang.UCharacter.UnicodeBlock LIMBU;
    field public static final int LIMBU_ID = 111; // 0x6f
    field public static final android.icu.lang.UCharacter.UnicodeBlock LINEAR_A;
    field public static final int LINEAR_A_ID = 232; // 0xe8
    field public static final android.icu.lang.UCharacter.UnicodeBlock LINEAR_B_IDEOGRAMS;
    field public static final int LINEAR_B_IDEOGRAMS_ID = 118; // 0x76
    field public static final android.icu.lang.UCharacter.UnicodeBlock LINEAR_B_SYLLABARY;
    field public static final int LINEAR_B_SYLLABARY_ID = 117; // 0x75
    field public static final android.icu.lang.UCharacter.UnicodeBlock LISU;
    field public static final int LISU_ID = 176; // 0xb0
    field public static final android.icu.lang.UCharacter.UnicodeBlock LOW_SURROGATES;
    field public static final int LOW_SURROGATES_ID = 77; // 0x4d
    field public static final android.icu.lang.UCharacter.UnicodeBlock LYCIAN;
    field public static final int LYCIAN_ID = 167; // 0xa7
    field public static final android.icu.lang.UCharacter.UnicodeBlock LYDIAN;
    field public static final int LYDIAN_ID = 169; // 0xa9
    field public static final android.icu.lang.UCharacter.UnicodeBlock MAHAJANI;
    field public static final int MAHAJANI_ID = 233; // 0xe9
    field public static final android.icu.lang.UCharacter.UnicodeBlock MAHJONG_TILES;
    field public static final int MAHJONG_TILES_ID = 170; // 0xaa
    field public static final android.icu.lang.UCharacter.UnicodeBlock MAKASAR;
    field public static final int MAKASAR_ID = 287; // 0x11f
    field public static final android.icu.lang.UCharacter.UnicodeBlock MALAYALAM;
    field public static final int MALAYALAM_ID = 23; // 0x17
    field public static final android.icu.lang.UCharacter.UnicodeBlock MANDAIC;
    field public static final int MANDAIC_ID = 198; // 0xc6
    field public static final android.icu.lang.UCharacter.UnicodeBlock MANICHAEAN;
    field public static final int MANICHAEAN_ID = 234; // 0xea
    field public static final android.icu.lang.UCharacter.UnicodeBlock MARCHEN;
    field public static final int MARCHEN_ID = 268; // 0x10c
    field public static final android.icu.lang.UCharacter.UnicodeBlock MASARAM_GONDI;
    field public static final int MASARAM_GONDI_ID = 276; // 0x114
    field public static final android.icu.lang.UCharacter.UnicodeBlock MATHEMATICAL_ALPHANUMERIC_SYMBOLS;
    field public static final int MATHEMATICAL_ALPHANUMERIC_SYMBOLS_ID = 93; // 0x5d
    field public static final android.icu.lang.UCharacter.UnicodeBlock MATHEMATICAL_OPERATORS;
    field public static final int MATHEMATICAL_OPERATORS_ID = 47; // 0x2f
    field public static final android.icu.lang.UCharacter.UnicodeBlock MAYAN_NUMERALS;
    field public static final int MAYAN_NUMERALS_ID = 288; // 0x120
    field public static final android.icu.lang.UCharacter.UnicodeBlock MEDEFAIDRIN;
    field public static final int MEDEFAIDRIN_ID = 289; // 0x121
    field public static final android.icu.lang.UCharacter.UnicodeBlock MEETEI_MAYEK;
    field public static final android.icu.lang.UCharacter.UnicodeBlock MEETEI_MAYEK_EXTENSIONS;
    field public static final int MEETEI_MAYEK_EXTENSIONS_ID = 213; // 0xd5
    field public static final int MEETEI_MAYEK_ID = 184; // 0xb8
    field public static final android.icu.lang.UCharacter.UnicodeBlock MENDE_KIKAKUI;
    field public static final int MENDE_KIKAKUI_ID = 235; // 0xeb
    field public static final android.icu.lang.UCharacter.UnicodeBlock MEROITIC_CURSIVE;
    field public static final int MEROITIC_CURSIVE_ID = 214; // 0xd6
    field public static final android.icu.lang.UCharacter.UnicodeBlock MEROITIC_HIEROGLYPHS;
    field public static final int MEROITIC_HIEROGLYPHS_ID = 215; // 0xd7
    field public static final android.icu.lang.UCharacter.UnicodeBlock MIAO;
    field public static final int MIAO_ID = 216; // 0xd8
    field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A;
    field public static final int MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A_ID = 102; // 0x66
    field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B;
    field public static final int MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B_ID = 105; // 0x69
    field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_SYMBOLS;
    field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_ARROWS;
    field public static final int MISCELLANEOUS_SYMBOLS_AND_ARROWS_ID = 115; // 0x73
    field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS;
    field public static final int MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS_ID = 205; // 0xcd
    field public static final int MISCELLANEOUS_SYMBOLS_ID = 55; // 0x37
    field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_TECHNICAL;
    field public static final int MISCELLANEOUS_TECHNICAL_ID = 48; // 0x30
    field public static final android.icu.lang.UCharacter.UnicodeBlock MODI;
    field public static final android.icu.lang.UCharacter.UnicodeBlock MODIFIER_TONE_LETTERS;
    field public static final int MODIFIER_TONE_LETTERS_ID = 138; // 0x8a
    field public static final int MODI_ID = 236; // 0xec
    field public static final android.icu.lang.UCharacter.UnicodeBlock MONGOLIAN;
    field public static final int MONGOLIAN_ID = 37; // 0x25
    field public static final android.icu.lang.UCharacter.UnicodeBlock MONGOLIAN_SUPPLEMENT;
    field public static final int MONGOLIAN_SUPPLEMENT_ID = 269; // 0x10d
    field public static final android.icu.lang.UCharacter.UnicodeBlock MRO;
    field public static final int MRO_ID = 237; // 0xed
    field public static final android.icu.lang.UCharacter.UnicodeBlock MULTANI;
    field public static final int MULTANI_ID = 259; // 0x103
    field public static final android.icu.lang.UCharacter.UnicodeBlock MUSICAL_SYMBOLS;
    field public static final int MUSICAL_SYMBOLS_ID = 92; // 0x5c
    field public static final android.icu.lang.UCharacter.UnicodeBlock MYANMAR;
    field public static final android.icu.lang.UCharacter.UnicodeBlock MYANMAR_EXTENDED_A;
    field public static final int MYANMAR_EXTENDED_A_ID = 182; // 0xb6
    field public static final android.icu.lang.UCharacter.UnicodeBlock MYANMAR_EXTENDED_B;
    field public static final int MYANMAR_EXTENDED_B_ID = 238; // 0xee
    field public static final int MYANMAR_ID = 28; // 0x1c
    field public static final android.icu.lang.UCharacter.UnicodeBlock NABATAEAN;
    field public static final int NABATAEAN_ID = 239; // 0xef
    field public static final android.icu.lang.UCharacter.UnicodeBlock NEWA;
    field public static final int NEWA_ID = 270; // 0x10e
    field public static final android.icu.lang.UCharacter.UnicodeBlock NEW_TAI_LUE;
    field public static final int NEW_TAI_LUE_ID = 139; // 0x8b
    field public static final android.icu.lang.UCharacter.UnicodeBlock NKO;
    field public static final int NKO_ID = 146; // 0x92
    field public static final android.icu.lang.UCharacter.UnicodeBlock NO_BLOCK;
    field public static final android.icu.lang.UCharacter.UnicodeBlock NUMBER_FORMS;
    field public static final int NUMBER_FORMS_ID = 45; // 0x2d
    field public static final android.icu.lang.UCharacter.UnicodeBlock NUSHU;
    field public static final int NUSHU_ID = 277; // 0x115
    field public static final android.icu.lang.UCharacter.UnicodeBlock OGHAM;
    field public static final int OGHAM_ID = 34; // 0x22
    field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_HUNGARIAN;
    field public static final int OLD_HUNGARIAN_ID = 260; // 0x104
    field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_ITALIC;
    field public static final int OLD_ITALIC_ID = 88; // 0x58
    field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_NORTH_ARABIAN;
    field public static final int OLD_NORTH_ARABIAN_ID = 240; // 0xf0
    field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_PERMIC;
    field public static final int OLD_PERMIC_ID = 241; // 0xf1
    field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_PERSIAN;
    field public static final int OLD_PERSIAN_ID = 140; // 0x8c
    field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_SOGDIAN;
    field public static final int OLD_SOGDIAN_ID = 290; // 0x122
    field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_SOUTH_ARABIAN;
    field public static final int OLD_SOUTH_ARABIAN_ID = 187; // 0xbb
    field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_TURKIC;
    field public static final int OLD_TURKIC_ID = 191; // 0xbf
    field public static final android.icu.lang.UCharacter.UnicodeBlock OL_CHIKI;
    field public static final int OL_CHIKI_ID = 157; // 0x9d
    field public static final android.icu.lang.UCharacter.UnicodeBlock OPTICAL_CHARACTER_RECOGNITION;
    field public static final int OPTICAL_CHARACTER_RECOGNITION_ID = 50; // 0x32
    field public static final android.icu.lang.UCharacter.UnicodeBlock ORIYA;
    field public static final int ORIYA_ID = 19; // 0x13
    field public static final android.icu.lang.UCharacter.UnicodeBlock ORNAMENTAL_DINGBATS;
    field public static final int ORNAMENTAL_DINGBATS_ID = 242; // 0xf2
    field public static final android.icu.lang.UCharacter.UnicodeBlock OSAGE;
    field public static final int OSAGE_ID = 271; // 0x10f
    field public static final android.icu.lang.UCharacter.UnicodeBlock OSMANYA;
    field public static final int OSMANYA_ID = 122; // 0x7a
    field public static final android.icu.lang.UCharacter.UnicodeBlock PAHAWH_HMONG;
    field public static final int PAHAWH_HMONG_ID = 243; // 0xf3
    field public static final android.icu.lang.UCharacter.UnicodeBlock PALMYRENE;
    field public static final int PALMYRENE_ID = 244; // 0xf4
    field public static final android.icu.lang.UCharacter.UnicodeBlock PAU_CIN_HAU;
    field public static final int PAU_CIN_HAU_ID = 245; // 0xf5
    field public static final android.icu.lang.UCharacter.UnicodeBlock PHAGS_PA;
    field public static final int PHAGS_PA_ID = 150; // 0x96
    field public static final android.icu.lang.UCharacter.UnicodeBlock PHAISTOS_DISC;
    field public static final int PHAISTOS_DISC_ID = 166; // 0xa6
    field public static final android.icu.lang.UCharacter.UnicodeBlock PHOENICIAN;
    field public static final int PHOENICIAN_ID = 151; // 0x97
    field public static final android.icu.lang.UCharacter.UnicodeBlock PHONETIC_EXTENSIONS;
    field public static final int PHONETIC_EXTENSIONS_ID = 114; // 0x72
    field public static final android.icu.lang.UCharacter.UnicodeBlock PHONETIC_EXTENSIONS_SUPPLEMENT;
    field public static final int PHONETIC_EXTENSIONS_SUPPLEMENT_ID = 141; // 0x8d
    field public static final android.icu.lang.UCharacter.UnicodeBlock PLAYING_CARDS;
    field public static final int PLAYING_CARDS_ID = 204; // 0xcc
    field public static final android.icu.lang.UCharacter.UnicodeBlock PRIVATE_USE;
    field public static final android.icu.lang.UCharacter.UnicodeBlock PRIVATE_USE_AREA;
    field public static final int PRIVATE_USE_AREA_ID = 78; // 0x4e
    field public static final int PRIVATE_USE_ID = 78; // 0x4e
    field public static final android.icu.lang.UCharacter.UnicodeBlock PSALTER_PAHLAVI;
    field public static final int PSALTER_PAHLAVI_ID = 246; // 0xf6
    field public static final android.icu.lang.UCharacter.UnicodeBlock REJANG;
    field public static final int REJANG_ID = 163; // 0xa3
    field public static final android.icu.lang.UCharacter.UnicodeBlock RUMI_NUMERAL_SYMBOLS;
    field public static final int RUMI_NUMERAL_SYMBOLS_ID = 192; // 0xc0
    field public static final android.icu.lang.UCharacter.UnicodeBlock RUNIC;
    field public static final int RUNIC_ID = 35; // 0x23
    field public static final android.icu.lang.UCharacter.UnicodeBlock SAMARITAN;
    field public static final int SAMARITAN_ID = 172; // 0xac
    field public static final android.icu.lang.UCharacter.UnicodeBlock SAURASHTRA;
    field public static final int SAURASHTRA_ID = 161; // 0xa1
    field public static final android.icu.lang.UCharacter.UnicodeBlock SHARADA;
    field public static final int SHARADA_ID = 217; // 0xd9
    field public static final android.icu.lang.UCharacter.UnicodeBlock SHAVIAN;
    field public static final int SHAVIAN_ID = 121; // 0x79
    field public static final android.icu.lang.UCharacter.UnicodeBlock SHORTHAND_FORMAT_CONTROLS;
    field public static final int SHORTHAND_FORMAT_CONTROLS_ID = 247; // 0xf7
    field public static final android.icu.lang.UCharacter.UnicodeBlock SIDDHAM;
    field public static final int SIDDHAM_ID = 248; // 0xf8
    field public static final android.icu.lang.UCharacter.UnicodeBlock SINHALA;
    field public static final android.icu.lang.UCharacter.UnicodeBlock SINHALA_ARCHAIC_NUMBERS;
    field public static final int SINHALA_ARCHAIC_NUMBERS_ID = 249; // 0xf9
    field public static final int SINHALA_ID = 24; // 0x18
    field public static final android.icu.lang.UCharacter.UnicodeBlock SMALL_FORM_VARIANTS;
    field public static final int SMALL_FORM_VARIANTS_ID = 84; // 0x54
    field public static final android.icu.lang.UCharacter.UnicodeBlock SOGDIAN;
    field public static final int SOGDIAN_ID = 291; // 0x123
    field public static final android.icu.lang.UCharacter.UnicodeBlock SORA_SOMPENG;
    field public static final int SORA_SOMPENG_ID = 218; // 0xda
    field public static final android.icu.lang.UCharacter.UnicodeBlock SOYOMBO;
    field public static final int SOYOMBO_ID = 278; // 0x116
    field public static final android.icu.lang.UCharacter.UnicodeBlock SPACING_MODIFIER_LETTERS;
    field public static final int SPACING_MODIFIER_LETTERS_ID = 6; // 0x6
    field public static final android.icu.lang.UCharacter.UnicodeBlock SPECIALS;
    field public static final int SPECIALS_ID = 86; // 0x56
    field public static final android.icu.lang.UCharacter.UnicodeBlock SUNDANESE;
    field public static final int SUNDANESE_ID = 155; // 0x9b
    field public static final android.icu.lang.UCharacter.UnicodeBlock SUNDANESE_SUPPLEMENT;
    field public static final int SUNDANESE_SUPPLEMENT_ID = 219; // 0xdb
    field public static final android.icu.lang.UCharacter.UnicodeBlock SUPERSCRIPTS_AND_SUBSCRIPTS;
    field public static final int SUPERSCRIPTS_AND_SUBSCRIPTS_ID = 41; // 0x29
    field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_ARROWS_A;
    field public static final int SUPPLEMENTAL_ARROWS_A_ID = 103; // 0x67
    field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_ARROWS_B;
    field public static final int SUPPLEMENTAL_ARROWS_B_ID = 104; // 0x68
    field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_ARROWS_C;
    field public static final int SUPPLEMENTAL_ARROWS_C_ID = 250; // 0xfa
    field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_MATHEMATICAL_OPERATORS;
    field public static final int SUPPLEMENTAL_MATHEMATICAL_OPERATORS_ID = 106; // 0x6a
    field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_PUNCTUATION;
    field public static final int SUPPLEMENTAL_PUNCTUATION_ID = 142; // 0x8e
    field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS;
    field public static final int SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS_ID = 261; // 0x105
    field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_A;
    field public static final int SUPPLEMENTARY_PRIVATE_USE_AREA_A_ID = 109; // 0x6d
    field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_B;
    field public static final int SUPPLEMENTARY_PRIVATE_USE_AREA_B_ID = 110; // 0x6e
    field public static final android.icu.lang.UCharacter.UnicodeBlock SUTTON_SIGNWRITING;
    field public static final int SUTTON_SIGNWRITING_ID = 262; // 0x106
    field public static final android.icu.lang.UCharacter.UnicodeBlock SYLOTI_NAGRI;
    field public static final int SYLOTI_NAGRI_ID = 143; // 0x8f
    field public static final android.icu.lang.UCharacter.UnicodeBlock SYRIAC;
    field public static final int SYRIAC_ID = 13; // 0xd
    field public static final android.icu.lang.UCharacter.UnicodeBlock SYRIAC_SUPPLEMENT;
    field public static final int SYRIAC_SUPPLEMENT_ID = 279; // 0x117
    field public static final android.icu.lang.UCharacter.UnicodeBlock TAGALOG;
    field public static final int TAGALOG_ID = 98; // 0x62
    field public static final android.icu.lang.UCharacter.UnicodeBlock TAGBANWA;
    field public static final int TAGBANWA_ID = 101; // 0x65
    field public static final android.icu.lang.UCharacter.UnicodeBlock TAGS;
    field public static final int TAGS_ID = 96; // 0x60
    field public static final android.icu.lang.UCharacter.UnicodeBlock TAI_LE;
    field public static final int TAI_LE_ID = 112; // 0x70
    field public static final android.icu.lang.UCharacter.UnicodeBlock TAI_THAM;
    field public static final int TAI_THAM_ID = 174; // 0xae
    field public static final android.icu.lang.UCharacter.UnicodeBlock TAI_VIET;
    field public static final int TAI_VIET_ID = 183; // 0xb7
    field public static final android.icu.lang.UCharacter.UnicodeBlock TAI_XUAN_JING_SYMBOLS;
    field public static final int TAI_XUAN_JING_SYMBOLS_ID = 124; // 0x7c
    field public static final android.icu.lang.UCharacter.UnicodeBlock TAKRI;
    field public static final int TAKRI_ID = 220; // 0xdc
    field public static final android.icu.lang.UCharacter.UnicodeBlock TAMIL;
    field public static final int TAMIL_ID = 20; // 0x14
    field public static final android.icu.lang.UCharacter.UnicodeBlock TANGUT;
    field public static final android.icu.lang.UCharacter.UnicodeBlock TANGUT_COMPONENTS;
    field public static final int TANGUT_COMPONENTS_ID = 273; // 0x111
    field public static final int TANGUT_ID = 272; // 0x110
    field public static final android.icu.lang.UCharacter.UnicodeBlock TELUGU;
    field public static final int TELUGU_ID = 21; // 0x15
    field public static final android.icu.lang.UCharacter.UnicodeBlock THAANA;
    field public static final int THAANA_ID = 14; // 0xe
    field public static final android.icu.lang.UCharacter.UnicodeBlock THAI;
    field public static final int THAI_ID = 25; // 0x19
    field public static final android.icu.lang.UCharacter.UnicodeBlock TIBETAN;
    field public static final int TIBETAN_ID = 27; // 0x1b
    field public static final android.icu.lang.UCharacter.UnicodeBlock TIFINAGH;
    field public static final int TIFINAGH_ID = 144; // 0x90
    field public static final android.icu.lang.UCharacter.UnicodeBlock TIRHUTA;
    field public static final int TIRHUTA_ID = 251; // 0xfb
    field public static final android.icu.lang.UCharacter.UnicodeBlock TRANSPORT_AND_MAP_SYMBOLS;
    field public static final int TRANSPORT_AND_MAP_SYMBOLS_ID = 207; // 0xcf
    field public static final android.icu.lang.UCharacter.UnicodeBlock UGARITIC;
    field public static final int UGARITIC_ID = 120; // 0x78
    field public static final android.icu.lang.UCharacter.UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS;
    field public static final android.icu.lang.UCharacter.UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED;
    field public static final int UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_ID = 173; // 0xad
    field public static final int UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_ID = 33; // 0x21
    field public static final android.icu.lang.UCharacter.UnicodeBlock VAI;
    field public static final int VAI_ID = 159; // 0x9f
    field public static final android.icu.lang.UCharacter.UnicodeBlock VARIATION_SELECTORS;
    field public static final int VARIATION_SELECTORS_ID = 108; // 0x6c
    field public static final android.icu.lang.UCharacter.UnicodeBlock VARIATION_SELECTORS_SUPPLEMENT;
    field public static final int VARIATION_SELECTORS_SUPPLEMENT_ID = 125; // 0x7d
    field public static final android.icu.lang.UCharacter.UnicodeBlock VEDIC_EXTENSIONS;
    field public static final int VEDIC_EXTENSIONS_ID = 175; // 0xaf
    field public static final android.icu.lang.UCharacter.UnicodeBlock VERTICAL_FORMS;
    field public static final int VERTICAL_FORMS_ID = 145; // 0x91
    field public static final android.icu.lang.UCharacter.UnicodeBlock WARANG_CITI;
    field public static final int WARANG_CITI_ID = 252; // 0xfc
    field public static final android.icu.lang.UCharacter.UnicodeBlock YIJING_HEXAGRAM_SYMBOLS;
    field public static final int YIJING_HEXAGRAM_SYMBOLS_ID = 116; // 0x74
    field public static final android.icu.lang.UCharacter.UnicodeBlock YI_RADICALS;
    field public static final int YI_RADICALS_ID = 73; // 0x49
    field public static final android.icu.lang.UCharacter.UnicodeBlock YI_SYLLABLES;
    field public static final int YI_SYLLABLES_ID = 72; // 0x48
    field public static final android.icu.lang.UCharacter.UnicodeBlock ZANABAZAR_SQUARE;
    field public static final int ZANABAZAR_SQUARE_ID = 280; // 0x118
  }

  public static interface UCharacter.VerticalOrientation {
    field public static final int ROTATED = 0; // 0x0
    field public static final int TRANSFORMED_ROTATED = 1; // 0x1
    field public static final int TRANSFORMED_UPRIGHT = 2; // 0x2
    field public static final int UPRIGHT = 3; // 0x3
  }

  public static interface UCharacter.WordBreak {
    field public static final int ALETTER = 1; // 0x1
    field public static final int CR = 8; // 0x8
    field public static final int DOUBLE_QUOTE = 16; // 0x10
    field public static final int EXTEND = 9; // 0x9
    field public static final int EXTENDNUMLET = 7; // 0x7
    field public static final int E_BASE = 17; // 0x11
    field public static final int E_BASE_GAZ = 18; // 0x12
    field public static final int E_MODIFIER = 19; // 0x13
    field public static final int FORMAT = 2; // 0x2
    field public static final int GLUE_AFTER_ZWJ = 20; // 0x14
    field public static final int HEBREW_LETTER = 14; // 0xe
    field public static final int KATAKANA = 3; // 0x3
    field public static final int LF = 10; // 0xa
    field public static final int MIDLETTER = 4; // 0x4
    field public static final int MIDNUM = 5; // 0x5
    field public static final int MIDNUMLET = 11; // 0xb
    field public static final int NEWLINE = 12; // 0xc
    field public static final int NUMERIC = 6; // 0x6
    field public static final int OTHER = 0; // 0x0
    field public static final int REGIONAL_INDICATOR = 13; // 0xd
    field public static final int SINGLE_QUOTE = 15; // 0xf
    field public static final int WSEGSPACE = 22; // 0x16
    field public static final int ZWJ = 21; // 0x15
  }

  public final class UCharacterCategory implements android.icu.lang.UCharacterEnums.ECharacterCategory {
    method public static String toString(int);
  }

  public final class UCharacterDirection implements android.icu.lang.UCharacterEnums.ECharacterDirection {
    method public static String toString(int);
  }

  public class UCharacterEnums {
  }

  public static interface UCharacterEnums.ECharacterCategory {
    field public static final byte COMBINING_SPACING_MARK = 8; // 0x8
    field public static final byte CONNECTOR_PUNCTUATION = 22; // 0x16
    field public static final byte CONTROL = 15; // 0xf
    field public static final byte CURRENCY_SYMBOL = 25; // 0x19
    field public static final byte DASH_PUNCTUATION = 19; // 0x13
    field public static final byte DECIMAL_DIGIT_NUMBER = 9; // 0x9
    field public static final byte ENCLOSING_MARK = 7; // 0x7
    field public static final byte END_PUNCTUATION = 21; // 0x15
    field public static final byte FINAL_PUNCTUATION = 29; // 0x1d
    field public static final byte FINAL_QUOTE_PUNCTUATION = 29; // 0x1d
    field public static final byte FORMAT = 16; // 0x10
    field public static final byte GENERAL_OTHER_TYPES = 0; // 0x0
    field public static final byte INITIAL_PUNCTUATION = 28; // 0x1c
    field public static final byte INITIAL_QUOTE_PUNCTUATION = 28; // 0x1c
    field public static final byte LETTER_NUMBER = 10; // 0xa
    field public static final byte LINE_SEPARATOR = 13; // 0xd
    field public static final byte LOWERCASE_LETTER = 2; // 0x2
    field public static final byte MATH_SYMBOL = 24; // 0x18
    field public static final byte MODIFIER_LETTER = 4; // 0x4
    field public static final byte MODIFIER_SYMBOL = 26; // 0x1a
    field public static final byte NON_SPACING_MARK = 6; // 0x6
    field public static final byte OTHER_LETTER = 5; // 0x5
    field public static final byte OTHER_NUMBER = 11; // 0xb
    field public static final byte OTHER_PUNCTUATION = 23; // 0x17
    field public static final byte OTHER_SYMBOL = 27; // 0x1b
    field public static final byte PARAGRAPH_SEPARATOR = 14; // 0xe
    field public static final byte PRIVATE_USE = 17; // 0x11
    field public static final byte SPACE_SEPARATOR = 12; // 0xc
    field public static final byte START_PUNCTUATION = 20; // 0x14
    field public static final byte SURROGATE = 18; // 0x12
    field public static final byte TITLECASE_LETTER = 3; // 0x3
    field public static final byte UNASSIGNED = 0; // 0x0
    field public static final byte UPPERCASE_LETTER = 1; // 0x1
  }

  public static interface UCharacterEnums.ECharacterDirection {
    field public static final int ARABIC_NUMBER = 5; // 0x5
    field public static final int BLOCK_SEPARATOR = 7; // 0x7
    field public static final int BOUNDARY_NEUTRAL = 18; // 0x12
    field public static final int COMMON_NUMBER_SEPARATOR = 6; // 0x6
    field public static final byte DIRECTIONALITY_ARABIC_NUMBER = 5; // 0x5
    field public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL = 18; // 0x12
    field public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR = 6; // 0x6
    field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER = 2; // 0x2
    field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR = 3; // 0x3
    field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR = 4; // 0x4
    field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT = 0; // 0x0
    field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING = 11; // 0xb
    field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE = 12; // 0xc
    field public static final byte DIRECTIONALITY_NONSPACING_MARK = 17; // 0x11
    field public static final byte DIRECTIONALITY_OTHER_NEUTRALS = 10; // 0xa
    field public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR = 7; // 0x7
    field public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = 16; // 0x10
    field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT = 1; // 0x1
    field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC = 13; // 0xd
    field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING = 14; // 0xe
    field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE = 15; // 0xf
    field public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR = 8; // 0x8
    field public static final byte DIRECTIONALITY_UNDEFINED = -1; // 0xffffffff
    field public static final byte DIRECTIONALITY_WHITESPACE = 9; // 0x9
    field public static final int DIR_NON_SPACING_MARK = 17; // 0x11
    field public static final int EUROPEAN_NUMBER = 2; // 0x2
    field public static final int EUROPEAN_NUMBER_SEPARATOR = 3; // 0x3
    field public static final int EUROPEAN_NUMBER_TERMINATOR = 4; // 0x4
    field public static final byte FIRST_STRONG_ISOLATE = 19; // 0x13
    field public static final int LEFT_TO_RIGHT = 0; // 0x0
    field public static final int LEFT_TO_RIGHT_EMBEDDING = 11; // 0xb
    field public static final byte LEFT_TO_RIGHT_ISOLATE = 20; // 0x14
    field public static final int LEFT_TO_RIGHT_OVERRIDE = 12; // 0xc
    field public static final int OTHER_NEUTRAL = 10; // 0xa
    field public static final int POP_DIRECTIONAL_FORMAT = 16; // 0x10
    field public static final byte POP_DIRECTIONAL_ISOLATE = 22; // 0x16
    field public static final int RIGHT_TO_LEFT = 1; // 0x1
    field public static final int RIGHT_TO_LEFT_ARABIC = 13; // 0xd
    field public static final int RIGHT_TO_LEFT_EMBEDDING = 14; // 0xe
    field public static final byte RIGHT_TO_LEFT_ISOLATE = 21; // 0x15
    field public static final int RIGHT_TO_LEFT_OVERRIDE = 15; // 0xf
    field public static final int SEGMENT_SEPARATOR = 8; // 0x8
    field public static final int WHITE_SPACE_NEUTRAL = 9; // 0x9
  }

  public interface UProperty {
    field public static final int AGE = 16384; // 0x4000
    field public static final int ALPHABETIC = 0; // 0x0
    field public static final int ASCII_HEX_DIGIT = 1; // 0x1
    field public static final int BIDI_CLASS = 4096; // 0x1000
    field public static final int BIDI_CONTROL = 2; // 0x2
    field public static final int BIDI_MIRRORED = 3; // 0x3
    field public static final int BIDI_MIRRORING_GLYPH = 16385; // 0x4001
    field public static final int BIDI_PAIRED_BRACKET = 16397; // 0x400d
    field public static final int BIDI_PAIRED_BRACKET_TYPE = 4117; // 0x1015
    field public static final int BINARY_START = 0; // 0x0
    field public static final int BLOCK = 4097; // 0x1001
    field public static final int CANONICAL_COMBINING_CLASS = 4098; // 0x1002
    field public static final int CASED = 49; // 0x31
    field public static final int CASE_FOLDING = 16386; // 0x4002
    field public static final int CASE_IGNORABLE = 50; // 0x32
    field public static final int CASE_SENSITIVE = 34; // 0x22
    field public static final int CHANGES_WHEN_CASEFOLDED = 54; // 0x36
    field public static final int CHANGES_WHEN_CASEMAPPED = 55; // 0x37
    field public static final int CHANGES_WHEN_LOWERCASED = 51; // 0x33
    field public static final int CHANGES_WHEN_NFKC_CASEFOLDED = 56; // 0x38
    field public static final int CHANGES_WHEN_TITLECASED = 53; // 0x35
    field public static final int CHANGES_WHEN_UPPERCASED = 52; // 0x34
    field public static final int DASH = 4; // 0x4
    field public static final int DECOMPOSITION_TYPE = 4099; // 0x1003
    field public static final int DEFAULT_IGNORABLE_CODE_POINT = 5; // 0x5
    field public static final int DEPRECATED = 6; // 0x6
    field public static final int DIACRITIC = 7; // 0x7
    field public static final int DOUBLE_START = 12288; // 0x3000
    field public static final int EAST_ASIAN_WIDTH = 4100; // 0x1004
    field public static final int EMOJI = 57; // 0x39
    field public static final int EMOJI_COMPONENT = 61; // 0x3d
    field public static final int EMOJI_MODIFIER = 59; // 0x3b
    field public static final int EMOJI_MODIFIER_BASE = 60; // 0x3c
    field public static final int EMOJI_PRESENTATION = 58; // 0x3a
    field public static final int EXTENDED_PICTOGRAPHIC = 64; // 0x40
    field public static final int EXTENDER = 8; // 0x8
    field public static final int FULL_COMPOSITION_EXCLUSION = 9; // 0x9
    field public static final int GENERAL_CATEGORY = 4101; // 0x1005
    field public static final int GENERAL_CATEGORY_MASK = 8192; // 0x2000
    field public static final int GRAPHEME_BASE = 10; // 0xa
    field public static final int GRAPHEME_CLUSTER_BREAK = 4114; // 0x1012
    field public static final int GRAPHEME_EXTEND = 11; // 0xb
    field public static final int GRAPHEME_LINK = 12; // 0xc
    field public static final int HANGUL_SYLLABLE_TYPE = 4107; // 0x100b
    field public static final int HEX_DIGIT = 13; // 0xd
    field public static final int HYPHEN = 14; // 0xe
    field public static final int IDEOGRAPHIC = 17; // 0x11
    field public static final int IDS_BINARY_OPERATOR = 18; // 0x12
    field public static final int IDS_TRINARY_OPERATOR = 19; // 0x13
    field public static final int ID_CONTINUE = 15; // 0xf
    field public static final int ID_START = 16; // 0x10
    field public static final int INDIC_POSITIONAL_CATEGORY = 4118; // 0x1016
    field public static final int INDIC_SYLLABIC_CATEGORY = 4119; // 0x1017
    field public static final int INT_START = 4096; // 0x1000
    field public static final int JOINING_GROUP = 4102; // 0x1006
    field public static final int JOINING_TYPE = 4103; // 0x1007
    field public static final int JOIN_CONTROL = 20; // 0x14
    field public static final int LEAD_CANONICAL_COMBINING_CLASS = 4112; // 0x1010
    field public static final int LINE_BREAK = 4104; // 0x1008
    field public static final int LOGICAL_ORDER_EXCEPTION = 21; // 0x15
    field public static final int LOWERCASE = 22; // 0x16
    field public static final int LOWERCASE_MAPPING = 16388; // 0x4004
    field public static final int MASK_START = 8192; // 0x2000
    field public static final int MATH = 23; // 0x17
    field public static final int NAME = 16389; // 0x4005
    field public static final int NFC_INERT = 39; // 0x27
    field public static final int NFC_QUICK_CHECK = 4110; // 0x100e
    field public static final int NFD_INERT = 37; // 0x25
    field public static final int NFD_QUICK_CHECK = 4108; // 0x100c
    field public static final int NFKC_INERT = 40; // 0x28
    field public static final int NFKC_QUICK_CHECK = 4111; // 0x100f
    field public static final int NFKD_INERT = 38; // 0x26
    field public static final int NFKD_QUICK_CHECK = 4109; // 0x100d
    field public static final int NONCHARACTER_CODE_POINT = 24; // 0x18
    field public static final int NUMERIC_TYPE = 4105; // 0x1009
    field public static final int NUMERIC_VALUE = 12288; // 0x3000
    field public static final int OTHER_PROPERTY_START = 28672; // 0x7000
    field public static final int PATTERN_SYNTAX = 42; // 0x2a
    field public static final int PATTERN_WHITE_SPACE = 43; // 0x2b
    field public static final int POSIX_ALNUM = 44; // 0x2c
    field public static final int POSIX_BLANK = 45; // 0x2d
    field public static final int POSIX_GRAPH = 46; // 0x2e
    field public static final int POSIX_PRINT = 47; // 0x2f
    field public static final int POSIX_XDIGIT = 48; // 0x30
    field public static final int PREPENDED_CONCATENATION_MARK = 63; // 0x3f
    field public static final int QUOTATION_MARK = 25; // 0x19
    field public static final int RADICAL = 26; // 0x1a
    field public static final int REGIONAL_INDICATOR = 62; // 0x3e
    field public static final int SCRIPT = 4106; // 0x100a
    field public static final int SCRIPT_EXTENSIONS = 28672; // 0x7000
    field public static final int SEGMENT_STARTER = 41; // 0x29
    field public static final int SENTENCE_BREAK = 4115; // 0x1013
    field public static final int SIMPLE_CASE_FOLDING = 16390; // 0x4006
    field public static final int SIMPLE_LOWERCASE_MAPPING = 16391; // 0x4007
    field public static final int SIMPLE_TITLECASE_MAPPING = 16392; // 0x4008
    field public static final int SIMPLE_UPPERCASE_MAPPING = 16393; // 0x4009
    field public static final int SOFT_DOTTED = 27; // 0x1b
    field public static final int STRING_START = 16384; // 0x4000
    field public static final int S_TERM = 35; // 0x23
    field public static final int TERMINAL_PUNCTUATION = 28; // 0x1c
    field public static final int TITLECASE_MAPPING = 16394; // 0x400a
    field public static final int TRAIL_CANONICAL_COMBINING_CLASS = 4113; // 0x1011
    field public static final int UNIFIED_IDEOGRAPH = 29; // 0x1d
    field public static final int UPPERCASE = 30; // 0x1e
    field public static final int UPPERCASE_MAPPING = 16396; // 0x400c
    field public static final int VARIATION_SELECTOR = 36; // 0x24
    field public static final int VERTICAL_ORIENTATION = 4120; // 0x1018
    field public static final int WHITE_SPACE = 31; // 0x1f
    field public static final int WORD_BREAK = 4116; // 0x1014
    field public static final int XID_CONTINUE = 32; // 0x20
    field public static final int XID_START = 33; // 0x21
  }

  public static interface UProperty.NameChoice {
    field public static final int LONG = 1; // 0x1
    field public static final int SHORT = 0; // 0x0
  }

  public final class UScript {
    method public static boolean breaksBetweenLetters(int);
    method public static int[] getCode(java.util.Locale);
    method public static int[] getCode(android.icu.util.ULocale);
    method public static int[] getCode(String);
    method public static int getCodeFromName(String);
    method public static String getName(int);
    method public static String getSampleString(int);
    method public static int getScript(int);
    method public static int getScriptExtensions(int, java.util.BitSet);
    method public static String getShortName(int);
    method public static android.icu.lang.UScript.ScriptUsage getUsage(int);
    method public static boolean hasScript(int, int);
    method public static boolean isCased(int);
    method public static boolean isRightToLeft(int);
    field public static final int ADLAM = 167; // 0xa7
    field public static final int AFAKA = 147; // 0x93
    field public static final int AHOM = 161; // 0xa1
    field public static final int ANATOLIAN_HIEROGLYPHS = 156; // 0x9c
    field public static final int ARABIC = 2; // 0x2
    field public static final int ARMENIAN = 3; // 0x3
    field public static final int AVESTAN = 117; // 0x75
    field public static final int BALINESE = 62; // 0x3e
    field public static final int BAMUM = 130; // 0x82
    field public static final int BASSA_VAH = 134; // 0x86
    field public static final int BATAK = 63; // 0x3f
    field public static final int BENGALI = 4; // 0x4
    field public static final int BHAIKSUKI = 168; // 0xa8
    field public static final int BLISSYMBOLS = 64; // 0x40
    field public static final int BOOK_PAHLAVI = 124; // 0x7c
    field public static final int BOPOMOFO = 5; // 0x5
    field public static final int BRAHMI = 65; // 0x41
    field public static final int BRAILLE = 46; // 0x2e
    field public static final int BUGINESE = 55; // 0x37
    field public static final int BUHID = 44; // 0x2c
    field public static final int CANADIAN_ABORIGINAL = 40; // 0x28
    field public static final int CARIAN = 104; // 0x68
    field public static final int CAUCASIAN_ALBANIAN = 159; // 0x9f
    field public static final int CHAKMA = 118; // 0x76
    field public static final int CHAM = 66; // 0x42
    field public static final int CHEROKEE = 6; // 0x6
    field public static final int CIRTH = 67; // 0x43
    field public static final int COMMON = 0; // 0x0
    field public static final int COPTIC = 7; // 0x7
    field public static final int CUNEIFORM = 101; // 0x65
    field public static final int CYPRIOT = 47; // 0x2f
    field public static final int CYRILLIC = 8; // 0x8
    field public static final int DEMOTIC_EGYPTIAN = 69; // 0x45
    field public static final int DESERET = 9; // 0x9
    field public static final int DEVANAGARI = 10; // 0xa
    field public static final int DOGRA = 178; // 0xb2
    field public static final int DUPLOYAN = 135; // 0x87
    field public static final int EASTERN_SYRIAC = 97; // 0x61
    field public static final int EGYPTIAN_HIEROGLYPHS = 71; // 0x47
    field public static final int ELBASAN = 136; // 0x88
    field public static final int ESTRANGELO_SYRIAC = 95; // 0x5f
    field public static final int ETHIOPIC = 11; // 0xb
    field public static final int GEORGIAN = 12; // 0xc
    field public static final int GLAGOLITIC = 56; // 0x38
    field public static final int GOTHIC = 13; // 0xd
    field public static final int GRANTHA = 137; // 0x89
    field public static final int GREEK = 14; // 0xe
    field public static final int GUJARATI = 15; // 0xf
    field public static final int GUNJALA_GONDI = 179; // 0xb3
    field public static final int GURMUKHI = 16; // 0x10
    field public static final int HAN = 17; // 0x11
    field public static final int HANGUL = 18; // 0x12
    field public static final int HANIFI_ROHINGYA = 182; // 0xb6
    field public static final int HANUNOO = 43; // 0x2b
    field public static final int HAN_WITH_BOPOMOFO = 172; // 0xac
    field public static final int HARAPPAN_INDUS = 77; // 0x4d
    field public static final int HATRAN = 162; // 0xa2
    field public static final int HEBREW = 19; // 0x13
    field public static final int HIERATIC_EGYPTIAN = 70; // 0x46
    field public static final int HIRAGANA = 20; // 0x14
    field public static final int IMPERIAL_ARAMAIC = 116; // 0x74
    field public static final int INHERITED = 1; // 0x1
    field public static final int INSCRIPTIONAL_PAHLAVI = 122; // 0x7a
    field public static final int INSCRIPTIONAL_PARTHIAN = 125; // 0x7d
    field public static final int INVALID_CODE = -1; // 0xffffffff
    field public static final int JAMO = 173; // 0xad
    field public static final int JAPANESE = 105; // 0x69
    field public static final int JAVANESE = 78; // 0x4e
    field public static final int JURCHEN = 148; // 0x94
    field public static final int KAITHI = 120; // 0x78
    field public static final int KANNADA = 21; // 0x15
    field public static final int KATAKANA = 22; // 0x16
    field public static final int KATAKANA_OR_HIRAGANA = 54; // 0x36
    field public static final int KAYAH_LI = 79; // 0x4f
    field public static final int KHAROSHTHI = 57; // 0x39
    field public static final int KHMER = 23; // 0x17
    field public static final int KHOJKI = 157; // 0x9d
    field public static final int KHUDAWADI = 145; // 0x91
    field public static final int KHUTSURI = 72; // 0x48
    field public static final int KOREAN = 119; // 0x77
    field public static final int KPELLE = 138; // 0x8a
    field public static final int LANNA = 106; // 0x6a
    field public static final int LAO = 24; // 0x18
    field public static final int LATIN = 25; // 0x19
    field public static final int LATIN_FRAKTUR = 80; // 0x50
    field public static final int LATIN_GAELIC = 81; // 0x51
    field public static final int LEPCHA = 82; // 0x52
    field public static final int LIMBU = 48; // 0x30
    field public static final int LINEAR_A = 83; // 0x53
    field public static final int LINEAR_B = 49; // 0x31
    field public static final int LISU = 131; // 0x83
    field public static final int LOMA = 139; // 0x8b
    field public static final int LYCIAN = 107; // 0x6b
    field public static final int LYDIAN = 108; // 0x6c
    field public static final int MAHAJANI = 160; // 0xa0
    field public static final int MAKASAR = 180; // 0xb4
    field public static final int MALAYALAM = 26; // 0x1a
    field public static final int MANDAEAN = 84; // 0x54
    field public static final int MANDAIC = 84; // 0x54
    field public static final int MANICHAEAN = 121; // 0x79
    field public static final int MARCHEN = 169; // 0xa9
    field public static final int MASARAM_GONDI = 175; // 0xaf
    field public static final int MATHEMATICAL_NOTATION = 128; // 0x80
    field public static final int MAYAN_HIEROGLYPHS = 85; // 0x55
    field public static final int MEDEFAIDRIN = 181; // 0xb5
    field public static final int MEITEI_MAYEK = 115; // 0x73
    field public static final int MENDE = 140; // 0x8c
    field public static final int MEROITIC = 86; // 0x56
    field public static final int MEROITIC_CURSIVE = 141; // 0x8d
    field public static final int MEROITIC_HIEROGLYPHS = 86; // 0x56
    field public static final int MIAO = 92; // 0x5c
    field public static final int MODI = 163; // 0xa3
    field public static final int MONGOLIAN = 27; // 0x1b
    field public static final int MOON = 114; // 0x72
    field public static final int MRO = 149; // 0x95
    field public static final int MULTANI = 164; // 0xa4
    field public static final int MYANMAR = 28; // 0x1c
    field public static final int NABATAEAN = 143; // 0x8f
    field public static final int NAKHI_GEBA = 132; // 0x84
    field public static final int NEWA = 170; // 0xaa
    field public static final int NEW_TAI_LUE = 59; // 0x3b
    field public static final int NKO = 87; // 0x57
    field public static final int NUSHU = 150; // 0x96
    field public static final int OGHAM = 29; // 0x1d
    field public static final int OLD_CHURCH_SLAVONIC_CYRILLIC = 68; // 0x44
    field public static final int OLD_HUNGARIAN = 76; // 0x4c
    field public static final int OLD_ITALIC = 30; // 0x1e
    field public static final int OLD_NORTH_ARABIAN = 142; // 0x8e
    field public static final int OLD_PERMIC = 89; // 0x59
    field public static final int OLD_PERSIAN = 61; // 0x3d
    field public static final int OLD_SOGDIAN = 184; // 0xb8
    field public static final int OLD_SOUTH_ARABIAN = 133; // 0x85
    field public static final int OL_CHIKI = 109; // 0x6d
    field public static final int ORIYA = 31; // 0x1f
    field public static final int ORKHON = 88; // 0x58
    field public static final int OSAGE = 171; // 0xab
    field public static final int OSMANYA = 50; // 0x32
    field public static final int PAHAWH_HMONG = 75; // 0x4b
    field public static final int PALMYRENE = 144; // 0x90
    field public static final int PAU_CIN_HAU = 165; // 0xa5
    field public static final int PHAGS_PA = 90; // 0x5a
    field public static final int PHOENICIAN = 91; // 0x5b
    field public static final int PHONETIC_POLLARD = 92; // 0x5c
    field public static final int PSALTER_PAHLAVI = 123; // 0x7b
    field public static final int REJANG = 110; // 0x6e
    field public static final int RONGORONGO = 93; // 0x5d
    field public static final int RUNIC = 32; // 0x20
    field public static final int SAMARITAN = 126; // 0x7e
    field public static final int SARATI = 94; // 0x5e
    field public static final int SAURASHTRA = 111; // 0x6f
    field public static final int SHARADA = 151; // 0x97
    field public static final int SHAVIAN = 51; // 0x33
    field public static final int SIDDHAM = 166; // 0xa6
    field public static final int SIGN_WRITING = 112; // 0x70
    field public static final int SIMPLIFIED_HAN = 73; // 0x49
    field public static final int SINDHI = 145; // 0x91
    field public static final int SINHALA = 33; // 0x21
    field public static final int SOGDIAN = 183; // 0xb7
    field public static final int SORA_SOMPENG = 152; // 0x98
    field public static final int SOYOMBO = 176; // 0xb0
    field public static final int SUNDANESE = 113; // 0x71
    field public static final int SYLOTI_NAGRI = 58; // 0x3a
    field public static final int SYMBOLS = 129; // 0x81
    field public static final int SYMBOLS_EMOJI = 174; // 0xae
    field public static final int SYRIAC = 34; // 0x22
    field public static final int TAGALOG = 42; // 0x2a
    field public static final int TAGBANWA = 45; // 0x2d
    field public static final int TAI_LE = 52; // 0x34
    field public static final int TAI_VIET = 127; // 0x7f
    field public static final int TAKRI = 153; // 0x99
    field public static final int TAMIL = 35; // 0x23
    field public static final int TANGUT = 154; // 0x9a
    field public static final int TELUGU = 36; // 0x24
    field public static final int TENGWAR = 98; // 0x62
    field public static final int THAANA = 37; // 0x25
    field public static final int THAI = 38; // 0x26
    field public static final int TIBETAN = 39; // 0x27
    field public static final int TIFINAGH = 60; // 0x3c
    field public static final int TIRHUTA = 158; // 0x9e
    field public static final int TRADITIONAL_HAN = 74; // 0x4a
    field public static final int UCAS = 40; // 0x28
    field public static final int UGARITIC = 53; // 0x35
    field public static final int UNKNOWN = 103; // 0x67
    field public static final int UNWRITTEN_LANGUAGES = 102; // 0x66
    field public static final int VAI = 99; // 0x63
    field public static final int VISIBLE_SPEECH = 100; // 0x64
    field public static final int WARANG_CITI = 146; // 0x92
    field public static final int WESTERN_SYRIAC = 96; // 0x60
    field public static final int WOLEAI = 155; // 0x9b
    field public static final int YI = 41; // 0x29
    field public static final int ZANABAZAR_SQUARE = 177; // 0xb1
  }

  public enum UScript.ScriptUsage {
    enum_constant public static final android.icu.lang.UScript.ScriptUsage ASPIRATIONAL;
    enum_constant public static final android.icu.lang.UScript.ScriptUsage EXCLUDED;
    enum_constant public static final android.icu.lang.UScript.ScriptUsage LIMITED_USE;
    enum_constant public static final android.icu.lang.UScript.ScriptUsage NOT_ENCODED;
    enum_constant public static final android.icu.lang.UScript.ScriptUsage RECOMMENDED;
    enum_constant public static final android.icu.lang.UScript.ScriptUsage UNKNOWN;
  }

}

package android.icu.math {

  public class BigDecimal extends java.lang.Number implements java.lang.Comparable<android.icu.math.BigDecimal> java.io.Serializable {
    ctor public BigDecimal(java.math.BigDecimal);
    ctor public BigDecimal(java.math.BigInteger);
    ctor public BigDecimal(java.math.BigInteger, int);
    ctor public BigDecimal(char[]);
    ctor public BigDecimal(char[], int, int);
    ctor public BigDecimal(double);
    ctor public BigDecimal(int);
    ctor public BigDecimal(long);
    ctor public BigDecimal(String);
    method public android.icu.math.BigDecimal abs();
    method public android.icu.math.BigDecimal abs(android.icu.math.MathContext);
    method public android.icu.math.BigDecimal add(android.icu.math.BigDecimal);
    method public android.icu.math.BigDecimal add(android.icu.math.BigDecimal, android.icu.math.MathContext);
    method public byte byteValueExact();
    method public int compareTo(android.icu.math.BigDecimal);
    method public int compareTo(android.icu.math.BigDecimal, android.icu.math.MathContext);
    method public android.icu.math.BigDecimal divide(android.icu.math.BigDecimal);
    method public android.icu.math.BigDecimal divide(android.icu.math.BigDecimal, int);
    method public android.icu.math.BigDecimal divide(android.icu.math.BigDecimal, int, int);
    method public android.icu.math.BigDecimal divide(android.icu.math.BigDecimal, android.icu.math.MathContext);
    method public android.icu.math.BigDecimal divideInteger(android.icu.math.BigDecimal);
    method public android.icu.math.BigDecimal divideInteger(android.icu.math.BigDecimal, android.icu.math.MathContext);
    method public double doubleValue();
    method public float floatValue();
    method public String format(int, int);
    method public String format(int, int, int, int, int, int);
    method public int intValue();
    method public int intValueExact();
    method public long longValue();
    method public long longValueExact();
    method public android.icu.math.BigDecimal max(android.icu.math.BigDecimal);
    method public android.icu.math.BigDecimal max(android.icu.math.BigDecimal, android.icu.math.MathContext);
    method public android.icu.math.BigDecimal min(android.icu.math.BigDecimal);
    method public android.icu.math.BigDecimal min(android.icu.math.BigDecimal, android.icu.math.MathContext);
    method public android.icu.math.BigDecimal movePointLeft(int);
    method public android.icu.math.BigDecimal movePointRight(int);
    method public android.icu.math.BigDecimal multiply(android.icu.math.BigDecimal);
    method public android.icu.math.BigDecimal multiply(android.icu.math.BigDecimal, android.icu.math.MathContext);
    method public android.icu.math.BigDecimal negate();
    method public android.icu.math.BigDecimal negate(android.icu.math.MathContext);
    method public android.icu.math.BigDecimal plus();
    method public android.icu.math.BigDecimal plus(android.icu.math.MathContext);
    method public android.icu.math.BigDecimal pow(android.icu.math.BigDecimal);
    method public android.icu.math.BigDecimal pow(android.icu.math.BigDecimal, android.icu.math.MathContext);
    method public android.icu.math.BigDecimal remainder(android.icu.math.BigDecimal);
    method public android.icu.math.BigDecimal remainder(android.icu.math.BigDecimal, android.icu.math.MathContext);
    method public int scale();
    method public android.icu.math.BigDecimal setScale(int);
    method public android.icu.math.BigDecimal setScale(int, int);
    method public short shortValueExact();
    method public int signum();
    method public android.icu.math.BigDecimal subtract(android.icu.math.BigDecimal);
    method public android.icu.math.BigDecimal subtract(android.icu.math.BigDecimal, android.icu.math.MathContext);
    method public java.math.BigDecimal toBigDecimal();
    method public java.math.BigInteger toBigInteger();
    method public java.math.BigInteger toBigIntegerExact();
    method public char[] toCharArray();
    method public java.math.BigInteger unscaledValue();
    method public static android.icu.math.BigDecimal valueOf(double);
    method public static android.icu.math.BigDecimal valueOf(long);
    method public static android.icu.math.BigDecimal valueOf(long, int);
    field public static final android.icu.math.BigDecimal ONE;
    field public static final int ROUND_CEILING = 2; // 0x2
    field public static final int ROUND_DOWN = 1; // 0x1
    field public static final int ROUND_FLOOR = 3; // 0x3
    field public static final int ROUND_HALF_DOWN = 5; // 0x5
    field public static final int ROUND_HALF_EVEN = 6; // 0x6
    field public static final int ROUND_HALF_UP = 4; // 0x4
    field public static final int ROUND_UNNECESSARY = 7; // 0x7
    field public static final int ROUND_UP = 0; // 0x0
    field public static final android.icu.math.BigDecimal TEN;
    field public static final android.icu.math.BigDecimal ZERO;
  }

  public final class MathContext implements java.io.Serializable {
    ctor public MathContext(int);
    ctor public MathContext(int, int);
    ctor public MathContext(int, int, boolean);
    ctor public MathContext(int, int, boolean, int);
    method public int getDigits();
    method public int getForm();
    method public boolean getLostDigits();
    method public int getRoundingMode();
    field public static final android.icu.math.MathContext DEFAULT;
    field public static final int ENGINEERING = 2; // 0x2
    field public static final int PLAIN = 0; // 0x0
    field public static final int ROUND_CEILING = 2; // 0x2
    field public static final int ROUND_DOWN = 1; // 0x1
    field public static final int ROUND_FLOOR = 3; // 0x3
    field public static final int ROUND_HALF_DOWN = 5; // 0x5
    field public static final int ROUND_HALF_EVEN = 6; // 0x6
    field public static final int ROUND_HALF_UP = 4; // 0x4
    field public static final int ROUND_UNNECESSARY = 7; // 0x7
    field public static final int ROUND_UP = 0; // 0x0
    field public static final int SCIENTIFIC = 1; // 0x1
  }

}

package android.icu.text {

  public final class AlphabeticIndex<V> implements java.lang.Iterable<android.icu.text.AlphabeticIndex.Bucket<V>> {
    ctor public AlphabeticIndex(android.icu.util.ULocale);
    ctor public AlphabeticIndex(java.util.Locale);
    ctor public AlphabeticIndex(android.icu.text.RuleBasedCollator);
    method public android.icu.text.AlphabeticIndex<V> addLabels(android.icu.text.UnicodeSet);
    method public android.icu.text.AlphabeticIndex<V> addLabels(android.icu.util.ULocale...);
    method public android.icu.text.AlphabeticIndex<V> addLabels(java.util.Locale...);
    method public android.icu.text.AlphabeticIndex<V> addRecord(CharSequence, V);
    method public android.icu.text.AlphabeticIndex.ImmutableIndex<V> buildImmutableIndex();
    method public android.icu.text.AlphabeticIndex<V> clearRecords();
    method public int getBucketCount();
    method public int getBucketIndex(CharSequence);
    method public java.util.List<java.lang.String> getBucketLabels();
    method public android.icu.text.RuleBasedCollator getCollator();
    method public String getInflowLabel();
    method public int getMaxLabelCount();
    method public String getOverflowLabel();
    method public int getRecordCount();
    method public String getUnderflowLabel();
    method public java.util.Iterator<android.icu.text.AlphabeticIndex.Bucket<V>> iterator();
    method public android.icu.text.AlphabeticIndex<V> setInflowLabel(String);
    method public android.icu.text.AlphabeticIndex<V> setMaxLabelCount(int);
    method public android.icu.text.AlphabeticIndex<V> setOverflowLabel(String);
    method public android.icu.text.AlphabeticIndex<V> setUnderflowLabel(String);
  }

  public static class AlphabeticIndex.Bucket<V> implements java.lang.Iterable<android.icu.text.AlphabeticIndex.Record<V>> {
    method public String getLabel();
    method public android.icu.text.AlphabeticIndex.Bucket.LabelType getLabelType();
    method public java.util.Iterator<android.icu.text.AlphabeticIndex.Record<V>> iterator();
    method public int size();
  }

  public enum AlphabeticIndex.Bucket.LabelType {
    enum_constant public static final android.icu.text.AlphabeticIndex.Bucket.LabelType INFLOW;
    enum_constant public static final android.icu.text.AlphabeticIndex.Bucket.LabelType NORMAL;
    enum_constant public static final android.icu.text.AlphabeticIndex.Bucket.LabelType OVERFLOW;
    enum_constant public static final android.icu.text.AlphabeticIndex.Bucket.LabelType UNDERFLOW;
  }

  public static final class AlphabeticIndex.ImmutableIndex<V> implements java.lang.Iterable<android.icu.text.AlphabeticIndex.Bucket<V>> {
    method public android.icu.text.AlphabeticIndex.Bucket<V> getBucket(int);
    method public int getBucketCount();
    method public int getBucketIndex(CharSequence);
    method public java.util.Iterator<android.icu.text.AlphabeticIndex.Bucket<V>> iterator();
  }

  public static class AlphabeticIndex.Record<V> {
    method public V getData();
    method public CharSequence getName();
  }

  public class Bidi {
    ctor public Bidi();
    ctor public Bidi(int, int);
    ctor public Bidi(String, int);
    ctor public Bidi(java.text.AttributedCharacterIterator);
    ctor public Bidi(char[], int, byte[], int, int, int);
    method public boolean baseIsLeftToRight();
    method public int countParagraphs();
    method public int countRuns();
    method public android.icu.text.Bidi createLineBidi(int, int);
    method public static byte getBaseDirection(CharSequence);
    method public int getBaseLevel();
    method public android.icu.text.BidiClassifier getCustomClassifier();
    method public int getCustomizedClass(int);
    method public byte getDirection();
    method public int getLength();
    method public byte getLevelAt(int);
    method public byte[] getLevels();
    method public int getLogicalIndex(int);
    method public int[] getLogicalMap();
    method public android.icu.text.BidiRun getLogicalRun(int);
    method public byte getParaLevel();
    method public android.icu.text.BidiRun getParagraph(int);
    method public android.icu.text.BidiRun getParagraphByIndex(int);
    method public int getParagraphIndex(int);
    method public int getProcessedLength();
    method public int getReorderingMode();
    method public int getReorderingOptions();
    method public int getResultLength();
    method public int getRunCount();
    method public int getRunLevel(int);
    method public int getRunLimit(int);
    method public int getRunStart(int);
    method public char[] getText();
    method public String getTextAsString();
    method public int getVisualIndex(int);
    method public int[] getVisualMap();
    method public android.icu.text.BidiRun getVisualRun(int);
    method public static int[] invertMap(int[]);
    method public boolean isInverse();
    method public boolean isLeftToRight();
    method public boolean isMixed();
    method public boolean isOrderParagraphsLTR();
    method public boolean isRightToLeft();
    method public void orderParagraphsLTR(boolean);
    method public static int[] reorderLogical(byte[]);
    method public static int[] reorderVisual(byte[]);
    method public static void reorderVisually(byte[], int, Object[], int, int);
    method public static boolean requiresBidi(char[], int, int);
    method public void setContext(String, String);
    method public void setCustomClassifier(android.icu.text.BidiClassifier);
    method public void setInverse(boolean);
    method public android.icu.text.Bidi setLine(int, int);
    method public void setPara(String, byte, byte[]);
    method public void setPara(char[], byte, byte[]);
    method public void setPara(java.text.AttributedCharacterIterator);
    method public void setReorderingMode(int);
    method public void setReorderingOptions(int);
    method public String writeReordered(int);
    method public static String writeReverse(String, int);
    field public static final int DIRECTION_DEFAULT_LEFT_TO_RIGHT = 126; // 0x7e
    field public static final int DIRECTION_DEFAULT_RIGHT_TO_LEFT = 127; // 0x7f
    field public static final int DIRECTION_LEFT_TO_RIGHT = 0; // 0x0
    field public static final int DIRECTION_RIGHT_TO_LEFT = 1; // 0x1
    field public static final short DO_MIRRORING = 2; // 0x2
    field public static final short INSERT_LRM_FOR_NUMERIC = 4; // 0x4
    field public static final short KEEP_BASE_COMBINING = 1; // 0x1
    field public static final byte LEVEL_DEFAULT_LTR = 126; // 0x7e
    field public static final byte LEVEL_DEFAULT_RTL = 127; // 0x7f
    field public static final byte LEVEL_OVERRIDE = -128; // 0xffffff80
    field public static final byte LTR = 0; // 0x0
    field public static final int MAP_NOWHERE = -1; // 0xffffffff
    field public static final byte MAX_EXPLICIT_LEVEL = 125; // 0x7d
    field public static final byte MIXED = 2; // 0x2
    field public static final byte NEUTRAL = 3; // 0x3
    field public static final int OPTION_DEFAULT = 0; // 0x0
    field public static final int OPTION_INSERT_MARKS = 1; // 0x1
    field public static final int OPTION_REMOVE_CONTROLS = 2; // 0x2
    field public static final int OPTION_STREAMING = 4; // 0x4
    field public static final short OUTPUT_REVERSE = 16; // 0x10
    field public static final short REMOVE_BIDI_CONTROLS = 8; // 0x8
    field public static final short REORDER_DEFAULT = 0; // 0x0
    field public static final short REORDER_GROUP_NUMBERS_WITH_R = 2; // 0x2
    field public static final short REORDER_INVERSE_FOR_NUMBERS_SPECIAL = 6; // 0x6
    field public static final short REORDER_INVERSE_LIKE_DIRECT = 5; // 0x5
    field public static final short REORDER_INVERSE_NUMBERS_AS_L = 4; // 0x4
    field public static final short REORDER_NUMBERS_SPECIAL = 1; // 0x1
    field public static final short REORDER_RUNS_ONLY = 3; // 0x3
    field public static final byte RTL = 1; // 0x1
  }

  public class BidiClassifier {
    ctor public BidiClassifier(Object);
    method public int classify(int);
    method public Object getContext();
    method public void setContext(Object);
  }

  public class BidiRun {
    method public byte getDirection();
    method public byte getEmbeddingLevel();
    method public int getLength();
    method public int getLimit();
    method public int getStart();
    method public boolean isEvenRun();
    method public boolean isOddRun();
  }

  public abstract class BreakIterator implements java.lang.Cloneable {
    ctor protected BreakIterator();
    method public Object clone();
    method public abstract int current();
    method public abstract int first();
    method public abstract int following(int);
    method public static java.util.Locale[] getAvailableLocales();
    method public static android.icu.text.BreakIterator getCharacterInstance();
    method public static android.icu.text.BreakIterator getCharacterInstance(java.util.Locale);
    method public static android.icu.text.BreakIterator getCharacterInstance(android.icu.util.ULocale);
    method public static android.icu.text.BreakIterator getLineInstance();
    method public static android.icu.text.BreakIterator getLineInstance(java.util.Locale);
    method public static android.icu.text.BreakIterator getLineInstance(android.icu.util.ULocale);
    method public int getRuleStatus();
    method public int getRuleStatusVec(int[]);
    method public static android.icu.text.BreakIterator getSentenceInstance();
    method public static android.icu.text.BreakIterator getSentenceInstance(java.util.Locale);
    method public static android.icu.text.BreakIterator getSentenceInstance(android.icu.util.ULocale);
    method public abstract java.text.CharacterIterator getText();
    method public static android.icu.text.BreakIterator getTitleInstance();
    method public static android.icu.text.BreakIterator getTitleInstance(java.util.Locale);
    method public static android.icu.text.BreakIterator getTitleInstance(android.icu.util.ULocale);
    method public static android.icu.text.BreakIterator getWordInstance();
    method public static android.icu.text.BreakIterator getWordInstance(java.util.Locale);
    method public static android.icu.text.BreakIterator getWordInstance(android.icu.util.ULocale);
    method public boolean isBoundary(int);
    method public abstract int last();
    method public abstract int next(int);
    method public abstract int next();
    method public int preceding(int);
    method public abstract int previous();
    method public void setText(String);
    method public void setText(CharSequence);
    method public abstract void setText(java.text.CharacterIterator);
    field public static final int DONE = -1; // 0xffffffff
    field public static final int KIND_CHARACTER = 0; // 0x0
    field public static final int KIND_LINE = 2; // 0x2
    field public static final int KIND_SENTENCE = 3; // 0x3
    field public static final int KIND_TITLE = 4; // 0x4
    field public static final int KIND_WORD = 1; // 0x1
    field public static final int WORD_IDEO = 400; // 0x190
    field public static final int WORD_IDEO_LIMIT = 500; // 0x1f4
    field public static final int WORD_KANA = 300; // 0x12c
    field public static final int WORD_KANA_LIMIT = 400; // 0x190
    field public static final int WORD_LETTER = 200; // 0xc8
    field public static final int WORD_LETTER_LIMIT = 300; // 0x12c
    field public static final int WORD_NONE = 0; // 0x0
    field public static final int WORD_NONE_LIMIT = 100; // 0x64
    field public static final int WORD_NUMBER = 100; // 0x64
    field public static final int WORD_NUMBER_LIMIT = 200; // 0xc8
  }

  public abstract class CaseMap {
    method public static android.icu.text.CaseMap.Fold fold();
    method public abstract android.icu.text.CaseMap omitUnchangedText();
    method public static android.icu.text.CaseMap.Lower toLower();
    method public static android.icu.text.CaseMap.Title toTitle();
    method public static android.icu.text.CaseMap.Upper toUpper();
  }

  public static final class CaseMap.Fold extends android.icu.text.CaseMap {
    method public String apply(CharSequence);
    method public <A extends java.lang.Appendable> A apply(CharSequence, A, android.icu.text.Edits);
    method public android.icu.text.CaseMap.Fold omitUnchangedText();
    method public android.icu.text.CaseMap.Fold turkic();
  }

  public static final class CaseMap.Lower extends android.icu.text.CaseMap {
    method public String apply(java.util.Locale, CharSequence);
    method public <A extends java.lang.Appendable> A apply(java.util.Locale, CharSequence, A, android.icu.text.Edits);
    method public android.icu.text.CaseMap.Lower omitUnchangedText();
  }

  public static final class CaseMap.Title extends android.icu.text.CaseMap {
    method public android.icu.text.CaseMap.Title adjustToCased();
    method public String apply(java.util.Locale, android.icu.text.BreakIterator, CharSequence);
    method public <A extends java.lang.Appendable> A apply(java.util.Locale, android.icu.text.BreakIterator, CharSequence, A, android.icu.text.Edits);
    method public android.icu.text.CaseMap.Title noBreakAdjustment();
    method public android.icu.text.CaseMap.Title noLowercase();
    method public android.icu.text.CaseMap.Title omitUnchangedText();
    method public android.icu.text.CaseMap.Title sentences();
    method public android.icu.text.CaseMap.Title wholeString();
  }

  public static final class CaseMap.Upper extends android.icu.text.CaseMap {
    method public String apply(java.util.Locale, CharSequence);
    method public <A extends java.lang.Appendable> A apply(java.util.Locale, CharSequence, A, android.icu.text.Edits);
    method public android.icu.text.CaseMap.Upper omitUnchangedText();
  }

  public final class CollationElementIterator {
    method public int getMaxExpansion(int);
    method public int getOffset();
    method public int next();
    method public int previous();
    method public static int primaryOrder(int);
    method public void reset();
    method public static int secondaryOrder(int);
    method public void setOffset(int);
    method public void setText(String);
    method public void setText(android.icu.text.UCharacterIterator);
    method public void setText(java.text.CharacterIterator);
    method public static int tertiaryOrder(int);
    field public static final int IGNORABLE = 0; // 0x0
    field public static final int NULLORDER = -1; // 0xffffffff
  }

  public final class CollationKey implements java.lang.Comparable<android.icu.text.CollationKey> {
    ctor public CollationKey(String, byte[]);
    method public int compareTo(android.icu.text.CollationKey);
    method public boolean equals(android.icu.text.CollationKey);
    method public android.icu.text.CollationKey getBound(int, int);
    method public String getSourceString();
    method public android.icu.text.CollationKey merge(android.icu.text.CollationKey);
    method public byte[] toByteArray();
  }

  public static final class CollationKey.BoundMode {
    field public static final int LOWER = 0; // 0x0
    field public static final int UPPER = 1; // 0x1
    field public static final int UPPER_LONG = 2; // 0x2
  }

  public abstract class Collator implements java.lang.Cloneable java.util.Comparator<java.lang.Object> android.icu.util.Freezable<android.icu.text.Collator> {
    ctor protected Collator();
    method public Object clone() throws java.lang.CloneNotSupportedException;
    method public android.icu.text.Collator cloneAsThawed();
    method public abstract int compare(String, String);
    method public int compare(Object, Object);
    method public boolean equals(String, String);
    method public android.icu.text.Collator freeze();
    method public static java.util.Locale[] getAvailableLocales();
    method public static final android.icu.util.ULocale[] getAvailableULocales();
    method public abstract android.icu.text.CollationKey getCollationKey(String);
    method public int getDecomposition();
    method public static String getDisplayName(java.util.Locale, java.util.Locale);
    method public static String getDisplayName(android.icu.util.ULocale, android.icu.util.ULocale);
    method public static String getDisplayName(java.util.Locale);
    method public static String getDisplayName(android.icu.util.ULocale);
    method public static int[] getEquivalentReorderCodes(int);
    method public static final android.icu.util.ULocale getFunctionalEquivalent(String, android.icu.util.ULocale, boolean[]);
    method public static final android.icu.util.ULocale getFunctionalEquivalent(String, android.icu.util.ULocale);
    method public static final android.icu.text.Collator getInstance();
    method public static final android.icu.text.Collator getInstance(android.icu.util.ULocale);
    method public static final android.icu.text.Collator getInstance(java.util.Locale);
    method public static final String[] getKeywordValues(String);
    method public static final String[] getKeywordValuesForLocale(String, android.icu.util.ULocale, boolean);
    method public static final String[] getKeywords();
    method public int getMaxVariable();
    method public int[] getReorderCodes();
    method public int getStrength();
    method public android.icu.text.UnicodeSet getTailoredSet();
    method public abstract android.icu.util.VersionInfo getUCAVersion();
    method public abstract int getVariableTop();
    method public abstract android.icu.util.VersionInfo getVersion();
    method public boolean isFrozen();
    method public void setDecomposition(int);
    method public android.icu.text.Collator setMaxVariable(int);
    method public void setReorderCodes(int...);
    method public void setStrength(int);
    field public static final int CANONICAL_DECOMPOSITION = 17; // 0x11
    field public static final int FULL_DECOMPOSITION = 15; // 0xf
    field public static final int IDENTICAL = 15; // 0xf
    field public static final int NO_DECOMPOSITION = 16; // 0x10
    field public static final int PRIMARY = 0; // 0x0
    field public static final int QUATERNARY = 3; // 0x3
    field public static final int SECONDARY = 1; // 0x1
    field public static final int TERTIARY = 2; // 0x2
  }

  public static interface Collator.ReorderCodes {
    field public static final int CURRENCY = 4099; // 0x1003
    field public static final int DEFAULT = -1; // 0xffffffff
    field public static final int DIGIT = 4100; // 0x1004
    field public static final int FIRST = 4096; // 0x1000
    field public static final int NONE = 103; // 0x67
    field public static final int OTHERS = 103; // 0x67
    field public static final int PUNCTUATION = 4097; // 0x1001
    field public static final int SPACE = 4096; // 0x1000
    field public static final int SYMBOL = 4098; // 0x1002
  }

  public class CompactDecimalFormat extends android.icu.text.DecimalFormat {
    method public static android.icu.text.CompactDecimalFormat getInstance(android.icu.util.ULocale, android.icu.text.CompactDecimalFormat.CompactStyle);
    method public static android.icu.text.CompactDecimalFormat getInstance(java.util.Locale, android.icu.text.CompactDecimalFormat.CompactStyle);
  }

  public enum CompactDecimalFormat.CompactStyle {
    enum_constant public static final android.icu.text.CompactDecimalFormat.CompactStyle LONG;
    enum_constant public static final android.icu.text.CompactDecimalFormat.CompactStyle SHORT;
  }

  public class CurrencyPluralInfo implements java.lang.Cloneable java.io.Serializable {
    ctor public CurrencyPluralInfo();
    ctor public CurrencyPluralInfo(java.util.Locale);
    ctor public CurrencyPluralInfo(android.icu.util.ULocale);
    method public Object clone();
    method public String getCurrencyPluralPattern(String);
    method public static android.icu.text.CurrencyPluralInfo getInstance();
    method public static android.icu.text.CurrencyPluralInfo getInstance(java.util.Locale);
    method public static android.icu.text.CurrencyPluralInfo getInstance(android.icu.util.ULocale);
    method public android.icu.util.ULocale getLocale();
    method public android.icu.text.PluralRules getPluralRules();
    method public void setCurrencyPluralPattern(String, String);
    method public void setLocale(android.icu.util.ULocale);
    method public void setPluralRules(String);
  }

  public abstract class DateFormat extends android.icu.text.UFormat {
    ctor protected DateFormat();
    method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
    method public abstract StringBuffer format(android.icu.util.Calendar, StringBuffer, java.text.FieldPosition);
    method public StringBuffer format(java.util.Date, StringBuffer, java.text.FieldPosition);
    method public final String format(java.util.Date);
    method public static java.util.Locale[] getAvailableLocales();
    method public boolean getBooleanAttribute(android.icu.text.DateFormat.BooleanAttribute);
    method public android.icu.util.Calendar getCalendar();
    method public android.icu.text.DisplayContext getContext(android.icu.text.DisplayContext.Type);
    method public static final android.icu.text.DateFormat getDateInstance();
    method public static final android.icu.text.DateFormat getDateInstance(int);
    method public static final android.icu.text.DateFormat getDateInstance(int, java.util.Locale);
    method public static final android.icu.text.DateFormat getDateInstance(int, android.icu.util.ULocale);
    method public static final android.icu.text.DateFormat getDateInstance(android.icu.util.Calendar, int, java.util.Locale);
    method public static final android.icu.text.DateFormat getDateInstance(android.icu.util.Calendar, int, android.icu.util.ULocale);
    method public static final android.icu.text.DateFormat getDateInstance(android.icu.util.Calendar, int);
    method public static final android.icu.text.DateFormat getDateTimeInstance();
    method public static final android.icu.text.DateFormat getDateTimeInstance(int, int);
    method public static final android.icu.text.DateFormat getDateTimeInstance(int, int, java.util.Locale);
    method public static final android.icu.text.DateFormat getDateTimeInstance(int, int, android.icu.util.ULocale);
    method public static final android.icu.text.DateFormat getDateTimeInstance(android.icu.util.Calendar, int, int, java.util.Locale);
    method public static final android.icu.text.DateFormat getDateTimeInstance(android.icu.util.Calendar, int, int, android.icu.util.ULocale);
    method public static final android.icu.text.DateFormat getDateTimeInstance(android.icu.util.Calendar, int, int);
    method public static final android.icu.text.DateFormat getInstance();
    method public static final android.icu.text.DateFormat getInstance(android.icu.util.Calendar, java.util.Locale);
    method public static final android.icu.text.DateFormat getInstance(android.icu.util.Calendar);
    method public static final android.icu.text.DateFormat getInstanceForSkeleton(String);
    method public static final android.icu.text.DateFormat getInstanceForSkeleton(String, java.util.Locale);
    method public static final android.icu.text.DateFormat getInstanceForSkeleton(String, android.icu.util.ULocale);
    method public static final android.icu.text.DateFormat getInstanceForSkeleton(android.icu.util.Calendar, String, java.util.Locale);
    method public static final android.icu.text.DateFormat getInstanceForSkeleton(android.icu.util.Calendar, String, android.icu.util.ULocale);
    method public android.icu.text.NumberFormat getNumberFormat();
    method public static final android.icu.text.DateFormat getPatternInstance(String);
    method public static final android.icu.text.DateFormat getPatternInstance(String, java.util.Locale);
    method public static final android.icu.text.DateFormat getPatternInstance(String, android.icu.util.ULocale);
    method public static final android.icu.text.DateFormat getPatternInstance(android.icu.util.Calendar, String, java.util.Locale);
    method public static final android.icu.text.DateFormat getPatternInstance(android.icu.util.Calendar, String, android.icu.util.ULocale);
    method public static final android.icu.text.DateFormat getTimeInstance();
    method public static final android.icu.text.DateFormat getTimeInstance(int);
    method public static final android.icu.text.DateFormat getTimeInstance(int, java.util.Locale);
    method public static final android.icu.text.DateFormat getTimeInstance(int, android.icu.util.ULocale);
    method public static final android.icu.text.DateFormat getTimeInstance(android.icu.util.Calendar, int, java.util.Locale);
    method public static final android.icu.text.DateFormat getTimeInstance(android.icu.util.Calendar, int, android.icu.util.ULocale);
    method public static final android.icu.text.DateFormat getTimeInstance(android.icu.util.Calendar, int);
    method public android.icu.util.TimeZone getTimeZone();
    method public boolean isCalendarLenient();
    method public boolean isLenient();
    method public java.util.Date parse(String) throws java.text.ParseException;
    method public abstract void parse(String, android.icu.util.Calendar, java.text.ParsePosition);
    method public java.util.Date parse(String, java.text.ParsePosition);
    method public Object parseObject(String, java.text.ParsePosition);
    method public android.icu.text.DateFormat setBooleanAttribute(android.icu.text.DateFormat.BooleanAttribute, boolean);
    method public void setCalendar(android.icu.util.Calendar);
    method public void setCalendarLenient(boolean);
    method public void setContext(android.icu.text.DisplayContext);
    method public void setLenient(boolean);
    method public void setNumberFormat(android.icu.text.NumberFormat);
    method public void setTimeZone(android.icu.util.TimeZone);
    field public static final String ABBR_GENERIC_TZ = "v";
    field public static final String ABBR_MONTH = "MMM";
    field public static final String ABBR_MONTH_DAY = "MMMd";
    field public static final String ABBR_MONTH_WEEKDAY_DAY = "MMMEd";
    field public static final String ABBR_QUARTER = "QQQ";
    field public static final String ABBR_SPECIFIC_TZ = "z";
    field public static final String ABBR_UTC_TZ = "ZZZZ";
    field public static final String ABBR_WEEKDAY = "E";
    field public static final int AM_PM_FIELD = 14; // 0xe
    field public static final int AM_PM_MIDNIGHT_NOON_FIELD = 35; // 0x23
    field public static final int DATE_FIELD = 3; // 0x3
    field public static final String DAY = "d";
    field public static final int DAY_OF_WEEK_FIELD = 9; // 0x9
    field public static final int DAY_OF_WEEK_IN_MONTH_FIELD = 11; // 0xb
    field public static final int DAY_OF_YEAR_FIELD = 10; // 0xa
    field public static final int DEFAULT = 2; // 0x2
    field public static final int DOW_LOCAL_FIELD = 19; // 0x13
    field public static final int ERA_FIELD = 0; // 0x0
    field public static final int EXTENDED_YEAR_FIELD = 20; // 0x14
    field public static final int FLEXIBLE_DAY_PERIOD_FIELD = 36; // 0x24
    field public static final int FRACTIONAL_SECOND_FIELD = 8; // 0x8
    field public static final int FULL = 0; // 0x0
    field public static final String GENERIC_TZ = "vvvv";
    field public static final String HOUR = "j";
    field public static final int HOUR0_FIELD = 16; // 0x10
    field public static final int HOUR1_FIELD = 15; // 0xf
    field public static final String HOUR24 = "H";
    field public static final String HOUR24_MINUTE = "Hm";
    field public static final String HOUR24_MINUTE_SECOND = "Hms";
    field public static final String HOUR_MINUTE = "jm";
    field public static final String HOUR_MINUTE_SECOND = "jms";
    field public static final int HOUR_OF_DAY0_FIELD = 5; // 0x5
    field public static final int HOUR_OF_DAY1_FIELD = 4; // 0x4
    field public static final int JULIAN_DAY_FIELD = 21; // 0x15
    field public static final String LOCATION_TZ = "VVVV";
    field public static final int LONG = 1; // 0x1
    field public static final int MEDIUM = 2; // 0x2
    field public static final int MILLISECONDS_IN_DAY_FIELD = 22; // 0x16
    field public static final int MILLISECOND_FIELD = 8; // 0x8
    field public static final String MINUTE = "m";
    field public static final int MINUTE_FIELD = 6; // 0x6
    field public static final String MINUTE_SECOND = "ms";
    field public static final String MONTH = "MMMM";
    field public static final String MONTH_DAY = "MMMMd";
    field public static final int MONTH_FIELD = 2; // 0x2
    field public static final String MONTH_WEEKDAY_DAY = "MMMMEEEEd";
    field public static final int NONE = -1; // 0xffffffff
    field public static final String NUM_MONTH = "M";
    field public static final String NUM_MONTH_DAY = "Md";
    field public static final String NUM_MONTH_WEEKDAY_DAY = "MEd";
    field public static final String QUARTER = "QQQQ";
    field public static final int QUARTER_FIELD = 27; // 0x1b
    field public static final int RELATIVE = 128; // 0x80
    field public static final int RELATIVE_DEFAULT = 130; // 0x82
    field public static final int RELATIVE_FULL = 128; // 0x80
    field public static final int RELATIVE_LONG = 129; // 0x81
    field public static final int RELATIVE_MEDIUM = 130; // 0x82
    field public static final int RELATIVE_SHORT = 131; // 0x83
    field public static final String SECOND = "s";
    field public static final int SECOND_FIELD = 7; // 0x7
    field public static final int SHORT = 3; // 0x3
    field public static final String SPECIFIC_TZ = "zzzz";
    field public static final int STANDALONE_DAY_FIELD = 25; // 0x19
    field public static final int STANDALONE_MONTH_FIELD = 26; // 0x1a
    field public static final int STANDALONE_QUARTER_FIELD = 28; // 0x1c
    field public static final int TIMEZONE_FIELD = 17; // 0x11
    field public static final int TIMEZONE_GENERIC_FIELD = 24; // 0x18
    field public static final int TIMEZONE_ISO_FIELD = 32; // 0x20
    field public static final int TIMEZONE_ISO_LOCAL_FIELD = 33; // 0x21
    field public static final int TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31; // 0x1f
    field public static final int TIMEZONE_RFC_FIELD = 23; // 0x17
    field public static final int TIMEZONE_SPECIAL_FIELD = 29; // 0x1d
    field public static final String WEEKDAY = "EEEE";
    field public static final int WEEK_OF_MONTH_FIELD = 13; // 0xd
    field public static final int WEEK_OF_YEAR_FIELD = 12; // 0xc
    field public static final String YEAR = "y";
    field public static final String YEAR_ABBR_MONTH = "yMMM";
    field public static final String YEAR_ABBR_MONTH_DAY = "yMMMd";
    field public static final String YEAR_ABBR_MONTH_WEEKDAY_DAY = "yMMMEd";
    field public static final String YEAR_ABBR_QUARTER = "yQQQ";
    field public static final int YEAR_FIELD = 1; // 0x1
    field public static final String YEAR_MONTH = "yMMMM";
    field public static final String YEAR_MONTH_DAY = "yMMMMd";
    field public static final String YEAR_MONTH_WEEKDAY_DAY = "yMMMMEEEEd";
    field public static final int YEAR_NAME_FIELD = 30; // 0x1e
    field public static final String YEAR_NUM_MONTH = "yM";
    field public static final String YEAR_NUM_MONTH_DAY = "yMd";
    field public static final String YEAR_NUM_MONTH_WEEKDAY_DAY = "yMEd";
    field public static final String YEAR_QUARTER = "yQQQQ";
    field public static final int YEAR_WOY_FIELD = 18; // 0x12
    field protected android.icu.util.Calendar calendar;
    field protected android.icu.text.NumberFormat numberFormat;
  }

  public enum DateFormat.BooleanAttribute {
    enum_constant public static final android.icu.text.DateFormat.BooleanAttribute PARSE_ALLOW_NUMERIC;
    enum_constant public static final android.icu.text.DateFormat.BooleanAttribute PARSE_ALLOW_WHITESPACE;
    enum_constant public static final android.icu.text.DateFormat.BooleanAttribute PARSE_MULTIPLE_PATTERNS_FOR_MATCH;
    enum_constant public static final android.icu.text.DateFormat.BooleanAttribute PARSE_PARTIAL_LITERAL_MATCH;
  }

  public static class DateFormat.Field extends java.text.Format.Field {
    ctor protected DateFormat.Field(String, int);
    method public int getCalendarField();
    method public static android.icu.text.DateFormat.Field ofCalendarField(int);
    field public static final android.icu.text.DateFormat.Field AM_PM;
    field public static final android.icu.text.DateFormat.Field AM_PM_MIDNIGHT_NOON;
    field public static final android.icu.text.DateFormat.Field DAY_OF_MONTH;
    field public static final android.icu.text.DateFormat.Field DAY_OF_WEEK;
    field public static final android.icu.text.DateFormat.Field DAY_OF_WEEK_IN_MONTH;
    field public static final android.icu.text.DateFormat.Field DAY_OF_YEAR;
    field public static final android.icu.text.DateFormat.Field DOW_LOCAL;
    field public static final android.icu.text.DateFormat.Field ERA;
    field public static final android.icu.text.DateFormat.Field EXTENDED_YEAR;
    field public static final android.icu.text.DateFormat.Field FLEXIBLE_DAY_PERIOD;
    field public static final android.icu.text.DateFormat.Field HOUR0;
    field public static final android.icu.text.DateFormat.Field HOUR1;
    field public static final android.icu.text.DateFormat.Field HOUR_OF_DAY0;
    field public static final android.icu.text.DateFormat.Field HOUR_OF_DAY1;
    field public static final android.icu.text.DateFormat.Field JULIAN_DAY;
    field public static final android.icu.text.DateFormat.Field MILLISECOND;
    field public static final android.icu.text.DateFormat.Field MILLISECONDS_IN_DAY;
    field public static final android.icu.text.DateFormat.Field MINUTE;
    field public static final android.icu.text.DateFormat.Field MONTH;
    field public static final android.icu.text.DateFormat.Field QUARTER;
    field public static final android.icu.text.DateFormat.Field SECOND;
    field public static final android.icu.text.DateFormat.Field TIME_ZONE;
    field public static final android.icu.text.DateFormat.Field WEEK_OF_MONTH;
    field public static final android.icu.text.DateFormat.Field WEEK_OF_YEAR;
    field public static final android.icu.text.DateFormat.Field YEAR;
    field public static final android.icu.text.DateFormat.Field YEAR_WOY;
  }

  public class DateFormatSymbols implements java.lang.Cloneable java.io.Serializable {
    ctor public DateFormatSymbols();
    ctor public DateFormatSymbols(java.util.Locale);
    ctor public DateFormatSymbols(android.icu.util.ULocale);
    ctor public DateFormatSymbols(android.icu.util.Calendar, java.util.Locale);
    ctor public DateFormatSymbols(android.icu.util.Calendar, android.icu.util.ULocale);
    ctor public DateFormatSymbols(Class<? extends android.icu.util.Calendar>, java.util.Locale);
    ctor public DateFormatSymbols(Class<? extends android.icu.util.Calendar>, android.icu.util.ULocale);
    ctor public DateFormatSymbols(java.util.ResourceBundle, java.util.Locale);
    ctor public DateFormatSymbols(java.util.ResourceBundle, android.icu.util.ULocale);
    method public Object clone();
    method public String[] getAmPmStrings();
    method public static java.util.Locale[] getAvailableLocales();
    method public String[] getEraNames();
    method public String[] getEras();
    method public static android.icu.text.DateFormatSymbols getInstance();
    method public static android.icu.text.DateFormatSymbols getInstance(java.util.Locale);
    method public static android.icu.text.DateFormatSymbols getInstance(android.icu.util.ULocale);
    method public String getLocalPatternChars();
    method public String[] getMonths();
    method public String[] getMonths(int, int);
    method public String[] getQuarters(int, int);
    method public String[] getShortMonths();
    method public String[] getShortWeekdays();
    method public String[] getWeekdays();
    method public String[] getWeekdays(int, int);
    method public String[] getYearNames(int, int);
    method public String[] getZodiacNames(int, int);
    method public String[][] getZoneStrings();
    method protected void initializeData(android.icu.util.ULocale, String);
    method public void setAmPmStrings(String[]);
    method public void setEraNames(String[]);
    method public void setEras(String[]);
    method public void setLocalPatternChars(String);
    method public void setMonths(String[]);
    method public void setMonths(String[], int, int);
    method public void setQuarters(String[], int, int);
    method public void setShortMonths(String[]);
    method public void setShortWeekdays(String[]);
    method public void setWeekdays(String[], int, int);
    method public void setWeekdays(String[]);
    method public void setYearNames(String[], int, int);
    method public void setZodiacNames(String[], int, int);
    method public void setZoneStrings(String[][]);
    field public static final int ABBREVIATED = 0; // 0x0
    field public static final int FORMAT = 0; // 0x0
    field public static final int NARROW = 2; // 0x2
    field public static final int SHORT = 3; // 0x3
    field public static final int STANDALONE = 1; // 0x1
    field public static final int WIDE = 1; // 0x1
  }

  public class DateIntervalFormat extends android.icu.text.UFormat {
    method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
    method public final StringBuffer format(android.icu.util.DateInterval, StringBuffer, java.text.FieldPosition);
    method public final StringBuffer format(android.icu.util.Calendar, android.icu.util.Calendar, StringBuffer, java.text.FieldPosition);
    method public android.icu.text.DateFormat getDateFormat();
    method public android.icu.text.DateIntervalInfo getDateIntervalInfo();
    method public static final android.icu.text.DateIntervalFormat getInstance(String);
    method public static final android.icu.text.DateIntervalFormat getInstance(String, java.util.Locale);
    method public static final android.icu.text.DateIntervalFormat getInstance(String, android.icu.util.ULocale);
    method public static final android.icu.text.DateIntervalFormat getInstance(String, android.icu.text.DateIntervalInfo);
    method public static final android.icu.text.DateIntervalFormat getInstance(String, java.util.Locale, android.icu.text.DateIntervalInfo);
    method public static final android.icu.text.DateIntervalFormat getInstance(String, android.icu.util.ULocale, android.icu.text.DateIntervalInfo);
    method public android.icu.util.TimeZone getTimeZone();
    method @Deprecated public Object parseObject(String, java.text.ParsePosition);
    method public void setDateIntervalInfo(android.icu.text.DateIntervalInfo);
    method public void setTimeZone(android.icu.util.TimeZone);
  }

  public class DateIntervalInfo implements java.lang.Cloneable android.icu.util.Freezable<android.icu.text.DateIntervalInfo> java.io.Serializable {
    ctor public DateIntervalInfo(android.icu.util.ULocale);
    ctor public DateIntervalInfo(java.util.Locale);
    method public Object clone();
    method public android.icu.text.DateIntervalInfo cloneAsThawed();
    method public android.icu.text.DateIntervalInfo freeze();
    method public boolean getDefaultOrder();
    method public String getFallbackIntervalPattern();
    method public android.icu.text.DateIntervalInfo.PatternInfo getIntervalPattern(String, int);
    method public boolean isFrozen();
    method public void setFallbackIntervalPattern(String);
    method public void setIntervalPattern(String, int, String);
  }

  public static final class DateIntervalInfo.PatternInfo implements java.lang.Cloneable java.io.Serializable {
    ctor public DateIntervalInfo.PatternInfo(String, String, boolean);
    method public boolean firstDateInPtnIsLaterDate();
    method public String getFirstPart();
    method public String getSecondPart();
  }

  public class DateTimePatternGenerator implements java.lang.Cloneable android.icu.util.Freezable<android.icu.text.DateTimePatternGenerator> {
    ctor protected DateTimePatternGenerator();
    method public android.icu.text.DateTimePatternGenerator addPattern(String, boolean, android.icu.text.DateTimePatternGenerator.PatternInfo);
    method public Object clone();
    method public android.icu.text.DateTimePatternGenerator cloneAsThawed();
    method public android.icu.text.DateTimePatternGenerator freeze();
    method public String getAppendItemFormat(int);
    method public String getAppendItemName(int);
    method public String getBaseSkeleton(String);
    method public java.util.Set<java.lang.String> getBaseSkeletons(java.util.Set<java.lang.String>);
    method public String getBestPattern(String);
    method public String getBestPattern(String, int);
    method public String getDateTimeFormat();
    method public String getDecimal();
    method public static android.icu.text.DateTimePatternGenerator getEmptyInstance();
    method public static android.icu.text.DateTimePatternGenerator getInstance();
    method public static android.icu.text.DateTimePatternGenerator getInstance(android.icu.util.ULocale);
    method public static android.icu.text.DateTimePatternGenerator getInstance(java.util.Locale);
    method public String getSkeleton(String);
    method public java.util.Map<java.lang.String,java.lang.String> getSkeletons(java.util.Map<java.lang.String,java.lang.String>);
    method public boolean isFrozen();
    method public String replaceFieldTypes(String, String);
    method public String replaceFieldTypes(String, String, int);
    method public void setAppendItemFormat(int, String);
    method public void setAppendItemName(int, String);
    method public void setDateTimeFormat(String);
    method public void setDecimal(String);
    field public static final int DAY = 7; // 0x7
    field public static final int DAYPERIOD = 10; // 0xa
    field public static final int DAY_OF_WEEK_IN_MONTH = 9; // 0x9
    field public static final int DAY_OF_YEAR = 8; // 0x8
    field public static final int ERA = 0; // 0x0
    field public static final int FRACTIONAL_SECOND = 14; // 0xe
    field public static final int HOUR = 11; // 0xb
    field public static final int MATCH_ALL_FIELDS_LENGTH = 65535; // 0xffff
    field public static final int MATCH_HOUR_FIELD_LENGTH = 2048; // 0x800
    field public static final int MATCH_NO_OPTIONS = 0; // 0x0
    field public static final int MINUTE = 12; // 0xc
    field public static final int MONTH = 3; // 0x3
    field public static final int QUARTER = 2; // 0x2
    field public static final int SECOND = 13; // 0xd
    field public static final int WEEKDAY = 6; // 0x6
    field public static final int WEEK_OF_MONTH = 5; // 0x5
    field public static final int WEEK_OF_YEAR = 4; // 0x4
    field public static final int YEAR = 1; // 0x1
    field public static final int ZONE = 15; // 0xf
  }

  public static final class DateTimePatternGenerator.PatternInfo {
    ctor public DateTimePatternGenerator.PatternInfo();
    field public static final int BASE_CONFLICT = 1; // 0x1
    field public static final int CONFLICT = 2; // 0x2
    field public static final int OK = 0; // 0x0
    field public String conflictingPattern;
    field public int status;
  }

  public class DecimalFormat extends android.icu.text.NumberFormat {
    ctor public DecimalFormat();
    ctor public DecimalFormat(String);
    ctor public DecimalFormat(String, android.icu.text.DecimalFormatSymbols);
    ctor public DecimalFormat(String, android.icu.text.DecimalFormatSymbols, android.icu.text.CurrencyPluralInfo, int);
    method public void applyLocalizedPattern(String);
    method public void applyPattern(String);
    method public boolean areSignificantDigitsUsed();
    method public StringBuffer format(double, StringBuffer, java.text.FieldPosition);
    method public StringBuffer format(long, StringBuffer, java.text.FieldPosition);
    method public StringBuffer format(java.math.BigInteger, StringBuffer, java.text.FieldPosition);
    method public StringBuffer format(java.math.BigDecimal, StringBuffer, java.text.FieldPosition);
    method public StringBuffer format(android.icu.math.BigDecimal, StringBuffer, java.text.FieldPosition);
    method public android.icu.text.CurrencyPluralInfo getCurrencyPluralInfo();
    method public android.icu.util.Currency.CurrencyUsage getCurrencyUsage();
    method public android.icu.text.DecimalFormatSymbols getDecimalFormatSymbols();
    method public int getFormatWidth();
    method public int getGroupingSize();
    method public java.math.MathContext getMathContext();
    method public android.icu.math.MathContext getMathContextICU();
    method public int getMaximumSignificantDigits();
    method public byte getMinimumExponentDigits();
    method public int getMinimumSignificantDigits();
    method public int getMultiplier();
    method public String getNegativePrefix();
    method public String getNegativeSuffix();
    method public char getPadCharacter();
    method public int getPadPosition();
    method @Deprecated public int getParseMaxDigits();
    method public String getPositivePrefix();
    method public String getPositiveSuffix();
    method public java.math.BigDecimal getRoundingIncrement();
    method public int getSecondaryGroupingSize();
    method public boolean isDecimalPatternMatchRequired();
    method public boolean isDecimalSeparatorAlwaysShown();
    method public boolean isExponentSignAlwaysShown();
    method public boolean isParseBigDecimal();
    method public boolean isScientificNotation();
    method public Number parse(String, java.text.ParsePosition);
    method public void setCurrencyPluralInfo(android.icu.text.CurrencyPluralInfo);
    method public void setCurrencyUsage(android.icu.util.Currency.CurrencyUsage);
    method public void setDecimalFormatSymbols(android.icu.text.DecimalFormatSymbols);
    method public void setDecimalPatternMatchRequired(boolean);
    method public void setDecimalSeparatorAlwaysShown(boolean);
    method public void setExponentSignAlwaysShown(boolean);
    method public void setFormatWidth(int);
    method public void setGroupingSize(int);
    method public void setMathContext(java.math.MathContext);
    method public void setMathContextICU(android.icu.math.MathContext);
    method public void setMaximumSignificantDigits(int);
    method public void setMinimumExponentDigits(byte);
    method public void setMinimumSignificantDigits(int);
    method public void setMultiplier(int);
    method public void setNegativePrefix(String);
    method public void setNegativeSuffix(String);
    method public void setPadCharacter(char);
    method public void setPadPosition(int);
    method public void setParseBigDecimal(boolean);
    method @Deprecated public void setParseMaxDigits(int);
    method public void setPositivePrefix(String);
    method public void setPositiveSuffix(String);
    method public void setRoundingIncrement(java.math.BigDecimal);
    method public void setRoundingIncrement(android.icu.math.BigDecimal);
    method public void setRoundingIncrement(double);
    method public void setScientificNotation(boolean);
    method public void setSecondaryGroupingSize(int);
    method public void setSignificantDigitsUsed(boolean);
    method public String toLocalizedPattern();
    method public String toPattern();
    field public static final int PAD_AFTER_PREFIX = 1; // 0x1
    field public static final int PAD_AFTER_SUFFIX = 3; // 0x3
    field public static final int PAD_BEFORE_PREFIX = 0; // 0x0
    field public static final int PAD_BEFORE_SUFFIX = 2; // 0x2
  }

  public class DecimalFormatSymbols implements java.lang.Cloneable java.io.Serializable {
    ctor public DecimalFormatSymbols();
    ctor public DecimalFormatSymbols(java.util.Locale);
    ctor public DecimalFormatSymbols(android.icu.util.ULocale);
    method public Object clone();
    method public static android.icu.text.DecimalFormatSymbols forNumberingSystem(java.util.Locale, android.icu.text.NumberingSystem);
    method public static android.icu.text.DecimalFormatSymbols forNumberingSystem(android.icu.util.ULocale, android.icu.text.NumberingSystem);
    method public static java.util.Locale[] getAvailableLocales();
    method public android.icu.util.Currency getCurrency();
    method public String getCurrencySymbol();
    method public char getDecimalSeparator();
    method public String getDecimalSeparatorString();
    method public char getDigit();
    method public String[] getDigitStrings();
    method public char[] getDigits();
    method public String getExponentMultiplicationSign();
    method public String getExponentSeparator();
    method public char getGroupingSeparator();
    method public String getGroupingSeparatorString();
    method public String getInfinity();
    method public static android.icu.text.DecimalFormatSymbols getInstance();
    method public static android.icu.text.DecimalFormatSymbols getInstance(java.util.Locale);
    method public static android.icu.text.DecimalFormatSymbols getInstance(android.icu.util.ULocale);
    method public String getInternationalCurrencySymbol();
    method public java.util.Locale getLocale();
    method public char getMinusSign();
    method public String getMinusSignString();
    method public char getMonetaryDecimalSeparator();
    method public String getMonetaryDecimalSeparatorString();
    method public char getMonetaryGroupingSeparator();
    method public String getMonetaryGroupingSeparatorString();
    method public String getNaN();
    method public char getPadEscape();
    method public String getPatternForCurrencySpacing(int, boolean);
    method public char getPatternSeparator();
    method public char getPerMill();
    method public String getPerMillString();
    method public char getPercent();
    method public String getPercentString();
    method public char getPlusSign();
    method public String getPlusSignString();
    method public char getSignificantDigit();
    method public android.icu.util.ULocale getULocale();
    method public char getZeroDigit();
    method public void setCurrency(android.icu.util.Currency);
    method public void setCurrencySymbol(String);
    method public void setDecimalSeparator(char);
    method public void setDecimalSeparatorString(String);
    method public void setDigit(char);
    method public void setDigitStrings(String[]);
    method public void setExponentMultiplicationSign(String);
    method public void setExponentSeparator(String);
    method public void setGroupingSeparator(char);
    method public void setGroupingSeparatorString(String);
    method public void setInfinity(String);
    method public void setInternationalCurrencySymbol(String);
    method public void setMinusSign(char);
    method public void setMinusSignString(String);
    method public void setMonetaryDecimalSeparator(char);
    method public void setMonetaryDecimalSeparatorString(String);
    method public void setMonetaryGroupingSeparator(char);
    method public void setMonetaryGroupingSeparatorString(String);
    method public void setNaN(String);
    method public void setPadEscape(char);
    method public void setPatternForCurrencySpacing(int, boolean, String);
    method public void setPatternSeparator(char);
    method public void setPerMill(char);
    method public void setPerMillString(String);
    method public void setPercent(char);
    method public void setPercentString(String);
    method public void setPlusSign(char);
    method public void setPlusSignString(String);
    method public void setSignificantDigit(char);
    method public void setZeroDigit(char);
    field public static final int CURRENCY_SPC_CURRENCY_MATCH = 0; // 0x0
    field public static final int CURRENCY_SPC_INSERT = 2; // 0x2
    field public static final int CURRENCY_SPC_SURROUNDING_MATCH = 1; // 0x1
  }

  public enum DisplayContext {
    method public android.icu.text.DisplayContext.Type type();
    method public int value();
    enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE;
    enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE;
    enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_FOR_STANDALONE;
    enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_FOR_UI_LIST_OR_MENU;
    enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_NONE;
    enum_constant public static final android.icu.text.DisplayContext DIALECT_NAMES;
    enum_constant public static final android.icu.text.DisplayContext LENGTH_FULL;
    enum_constant public static final android.icu.text.DisplayContext LENGTH_SHORT;
    enum_constant public static final android.icu.text.DisplayContext NO_SUBSTITUTE;
    enum_constant public static final android.icu.text.DisplayContext STANDARD_NAMES;
    enum_constant public static final android.icu.text.DisplayContext SUBSTITUTE;
  }

  public enum DisplayContext.Type {
    enum_constant public static final android.icu.text.DisplayContext.Type CAPITALIZATION;
    enum_constant public static final android.icu.text.DisplayContext.Type DIALECT_HANDLING;
    enum_constant public static final android.icu.text.DisplayContext.Type DISPLAY_LENGTH;
    enum_constant public static final android.icu.text.DisplayContext.Type SUBSTITUTE_HANDLING;
  }

  public final class Edits {
    ctor public Edits();
    method public void addReplace(int, int);
    method public void addUnchanged(int);
    method public android.icu.text.Edits.Iterator getCoarseChangesIterator();
    method public android.icu.text.Edits.Iterator getCoarseIterator();
    method public android.icu.text.Edits.Iterator getFineChangesIterator();
    method public android.icu.text.Edits.Iterator getFineIterator();
    method public boolean hasChanges();
    method public int lengthDelta();
    method public android.icu.text.Edits mergeAndAppend(android.icu.text.Edits, android.icu.text.Edits);
    method public int numberOfChanges();
    method public void reset();
  }

  public static final class Edits.Iterator {
    method public int destinationIndex();
    method public int destinationIndexFromSourceIndex(int);
    method public boolean findDestinationIndex(int);
    method public boolean findSourceIndex(int);
    method public boolean hasChange();
    method public int newLength();
    method public boolean next();
    method public int oldLength();
    method public int replacementIndex();
    method public int sourceIndex();
    method public int sourceIndexFromDestinationIndex(int);
  }

  public abstract class IDNA {
    method public static android.icu.text.IDNA getUTS46Instance(int);
    method public abstract StringBuilder labelToASCII(CharSequence, StringBuilder, android.icu.text.IDNA.Info);
    method public abstract StringBuilder labelToUnicode(CharSequence, StringBuilder, android.icu.text.IDNA.Info);
    method public abstract StringBuilder nameToASCII(CharSequence, StringBuilder, android.icu.text.IDNA.Info);
    method public abstract StringBuilder nameToUnicode(CharSequence, StringBuilder, android.icu.text.IDNA.Info);
    field public static final int CHECK_BIDI = 4; // 0x4
    field public static final int CHECK_CONTEXTJ = 8; // 0x8
    field public static final int CHECK_CONTEXTO = 64; // 0x40
    field public static final int DEFAULT = 0; // 0x0
    field public static final int NONTRANSITIONAL_TO_ASCII = 16; // 0x10
    field public static final int NONTRANSITIONAL_TO_UNICODE = 32; // 0x20
    field public static final int USE_STD3_RULES = 2; // 0x2
  }

  public enum IDNA.Error {
    enum_constant public static final android.icu.text.IDNA.Error BIDI;
    enum_constant public static final android.icu.text.IDNA.Error CONTEXTJ;
    enum_constant public static final android.icu.text.IDNA.Error CONTEXTO_DIGITS;
    enum_constant public static final android.icu.text.IDNA.Error CONTEXTO_PUNCTUATION;
    enum_constant public static final android.icu.text.IDNA.Error DISALLOWED;
    enum_constant public static final android.icu.text.IDNA.Error DOMAIN_NAME_TOO_LONG;
    enum_constant public static final android.icu.text.IDNA.Error EMPTY_LABEL;
    enum_constant public static final android.icu.text.IDNA.Error HYPHEN_3_4;
    enum_constant public static final android.icu.text.IDNA.Error INVALID_ACE_LABEL;
    enum_constant public static final android.icu.text.IDNA.Error LABEL_HAS_DOT;
    enum_constant public static final android.icu.text.IDNA.Error LABEL_TOO_LONG;
    enum_constant public static final android.icu.text.IDNA.Error LEADING_COMBINING_MARK;
    enum_constant public static final android.icu.text.IDNA.Error LEADING_HYPHEN;
    enum_constant public static final android.icu.text.IDNA.Error PUNYCODE;
    enum_constant public static final android.icu.text.IDNA.Error TRAILING_HYPHEN;
  }

  public static final class IDNA.Info {
    ctor public IDNA.Info();
    method public java.util.Set<android.icu.text.IDNA.Error> getErrors();
    method public boolean hasErrors();
    method public boolean isTransitionalDifferent();
  }

  public final class ListFormatter {
    method public String format(java.lang.Object...);
    method public String format(java.util.Collection<?>);
    method public static android.icu.text.ListFormatter getInstance(android.icu.util.ULocale);
    method public static android.icu.text.ListFormatter getInstance(java.util.Locale);
    method public static android.icu.text.ListFormatter getInstance();
    method public String getPatternForNumItems(int);
  }

  public abstract class LocaleDisplayNames {
    method public abstract android.icu.text.DisplayContext getContext(android.icu.text.DisplayContext.Type);
    method public abstract android.icu.text.LocaleDisplayNames.DialectHandling getDialectHandling();
    method public static android.icu.text.LocaleDisplayNames getInstance(android.icu.util.ULocale);
    method public static android.icu.text.LocaleDisplayNames getInstance(java.util.Locale);
    method public static android.icu.text.LocaleDisplayNames getInstance(android.icu.util.ULocale, android.icu.text.LocaleDisplayNames.DialectHandling);
    method public static android.icu.text.LocaleDisplayNames getInstance(android.icu.util.ULocale, android.icu.text.DisplayContext...);
    method public static android.icu.text.LocaleDisplayNames getInstance(java.util.Locale, android.icu.text.DisplayContext...);
    method public abstract android.icu.util.ULocale getLocale();
    method public java.util.List<android.icu.text.LocaleDisplayNames.UiListItem> getUiList(java.util.Set<android.icu.util.ULocale>, boolean, java.util.Comparator<java.lang.Object>);
    method public abstract java.util.List<android.icu.text.LocaleDisplayNames.UiListItem> getUiListCompareWholeItems(java.util.Set<android.icu.util.ULocale>, java.util.Comparator<android.icu.text.LocaleDisplayNames.UiListItem>);
    method public abstract String keyDisplayName(String);
    method public abstract String keyValueDisplayName(String, String);
    method public abstract String languageDisplayName(String);
    method public abstract String localeDisplayName(android.icu.util.ULocale);
    method public abstract String localeDisplayName(java.util.Locale);
    method public abstract String localeDisplayName(String);
    method public abstract String regionDisplayName(String);
    method public abstract String scriptDisplayName(String);
    method public abstract String scriptDisplayName(int);
    method public abstract String variantDisplayName(String);
  }

  public enum LocaleDisplayNames.DialectHandling {
    enum_constant public static final android.icu.text.LocaleDisplayNames.DialectHandling DIALECT_NAMES;
    enum_constant public static final android.icu.text.LocaleDisplayNames.DialectHandling STANDARD_NAMES;
  }

  public static class LocaleDisplayNames.UiListItem {
    ctor public LocaleDisplayNames.UiListItem(android.icu.util.ULocale, android.icu.util.ULocale, String, String);
    method public static java.util.Comparator<android.icu.text.LocaleDisplayNames.UiListItem> getComparator(java.util.Comparator<java.lang.Object>, boolean);
    field public final android.icu.util.ULocale minimized;
    field public final android.icu.util.ULocale modified;
    field public final String nameInDisplayLocale;
    field public final String nameInSelf;
  }

  public class MeasureFormat extends android.icu.text.UFormat {
    method public final boolean equals(Object);
    method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
    method public StringBuilder formatMeasurePerUnit(android.icu.util.Measure, android.icu.util.MeasureUnit, StringBuilder, java.text.FieldPosition);
    method public final String formatMeasures(android.icu.util.Measure...);
    method public StringBuilder formatMeasures(StringBuilder, java.text.FieldPosition, android.icu.util.Measure...);
    method public static android.icu.text.MeasureFormat getCurrencyFormat(android.icu.util.ULocale);
    method public static android.icu.text.MeasureFormat getCurrencyFormat(java.util.Locale);
    method public static android.icu.text.MeasureFormat getCurrencyFormat();
    method public static android.icu.text.MeasureFormat getInstance(android.icu.util.ULocale, android.icu.text.MeasureFormat.FormatWidth);
    method public static android.icu.text.MeasureFormat getInstance(java.util.Locale, android.icu.text.MeasureFormat.FormatWidth);
    method public static android.icu.text.MeasureFormat getInstance(android.icu.util.ULocale, android.icu.text.MeasureFormat.FormatWidth, android.icu.text.NumberFormat);
    method public static android.icu.text.MeasureFormat getInstance(java.util.Locale, android.icu.text.MeasureFormat.FormatWidth, android.icu.text.NumberFormat);
    method public final android.icu.util.ULocale getLocale();
    method public android.icu.text.NumberFormat getNumberFormat();
    method public String getUnitDisplayName(android.icu.util.MeasureUnit);
    method public android.icu.text.MeasureFormat.FormatWidth getWidth();
    method public final int hashCode();
    method public android.icu.util.Measure parseObject(String, java.text.ParsePosition);
  }

  public enum MeasureFormat.FormatWidth {
    enum_constant public static final android.icu.text.MeasureFormat.FormatWidth NARROW;
    enum_constant public static final android.icu.text.MeasureFormat.FormatWidth NUMERIC;
    enum_constant public static final android.icu.text.MeasureFormat.FormatWidth SHORT;
    enum_constant public static final android.icu.text.MeasureFormat.FormatWidth WIDE;
  }

  public class MessageFormat extends android.icu.text.UFormat {
    ctor public MessageFormat(String);
    ctor public MessageFormat(String, java.util.Locale);
    ctor public MessageFormat(String, android.icu.util.ULocale);
    method public void applyPattern(String);
    method public void applyPattern(String, android.icu.text.MessagePattern.ApostropheMode);
    method public static String autoQuoteApostrophe(String);
    method public final StringBuffer format(Object[], StringBuffer, java.text.FieldPosition);
    method public final StringBuffer format(java.util.Map<java.lang.String,java.lang.Object>, StringBuffer, java.text.FieldPosition);
    method public static String format(String, java.lang.Object...);
    method public static String format(String, java.util.Map<java.lang.String,java.lang.Object>);
    method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
    method public android.icu.text.MessagePattern.ApostropheMode getApostropheMode();
    method public java.util.Set<java.lang.String> getArgumentNames();
    method public java.text.Format getFormatByArgumentName(String);
    method public java.text.Format[] getFormats();
    method public java.text.Format[] getFormatsByArgumentIndex();
    method public java.util.Locale getLocale();
    method public android.icu.util.ULocale getULocale();
    method public Object[] parse(String, java.text.ParsePosition);
    method public Object[] parse(String) throws java.text.ParseException;
    method public Object parseObject(String, java.text.ParsePosition);
    method public java.util.Map<java.lang.String,java.lang.Object> parseToMap(String, java.text.ParsePosition);
    method public java.util.Map<java.lang.String,java.lang.Object> parseToMap(String) throws java.text.ParseException;
    method public void setFormat(int, java.text.Format);
    method public void setFormatByArgumentIndex(int, java.text.Format);
    method public void setFormatByArgumentName(String, java.text.Format);
    method public void setFormats(java.text.Format[]);
    method public void setFormatsByArgumentIndex(java.text.Format[]);
    method public void setFormatsByArgumentName(java.util.Map<java.lang.String,java.text.Format>);
    method public void setLocale(java.util.Locale);
    method public void setLocale(android.icu.util.ULocale);
    method public String toPattern();
    method public boolean usesNamedArguments();
  }

  public static class MessageFormat.Field extends java.text.Format.Field {
    ctor protected MessageFormat.Field(String);
    field public static final android.icu.text.MessageFormat.Field ARGUMENT;
  }

  public final class MessagePattern implements java.lang.Cloneable android.icu.util.Freezable<android.icu.text.MessagePattern> {
    ctor public MessagePattern();
    ctor public MessagePattern(android.icu.text.MessagePattern.ApostropheMode);
    ctor public MessagePattern(String);
    method public String autoQuoteApostropheDeep();
    method public void clear();
    method public void clearPatternAndSetApostropheMode(android.icu.text.MessagePattern.ApostropheMode);
    method public Object clone();
    method public android.icu.text.MessagePattern cloneAsThawed();
    method public int countParts();
    method public android.icu.text.MessagePattern freeze();
    method public android.icu.text.MessagePattern.ApostropheMode getApostropheMode();
    method public int getLimitPartIndex(int);
    method public double getNumericValue(android.icu.text.MessagePattern.Part);
    method public android.icu.text.MessagePattern.Part getPart(int);
    method public android.icu.text.MessagePattern.Part.Type getPartType(int);
    method public int getPatternIndex(int);
    method public String getPatternString();
    method public double getPluralOffset(int);
    method public String getSubstring(android.icu.text.MessagePattern.Part);
    method public boolean hasNamedArguments();
    method public boolean hasNumberedArguments();
    method public boolean isFrozen();
    method public android.icu.text.MessagePattern parse(String);
    method public android.icu.text.MessagePattern parseChoiceStyle(String);
    method public android.icu.text.MessagePattern parsePluralStyle(String);
    method public android.icu.text.MessagePattern parseSelectStyle(String);
    method public boolean partSubstringMatches(android.icu.text.MessagePattern.Part, String);
    method public static int validateArgumentName(String);
    field public static final int ARG_NAME_NOT_NUMBER = -1; // 0xffffffff
    field public static final int ARG_NAME_NOT_VALID = -2; // 0xfffffffe
    field public static final double NO_NUMERIC_VALUE = -1.23456789E8;
  }

  public enum MessagePattern.ApostropheMode {
    enum_constant public static final android.icu.text.MessagePattern.ApostropheMode DOUBLE_OPTIONAL;
    enum_constant public static final android.icu.text.MessagePattern.ApostropheMode DOUBLE_REQUIRED;
  }

  public enum MessagePattern.ArgType {
    method public boolean hasPluralStyle();
    enum_constant public static final android.icu.text.MessagePattern.ArgType CHOICE;
    enum_constant public static final android.icu.text.MessagePattern.ArgType NONE;
    enum_constant public static final android.icu.text.MessagePattern.ArgType PLURAL;
    enum_constant public static final android.icu.text.MessagePattern.ArgType SELECT;
    enum_constant public static final android.icu.text.MessagePattern.ArgType SELECTORDINAL;
    enum_constant public static final android.icu.text.MessagePattern.ArgType SIMPLE;
  }

  public static final class MessagePattern.Part {
    method public android.icu.text.MessagePattern.ArgType getArgType();
    method public int getIndex();
    method public int getLength();
    method public int getLimit();
    method public android.icu.text.MessagePattern.Part.Type getType();
    method public int getValue();
  }

  public enum MessagePattern.Part.Type {
    method public boolean hasNumericValue();
    enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_DOUBLE;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_INT;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_LIMIT;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_NAME;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_NUMBER;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_SELECTOR;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_START;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_STYLE;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_TYPE;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type INSERT_CHAR;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type MSG_LIMIT;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type MSG_START;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type REPLACE_NUMBER;
    enum_constant public static final android.icu.text.MessagePattern.Part.Type SKIP_SYNTAX;
  }

  public final class Normalizer implements java.lang.Cloneable {
    method @Deprecated public Object clone();
    method public static int compare(char[], int, int, char[], int, int, int);
    method public static int compare(String, String, int);
    method public static int compare(char[], char[], int);
    method public static int compare(int, int, int);
    method public static int compare(int, String, int);
    field public static final int COMPARE_CODE_POINT_ORDER = 32768; // 0x8000
    field public static final int COMPARE_IGNORE_CASE = 65536; // 0x10000
    field public static final int FOLD_CASE_DEFAULT = 0; // 0x0
    field public static final int FOLD_CASE_EXCLUDE_SPECIAL_I = 1; // 0x1
    field public static final int INPUT_IS_FCD = 131072; // 0x20000
    field public static final android.icu.text.Normalizer.QuickCheckResult MAYBE;
    field public static final android.icu.text.Normalizer.QuickCheckResult NO;
    field public static final android.icu.text.Normalizer.QuickCheckResult YES;
  }

  public static final class Normalizer.QuickCheckResult {
  }

  public abstract class Normalizer2 {
    method public abstract StringBuilder append(StringBuilder, CharSequence);
    method public int composePair(int, int);
    method public int getCombiningClass(int);
    method public abstract String getDecomposition(int);
    method public static android.icu.text.Normalizer2 getInstance(java.io.InputStream, String, android.icu.text.Normalizer2.Mode);
    method public static android.icu.text.Normalizer2 getNFCInstance();
    method public static android.icu.text.Normalizer2 getNFDInstance();
    method public static android.icu.text.Normalizer2 getNFKCCasefoldInstance();
    method public static android.icu.text.Normalizer2 getNFKCInstance();
    method public static android.icu.text.Normalizer2 getNFKDInstance();
    method public String getRawDecomposition(int);
    method public abstract boolean hasBoundaryAfter(int);
    method public abstract boolean hasBoundaryBefore(int);
    method public abstract boolean isInert(int);
    method public abstract boolean isNormalized(CharSequence);
    method public String normalize(CharSequence);
    method public abstract StringBuilder normalize(CharSequence, StringBuilder);
    method public abstract Appendable normalize(CharSequence, Appendable);
    method public abstract StringBuilder normalizeSecondAndAppend(StringBuilder, CharSequence);
    method public abstract android.icu.text.Normalizer.QuickCheckResult quickCheck(CharSequence);
    method public abstract int spanQuickCheckYes(CharSequence);
  }

  public enum Normalizer2.Mode {
    enum_constant public static final android.icu.text.Normalizer2.Mode COMPOSE;
    enum_constant public static final android.icu.text.Normalizer2.Mode COMPOSE_CONTIGUOUS;
    enum_constant public static final android.icu.text.Normalizer2.Mode DECOMPOSE;
    enum_constant public static final android.icu.text.Normalizer2.Mode FCD;
  }

  public abstract class NumberFormat extends android.icu.text.UFormat {
    ctor public NumberFormat();
    method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
    method public final String format(double);
    method public final String format(long);
    method public final String format(java.math.BigInteger);
    method public final String format(java.math.BigDecimal);
    method public final String format(android.icu.math.BigDecimal);
    method public final String format(android.icu.util.CurrencyAmount);
    method public abstract StringBuffer format(double, StringBuffer, java.text.FieldPosition);
    method public abstract StringBuffer format(long, StringBuffer, java.text.FieldPosition);
    method public abstract StringBuffer format(java.math.BigInteger, StringBuffer, java.text.FieldPosition);
    method public abstract StringBuffer format(java.math.BigDecimal, StringBuffer, java.text.FieldPosition);
    method public abstract StringBuffer format(android.icu.math.BigDecimal, StringBuffer, java.text.FieldPosition);
    method public StringBuffer format(android.icu.util.CurrencyAmount, StringBuffer, java.text.FieldPosition);
    method public static java.util.Locale[] getAvailableLocales();
    method public android.icu.text.DisplayContext getContext(android.icu.text.DisplayContext.Type);
    method public android.icu.util.Currency getCurrency();
    method public static final android.icu.text.NumberFormat getCurrencyInstance();
    method public static android.icu.text.NumberFormat getCurrencyInstance(java.util.Locale);
    method public static android.icu.text.NumberFormat getCurrencyInstance(android.icu.util.ULocale);
    method public static final android.icu.text.NumberFormat getInstance();
    method public static android.icu.text.NumberFormat getInstance(java.util.Locale);
    method public static android.icu.text.NumberFormat getInstance(android.icu.util.ULocale);
    method public static final android.icu.text.NumberFormat getInstance(int);
    method public static android.icu.text.NumberFormat getInstance(java.util.Locale, int);
    method public static android.icu.text.NumberFormat getInstance(android.icu.util.ULocale, int);
    method public static final android.icu.text.NumberFormat getIntegerInstance();
    method public static android.icu.text.NumberFormat getIntegerInstance(java.util.Locale);
    method public static android.icu.text.NumberFormat getIntegerInstance(android.icu.util.ULocale);
    method public int getMaximumFractionDigits();
    method public int getMaximumIntegerDigits();
    method public int getMinimumFractionDigits();
    method public int getMinimumIntegerDigits();
    method public static final android.icu.text.NumberFormat getNumberInstance();
    method public static android.icu.text.NumberFormat getNumberInstance(java.util.Locale);
    method public static android.icu.text.NumberFormat getNumberInstance(android.icu.util.ULocale);
    method protected static String getPattern(android.icu.util.ULocale, int);
    method public static final android.icu.text.NumberFormat getPercentInstance();
    method public static android.icu.text.NumberFormat getPercentInstance(java.util.Locale);
    method public static android.icu.text.NumberFormat getPercentInstance(android.icu.util.ULocale);
    method public int getRoundingMode();
    method public static final android.icu.text.NumberFormat getScientificInstance();
    method public static android.icu.text.NumberFormat getScientificInstance(java.util.Locale);
    method public static android.icu.text.NumberFormat getScientificInstance(android.icu.util.ULocale);
    method public boolean isGroupingUsed();
    method public boolean isParseIntegerOnly();
    method public boolean isParseStrict();
    method public abstract Number parse(String, java.text.ParsePosition);
    method public Number parse(String) throws java.text.ParseException;
    method public android.icu.util.CurrencyAmount parseCurrency(CharSequence, java.text.ParsePosition);
    method public final Object parseObject(String, java.text.ParsePosition);
    method public void setContext(android.icu.text.DisplayContext);
    method public void setCurrency(android.icu.util.Currency);
    method public void setGroupingUsed(boolean);
    method public void setMaximumFractionDigits(int);
    method public void setMaximumIntegerDigits(int);
    method public void setMinimumFractionDigits(int);
    method public void setMinimumIntegerDigits(int);
    method public void setParseIntegerOnly(boolean);
    method public void setParseStrict(boolean);
    method public void setRoundingMode(int);
    field public static final int ACCOUNTINGCURRENCYSTYLE = 7; // 0x7
    field public static final int CASHCURRENCYSTYLE = 8; // 0x8
    field public static final int CURRENCYSTYLE = 1; // 0x1
    field public static final int FRACTION_FIELD = 1; // 0x1
    field public static final int INTEGERSTYLE = 4; // 0x4
    field public static final int INTEGER_FIELD = 0; // 0x0
    field public static final int ISOCURRENCYSTYLE = 5; // 0x5
    field public static final int NUMBERSTYLE = 0; // 0x0
    field public static final int PERCENTSTYLE = 2; // 0x2
    field public static final int PLURALCURRENCYSTYLE = 6; // 0x6
    field public static final int SCIENTIFICSTYLE = 3; // 0x3
    field public static final int STANDARDCURRENCYSTYLE = 9; // 0x9
  }

  public static class NumberFormat.Field extends java.text.Format.Field {
    ctor protected NumberFormat.Field(String);
    field public static final android.icu.text.NumberFormat.Field CURRENCY;
    field public static final android.icu.text.NumberFormat.Field DECIMAL_SEPARATOR;
    field public static final android.icu.text.NumberFormat.Field EXPONENT;
    field public static final android.icu.text.NumberFormat.Field EXPONENT_SIGN;
    field public static final android.icu.text.NumberFormat.Field EXPONENT_SYMBOL;
    field public static final android.icu.text.NumberFormat.Field FRACTION;
    field public static final android.icu.text.NumberFormat.Field GROUPING_SEPARATOR;
    field public static final android.icu.text.NumberFormat.Field INTEGER;
    field public static final android.icu.text.NumberFormat.Field PERCENT;
    field public static final android.icu.text.NumberFormat.Field PERMILLE;
    field public static final android.icu.text.NumberFormat.Field SIGN;
  }

  public class NumberingSystem {
    ctor public NumberingSystem();
    method public static String[] getAvailableNames();
    method public String getDescription();
    method public static android.icu.text.NumberingSystem getInstance(int, boolean, String);
    method public static android.icu.text.NumberingSystem getInstance(java.util.Locale);
    method public static android.icu.text.NumberingSystem getInstance(android.icu.util.ULocale);
    method public static android.icu.text.NumberingSystem getInstance();
    method public static android.icu.text.NumberingSystem getInstanceByName(String);
    method public String getName();
    method public int getRadix();
    method public boolean isAlgorithmic();
    method public static boolean isValidDigitString(String);
    field public static final android.icu.text.NumberingSystem LATIN;
  }

  public class PluralFormat extends android.icu.text.UFormat {
    ctor public PluralFormat();
    ctor public PluralFormat(android.icu.util.ULocale);
    ctor public PluralFormat(java.util.Locale);
    ctor public PluralFormat(android.icu.text.PluralRules);
    ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules);
    ctor public PluralFormat(java.util.Locale, android.icu.text.PluralRules);
    ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules.PluralType);
    ctor public PluralFormat(java.util.Locale, android.icu.text.PluralRules.PluralType);
    ctor public PluralFormat(String);
    ctor public PluralFormat(android.icu.util.ULocale, String);
    ctor public PluralFormat(android.icu.text.PluralRules, String);
    ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules, String);
    ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules.PluralType, String);
    method public void applyPattern(String);
    method public boolean equals(android.icu.text.PluralFormat);
    method public final String format(double);
    method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
    method public Number parse(String, java.text.ParsePosition);
    method public Object parseObject(String, java.text.ParsePosition);
    method public void setNumberFormat(android.icu.text.NumberFormat);
    method public String toPattern();
  }

  public class PluralRules implements java.io.Serializable {
    method public static android.icu.text.PluralRules createRules(String);
    method public boolean equals(android.icu.text.PluralRules);
    method public static android.icu.text.PluralRules forLocale(android.icu.util.ULocale);
    method public static android.icu.text.PluralRules forLocale(java.util.Locale);
    method public static android.icu.text.PluralRules forLocale(android.icu.util.ULocale, android.icu.text.PluralRules.PluralType);
    method public static android.icu.text.PluralRules forLocale(java.util.Locale, android.icu.text.PluralRules.PluralType);
    method public java.util.Collection<java.lang.Double> getAllKeywordValues(String);
    method public java.util.Set<java.lang.String> getKeywords();
    method public java.util.Collection<java.lang.Double> getSamples(String);
    method public double getUniqueKeywordValue(String);
    method public static android.icu.text.PluralRules parseDescription(String) throws java.text.ParseException;
    method public String select(double);
    field public static final android.icu.text.PluralRules DEFAULT;
    field public static final String KEYWORD_FEW = "few";
    field public static final String KEYWORD_MANY = "many";
    field public static final String KEYWORD_ONE = "one";
    field public static final String KEYWORD_OTHER = "other";
    field public static final String KEYWORD_TWO = "two";
    field public static final String KEYWORD_ZERO = "zero";
    field public static final double NO_UNIQUE_VALUE = -0.00123456777;
  }

  public enum PluralRules.PluralType {
    enum_constant public static final android.icu.text.PluralRules.PluralType CARDINAL;
    enum_constant public static final android.icu.text.PluralRules.PluralType ORDINAL;
  }

  public final class RelativeDateTimeFormatter {
    method public String combineDateAndTime(String, String);
    method public String format(double, android.icu.text.RelativeDateTimeFormatter.Direction, android.icu.text.RelativeDateTimeFormatter.RelativeUnit);
    method public String format(android.icu.text.RelativeDateTimeFormatter.Direction, android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit);
    method public String format(double, android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit);
    method public String formatNumeric(double, android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit);
    method public android.icu.text.DisplayContext getCapitalizationContext();
    method public android.icu.text.RelativeDateTimeFormatter.Style getFormatStyle();
    method public static android.icu.text.RelativeDateTimeFormatter getInstance();
    method public static android.icu.text.RelativeDateTimeFormatter getInstance(android.icu.util.ULocale);
    method public static android.icu.text.RelativeDateTimeFormatter getInstance(java.util.Locale);
    method public static android.icu.text.RelativeDateTimeFormatter getInstance(android.icu.util.ULocale, android.icu.text.NumberFormat);
    method public static android.icu.text.RelativeDateTimeFormatter getInstance(android.icu.util.ULocale, android.icu.text.NumberFormat, android.icu.text.RelativeDateTimeFormatter.Style, android.icu.text.DisplayContext);
    method public static android.icu.text.RelativeDateTimeFormatter getInstance(java.util.Locale, android.icu.text.NumberFormat);
    method public android.icu.text.NumberFormat getNumberFormat();
  }

  public enum RelativeDateTimeFormatter.AbsoluteUnit {
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit DAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit FRIDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit MONDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit MONTH;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit NOW;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit SATURDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit SUNDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit THURSDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit TUESDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit WEDNESDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit WEEK;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit YEAR;
  }

  public enum RelativeDateTimeFormatter.Direction {
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction LAST;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction LAST_2;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction NEXT;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction NEXT_2;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction PLAIN;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction THIS;
  }

  public enum RelativeDateTimeFormatter.RelativeDateTimeUnit {
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit DAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit FRIDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit HOUR;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit MINUTE;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit MONDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit MONTH;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit QUARTER;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit SATURDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit SECOND;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit SUNDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit THURSDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit TUESDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit WEDNESDAY;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit WEEK;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit YEAR;
  }

  public enum RelativeDateTimeFormatter.RelativeUnit {
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit DAYS;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit HOURS;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit MINUTES;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit MONTHS;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit SECONDS;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit WEEKS;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit YEARS;
  }

  public enum RelativeDateTimeFormatter.Style {
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Style LONG;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Style NARROW;
    enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Style SHORT;
  }

  public interface Replaceable {
    method public int char32At(int);
    method public char charAt(int);
    method public void copy(int, int, int);
    method public void getChars(int, int, char[], int);
    method public boolean hasMetaData();
    method public int length();
    method public void replace(int, int, String);
    method public void replace(int, int, char[], int, int);
  }

  public final class RuleBasedCollator extends android.icu.text.Collator {
    ctor public RuleBasedCollator(String) throws java.lang.Exception;
    method public android.icu.text.RuleBasedCollator cloneAsThawed();
    method public int compare(String, String);
    method public android.icu.text.CollationElementIterator getCollationElementIterator(String);
    method public android.icu.text.CollationElementIterator getCollationElementIterator(java.text.CharacterIterator);
    method public android.icu.text.CollationElementIterator getCollationElementIterator(android.icu.text.UCharacterIterator);
    method public android.icu.text.CollationKey getCollationKey(String);
    method public void getContractionsAndExpansions(android.icu.text.UnicodeSet, android.icu.text.UnicodeSet, boolean) throws java.lang.Exception;
    method public boolean getNumericCollation();
    method public String getRules();
    method public String getRules(boolean);
    method public android.icu.util.VersionInfo getUCAVersion();
    method public int getVariableTop();
    method public android.icu.util.VersionInfo getVersion();
    method public boolean isAlternateHandlingShifted();
    method public boolean isCaseLevel();
    method public boolean isFrenchCollation();
    method public boolean isLowerCaseFirst();
    method public boolean isUpperCaseFirst();
    method public void setAlternateHandlingDefault();
    method public void setAlternateHandlingShifted(boolean);
    method public void setCaseFirstDefault();
    method public void setCaseLevel(boolean);
    method public void setCaseLevelDefault();
    method public void setDecompositionDefault();
    method public void setFrenchCollation(boolean);
    method public void setFrenchCollationDefault();
    method public void setLowerCaseFirst(boolean);
    method public android.icu.text.RuleBasedCollator setMaxVariable(int);
    method public void setNumericCollation(boolean);
    method public void setNumericCollationDefault();
    method public void setStrengthDefault();
    method public void setUpperCaseFirst(boolean);
  }

  public final class ScientificNumberFormatter {
    method public String format(Object);
    method public static android.icu.text.ScientificNumberFormatter getMarkupInstance(android.icu.util.ULocale, String, String);
    method public static android.icu.text.ScientificNumberFormatter getMarkupInstance(android.icu.text.DecimalFormat, String, String);
    method public static android.icu.text.ScientificNumberFormatter getSuperscriptInstance(android.icu.util.ULocale);
    method public static android.icu.text.ScientificNumberFormatter getSuperscriptInstance(android.icu.text.DecimalFormat);
  }

  public abstract class SearchIterator {
    ctor protected SearchIterator(java.text.CharacterIterator, android.icu.text.BreakIterator);
    method public final int first();
    method public final int following(int);
    method public android.icu.text.BreakIterator getBreakIterator();
    method public android.icu.text.SearchIterator.ElementComparisonType getElementComparisonType();
    method public abstract int getIndex();
    method public int getMatchLength();
    method public int getMatchStart();
    method public String getMatchedText();
    method public java.text.CharacterIterator getTarget();
    method protected abstract int handleNext(int);
    method protected abstract int handlePrevious(int);
    method public boolean isOverlapping();
    method public final int last();
    method public int next();
    method public final int preceding(int);
    method public int previous();
    method public void reset();
    method public void setBreakIterator(android.icu.text.BreakIterator);
    method public void setElementComparisonType(android.icu.text.SearchIterator.ElementComparisonType);
    method public void setIndex(int);
    method protected void setMatchLength(int);
    method public void setOverlapping(boolean);
    method public void setTarget(java.text.CharacterIterator);
    field public static final int DONE = -1; // 0xffffffff
    field protected android.icu.text.BreakIterator breakIterator;
    field protected int matchLength;
    field protected java.text.CharacterIterator targetText;
  }

  public enum SearchIterator.ElementComparisonType {
    enum_constant public static final android.icu.text.SearchIterator.ElementComparisonType ANY_BASE_WEIGHT_IS_WILDCARD;
    enum_constant public static final android.icu.text.SearchIterator.ElementComparisonType PATTERN_BASE_WEIGHT_IS_WILDCARD;
    enum_constant public static final android.icu.text.SearchIterator.ElementComparisonType STANDARD_ELEMENT_COMPARISON;
  }

  public class SelectFormat extends java.text.Format {
    ctor public SelectFormat(String);
    method public void applyPattern(String);
    method public final String format(String);
    method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
    method public Object parseObject(String, java.text.ParsePosition);
    method public String toPattern();
  }

  public class SimpleDateFormat extends android.icu.text.DateFormat {
    ctor public SimpleDateFormat();
    ctor public SimpleDateFormat(String);
    ctor public SimpleDateFormat(String, java.util.Locale);
    ctor public SimpleDateFormat(String, android.icu.util.ULocale);
    ctor public SimpleDateFormat(String, String, android.icu.util.ULocale);
    ctor public SimpleDateFormat(String, android.icu.text.DateFormatSymbols);
    method public void applyLocalizedPattern(String);
    method public void applyPattern(String);
    method public StringBuffer format(android.icu.util.Calendar, StringBuffer, java.text.FieldPosition);
    method public java.util.Date get2DigitYearStart();
    method public android.icu.text.DateFormatSymbols getDateFormatSymbols();
    method public android.icu.text.NumberFormat getNumberFormat(char);
    method protected android.icu.text.DateFormatSymbols getSymbols();
    method public android.icu.text.TimeZoneFormat getTimeZoneFormat();
    method protected int matchQuarterString(String, int, int, String[], android.icu.util.Calendar);
    method protected int matchString(String, int, int, String[], android.icu.util.Calendar);
    method public void parse(String, android.icu.util.Calendar, java.text.ParsePosition);
    method protected android.icu.text.DateFormat.Field patternCharToDateFormatField(char);
    method public void set2DigitYearStart(java.util.Date);
    method public void setDateFormatSymbols(android.icu.text.DateFormatSymbols);
    method public void setNumberFormat(String, android.icu.text.NumberFormat);
    method public void setTimeZoneFormat(android.icu.text.TimeZoneFormat);
    method protected String subFormat(char, int, int, java.text.FieldPosition, android.icu.text.DateFormatSymbols, android.icu.util.Calendar) throws java.lang.IllegalArgumentException;
    method protected int subParse(String, int, char, int, boolean, boolean, boolean[], android.icu.util.Calendar);
    method public String toLocalizedPattern();
    method public String toPattern();
    method protected String zeroPaddingNumber(long, int, int);
  }

  public class StringPrepParseException extends java.text.ParseException {
    ctor public StringPrepParseException(String, int);
    ctor public StringPrepParseException(String, int, String, int);
    ctor public StringPrepParseException(String, int, String, int, int);
    method public int getError();
    field public static final int ACE_PREFIX_ERROR = 6; // 0x6
    field public static final int BUFFER_OVERFLOW_ERROR = 9; // 0x9
    field public static final int CHECK_BIDI_ERROR = 4; // 0x4
    field public static final int DOMAIN_NAME_TOO_LONG_ERROR = 11; // 0xb
    field public static final int ILLEGAL_CHAR_FOUND = 1; // 0x1
    field public static final int INVALID_CHAR_FOUND = 0; // 0x0
    field public static final int LABEL_TOO_LONG_ERROR = 8; // 0x8
    field public static final int PROHIBITED_ERROR = 2; // 0x2
    field public static final int STD3_ASCII_RULES_ERROR = 5; // 0x5
    field public static final int UNASSIGNED_ERROR = 3; // 0x3
    field public static final int VERIFICATION_ERROR = 7; // 0x7
    field public static final int ZERO_LENGTH_LABEL = 10; // 0xa
  }

  public final class StringSearch extends android.icu.text.SearchIterator {
    ctor public StringSearch(String, java.text.CharacterIterator, android.icu.text.RuleBasedCollator, android.icu.text.BreakIterator);
    ctor public StringSearch(String, java.text.CharacterIterator, android.icu.text.RuleBasedCollator);
    ctor public StringSearch(String, java.text.CharacterIterator, java.util.Locale);
    ctor public StringSearch(String, java.text.CharacterIterator, android.icu.util.ULocale);
    ctor public StringSearch(String, String);
    method public android.icu.text.RuleBasedCollator getCollator();
    method public int getIndex();
    method public String getPattern();
    method protected int handleNext(int);
    method protected int handlePrevious(int);
    method public boolean isCanonical();
    method public void setCanonical(boolean);
    method public void setCollator(android.icu.text.RuleBasedCollator);
    method public void setPattern(String);
  }

  public interface SymbolTable {
    method public char[] lookup(String);
    method public android.icu.text.UnicodeMatcher lookupMatcher(int);
    method public String parseReference(String, java.text.ParsePosition, int);
    field public static final char SYMBOL_REF = 36; // 0x0024 '$'
  }

  public class TimeZoneFormat extends android.icu.text.UFormat implements android.icu.util.Freezable<android.icu.text.TimeZoneFormat> java.io.Serializable {
    ctor protected TimeZoneFormat(android.icu.util.ULocale);
    method public android.icu.text.TimeZoneFormat cloneAsThawed();
    method public final String format(android.icu.text.TimeZoneFormat.Style, android.icu.util.TimeZone, long);
    method public String format(android.icu.text.TimeZoneFormat.Style, android.icu.util.TimeZone, long, android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>);
    method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
    method public final String formatOffsetISO8601Basic(int, boolean, boolean, boolean);
    method public final String formatOffsetISO8601Extended(int, boolean, boolean, boolean);
    method public String formatOffsetLocalizedGMT(int);
    method public String formatOffsetShortLocalizedGMT(int);
    method public android.icu.text.TimeZoneFormat freeze();
    method public java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption> getDefaultParseOptions();
    method public String getGMTOffsetDigits();
    method public String getGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType);
    method public String getGMTPattern();
    method public String getGMTZeroFormat();
    method public static android.icu.text.TimeZoneFormat getInstance(android.icu.util.ULocale);
    method public static android.icu.text.TimeZoneFormat getInstance(java.util.Locale);
    method public android.icu.text.TimeZoneNames getTimeZoneNames();
    method public boolean isFrozen();
    method public android.icu.util.TimeZone parse(android.icu.text.TimeZoneFormat.Style, String, java.text.ParsePosition, java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>, android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>);
    method public android.icu.util.TimeZone parse(android.icu.text.TimeZoneFormat.Style, String, java.text.ParsePosition, android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>);
    method public final android.icu.util.TimeZone parse(String, java.text.ParsePosition);
    method public final android.icu.util.TimeZone parse(String) throws java.text.ParseException;
    method public Object parseObject(String, java.text.ParsePosition);
    method public final int parseOffsetISO8601(String, java.text.ParsePosition);
    method public int parseOffsetLocalizedGMT(String, java.text.ParsePosition);
    method public int parseOffsetShortLocalizedGMT(String, java.text.ParsePosition);
    method public android.icu.text.TimeZoneFormat setDefaultParseOptions(java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>);
    method public android.icu.text.TimeZoneFormat setGMTOffsetDigits(String);
    method public android.icu.text.TimeZoneFormat setGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType, String);
    method public android.icu.text.TimeZoneFormat setGMTPattern(String);
    method public android.icu.text.TimeZoneFormat setGMTZeroFormat(String);
    method public android.icu.text.TimeZoneFormat setTimeZoneNames(android.icu.text.TimeZoneNames);
  }

  public enum TimeZoneFormat.GMTOffsetPatternType {
    enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType NEGATIVE_H;
    enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType NEGATIVE_HM;
    enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType NEGATIVE_HMS;
    enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType POSITIVE_H;
    enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType POSITIVE_HM;
    enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType POSITIVE_HMS;
  }

  public enum TimeZoneFormat.ParseOption {
    enum_constant public static final android.icu.text.TimeZoneFormat.ParseOption ALL_STYLES;
    enum_constant public static final android.icu.text.TimeZoneFormat.ParseOption TZ_DATABASE_ABBREVIATIONS;
  }

  public enum TimeZoneFormat.Style {
    enum_constant public static final android.icu.text.TimeZoneFormat.Style EXEMPLAR_LOCATION;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style GENERIC_LOCATION;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style GENERIC_LONG;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style GENERIC_SHORT;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_FIXED;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_FULL;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_LOCAL_FIXED;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_LOCAL_FULL;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_LOCAL_SHORT;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_SHORT;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_EXTENDED_FIXED;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_EXTENDED_FULL;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_EXTENDED_LOCAL_FIXED;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_EXTENDED_LOCAL_FULL;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style LOCALIZED_GMT;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style LOCALIZED_GMT_SHORT;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style SPECIFIC_LONG;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style SPECIFIC_SHORT;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style ZONE_ID;
    enum_constant public static final android.icu.text.TimeZoneFormat.Style ZONE_ID_SHORT;
  }

  public enum TimeZoneFormat.TimeType {
    enum_constant public static final android.icu.text.TimeZoneFormat.TimeType DAYLIGHT;
    enum_constant public static final android.icu.text.TimeZoneFormat.TimeType STANDARD;
    enum_constant public static final android.icu.text.TimeZoneFormat.TimeType UNKNOWN;
  }

  public abstract class TimeZoneNames implements java.io.Serializable {
    method public abstract java.util.Set<java.lang.String> getAvailableMetaZoneIDs();
    method public abstract java.util.Set<java.lang.String> getAvailableMetaZoneIDs(String);
    method public final String getDisplayName(String, android.icu.text.TimeZoneNames.NameType, long);
    method public String getExemplarLocationName(String);
    method public static android.icu.text.TimeZoneNames getInstance(android.icu.util.ULocale);
    method public static android.icu.text.TimeZoneNames getInstance(java.util.Locale);
    method public abstract String getMetaZoneDisplayName(String, android.icu.text.TimeZoneNames.NameType);
    method public abstract String getMetaZoneID(String, long);
    method public abstract String getReferenceZoneID(String, String);
    method public static android.icu.text.TimeZoneNames getTZDBInstance(android.icu.util.ULocale);
    method public abstract String getTimeZoneDisplayName(String, android.icu.text.TimeZoneNames.NameType);
  }

  public enum TimeZoneNames.NameType {
    enum_constant public static final android.icu.text.TimeZoneNames.NameType EXEMPLAR_LOCATION;
    enum_constant public static final android.icu.text.TimeZoneNames.NameType LONG_DAYLIGHT;
    enum_constant public static final android.icu.text.TimeZoneNames.NameType LONG_GENERIC;
    enum_constant public static final android.icu.text.TimeZoneNames.NameType LONG_STANDARD;
    enum_constant public static final android.icu.text.TimeZoneNames.NameType SHORT_DAYLIGHT;
    enum_constant public static final android.icu.text.TimeZoneNames.NameType SHORT_GENERIC;
    enum_constant public static final android.icu.text.TimeZoneNames.NameType SHORT_STANDARD;
  }

  public abstract class Transliterator {
    method public static final android.icu.text.Transliterator createFromRules(String, String, int);
    method public void filteredTransliterate(android.icu.text.Replaceable, android.icu.text.Transliterator.Position, boolean);
    method public final void finishTransliteration(android.icu.text.Replaceable, android.icu.text.Transliterator.Position);
    method public static final java.util.Enumeration<java.lang.String> getAvailableIDs();
    method public static final java.util.Enumeration<java.lang.String> getAvailableSources();
    method public static final java.util.Enumeration<java.lang.String> getAvailableTargets(String);
    method public static final java.util.Enumeration<java.lang.String> getAvailableVariants(String, String);
    method public static final String getDisplayName(String);
    method public static String getDisplayName(String, java.util.Locale);
    method public static String getDisplayName(String, android.icu.util.ULocale);
    method public android.icu.text.Transliterator[] getElements();
    method public final android.icu.text.UnicodeFilter getFilter();
    method public final String getID();
    method public static final android.icu.text.Transliterator getInstance(String);
    method public static android.icu.text.Transliterator getInstance(String, int);
    method public final android.icu.text.Transliterator getInverse();
    method public final int getMaximumContextLength();
    method public final android.icu.text.UnicodeSet getSourceSet();
    method public android.icu.text.UnicodeSet getTargetSet();
    method public void setFilter(android.icu.text.UnicodeFilter);
    method public String toRules(boolean);
    method public final int transliterate(android.icu.text.Replaceable, int, int);
    method public final void transliterate(android.icu.text.Replaceable);
    method public final String transliterate(String);
    method public final void transliterate(android.icu.text.Replaceable, android.icu.text.Transliterator.Position, String);
    method public final void transliterate(android.icu.text.Replaceable, android.icu.text.Transliterator.Position, int);
    method public final void transliterate(android.icu.text.Replaceable, android.icu.text.Transliterator.Position);
    field public static final int FORWARD = 0; // 0x0
    field public static final int REVERSE = 1; // 0x1
  }

  public static class Transliterator.Position {
    ctor public Transliterator.Position();
    ctor public Transliterator.Position(int, int, int);
    ctor public Transliterator.Position(int, int, int, int);
    ctor public Transliterator.Position(android.icu.text.Transliterator.Position);
    method public void set(android.icu.text.Transliterator.Position);
    method public final void validate(int);
    field public int contextLimit;
    field public int contextStart;
    field public int limit;
    field public int start;
  }

  public abstract class UCharacterIterator implements java.lang.Cloneable {
    ctor protected UCharacterIterator();
    method public Object clone() throws java.lang.CloneNotSupportedException;
    method public abstract int current();
    method public int currentCodePoint();
    method public java.text.CharacterIterator getCharacterIterator();
    method public abstract int getIndex();
    method public static final android.icu.text.UCharacterIterator getInstance(android.icu.text.Replaceable);
    method public static final android.icu.text.UCharacterIterator getInstance(String);
    method public static final android.icu.text.UCharacterIterator getInstance(char[]);
    method public static final android.icu.text.UCharacterIterator getInstance(char[], int, int);
    method public static final android.icu.text.UCharacterIterator getInstance(StringBuffer);
    method public static final android.icu.text.UCharacterIterator getInstance(java.text.CharacterIterator);
    method public abstract int getLength();
    method public abstract int getText(char[], int);
    method public final int getText(char[]);
    method public String getText();
    method public int moveCodePointIndex(int);
    method public int moveIndex(int);
    method public abstract int next();
    method public int nextCodePoint();
    method public abstract int previous();
    method public int previousCodePoint();
    method public abstract void setIndex(int);
    method public void setToLimit();
    method public void setToStart();
    field public static final int DONE = -1; // 0xffffffff
  }

  public abstract class UFormat extends java.text.Format {
    ctor public UFormat();
  }

  public abstract class UnicodeFilter implements android.icu.text.UnicodeMatcher {
    method public abstract boolean contains(int);
    method public int matches(android.icu.text.Replaceable, int[], int, boolean);
  }

  public interface UnicodeMatcher {
    method public void addMatchSetTo(android.icu.text.UnicodeSet);
    method public int matches(android.icu.text.Replaceable, int[], int, boolean);
    method public boolean matchesIndexValue(int);
    method public String toPattern(boolean);
    field public static final char ETHER = 65535; // 0xffff '\uffff'
    field public static final int U_MATCH = 2; // 0x2
    field public static final int U_MISMATCH = 0; // 0x0
    field public static final int U_PARTIAL_MATCH = 1; // 0x1
  }

  public class UnicodeSet extends android.icu.text.UnicodeFilter implements java.lang.Comparable<android.icu.text.UnicodeSet> android.icu.util.Freezable<android.icu.text.UnicodeSet> java.lang.Iterable<java.lang.String> {
    ctor public UnicodeSet();
    ctor public UnicodeSet(android.icu.text.UnicodeSet);
    ctor public UnicodeSet(int, int);
    ctor public UnicodeSet(int...);
    ctor public UnicodeSet(String);
    ctor public UnicodeSet(String, boolean);
    ctor public UnicodeSet(String, int);
    ctor public UnicodeSet(String, java.text.ParsePosition, android.icu.text.SymbolTable);
    ctor public UnicodeSet(String, java.text.ParsePosition, android.icu.text.SymbolTable, int);
    method public StringBuffer _generatePattern(StringBuffer, boolean);
    method public StringBuffer _generatePattern(StringBuffer, boolean, boolean);
    method public android.icu.text.UnicodeSet add(int, int);
    method public final android.icu.text.UnicodeSet add(int);
    method public final android.icu.text.UnicodeSet add(CharSequence);
    method public android.icu.text.UnicodeSet add(Iterable<?>);
    method public android.icu.text.UnicodeSet addAll(int, int);
    method public final android.icu.text.UnicodeSet addAll(CharSequence);
    method public android.icu.text.UnicodeSet addAll(android.icu.text.UnicodeSet);
    method public android.icu.text.UnicodeSet addAll(Iterable<?>);
    method public <T extends java.lang.CharSequence> android.icu.text.UnicodeSet addAll(T...);
    method public <T extends java.util.Collection<java.lang.String>> T addAllTo(T);
    method public void addMatchSetTo(android.icu.text.UnicodeSet);
    method public android.icu.text.UnicodeSet applyIntPropertyValue(int, int);
    method public final android.icu.text.UnicodeSet applyPattern(String);
    method public android.icu.text.UnicodeSet applyPattern(String, boolean);
    method public android.icu.text.UnicodeSet applyPattern(String, int);
    method public android.icu.text.UnicodeSet applyPropertyAlias(String, String);
    method public android.icu.text.UnicodeSet applyPropertyAlias(String, String, android.icu.text.SymbolTable);
    method public int charAt(int);
    method public android.icu.text.UnicodeSet clear();
    method public Object clone();
    method public android.icu.text.UnicodeSet cloneAsThawed();
    method public android.icu.text.UnicodeSet closeOver(int);
    method public android.icu.text.UnicodeSet compact();
    method public int compareTo(android.icu.text.UnicodeSet);
    method public int compareTo(android.icu.text.UnicodeSet, android.icu.text.UnicodeSet.ComparisonStyle);
    method public int compareTo(Iterable<java.lang.String>);
    method public android.icu.text.UnicodeSet complement(int, int);
    method public final android.icu.text.UnicodeSet complement(int);
    method public android.icu.text.UnicodeSet complement();
    method public final android.icu.text.UnicodeSet complement(CharSequence);
    method public final android.icu.text.UnicodeSet complementAll(CharSequence);
    method public android.icu.text.UnicodeSet complementAll(android.icu.text.UnicodeSet);
    method public boolean contains(int);
    method public boolean contains(int, int);
    method public final boolean contains(CharSequence);
    method public boolean containsAll(android.icu.text.UnicodeSet);
    method public boolean containsAll(String);
    method public <T extends java.lang.CharSequence> boolean containsAll(Iterable<T>);
    method public boolean containsNone(int, int);
    method public boolean containsNone(android.icu.text.UnicodeSet);
    method public boolean containsNone(CharSequence);
    method public <T extends java.lang.CharSequence> boolean containsNone(Iterable<T>);
    method public final boolean containsSome(int, int);
    method public final boolean containsSome(android.icu.text.UnicodeSet);
    method public final boolean containsSome(CharSequence);
    method public final <T extends java.lang.CharSequence> boolean containsSome(Iterable<T>);
    method public android.icu.text.UnicodeSet freeze();
    method public static android.icu.text.UnicodeSet from(CharSequence);
    method public static android.icu.text.UnicodeSet fromAll(CharSequence);
    method public int getRangeCount();
    method public int getRangeEnd(int);
    method public int getRangeStart(int);
    method public int indexOf(int);
    method public boolean isEmpty();
    method public boolean isFrozen();
    method public java.util.Iterator<java.lang.String> iterator();
    method public boolean matchesIndexValue(int);
    method public Iterable<android.icu.text.UnicodeSet.EntryRange> ranges();
    method public android.icu.text.UnicodeSet remove(int, int);
    method public final android.icu.text.UnicodeSet remove(int);
    method public final android.icu.text.UnicodeSet remove(CharSequence);
    method public final android.icu.text.UnicodeSet removeAll(CharSequence);
    method public android.icu.text.UnicodeSet removeAll(android.icu.text.UnicodeSet);
    method public <T extends java.lang.CharSequence> android.icu.text.UnicodeSet removeAll(Iterable<T>);
    method public final android.icu.text.UnicodeSet removeAllStrings();
    method public android.icu.text.UnicodeSet retain(int, int);
    method public final android.icu.text.UnicodeSet retain(int);
    method public final android.icu.text.UnicodeSet retain(CharSequence);
    method public final android.icu.text.UnicodeSet retainAll(CharSequence);
    method public android.icu.text.UnicodeSet retainAll(android.icu.text.UnicodeSet);
    method public <T extends java.lang.CharSequence> android.icu.text.UnicodeSet retainAll(Iterable<T>);
    method public android.icu.text.UnicodeSet set(int, int);
    method public android.icu.text.UnicodeSet set(android.icu.text.UnicodeSet);
    method public int size();
    method public int span(CharSequence, android.icu.text.UnicodeSet.SpanCondition);
    method public int span(CharSequence, int, android.icu.text.UnicodeSet.SpanCondition);
    method public int spanBack(CharSequence, android.icu.text.UnicodeSet.SpanCondition);
    method public int spanBack(CharSequence, int, android.icu.text.UnicodeSet.SpanCondition);
    method public java.util.Collection<java.lang.String> strings();
    method public String toPattern(boolean);
    field public static final int ADD_CASE_MAPPINGS = 4; // 0x4
    field public static final android.icu.text.UnicodeSet ALL_CODE_POINTS;
    field public static final int CASE = 2; // 0x2
    field public static final int CASE_INSENSITIVE = 2; // 0x2
    field public static final android.icu.text.UnicodeSet EMPTY;
    field public static final int IGNORE_SPACE = 1; // 0x1
    field public static final int MAX_VALUE = 1114111; // 0x10ffff
    field public static final int MIN_VALUE = 0; // 0x0
  }

  public enum UnicodeSet.ComparisonStyle {
    enum_constant public static final android.icu.text.UnicodeSet.ComparisonStyle LEXICOGRAPHIC;
    enum_constant public static final android.icu.text.UnicodeSet.ComparisonStyle LONGER_FIRST;
    enum_constant public static final android.icu.text.UnicodeSet.ComparisonStyle SHORTER_FIRST;
  }

  public static class UnicodeSet.EntryRange {
    field public int codepoint;
    field public int codepointEnd;
  }

  public enum UnicodeSet.SpanCondition {
    enum_constant public static final android.icu.text.UnicodeSet.SpanCondition CONDITION_COUNT;
    enum_constant public static final android.icu.text.UnicodeSet.SpanCondition CONTAINED;
    enum_constant public static final android.icu.text.UnicodeSet.SpanCondition NOT_CONTAINED;
    enum_constant public static final android.icu.text.UnicodeSet.SpanCondition SIMPLE;
  }

  public class UnicodeSetIterator {
    ctor public UnicodeSetIterator(android.icu.text.UnicodeSet);
    ctor public UnicodeSetIterator();
    method public String getString();
    method public boolean next();
    method public boolean nextRange();
    method public void reset(android.icu.text.UnicodeSet);
    method public void reset();
    field public static int IS_STRING;
    field public int codepoint;
    field public int codepointEnd;
    field public String string;
  }

  public class UnicodeSetSpanner {
    ctor public UnicodeSetSpanner(android.icu.text.UnicodeSet);
    method public int countIn(CharSequence);
    method public int countIn(CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod);
    method public int countIn(CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod, android.icu.text.UnicodeSet.SpanCondition);
    method public String deleteFrom(CharSequence);
    method public String deleteFrom(CharSequence, android.icu.text.UnicodeSet.SpanCondition);
    method public android.icu.text.UnicodeSet getUnicodeSet();
    method public String replaceFrom(CharSequence, CharSequence);
    method public String replaceFrom(CharSequence, CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod);
    method public String replaceFrom(CharSequence, CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod, android.icu.text.UnicodeSet.SpanCondition);
    method public CharSequence trim(CharSequence);
    method public CharSequence trim(CharSequence, android.icu.text.UnicodeSetSpanner.TrimOption);
    method public CharSequence trim(CharSequence, android.icu.text.UnicodeSetSpanner.TrimOption, android.icu.text.UnicodeSet.SpanCondition);
  }

  public enum UnicodeSetSpanner.CountMethod {
    enum_constant public static final android.icu.text.UnicodeSetSpanner.CountMethod MIN_ELEMENTS;
    enum_constant public static final android.icu.text.UnicodeSetSpanner.CountMethod WHOLE_SPAN;
  }

  public enum UnicodeSetSpanner.TrimOption {
    enum_constant public static final android.icu.text.UnicodeSetSpanner.TrimOption BOTH;
    enum_constant public static final android.icu.text.UnicodeSetSpanner.TrimOption LEADING;
    enum_constant public static final android.icu.text.UnicodeSetSpanner.TrimOption TRAILING;
  }

}

package android.icu.util {

  public class BuddhistCalendar extends android.icu.util.GregorianCalendar {
    ctor public BuddhistCalendar();
    ctor public BuddhistCalendar(android.icu.util.TimeZone);
    ctor public BuddhistCalendar(java.util.Locale);
    ctor public BuddhistCalendar(android.icu.util.ULocale);
    ctor public BuddhistCalendar(android.icu.util.TimeZone, java.util.Locale);
    ctor public BuddhistCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
    ctor public BuddhistCalendar(java.util.Date);
    ctor public BuddhistCalendar(int, int, int);
    ctor public BuddhistCalendar(int, int, int, int, int, int);
    field public static final int BE = 0; // 0x0
  }

  public abstract class Calendar implements java.lang.Cloneable java.lang.Comparable<android.icu.util.Calendar> java.io.Serializable {
    ctor protected Calendar();
    ctor protected Calendar(android.icu.util.TimeZone, java.util.Locale);
    ctor protected Calendar(android.icu.util.TimeZone, android.icu.util.ULocale);
    method public void add(int, int);
    method public boolean after(Object);
    method public boolean before(Object);
    method public final void clear();
    method public final void clear(int);
    method public Object clone();
    method public int compareTo(android.icu.util.Calendar);
    method protected void complete();
    method protected void computeFields();
    method protected final void computeGregorianFields(int);
    method protected int computeGregorianMonthStart(int, int);
    method protected int computeJulianDay();
    method @Deprecated protected int computeMillisInDay();
    method protected void computeTime();
    method @Deprecated protected int computeZoneOffset(long, int);
    method public int fieldDifference(java.util.Date, int);
    method protected String fieldName(int);
    method protected static final long floorDivide(long, long);
    method protected static final int floorDivide(int, int);
    method protected static final int floorDivide(int, int, int[]);
    method protected static final int floorDivide(long, int, int[]);
    method public final int get(int);
    method public int getActualMaximum(int);
    method public int getActualMinimum(int);
    method public static java.util.Locale[] getAvailableLocales();
    method public android.icu.text.DateFormat getDateTimeFormat(int, int, java.util.Locale);
    method public android.icu.text.DateFormat getDateTimeFormat(int, int, android.icu.util.ULocale);
    method public String getDisplayName(java.util.Locale);
    method public String getDisplayName(android.icu.util.ULocale);
    method public final int getFieldCount();
    method protected int[][][] getFieldResolutionTable();
    method public int getFirstDayOfWeek();
    method public final int getGreatestMinimum(int);
    method protected final int getGregorianDayOfMonth();
    method protected final int getGregorianDayOfYear();
    method protected final int getGregorianMonth();
    method protected final int getGregorianYear();
    method public static android.icu.util.Calendar getInstance();
    method public static android.icu.util.Calendar getInstance(android.icu.util.TimeZone);
    method public static android.icu.util.Calendar getInstance(java.util.Locale);
    method public static android.icu.util.Calendar getInstance(android.icu.util.ULocale);
    method public static android.icu.util.Calendar getInstance(android.icu.util.TimeZone, java.util.Locale);
    method public static android.icu.util.Calendar getInstance(android.icu.util.TimeZone, android.icu.util.ULocale);
    method public static final String[] getKeywordValuesForLocale(String, android.icu.util.ULocale, boolean);
    method public final int getLeastMaximum(int);
    method protected int getLimit(int, int);
    method public final int getMaximum(int);
    method public int getMinimalDaysInFirstWeek();
    method public final int getMinimum(int);
    method public int getRepeatedWallTimeOption();
    method public int getSkippedWallTimeOption();
    method protected final int getStamp(int);
    method public final java.util.Date getTime();
    method public long getTimeInMillis();
    method public android.icu.util.TimeZone getTimeZone();
    method public String getType();
    method public android.icu.util.Calendar.WeekData getWeekData();
    method public static android.icu.util.Calendar.WeekData getWeekDataForRegion(String);
    method protected static final int gregorianMonthLength(int, int);
    method protected static final int gregorianPreviousMonthLength(int, int);
    method protected void handleComputeFields(int);
    method protected int handleComputeJulianDay(int);
    method protected abstract int handleComputeMonthStart(int, int, boolean);
    method protected int[] handleCreateFields();
    method protected android.icu.text.DateFormat handleGetDateFormat(String, java.util.Locale);
    method protected android.icu.text.DateFormat handleGetDateFormat(String, String, java.util.Locale);
    method protected android.icu.text.DateFormat handleGetDateFormat(String, android.icu.util.ULocale);
    method protected abstract int handleGetExtendedYear();
    method protected abstract int handleGetLimit(int, int);
    method protected int handleGetMonthLength(int, int);
    method protected int handleGetYearLength(int);
    method protected final int internalGet(int);
    method protected final int internalGet(int, int);
    method protected final long internalGetTimeInMillis();
    method protected final void internalSet(int, int);
    method public boolean isEquivalentTo(android.icu.util.Calendar);
    method protected static final boolean isGregorianLeapYear(int);
    method public boolean isLenient();
    method public final boolean isSet(int);
    method public boolean isWeekend(java.util.Date);
    method public boolean isWeekend();
    method protected static final int julianDayToDayOfWeek(int);
    method protected static final long julianDayToMillis(int);
    method protected static final int millisToJulianDay(long);
    method protected int newerField(int, int);
    method protected int newestStamp(int, int, int);
    method protected void pinField(int);
    method protected void prepareGetActual(int, boolean);
    method protected int resolveFields(int[][][]);
    method public final void roll(int, boolean);
    method public void roll(int, int);
    method public final void set(int, int);
    method public final void set(int, int, int);
    method public final void set(int, int, int, int, int);
    method public final void set(int, int, int, int, int, int);
    method public void setFirstDayOfWeek(int);
    method public void setLenient(boolean);
    method public void setMinimalDaysInFirstWeek(int);
    method public void setRepeatedWallTimeOption(int);
    method public void setSkippedWallTimeOption(int);
    method public final void setTime(java.util.Date);
    method public void setTimeInMillis(long);
    method public void setTimeZone(android.icu.util.TimeZone);
    method public android.icu.util.Calendar setWeekData(android.icu.util.Calendar.WeekData);
    method protected void validateField(int);
    method protected final void validateField(int, int, int);
    method protected void validateFields();
    method protected int weekNumber(int, int, int);
    method protected final int weekNumber(int, int);
    field public static final int AM = 0; // 0x0
    field public static final int AM_PM = 9; // 0x9
    field public static final int APRIL = 3; // 0x3
    field public static final int AUGUST = 7; // 0x7
    field @Deprecated protected static final int BASE_FIELD_COUNT = 23; // 0x17
    field public static final int DATE = 5; // 0x5
    field public static final int DAY_OF_MONTH = 5; // 0x5
    field public static final int DAY_OF_WEEK = 7; // 0x7
    field public static final int DAY_OF_WEEK_IN_MONTH = 8; // 0x8
    field public static final int DAY_OF_YEAR = 6; // 0x6
    field public static final int DECEMBER = 11; // 0xb
    field public static final int DOW_LOCAL = 18; // 0x12
    field public static final int DST_OFFSET = 16; // 0x10
    field protected static final int EPOCH_JULIAN_DAY = 2440588; // 0x253d8c
    field public static final int ERA = 0; // 0x0
    field public static final int EXTENDED_YEAR = 19; // 0x13
    field public static final int FEBRUARY = 1; // 0x1
    field public static final int FRIDAY = 6; // 0x6
    field protected static final int GREATEST_MINIMUM = 1; // 0x1
    field public static final int HOUR = 10; // 0xa
    field public static final int HOUR_OF_DAY = 11; // 0xb
    field protected static final int INTERNALLY_SET = 1; // 0x1
    field public static final int IS_LEAP_MONTH = 22; // 0x16
    field public static final int JANUARY = 0; // 0x0
    field protected static final int JAN_1_1_JULIAN_DAY = 1721426; // 0x1a4452
    field public static final int JULIAN_DAY = 20; // 0x14
    field public static final int JULY = 6; // 0x6
    field public static final int JUNE = 5; // 0x5
    field protected static final int LEAST_MAXIMUM = 2; // 0x2
    field public static final int MARCH = 2; // 0x2
    field protected static final int MAXIMUM = 3; // 0x3
    field protected static final java.util.Date MAX_DATE;
    field @Deprecated protected static final int MAX_FIELD_COUNT = 32; // 0x20
    field protected static final int MAX_JULIAN = 2130706432; // 0x7f000000
    field protected static final long MAX_MILLIS = 183882168921600000L; // 0x28d47dbbf19b000L
    field public static final int MAY = 4; // 0x4
    field public static final int MILLISECOND = 14; // 0xe
    field public static final int MILLISECONDS_IN_DAY = 21; // 0x15
    field protected static final int MINIMUM = 0; // 0x0
    field protected static final int MINIMUM_USER_STAMP = 2; // 0x2
    field public static final int MINUTE = 12; // 0xc
    field protected static final java.util.Date MIN_DATE;
    field protected static final int MIN_JULIAN = -2130706432; // 0x81000000
    field protected static final long MIN_MILLIS = -184303902528000000L; // 0xfd713893bf19b000L
    field public static final int MONDAY = 2; // 0x2
    field public static final int MONTH = 2; // 0x2
    field public static final int NOVEMBER = 10; // 0xa
    field public static final int OCTOBER = 9; // 0x9
    field protected static final long ONE_DAY = 86400000L; // 0x5265c00L
    field protected static final int ONE_HOUR = 3600000; // 0x36ee80
    field protected static final int ONE_MINUTE = 60000; // 0xea60
    field protected static final int ONE_SECOND = 1000; // 0x3e8
    field protected static final long ONE_WEEK = 604800000L; // 0x240c8400L
    field public static final int PM = 1; // 0x1
    field protected static final int RESOLVE_REMAP = 32; // 0x20
    field public static final int SATURDAY = 7; // 0x7
    field public static final int SECOND = 13; // 0xd
    field public static final int SEPTEMBER = 8; // 0x8
    field public static final int SUNDAY = 1; // 0x1
    field public static final int THURSDAY = 5; // 0x5
    field public static final int TUESDAY = 3; // 0x3
    field public static final int UNDECIMBER = 12; // 0xc
    field protected static final int UNSET = 0; // 0x0
    field public static final int WALLTIME_FIRST = 1; // 0x1
    field public static final int WALLTIME_LAST = 0; // 0x0
    field public static final int WALLTIME_NEXT_VALID = 2; // 0x2
    field public static final int WEDNESDAY = 4; // 0x4
    field public static final int WEEK_OF_MONTH = 4; // 0x4
    field public static final int WEEK_OF_YEAR = 3; // 0x3
    field public static final int YEAR = 1; // 0x1
    field public static final int YEAR_WOY = 17; // 0x11
    field public static final int ZONE_OFFSET = 15; // 0xf
  }

  public static final class Calendar.WeekData {
    ctor public Calendar.WeekData(int, int, int, int, int, int);
    field public final int firstDayOfWeek;
    field public final int minimalDaysInFirstWeek;
    field public final int weekendCease;
    field public final int weekendCeaseMillis;
    field public final int weekendOnset;
    field public final int weekendOnsetMillis;
  }

  public class ChineseCalendar extends android.icu.util.Calendar {
    ctor public ChineseCalendar();
    ctor public ChineseCalendar(java.util.Date);
    ctor public ChineseCalendar(int, int, int, int);
    ctor public ChineseCalendar(int, int, int, int, int, int, int);
    ctor public ChineseCalendar(int, int, int, int, int);
    ctor public ChineseCalendar(int, int, int, int, int, int, int, int);
    ctor public ChineseCalendar(java.util.Locale);
    ctor public ChineseCalendar(android.icu.util.TimeZone);
    ctor public ChineseCalendar(android.icu.util.TimeZone, java.util.Locale);
    ctor public ChineseCalendar(android.icu.util.ULocale);
    ctor public ChineseCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
    method protected int handleComputeMonthStart(int, int, boolean);
    method protected android.icu.text.DateFormat handleGetDateFormat(String, String, android.icu.util.ULocale);
    method protected int handleGetExtendedYear();
    method protected int handleGetLimit(int, int);
  }

  public final class CopticCalendar extends android.icu.util.Calendar {
    ctor public CopticCalendar();
    ctor public CopticCalendar(android.icu.util.TimeZone);
    ctor public CopticCalendar(java.util.Locale);
    ctor public CopticCalendar(android.icu.util.ULocale);
    ctor public CopticCalendar(android.icu.util.TimeZone, java.util.Locale);
    ctor public CopticCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
    ctor public CopticCalendar(int, int, int);
    ctor public CopticCalendar(java.util.Date);
    ctor public CopticCalendar(int, int, int, int, int, int);
    method @Deprecated protected void handleComputeFields(int);
    method protected int handleComputeMonthStart(int, int, boolean);
    method @Deprecated protected int handleGetExtendedYear();
    method protected int handleGetLimit(int, int);
    field public static final int AMSHIR = 5; // 0x5
    field public static final int BABA = 1; // 0x1
    field public static final int BARAMHAT = 6; // 0x6
    field public static final int BARAMOUDA = 7; // 0x7
    field public static final int BASHANS = 8; // 0x8
    field public static final int EPEP = 10; // 0xa
    field public static final int HATOR = 2; // 0x2
    field public static final int KIAHK = 3; // 0x3
    field public static final int MESRA = 11; // 0xb
    field public static final int NASIE = 12; // 0xc
    field public static final int PAONA = 9; // 0x9
    field public static final int TOBA = 4; // 0x4
    field public static final int TOUT = 0; // 0x0
  }

  public class Currency extends android.icu.util.MeasureUnit {
    ctor protected Currency(String);
    method public static android.icu.util.Currency fromJavaCurrency(java.util.Currency);
    method public static java.util.Set<android.icu.util.Currency> getAvailableCurrencies();
    method public static String[] getAvailableCurrencyCodes(android.icu.util.ULocale, java.util.Date);
    method public static String[] getAvailableCurrencyCodes(java.util.Locale, java.util.Date);
    method public static java.util.Locale[] getAvailableLocales();
    method public static android.icu.util.ULocale[] getAvailableULocales();
    method public String getCurrencyCode();
    method public int getDefaultFractionDigits();
    method public int getDefaultFractionDigits(android.icu.util.Currency.CurrencyUsage);
    method public String getDisplayName();
    method public String getDisplayName(java.util.Locale);
    method public static android.icu.util.Currency getInstance(java.util.Locale);
    method public static android.icu.util.Currency getInstance(android.icu.util.ULocale);
    method public static android.icu.util.Currency getInstance(String);
    method public static final String[] getKeywordValuesForLocale(String, android.icu.util.ULocale, boolean);
    method public String getName(java.util.Locale, int, boolean[]);
    method public String getName(android.icu.util.ULocale, int, boolean[]);
    method public String getName(java.util.Locale, int, String, boolean[]);
    method public String getName(android.icu.util.ULocale, int, String, boolean[]);
    method public int getNumericCode();
    method public double getRoundingIncrement();
    method public double getRoundingIncrement(android.icu.util.Currency.CurrencyUsage);
    method public String getSymbol();
    method public String getSymbol(java.util.Locale);
    method public String getSymbol(android.icu.util.ULocale);
    method public static boolean isAvailable(String, java.util.Date, java.util.Date);
    method public java.util.Currency toJavaCurrency();
    field public static final int LONG_NAME = 1; // 0x1
    field public static final int PLURAL_LONG_NAME = 2; // 0x2
    field public static final int SYMBOL_NAME = 0; // 0x0
  }

  public enum Currency.CurrencyUsage {
    enum_constant public static final android.icu.util.Currency.CurrencyUsage CASH;
    enum_constant public static final android.icu.util.Currency.CurrencyUsage STANDARD;
  }

  public class CurrencyAmount extends android.icu.util.Measure {
    ctor public CurrencyAmount(Number, android.icu.util.Currency);
    ctor public CurrencyAmount(double, android.icu.util.Currency);
    ctor public CurrencyAmount(Number, java.util.Currency);
    ctor public CurrencyAmount(double, java.util.Currency);
    method public android.icu.util.Currency getCurrency();
  }

  public final class DateInterval implements java.io.Serializable {
    ctor public DateInterval(long, long);
    method public long getFromDate();
    method public long getToDate();
  }

  public final class EthiopicCalendar extends android.icu.util.Calendar {
    ctor public EthiopicCalendar();
    ctor public EthiopicCalendar(android.icu.util.TimeZone);
    ctor public EthiopicCalendar(java.util.Locale);
    ctor public EthiopicCalendar(android.icu.util.ULocale);
    ctor public EthiopicCalendar(android.icu.util.TimeZone, java.util.Locale);
    ctor public EthiopicCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
    ctor public EthiopicCalendar(int, int, int);
    ctor public EthiopicCalendar(java.util.Date);
    ctor public EthiopicCalendar(int, int, int, int, int, int);
    method @Deprecated protected void handleComputeFields(int);
    method protected int handleComputeMonthStart(int, int, boolean);
    method @Deprecated protected int handleGetExtendedYear();
    method @Deprecated protected int handleGetLimit(int, int);
    method public boolean isAmeteAlemEra();
    method public void setAmeteAlemEra(boolean);
    field public static final int GENBOT = 8; // 0x8
    field public static final int HAMLE = 10; // 0xa
    field public static final int HEDAR = 2; // 0x2
    field public static final int MEGABIT = 6; // 0x6
    field public static final int MESKEREM = 0; // 0x0
    field public static final int MIAZIA = 7; // 0x7
    field public static final int NEHASSE = 11; // 0xb
    field public static final int PAGUMEN = 12; // 0xc
    field public static final int SENE = 9; // 0x9
    field public static final int TAHSAS = 3; // 0x3
    field public static final int TEKEMT = 1; // 0x1
    field public static final int TER = 4; // 0x4
    field public static final int YEKATIT = 5; // 0x5
  }

  public interface Freezable<T> extends java.lang.Cloneable {
    method public T cloneAsThawed();
    method public T freeze();
    method public boolean isFrozen();
  }

  public class GregorianCalendar extends android.icu.util.Calendar {
    ctor public GregorianCalendar();
    ctor public GregorianCalendar(android.icu.util.TimeZone);
    ctor public GregorianCalendar(java.util.Locale);
    ctor public GregorianCalendar(android.icu.util.ULocale);
    ctor public GregorianCalendar(android.icu.util.TimeZone, java.util.Locale);
    ctor public GregorianCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
    ctor public GregorianCalendar(int, int, int);
    ctor public GregorianCalendar(int, int, int, int, int);
    ctor public GregorianCalendar(int, int, int, int, int, int);
    method public final java.util.Date getGregorianChange();
    method protected int handleComputeMonthStart(int, int, boolean);
    method protected int handleGetExtendedYear();
    method protected int handleGetLimit(int, int);
    method public boolean isLeapYear(int);
    method public void setGregorianChange(java.util.Date);
    field public static final int AD = 1; // 0x1
    field public static final int BC = 0; // 0x0
    field protected transient boolean invertGregorian;
    field protected transient boolean isGregorian;
  }

  public class HebrewCalendar extends android.icu.util.Calendar {
    ctor public HebrewCalendar();
    ctor public HebrewCalendar(android.icu.util.TimeZone);
    ctor public HebrewCalendar(java.util.Locale);
    ctor public HebrewCalendar(android.icu.util.ULocale);
    ctor public HebrewCalendar(android.icu.util.TimeZone, java.util.Locale);
    ctor public HebrewCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
    ctor public HebrewCalendar(int, int, int);
    ctor public HebrewCalendar(java.util.Date);
    ctor public HebrewCalendar(int, int, int, int, int, int);
    method protected int handleComputeMonthStart(int, int, boolean);
    method protected int handleGetExtendedYear();
    method protected int handleGetLimit(int, int);
    method @Deprecated protected void validateField(int);
    field public static final int ADAR = 6; // 0x6
    field public static final int ADAR_1 = 5; // 0x5
    field public static final int AV = 11; // 0xb
    field public static final int ELUL = 12; // 0xc
    field public static final int HESHVAN = 1; // 0x1
    field public static final int IYAR = 8; // 0x8
    field public static final int KISLEV = 2; // 0x2
    field public static final int NISAN = 7; // 0x7
    field public static final int SHEVAT = 4; // 0x4
    field public static final int SIVAN = 9; // 0x9
    field public static final int TAMUZ = 10; // 0xa
    field public static final int TEVET = 3; // 0x3
    field public static final int TISHRI = 0; // 0x0
  }

  public class ICUUncheckedIOException extends java.lang.RuntimeException {
    ctor public ICUUncheckedIOException();
    ctor public ICUUncheckedIOException(String);
    ctor public ICUUncheckedIOException(Throwable);
    ctor public ICUUncheckedIOException(String, Throwable);
  }

  public class IllformedLocaleException extends java.lang.RuntimeException {
    ctor public IllformedLocaleException();
    ctor public IllformedLocaleException(String);
    ctor public IllformedLocaleException(String, int);
    method public int getErrorIndex();
  }

  public class IndianCalendar extends android.icu.util.Calendar {
    ctor public IndianCalendar();
    ctor public IndianCalendar(android.icu.util.TimeZone);
    ctor public IndianCalendar(java.util.Locale);
    ctor public IndianCalendar(android.icu.util.ULocale);
    ctor public IndianCalendar(android.icu.util.TimeZone, java.util.Locale);
    ctor public IndianCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
    ctor public IndianCalendar(java.util.Date);
    ctor public IndianCalendar(int, int, int);
    ctor public IndianCalendar(int, int, int, int, int, int);
    method protected int handleComputeMonthStart(int, int, boolean);
    method protected int handleGetExtendedYear();
    method protected int handleGetLimit(int, int);
    field public static final int AGRAHAYANA = 8; // 0x8
    field public static final int ASADHA = 3; // 0x3
    field public static final int ASVINA = 6; // 0x6
    field public static final int BHADRA = 5; // 0x5
    field public static final int CHAITRA = 0; // 0x0
    field public static final int IE = 0; // 0x0
    field public static final int JYAISTHA = 2; // 0x2
    field public static final int KARTIKA = 7; // 0x7
    field public static final int MAGHA = 10; // 0xa
    field public static final int PAUSA = 9; // 0x9
    field public static final int PHALGUNA = 11; // 0xb
    field public static final int SRAVANA = 4; // 0x4
    field public static final int VAISAKHA = 1; // 0x1
  }

  public class IslamicCalendar extends android.icu.util.Calendar {
    ctor public IslamicCalendar();
    ctor public IslamicCalendar(android.icu.util.TimeZone);
    ctor public IslamicCalendar(java.util.Locale);
    ctor public IslamicCalendar(android.icu.util.ULocale);
    ctor public IslamicCalendar(android.icu.util.TimeZone, java.util.Locale);
    ctor public IslamicCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
    ctor public IslamicCalendar(java.util.Date);
    ctor public IslamicCalendar(int, int, int);
    ctor public IslamicCalendar(int, int, int, int, int, int);
    method public android.icu.util.IslamicCalendar.CalculationType getCalculationType();
    method protected int handleComputeMonthStart(int, int, boolean);
    method protected int handleGetExtendedYear();
    method protected int handleGetLimit(int, int);
    method public void setCalculationType(android.icu.util.IslamicCalendar.CalculationType);
    field public static final int DHU_AL_HIJJAH = 11; // 0xb
    field public static final int DHU_AL_QIDAH = 10; // 0xa
    field public static final int JUMADA_1 = 4; // 0x4
    field public static final int JUMADA_2 = 5; // 0x5
    field public static final int MUHARRAM = 0; // 0x0
    field public static final int RABI_1 = 2; // 0x2
    field public static final int RABI_2 = 3; // 0x3
    field public static final int RAJAB = 6; // 0x6
    field public static final int RAMADAN = 8; // 0x8
    field public static final int SAFAR = 1; // 0x1
    field public static final int SHABAN = 7; // 0x7
    field public static final int SHAWWAL = 9; // 0x9
  }

  public enum IslamicCalendar.CalculationType {
    enum_constant public static final android.icu.util.IslamicCalendar.CalculationType ISLAMIC;
    enum_constant public static final android.icu.util.IslamicCalendar.CalculationType ISLAMIC_CIVIL;
    enum_constant public static final android.icu.util.IslamicCalendar.CalculationType ISLAMIC_TBLA;
    enum_constant public static final android.icu.util.IslamicCalendar.CalculationType ISLAMIC_UMALQURA;
  }

  public class JapaneseCalendar extends android.icu.util.GregorianCalendar {
    ctor public JapaneseCalendar();
    ctor public JapaneseCalendar(android.icu.util.TimeZone);
    ctor public JapaneseCalendar(java.util.Locale);
    ctor public JapaneseCalendar(android.icu.util.ULocale);
    ctor public JapaneseCalendar(android.icu.util.TimeZone, java.util.Locale);
    ctor public JapaneseCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
    ctor public JapaneseCalendar(java.util.Date);
    ctor public JapaneseCalendar(int, int, int, int);
    ctor public JapaneseCalendar(int, int, int);
    ctor public JapaneseCalendar(int, int, int, int, int, int);
    field @Deprecated public static final int CURRENT_ERA;
    field public static final int HEISEI;
    field public static final int MEIJI;
    field public static final int SHOWA;
    field public static final int TAISHO;
  }

  public final class LocaleData {
    method public static android.icu.util.VersionInfo getCLDRVersion();
    method public String getDelimiter(int);
    method public static android.icu.util.LocaleData getInstance(android.icu.util.ULocale);
    method public static android.icu.util.LocaleData getInstance();
    method public static android.icu.util.LocaleData.MeasurementSystem getMeasurementSystem(android.icu.util.ULocale);
    method public boolean getNoSubstitute();
    method public static android.icu.util.LocaleData.PaperSize getPaperSize(android.icu.util.ULocale);
    method public void setNoSubstitute(boolean);
    field public static final int ALT_QUOTATION_END = 3; // 0x3
    field public static final int ALT_QUOTATION_START = 2; // 0x2
    field public static final int QUOTATION_END = 1; // 0x1
    field public static final int QUOTATION_START = 0; // 0x0
  }

  public static final class LocaleData.MeasurementSystem {
    field public static final android.icu.util.LocaleData.MeasurementSystem SI;
    field public static final android.icu.util.LocaleData.MeasurementSystem UK;
    field public static final android.icu.util.LocaleData.MeasurementSystem US;
  }

  public static final class LocaleData.PaperSize {
    method public int getHeight();
    method public int getWidth();
  }

  public class Measure {
    ctor public Measure(Number, android.icu.util.MeasureUnit);
    method public Number getNumber();
    method public android.icu.util.MeasureUnit getUnit();
  }

  public class MeasureUnit implements java.io.Serializable {
    method public static java.util.Set<android.icu.util.MeasureUnit> getAvailable(String);
    method public static java.util.Set<android.icu.util.MeasureUnit> getAvailable();
    method public static java.util.Set<java.lang.String> getAvailableTypes();
    method public String getSubtype();
    method public String getType();
    field public static final android.icu.util.MeasureUnit ACRE;
    field public static final android.icu.util.MeasureUnit ACRE_FOOT;
    field public static final android.icu.util.MeasureUnit AMPERE;
    field public static final android.icu.util.MeasureUnit ARC_MINUTE;
    field public static final android.icu.util.MeasureUnit ARC_SECOND;
    field public static final android.icu.util.MeasureUnit ASTRONOMICAL_UNIT;
    field public static final android.icu.util.MeasureUnit BIT;
    field public static final android.icu.util.MeasureUnit BUSHEL;
    field public static final android.icu.util.MeasureUnit BYTE;
    field public static final android.icu.util.MeasureUnit CALORIE;
    field public static final android.icu.util.MeasureUnit CARAT;
    field public static final android.icu.util.MeasureUnit CELSIUS;
    field public static final android.icu.util.MeasureUnit CENTILITER;
    field public static final android.icu.util.MeasureUnit CENTIMETER;
    field public static final android.icu.util.MeasureUnit CENTURY;
    field public static final android.icu.util.MeasureUnit CUBIC_CENTIMETER;
    field public static final android.icu.util.MeasureUnit CUBIC_FOOT;
    field public static final android.icu.util.MeasureUnit CUBIC_INCH;
    field public static final android.icu.util.MeasureUnit CUBIC_KILOMETER;
    field public static final android.icu.util.MeasureUnit CUBIC_METER;
    field public static final android.icu.util.MeasureUnit CUBIC_MILE;
    field public static final android.icu.util.MeasureUnit CUBIC_YARD;
    field public static final android.icu.util.MeasureUnit CUP;
    field public static final android.icu.util.MeasureUnit CUP_METRIC;
    field public static final android.icu.util.TimeUnit DAY;
    field public static final android.icu.util.MeasureUnit DECILITER;
    field public static final android.icu.util.MeasureUnit DECIMETER;
    field public static final android.icu.util.MeasureUnit DEGREE;
    field public static final android.icu.util.MeasureUnit FAHRENHEIT;
    field public static final android.icu.util.MeasureUnit FATHOM;
    field public static final android.icu.util.MeasureUnit FLUID_OUNCE;
    field public static final android.icu.util.MeasureUnit FOODCALORIE;
    field public static final android.icu.util.MeasureUnit FOOT;
    field public static final android.icu.util.MeasureUnit FURLONG;
    field public static final android.icu.util.MeasureUnit GALLON;
    field public static final android.icu.util.MeasureUnit GALLON_IMPERIAL;
    field public static final android.icu.util.MeasureUnit GENERIC_TEMPERATURE;
    field public static final android.icu.util.MeasureUnit GIGABIT;
    field public static final android.icu.util.MeasureUnit GIGABYTE;
    field public static final android.icu.util.MeasureUnit GIGAHERTZ;
    field public static final android.icu.util.MeasureUnit GIGAWATT;
    field public static final android.icu.util.MeasureUnit GRAM;
    field public static final android.icu.util.MeasureUnit G_FORCE;
    field public static final android.icu.util.MeasureUnit HECTARE;
    field public static final android.icu.util.MeasureUnit HECTOLITER;
    field public static final android.icu.util.MeasureUnit HECTOPASCAL;
    field public static final android.icu.util.MeasureUnit HERTZ;
    field public static final android.icu.util.MeasureUnit HORSEPOWER;
    field public static final android.icu.util.TimeUnit HOUR;
    field public static final android.icu.util.MeasureUnit INCH;
    field public static final android.icu.util.MeasureUnit INCH_HG;
    field public static final android.icu.util.MeasureUnit JOULE;
    field public static final android.icu.util.MeasureUnit KARAT;
    field public static final android.icu.util.MeasureUnit KELVIN;
    field public static final android.icu.util.MeasureUnit KILOBIT;
    field public static final android.icu.util.MeasureUnit KILOBYTE;
    field public static final android.icu.util.MeasureUnit KILOCALORIE;
    field public static final android.icu.util.MeasureUnit KILOGRAM;
    field public static final android.icu.util.MeasureUnit KILOHERTZ;
    field public static final android.icu.util.MeasureUnit KILOJOULE;
    field public static final android.icu.util.MeasureUnit KILOMETER;
    field public static final android.icu.util.MeasureUnit KILOMETER_PER_HOUR;
    field public static final android.icu.util.MeasureUnit KILOWATT;
    field public static final android.icu.util.MeasureUnit KILOWATT_HOUR;
    field public static final android.icu.util.MeasureUnit KNOT;
    field public static final android.icu.util.MeasureUnit LIGHT_YEAR;
    field public static final android.icu.util.MeasureUnit LITER;
    field public static final android.icu.util.MeasureUnit LITER_PER_100KILOMETERS;
    field public static final android.icu.util.MeasureUnit LITER_PER_KILOMETER;
    field public static final android.icu.util.MeasureUnit LUX;
    field public static final android.icu.util.MeasureUnit MEGABIT;
    field public static final android.icu.util.MeasureUnit MEGABYTE;
    field public static final android.icu.util.MeasureUnit MEGAHERTZ;
    field public static final android.icu.util.MeasureUnit MEGALITER;
    field public static final android.icu.util.MeasureUnit MEGAWATT;
    field public static final android.icu.util.MeasureUnit METER;
    field public static final android.icu.util.MeasureUnit METER_PER_SECOND;
    field public static final android.icu.util.MeasureUnit METER_PER_SECOND_SQUARED;
    field public static final android.icu.util.MeasureUnit METRIC_TON;
    field public static final android.icu.util.MeasureUnit MICROGRAM;
    field public static final android.icu.util.MeasureUnit MICROMETER;
    field public static final android.icu.util.MeasureUnit MICROSECOND;
    field public static final android.icu.util.MeasureUnit MILE;
    field public static final android.icu.util.MeasureUnit MILE_PER_GALLON;
    field public static final android.icu.util.MeasureUnit MILE_PER_GALLON_IMPERIAL;
    field public static final android.icu.util.MeasureUnit MILE_PER_HOUR;
    field public static final android.icu.util.MeasureUnit MILE_SCANDINAVIAN;
    field public static final android.icu.util.MeasureUnit MILLIAMPERE;
    field public static final android.icu.util.MeasureUnit MILLIBAR;
    field public static final android.icu.util.MeasureUnit MILLIGRAM;
    field public static final android.icu.util.MeasureUnit MILLIGRAM_PER_DECILITER;
    field public static final android.icu.util.MeasureUnit MILLILITER;
    field public static final android.icu.util.MeasureUnit MILLIMETER;
    field public static final android.icu.util.MeasureUnit MILLIMETER_OF_MERCURY;
    field public static final android.icu.util.MeasureUnit MILLIMOLE_PER_LITER;
    field public static final android.icu.util.MeasureUnit MILLISECOND;
    field public static final android.icu.util.MeasureUnit MILLIWATT;
    field public static final android.icu.util.TimeUnit MINUTE;
    field public static final android.icu.util.TimeUnit MONTH;
    field public static final android.icu.util.MeasureUnit NANOMETER;
    field public static final android.icu.util.MeasureUnit NANOSECOND;
    field public static final android.icu.util.MeasureUnit NAUTICAL_MILE;
    field public static final android.icu.util.MeasureUnit OHM;
    field public static final android.icu.util.MeasureUnit OUNCE;
    field public static final android.icu.util.MeasureUnit OUNCE_TROY;
    field public static final android.icu.util.MeasureUnit PARSEC;
    field public static final android.icu.util.MeasureUnit PART_PER_MILLION;
    field public static final android.icu.util.MeasureUnit PICOMETER;
    field public static final android.icu.util.MeasureUnit PINT;
    field public static final android.icu.util.MeasureUnit PINT_METRIC;
    field public static final android.icu.util.MeasureUnit POINT;
    field public static final android.icu.util.MeasureUnit POUND;
    field public static final android.icu.util.MeasureUnit POUND_PER_SQUARE_INCH;
    field public static final android.icu.util.MeasureUnit QUART;
    field public static final android.icu.util.MeasureUnit RADIAN;
    field public static final android.icu.util.MeasureUnit REVOLUTION_ANGLE;
    field public static final android.icu.util.TimeUnit SECOND;
    field public static final android.icu.util.MeasureUnit SQUARE_CENTIMETER;
    field public static final android.icu.util.MeasureUnit SQUARE_FOOT;
    field public static final android.icu.util.MeasureUnit SQUARE_INCH;
    field public static final android.icu.util.MeasureUnit SQUARE_KILOMETER;
    field public static final android.icu.util.MeasureUnit SQUARE_METER;
    field public static final android.icu.util.MeasureUnit SQUARE_MILE;
    field public static final android.icu.util.MeasureUnit SQUARE_YARD;
    field public static final android.icu.util.MeasureUnit STONE;
    field public static final android.icu.util.MeasureUnit TABLESPOON;
    field public static final android.icu.util.MeasureUnit TEASPOON;
    field public static final android.icu.util.MeasureUnit TERABIT;
    field public static final android.icu.util.MeasureUnit TERABYTE;
    field public static final android.icu.util.MeasureUnit TON;
    field public static final android.icu.util.MeasureUnit VOLT;
    field public static final android.icu.util.MeasureUnit WATT;
    field public static final android.icu.util.TimeUnit WEEK;
    field public static final android.icu.util.MeasureUnit YARD;
    field public static final android.icu.util.TimeUnit YEAR;
  }

  public class Output<T> {
    ctor public Output();
    ctor public Output(T);
    field public T value;
  }

  public interface RangeValueIterator {
    method public boolean next(android.icu.util.RangeValueIterator.Element);
    method public void reset();
  }

  public static class RangeValueIterator.Element {
    ctor public RangeValueIterator.Element();
    field public int limit;
    field public int start;
    field public int value;
  }

  public class TaiwanCalendar extends android.icu.util.GregorianCalendar {
    ctor public TaiwanCalendar();
    ctor public TaiwanCalendar(android.icu.util.TimeZone);
    ctor public TaiwanCalendar(java.util.Locale);
    ctor public TaiwanCalendar(android.icu.util.ULocale);
    ctor public TaiwanCalendar(android.icu.util.TimeZone, java.util.Locale);
    ctor public TaiwanCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
    ctor public TaiwanCalendar(java.util.Date);
    ctor public TaiwanCalendar(int, int, int);
    ctor public TaiwanCalendar(int, int, int, int, int, int);
    field public static final int BEFORE_MINGUO = 0; // 0x0
    field public static final int MINGUO = 1; // 0x1
  }

  public class TimeUnit extends android.icu.util.MeasureUnit {
    method public static android.icu.util.TimeUnit[] values();
  }

  public abstract class TimeZone implements java.lang.Cloneable android.icu.util.Freezable<android.icu.util.TimeZone> java.io.Serializable {
    ctor public TimeZone();
    method public Object clone();
    method public android.icu.util.TimeZone cloneAsThawed();
    method public static int countEquivalentIDs(String);
    method public android.icu.util.TimeZone freeze();
    method public static java.util.Set<java.lang.String> getAvailableIDs(android.icu.util.TimeZone.SystemTimeZoneType, String, Integer);
    method public static String[] getAvailableIDs(int);
    method public static String[] getAvailableIDs(String);
    method public static String[] getAvailableIDs();
    method public static String getCanonicalID(String);
    method public static String getCanonicalID(String, boolean[]);
    method public int getDSTSavings();
    method public static android.icu.util.TimeZone getDefault();
    method public final String getDisplayName();
    method public final String getDisplayName(java.util.Locale);
    method public final String getDisplayName(android.icu.util.ULocale);
    method public final String getDisplayName(boolean, int);
    method public String getDisplayName(boolean, int, java.util.Locale);
    method public String getDisplayName(boolean, int, android.icu.util.ULocale);
    method public static String getEquivalentID(String, int);
    method public static android.icu.util.TimeZone getFrozenTimeZone(String);
    method public String getID();
    method public static String getIDForWindowsID(String, String);
    method public abstract int getOffset(int, int, int, int, int, int);
    method public int getOffset(long);
    method public void getOffset(long, boolean, int[]);
    method public abstract int getRawOffset();
    method public static String getRegion(String);
    method public static String getTZDataVersion();
    method public static android.icu.util.TimeZone getTimeZone(String);
    method public static android.icu.util.TimeZone getTimeZone(String, int);
    method public static String getWindowsID(String);
    method public boolean hasSameRules(android.icu.util.TimeZone);
    method public abstract boolean inDaylightTime(java.util.Date);
    method public boolean isFrozen();
    method public boolean observesDaylightTime();
    method public void setID(String);
    method public abstract void setRawOffset(int);
    method public abstract boolean useDaylightTime();
    field public static final int GENERIC_LOCATION = 7; // 0x7
    field public static final android.icu.util.TimeZone GMT_ZONE;
    field public static final int LONG = 1; // 0x1
    field public static final int LONG_GENERIC = 3; // 0x3
    field public static final int LONG_GMT = 5; // 0x5
    field public static final int SHORT = 0; // 0x0
    field public static final int SHORT_COMMONLY_USED = 6; // 0x6
    field public static final int SHORT_GENERIC = 2; // 0x2
    field public static final int SHORT_GMT = 4; // 0x4
    field public static final int TIMEZONE_ICU = 0; // 0x0
    field public static final int TIMEZONE_JDK = 1; // 0x1
    field public static final android.icu.util.TimeZone UNKNOWN_ZONE;
    field public static final String UNKNOWN_ZONE_ID = "Etc/Unknown";
  }

  public enum TimeZone.SystemTimeZoneType {
    enum_constant public static final android.icu.util.TimeZone.SystemTimeZoneType ANY;
    enum_constant public static final android.icu.util.TimeZone.SystemTimeZoneType CANONICAL;
    enum_constant public static final android.icu.util.TimeZone.SystemTimeZoneType CANONICAL_LOCATION;
  }

  public final class ULocale implements java.lang.Comparable<android.icu.util.ULocale> java.io.Serializable {
    ctor public ULocale(String);
    ctor public ULocale(String, String);
    ctor public ULocale(String, String, String);
    method public static android.icu.util.ULocale acceptLanguage(String, android.icu.util.ULocale[], boolean[]);
    method public static android.icu.util.ULocale acceptLanguage(android.icu.util.ULocale[], android.icu.util.ULocale[], boolean[]);
    method public static android.icu.util.ULocale acceptLanguage(String, boolean[]);
    method public static android.icu.util.ULocale acceptLanguage(android.icu.util.ULocale[], boolean[]);
    method public static android.icu.util.ULocale addLikelySubtags(android.icu.util.ULocale);
    method public static String canonicalize(String);
    method public Object clone();
    method public int compareTo(android.icu.util.ULocale);
    method public static android.icu.util.ULocale createCanonical(String);
    method public static android.icu.util.ULocale forLanguageTag(String);
    method public static android.icu.util.ULocale forLocale(java.util.Locale);
    method public static android.icu.util.ULocale[] getAvailableLocales();
    method public String getBaseName();
    method public static String getBaseName(String);
    method public String getCharacterOrientation();
    method public String getCountry();
    method public static String getCountry(String);
    method public static android.icu.util.ULocale getDefault();
    method public static android.icu.util.ULocale getDefault(android.icu.util.ULocale.Category);
    method public String getDisplayCountry();
    method public String getDisplayCountry(android.icu.util.ULocale);
    method public static String getDisplayCountry(String, String);
    method public static String getDisplayCountry(String, android.icu.util.ULocale);
    method public static String getDisplayKeyword(String);
    method public static String getDisplayKeyword(String, String);
    method public static String getDisplayKeyword(String, android.icu.util.ULocale);
    method public String getDisplayKeywordValue(String);
    method public String getDisplayKeywordValue(String, android.icu.util.ULocale);
    method public static String getDisplayKeywordValue(String, String, String);
    method public static String getDisplayKeywordValue(String, String, android.icu.util.ULocale);
    method public String getDisplayLanguage();
    method public String getDisplayLanguage(android.icu.util.ULocale);
    method public static String getDisplayLanguage(String, String);
    method public static String getDisplayLanguage(String, android.icu.util.ULocale);
    method public String getDisplayLanguageWithDialect();
    method public String getDisplayLanguageWithDialect(android.icu.util.ULocale);
    method public static String getDisplayLanguageWithDialect(String, String);
    method public static String getDisplayLanguageWithDialect(String, android.icu.util.ULocale);
    method public String getDisplayName();
    method public String getDisplayName(android.icu.util.ULocale);
    method public static String getDisplayName(String, String);
    method public static String getDisplayName(String, android.icu.util.ULocale);
    method public String getDisplayNameWithDialect();
    method public String getDisplayNameWithDialect(android.icu.util.ULocale);
    method public static String getDisplayNameWithDialect(String, String);
    method public static String getDisplayNameWithDialect(String, android.icu.util.ULocale);
    method public String getDisplayScript();
    method public String getDisplayScript(android.icu.util.ULocale);
    method public static String getDisplayScript(String, String);
    method public static String getDisplayScript(String, android.icu.util.ULocale);
    method public String getDisplayVariant();
    method public String getDisplayVariant(android.icu.util.ULocale);
    method public static String getDisplayVariant(String, String);
    method public static String getDisplayVariant(String, android.icu.util.ULocale);
    method public String getExtension(char);
    method public java.util.Set<java.lang.Character> getExtensionKeys();
    method public static String getFallback(String);
    method public android.icu.util.ULocale getFallback();
    method public String getISO3Country();
    method public static String getISO3Country(String);
    method public String getISO3Language();
    method public static String getISO3Language(String);
    method public static String[] getISOCountries();
    method public static String[] getISOLanguages();
    method public String getKeywordValue(String);
    method public static String getKeywordValue(String, String);
    method public java.util.Iterator<java.lang.String> getKeywords();
    method public static java.util.Iterator<java.lang.String> getKeywords(String);
    method public String getLanguage();
    method public static String getLanguage(String);
    method public String getLineOrientation();
    method public String getName();
    method public static String getName(String);
    method public String getScript();
    method public static String getScript(String);
    method public java.util.Set<java.lang.String> getUnicodeLocaleAttributes();
    method public java.util.Set<java.lang.String> getUnicodeLocaleKeys();
    method public String getUnicodeLocaleType(String);
    method public String getVariant();
    method public static String getVariant(String);
    method public boolean isRightToLeft();
    method public static android.icu.util.ULocale minimizeSubtags(android.icu.util.ULocale);
    method public android.icu.util.ULocale setKeywordValue(String, String);
    method public static String setKeywordValue(String, String, String);
    method public String toLanguageTag();
    method public static String toLegacyKey(String);
    method public static String toLegacyType(String, String);
    method public java.util.Locale toLocale();
    method public static String toUnicodeLocaleKey(String);
    method public static String toUnicodeLocaleType(String, String);
    field public static final android.icu.util.ULocale CANADA;
    field public static final android.icu.util.ULocale CANADA_FRENCH;
    field public static final android.icu.util.ULocale CHINA;
    field public static final android.icu.util.ULocale CHINESE;
    field public static final android.icu.util.ULocale ENGLISH;
    field public static final android.icu.util.ULocale FRANCE;
    field public static final android.icu.util.ULocale FRENCH;
    field public static final android.icu.util.ULocale GERMAN;
    field public static final android.icu.util.ULocale GERMANY;
    field public static final android.icu.util.ULocale ITALIAN;
    field public static final android.icu.util.ULocale ITALY;
    field public static final android.icu.util.ULocale JAPAN;
    field public static final android.icu.util.ULocale JAPANESE;
    field public static final android.icu.util.ULocale KOREA;
    field public static final android.icu.util.ULocale KOREAN;
    field public static final android.icu.util.ULocale PRC;
    field public static final char PRIVATE_USE_EXTENSION = 120; // 0x0078 'x'
    field public static final android.icu.util.ULocale ROOT;
    field public static final android.icu.util.ULocale SIMPLIFIED_CHINESE;
    field public static final android.icu.util.ULocale TAIWAN;
    field public static final android.icu.util.ULocale TRADITIONAL_CHINESE;
    field public static final android.icu.util.ULocale UK;
    field public static final char UNICODE_LOCALE_EXTENSION = 117; // 0x0075 'u'
    field public static final android.icu.util.ULocale US;
  }

  public static final class ULocale.Builder {
    ctor public ULocale.Builder();
    method public android.icu.util.ULocale.Builder addUnicodeLocaleAttribute(String);
    method public android.icu.util.ULocale build();
    method public android.icu.util.ULocale.Builder clear();
    method public android.icu.util.ULocale.Builder clearExtensions();
    method public android.icu.util.ULocale.Builder removeUnicodeLocaleAttribute(String);
    method public android.icu.util.ULocale.Builder setExtension(char, String);
    method public android.icu.util.ULocale.Builder setLanguage(String);
    method public android.icu.util.ULocale.Builder setLanguageTag(String);
    method public android.icu.util.ULocale.Builder setLocale(android.icu.util.ULocale);
    method public android.icu.util.ULocale.Builder setRegion(String);
    method public android.icu.util.ULocale.Builder setScript(String);
    method public android.icu.util.ULocale.Builder setUnicodeLocaleKeyword(String, String);
    method public android.icu.util.ULocale.Builder setVariant(String);
  }

  public enum ULocale.Category {
    enum_constant public static final android.icu.util.ULocale.Category DISPLAY;
    enum_constant public static final android.icu.util.ULocale.Category FORMAT;
  }

  public final class UniversalTimeScale {
    method public static android.icu.math.BigDecimal bigDecimalFrom(double, int);
    method public static android.icu.math.BigDecimal bigDecimalFrom(long, int);
    method public static android.icu.math.BigDecimal bigDecimalFrom(android.icu.math.BigDecimal, int);
    method public static long from(long, int);
    method public static long getTimeScaleValue(int, int);
    method public static android.icu.math.BigDecimal toBigDecimal(long, int);
    method public static android.icu.math.BigDecimal toBigDecimal(android.icu.math.BigDecimal, int);
    method public static long toLong(long, int);
    field public static final int DB2_TIME = 8; // 0x8
    field public static final int DOTNET_DATE_TIME = 4; // 0x4
    field public static final int EPOCH_OFFSET_PLUS_1_VALUE = 6; // 0x6
    field public static final int EPOCH_OFFSET_VALUE = 1; // 0x1
    field public static final int EXCEL_TIME = 7; // 0x7
    field public static final int FROM_MAX_VALUE = 3; // 0x3
    field public static final int FROM_MIN_VALUE = 2; // 0x2
    field public static final int ICU4C_TIME = 2; // 0x2
    field public static final int JAVA_TIME = 0; // 0x0
    field public static final int MAC_OLD_TIME = 5; // 0x5
    field public static final int MAC_TIME = 6; // 0x6
    field @Deprecated public static final int MAX_SCALE = 10; // 0xa
    field public static final int TO_MAX_VALUE = 5; // 0x5
    field public static final int TO_MIN_VALUE = 4; // 0x4
    field public static final int UNITS_VALUE = 0; // 0x0
    field public static final int UNIX_MICROSECONDS_TIME = 9; // 0x9
    field public static final int UNIX_TIME = 1; // 0x1
    field public static final int WINDOWS_FILE_TIME = 3; // 0x3
  }

  public interface ValueIterator {
    method public boolean next(android.icu.util.ValueIterator.Element);
    method public void reset();
    method public void setRange(int, int);
  }

  public static final class ValueIterator.Element {
    ctor public ValueIterator.Element();
    field public int integer;
    field public Object value;
  }

  public final class VersionInfo implements java.lang.Comparable<android.icu.util.VersionInfo> {
    method public int compareTo(android.icu.util.VersionInfo);
    method public static android.icu.util.VersionInfo getInstance(String);
    method public static android.icu.util.VersionInfo getInstance(int, int, int, int);
    method public static android.icu.util.VersionInfo getInstance(int, int, int);
    method public static android.icu.util.VersionInfo getInstance(int, int);
    method public static android.icu.util.VersionInfo getInstance(int);
    method public int getMajor();
    method public int getMicro();
    method public int getMilli();
    method public int getMinor();
    field public static final android.icu.util.VersionInfo ICU_VERSION;
    field public static final android.icu.util.VersionInfo UCOL_BUILDER_VERSION;
    field public static final android.icu.util.VersionInfo UCOL_RUNTIME_VERSION;
    field public static final android.icu.util.VersionInfo UNICODE_10_0;
    field public static final android.icu.util.VersionInfo UNICODE_11_0;
    field public static final android.icu.util.VersionInfo UNICODE_1_0;
    field public static final android.icu.util.VersionInfo UNICODE_1_0_1;
    field public static final android.icu.util.VersionInfo UNICODE_1_1_0;
    field public static final android.icu.util.VersionInfo UNICODE_1_1_5;
    field public static final android.icu.util.VersionInfo UNICODE_2_0;
    field public static final android.icu.util.VersionInfo UNICODE_2_1_2;
    field public static final android.icu.util.VersionInfo UNICODE_2_1_5;
    field public static final android.icu.util.VersionInfo UNICODE_2_1_8;
    field public static final android.icu.util.VersionInfo UNICODE_2_1_9;
    field public static final android.icu.util.VersionInfo UNICODE_3_0;
    field public static final android.icu.util.VersionInfo UNICODE_3_0_1;
    field public static final android.icu.util.VersionInfo UNICODE_3_1_0;
    field public static final android.icu.util.VersionInfo UNICODE_3_1_1;
    field public static final android.icu.util.VersionInfo UNICODE_3_2;
    field public static final android.icu.util.VersionInfo UNICODE_4_0;
    field public static final android.icu.util.VersionInfo UNICODE_4_0_1;
    field public static final android.icu.util.VersionInfo UNICODE_4_1;
    field public static final android.icu.util.VersionInfo UNICODE_5_0;
    field public static final android.icu.util.VersionInfo UNICODE_5_1;
    field public static final android.icu.util.VersionInfo UNICODE_5_2;
    field public static final android.icu.util.VersionInfo UNICODE_6_0;
    field public static final android.icu.util.VersionInfo UNICODE_6_1;
    field public static final android.icu.util.VersionInfo UNICODE_6_2;
    field public static final android.icu.util.VersionInfo UNICODE_6_3;
    field public static final android.icu.util.VersionInfo UNICODE_7_0;
    field public static final android.icu.util.VersionInfo UNICODE_8_0;
    field public static final android.icu.util.VersionInfo UNICODE_9_0;
  }

}

package android.inputmethodservice {

  public abstract class AbstractInputMethodService extends android.app.Service implements android.view.KeyEvent.Callback {
    ctor public AbstractInputMethodService();
    method public android.view.KeyEvent.DispatcherState getKeyDispatcherState();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl onCreateInputMethodInterface();
    method public abstract android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodSessionImpl onCreateInputMethodSessionInterface();
    method public boolean onGenericMotionEvent(android.view.MotionEvent);
    method public boolean onTrackballEvent(android.view.MotionEvent);
  }

  public abstract class AbstractInputMethodService.AbstractInputMethodImpl implements android.view.inputmethod.InputMethod {
    ctor public AbstractInputMethodService.AbstractInputMethodImpl();
    method @MainThread public void createSession(android.view.inputmethod.InputMethod.SessionCallback);
    method @MainThread public void revokeSession(android.view.inputmethod.InputMethodSession);
    method @MainThread public void setSessionEnabled(android.view.inputmethod.InputMethodSession, boolean);
  }

  public abstract class AbstractInputMethodService.AbstractInputMethodSessionImpl implements android.view.inputmethod.InputMethodSession {
    ctor public AbstractInputMethodService.AbstractInputMethodSessionImpl();
    method public void dispatchGenericMotionEvent(int, android.view.MotionEvent, android.view.inputmethod.InputMethodSession.EventCallback);
    method public void dispatchKeyEvent(int, android.view.KeyEvent, android.view.inputmethod.InputMethodSession.EventCallback);
    method public void dispatchTrackballEvent(int, android.view.MotionEvent, android.view.inputmethod.InputMethodSession.EventCallback);
    method public boolean isEnabled();
    method public boolean isRevoked();
    method public void revokeSelf();
    method public void setEnabled(boolean);
  }

  public class ExtractEditText extends android.widget.EditText {
    ctor public ExtractEditText(android.content.Context);
    ctor public ExtractEditText(android.content.Context, android.util.AttributeSet);
    ctor public ExtractEditText(android.content.Context, android.util.AttributeSet, int);
    ctor public ExtractEditText(android.content.Context, android.util.AttributeSet, int, int);
    method public void finishInternalChanges();
    method public boolean hasVerticalScrollBar();
    method public void startInternalChanges();
  }

  public class InputMethodService extends android.inputmethodservice.AbstractInputMethodService {
    ctor public InputMethodService();
    method @Deprecated public boolean enableHardwareAcceleration();
    method public int getBackDisposition();
    method public int getCandidatesHiddenVisibility();
    method public android.view.inputmethod.InputBinding getCurrentInputBinding();
    method public android.view.inputmethod.InputConnection getCurrentInputConnection();
    method public android.view.inputmethod.EditorInfo getCurrentInputEditorInfo();
    method public boolean getCurrentInputStarted();
    method public int getInputMethodWindowRecommendedHeight();
    method public android.view.LayoutInflater getLayoutInflater();
    method public int getMaxWidth();
    method public CharSequence getTextForImeAction(int);
    method public android.app.Dialog getWindow();
    method public void hideStatusIcon();
    method public void hideWindow();
    method public boolean isExtractViewShown();
    method public boolean isFullscreenMode();
    method public boolean isInputViewShown();
    method public boolean isShowInputRequested();
    method public void onAppPrivateCommand(String, android.os.Bundle);
    method public void onBindInput();
    method public void onComputeInsets(android.inputmethodservice.InputMethodService.Insets);
    method public void onConfigureWindow(android.view.Window, boolean, boolean);
    method public android.view.View onCreateCandidatesView();
    method public android.view.View onCreateExtractTextView();
    method public android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl onCreateInputMethodInterface();
    method public android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodSessionImpl onCreateInputMethodSessionInterface();
    method public android.view.View onCreateInputView();
    method protected void onCurrentInputMethodSubtypeChanged(android.view.inputmethod.InputMethodSubtype);
    method public void onDisplayCompletions(android.view.inputmethod.CompletionInfo[]);
    method public boolean onEvaluateFullscreenMode();
    method @CallSuper public boolean onEvaluateInputViewShown();
    method public boolean onExtractTextContextMenuItem(int);
    method public void onExtractedCursorMovement(int, int);
    method public void onExtractedSelectionChanged(int, int);
    method public void onExtractedTextClicked();
    method public void onExtractingInputChanged(android.view.inputmethod.EditorInfo);
    method public void onFinishCandidatesView(boolean);
    method public void onFinishInput();
    method public void onFinishInputView(boolean);
    method public void onInitializeInterface();
    method public boolean onKeyDown(int, android.view.KeyEvent);
    method public boolean onKeyLongPress(int, android.view.KeyEvent);
    method public boolean onKeyMultiple(int, int, android.view.KeyEvent);
    method public boolean onKeyUp(int, android.view.KeyEvent);
    method public boolean onShowInputRequested(int, boolean);
    method public void onStartCandidatesView(android.view.inputmethod.EditorInfo, boolean);
    method public void onStartInput(android.view.inputmethod.EditorInfo, boolean);
    method public void onStartInputView(android.view.inputmethod.EditorInfo, boolean);
    method public void onUnbindInput();
    method @Deprecated public void onUpdateCursor(android.graphics.Rect);
    method public void onUpdateCursorAnchorInfo(android.view.inputmethod.CursorAnchorInfo);
    method public void onUpdateExtractedText(int, android.view.inputmethod.ExtractedText);
    method public void onUpdateExtractingViews(android.view.inputmethod.EditorInfo);
    method public void onUpdateExtractingVisibility(android.view.inputmethod.EditorInfo);
    method public void onUpdateSelection(int, int, int, int, int, int);
    method public void onViewClicked(boolean);
    method public void onWindowHidden();
    method public void onWindowShown();
    method public void requestHideSelf(int);
    method public final void requestShowSelf(int);
    method public boolean sendDefaultEditorAction(boolean);
    method public void sendDownUpKeyEvents(int);
    method public void sendKeyChar(char);
    method public void setBackDisposition(int);
    method public void setCandidatesView(android.view.View);
    method public void setCandidatesViewShown(boolean);
    method public void setExtractView(android.view.View);
    method public void setExtractViewShown(boolean);
    method public void setInputView(android.view.View);
    method public final boolean shouldOfferSwitchingToNextInputMethod();
    method public void showStatusIcon(@DrawableRes int);
    method public void showWindow(boolean);
    method public void switchInputMethod(String);
    method public final void switchInputMethod(String, android.view.inputmethod.InputMethodSubtype);
    method public final boolean switchToNextInputMethod(boolean);
    method public final boolean switchToPreviousInputMethod();
    method public void updateFullscreenMode();
    method public void updateInputViewShown();
    field public static final int BACK_DISPOSITION_ADJUST_NOTHING = 3; // 0x3
    field public static final int BACK_DISPOSITION_DEFAULT = 0; // 0x0
    field @Deprecated public static final int BACK_DISPOSITION_WILL_DISMISS = 2; // 0x2
    field @Deprecated public static final int BACK_DISPOSITION_WILL_NOT_DISMISS = 1; // 0x1
  }

  public class InputMethodService.InputMethodImpl extends android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl {
    ctor public InputMethodService.InputMethodImpl();
    method @MainThread public void attachToken(android.os.IBinder);
    method @MainThread public void bindInput(android.view.inputmethod.InputBinding);
    method @MainThread public void changeInputMethodSubtype(android.view.inputmethod.InputMethodSubtype);
    method @MainThread public void hideSoftInput(int, android.os.ResultReceiver);
    method @MainThread public void restartInput(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo);
    method @MainThread public void showSoftInput(int, android.os.ResultReceiver);
    method @MainThread public void startInput(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo);
    method @MainThread public void unbindInput();
  }

  public class InputMethodService.InputMethodSessionImpl extends android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodSessionImpl {
    ctor public InputMethodService.InputMethodSessionImpl();
    method public void appPrivateCommand(String, android.os.Bundle);
    method public void displayCompletions(android.view.inputmethod.CompletionInfo[]);
    method public void finishInput();
    method public void toggleSoftInput(int, int);
    method public void updateCursor(android.graphics.Rect);
    method public void updateCursorAnchorInfo(android.view.inputmethod.CursorAnchorInfo);
    method public void updateExtractedText(int, android.view.inputmethod.ExtractedText);
    method public void updateSelection(int, int, int, int, int, int);
    method public void viewClicked(boolean);
  }

  public static final class InputMethodService.Insets {
    ctor public InputMethodService.Insets();
    field public static final int TOUCHABLE_INSETS_CONTENT = 1; // 0x1
    field public static final int TOUCHABLE_INSETS_FRAME = 0; // 0x0
    field public static final int TOUCHABLE_INSETS_REGION = 3; // 0x3
    field public static final int TOUCHABLE_INSETS_VISIBLE = 2; // 0x2
    field public int contentTopInsets;
    field public int touchableInsets;
    field public final android.graphics.Region touchableRegion;
    field public int visibleTopInsets;
  }

  public class Keyboard {
    ctor public Keyboard(android.content.Context, int);
    ctor public Keyboard(android.content.Context, @XmlRes int, int, int, int);
    ctor public Keyboard(android.content.Context, @XmlRes int, int);
    ctor public Keyboard(android.content.Context, int, CharSequence, int, int);
    method protected android.inputmethodservice.Keyboard.Key createKeyFromXml(android.content.res.Resources, android.inputmethodservice.Keyboard.Row, int, int, android.content.res.XmlResourceParser);
    method protected android.inputmethodservice.Keyboard.Row createRowFromXml(android.content.res.Resources, android.content.res.XmlResourceParser);
    method public int getHeight();
    method protected int getHorizontalGap();
    method protected int getKeyHeight();
    method protected int getKeyWidth();
    method public java.util.List<android.inputmethodservice.Keyboard.Key> getKeys();
    method public int getMinWidth();
    method public java.util.List<android.inputmethodservice.Keyboard.Key> getModifierKeys();
    method public int[] getNearestKeys(int, int);
    method public int getShiftKeyIndex();
    method protected int getVerticalGap();
    method public boolean isShifted();
    method protected void setHorizontalGap(int);
    method protected void setKeyHeight(int);
    method protected void setKeyWidth(int);
    method public boolean setShifted(boolean);
    method protected void setVerticalGap(int);
    field public static final int EDGE_BOTTOM = 8; // 0x8
    field public static final int EDGE_LEFT = 1; // 0x1
    field public static final int EDGE_RIGHT = 2; // 0x2
    field public static final int EDGE_TOP = 4; // 0x4
    field public static final int KEYCODE_ALT = -6; // 0xfffffffa
    field public static final int KEYCODE_CANCEL = -3; // 0xfffffffd
    field public static final int KEYCODE_DELETE = -5; // 0xfffffffb
    field public static final int KEYCODE_DONE = -4; // 0xfffffffc
    field public static final int KEYCODE_MODE_CHANGE = -2; // 0xfffffffe
    field public static final int KEYCODE_SHIFT = -1; // 0xffffffff
  }

  public static class Keyboard.Key {
    ctor public Keyboard.Key(android.inputmethodservice.Keyboard.Row);
    ctor public Keyboard.Key(android.content.res.Resources, android.inputmethodservice.Keyboard.Row, int, int, android.content.res.XmlResourceParser);
    method public int[] getCurrentDrawableState();
    method public boolean isInside(int, int);
    method public void onPressed();
    method public void onReleased(boolean);
    method public int squaredDistanceFrom(int, int);
    field public int[] codes;
    field public int edgeFlags;
    field public int gap;
    field public int height;
    field public android.graphics.drawable.Drawable icon;
    field public android.graphics.drawable.Drawable iconPreview;
    field public CharSequence label;
    field public boolean modifier;
    field public boolean on;
    field public CharSequence popupCharacters;
    field public int popupResId;
    field public boolean pressed;
    field public boolean repeatable;
    field public boolean sticky;
    field public CharSequence text;
    field public int width;
    field public int x;
    field public int y;
  }

  public static class Keyboard.Row {
    ctor public Keyboard.Row(android.inputmethodservice.Keyboard);
    ctor public Keyboard.Row(android.content.res.Resources, android.inputmethodservice.Keyboard, android.content.res.XmlResourceParser);
    field public int defaultHeight;
    field public int defaultHorizontalGap;
    field public int defaultWidth;
    field public int mode;
    field public int rowEdgeFlags;
    field public int verticalGap;
  }

  public class KeyboardView extends android.view.View implements android.view.View.OnClickListener {
    ctor public KeyboardView(android.content.Context, android.util.AttributeSet);
    ctor public KeyboardView(android.content.Context, android.util.AttributeSet, int);
    ctor public KeyboardView(android.content.Context, android.util.AttributeSet, int, int);
    method public void closing();
    method public android.inputmethodservice.Keyboard getKeyboard();
    method protected android.inputmethodservice.KeyboardView.OnKeyboardActionListener getOnKeyboardActionListener();
    method public boolean handleBack();
    method public void invalidateAllKeys();
    method public void invalidateKey(int);
    method public boolean isPreviewEnabled();
    method public boolean isProximityCorrectionEnabled();
    method public boolean isShifted();
    method public void onClick(android.view.View);
    method public void onDetachedFromWindow();
    method public void onDraw(android.graphics.Canvas);
    method protected boolean onLongPress(android.inputmethodservice.Keyboard.Key);
    method public void onMeasure(int, int);
    method public void onSizeChanged(int, int, int, int);
    method public void setKeyboard(android.inputmethodservice.Keyboard);
    method public void setOnKeyboardActionListener(android.inputmethodservice.KeyboardView.OnKeyboardActionListener);
    method public void setPopupOffset(int, int);
    method public void setPopupParent(android.view.View);
    method public void setPreviewEnabled(boolean);
    method public void setProximityCorrectionEnabled(boolean);
    method public boolean setShifted(boolean);
    method public void setVerticalCorrection(int);
    method protected void swipeDown();
    method protected void swipeLeft();
    method protected void swipeRight();
    method protected void swipeUp();
  }

  public static interface KeyboardView.OnKeyboardActionListener {
    method public void onKey(int, int[]);
    method public void onPress(int);
    method public void onRelease(int);
    method public void onText(CharSequence);
    method public void swipeDown();
    method public void swipeLeft();
    method public void swipeRight();
    method public void swipeUp();
  }

}

package android.location {

  public class Address implements android.os.Parcelable {
    ctor public Address(java.util.Locale);
    method public void clearLatitude();
    method public void clearLongitude();
    method public int describeContents();
    method public String getAddressLine(int);
    method public String getAdminArea();
    method public String getCountryCode();
    method public String getCountryName();
    method public android.os.Bundle getExtras();
    method public String getFeatureName();
    method public double getLatitude();
    method public java.util.Locale getLocale();
    method public String getLocality();
    method public double getLongitude();
    method public int getMaxAddressLineIndex();
    method public String getPhone();
    method public String getPostalCode();
    method public String getPremises();
    method public String getSubAdminArea();
    method public String getSubLocality();
    method public String getSubThoroughfare();
    method public String getThoroughfare();
    method public String getUrl();
    method public boolean hasLatitude();
    method public boolean hasLongitude();
    method public void setAddressLine(int, String);
    method public void setAdminArea(String);
    method public void setCountryCode(String);
    method public void setCountryName(String);
    method public void setExtras(android.os.Bundle);
    method public void setFeatureName(String);
    method public void setLatitude(double);
    method public void setLocality(String);
    method public void setLongitude(double);
    method public void setPhone(String);
    method public void setPostalCode(String);
    method public void setPremises(String);
    method public void setSubAdminArea(String);
    method public void setSubLocality(String);
    method public void setSubThoroughfare(String);
    method public void setThoroughfare(String);
    method public void setUrl(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.Address> CREATOR;
  }

  public class Criteria implements android.os.Parcelable {
    ctor public Criteria();
    ctor public Criteria(android.location.Criteria);
    method public int describeContents();
    method public int getAccuracy();
    method public int getBearingAccuracy();
    method public int getHorizontalAccuracy();
    method public int getPowerRequirement();
    method public int getSpeedAccuracy();
    method public int getVerticalAccuracy();
    method public boolean isAltitudeRequired();
    method public boolean isBearingRequired();
    method public boolean isCostAllowed();
    method public boolean isSpeedRequired();
    method public void setAccuracy(int);
    method public void setAltitudeRequired(boolean);
    method public void setBearingAccuracy(int);
    method public void setBearingRequired(boolean);
    method public void setCostAllowed(boolean);
    method public void setHorizontalAccuracy(int);
    method public void setPowerRequirement(int);
    method public void setSpeedAccuracy(int);
    method public void setSpeedRequired(boolean);
    method public void setVerticalAccuracy(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ACCURACY_COARSE = 2; // 0x2
    field public static final int ACCURACY_FINE = 1; // 0x1
    field public static final int ACCURACY_HIGH = 3; // 0x3
    field public static final int ACCURACY_LOW = 1; // 0x1
    field public static final int ACCURACY_MEDIUM = 2; // 0x2
    field public static final android.os.Parcelable.Creator<android.location.Criteria> CREATOR;
    field public static final int NO_REQUIREMENT = 0; // 0x0
    field public static final int POWER_HIGH = 3; // 0x3
    field public static final int POWER_LOW = 1; // 0x1
    field public static final int POWER_MEDIUM = 2; // 0x2
  }

  public final class Geocoder {
    ctor public Geocoder(android.content.Context, java.util.Locale);
    ctor public Geocoder(android.content.Context);
    method public java.util.List<android.location.Address> getFromLocation(double, double, int) throws java.io.IOException;
    method public java.util.List<android.location.Address> getFromLocationName(String, int) throws java.io.IOException;
    method public java.util.List<android.location.Address> getFromLocationName(String, int, double, double, double, double) throws java.io.IOException;
    method public static boolean isPresent();
  }

  public final class GnssClock implements android.os.Parcelable {
    method public int describeContents();
    method public double getBiasNanos();
    method public double getBiasUncertaintyNanos();
    method public double getDriftNanosPerSecond();
    method public double getDriftUncertaintyNanosPerSecond();
    method public long getFullBiasNanos();
    method public int getHardwareClockDiscontinuityCount();
    method public int getLeapSecond();
    method public long getTimeNanos();
    method public double getTimeUncertaintyNanos();
    method public boolean hasBiasNanos();
    method public boolean hasBiasUncertaintyNanos();
    method public boolean hasDriftNanosPerSecond();
    method public boolean hasDriftUncertaintyNanosPerSecond();
    method public boolean hasFullBiasNanos();
    method public boolean hasLeapSecond();
    method public boolean hasTimeUncertaintyNanos();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GnssClock> CREATOR;
  }

  public final class GnssMeasurement implements android.os.Parcelable {
    method public int describeContents();
    method public double getAccumulatedDeltaRangeMeters();
    method public int getAccumulatedDeltaRangeState();
    method public double getAccumulatedDeltaRangeUncertaintyMeters();
    method public double getAutomaticGainControlLevelDb();
    method @Deprecated public long getCarrierCycles();
    method public float getCarrierFrequencyHz();
    method @Deprecated public double getCarrierPhase();
    method @Deprecated public double getCarrierPhaseUncertainty();
    method public double getCn0DbHz();
    method public int getConstellationType();
    method public int getMultipathIndicator();
    method public double getPseudorangeRateMetersPerSecond();
    method public double getPseudorangeRateUncertaintyMetersPerSecond();
    method public long getReceivedSvTimeNanos();
    method public long getReceivedSvTimeUncertaintyNanos();
    method public double getSnrInDb();
    method public int getState();
    method public int getSvid();
    method public double getTimeOffsetNanos();
    method public boolean hasAutomaticGainControlLevelDb();
    method @Deprecated public boolean hasCarrierCycles();
    method public boolean hasCarrierFrequencyHz();
    method @Deprecated public boolean hasCarrierPhase();
    method @Deprecated public boolean hasCarrierPhaseUncertainty();
    method public boolean hasSnrInDb();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ADR_STATE_CYCLE_SLIP = 4; // 0x4
    field public static final int ADR_STATE_HALF_CYCLE_REPORTED = 16; // 0x10
    field public static final int ADR_STATE_HALF_CYCLE_RESOLVED = 8; // 0x8
    field public static final int ADR_STATE_RESET = 2; // 0x2
    field public static final int ADR_STATE_UNKNOWN = 0; // 0x0
    field public static final int ADR_STATE_VALID = 1; // 0x1
    field public static final android.os.Parcelable.Creator<android.location.GnssMeasurement> CREATOR;
    field public static final int MULTIPATH_INDICATOR_DETECTED = 1; // 0x1
    field public static final int MULTIPATH_INDICATOR_NOT_DETECTED = 2; // 0x2
    field public static final int MULTIPATH_INDICATOR_UNKNOWN = 0; // 0x0
    field public static final int STATE_BDS_D2_BIT_SYNC = 256; // 0x100
    field public static final int STATE_BDS_D2_SUBFRAME_SYNC = 512; // 0x200
    field public static final int STATE_BIT_SYNC = 2; // 0x2
    field public static final int STATE_CODE_LOCK = 1; // 0x1
    field public static final int STATE_GAL_E1BC_CODE_LOCK = 1024; // 0x400
    field public static final int STATE_GAL_E1B_PAGE_SYNC = 4096; // 0x1000
    field public static final int STATE_GAL_E1C_2ND_CODE_LOCK = 2048; // 0x800
    field public static final int STATE_GLO_STRING_SYNC = 64; // 0x40
    field public static final int STATE_GLO_TOD_DECODED = 128; // 0x80
    field public static final int STATE_GLO_TOD_KNOWN = 32768; // 0x8000
    field public static final int STATE_MSEC_AMBIGUOUS = 16; // 0x10
    field public static final int STATE_SBAS_SYNC = 8192; // 0x2000
    field public static final int STATE_SUBFRAME_SYNC = 4; // 0x4
    field public static final int STATE_SYMBOL_SYNC = 32; // 0x20
    field public static final int STATE_TOW_DECODED = 8; // 0x8
    field public static final int STATE_TOW_KNOWN = 16384; // 0x4000
    field public static final int STATE_UNKNOWN = 0; // 0x0
  }

  public final class GnssMeasurementsEvent implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.location.GnssClock getClock();
    method @NonNull public java.util.Collection<android.location.GnssMeasurement> getMeasurements();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GnssMeasurementsEvent> CREATOR;
  }

  public abstract static class GnssMeasurementsEvent.Callback {
    ctor public GnssMeasurementsEvent.Callback();
    method public void onGnssMeasurementsReceived(android.location.GnssMeasurementsEvent);
    method public void onStatusChanged(int);
    field public static final int STATUS_LOCATION_DISABLED = 2; // 0x2
    field public static final int STATUS_NOT_ALLOWED = 3; // 0x3
    field public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
    field public static final int STATUS_READY = 1; // 0x1
  }

  public final class GnssNavigationMessage implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public byte[] getData();
    method public int getMessageId();
    method public int getStatus();
    method public int getSubmessageId();
    method public int getSvid();
    method public int getType();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GnssNavigationMessage> CREATOR;
    field public static final int STATUS_PARITY_PASSED = 1; // 0x1
    field public static final int STATUS_PARITY_REBUILT = 2; // 0x2
    field public static final int STATUS_UNKNOWN = 0; // 0x0
    field public static final int TYPE_BDS_D1 = 1281; // 0x501
    field public static final int TYPE_BDS_D2 = 1282; // 0x502
    field public static final int TYPE_GAL_F = 1538; // 0x602
    field public static final int TYPE_GAL_I = 1537; // 0x601
    field public static final int TYPE_GLO_L1CA = 769; // 0x301
    field public static final int TYPE_GPS_CNAV2 = 260; // 0x104
    field public static final int TYPE_GPS_L1CA = 257; // 0x101
    field public static final int TYPE_GPS_L2CNAV = 258; // 0x102
    field public static final int TYPE_GPS_L5CNAV = 259; // 0x103
    field public static final int TYPE_UNKNOWN = 0; // 0x0
  }

  public abstract static class GnssNavigationMessage.Callback {
    ctor public GnssNavigationMessage.Callback();
    method public void onGnssNavigationMessageReceived(android.location.GnssNavigationMessage);
    method public void onStatusChanged(int);
    field public static final int STATUS_LOCATION_DISABLED = 2; // 0x2
    field public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
    field public static final int STATUS_READY = 1; // 0x1
  }

  public final class GnssStatus {
    method public float getAzimuthDegrees(int);
    method public float getCarrierFrequencyHz(int);
    method public float getCn0DbHz(int);
    method public int getConstellationType(int);
    method public float getElevationDegrees(int);
    method public int getSatelliteCount();
    method public int getSvid(int);
    method public boolean hasAlmanacData(int);
    method public boolean hasCarrierFrequencyHz(int);
    method public boolean hasEphemerisData(int);
    method public boolean usedInFix(int);
    field public static final int CONSTELLATION_BEIDOU = 5; // 0x5
    field public static final int CONSTELLATION_GALILEO = 6; // 0x6
    field public static final int CONSTELLATION_GLONASS = 3; // 0x3
    field public static final int CONSTELLATION_GPS = 1; // 0x1
    field public static final int CONSTELLATION_QZSS = 4; // 0x4
    field public static final int CONSTELLATION_SBAS = 2; // 0x2
    field public static final int CONSTELLATION_UNKNOWN = 0; // 0x0
  }

  public abstract static class GnssStatus.Callback {
    ctor public GnssStatus.Callback();
    method public void onFirstFix(int);
    method public void onSatelliteStatusChanged(android.location.GnssStatus);
    method public void onStarted();
    method public void onStopped();
  }

  @Deprecated public final class GpsSatellite {
    method @Deprecated public float getAzimuth();
    method @Deprecated public float getElevation();
    method @Deprecated public int getPrn();
    method @Deprecated public float getSnr();
    method @Deprecated public boolean hasAlmanac();
    method @Deprecated public boolean hasEphemeris();
    method @Deprecated public boolean usedInFix();
  }

  @Deprecated public final class GpsStatus {
    method @Deprecated public int getMaxSatellites();
    method @Deprecated public Iterable<android.location.GpsSatellite> getSatellites();
    method @Deprecated public int getTimeToFirstFix();
    field @Deprecated public static final int GPS_EVENT_FIRST_FIX = 3; // 0x3
    field @Deprecated public static final int GPS_EVENT_SATELLITE_STATUS = 4; // 0x4
    field @Deprecated public static final int GPS_EVENT_STARTED = 1; // 0x1
    field @Deprecated public static final int GPS_EVENT_STOPPED = 2; // 0x2
  }

  @Deprecated public static interface GpsStatus.Listener {
    method @Deprecated public void onGpsStatusChanged(int);
  }

  @Deprecated public static interface GpsStatus.NmeaListener {
    method @Deprecated public void onNmeaReceived(long, String);
  }

  public class Location implements android.os.Parcelable {
    ctor public Location(String);
    ctor public Location(android.location.Location);
    method public float bearingTo(android.location.Location);
    method public static String convert(double, int);
    method public static double convert(String);
    method public int describeContents();
    method public static void distanceBetween(double, double, double, double, float[]);
    method public float distanceTo(android.location.Location);
    method public void dump(android.util.Printer, String);
    method public float getAccuracy();
    method public double getAltitude();
    method public float getBearing();
    method public float getBearingAccuracyDegrees();
    method public long getElapsedRealtimeNanos();
    method public android.os.Bundle getExtras();
    method public double getLatitude();
    method public double getLongitude();
    method public String getProvider();
    method public float getSpeed();
    method public float getSpeedAccuracyMetersPerSecond();
    method public long getTime();
    method public float getVerticalAccuracyMeters();
    method public boolean hasAccuracy();
    method public boolean hasAltitude();
    method public boolean hasBearing();
    method public boolean hasBearingAccuracy();
    method public boolean hasSpeed();
    method public boolean hasSpeedAccuracy();
    method public boolean hasVerticalAccuracy();
    method public boolean isFromMockProvider();
    method @Deprecated public void removeAccuracy();
    method @Deprecated public void removeAltitude();
    method @Deprecated public void removeBearing();
    method @Deprecated public void removeSpeed();
    method public void reset();
    method public void set(android.location.Location);
    method public void setAccuracy(float);
    method public void setAltitude(double);
    method public void setBearing(float);
    method public void setBearingAccuracyDegrees(float);
    method public void setElapsedRealtimeNanos(long);
    method public void setExtras(android.os.Bundle);
    method public void setLatitude(double);
    method public void setLongitude(double);
    method public void setProvider(String);
    method public void setSpeed(float);
    method public void setSpeedAccuracyMetersPerSecond(float);
    method public void setTime(long);
    method public void setVerticalAccuracyMeters(float);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.Location> CREATOR;
    field public static final int FORMAT_DEGREES = 0; // 0x0
    field public static final int FORMAT_MINUTES = 1; // 0x1
    field public static final int FORMAT_SECONDS = 2; // 0x2
  }

  public interface LocationListener {
    method public void onLocationChanged(android.location.Location);
    method public void onProviderDisabled(String);
    method public void onProviderEnabled(String);
    method public void onStatusChanged(String, int, android.os.Bundle);
  }

  public class LocationManager {
    method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addGpsStatusListener(android.location.GpsStatus.Listener);
    method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(android.location.GpsStatus.NmeaListener);
    method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(android.location.OnNmeaMessageListener);
    method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(android.location.OnNmeaMessageListener, android.os.Handler);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void addProximityAlert(double, double, float, long, android.app.PendingIntent);
    method public void addTestProvider(String, boolean, boolean, boolean, boolean, boolean, boolean, boolean, int, int);
    method public void clearTestProviderEnabled(String);
    method public void clearTestProviderLocation(String);
    method public void clearTestProviderStatus(String);
    method public java.util.List<java.lang.String> getAllProviders();
    method public String getBestProvider(android.location.Criteria, boolean);
    method @Nullable public String getGnssHardwareModelName();
    method public int getGnssYearOfHardware();
    method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public android.location.GpsStatus getGpsStatus(android.location.GpsStatus);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public android.location.Location getLastKnownLocation(String);
    method public android.location.LocationProvider getProvider(String);
    method public java.util.List<java.lang.String> getProviders(boolean);
    method public java.util.List<java.lang.String> getProviders(android.location.Criteria, boolean);
    method public boolean isLocationEnabled();
    method public boolean isProviderEnabled(String);
    method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(android.location.GnssMeasurementsEvent.Callback);
    method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(android.location.GnssMeasurementsEvent.Callback, android.os.Handler);
    method public boolean registerGnssNavigationMessageCallback(android.location.GnssNavigationMessage.Callback);
    method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssNavigationMessageCallback(android.location.GnssNavigationMessage.Callback, android.os.Handler);
    method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssStatusCallback(android.location.GnssStatus.Callback);
    method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssStatusCallback(android.location.GnssStatus.Callback, android.os.Handler);
    method @Deprecated public void removeGpsStatusListener(android.location.GpsStatus.Listener);
    method @Deprecated public void removeNmeaListener(android.location.GpsStatus.NmeaListener);
    method public void removeNmeaListener(android.location.OnNmeaMessageListener);
    method @RequiresPermission(anyOf={"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"}, apis="..22") public void removeProximityAlert(android.app.PendingIntent);
    method public void removeTestProvider(String);
    method @RequiresPermission(anyOf={"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"}, apis="..22") public void removeUpdates(android.location.LocationListener);
    method public void removeUpdates(android.app.PendingIntent);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(String, long, float, android.location.LocationListener);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(String, long, float, android.location.LocationListener, android.os.Looper);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, android.location.Criteria, android.location.LocationListener, android.os.Looper);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(String, long, float, android.app.PendingIntent);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, android.location.Criteria, android.app.PendingIntent);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(String, android.location.LocationListener, android.os.Looper);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(android.location.Criteria, android.location.LocationListener, android.os.Looper);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(String, android.app.PendingIntent);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(android.location.Criteria, android.app.PendingIntent);
    method public boolean sendExtraCommand(String, String, android.os.Bundle);
    method public void setTestProviderEnabled(String, boolean);
    method public void setTestProviderLocation(String, android.location.Location);
    method public void setTestProviderStatus(String, int, android.os.Bundle, long);
    method public void unregisterGnssMeasurementsCallback(android.location.GnssMeasurementsEvent.Callback);
    method public void unregisterGnssNavigationMessageCallback(android.location.GnssNavigationMessage.Callback);
    method public void unregisterGnssStatusCallback(android.location.GnssStatus.Callback);
    field public static final String GPS_PROVIDER = "gps";
    field public static final String KEY_LOCATION_CHANGED = "location";
    field public static final String KEY_PROVIDER_ENABLED = "providerEnabled";
    field public static final String KEY_PROXIMITY_ENTERING = "entering";
    field public static final String KEY_STATUS_CHANGED = "status";
    field public static final String MODE_CHANGED_ACTION = "android.location.MODE_CHANGED";
    field public static final String NETWORK_PROVIDER = "network";
    field public static final String PASSIVE_PROVIDER = "passive";
    field public static final String PROVIDERS_CHANGED_ACTION = "android.location.PROVIDERS_CHANGED";
  }

  public class LocationProvider {
    method public int getAccuracy();
    method public String getName();
    method public int getPowerRequirement();
    method public boolean hasMonetaryCost();
    method public boolean meetsCriteria(android.location.Criteria);
    method public boolean requiresCell();
    method public boolean requiresNetwork();
    method public boolean requiresSatellite();
    method public boolean supportsAltitude();
    method public boolean supportsBearing();
    method public boolean supportsSpeed();
    field public static final int AVAILABLE = 2; // 0x2
    field public static final int OUT_OF_SERVICE = 0; // 0x0
    field public static final int TEMPORARILY_UNAVAILABLE = 1; // 0x1
  }

  public interface OnNmeaMessageListener {
    method public void onNmeaMessage(String, long);
  }

  public abstract class SettingInjectorService extends android.app.Service {
    ctor public SettingInjectorService(String);
    method public final android.os.IBinder onBind(android.content.Intent);
    method protected abstract boolean onGetEnabled();
    method @Deprecated protected abstract String onGetSummary();
    method public final void onStart(android.content.Intent, int);
    method public final int onStartCommand(android.content.Intent, int, int);
    field public static final String ACTION_INJECTED_SETTING_CHANGED = "android.location.InjectedSettingChanged";
    field public static final String ACTION_SERVICE_INTENT = "android.location.SettingInjectorService";
    field public static final String ATTRIBUTES_NAME = "injected-location-setting";
    field public static final String META_DATA_NAME = "android.location.SettingInjectorService";
  }

}

package android.media {

  public class AsyncPlayer {
    ctor public AsyncPlayer(String);
    method @Deprecated public void play(android.content.Context, android.net.Uri, boolean, int);
    method public void play(@NonNull android.content.Context, @NonNull android.net.Uri, boolean, @NonNull android.media.AudioAttributes) throws java.lang.IllegalArgumentException;
    method public void stop();
  }

  public final class AudioAttributes implements android.os.Parcelable {
    method public int describeContents();
    method public int getContentType();
    method public int getFlags();
    method public int getUsage();
    method public int getVolumeControlStream();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CONTENT_TYPE_MOVIE = 3; // 0x3
    field public static final int CONTENT_TYPE_MUSIC = 2; // 0x2
    field public static final int CONTENT_TYPE_SONIFICATION = 4; // 0x4
    field public static final int CONTENT_TYPE_SPEECH = 1; // 0x1
    field public static final int CONTENT_TYPE_UNKNOWN = 0; // 0x0
    field public static final android.os.Parcelable.Creator<android.media.AudioAttributes> CREATOR;
    field public static final int FLAG_AUDIBILITY_ENFORCED = 1; // 0x1
    field public static final int FLAG_HW_AV_SYNC = 16; // 0x10
    field @Deprecated public static final int FLAG_LOW_LATENCY = 256; // 0x100
    field public static final int USAGE_ALARM = 4; // 0x4
    field public static final int USAGE_ASSISTANCE_ACCESSIBILITY = 11; // 0xb
    field public static final int USAGE_ASSISTANCE_NAVIGATION_GUIDANCE = 12; // 0xc
    field public static final int USAGE_ASSISTANCE_SONIFICATION = 13; // 0xd
    field public static final int USAGE_ASSISTANT = 16; // 0x10
    field public static final int USAGE_GAME = 14; // 0xe
    field public static final int USAGE_MEDIA = 1; // 0x1
    field public static final int USAGE_NOTIFICATION = 5; // 0x5
    field public static final int USAGE_NOTIFICATION_COMMUNICATION_DELAYED = 9; // 0x9
    field public static final int USAGE_NOTIFICATION_COMMUNICATION_INSTANT = 8; // 0x8
    field public static final int USAGE_NOTIFICATION_COMMUNICATION_REQUEST = 7; // 0x7
    field public static final int USAGE_NOTIFICATION_EVENT = 10; // 0xa
    field public static final int USAGE_NOTIFICATION_RINGTONE = 6; // 0x6
    field public static final int USAGE_UNKNOWN = 0; // 0x0
    field public static final int USAGE_VOICE_COMMUNICATION = 2; // 0x2
    field public static final int USAGE_VOICE_COMMUNICATION_SIGNALLING = 3; // 0x3
  }

  public static class AudioAttributes.Builder {
    ctor public AudioAttributes.Builder();
    ctor public AudioAttributes.Builder(android.media.AudioAttributes);
    method public android.media.AudioAttributes build();
    method public android.media.AudioAttributes.Builder setContentType(int);
    method public android.media.AudioAttributes.Builder setFlags(int);
    method public android.media.AudioAttributes.Builder setLegacyStreamType(int);
    method public android.media.AudioAttributes.Builder setUsage(int);
  }

  public abstract class AudioDeviceCallback {
    ctor public AudioDeviceCallback();
    method public void onAudioDevicesAdded(android.media.AudioDeviceInfo[]);
    method public void onAudioDevicesRemoved(android.media.AudioDeviceInfo[]);
  }

  public final class AudioDeviceInfo {
    method @NonNull public String getAddress();
    method @NonNull public int[] getChannelCounts();
    method @NonNull public int[] getChannelIndexMasks();
    method @NonNull public int[] getChannelMasks();
    method @NonNull public int[] getEncodings();
    method public int getId();
    method public CharSequence getProductName();
    method @NonNull public int[] getSampleRates();
    method public int getType();
    method public boolean isSink();
    method public boolean isSource();
    field public static final int TYPE_AUX_LINE = 19; // 0x13
    field public static final int TYPE_BLUETOOTH_A2DP = 8; // 0x8
    field public static final int TYPE_BLUETOOTH_SCO = 7; // 0x7
    field public static final int TYPE_BUILTIN_EARPIECE = 1; // 0x1
    field public static final int TYPE_BUILTIN_MIC = 15; // 0xf
    field public static final int TYPE_BUILTIN_SPEAKER = 2; // 0x2
    field public static final int TYPE_BUS = 21; // 0x15
    field public static final int TYPE_DOCK = 13; // 0xd
    field public static final int TYPE_FM = 14; // 0xe
    field public static final int TYPE_FM_TUNER = 16; // 0x10
    field public static final int TYPE_HDMI = 9; // 0x9
    field public static final int TYPE_HDMI_ARC = 10; // 0xa
    field public static final int TYPE_HEARING_AID = 23; // 0x17
    field public static final int TYPE_IP = 20; // 0x14
    field public static final int TYPE_LINE_ANALOG = 5; // 0x5
    field public static final int TYPE_LINE_DIGITAL = 6; // 0x6
    field public static final int TYPE_TELEPHONY = 18; // 0x12
    field public static final int TYPE_TV_TUNER = 17; // 0x11
    field public static final int TYPE_UNKNOWN = 0; // 0x0
    field public static final int TYPE_USB_ACCESSORY = 12; // 0xc
    field public static final int TYPE_USB_DEVICE = 11; // 0xb
    field public static final int TYPE_USB_HEADSET = 22; // 0x16
    field public static final int TYPE_WIRED_HEADPHONES = 4; // 0x4
    field public static final int TYPE_WIRED_HEADSET = 3; // 0x3
  }

  public final class AudioFocusRequest {
    method public boolean acceptsDelayedFocusGain();
    method @NonNull public android.media.AudioAttributes getAudioAttributes();
    method public int getFocusGain();
    method public boolean willPauseWhenDucked();
  }

  public static final class AudioFocusRequest.Builder {
    ctor public AudioFocusRequest.Builder(int);
    ctor public AudioFocusRequest.Builder(@NonNull android.media.AudioFocusRequest);
    method public android.media.AudioFocusRequest build();
    method @NonNull public android.media.AudioFocusRequest.Builder setAcceptsDelayedFocusGain(boolean);
    method @NonNull public android.media.AudioFocusRequest.Builder setAudioAttributes(@NonNull android.media.AudioAttributes);
    method @NonNull public android.media.AudioFocusRequest.Builder setFocusGain(int);
    method @NonNull public android.media.AudioFocusRequest.Builder setForceDucking(boolean);
    method @NonNull public android.media.AudioFocusRequest.Builder setOnAudioFocusChangeListener(@NonNull android.media.AudioManager.OnAudioFocusChangeListener);
    method @NonNull public android.media.AudioFocusRequest.Builder setOnAudioFocusChangeListener(@NonNull android.media.AudioManager.OnAudioFocusChangeListener, @NonNull android.os.Handler);
    method @NonNull public android.media.AudioFocusRequest.Builder setWillPauseWhenDucked(boolean);
  }

  public final class AudioFormat implements android.os.Parcelable {
    method public int describeContents();
    method public int getChannelCount();
    method public int getChannelIndexMask();
    method public int getChannelMask();
    method public int getEncoding();
    method public int getSampleRate();
    method public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public static final int CHANNEL_CONFIGURATION_DEFAULT = 1; // 0x1
    field @Deprecated public static final int CHANNEL_CONFIGURATION_INVALID = 0; // 0x0
    field @Deprecated public static final int CHANNEL_CONFIGURATION_MONO = 2; // 0x2
    field @Deprecated public static final int CHANNEL_CONFIGURATION_STEREO = 3; // 0x3
    field public static final int CHANNEL_INVALID = 0; // 0x0
    field public static final int CHANNEL_IN_BACK = 32; // 0x20
    field public static final int CHANNEL_IN_BACK_PROCESSED = 512; // 0x200
    field public static final int CHANNEL_IN_DEFAULT = 1; // 0x1
    field public static final int CHANNEL_IN_FRONT = 16; // 0x10
    field public static final int CHANNEL_IN_FRONT_PROCESSED = 256; // 0x100
    field public static final int CHANNEL_IN_LEFT = 4; // 0x4
    field public static final int CHANNEL_IN_LEFT_PROCESSED = 64; // 0x40
    field public static final int CHANNEL_IN_MONO = 16; // 0x10
    field public static final int CHANNEL_IN_PRESSURE = 1024; // 0x400
    field public static final int CHANNEL_IN_RIGHT = 8; // 0x8
    field public static final int CHANNEL_IN_RIGHT_PROCESSED = 128; // 0x80
    field public static final int CHANNEL_IN_STEREO = 12; // 0xc
    field public static final int CHANNEL_IN_VOICE_DNLINK = 32768; // 0x8000
    field public static final int CHANNEL_IN_VOICE_UPLINK = 16384; // 0x4000
    field public static final int CHANNEL_IN_X_AXIS = 2048; // 0x800
    field public static final int CHANNEL_IN_Y_AXIS = 4096; // 0x1000
    field public static final int CHANNEL_IN_Z_AXIS = 8192; // 0x2000
    field public static final int CHANNEL_OUT_5POINT1 = 252; // 0xfc
    field @Deprecated public static final int CHANNEL_OUT_7POINT1 = 1020; // 0x3fc
    field public static final int CHANNEL_OUT_7POINT1_SURROUND = 6396; // 0x18fc
    field public static final int CHANNEL_OUT_BACK_CENTER = 1024; // 0x400
    field public static final int CHANNEL_OUT_BACK_LEFT = 64; // 0x40
    field public static final int CHANNEL_OUT_BACK_RIGHT = 128; // 0x80
    field public static final int CHANNEL_OUT_DEFAULT = 1; // 0x1
    field public static final int CHANNEL_OUT_FRONT_CENTER = 16; // 0x10
    field public static final int CHANNEL_OUT_FRONT_LEFT = 4; // 0x4
    field public static final int CHANNEL_OUT_FRONT_LEFT_OF_CENTER = 256; // 0x100
    field public static final int CHANNEL_OUT_FRONT_RIGHT = 8; // 0x8
    field public static final int CHANNEL_OUT_FRONT_RIGHT_OF_CENTER = 512; // 0x200
    field public static final int CHANNEL_OUT_LOW_FREQUENCY = 32; // 0x20
    field public static final int CHANNEL_OUT_MONO = 4; // 0x4
    field public static final int CHANNEL_OUT_QUAD = 204; // 0xcc
    field public static final int CHANNEL_OUT_SIDE_LEFT = 2048; // 0x800
    field public static final int CHANNEL_OUT_SIDE_RIGHT = 4096; // 0x1000
    field public static final int CHANNEL_OUT_STEREO = 12; // 0xc
    field public static final int CHANNEL_OUT_SURROUND = 1052; // 0x41c
    field public static final android.os.Parcelable.Creator<android.media.AudioFormat> CREATOR;
    field public static final int ENCODING_AAC_ELD = 15; // 0xf
    field public static final int ENCODING_AAC_HE_V1 = 11; // 0xb
    field public static final int ENCODING_AAC_HE_V2 = 12; // 0xc
    field public static final int ENCODING_AAC_LC = 10; // 0xa
    field public static final int ENCODING_AAC_XHE = 16; // 0x10
    field public static final int ENCODING_AC3 = 5; // 0x5
    field public static final int ENCODING_AC4 = 17; // 0x11
    field public static final int ENCODING_DEFAULT = 1; // 0x1
    field public static final int ENCODING_DOLBY_TRUEHD = 14; // 0xe
    field public static final int ENCODING_DTS = 7; // 0x7
    field public static final int ENCODING_DTS_HD = 8; // 0x8
    field public static final int ENCODING_E_AC3 = 6; // 0x6
    field public static final int ENCODING_E_AC3_JOC = 18; // 0x12
    field public static final int ENCODING_IEC61937 = 13; // 0xd
    field public static final int ENCODING_INVALID = 0; // 0x0
    field public static final int ENCODING_MP3 = 9; // 0x9
    field public static final int ENCODING_PCM_16BIT = 2; // 0x2
    field public static final int ENCODING_PCM_8BIT = 3; // 0x3
    field public static final int ENCODING_PCM_FLOAT = 4; // 0x4
    field public static final int SAMPLE_RATE_UNSPECIFIED = 0; // 0x0
  }

  public static class AudioFormat.Builder {
    ctor public AudioFormat.Builder();
    ctor public AudioFormat.Builder(android.media.AudioFormat);
    method public android.media.AudioFormat build();
    method @NonNull public android.media.AudioFormat.Builder setChannelIndexMask(int);
    method @NonNull public android.media.AudioFormat.Builder setChannelMask(int);
    method public android.media.AudioFormat.Builder setEncoding(int) throws java.lang.IllegalArgumentException;
    method public android.media.AudioFormat.Builder setSampleRate(int) throws java.lang.IllegalArgumentException;
  }

  public class AudioManager {
    method @Deprecated public int abandonAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener);
    method public int abandonAudioFocusRequest(@NonNull android.media.AudioFocusRequest);
    method public void adjustStreamVolume(int, int, int);
    method public void adjustSuggestedStreamVolume(int, int, int);
    method public void adjustVolume(int, int);
    method public void dispatchMediaKeyEvent(android.view.KeyEvent);
    method public int generateAudioSessionId();
    method @NonNull public java.util.List<android.media.AudioPlaybackConfiguration> getActivePlaybackConfigurations();
    method @NonNull public java.util.List<android.media.AudioRecordingConfiguration> getActiveRecordingConfigurations();
    method public android.media.AudioDeviceInfo[] getDevices(int);
    method public java.util.List<android.media.MicrophoneInfo> getMicrophones() throws java.io.IOException;
    method public int getMode();
    method public String getParameters(String);
    method public String getProperty(String);
    method public int getRingerMode();
    method @Deprecated public int getRouting(int);
    method public int getStreamMaxVolume(int);
    method public int getStreamMinVolume(int);
    method public int getStreamVolume(int);
    method public float getStreamVolumeDb(int, int, int);
    method @Deprecated public int getVibrateSetting(int);
    method @Deprecated public boolean isBluetoothA2dpOn();
    method public boolean isBluetoothScoAvailableOffCall();
    method public boolean isBluetoothScoOn();
    method public boolean isMicrophoneMute();
    method public boolean isMusicActive();
    method public boolean isSpeakerphoneOn();
    method public boolean isStreamMute(int);
    method public boolean isVolumeFixed();
    method @Deprecated public boolean isWiredHeadsetOn();
    method public void loadSoundEffects();
    method public void playSoundEffect(int);
    method public void playSoundEffect(int, float);
    method public void registerAudioDeviceCallback(android.media.AudioDeviceCallback, android.os.Handler);
    method public void registerAudioPlaybackCallback(@NonNull android.media.AudioManager.AudioPlaybackCallback, android.os.Handler);
    method public void registerAudioRecordingCallback(@NonNull android.media.AudioManager.AudioRecordingCallback, android.os.Handler);
    method @Deprecated public void registerMediaButtonEventReceiver(android.content.ComponentName);
    method @Deprecated public void registerMediaButtonEventReceiver(android.app.PendingIntent);
    method @Deprecated public void registerRemoteControlClient(android.media.RemoteControlClient);
    method @Deprecated public boolean registerRemoteController(android.media.RemoteController);
    method @Deprecated public int requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, int, int);
    method public int requestAudioFocus(@NonNull android.media.AudioFocusRequest);
    method @Deprecated public void setBluetoothA2dpOn(boolean);
    method public void setBluetoothScoOn(boolean);
    method public void setMicrophoneMute(boolean);
    method public void setMode(int);
    method public void setParameters(String);
    method public void setRingerMode(int);
    method @Deprecated public void setRouting(int, int, int);
    method public void setSpeakerphoneOn(boolean);
    method @Deprecated public void setStreamMute(int, boolean);
    method @Deprecated public void setStreamSolo(int, boolean);
    method public void setStreamVolume(int, int, int);
    method @Deprecated public void setVibrateSetting(int, int);
    method @Deprecated public void setWiredHeadsetOn(boolean);
    method @Deprecated public boolean shouldVibrate(int);
    method public void startBluetoothSco();
    method public void stopBluetoothSco();
    method public void unloadSoundEffects();
    method public void unregisterAudioDeviceCallback(android.media.AudioDeviceCallback);
    method public void unregisterAudioPlaybackCallback(@NonNull android.media.AudioManager.AudioPlaybackCallback);
    method public void unregisterAudioRecordingCallback(@NonNull android.media.AudioManager.AudioRecordingCallback);
    method @Deprecated public void unregisterMediaButtonEventReceiver(android.content.ComponentName);
    method @Deprecated public void unregisterMediaButtonEventReceiver(android.app.PendingIntent);
    method @Deprecated public void unregisterRemoteControlClient(android.media.RemoteControlClient);
    method @Deprecated public void unregisterRemoteController(android.media.RemoteController);
    field public static final String ACTION_AUDIO_BECOMING_NOISY = "android.media.AUDIO_BECOMING_NOISY";
    field public static final String ACTION_HDMI_AUDIO_PLUG = "android.media.action.HDMI_AUDIO_PLUG";
    field public static final String ACTION_HEADSET_PLUG = "android.intent.action.HEADSET_PLUG";
    field public static final String ACTION_MICROPHONE_MUTE_CHANGED = "android.media.action.MICROPHONE_MUTE_CHANGED";
    field @Deprecated public static final String ACTION_SCO_AUDIO_STATE_CHANGED = "android.media.SCO_AUDIO_STATE_CHANGED";
    field public static final String ACTION_SCO_AUDIO_STATE_UPDATED = "android.media.ACTION_SCO_AUDIO_STATE_UPDATED";
    field public static final int ADJUST_LOWER = -1; // 0xffffffff
    field public static final int ADJUST_MUTE = -100; // 0xffffff9c
    field public static final int ADJUST_RAISE = 1; // 0x1
    field public static final int ADJUST_SAME = 0; // 0x0
    field public static final int ADJUST_TOGGLE_MUTE = 101; // 0x65
    field public static final int ADJUST_UNMUTE = 100; // 0x64
    field public static final int AUDIOFOCUS_GAIN = 1; // 0x1
    field public static final int AUDIOFOCUS_GAIN_TRANSIENT = 2; // 0x2
    field public static final int AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE = 4; // 0x4
    field public static final int AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK = 3; // 0x3
    field public static final int AUDIOFOCUS_LOSS = -1; // 0xffffffff
    field public static final int AUDIOFOCUS_LOSS_TRANSIENT = -2; // 0xfffffffe
    field public static final int AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK = -3; // 0xfffffffd
    field public static final int AUDIOFOCUS_NONE = 0; // 0x0
    field public static final int AUDIOFOCUS_REQUEST_DELAYED = 2; // 0x2
    field public static final int AUDIOFOCUS_REQUEST_FAILED = 0; // 0x0
    field public static final int AUDIOFOCUS_REQUEST_GRANTED = 1; // 0x1
    field public static final int AUDIO_SESSION_ID_GENERATE = 0; // 0x0
    field public static final int ERROR = -1; // 0xffffffff
    field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa
    field public static final String EXTRA_AUDIO_PLUG_STATE = "android.media.extra.AUDIO_PLUG_STATE";
    field public static final String EXTRA_ENCODINGS = "android.media.extra.ENCODINGS";
    field public static final String EXTRA_MAX_CHANNEL_COUNT = "android.media.extra.MAX_CHANNEL_COUNT";
    field public static final String EXTRA_RINGER_MODE = "android.media.EXTRA_RINGER_MODE";
    field public static final String EXTRA_SCO_AUDIO_PREVIOUS_STATE = "android.media.extra.SCO_AUDIO_PREVIOUS_STATE";
    field public static final String EXTRA_SCO_AUDIO_STATE = "android.media.extra.SCO_AUDIO_STATE";
    field @Deprecated public static final String EXTRA_VIBRATE_SETTING = "android.media.EXTRA_VIBRATE_SETTING";
    field @Deprecated public static final String EXTRA_VIBRATE_TYPE = "android.media.EXTRA_VIBRATE_TYPE";
    field public static final int FLAG_ALLOW_RINGER_MODES = 2; // 0x2
    field public static final int FLAG_PLAY_SOUND = 4; // 0x4
    field public static final int FLAG_REMOVE_SOUND_AND_VIBRATE = 8; // 0x8
    field public static final int FLAG_SHOW_UI = 1; // 0x1
    field public static final int FLAG_VIBRATE = 16; // 0x10
    field public static final int FX_FOCUS_NAVIGATION_DOWN = 2; // 0x2
    field public static final int FX_FOCUS_NAVIGATION_LEFT = 3; // 0x3
    field public static final int FX_FOCUS_NAVIGATION_RIGHT = 4; // 0x4
    field public static final int FX_FOCUS_NAVIGATION_UP = 1; // 0x1
    field public static final int FX_KEYPRESS_DELETE = 7; // 0x7
    field public static final int FX_KEYPRESS_INVALID = 9; // 0x9
    field public static final int FX_KEYPRESS_RETURN = 8; // 0x8
    field public static final int FX_KEYPRESS_SPACEBAR = 6; // 0x6
    field public static final int FX_KEYPRESS_STANDARD = 5; // 0x5
    field public static final int FX_KEY_CLICK = 0; // 0x0
    field public static final int GET_DEVICES_ALL = 3; // 0x3
    field public static final int GET_DEVICES_INPUTS = 1; // 0x1
    field public static final int GET_DEVICES_OUTPUTS = 2; // 0x2
    field public static final int MODE_CURRENT = -1; // 0xffffffff
    field public static final int MODE_INVALID = -2; // 0xfffffffe
    field public static final int MODE_IN_CALL = 2; // 0x2
    field public static final int MODE_IN_COMMUNICATION = 3; // 0x3
    field public static final int MODE_NORMAL = 0; // 0x0
    field public static final int MODE_RINGTONE = 1; // 0x1
    field @Deprecated public static final int NUM_STREAMS = 5; // 0x5
    field public static final String PROPERTY_OUTPUT_FRAMES_PER_BUFFER = "android.media.property.OUTPUT_FRAMES_PER_BUFFER";
    field public static final String PROPERTY_OUTPUT_SAMPLE_RATE = "android.media.property.OUTPUT_SAMPLE_RATE";
    field public static final String PROPERTY_SUPPORT_AUDIO_SOURCE_UNPROCESSED = "android.media.property.SUPPORT_AUDIO_SOURCE_UNPROCESSED";
    field public static final String PROPERTY_SUPPORT_MIC_NEAR_ULTRASOUND = "android.media.property.SUPPORT_MIC_NEAR_ULTRASOUND";
    field public static final String PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND = "android.media.property.SUPPORT_SPEAKER_NEAR_ULTRASOUND";
    field public static final String RINGER_MODE_CHANGED_ACTION = "android.media.RINGER_MODE_CHANGED";
    field public static final int RINGER_MODE_NORMAL = 2; // 0x2
    field public static final int RINGER_MODE_SILENT = 0; // 0x0
    field public static final int RINGER_MODE_VIBRATE = 1; // 0x1
    field @Deprecated public static final int ROUTE_ALL = -1; // 0xffffffff
    field @Deprecated public static final int ROUTE_BLUETOOTH = 4; // 0x4
    field @Deprecated public static final int ROUTE_BLUETOOTH_A2DP = 16; // 0x10
    field @Deprecated public static final int ROUTE_BLUETOOTH_SCO = 4; // 0x4
    field @Deprecated public static final int ROUTE_EARPIECE = 1; // 0x1
    field @Deprecated public static final int ROUTE_HEADSET = 8; // 0x8
    field @Deprecated public static final int ROUTE_SPEAKER = 2; // 0x2
    field public static final int SCO_AUDIO_STATE_CONNECTED = 1; // 0x1
    field public static final int SCO_AUDIO_STATE_CONNECTING = 2; // 0x2
    field public static final int SCO_AUDIO_STATE_DISCONNECTED = 0; // 0x0
    field public static final int SCO_AUDIO_STATE_ERROR = -1; // 0xffffffff
    field public static final int STREAM_ACCESSIBILITY = 10; // 0xa
    field public static final int STREAM_ALARM = 4; // 0x4
    field public static final int STREAM_DTMF = 8; // 0x8
    field public static final int STREAM_MUSIC = 3; // 0x3
    field public static final int STREAM_NOTIFICATION = 5; // 0x5
    field public static final int STREAM_RING = 2; // 0x2
    field public static final int STREAM_SYSTEM = 1; // 0x1
    field public static final int STREAM_VOICE_CALL = 0; // 0x0
    field public static final int USE_DEFAULT_STREAM_TYPE = -2147483648; // 0x80000000
    field @Deprecated public static final String VIBRATE_SETTING_CHANGED_ACTION = "android.media.VIBRATE_SETTING_CHANGED";
    field @Deprecated public static final int VIBRATE_SETTING_OFF = 0; // 0x0
    field @Deprecated public static final int VIBRATE_SETTING_ON = 1; // 0x1
    field @Deprecated public static final int VIBRATE_SETTING_ONLY_SILENT = 2; // 0x2
    field @Deprecated public static final int VIBRATE_TYPE_NOTIFICATION = 1; // 0x1
    field @Deprecated public static final int VIBRATE_TYPE_RINGER = 0; // 0x0
  }

  public abstract static class AudioManager.AudioPlaybackCallback {
    ctor public AudioManager.AudioPlaybackCallback();
    method public void onPlaybackConfigChanged(java.util.List<android.media.AudioPlaybackConfiguration>);
  }

  public abstract static class AudioManager.AudioRecordingCallback {
    ctor public AudioManager.AudioRecordingCallback();
    method public void onRecordingConfigChanged(java.util.List<android.media.AudioRecordingConfiguration>);
  }

  public static interface AudioManager.OnAudioFocusChangeListener {
    method public void onAudioFocusChange(int);
  }

  public final class AudioPlaybackConfiguration implements android.os.Parcelable {
    method public int describeContents();
    method public android.media.AudioAttributes getAudioAttributes();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.AudioPlaybackConfiguration> CREATOR;
  }

  public final class AudioPresentation {
    method public java.util.Map<java.util.Locale,java.lang.String> getLabels();
    method public java.util.Locale getLocale();
    method public int getMasteringIndication();
    method public boolean hasAudioDescription();
    method public boolean hasDialogueEnhancement();
    method public boolean hasSpokenSubtitles();
    field public static final int MASTERED_FOR_3D = 3; // 0x3
    field public static final int MASTERED_FOR_HEADPHONE = 4; // 0x4
    field public static final int MASTERED_FOR_STEREO = 1; // 0x1
    field public static final int MASTERED_FOR_SURROUND = 2; // 0x2
    field public static final int MASTERING_NOT_INDICATED = 0; // 0x0
  }

  public class AudioRecord implements android.media.AudioRouting {
    ctor public AudioRecord(int, int, int, int, int) throws java.lang.IllegalArgumentException;
    method public void addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler);
    method @Deprecated public void addOnRoutingChangedListener(android.media.AudioRecord.OnRoutingChangedListener, android.os.Handler);
    method protected void finalize();
    method public java.util.List<android.media.MicrophoneInfo> getActiveMicrophones() throws java.io.IOException;
    method public int getAudioFormat();
    method public int getAudioSessionId();
    method public int getAudioSource();
    method public int getBufferSizeInFrames();
    method public int getChannelConfiguration();
    method public int getChannelCount();
    method @NonNull public android.media.AudioFormat getFormat();
    method public android.os.PersistableBundle getMetrics();
    method public static int getMinBufferSize(int, int, int);
    method public int getNotificationMarkerPosition();
    method public int getPositionNotificationPeriod();
    method public android.media.AudioDeviceInfo getPreferredDevice();
    method public int getRecordingState();
    method public android.media.AudioDeviceInfo getRoutedDevice();
    method public int getSampleRate();
    method public int getState();
    method public int getTimestamp(@NonNull android.media.AudioTimestamp, int);
    method public int read(@NonNull byte[], int, int);
    method public int read(@NonNull byte[], int, int, int);
    method public int read(@NonNull short[], int, int);
    method public int read(@NonNull short[], int, int, int);
    method public int read(@NonNull float[], int, int, int);
    method public int read(@NonNull java.nio.ByteBuffer, int);
    method public int read(@NonNull java.nio.ByteBuffer, int, int);
    method public void release();
    method public void removeOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener);
    method @Deprecated public void removeOnRoutingChangedListener(android.media.AudioRecord.OnRoutingChangedListener);
    method public int setNotificationMarkerPosition(int);
    method public int setPositionNotificationPeriod(int);
    method public boolean setPreferredDevice(android.media.AudioDeviceInfo);
    method public void setRecordPositionUpdateListener(android.media.AudioRecord.OnRecordPositionUpdateListener);
    method public void setRecordPositionUpdateListener(android.media.AudioRecord.OnRecordPositionUpdateListener, android.os.Handler);
    method public void startRecording() throws java.lang.IllegalStateException;
    method public void startRecording(android.media.MediaSyncEvent) throws java.lang.IllegalStateException;
    method public void stop() throws java.lang.IllegalStateException;
    field public static final int ERROR = -1; // 0xffffffff
    field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe
    field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa
    field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd
    field public static final int READ_BLOCKING = 0; // 0x0
    field public static final int READ_NON_BLOCKING = 1; // 0x1
    field public static final int RECORDSTATE_RECORDING = 3; // 0x3
    field public static final int RECORDSTATE_STOPPED = 1; // 0x1
    field public static final int STATE_INITIALIZED = 1; // 0x1
    field public static final int STATE_UNINITIALIZED = 0; // 0x0
    field public static final int SUCCESS = 0; // 0x0
  }

  public static class AudioRecord.Builder {
    ctor public AudioRecord.Builder();
    method public android.media.AudioRecord build() throws java.lang.UnsupportedOperationException;
    method public android.media.AudioRecord.Builder setAudioFormat(@NonNull android.media.AudioFormat) throws java.lang.IllegalArgumentException;
    method public android.media.AudioRecord.Builder setAudioSource(int) throws java.lang.IllegalArgumentException;
    method public android.media.AudioRecord.Builder setBufferSizeInBytes(int) throws java.lang.IllegalArgumentException;
  }

  public static final class AudioRecord.MetricsConstants {
    field public static final String CHANNELS = "android.media.audiorecord.channels";
    field public static final String ENCODING = "android.media.audiorecord.encoding";
    field public static final String LATENCY = "android.media.audiorecord.latency";
    field public static final String SAMPLERATE = "android.media.audiorecord.samplerate";
    field public static final String SOURCE = "android.media.audiorecord.source";
  }

  public static interface AudioRecord.OnRecordPositionUpdateListener {
    method public void onMarkerReached(android.media.AudioRecord);
    method public void onPeriodicNotification(android.media.AudioRecord);
  }

  @Deprecated public static interface AudioRecord.OnRoutingChangedListener extends android.media.AudioRouting.OnRoutingChangedListener {
    method @Deprecated public void onRoutingChanged(android.media.AudioRecord);
    method @Deprecated public default void onRoutingChanged(android.media.AudioRouting);
  }

  public final class AudioRecordingConfiguration implements android.os.Parcelable {
    method public int describeContents();
    method public android.media.AudioDeviceInfo getAudioDevice();
    method public int getClientAudioSessionId();
    method public int getClientAudioSource();
    method public android.media.AudioFormat getClientFormat();
    method public android.media.AudioFormat getFormat();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.AudioRecordingConfiguration> CREATOR;
  }

  public interface AudioRouting {
    method public void addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler);
    method public android.media.AudioDeviceInfo getPreferredDevice();
    method public android.media.AudioDeviceInfo getRoutedDevice();
    method public void removeOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener);
    method public boolean setPreferredDevice(android.media.AudioDeviceInfo);
  }

  public static interface AudioRouting.OnRoutingChangedListener {
    method public void onRoutingChanged(android.media.AudioRouting);
  }

  public final class AudioTimestamp {
    ctor public AudioTimestamp();
    field public static final int TIMEBASE_BOOTTIME = 1; // 0x1
    field public static final int TIMEBASE_MONOTONIC = 0; // 0x0
    field public long framePosition;
    field public long nanoTime;
  }

  public class AudioTrack implements android.media.AudioRouting android.media.VolumeAutomation {
    ctor @Deprecated public AudioTrack(int, int, int, int, int, int) throws java.lang.IllegalArgumentException;
    ctor @Deprecated public AudioTrack(int, int, int, int, int, int, int) throws java.lang.IllegalArgumentException;
    ctor public AudioTrack(android.media.AudioAttributes, android.media.AudioFormat, int, int, int) throws java.lang.IllegalArgumentException;
    method public void addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler);
    method @Deprecated public void addOnRoutingChangedListener(android.media.AudioTrack.OnRoutingChangedListener, android.os.Handler);
    method public int attachAuxEffect(int);
    method @NonNull public android.media.VolumeShaper createVolumeShaper(@NonNull android.media.VolumeShaper.Configuration);
    method public static void deprecateStreamTypeForPlayback(int, String, String) throws java.lang.IllegalArgumentException;
    method protected void finalize();
    method public void flush();
    method public int getAudioFormat();
    method public int getAudioSessionId();
    method public int getBufferCapacityInFrames();
    method public int getBufferSizeInFrames();
    method public int getChannelConfiguration();
    method public int getChannelCount();
    method @NonNull public android.media.AudioFormat getFormat();
    method public static float getMaxVolume();
    method public android.os.PersistableBundle getMetrics();
    method public static int getMinBufferSize(int, int, int);
    method public static float getMinVolume();
    method @Deprecated protected int getNativeFrameCount();
    method public static int getNativeOutputSampleRate(int);
    method public int getNotificationMarkerPosition();
    method public int getPerformanceMode();
    method public int getPlayState();
    method public int getPlaybackHeadPosition();
    method @NonNull public android.media.PlaybackParams getPlaybackParams();
    method public int getPlaybackRate();
    method public int getPositionNotificationPeriod();
    method public android.media.AudioDeviceInfo getPreferredDevice();
    method public android.media.AudioDeviceInfo getRoutedDevice();
    method public int getSampleRate();
    method public int getState();
    method public int getStreamType();
    method public boolean getTimestamp(android.media.AudioTimestamp);
    method public int getUnderrunCount();
    method public void pause() throws java.lang.IllegalStateException;
    method public void play() throws java.lang.IllegalStateException;
    method public void release();
    method public int reloadStaticData();
    method public void removeOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener);
    method @Deprecated public void removeOnRoutingChangedListener(android.media.AudioTrack.OnRoutingChangedListener);
    method public int setAuxEffectSendLevel(float);
    method public int setBufferSizeInFrames(int);
    method public int setLoopPoints(int, int, int);
    method public int setNotificationMarkerPosition(int);
    method public int setPlaybackHeadPosition(int);
    method public void setPlaybackParams(@NonNull android.media.PlaybackParams);
    method public void setPlaybackPositionUpdateListener(android.media.AudioTrack.OnPlaybackPositionUpdateListener);
    method public void setPlaybackPositionUpdateListener(android.media.AudioTrack.OnPlaybackPositionUpdateListener, android.os.Handler);
    method public int setPlaybackRate(int);
    method public int setPositionNotificationPeriod(int);
    method public boolean setPreferredDevice(android.media.AudioDeviceInfo);
    method public int setPresentation(@NonNull android.media.AudioPresentation);
    method @Deprecated protected void setState(int);
    method @Deprecated public int setStereoVolume(float, float);
    method public int setVolume(float);
    method public void stop() throws java.lang.IllegalStateException;
    method public int write(@NonNull byte[], int, int);
    method public int write(@NonNull byte[], int, int, int);
    method public int write(@NonNull short[], int, int);
    method public int write(@NonNull short[], int, int, int);
    method public int write(@NonNull float[], int, int, int);
    method public int write(@NonNull java.nio.ByteBuffer, int, int);
    method public int write(@NonNull java.nio.ByteBuffer, int, int, long);
    field public static final int ERROR = -1; // 0xffffffff
    field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe
    field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa
    field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd
    field public static final int MODE_STATIC = 0; // 0x0
    field public static final int MODE_STREAM = 1; // 0x1
    field public static final int PERFORMANCE_MODE_LOW_LATENCY = 1; // 0x1
    field public static final int PERFORMANCE_MODE_NONE = 0; // 0x0
    field public static final int PERFORMANCE_MODE_POWER_SAVING = 2; // 0x2
    field public static final int PLAYSTATE_PAUSED = 2; // 0x2
    field public static final int PLAYSTATE_PLAYING = 3; // 0x3
    field public static final int PLAYSTATE_STOPPED = 1; // 0x1
    field public static final int STATE_INITIALIZED = 1; // 0x1
    field public static final int STATE_NO_STATIC_DATA = 2; // 0x2
    field public static final int STATE_UNINITIALIZED = 0; // 0x0
    field public static final int SUCCESS = 0; // 0x0
    field public static final int WRITE_BLOCKING = 0; // 0x0
    field public static final int WRITE_NON_BLOCKING = 1; // 0x1
  }

  public static class AudioTrack.Builder {
    ctor public AudioTrack.Builder();
    method @NonNull public android.media.AudioTrack build() throws java.lang.UnsupportedOperationException;
    method @NonNull public android.media.AudioTrack.Builder setAudioAttributes(@NonNull android.media.AudioAttributes) throws java.lang.IllegalArgumentException;
    method @NonNull public android.media.AudioTrack.Builder setAudioFormat(@NonNull android.media.AudioFormat) throws java.lang.IllegalArgumentException;
    method @NonNull public android.media.AudioTrack.Builder setBufferSizeInBytes(int) throws java.lang.IllegalArgumentException;
    method @NonNull public android.media.AudioTrack.Builder setPerformanceMode(int);
    method @NonNull public android.media.AudioTrack.Builder setSessionId(int) throws java.lang.IllegalArgumentException;
    method @NonNull public android.media.AudioTrack.Builder setTransferMode(int) throws java.lang.IllegalArgumentException;
  }

  public static final class AudioTrack.MetricsConstants {
    field public static final String CHANNELMASK = "android.media.audiorecord.channelmask";
    field public static final String CONTENTTYPE = "android.media.audiotrack.type";
    field public static final String SAMPLERATE = "android.media.audiorecord.samplerate";
    field public static final String STREAMTYPE = "android.media.audiotrack.streamtype";
    field public static final String USAGE = "android.media.audiotrack.usage";
  }

  public static interface AudioTrack.OnPlaybackPositionUpdateListener {
    method public void onMarkerReached(android.media.AudioTrack);
    method public void onPeriodicNotification(android.media.AudioTrack);
  }

  @Deprecated public static interface AudioTrack.OnRoutingChangedListener extends android.media.AudioRouting.OnRoutingChangedListener {
    method @Deprecated public void onRoutingChanged(android.media.AudioTrack);
    method @Deprecated public default void onRoutingChanged(android.media.AudioRouting);
  }

  public class CamcorderProfile {
    method public static android.media.CamcorderProfile get(int);
    method public static android.media.CamcorderProfile get(int, int);
    method public static boolean hasProfile(int);
    method public static boolean hasProfile(int, int);
    field public static final int QUALITY_1080P = 6; // 0x6
    field public static final int QUALITY_2160P = 8; // 0x8
    field public static final int QUALITY_480P = 4; // 0x4
    field public static final int QUALITY_720P = 5; // 0x5
    field public static final int QUALITY_CIF = 3; // 0x3
    field public static final int QUALITY_HIGH = 1; // 0x1
    field public static final int QUALITY_HIGH_SPEED_1080P = 2004; // 0x7d4
    field public static final int QUALITY_HIGH_SPEED_2160P = 2005; // 0x7d5
    field public static final int QUALITY_HIGH_SPEED_480P = 2002; // 0x7d2
    field public static final int QUALITY_HIGH_SPEED_720P = 2003; // 0x7d3
    field public static final int QUALITY_HIGH_SPEED_HIGH = 2001; // 0x7d1
    field public static final int QUALITY_HIGH_SPEED_LOW = 2000; // 0x7d0
    field public static final int QUALITY_LOW = 0; // 0x0
    field public static final int QUALITY_QCIF = 2; // 0x2
    field public static final int QUALITY_QVGA = 7; // 0x7
    field public static final int QUALITY_TIME_LAPSE_1080P = 1006; // 0x3ee
    field public static final int QUALITY_TIME_LAPSE_2160P = 1008; // 0x3f0
    field public static final int QUALITY_TIME_LAPSE_480P = 1004; // 0x3ec
    field public static final int QUALITY_TIME_LAPSE_720P = 1005; // 0x3ed
    field public static final int QUALITY_TIME_LAPSE_CIF = 1003; // 0x3eb
    field public static final int QUALITY_TIME_LAPSE_HIGH = 1001; // 0x3e9
    field public static final int QUALITY_TIME_LAPSE_LOW = 1000; // 0x3e8
    field public static final int QUALITY_TIME_LAPSE_QCIF = 1002; // 0x3ea
    field public static final int QUALITY_TIME_LAPSE_QVGA = 1007; // 0x3ef
    field public int audioBitRate;
    field public int audioChannels;
    field public int audioCodec;
    field public int audioSampleRate;
    field public int duration;
    field public int fileFormat;
    field public int quality;
    field public int videoBitRate;
    field public int videoCodec;
    field public int videoFrameHeight;
    field public int videoFrameRate;
    field public int videoFrameWidth;
  }

  public class CameraProfile {
    ctor public CameraProfile();
    method public static int getJpegEncodingQualityParameter(int);
    method public static int getJpegEncodingQualityParameter(int, int);
    field public static final int QUALITY_HIGH = 2; // 0x2
    field public static final int QUALITY_LOW = 0; // 0x0
    field public static final int QUALITY_MEDIUM = 1; // 0x1
  }

  public final class DeniedByServerException extends android.media.MediaDrmException {
    ctor public DeniedByServerException(String);
  }

  public abstract class DrmInitData {
    method public abstract android.media.DrmInitData.SchemeInitData get(java.util.UUID);
  }

  public static final class DrmInitData.SchemeInitData {
    field public final byte[] data;
    field public final String mimeType;
  }

  public class ExifInterface {
    ctor public ExifInterface(String) throws java.io.IOException;
    ctor public ExifInterface(java.io.FileDescriptor) throws java.io.IOException;
    ctor public ExifInterface(java.io.InputStream) throws java.io.IOException;
    method public double getAltitude(double);
    method public String getAttribute(String);
    method public double getAttributeDouble(String, double);
    method public int getAttributeInt(String, int);
    method public boolean getLatLong(float[]);
    method public byte[] getThumbnail();
    method public android.graphics.Bitmap getThumbnailBitmap();
    method public byte[] getThumbnailBytes();
    method public long[] getThumbnailRange();
    method public boolean hasThumbnail();
    method public boolean isThumbnailCompressed();
    method public void saveAttributes() throws java.io.IOException;
    method public void setAttribute(String, String);
    field public static final int ORIENTATION_FLIP_HORIZONTAL = 2; // 0x2
    field public static final int ORIENTATION_FLIP_VERTICAL = 4; // 0x4
    field public static final int ORIENTATION_NORMAL = 1; // 0x1
    field public static final int ORIENTATION_ROTATE_180 = 3; // 0x3
    field public static final int ORIENTATION_ROTATE_270 = 8; // 0x8
    field public static final int ORIENTATION_ROTATE_90 = 6; // 0x6
    field public static final int ORIENTATION_TRANSPOSE = 5; // 0x5
    field public static final int ORIENTATION_TRANSVERSE = 7; // 0x7
    field public static final int ORIENTATION_UNDEFINED = 0; // 0x0
    field @Deprecated public static final String TAG_APERTURE = "FNumber";
    field public static final String TAG_APERTURE_VALUE = "ApertureValue";
    field public static final String TAG_ARTIST = "Artist";
    field public static final String TAG_BITS_PER_SAMPLE = "BitsPerSample";
    field public static final String TAG_BRIGHTNESS_VALUE = "BrightnessValue";
    field public static final String TAG_CFA_PATTERN = "CFAPattern";
    field public static final String TAG_COLOR_SPACE = "ColorSpace";
    field public static final String TAG_COMPONENTS_CONFIGURATION = "ComponentsConfiguration";
    field public static final String TAG_COMPRESSED_BITS_PER_PIXEL = "CompressedBitsPerPixel";
    field public static final String TAG_COMPRESSION = "Compression";
    field public static final String TAG_CONTRAST = "Contrast";
    field public static final String TAG_COPYRIGHT = "Copyright";
    field public static final String TAG_CUSTOM_RENDERED = "CustomRendered";
    field public static final String TAG_DATETIME = "DateTime";
    field public static final String TAG_DATETIME_DIGITIZED = "DateTimeDigitized";
    field public static final String TAG_DATETIME_ORIGINAL = "DateTimeOriginal";
    field public static final String TAG_DEFAULT_CROP_SIZE = "DefaultCropSize";
    field public static final String TAG_DEVICE_SETTING_DESCRIPTION = "DeviceSettingDescription";
    field public static final String TAG_DIGITAL_ZOOM_RATIO = "DigitalZoomRatio";
    field public static final String TAG_DNG_VERSION = "DNGVersion";
    field public static final String TAG_EXIF_VERSION = "ExifVersion";
    field public static final String TAG_EXPOSURE_BIAS_VALUE = "ExposureBiasValue";
    field public static final String TAG_EXPOSURE_INDEX = "ExposureIndex";
    field public static final String TAG_EXPOSURE_MODE = "ExposureMode";
    field public static final String TAG_EXPOSURE_PROGRAM = "ExposureProgram";
    field public static final String TAG_EXPOSURE_TIME = "ExposureTime";
    field public static final String TAG_FILE_SOURCE = "FileSource";
    field public static final String TAG_FLASH = "Flash";
    field public static final String TAG_FLASHPIX_VERSION = "FlashpixVersion";
    field public static final String TAG_FLASH_ENERGY = "FlashEnergy";
    field public static final String TAG_FOCAL_LENGTH = "FocalLength";
    field public static final String TAG_FOCAL_LENGTH_IN_35MM_FILM = "FocalLengthIn35mmFilm";
    field public static final String TAG_FOCAL_PLANE_RESOLUTION_UNIT = "FocalPlaneResolutionUnit";
    field public static final String TAG_FOCAL_PLANE_X_RESOLUTION = "FocalPlaneXResolution";
    field public static final String TAG_FOCAL_PLANE_Y_RESOLUTION = "FocalPlaneYResolution";
    field public static final String TAG_F_NUMBER = "FNumber";
    field public static final String TAG_GAIN_CONTROL = "GainControl";
    field public static final String TAG_GPS_ALTITUDE = "GPSAltitude";
    field public static final String TAG_GPS_ALTITUDE_REF = "GPSAltitudeRef";
    field public static final String TAG_GPS_AREA_INFORMATION = "GPSAreaInformation";
    field public static final String TAG_GPS_DATESTAMP = "GPSDateStamp";
    field public static final String TAG_GPS_DEST_BEARING = "GPSDestBearing";
    field public static final String TAG_GPS_DEST_BEARING_REF = "GPSDestBearingRef";
    field public static final String TAG_GPS_DEST_DISTANCE = "GPSDestDistance";
    field public static final String TAG_GPS_DEST_DISTANCE_REF = "GPSDestDistanceRef";
    field public static final String TAG_GPS_DEST_LATITUDE = "GPSDestLatitude";
    field public static final String TAG_GPS_DEST_LATITUDE_REF = "GPSDestLatitudeRef";
    field public static final String TAG_GPS_DEST_LONGITUDE = "GPSDestLongitude";
    field public static final String TAG_GPS_DEST_LONGITUDE_REF = "GPSDestLongitudeRef";
    field public static final String TAG_GPS_DIFFERENTIAL = "GPSDifferential";
    field public static final String TAG_GPS_DOP = "GPSDOP";
    field public static final String TAG_GPS_IMG_DIRECTION = "GPSImgDirection";
    field public static final String TAG_GPS_IMG_DIRECTION_REF = "GPSImgDirectionRef";
    field public static final String TAG_GPS_LATITUDE = "GPSLatitude";
    field public static final String TAG_GPS_LATITUDE_REF = "GPSLatitudeRef";
    field public static final String TAG_GPS_LONGITUDE = "GPSLongitude";
    field public static final String TAG_GPS_LONGITUDE_REF = "GPSLongitudeRef";
    field public static final String TAG_GPS_MAP_DATUM = "GPSMapDatum";
    field public static final String TAG_GPS_MEASURE_MODE = "GPSMeasureMode";
    field public static final String TAG_GPS_PROCESSING_METHOD = "GPSProcessingMethod";
    field public static final String TAG_GPS_SATELLITES = "GPSSatellites";
    field public static final String TAG_GPS_SPEED = "GPSSpeed";
    field public static final String TAG_GPS_SPEED_REF = "GPSSpeedRef";
    field public static final String TAG_GPS_STATUS = "GPSStatus";
    field public static final String TAG_GPS_TIMESTAMP = "GPSTimeStamp";
    field public static final String TAG_GPS_TRACK = "GPSTrack";
    field public static final String TAG_GPS_TRACK_REF = "GPSTrackRef";
    field public static final String TAG_GPS_VERSION_ID = "GPSVersionID";
    field public static final String TAG_IMAGE_DESCRIPTION = "ImageDescription";
    field public static final String TAG_IMAGE_LENGTH = "ImageLength";
    field public static final String TAG_IMAGE_UNIQUE_ID = "ImageUniqueID";
    field public static final String TAG_IMAGE_WIDTH = "ImageWidth";
    field public static final String TAG_INTEROPERABILITY_INDEX = "InteroperabilityIndex";
    field @Deprecated public static final String TAG_ISO = "ISOSpeedRatings";
    field public static final String TAG_ISO_SPEED_RATINGS = "ISOSpeedRatings";
    field public static final String TAG_JPEG_INTERCHANGE_FORMAT = "JPEGInterchangeFormat";
    field public static final String TAG_JPEG_INTERCHANGE_FORMAT_LENGTH = "JPEGInterchangeFormatLength";
    field public static final String TAG_LIGHT_SOURCE = "LightSource";
    field public static final String TAG_MAKE = "Make";
    field public static final String TAG_MAKER_NOTE = "MakerNote";
    field public static final String TAG_MAX_APERTURE_VALUE = "MaxApertureValue";
    field public static final String TAG_METERING_MODE = "MeteringMode";
    field public static final String TAG_MODEL = "Model";
    field public static final String TAG_NEW_SUBFILE_TYPE = "NewSubfileType";
    field public static final String TAG_OECF = "OECF";
    field public static final String TAG_ORF_ASPECT_FRAME = "AspectFrame";
    field public static final String TAG_ORF_PREVIEW_IMAGE_LENGTH = "PreviewImageLength";
    field public static final String TAG_ORF_PREVIEW_IMAGE_START = "PreviewImageStart";
    field public static final String TAG_ORF_THUMBNAIL_IMAGE = "ThumbnailImage";
    field public static final String TAG_ORIENTATION = "Orientation";
    field public static final String TAG_PHOTOMETRIC_INTERPRETATION = "PhotometricInterpretation";
    field public static final String TAG_PIXEL_X_DIMENSION = "PixelXDimension";
    field public static final String TAG_PIXEL_Y_DIMENSION = "PixelYDimension";
    field public static final String TAG_PLANAR_CONFIGURATION = "PlanarConfiguration";
    field public static final String TAG_PRIMARY_CHROMATICITIES = "PrimaryChromaticities";
    field public static final String TAG_REFERENCE_BLACK_WHITE = "ReferenceBlackWhite";
    field public static final String TAG_RELATED_SOUND_FILE = "RelatedSoundFile";
    field public static final String TAG_RESOLUTION_UNIT = "ResolutionUnit";
    field public static final String TAG_ROWS_PER_STRIP = "RowsPerStrip";
    field public static final String TAG_RW2_ISO = "ISO";
    field public static final String TAG_RW2_JPG_FROM_RAW = "JpgFromRaw";
    field public static final String TAG_RW2_SENSOR_BOTTOM_BORDER = "SensorBottomBorder";
    field public static final String TAG_RW2_SENSOR_LEFT_BORDER = "SensorLeftBorder";
    field public static final String TAG_RW2_SENSOR_RIGHT_BORDER = "SensorRightBorder";
    field public static final String TAG_RW2_SENSOR_TOP_BORDER = "SensorTopBorder";
    field public static final String TAG_SAMPLES_PER_PIXEL = "SamplesPerPixel";
    field public static final String TAG_SATURATION = "Saturation";
    field public static final String TAG_SCENE_CAPTURE_TYPE = "SceneCaptureType";
    field public static final String TAG_SCENE_TYPE = "SceneType";
    field public static final String TAG_SENSING_METHOD = "SensingMethod";
    field public static final String TAG_SHARPNESS = "Sharpness";
    field public static final String TAG_SHUTTER_SPEED_VALUE = "ShutterSpeedValue";
    field public static final String TAG_SOFTWARE = "Software";
    field public static final String TAG_SPATIAL_FREQUENCY_RESPONSE = "SpatialFrequencyResponse";
    field public static final String TAG_SPECTRAL_SENSITIVITY = "SpectralSensitivity";
    field public static final String TAG_STRIP_BYTE_COUNTS = "StripByteCounts";
    field public static final String TAG_STRIP_OFFSETS = "StripOffsets";
    field public static final String TAG_SUBFILE_TYPE = "SubfileType";
    field public static final String TAG_SUBJECT_AREA = "SubjectArea";
    field public static final String TAG_SUBJECT_DISTANCE = "SubjectDistance";
    field public static final String TAG_SUBJECT_DISTANCE_RANGE = "SubjectDistanceRange";
    field public static final String TAG_SUBJECT_LOCATION = "SubjectLocation";
    field public static final String TAG_SUBSEC_TIME = "SubSecTime";
    field @Deprecated public static final String TAG_SUBSEC_TIME_DIG = "SubSecTimeDigitized";
    field public static final String TAG_SUBSEC_TIME_DIGITIZED = "SubSecTimeDigitized";
    field @Deprecated public static final String TAG_SUBSEC_TIME_ORIG = "SubSecTimeOriginal";
    field public static final String TAG_SUBSEC_TIME_ORIGINAL = "SubSecTimeOriginal";
    field public static final String TAG_THUMBNAIL_IMAGE_LENGTH = "ThumbnailImageLength";
    field public static final String TAG_THUMBNAIL_IMAGE_WIDTH = "ThumbnailImageWidth";
    field public static final String TAG_TRANSFER_FUNCTION = "TransferFunction";
    field public static final String TAG_USER_COMMENT = "UserComment";
    field public static final String TAG_WHITE_BALANCE = "WhiteBalance";
    field public static final String TAG_WHITE_POINT = "WhitePoint";
    field public static final String TAG_X_RESOLUTION = "XResolution";
    field public static final String TAG_Y_CB_CR_COEFFICIENTS = "YCbCrCoefficients";
    field public static final String TAG_Y_CB_CR_POSITIONING = "YCbCrPositioning";
    field public static final String TAG_Y_CB_CR_SUB_SAMPLING = "YCbCrSubSampling";
    field public static final String TAG_Y_RESOLUTION = "YResolution";
    field public static final int WHITEBALANCE_AUTO = 0; // 0x0
    field public static final int WHITEBALANCE_MANUAL = 1; // 0x1
  }

  public class FaceDetector {
    ctor public FaceDetector(int, int, int);
    method public int findFaces(android.graphics.Bitmap, android.media.FaceDetector.Face[]);
  }

  public class FaceDetector.Face {
    method public float confidence();
    method public float eyesDistance();
    method public void getMidPoint(android.graphics.PointF);
    method public float pose(int);
    field public static final float CONFIDENCE_THRESHOLD = 0.4f;
    field public static final int EULER_X = 0; // 0x0
    field public static final int EULER_Y = 1; // 0x1
    field public static final int EULER_Z = 2; // 0x2
  }

  public abstract class Image implements java.lang.AutoCloseable {
    method public abstract void close();
    method public android.graphics.Rect getCropRect();
    method public abstract int getFormat();
    method @Nullable public android.hardware.HardwareBuffer getHardwareBuffer();
    method public abstract int getHeight();
    method public abstract android.media.Image.Plane[] getPlanes();
    method public abstract long getTimestamp();
    method public abstract int getWidth();
    method public void setCropRect(android.graphics.Rect);
    method public void setTimestamp(long);
  }

  public abstract static class Image.Plane {
    method public abstract java.nio.ByteBuffer getBuffer();
    method public abstract int getPixelStride();
    method public abstract int getRowStride();
  }

  public class ImageReader implements java.lang.AutoCloseable {
    method public android.media.Image acquireLatestImage();
    method public android.media.Image acquireNextImage();
    method public void close();
    method public void discardFreeBuffers();
    method public int getHeight();
    method public int getImageFormat();
    method public int getMaxImages();
    method public android.view.Surface getSurface();
    method public int getWidth();
    method public static android.media.ImageReader newInstance(int, int, int, int);
    method public void setOnImageAvailableListener(android.media.ImageReader.OnImageAvailableListener, android.os.Handler);
  }

  public static interface ImageReader.OnImageAvailableListener {
    method public void onImageAvailable(android.media.ImageReader);
  }

  public class ImageWriter implements java.lang.AutoCloseable {
    method public void close();
    method public android.media.Image dequeueInputImage();
    method public int getFormat();
    method public int getMaxImages();
    method public static android.media.ImageWriter newInstance(android.view.Surface, int);
    method public void queueInputImage(android.media.Image);
    method public void setOnImageReleasedListener(android.media.ImageWriter.OnImageReleasedListener, android.os.Handler);
  }

  public static interface ImageWriter.OnImageReleasedListener {
    method public void onImageReleased(android.media.ImageWriter);
  }

  public class JetPlayer {
    method public boolean clearQueue();
    method public Object clone() throws java.lang.CloneNotSupportedException;
    method public boolean closeJetFile();
    method protected void finalize();
    method public static android.media.JetPlayer getJetPlayer();
    method public static int getMaxTracks();
    method public boolean loadJetFile(String);
    method public boolean loadJetFile(android.content.res.AssetFileDescriptor);
    method public boolean pause();
    method public boolean play();
    method public boolean queueJetSegment(int, int, int, int, int, byte);
    method public boolean queueJetSegmentMuteArray(int, int, int, int, boolean[], byte);
    method public void release();
    method public void setEventListener(android.media.JetPlayer.OnJetEventListener);
    method public void setEventListener(android.media.JetPlayer.OnJetEventListener, android.os.Handler);
    method public boolean setMuteArray(boolean[], boolean);
    method public boolean setMuteFlag(int, boolean, boolean);
    method public boolean setMuteFlags(int, boolean);
    method public boolean triggerClip(int);
  }

  public static interface JetPlayer.OnJetEventListener {
    method public void onJetEvent(android.media.JetPlayer, short, byte, byte, byte, byte);
    method public void onJetNumQueuedSegmentUpdate(android.media.JetPlayer, int);
    method public void onJetPauseUpdate(android.media.JetPlayer, int);
    method public void onJetUserIdUpdate(android.media.JetPlayer, int, int);
  }

  public class MediaActionSound {
    ctor public MediaActionSound();
    method public void load(int);
    method public void play(int);
    method public void release();
    field public static final int FOCUS_COMPLETE = 1; // 0x1
    field public static final int SHUTTER_CLICK = 0; // 0x0
    field public static final int START_VIDEO_RECORDING = 2; // 0x2
    field public static final int STOP_VIDEO_RECORDING = 3; // 0x3
  }

  public final class MediaCas implements java.lang.AutoCloseable {
    ctor public MediaCas(int) throws android.media.MediaCasException.UnsupportedCasException;
    method public void close();
    method public static android.media.MediaCas.PluginDescriptor[] enumeratePlugins();
    method protected void finalize();
    method public static boolean isSystemIdSupported(int);
    method public android.media.MediaCas.Session openSession() throws android.media.MediaCasException;
    method public void processEmm(@NonNull byte[], int, int) throws android.media.MediaCasException;
    method public void processEmm(@NonNull byte[]) throws android.media.MediaCasException;
    method public void provision(@NonNull String) throws android.media.MediaCasException;
    method public void refreshEntitlements(int, @Nullable byte[]) throws android.media.MediaCasException;
    method public void sendEvent(int, int, @Nullable byte[]) throws android.media.MediaCasException;
    method public void setEventListener(@Nullable android.media.MediaCas.EventListener, @Nullable android.os.Handler);
    method public void setPrivateData(@NonNull byte[]) throws android.media.MediaCasException;
  }

  public static interface MediaCas.EventListener {
    method public void onEvent(android.media.MediaCas, int, int, @Nullable byte[]);
  }

  public static class MediaCas.PluginDescriptor {
    method @NonNull public String getName();
    method public int getSystemId();
  }

  public final class MediaCas.Session implements java.lang.AutoCloseable {
    method public void close();
    method public void processEcm(@NonNull byte[], int, int) throws android.media.MediaCasException;
    method public void processEcm(@NonNull byte[]) throws android.media.MediaCasException;
    method public void setPrivateData(@NonNull byte[]) throws android.media.MediaCasException;
  }

  public class MediaCasException extends java.lang.Exception {
  }

  public static final class MediaCasException.DeniedByServerException extends android.media.MediaCasException {
  }

  public static final class MediaCasException.NotProvisionedException extends android.media.MediaCasException {
  }

  public static final class MediaCasException.ResourceBusyException extends android.media.MediaCasException {
  }

  public static final class MediaCasException.UnsupportedCasException extends android.media.MediaCasException {
  }

  public class MediaCasStateException extends java.lang.IllegalStateException {
    method @NonNull public String getDiagnosticInfo();
  }

  public final class MediaCodec {
    method public void configure(@Nullable android.media.MediaFormat, @Nullable android.view.Surface, @Nullable android.media.MediaCrypto, int);
    method public void configure(@Nullable android.media.MediaFormat, @Nullable android.view.Surface, int, @Nullable android.media.MediaDescrambler);
    method @NonNull public static android.media.MediaCodec createByCodecName(@NonNull String) throws java.io.IOException;
    method @NonNull public static android.media.MediaCodec createDecoderByType(@NonNull String) throws java.io.IOException;
    method @NonNull public static android.media.MediaCodec createEncoderByType(@NonNull String) throws java.io.IOException;
    method @NonNull public android.view.Surface createInputSurface();
    method @NonNull public static android.view.Surface createPersistentInputSurface();
    method public int dequeueInputBuffer(long);
    method public int dequeueOutputBuffer(@NonNull android.media.MediaCodec.BufferInfo, long);
    method protected void finalize();
    method public void flush();
    method @NonNull public android.media.MediaCodecInfo getCodecInfo();
    method @Nullable public java.nio.ByteBuffer getInputBuffer(int);
    method @Deprecated @NonNull public java.nio.ByteBuffer[] getInputBuffers();
    method @NonNull public android.media.MediaFormat getInputFormat();
    method @Nullable public android.media.Image getInputImage(int);
    method public android.os.PersistableBundle getMetrics();
    method @NonNull public String getName();
    method @Nullable public java.nio.ByteBuffer getOutputBuffer(int);
    method @Deprecated @NonNull public java.nio.ByteBuffer[] getOutputBuffers();
    method @NonNull public android.media.MediaFormat getOutputFormat();
    method @NonNull public android.media.MediaFormat getOutputFormat(int);
    method @Nullable public android.media.Image getOutputImage(int);
    method public void queueInputBuffer(int, int, int, long, int) throws android.media.MediaCodec.CryptoException;
    method public void queueSecureInputBuffer(int, int, @NonNull android.media.MediaCodec.CryptoInfo, long, int) throws android.media.MediaCodec.CryptoException;
    method public void release();
    method public void releaseOutputBuffer(int, boolean);
    method public void releaseOutputBuffer(int, long);
    method public void reset();
    method public void setCallback(@Nullable android.media.MediaCodec.Callback, @Nullable android.os.Handler);
    method public void setCallback(@Nullable android.media.MediaCodec.Callback);
    method public void setInputSurface(@NonNull android.view.Surface);
    method public void setOnFrameRenderedListener(@Nullable android.media.MediaCodec.OnFrameRenderedListener, @Nullable android.os.Handler);
    method public void setOutputSurface(@NonNull android.view.Surface);
    method public void setParameters(@Nullable android.os.Bundle);
    method public void setVideoScalingMode(int);
    method public void signalEndOfInputStream();
    method public void start();
    method public void stop();
    field public static final int BUFFER_FLAG_CODEC_CONFIG = 2; // 0x2
    field public static final int BUFFER_FLAG_END_OF_STREAM = 4; // 0x4
    field public static final int BUFFER_FLAG_KEY_FRAME = 1; // 0x1
    field public static final int BUFFER_FLAG_PARTIAL_FRAME = 8; // 0x8
    field @Deprecated public static final int BUFFER_FLAG_SYNC_FRAME = 1; // 0x1
    field public static final int CONFIGURE_FLAG_ENCODE = 1; // 0x1
    field public static final int CRYPTO_MODE_AES_CBC = 2; // 0x2
    field public static final int CRYPTO_MODE_AES_CTR = 1; // 0x1
    field public static final int CRYPTO_MODE_UNENCRYPTED = 0; // 0x0
    field @Deprecated public static final int INFO_OUTPUT_BUFFERS_CHANGED = -3; // 0xfffffffd
    field public static final int INFO_OUTPUT_FORMAT_CHANGED = -2; // 0xfffffffe
    field public static final int INFO_TRY_AGAIN_LATER = -1; // 0xffffffff
    field public static final String PARAMETER_KEY_REQUEST_SYNC_FRAME = "request-sync";
    field public static final String PARAMETER_KEY_SUSPEND = "drop-input-frames";
    field public static final String PARAMETER_KEY_VIDEO_BITRATE = "video-bitrate";
    field public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT = 1; // 0x1
    field public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING = 2; // 0x2
  }

  public static final class MediaCodec.BufferInfo {
    ctor public MediaCodec.BufferInfo();
    method public void set(int, int, long, int);
    field public int flags;
    field public int offset;
    field public long presentationTimeUs;
    field public int size;
  }

  public abstract static class MediaCodec.Callback {
    ctor public MediaCodec.Callback();
    method public abstract void onError(@NonNull android.media.MediaCodec, @NonNull android.media.MediaCodec.CodecException);
    method public abstract void onInputBufferAvailable(@NonNull android.media.MediaCodec, int);
    method public abstract void onOutputBufferAvailable(@NonNull android.media.MediaCodec, int, @NonNull android.media.MediaCodec.BufferInfo);
    method public abstract void onOutputFormatChanged(@NonNull android.media.MediaCodec, @NonNull android.media.MediaFormat);
  }

  public static final class MediaCodec.CodecException extends java.lang.IllegalStateException {
    method @NonNull public String getDiagnosticInfo();
    method public int getErrorCode();
    method public boolean isRecoverable();
    method public boolean isTransient();
    field public static final int ERROR_INSUFFICIENT_RESOURCE = 1100; // 0x44c
    field public static final int ERROR_RECLAIMED = 1101; // 0x44d
  }

  public static final class MediaCodec.CryptoException extends java.lang.RuntimeException {
    ctor public MediaCodec.CryptoException(int, @Nullable String);
    method public int getErrorCode();
    field public static final int ERROR_INSUFFICIENT_OUTPUT_PROTECTION = 4; // 0x4
    field public static final int ERROR_KEY_EXPIRED = 2; // 0x2
    field public static final int ERROR_NO_KEY = 1; // 0x1
    field public static final int ERROR_RESOURCE_BUSY = 3; // 0x3
    field public static final int ERROR_SESSION_NOT_OPENED = 5; // 0x5
    field public static final int ERROR_UNSUPPORTED_OPERATION = 6; // 0x6
  }

  public static final class MediaCodec.CryptoInfo {
    ctor public MediaCodec.CryptoInfo();
    method public void set(int, @NonNull int[], @NonNull int[], @NonNull byte[], @NonNull byte[], int);
    method public void setPattern(android.media.MediaCodec.CryptoInfo.Pattern);
    field public byte[] iv;
    field public byte[] key;
    field public int mode;
    field public int[] numBytesOfClearData;
    field public int[] numBytesOfEncryptedData;
    field public int numSubSamples;
  }

  public static final class MediaCodec.CryptoInfo.Pattern {
    ctor public MediaCodec.CryptoInfo.Pattern(int, int);
    method public int getEncryptBlocks();
    method public int getSkipBlocks();
    method public void set(int, int);
  }

  public static final class MediaCodec.MetricsConstants {
    field public static final String CODEC = "android.media.mediacodec.codec";
    field public static final String ENCODER = "android.media.mediacodec.encoder";
    field public static final String HEIGHT = "android.media.mediacodec.height";
    field public static final String MIME_TYPE = "android.media.mediacodec.mime";
    field public static final String MODE = "android.media.mediacodec.mode";
    field public static final String MODE_AUDIO = "audio";
    field public static final String MODE_VIDEO = "video";
    field public static final String ROTATION = "android.media.mediacodec.rotation";
    field public static final String SECURE = "android.media.mediacodec.secure";
    field public static final String WIDTH = "android.media.mediacodec.width";
  }

  public static interface MediaCodec.OnFrameRenderedListener {
    method public void onFrameRendered(@NonNull android.media.MediaCodec, long, long);
  }

  public final class MediaCodecInfo {
    method public android.media.MediaCodecInfo.CodecCapabilities getCapabilitiesForType(String);
    method public String getName();
    method public String[] getSupportedTypes();
    method public boolean isEncoder();
  }

  public static final class MediaCodecInfo.AudioCapabilities {
    method public android.util.Range<java.lang.Integer> getBitrateRange();
    method public int getMaxInputChannelCount();
    method public android.util.Range<java.lang.Integer>[] getSupportedSampleRateRanges();
    method public int[] getSupportedSampleRates();
    method public boolean isSampleRateSupported(int);
  }

  public static final class MediaCodecInfo.CodecCapabilities {
    ctor public MediaCodecInfo.CodecCapabilities();
    method public static android.media.MediaCodecInfo.CodecCapabilities createFromProfileLevel(String, int, int);
    method public android.media.MediaCodecInfo.AudioCapabilities getAudioCapabilities();
    method public android.media.MediaFormat getDefaultFormat();
    method public android.media.MediaCodecInfo.EncoderCapabilities getEncoderCapabilities();
    method public int getMaxSupportedInstances();
    method public String getMimeType();
    method public android.media.MediaCodecInfo.VideoCapabilities getVideoCapabilities();
    method public boolean isFeatureRequired(String);
    method public boolean isFeatureSupported(String);
    method public boolean isFormatSupported(android.media.MediaFormat);
    field @Deprecated public static final int COLOR_Format12bitRGB444 = 3; // 0x3
    field @Deprecated public static final int COLOR_Format16bitARGB1555 = 5; // 0x5
    field @Deprecated public static final int COLOR_Format16bitARGB4444 = 4; // 0x4
    field @Deprecated public static final int COLOR_Format16bitBGR565 = 7; // 0x7
    field public static final int COLOR_Format16bitRGB565 = 6; // 0x6
    field @Deprecated public static final int COLOR_Format18BitBGR666 = 41; // 0x29
    field @Deprecated public static final int COLOR_Format18bitARGB1665 = 9; // 0x9
    field @Deprecated public static final int COLOR_Format18bitRGB666 = 8; // 0x8
    field @Deprecated public static final int COLOR_Format19bitARGB1666 = 10; // 0xa
    field @Deprecated public static final int COLOR_Format24BitABGR6666 = 43; // 0x2b
    field @Deprecated public static final int COLOR_Format24BitARGB6666 = 42; // 0x2a
    field @Deprecated public static final int COLOR_Format24bitARGB1887 = 13; // 0xd
    field public static final int COLOR_Format24bitBGR888 = 12; // 0xc
    field @Deprecated public static final int COLOR_Format24bitRGB888 = 11; // 0xb
    field @Deprecated public static final int COLOR_Format25bitARGB1888 = 14; // 0xe
    field public static final int COLOR_Format32bitABGR8888 = 2130747392; // 0x7f00a000
    field @Deprecated public static final int COLOR_Format32bitARGB8888 = 16; // 0x10
    field @Deprecated public static final int COLOR_Format32bitBGRA8888 = 15; // 0xf
    field @Deprecated public static final int COLOR_Format8bitRGB332 = 2; // 0x2
    field @Deprecated public static final int COLOR_FormatCbYCrY = 27; // 0x1b
    field @Deprecated public static final int COLOR_FormatCrYCbY = 28; // 0x1c
    field public static final int COLOR_FormatL16 = 36; // 0x24
    field @Deprecated public static final int COLOR_FormatL2 = 33; // 0x21
    field @Deprecated public static final int COLOR_FormatL24 = 37; // 0x25
    field @Deprecated public static final int COLOR_FormatL32 = 38; // 0x26
    field @Deprecated public static final int COLOR_FormatL4 = 34; // 0x22
    field public static final int COLOR_FormatL8 = 35; // 0x23
    field @Deprecated public static final int COLOR_FormatMonochrome = 1; // 0x1
    field public static final int COLOR_FormatRGBAFlexible = 2134288520; // 0x7f36a888
    field public static final int COLOR_FormatRGBFlexible = 2134292616; // 0x7f36b888
    field public static final int COLOR_FormatRawBayer10bit = 31; // 0x1f
    field public static final int COLOR_FormatRawBayer8bit = 30; // 0x1e
    field public static final int COLOR_FormatRawBayer8bitcompressed = 32; // 0x20
    field public static final int COLOR_FormatSurface = 2130708361; // 0x7f000789
    field @Deprecated public static final int COLOR_FormatYCbYCr = 25; // 0x19
    field @Deprecated public static final int COLOR_FormatYCrYCb = 26; // 0x1a
    field @Deprecated public static final int COLOR_FormatYUV411PackedPlanar = 18; // 0x12
    field @Deprecated public static final int COLOR_FormatYUV411Planar = 17; // 0x11
    field public static final int COLOR_FormatYUV420Flexible = 2135033992; // 0x7f420888
    field @Deprecated public static final int COLOR_FormatYUV420PackedPlanar = 20; // 0x14
    field @Deprecated public static final int COLOR_FormatYUV420PackedSemiPlanar = 39; // 0x27
    field @Deprecated public static final int COLOR_FormatYUV420Planar = 19; // 0x13
    field @Deprecated public static final int COLOR_FormatYUV420SemiPlanar = 21; // 0x15
    field public static final int COLOR_FormatYUV422Flexible = 2135042184; // 0x7f422888
    field @Deprecated public static final int COLOR_FormatYUV422PackedPlanar = 23; // 0x17
    field @Deprecated public static final int COLOR_FormatYUV422PackedSemiPlanar = 40; // 0x28
    field @Deprecated public static final int COLOR_FormatYUV422Planar = 22; // 0x16
    field @Deprecated public static final int COLOR_FormatYUV422SemiPlanar = 24; // 0x18
    field public static final int COLOR_FormatYUV444Flexible = 2135181448; // 0x7f444888
    field @Deprecated public static final int COLOR_FormatYUV444Interleaved = 29; // 0x1d
    field @Deprecated public static final int COLOR_QCOM_FormatYUV420SemiPlanar = 2141391872; // 0x7fa30c00
    field @Deprecated public static final int COLOR_TI_FormatYUV420PackedSemiPlanar = 2130706688; // 0x7f000100
    field public static final String FEATURE_AdaptivePlayback = "adaptive-playback";
    field public static final String FEATURE_IntraRefresh = "intra-refresh";
    field public static final String FEATURE_PartialFrame = "partial-frame";
    field public static final String FEATURE_SecurePlayback = "secure-playback";
    field public static final String FEATURE_TunneledPlayback = "tunneled-playback";
    field public int[] colorFormats;
    field public android.media.MediaCodecInfo.CodecProfileLevel[] profileLevels;
  }

  public static final class MediaCodecInfo.CodecProfileLevel {
    ctor public MediaCodecInfo.CodecProfileLevel();
    field public static final int AACObjectELD = 39; // 0x27
    field public static final int AACObjectERLC = 17; // 0x11
    field public static final int AACObjectERScalable = 20; // 0x14
    field public static final int AACObjectHE = 5; // 0x5
    field public static final int AACObjectHE_PS = 29; // 0x1d
    field public static final int AACObjectLC = 2; // 0x2
    field public static final int AACObjectLD = 23; // 0x17
    field public static final int AACObjectLTP = 4; // 0x4
    field public static final int AACObjectMain = 1; // 0x1
    field public static final int AACObjectSSR = 3; // 0x3
    field public static final int AACObjectScalable = 6; // 0x6
    field public static final int AACObjectXHE = 42; // 0x2a
    field public static final int AVCLevel1 = 1; // 0x1
    field public static final int AVCLevel11 = 4; // 0x4
    field public static final int AVCLevel12 = 8; // 0x8
    field public static final int AVCLevel13 = 16; // 0x10
    field public static final int AVCLevel1b = 2; // 0x2
    field public static final int AVCLevel2 = 32; // 0x20
    field public static final int AVCLevel21 = 64; // 0x40
    field public static final int AVCLevel22 = 128; // 0x80
    field public static final int AVCLevel3 = 256; // 0x100
    field public static final int AVCLevel31 = 512; // 0x200
    field public static final int AVCLevel32 = 1024; // 0x400
    field public static final int AVCLevel4 = 2048; // 0x800
    field public static final int AVCLevel41 = 4096; // 0x1000
    field public static final int AVCLevel42 = 8192; // 0x2000
    field public static final int AVCLevel5 = 16384; // 0x4000
    field public static final int AVCLevel51 = 32768; // 0x8000
    field public static final int AVCLevel52 = 65536; // 0x10000
    field public static final int AVCProfileBaseline = 1; // 0x1
    field public static final int AVCProfileConstrainedBaseline = 65536; // 0x10000
    field public static final int AVCProfileConstrainedHigh = 524288; // 0x80000
    field public static final int AVCProfileExtended = 4; // 0x4
    field public static final int AVCProfileHigh = 8; // 0x8
    field public static final int AVCProfileHigh10 = 16; // 0x10
    field public static final int AVCProfileHigh422 = 32; // 0x20
    field public static final int AVCProfileHigh444 = 64; // 0x40
    field public static final int AVCProfileMain = 2; // 0x2
    field public static final int DolbyVisionLevelFhd24 = 4; // 0x4
    field public static final int DolbyVisionLevelFhd30 = 8; // 0x8
    field public static final int DolbyVisionLevelFhd60 = 16; // 0x10
    field public static final int DolbyVisionLevelHd24 = 1; // 0x1
    field public static final int DolbyVisionLevelHd30 = 2; // 0x2
    field public static final int DolbyVisionLevelUhd24 = 32; // 0x20
    field public static final int DolbyVisionLevelUhd30 = 64; // 0x40
    field public static final int DolbyVisionLevelUhd48 = 128; // 0x80
    field public static final int DolbyVisionLevelUhd60 = 256; // 0x100
    field public static final int DolbyVisionProfileDvavPen = 2; // 0x2
    field public static final int DolbyVisionProfileDvavPer = 1; // 0x1
    field public static final int DolbyVisionProfileDvavSe = 512; // 0x200
    field public static final int DolbyVisionProfileDvheDen = 8; // 0x8
    field public static final int DolbyVisionProfileDvheDer = 4; // 0x4
    field public static final int DolbyVisionProfileDvheDtb = 128; // 0x80
    field public static final int DolbyVisionProfileDvheDth = 64; // 0x40
    field public static final int DolbyVisionProfileDvheDtr = 16; // 0x10
    field public static final int DolbyVisionProfileDvheSt = 256; // 0x100
    field public static final int DolbyVisionProfileDvheStn = 32; // 0x20
    field public static final int H263Level10 = 1; // 0x1
    field public static final int H263Level20 = 2; // 0x2
    field public static final int H263Level30 = 4; // 0x4
    field public static final int H263Level40 = 8; // 0x8
    field public static final int H263Level45 = 16; // 0x10
    field public static final int H263Level50 = 32; // 0x20
    field public static final int H263Level60 = 64; // 0x40
    field public static final int H263Level70 = 128; // 0x80
    field public static final int H263ProfileBackwardCompatible = 4; // 0x4
    field public static final int H263ProfileBaseline = 1; // 0x1
    field public static final int H263ProfileH320Coding = 2; // 0x2
    field public static final int H263ProfileHighCompression = 32; // 0x20
    field public static final int H263ProfileHighLatency = 256; // 0x100
    field public static final int H263ProfileISWV2 = 8; // 0x8
    field public static final int H263ProfileISWV3 = 16; // 0x10
    field public static final int H263ProfileInterlace = 128; // 0x80
    field public static final int H263ProfileInternet = 64; // 0x40
    field public static final int HEVCHighTierLevel1 = 2; // 0x2
    field public static final int HEVCHighTierLevel2 = 8; // 0x8
    field public static final int HEVCHighTierLevel21 = 32; // 0x20
    field public static final int HEVCHighTierLevel3 = 128; // 0x80
    field public static final int HEVCHighTierLevel31 = 512; // 0x200
    field public static final int HEVCHighTierLevel4 = 2048; // 0x800
    field public static final int HEVCHighTierLevel41 = 8192; // 0x2000
    field public static final int HEVCHighTierLevel5 = 32768; // 0x8000
    field public static final int HEVCHighTierLevel51 = 131072; // 0x20000
    field public static final int HEVCHighTierLevel52 = 524288; // 0x80000
    field public static final int HEVCHighTierLevel6 = 2097152; // 0x200000
    field public static final int HEVCHighTierLevel61 = 8388608; // 0x800000
    field public static final int HEVCHighTierLevel62 = 33554432; // 0x2000000
    field public static final int HEVCMainTierLevel1 = 1; // 0x1
    field public static final int HEVCMainTierLevel2 = 4; // 0x4
    field public static final int HEVCMainTierLevel21 = 16; // 0x10
    field public static final int HEVCMainTierLevel3 = 64; // 0x40
    field public static final int HEVCMainTierLevel31 = 256; // 0x100
    field public static final int HEVCMainTierLevel4 = 1024; // 0x400
    field public static final int HEVCMainTierLevel41 = 4096; // 0x1000
    field public static final int HEVCMainTierLevel5 = 16384; // 0x4000
    field public static final int HEVCMainTierLevel51 = 65536; // 0x10000
    field public static final int HEVCMainTierLevel52 = 262144; // 0x40000
    field public static final int HEVCMainTierLevel6 = 1048576; // 0x100000
    field public static final int HEVCMainTierLevel61 = 4194304; // 0x400000
    field public static final int HEVCMainTierLevel62 = 16777216; // 0x1000000
    field public static final int HEVCProfileMain = 1; // 0x1
    field public static final int HEVCProfileMain10 = 2; // 0x2
    field public static final int HEVCProfileMain10HDR10 = 4096; // 0x1000
    field public static final int HEVCProfileMainStill = 4; // 0x4
    field public static final int MPEG2LevelH14 = 2; // 0x2
    field public static final int MPEG2LevelHL = 3; // 0x3
    field public static final int MPEG2LevelHP = 4; // 0x4
    field public static final int MPEG2LevelLL = 0; // 0x0
    field public static final int MPEG2LevelML = 1; // 0x1
    field public static final int MPEG2Profile422 = 2; // 0x2
    field public static final int MPEG2ProfileHigh = 5; // 0x5
    field public static final int MPEG2ProfileMain = 1; // 0x1
    field public static final int MPEG2ProfileSNR = 3; // 0x3
    field public static final int MPEG2ProfileSimple = 0; // 0x0
    field public static final int MPEG2ProfileSpatial = 4; // 0x4
    field public static final int MPEG4Level0 = 1; // 0x1
    field public static final int MPEG4Level0b = 2; // 0x2
    field public static final int MPEG4Level1 = 4; // 0x4
    field public static final int MPEG4Level2 = 8; // 0x8
    field public static final int MPEG4Level3 = 16; // 0x10
    field public static final int MPEG4Level3b = 24; // 0x18
    field public static final int MPEG4Level4 = 32; // 0x20
    field public static final int MPEG4Level4a = 64; // 0x40
    field public static final int MPEG4Level5 = 128; // 0x80
    field public static final int MPEG4Level6 = 256; // 0x100
    field public static final int MPEG4ProfileAdvancedCoding = 4096; // 0x1000
    field public static final int MPEG4ProfileAdvancedCore = 8192; // 0x2000
    field public static final int MPEG4ProfileAdvancedRealTime = 1024; // 0x400
    field public static final int MPEG4ProfileAdvancedScalable = 16384; // 0x4000
    field public static final int MPEG4ProfileAdvancedSimple = 32768; // 0x8000
    field public static final int MPEG4ProfileBasicAnimated = 256; // 0x100
    field public static final int MPEG4ProfileCore = 4; // 0x4
    field public static final int MPEG4ProfileCoreScalable = 2048; // 0x800
    field public static final int MPEG4ProfileHybrid = 512; // 0x200
    field public static final int MPEG4ProfileMain = 8; // 0x8
    field public static final int MPEG4ProfileNbit = 16; // 0x10
    field public static final int MPEG4ProfileScalableTexture = 32; // 0x20
    field public static final int MPEG4ProfileSimple = 1; // 0x1
    field public static final int MPEG4ProfileSimpleFBA = 128; // 0x80
    field public static final int MPEG4ProfileSimpleFace = 64; // 0x40
    field public static final int MPEG4ProfileSimpleScalable = 2; // 0x2
    field public static final int VP8Level_Version0 = 1; // 0x1
    field public static final int VP8Level_Version1 = 2; // 0x2
    field public static final int VP8Level_Version2 = 4; // 0x4
    field public static final int VP8Level_Version3 = 8; // 0x8
    field public static final int VP8ProfileMain = 1; // 0x1
    field public static final int VP9Level1 = 1; // 0x1
    field public static final int VP9Level11 = 2; // 0x2
    field public static final int VP9Level2 = 4; // 0x4
    field public static final int VP9Level21 = 8; // 0x8
    field public static final int VP9Level3 = 16; // 0x10
    field public static final int VP9Level31 = 32; // 0x20
    field public static final int VP9Level4 = 64; // 0x40
    field public static final int VP9Level41 = 128; // 0x80
    field public static final int VP9Level5 = 256; // 0x100
    field public static final int VP9Level51 = 512; // 0x200
    field public static final int VP9Level52 = 1024; // 0x400
    field public static final int VP9Level6 = 2048; // 0x800
    field public static final int VP9Level61 = 4096; // 0x1000
    field public static final int VP9Level62 = 8192; // 0x2000
    field public static final int VP9Profile0 = 1; // 0x1
    field public static final int VP9Profile1 = 2; // 0x2
    field public static final int VP9Profile2 = 4; // 0x4
    field public static final int VP9Profile2HDR = 4096; // 0x1000
    field public static final int VP9Profile3 = 8; // 0x8
    field public static final int VP9Profile3HDR = 8192; // 0x2000
    field public int level;
    field public int profile;
  }

  public static final class MediaCodecInfo.EncoderCapabilities {
    method public android.util.Range<java.lang.Integer> getComplexityRange();
    method public android.util.Range<java.lang.Integer> getQualityRange();
    method public boolean isBitrateModeSupported(int);
    field public static final int BITRATE_MODE_CBR = 2; // 0x2
    field public static final int BITRATE_MODE_CQ = 0; // 0x0
    field public static final int BITRATE_MODE_VBR = 1; // 0x1
  }

  public static final class MediaCodecInfo.VideoCapabilities {
    method public boolean areSizeAndRateSupported(int, int, double);
    method @Nullable public android.util.Range<java.lang.Double> getAchievableFrameRatesFor(int, int);
    method public android.util.Range<java.lang.Integer> getBitrateRange();
    method public int getHeightAlignment();
    method public android.util.Range<java.lang.Integer> getSupportedFrameRates();
    method public android.util.Range<java.lang.Double> getSupportedFrameRatesFor(int, int);
    method public android.util.Range<java.lang.Integer> getSupportedHeights();
    method public android.util.Range<java.lang.Integer> getSupportedHeightsFor(int);
    method public android.util.Range<java.lang.Integer> getSupportedWidths();
    method public android.util.Range<java.lang.Integer> getSupportedWidthsFor(int);
    method public int getWidthAlignment();
    method public boolean isSizeSupported(int, int);
  }

  public final class MediaCodecList {
    ctor public MediaCodecList(int);
    method public String findDecoderForFormat(android.media.MediaFormat);
    method public String findEncoderForFormat(android.media.MediaFormat);
    method @Deprecated public static int getCodecCount();
    method @Deprecated public static android.media.MediaCodecInfo getCodecInfoAt(int);
    method public android.media.MediaCodecInfo[] getCodecInfos();
    field public static final int ALL_CODECS = 1; // 0x1
    field public static final int REGULAR_CODECS = 0; // 0x0
  }

  public final class MediaCrypto {
    ctor public MediaCrypto(@NonNull java.util.UUID, @NonNull byte[]) throws android.media.MediaCryptoException;
    method protected void finalize();
    method public static boolean isCryptoSchemeSupported(@NonNull java.util.UUID);
    method public void release();
    method public boolean requiresSecureDecoderComponent(@NonNull String);
    method public void setMediaDrmSession(@NonNull byte[]) throws android.media.MediaCryptoException;
  }

  public final class MediaCryptoException extends java.lang.Exception {
    ctor public MediaCryptoException(@Nullable String);
  }

  public abstract class MediaDataSource implements java.io.Closeable {
    ctor public MediaDataSource();
    method public abstract long getSize() throws java.io.IOException;
    method public abstract int readAt(long, byte[], int, int) throws java.io.IOException;
  }

  public final class MediaDescrambler implements java.lang.AutoCloseable {
    ctor public MediaDescrambler(int) throws android.media.MediaCasException.UnsupportedCasException;
    method public void close();
    method public int descramble(@NonNull java.nio.ByteBuffer, @NonNull java.nio.ByteBuffer, @NonNull android.media.MediaCodec.CryptoInfo);
    method protected void finalize();
    method public boolean requiresSecureDecoderComponent(@NonNull String);
    method public void setMediaCasSession(@NonNull android.media.MediaCas.Session);
    field public static final byte SCRAMBLE_CONTROL_EVEN_KEY = 2; // 0x2
    field public static final byte SCRAMBLE_CONTROL_ODD_KEY = 3; // 0x3
    field public static final byte SCRAMBLE_CONTROL_RESERVED = 1; // 0x1
    field public static final byte SCRAMBLE_CONTROL_UNSCRAMBLED = 0; // 0x0
    field public static final byte SCRAMBLE_FLAG_PES_HEADER = 1; // 0x1
  }

  public class MediaDescription implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public CharSequence getDescription();
    method @Nullable public android.os.Bundle getExtras();
    method @Nullable public android.graphics.Bitmap getIconBitmap();
    method @Nullable public android.net.Uri getIconUri();
    method @Nullable public String getMediaId();
    method @Nullable public android.net.Uri getMediaUri();
    method @Nullable public CharSequence getSubtitle();
    method @Nullable public CharSequence getTitle();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final long BT_FOLDER_TYPE_ALBUMS = 2L; // 0x2L
    field public static final long BT_FOLDER_TYPE_ARTISTS = 3L; // 0x3L
    field public static final long BT_FOLDER_TYPE_GENRES = 4L; // 0x4L
    field public static final long BT_FOLDER_TYPE_MIXED = 0L; // 0x0L
    field public static final long BT_FOLDER_TYPE_PLAYLISTS = 5L; // 0x5L
    field public static final long BT_FOLDER_TYPE_TITLES = 1L; // 0x1L
    field public static final long BT_FOLDER_TYPE_YEARS = 6L; // 0x6L
    field public static final android.os.Parcelable.Creator<android.media.MediaDescription> CREATOR;
    field public static final String EXTRA_BT_FOLDER_TYPE = "android.media.extra.BT_FOLDER_TYPE";
  }

  public static class MediaDescription.Builder {
    ctor public MediaDescription.Builder();
    method public android.media.MediaDescription build();
    method public android.media.MediaDescription.Builder setDescription(@Nullable CharSequence);
    method public android.media.MediaDescription.Builder setExtras(@Nullable android.os.Bundle);
    method public android.media.MediaDescription.Builder setIconBitmap(@Nullable android.graphics.Bitmap);
    method public android.media.MediaDescription.Builder setIconUri(@Nullable android.net.Uri);
    method public android.media.MediaDescription.Builder setMediaId(@Nullable String);
    method public android.media.MediaDescription.Builder setMediaUri(@Nullable android.net.Uri);
    method public android.media.MediaDescription.Builder setSubtitle(@Nullable CharSequence);
    method public android.media.MediaDescription.Builder setTitle(@Nullable CharSequence);
  }

  public final class MediaDrm implements java.lang.AutoCloseable {
    ctor public MediaDrm(@NonNull java.util.UUID) throws android.media.UnsupportedSchemeException;
    method public void close();
    method public void closeSession(@NonNull byte[]);
    method @android.media.MediaDrm.HdcpLevel public int getConnectedHdcpLevel();
    method public android.media.MediaDrm.CryptoSession getCryptoSession(@NonNull byte[], @NonNull String, @NonNull String);
    method @NonNull public android.media.MediaDrm.KeyRequest getKeyRequest(@NonNull byte[], @Nullable byte[], @Nullable String, int, @Nullable java.util.HashMap<java.lang.String,java.lang.String>) throws android.media.NotProvisionedException;
    method @android.media.MediaDrm.HdcpLevel public int getMaxHdcpLevel();
    method @android.media.MediaDrm.SecurityLevel public static int getMaxSecurityLevel();
    method public int getMaxSessionCount();
    method public android.os.PersistableBundle getMetrics();
    method public int getOpenSessionCount();
    method @NonNull public byte[] getPropertyByteArray(String);
    method @NonNull public String getPropertyString(@NonNull String);
    method @NonNull public android.media.MediaDrm.ProvisionRequest getProvisionRequest();
    method @NonNull public byte[] getSecureStop(@NonNull byte[]);
    method @NonNull public java.util.List<byte[]> getSecureStopIds();
    method @NonNull public java.util.List<byte[]> getSecureStops();
    method @android.media.MediaDrm.SecurityLevel public int getSecurityLevel(@NonNull byte[]);
    method public static boolean isCryptoSchemeSupported(@NonNull java.util.UUID);
    method public static boolean isCryptoSchemeSupported(@NonNull java.util.UUID, @NonNull String);
    method @NonNull public byte[] openSession() throws android.media.NotProvisionedException, android.media.ResourceBusyException;
    method @NonNull public byte[] openSession(@android.media.MediaDrm.SecurityLevel int) throws android.media.NotProvisionedException, android.media.ResourceBusyException;
    method @Nullable public byte[] provideKeyResponse(@NonNull byte[], @NonNull byte[]) throws android.media.DeniedByServerException, android.media.NotProvisionedException;
    method public void provideProvisionResponse(@NonNull byte[]) throws android.media.DeniedByServerException;
    method @NonNull public java.util.HashMap<java.lang.String,java.lang.String> queryKeyStatus(@NonNull byte[]);
    method @Deprecated public void release();
    method @Deprecated public void releaseAllSecureStops();
    method public void releaseSecureStops(@NonNull byte[]);
    method public void removeAllSecureStops();
    method public void removeKeys(@NonNull byte[]);
    method public void removeSecureStop(@NonNull byte[]);
    method public void restoreKeys(@NonNull byte[], @NonNull byte[]);
    method public void setOnEventListener(@Nullable android.media.MediaDrm.OnEventListener);
    method public void setOnExpirationUpdateListener(@Nullable android.media.MediaDrm.OnExpirationUpdateListener, @Nullable android.os.Handler);
    method public void setOnKeyStatusChangeListener(@Nullable android.media.MediaDrm.OnKeyStatusChangeListener, @Nullable android.os.Handler);
    method public void setPropertyByteArray(@NonNull String, @NonNull byte[]);
    method public void setPropertyString(@NonNull String, @NonNull String);
    field @Deprecated public static final int EVENT_KEY_EXPIRED = 3; // 0x3
    field public static final int EVENT_KEY_REQUIRED = 2; // 0x2
    field @Deprecated public static final int EVENT_PROVISION_REQUIRED = 1; // 0x1
    field public static final int EVENT_SESSION_RECLAIMED = 5; // 0x5
    field public static final int EVENT_VENDOR_DEFINED = 4; // 0x4
    field public static final int HDCP_LEVEL_UNKNOWN = 0; // 0x0
    field public static final int HDCP_NONE = 1; // 0x1
    field public static final int HDCP_NO_DIGITAL_OUTPUT = 2147483647; // 0x7fffffff
    field public static final int HDCP_V1 = 2; // 0x2
    field public static final int HDCP_V2 = 3; // 0x3
    field public static final int HDCP_V2_1 = 4; // 0x4
    field public static final int HDCP_V2_2 = 5; // 0x5
    field public static final int KEY_TYPE_OFFLINE = 2; // 0x2
    field public static final int KEY_TYPE_RELEASE = 3; // 0x3
    field public static final int KEY_TYPE_STREAMING = 1; // 0x1
    field public static final String PROPERTY_ALGORITHMS = "algorithms";
    field public static final String PROPERTY_DESCRIPTION = "description";
    field public static final String PROPERTY_DEVICE_UNIQUE_ID = "deviceUniqueId";
    field public static final String PROPERTY_VENDOR = "vendor";
    field public static final String PROPERTY_VERSION = "version";
    field public static final int SECURITY_LEVEL_HW_SECURE_ALL = 5; // 0x5
    field public static final int SECURITY_LEVEL_HW_SECURE_CRYPTO = 3; // 0x3
    field public static final int SECURITY_LEVEL_HW_SECURE_DECODE = 4; // 0x4
    field public static final int SECURITY_LEVEL_SW_SECURE_CRYPTO = 1; // 0x1
    field public static final int SECURITY_LEVEL_SW_SECURE_DECODE = 2; // 0x2
    field public static final int SECURITY_LEVEL_UNKNOWN = 0; // 0x0
  }

  public final class MediaDrm.CryptoSession {
    method @NonNull public byte[] decrypt(@NonNull byte[], @NonNull byte[], @NonNull byte[]);
    method @NonNull public byte[] encrypt(@NonNull byte[], @NonNull byte[], @NonNull byte[]);
    method @NonNull public byte[] sign(@NonNull byte[], @NonNull byte[]);
    method public boolean verify(@NonNull byte[], @NonNull byte[], @NonNull byte[]);
  }

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({android.media.MediaDrm.HDCP_LEVEL_UNKNOWN, android.media.MediaDrm.HDCP_NONE, android.media.MediaDrm.HDCP_V1, android.media.MediaDrm.HDCP_V2, android.media.MediaDrm.HDCP_V2_1, android.media.MediaDrm.HDCP_V2_2, android.media.MediaDrm.HDCP_NO_DIGITAL_OUTPUT}) public static @interface MediaDrm.HdcpLevel {
  }

  public static final class MediaDrm.KeyRequest {
    method @NonNull public byte[] getData();
    method @NonNull public String getDefaultUrl();
    method public int getRequestType();
    field public static final int REQUEST_TYPE_INITIAL = 0; // 0x0
    field public static final int REQUEST_TYPE_NONE = 3; // 0x3
    field public static final int REQUEST_TYPE_RELEASE = 2; // 0x2
    field public static final int REQUEST_TYPE_RENEWAL = 1; // 0x1
    field public static final int REQUEST_TYPE_UPDATE = 4; // 0x4
  }

  public static final class MediaDrm.KeyStatus {
    method @NonNull public byte[] getKeyId();
    method public int getStatusCode();
    field public static final int STATUS_EXPIRED = 1; // 0x1
    field public static final int STATUS_INTERNAL_ERROR = 4; // 0x4
    field public static final int STATUS_OUTPUT_NOT_ALLOWED = 2; // 0x2
    field public static final int STATUS_PENDING = 3; // 0x3
    field public static final int STATUS_USABLE = 0; // 0x0
  }

  public static final class MediaDrm.MediaDrmStateException extends java.lang.IllegalStateException {
    method @NonNull public String getDiagnosticInfo();
  }

  public static final class MediaDrm.MetricsConstants {
    field public static final String CLOSE_SESSION_ERROR_COUNT = "drm.mediadrm.close_session.error.count";
    field public static final String CLOSE_SESSION_ERROR_LIST = "drm.mediadrm.close_session.error.list";
    field public static final String CLOSE_SESSION_OK_COUNT = "drm.mediadrm.close_session.ok.count";
    field public static final String EVENT_KEY_EXPIRED_COUNT = "drm.mediadrm.event.KEY_EXPIRED.count";
    field public static final String EVENT_KEY_NEEDED_COUNT = "drm.mediadrm.event.KEY_NEEDED.count";
    field public static final String EVENT_PROVISION_REQUIRED_COUNT = "drm.mediadrm.event.PROVISION_REQUIRED.count";
    field public static final String EVENT_SESSION_RECLAIMED_COUNT = "drm.mediadrm.event.SESSION_RECLAIMED.count";
    field public static final String EVENT_VENDOR_DEFINED_COUNT = "drm.mediadrm.event.VENDOR_DEFINED.count";
    field public static final String GET_DEVICE_UNIQUE_ID_ERROR_COUNT = "drm.mediadrm.get_device_unique_id.error.count";
    field public static final String GET_DEVICE_UNIQUE_ID_ERROR_LIST = "drm.mediadrm.get_device_unique_id.error.list";
    field public static final String GET_DEVICE_UNIQUE_ID_OK_COUNT = "drm.mediadrm.get_device_unique_id.ok.count";
    field public static final String GET_KEY_REQUEST_ERROR_COUNT = "drm.mediadrm.get_key_request.error.count";
    field public static final String GET_KEY_REQUEST_ERROR_LIST = "drm.mediadrm.get_key_request.error.list";
    field public static final String GET_KEY_REQUEST_OK_COUNT = "drm.mediadrm.get_key_request.ok.count";
    field public static final String GET_KEY_REQUEST_OK_TIME_MICROS = "drm.mediadrm.get_key_request.ok.average_time_micros";
    field public static final String GET_PROVISION_REQUEST_ERROR_COUNT = "drm.mediadrm.get_provision_request.error.count";
    field public static final String GET_PROVISION_REQUEST_ERROR_LIST = "drm.mediadrm.get_provision_request.error.list";
    field public static final String GET_PROVISION_REQUEST_OK_COUNT = "drm.mediadrm.get_provision_request.ok.count";
    field public static final String KEY_STATUS_EXPIRED_COUNT = "drm.mediadrm.key_status.EXPIRED.count";
    field public static final String KEY_STATUS_INTERNAL_ERROR_COUNT = "drm.mediadrm.key_status.INTERNAL_ERROR.count";
    field public static final String KEY_STATUS_OUTPUT_NOT_ALLOWED_COUNT = "drm.mediadrm.key_status_change.OUTPUT_NOT_ALLOWED.count";
    field public static final String KEY_STATUS_PENDING_COUNT = "drm.mediadrm.key_status_change.PENDING.count";
    field public static final String KEY_STATUS_USABLE_COUNT = "drm.mediadrm.key_status_change.USABLE.count";
    field public static final String OPEN_SESSION_ERROR_COUNT = "drm.mediadrm.open_session.error.count";
    field public static final String OPEN_SESSION_ERROR_LIST = "drm.mediadrm.open_session.error.list";
    field public static final String OPEN_SESSION_OK_COUNT = "drm.mediadrm.open_session.ok.count";
    field public static final String PROVIDE_KEY_RESPONSE_ERROR_COUNT = "drm.mediadrm.provide_key_response.error.count";
    field public static final String PROVIDE_KEY_RESPONSE_ERROR_LIST = "drm.mediadrm.provide_key_response.error.list";
    field public static final String PROVIDE_KEY_RESPONSE_OK_COUNT = "drm.mediadrm.provide_key_response.ok.count";
    field public static final String PROVIDE_KEY_RESPONSE_OK_TIME_MICROS = "drm.mediadrm.provide_key_response.ok.average_time_micros";
    field public static final String PROVIDE_PROVISION_RESPONSE_ERROR_COUNT = "drm.mediadrm.provide_provision_response.error.count";
    field public static final String PROVIDE_PROVISION_RESPONSE_ERROR_LIST = "drm.mediadrm.provide_provision_response.error.list";
    field public static final String PROVIDE_PROVISION_RESPONSE_OK_COUNT = "drm.mediadrm.provide_provision_response.ok.count";
    field public static final String SESSION_END_TIMES_MS = "drm.mediadrm.session_end_times_ms";
    field public static final String SESSION_START_TIMES_MS = "drm.mediadrm.session_start_times_ms";
  }

  public static interface MediaDrm.OnEventListener {
    method public void onEvent(@NonNull android.media.MediaDrm, @Nullable byte[], int, int, @Nullable byte[]);
  }

  public static interface MediaDrm.OnExpirationUpdateListener {
    method public void onExpirationUpdate(@NonNull android.media.MediaDrm, @NonNull byte[], long);
  }

  public static interface MediaDrm.OnKeyStatusChangeListener {
    method public void onKeyStatusChange(@NonNull android.media.MediaDrm, @NonNull byte[], @NonNull java.util.List<android.media.MediaDrm.KeyStatus>, boolean);
  }

  public static final class MediaDrm.ProvisionRequest {
    method @NonNull public byte[] getData();
    method @NonNull public String getDefaultUrl();
  }

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({android.media.MediaDrm.SECURITY_LEVEL_UNKNOWN, android.media.MediaDrm.SECURITY_LEVEL_SW_SECURE_CRYPTO, android.media.MediaDrm.SECURITY_LEVEL_SW_SECURE_DECODE, android.media.MediaDrm.SECURITY_LEVEL_HW_SECURE_CRYPTO, android.media.MediaDrm.SECURITY_LEVEL_HW_SECURE_DECODE, android.media.MediaDrm.SECURITY_LEVEL_HW_SECURE_ALL}) public static @interface MediaDrm.SecurityLevel {
  }

  public class MediaDrmException extends java.lang.Exception {
    ctor public MediaDrmException(String);
  }

  public class MediaDrmResetException extends java.lang.IllegalStateException {
    ctor public MediaDrmResetException(String);
  }

  public final class MediaExtractor {
    ctor public MediaExtractor();
    method public boolean advance();
    method protected void finalize();
    method @NonNull public java.util.List<android.media.AudioPresentation> getAudioPresentations(int);
    method public long getCachedDuration();
    method public android.media.MediaExtractor.CasInfo getCasInfo(int);
    method public android.media.DrmInitData getDrmInitData();
    method public android.os.PersistableBundle getMetrics();
    method @Nullable public java.util.Map<java.util.UUID,byte[]> getPsshInfo();
    method public boolean getSampleCryptoInfo(@NonNull android.media.MediaCodec.CryptoInfo);
    method public int getSampleFlags();
    method public long getSampleSize();
    method public long getSampleTime();
    method public int getSampleTrackIndex();
    method public int getTrackCount();
    method @NonNull public android.media.MediaFormat getTrackFormat(int);
    method public boolean hasCacheReachedEndOfStream();
    method public int readSampleData(@NonNull java.nio.ByteBuffer, int);
    method public void release();
    method public void seekTo(long, int);
    method public void selectTrack(int);
    method public void setDataSource(@NonNull android.media.MediaDataSource) throws java.io.IOException;
    method public void setDataSource(@NonNull android.content.Context, @NonNull android.net.Uri, @Nullable java.util.Map<java.lang.String,java.lang.String>) throws java.io.IOException;
    method public void setDataSource(@NonNull String, @Nullable java.util.Map<java.lang.String,java.lang.String>) throws java.io.IOException;
    method public void setDataSource(@NonNull String) throws java.io.IOException;
    method public void setDataSource(@NonNull android.content.res.AssetFileDescriptor) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void setDataSource(@NonNull java.io.FileDescriptor) throws java.io.IOException;
    method public void setDataSource(@NonNull java.io.FileDescriptor, long, long) throws java.io.IOException;
    method public void setMediaCas(@NonNull android.media.MediaCas);
    method public void unselectTrack(int);
    field public static final int SAMPLE_FLAG_ENCRYPTED = 2; // 0x2
    field public static final int SAMPLE_FLAG_PARTIAL_FRAME = 4; // 0x4
    field public static final int SAMPLE_FLAG_SYNC = 1; // 0x1
    field public static final int SEEK_TO_CLOSEST_SYNC = 2; // 0x2
    field public static final int SEEK_TO_NEXT_SYNC = 1; // 0x1
    field public static final int SEEK_TO_PREVIOUS_SYNC = 0; // 0x0
  }

  public static final class MediaExtractor.CasInfo {
    method public android.media.MediaCas.Session getSession();
    method public int getSystemId();
  }

  public static final class MediaExtractor.MetricsConstants {
    field public static final String FORMAT = "android.media.mediaextractor.fmt";
    field public static final String MIME_TYPE = "android.media.mediaextractor.mime";
    field public static final String TRACKS = "android.media.mediaextractor.ntrk";
  }

  public final class MediaFormat {
    ctor public MediaFormat();
    method public boolean containsKey(String);
    method public static android.media.MediaFormat createAudioFormat(String, int, int);
    method public static android.media.MediaFormat createSubtitleFormat(String, String);
    method public static android.media.MediaFormat createVideoFormat(String, int, int);
    method public java.nio.ByteBuffer getByteBuffer(String);
    method public boolean getFeatureEnabled(String);
    method public float getFloat(String);
    method public int getInteger(String);
    method public long getLong(String);
    method public String getString(String);
    method public void setByteBuffer(String, java.nio.ByteBuffer);
    method public void setFeatureEnabled(String, boolean);
    method public void setFloat(String, float);
    method public void setInteger(String, int);
    method public void setLong(String, long);
    method public void setString(String, String);
    field public static final int COLOR_RANGE_FULL = 1; // 0x1
    field public static final int COLOR_RANGE_LIMITED = 2; // 0x2
    field public static final int COLOR_STANDARD_BT2020 = 6; // 0x6
    field public static final int COLOR_STANDARD_BT601_NTSC = 4; // 0x4
    field public static final int COLOR_STANDARD_BT601_PAL = 2; // 0x2
    field public static final int COLOR_STANDARD_BT709 = 1; // 0x1
    field public static final int COLOR_TRANSFER_HLG = 7; // 0x7
    field public static final int COLOR_TRANSFER_LINEAR = 1; // 0x1
    field public static final int COLOR_TRANSFER_SDR_VIDEO = 3; // 0x3
    field public static final int COLOR_TRANSFER_ST2084 = 6; // 0x6
    field public static final String KEY_AAC_DRC_ATTENUATION_FACTOR = "aac-drc-cut-level";
    field public static final String KEY_AAC_DRC_BOOST_FACTOR = "aac-drc-boost-level";
    field public static final String KEY_AAC_DRC_EFFECT_TYPE = "aac-drc-effect-type";
    field public static final String KEY_AAC_DRC_HEAVY_COMPRESSION = "aac-drc-heavy-compression";
    field public static final String KEY_AAC_DRC_TARGET_REFERENCE_LEVEL = "aac-target-ref-level";
    field public static final String KEY_AAC_ENCODED_TARGET_LEVEL = "aac-encoded-target-level";
    field public static final String KEY_AAC_MAX_OUTPUT_CHANNEL_COUNT = "aac-max-output-channel_count";
    field public static final String KEY_AAC_PROFILE = "aac-profile";
    field public static final String KEY_AAC_SBR_MODE = "aac-sbr-mode";
    field public static final String KEY_AUDIO_SESSION_ID = "audio-session-id";
    field public static final String KEY_BITRATE_MODE = "bitrate-mode";
    field public static final String KEY_BIT_RATE = "bitrate";
    field public static final String KEY_CAPTURE_RATE = "capture-rate";
    field public static final String KEY_CHANNEL_COUNT = "channel-count";
    field public static final String KEY_CHANNEL_MASK = "channel-mask";
    field public static final String KEY_COLOR_FORMAT = "color-format";
    field public static final String KEY_COLOR_RANGE = "color-range";
    field public static final String KEY_COLOR_STANDARD = "color-standard";
    field public static final String KEY_COLOR_TRANSFER = "color-transfer";
    field public static final String KEY_COMPLEXITY = "complexity";
    field public static final String KEY_DURATION = "durationUs";
    field public static final String KEY_FLAC_COMPRESSION_LEVEL = "flac-compression-level";
    field public static final String KEY_FRAME_RATE = "frame-rate";
    field public static final String KEY_GRID_COLUMNS = "grid-cols";
    field public static final String KEY_GRID_ROWS = "grid-rows";
    field public static final String KEY_HDR_STATIC_INFO = "hdr-static-info";
    field public static final String KEY_HEIGHT = "height";
    field public static final String KEY_INTRA_REFRESH_PERIOD = "intra-refresh-period";
    field public static final String KEY_IS_ADTS = "is-adts";
    field public static final String KEY_IS_AUTOSELECT = "is-autoselect";
    field public static final String KEY_IS_DEFAULT = "is-default";
    field public static final String KEY_IS_FORCED_SUBTITLE = "is-forced-subtitle";
    field public static final String KEY_I_FRAME_INTERVAL = "i-frame-interval";
    field public static final String KEY_LANGUAGE = "language";
    field public static final String KEY_LATENCY = "latency";
    field public static final String KEY_LEVEL = "level";
    field public static final String KEY_MAX_HEIGHT = "max-height";
    field public static final String KEY_MAX_INPUT_SIZE = "max-input-size";
    field public static final String KEY_MAX_WIDTH = "max-width";
    field public static final String KEY_MIME = "mime";
    field public static final String KEY_OPERATING_RATE = "operating-rate";
    field public static final String KEY_OUTPUT_REORDER_DEPTH = "output-reorder-depth";
    field public static final String KEY_PCM_ENCODING = "pcm-encoding";
    field public static final String KEY_PRIORITY = "priority";
    field public static final String KEY_PROFILE = "profile";
    field public static final String KEY_PUSH_BLANK_BUFFERS_ON_STOP = "push-blank-buffers-on-shutdown";
    field public static final String KEY_QUALITY = "quality";
    field public static final String KEY_REPEAT_PREVIOUS_FRAME_AFTER = "repeat-previous-frame-after";
    field public static final String KEY_ROTATION = "rotation-degrees";
    field public static final String KEY_SAMPLE_RATE = "sample-rate";
    field public static final String KEY_SLICE_HEIGHT = "slice-height";
    field public static final String KEY_STRIDE = "stride";
    field public static final String KEY_TEMPORAL_LAYERING = "ts-schema";
    field public static final String KEY_TILE_HEIGHT = "tile-height";
    field public static final String KEY_TILE_WIDTH = "tile-width";
    field public static final String KEY_TRACK_ID = "track-id";
    field public static final String KEY_WIDTH = "width";
    field public static final String MIMETYPE_AUDIO_AAC = "audio/mp4a-latm";
    field public static final String MIMETYPE_AUDIO_AC3 = "audio/ac3";
    field public static final String MIMETYPE_AUDIO_AMR_NB = "audio/3gpp";
    field public static final String MIMETYPE_AUDIO_AMR_WB = "audio/amr-wb";
    field public static final String MIMETYPE_AUDIO_EAC3 = "audio/eac3";
    field public static final String MIMETYPE_AUDIO_FLAC = "audio/flac";
    field public static final String MIMETYPE_AUDIO_G711_ALAW = "audio/g711-alaw";
    field public static final String MIMETYPE_AUDIO_G711_MLAW = "audio/g711-mlaw";
    field public static final String MIMETYPE_AUDIO_MPEG = "audio/mpeg";
    field public static final String MIMETYPE_AUDIO_MSGSM = "audio/gsm";
    field public static final String MIMETYPE_AUDIO_OPUS = "audio/opus";
    field public static final String MIMETYPE_AUDIO_QCELP = "audio/qcelp";
    field public static final String MIMETYPE_AUDIO_RAW = "audio/raw";
    field public static final String MIMETYPE_AUDIO_SCRAMBLED = "audio/scrambled";
    field public static final String MIMETYPE_AUDIO_VORBIS = "audio/vorbis";
    field public static final String MIMETYPE_IMAGE_ANDROID_HEIC = "image/vnd.android.heic";
    field public static final String MIMETYPE_TEXT_CEA_608 = "text/cea-608";
    field public static final String MIMETYPE_TEXT_CEA_708 = "text/cea-708";
    field public static final String MIMETYPE_TEXT_SUBRIP = "application/x-subrip";
    field public static final String MIMETYPE_TEXT_VTT = "text/vtt";
    field public static final String MIMETYPE_VIDEO_AVC = "video/avc";
    field public static final String MIMETYPE_VIDEO_DOLBY_VISION = "video/dolby-vision";
    field public static final String MIMETYPE_VIDEO_H263 = "video/3gpp";
    field public static final String MIMETYPE_VIDEO_HEVC = "video/hevc";
    field public static final String MIMETYPE_VIDEO_MPEG2 = "video/mpeg2";
    field public static final String MIMETYPE_VIDEO_MPEG4 = "video/mp4v-es";
    field public static final String MIMETYPE_VIDEO_RAW = "video/raw";
    field public static final String MIMETYPE_VIDEO_SCRAMBLED = "video/scrambled";
    field public static final String MIMETYPE_VIDEO_VP8 = "video/x-vnd.on2.vp8";
    field public static final String MIMETYPE_VIDEO_VP9 = "video/x-vnd.on2.vp9";
  }

  public final class MediaMetadata implements android.os.Parcelable {
    method public boolean containsKey(String);
    method public int describeContents();
    method public android.graphics.Bitmap getBitmap(String);
    method @NonNull public android.media.MediaDescription getDescription();
    method public long getLong(String);
    method public android.media.Rating getRating(String);
    method public String getString(String);
    method public CharSequence getText(String);
    method public java.util.Set<java.lang.String> keySet();
    method public int size();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.MediaMetadata> CREATOR;
    field public static final String METADATA_KEY_ALBUM = "android.media.metadata.ALBUM";
    field public static final String METADATA_KEY_ALBUM_ART = "android.media.metadata.ALBUM_ART";
    field public static final String METADATA_KEY_ALBUM_ARTIST = "android.media.metadata.ALBUM_ARTIST";
    field public static final String METADATA_KEY_ALBUM_ART_URI = "android.media.metadata.ALBUM_ART_URI";
    field public static final String METADATA_KEY_ART = "android.media.metadata.ART";
    field public static final String METADATA_KEY_ARTIST = "android.media.metadata.ARTIST";
    field public static final String METADATA_KEY_ART_URI = "android.media.metadata.ART_URI";
    field public static final String METADATA_KEY_AUTHOR = "android.media.metadata.AUTHOR";
    field public static final String METADATA_KEY_BT_FOLDER_TYPE = "android.media.metadata.BT_FOLDER_TYPE";
    field public static final String METADATA_KEY_COMPILATION = "android.media.metadata.COMPILATION";
    field public static final String METADATA_KEY_COMPOSER = "android.media.metadata.COMPOSER";
    field public static final String METADATA_KEY_DATE = "android.media.metadata.DATE";
    field public static final String METADATA_KEY_DISC_NUMBER = "android.media.metadata.DISC_NUMBER";
    field public static final String METADATA_KEY_DISPLAY_DESCRIPTION = "android.media.metadata.DISPLAY_DESCRIPTION";
    field public static final String METADATA_KEY_DISPLAY_ICON = "android.media.metadata.DISPLAY_ICON";
    field public static final String METADATA_KEY_DISPLAY_ICON_URI = "android.media.metadata.DISPLAY_ICON_URI";
    field public static final String METADATA_KEY_DISPLAY_SUBTITLE = "android.media.metadata.DISPLAY_SUBTITLE";
    field public static final String METADATA_KEY_DISPLAY_TITLE = "android.media.metadata.DISPLAY_TITLE";
    field public static final String METADATA_KEY_DURATION = "android.media.metadata.DURATION";
    field public static final String METADATA_KEY_GENRE = "android.media.metadata.GENRE";
    field public static final String METADATA_KEY_MEDIA_ID = "android.media.metadata.MEDIA_ID";
    field public static final String METADATA_KEY_MEDIA_URI = "android.media.metadata.MEDIA_URI";
    field public static final String METADATA_KEY_NUM_TRACKS = "android.media.metadata.NUM_TRACKS";
    field public static final String METADATA_KEY_RATING = "android.media.metadata.RATING";
    field public static final String METADATA_KEY_TITLE = "android.media.metadata.TITLE";
    field public static final String METADATA_KEY_TRACK_NUMBER = "android.media.metadata.TRACK_NUMBER";
    field public static final String METADATA_KEY_USER_RATING = "android.media.metadata.USER_RATING";
    field public static final String METADATA_KEY_WRITER = "android.media.metadata.WRITER";
    field public static final String METADATA_KEY_YEAR = "android.media.metadata.YEAR";
  }

  public static final class MediaMetadata.Builder {
    ctor public MediaMetadata.Builder();
    ctor public MediaMetadata.Builder(android.media.MediaMetadata);
    method public android.media.MediaMetadata build();
    method public android.media.MediaMetadata.Builder putBitmap(String, android.graphics.Bitmap);
    method public android.media.MediaMetadata.Builder putLong(String, long);
    method public android.media.MediaMetadata.Builder putRating(String, android.media.Rating);
    method public android.media.MediaMetadata.Builder putString(String, String);
    method public android.media.MediaMetadata.Builder putText(String, CharSequence);
  }

  @Deprecated public abstract class MediaMetadataEditor {
    method @Deprecated public void addEditableKey(int);
    method @Deprecated public abstract void apply();
    method @Deprecated public void clear();
    method @Deprecated public android.graphics.Bitmap getBitmap(int, android.graphics.Bitmap) throws java.lang.IllegalArgumentException;
    method @Deprecated public int[] getEditableKeys();
    method @Deprecated public long getLong(int, long) throws java.lang.IllegalArgumentException;
    method @Deprecated public Object getObject(int, Object) throws java.lang.IllegalArgumentException;
    method @Deprecated public String getString(int, String) throws java.lang.IllegalArgumentException;
    method @Deprecated public android.media.MediaMetadataEditor putBitmap(int, android.graphics.Bitmap) throws java.lang.IllegalArgumentException;
    method @Deprecated public android.media.MediaMetadataEditor putLong(int, long) throws java.lang.IllegalArgumentException;
    method @Deprecated public android.media.MediaMetadataEditor putObject(int, Object) throws java.lang.IllegalArgumentException;
    method @Deprecated public android.media.MediaMetadataEditor putString(int, String) throws java.lang.IllegalArgumentException;
    method @Deprecated public void removeEditableKeys();
    field @Deprecated public static final int BITMAP_KEY_ARTWORK = 100; // 0x64
    field @Deprecated public static final int RATING_KEY_BY_OTHERS = 101; // 0x65
    field @Deprecated public static final int RATING_KEY_BY_USER = 268435457; // 0x10000001
  }

  public class MediaMetadataRetriever {
    ctor public MediaMetadataRetriever();
    method public String extractMetadata(int);
    method public byte[] getEmbeddedPicture();
    method public android.graphics.Bitmap getFrameAtIndex(int, @NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method public android.graphics.Bitmap getFrameAtIndex(int);
    method public android.graphics.Bitmap getFrameAtTime(long, int);
    method public android.graphics.Bitmap getFrameAtTime(long);
    method public android.graphics.Bitmap getFrameAtTime();
    method @NonNull public java.util.List<android.graphics.Bitmap> getFramesAtIndex(int, int, @NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method @NonNull public java.util.List<android.graphics.Bitmap> getFramesAtIndex(int, int);
    method public android.graphics.Bitmap getImageAtIndex(int, @NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method public android.graphics.Bitmap getImageAtIndex(int);
    method public android.graphics.Bitmap getPrimaryImage(@NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method public android.graphics.Bitmap getPrimaryImage();
    method public android.graphics.Bitmap getScaledFrameAtTime(long, int, int, int);
    method public void release();
    method public void setDataSource(String) throws java.lang.IllegalArgumentException;
    method public void setDataSource(String, java.util.Map<java.lang.String,java.lang.String>) throws java.lang.IllegalArgumentException;
    method public void setDataSource(java.io.FileDescriptor, long, long) throws java.lang.IllegalArgumentException;
    method public void setDataSource(java.io.FileDescriptor) throws java.lang.IllegalArgumentException;
    method public void setDataSource(android.content.Context, android.net.Uri) throws java.lang.IllegalArgumentException, java.lang.SecurityException;
    method public void setDataSource(android.media.MediaDataSource) throws java.lang.IllegalArgumentException;
    field public static final int METADATA_KEY_ALBUM = 1; // 0x1
    field public static final int METADATA_KEY_ALBUMARTIST = 13; // 0xd
    field public static final int METADATA_KEY_ARTIST = 2; // 0x2
    field public static final int METADATA_KEY_AUTHOR = 3; // 0x3
    field public static final int METADATA_KEY_BITRATE = 20; // 0x14
    field public static final int METADATA_KEY_CAPTURE_FRAMERATE = 25; // 0x19
    field public static final int METADATA_KEY_CD_TRACK_NUMBER = 0; // 0x0
    field public static final int METADATA_KEY_COMPILATION = 15; // 0xf
    field public static final int METADATA_KEY_COMPOSER = 4; // 0x4
    field public static final int METADATA_KEY_DATE = 5; // 0x5
    field public static final int METADATA_KEY_DISC_NUMBER = 14; // 0xe
    field public static final int METADATA_KEY_DURATION = 9; // 0x9
    field public static final int METADATA_KEY_GENRE = 6; // 0x6
    field public static final int METADATA_KEY_HAS_AUDIO = 16; // 0x10
    field public static final int METADATA_KEY_HAS_IMAGE = 26; // 0x1a
    field public static final int METADATA_KEY_HAS_VIDEO = 17; // 0x11
    field public static final int METADATA_KEY_IMAGE_COUNT = 27; // 0x1b
    field public static final int METADATA_KEY_IMAGE_HEIGHT = 30; // 0x1e
    field public static final int METADATA_KEY_IMAGE_PRIMARY = 28; // 0x1c
    field public static final int METADATA_KEY_IMAGE_ROTATION = 31; // 0x1f
    field public static final int METADATA_KEY_IMAGE_WIDTH = 29; // 0x1d
    field public static final int METADATA_KEY_LOCATION = 23; // 0x17
    field public static final int METADATA_KEY_MIMETYPE = 12; // 0xc
    field public static final int METADATA_KEY_NUM_TRACKS = 10; // 0xa
    field public static final int METADATA_KEY_TITLE = 7; // 0x7
    field public static final int METADATA_KEY_VIDEO_FRAME_COUNT = 32; // 0x20
    field public static final int METADATA_KEY_VIDEO_HEIGHT = 19; // 0x13
    field public static final int METADATA_KEY_VIDEO_ROTATION = 24; // 0x18
    field public static final int METADATA_KEY_VIDEO_WIDTH = 18; // 0x12
    field public static final int METADATA_KEY_WRITER = 11; // 0xb
    field public static final int METADATA_KEY_YEAR = 8; // 0x8
    field public static final int OPTION_CLOSEST = 3; // 0x3
    field public static final int OPTION_CLOSEST_SYNC = 2; // 0x2
    field public static final int OPTION_NEXT_SYNC = 1; // 0x1
    field public static final int OPTION_PREVIOUS_SYNC = 0; // 0x0
  }

  public static final class MediaMetadataRetriever.BitmapParams {
    ctor public MediaMetadataRetriever.BitmapParams();
    method @NonNull public android.graphics.Bitmap.Config getActualConfig();
    method @NonNull public android.graphics.Bitmap.Config getPreferredConfig();
    method public void setPreferredConfig(@NonNull android.graphics.Bitmap.Config);
  }

  public final class MediaMuxer {
    ctor public MediaMuxer(@NonNull String, int) throws java.io.IOException;
    ctor public MediaMuxer(@NonNull java.io.FileDescriptor, int) throws java.io.IOException;
    method public int addTrack(@NonNull android.media.MediaFormat);
    method public void release();
    method public void setLocation(float, float);
    method public void setOrientationHint(int);
    method public void start();
    method public void stop();
    method public void writeSampleData(int, @NonNull java.nio.ByteBuffer, @NonNull android.media.MediaCodec.BufferInfo);
  }

  public static final class MediaMuxer.OutputFormat {
    field public static final int MUXER_OUTPUT_3GPP = 2; // 0x2
    field public static final int MUXER_OUTPUT_HEIF = 3; // 0x3
    field public static final int MUXER_OUTPUT_MPEG_4 = 0; // 0x0
    field public static final int MUXER_OUTPUT_WEBM = 1; // 0x1
  }

  public class MediaPlayer implements android.media.AudioRouting android.media.VolumeAutomation {
    ctor public MediaPlayer();
    method public void addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler);
    method public void addTimedTextSource(String, String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void addTimedTextSource(android.content.Context, android.net.Uri, String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void addTimedTextSource(java.io.FileDescriptor, String) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void addTimedTextSource(java.io.FileDescriptor, long, long, String) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void attachAuxEffect(int);
    method public void clearOnMediaTimeDiscontinuityListener();
    method public void clearOnSubtitleDataListener();
    method public static android.media.MediaPlayer create(android.content.Context, android.net.Uri);
    method public static android.media.MediaPlayer create(android.content.Context, android.net.Uri, android.view.SurfaceHolder);
    method public static android.media.MediaPlayer create(android.content.Context, android.net.Uri, android.view.SurfaceHolder, android.media.AudioAttributes, int);
    method public static android.media.MediaPlayer create(android.content.Context, int);
    method public static android.media.MediaPlayer create(android.content.Context, int, android.media.AudioAttributes, int);
    method @NonNull public android.media.VolumeShaper createVolumeShaper(@NonNull android.media.VolumeShaper.Configuration);
    method public static void deprecateStreamTypeForPlayback(int, String, String) throws java.lang.IllegalArgumentException;
    method public void deselectTrack(int) throws java.lang.IllegalStateException;
    method protected void finalize();
    method public int getAudioSessionId();
    method public int getCurrentPosition();
    method public android.media.MediaPlayer.DrmInfo getDrmInfo();
    method @NonNull public String getDrmPropertyString(@NonNull String) throws android.media.MediaPlayer.NoDrmSchemeException;
    method public int getDuration();
    method @NonNull public android.media.MediaDrm.KeyRequest getKeyRequest(@Nullable byte[], @Nullable byte[], @Nullable String, int, @Nullable java.util.Map<java.lang.String,java.lang.String>) throws android.media.MediaPlayer.NoDrmSchemeException;
    method public android.os.PersistableBundle getMetrics();
    method @NonNull public android.media.PlaybackParams getPlaybackParams();
    method public android.media.AudioDeviceInfo getPreferredDevice();
    method public android.media.AudioDeviceInfo getRoutedDevice();
    method public int getSelectedTrack(int) throws java.lang.IllegalStateException;
    method @NonNull public android.media.SyncParams getSyncParams();
    method @Nullable public android.media.MediaTimestamp getTimestamp();
    method public android.media.MediaPlayer.TrackInfo[] getTrackInfo() throws java.lang.IllegalStateException;
    method public int getVideoHeight();
    method public int getVideoWidth();
    method public boolean isLooping();
    method public boolean isPlaying();
    method public void pause() throws java.lang.IllegalStateException;
    method public void prepare() throws java.io.IOException, java.lang.IllegalStateException;
    method public void prepareAsync() throws java.lang.IllegalStateException;
    method public void prepareDrm(@NonNull java.util.UUID) throws android.media.MediaPlayer.ProvisioningNetworkErrorException, android.media.MediaPlayer.ProvisioningServerErrorException, android.media.ResourceBusyException, android.media.UnsupportedSchemeException;
    method public byte[] provideKeyResponse(@Nullable byte[], @NonNull byte[]) throws android.media.DeniedByServerException, android.media.MediaPlayer.NoDrmSchemeException;
    method public void release();
    method public void releaseDrm() throws android.media.MediaPlayer.NoDrmSchemeException;
    method public void removeOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener);
    method public void reset();
    method public void restoreKeys(@NonNull byte[]) throws android.media.MediaPlayer.NoDrmSchemeException;
    method public void seekTo(long, int);
    method public void seekTo(int) throws java.lang.IllegalStateException;
    method public void selectTrack(int) throws java.lang.IllegalStateException;
    method public void setAudioAttributes(android.media.AudioAttributes) throws java.lang.IllegalArgumentException;
    method public void setAudioSessionId(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method @Deprecated public void setAudioStreamType(int);
    method public void setAuxEffectSendLevel(float);
    method public void setDataSource(@NonNull android.content.Context, @NonNull android.net.Uri) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.SecurityException;
    method public void setDataSource(@NonNull android.content.Context, @NonNull android.net.Uri, @Nullable java.util.Map<java.lang.String,java.lang.String>, @Nullable java.util.List<java.net.HttpCookie>) throws java.io.IOException;
    method public void setDataSource(@NonNull android.content.Context, @NonNull android.net.Uri, @Nullable java.util.Map<java.lang.String,java.lang.String>) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.SecurityException;
    method public void setDataSource(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.SecurityException;
    method public void setDataSource(@NonNull android.content.res.AssetFileDescriptor) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void setDataSource(java.io.FileDescriptor) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void setDataSource(java.io.FileDescriptor, long, long) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void setDataSource(android.media.MediaDataSource) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void setDisplay(android.view.SurfaceHolder);
    method public void setDrmPropertyString(@NonNull String, @NonNull String) throws android.media.MediaPlayer.NoDrmSchemeException;
    method public void setLooping(boolean);
    method public void setNextMediaPlayer(android.media.MediaPlayer);
    method public void setOnBufferingUpdateListener(android.media.MediaPlayer.OnBufferingUpdateListener);
    method public void setOnCompletionListener(android.media.MediaPlayer.OnCompletionListener);
    method public void setOnDrmConfigHelper(android.media.MediaPlayer.OnDrmConfigHelper);
    method public void setOnDrmInfoListener(android.media.MediaPlayer.OnDrmInfoListener);
    method public void setOnDrmInfoListener(android.media.MediaPlayer.OnDrmInfoListener, android.os.Handler);
    method public void setOnDrmPreparedListener(android.media.MediaPlayer.OnDrmPreparedListener);
    method public void setOnDrmPreparedListener(android.media.MediaPlayer.OnDrmPreparedListener, android.os.Handler);
    method public void setOnErrorListener(android.media.MediaPlayer.OnErrorListener);
    method public void setOnInfoListener(android.media.MediaPlayer.OnInfoListener);
    method public void setOnMediaTimeDiscontinuityListener(@NonNull android.media.MediaPlayer.OnMediaTimeDiscontinuityListener, @NonNull android.os.Handler);
    method public void setOnMediaTimeDiscontinuityListener(@NonNull android.media.MediaPlayer.OnMediaTimeDiscontinuityListener);
    method public void setOnPreparedListener(android.media.MediaPlayer.OnPreparedListener);
    method public void setOnSeekCompleteListener(android.media.MediaPlayer.OnSeekCompleteListener);
    method public void setOnSubtitleDataListener(@NonNull android.media.MediaPlayer.OnSubtitleDataListener, @NonNull android.os.Handler);
    method public void setOnSubtitleDataListener(@NonNull android.media.MediaPlayer.OnSubtitleDataListener);
    method public void setOnTimedMetaDataAvailableListener(android.media.MediaPlayer.OnTimedMetaDataAvailableListener);
    method public void setOnTimedTextListener(android.media.MediaPlayer.OnTimedTextListener);
    method public void setOnVideoSizeChangedListener(android.media.MediaPlayer.OnVideoSizeChangedListener);
    method public void setPlaybackParams(@NonNull android.media.PlaybackParams);
    method public boolean setPreferredDevice(android.media.AudioDeviceInfo);
    method public void setScreenOnWhilePlaying(boolean);
    method public void setSurface(android.view.Surface);
    method public void setSyncParams(@NonNull android.media.SyncParams);
    method public void setVideoScalingMode(int);
    method public void setVolume(float, float);
    method public void setWakeMode(android.content.Context, int);
    method public void start() throws java.lang.IllegalStateException;
    method public void stop() throws java.lang.IllegalStateException;
    field public static final int MEDIA_ERROR_IO = -1004; // 0xfffffc14
    field public static final int MEDIA_ERROR_MALFORMED = -1007; // 0xfffffc11
    field public static final int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200; // 0xc8
    field public static final int MEDIA_ERROR_SERVER_DIED = 100; // 0x64
    field public static final int MEDIA_ERROR_TIMED_OUT = -110; // 0xffffff92
    field public static final int MEDIA_ERROR_UNKNOWN = 1; // 0x1
    field public static final int MEDIA_ERROR_UNSUPPORTED = -1010; // 0xfffffc0e
    field public static final int MEDIA_INFO_AUDIO_NOT_PLAYING = 804; // 0x324
    field public static final int MEDIA_INFO_BAD_INTERLEAVING = 800; // 0x320
    field public static final int MEDIA_INFO_BUFFERING_END = 702; // 0x2be
    field public static final int MEDIA_INFO_BUFFERING_START = 701; // 0x2bd
    field public static final int MEDIA_INFO_METADATA_UPDATE = 802; // 0x322
    field public static final int MEDIA_INFO_NOT_SEEKABLE = 801; // 0x321
    field public static final int MEDIA_INFO_STARTED_AS_NEXT = 2; // 0x2
    field public static final int MEDIA_INFO_SUBTITLE_TIMED_OUT = 902; // 0x386
    field public static final int MEDIA_INFO_UNKNOWN = 1; // 0x1
    field public static final int MEDIA_INFO_UNSUPPORTED_SUBTITLE = 901; // 0x385
    field public static final int MEDIA_INFO_VIDEO_NOT_PLAYING = 805; // 0x325
    field public static final int MEDIA_INFO_VIDEO_RENDERING_START = 3; // 0x3
    field public static final int MEDIA_INFO_VIDEO_TRACK_LAGGING = 700; // 0x2bc
    field @Deprecated public static final String MEDIA_MIMETYPE_TEXT_SUBRIP = "application/x-subrip";
    field public static final int PREPARE_DRM_STATUS_PREPARATION_ERROR = 3; // 0x3
    field public static final int PREPARE_DRM_STATUS_PROVISIONING_NETWORK_ERROR = 1; // 0x1
    field public static final int PREPARE_DRM_STATUS_PROVISIONING_SERVER_ERROR = 2; // 0x2
    field public static final int PREPARE_DRM_STATUS_SUCCESS = 0; // 0x0
    field public static final int SEEK_CLOSEST = 3; // 0x3
    field public static final int SEEK_CLOSEST_SYNC = 2; // 0x2
    field public static final int SEEK_NEXT_SYNC = 1; // 0x1
    field public static final int SEEK_PREVIOUS_SYNC = 0; // 0x0
    field public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT = 1; // 0x1
    field public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING = 2; // 0x2
  }

  public static final class MediaPlayer.DrmInfo {
    method public java.util.Map<java.util.UUID,byte[]> getPssh();
    method public java.util.UUID[] getSupportedSchemes();
  }

  public static final class MediaPlayer.MetricsConstants {
    field public static final String CODEC_AUDIO = "android.media.mediaplayer.audio.codec";
    field public static final String CODEC_VIDEO = "android.media.mediaplayer.video.codec";
    field public static final String DURATION = "android.media.mediaplayer.durationMs";
    field public static final String ERRORS = "android.media.mediaplayer.err";
    field public static final String ERROR_CODE = "android.media.mediaplayer.errcode";
    field public static final String FRAMES = "android.media.mediaplayer.frames";
    field public static final String FRAMES_DROPPED = "android.media.mediaplayer.dropped";
    field public static final String HEIGHT = "android.media.mediaplayer.height";
    field public static final String MIME_TYPE_AUDIO = "android.media.mediaplayer.audio.mime";
    field public static final String MIME_TYPE_VIDEO = "android.media.mediaplayer.video.mime";
    field public static final String PLAYING = "android.media.mediaplayer.playingMs";
    field public static final String WIDTH = "android.media.mediaplayer.width";
  }

  public static final class MediaPlayer.NoDrmSchemeException extends android.media.MediaDrmException {
    ctor public MediaPlayer.NoDrmSchemeException(String);
  }

  public static interface MediaPlayer.OnBufferingUpdateListener {
    method public void onBufferingUpdate(android.media.MediaPlayer, int);
  }

  public static interface MediaPlayer.OnCompletionListener {
    method public void onCompletion(android.media.MediaPlayer);
  }

  public static interface MediaPlayer.OnDrmConfigHelper {
    method public void onDrmConfig(android.media.MediaPlayer);
  }

  public static interface MediaPlayer.OnDrmInfoListener {
    method public void onDrmInfo(android.media.MediaPlayer, android.media.MediaPlayer.DrmInfo);
  }

  public static interface MediaPlayer.OnDrmPreparedListener {
    method public void onDrmPrepared(android.media.MediaPlayer, int);
  }

  public static interface MediaPlayer.OnErrorListener {
    method public boolean onError(android.media.MediaPlayer, int, int);
  }

  public static interface MediaPlayer.OnInfoListener {
    method public boolean onInfo(android.media.MediaPlayer, int, int);
  }

  public static interface MediaPlayer.OnMediaTimeDiscontinuityListener {
    method public void onMediaTimeDiscontinuity(@NonNull android.media.MediaPlayer, @NonNull android.media.MediaTimestamp);
  }

  public static interface MediaPlayer.OnPreparedListener {
    method public void onPrepared(android.media.MediaPlayer);
  }

  public static interface MediaPlayer.OnSeekCompleteListener {
    method public void onSeekComplete(android.media.MediaPlayer);
  }

  public static interface MediaPlayer.OnSubtitleDataListener {
    method public void onSubtitleData(@NonNull android.media.MediaPlayer, @NonNull android.media.SubtitleData);
  }

  public static interface MediaPlayer.OnTimedMetaDataAvailableListener {
    method public void onTimedMetaDataAvailable(android.media.MediaPlayer, android.media.TimedMetaData);
  }

  public static interface MediaPlayer.OnTimedTextListener {
    method public void onTimedText(android.media.MediaPlayer, android.media.TimedText);
  }

  public static interface MediaPlayer.OnVideoSizeChangedListener {
    method public void onVideoSizeChanged(android.media.MediaPlayer, int, int);
  }

  public static final class MediaPlayer.ProvisioningNetworkErrorException extends android.media.MediaDrmException {
    ctor public MediaPlayer.ProvisioningNetworkErrorException(String);
  }

  public static final class MediaPlayer.ProvisioningServerErrorException extends android.media.MediaDrmException {
    ctor public MediaPlayer.ProvisioningServerErrorException(String);
  }

  public static class MediaPlayer.TrackInfo implements android.os.Parcelable {
    method public int describeContents();
    method public android.media.MediaFormat getFormat();
    method public String getLanguage();
    method public int getTrackType();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int MEDIA_TRACK_TYPE_AUDIO = 2; // 0x2
    field public static final int MEDIA_TRACK_TYPE_METADATA = 5; // 0x5
    field public static final int MEDIA_TRACK_TYPE_SUBTITLE = 4; // 0x4
    field public static final int MEDIA_TRACK_TYPE_TIMEDTEXT = 3; // 0x3
    field public static final int MEDIA_TRACK_TYPE_UNKNOWN = 0; // 0x0
    field public static final int MEDIA_TRACK_TYPE_VIDEO = 1; // 0x1
  }

  public class MediaRecorder implements android.media.AudioRouting {
    ctor public MediaRecorder();
    method public void addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler);
    method protected void finalize();
    method public java.util.List<android.media.MicrophoneInfo> getActiveMicrophones() throws java.io.IOException;
    method public static final int getAudioSourceMax();
    method public int getMaxAmplitude() throws java.lang.IllegalStateException;
    method public android.os.PersistableBundle getMetrics();
    method public android.media.AudioDeviceInfo getPreferredDevice();
    method public android.media.AudioDeviceInfo getRoutedDevice();
    method public android.view.Surface getSurface();
    method public void pause() throws java.lang.IllegalStateException;
    method public void prepare() throws java.io.IOException, java.lang.IllegalStateException;
    method public void release();
    method public void removeOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener);
    method public void reset();
    method public void resume() throws java.lang.IllegalStateException;
    method public void setAudioChannels(int);
    method public void setAudioEncoder(int) throws java.lang.IllegalStateException;
    method public void setAudioEncodingBitRate(int);
    method public void setAudioSamplingRate(int);
    method public void setAudioSource(int) throws java.lang.IllegalStateException;
    method @Deprecated public void setCamera(android.hardware.Camera);
    method public void setCaptureRate(double);
    method public void setInputSurface(@NonNull android.view.Surface);
    method public void setLocation(float, float);
    method public void setMaxDuration(int) throws java.lang.IllegalArgumentException;
    method public void setMaxFileSize(long) throws java.lang.IllegalArgumentException;
    method public void setNextOutputFile(java.io.FileDescriptor) throws java.io.IOException;
    method public void setNextOutputFile(java.io.File) throws java.io.IOException;
    method public void setOnErrorListener(android.media.MediaRecorder.OnErrorListener);
    method public void setOnInfoListener(android.media.MediaRecorder.OnInfoListener);
    method public void setOrientationHint(int);
    method public void setOutputFile(java.io.FileDescriptor) throws java.lang.IllegalStateException;
    method public void setOutputFile(java.io.File);
    method public void setOutputFile(String) throws java.lang.IllegalStateException;
    method public void setOutputFormat(int) throws java.lang.IllegalStateException;
    method public boolean setPreferredDevice(android.media.AudioDeviceInfo);
    method public void setPreviewDisplay(android.view.Surface);
    method public void setProfile(android.media.CamcorderProfile);
    method public void setVideoEncoder(int) throws java.lang.IllegalStateException;
    method public void setVideoEncodingBitRate(int);
    method public void setVideoEncodingProfileLevel(int, int);
    method public void setVideoFrameRate(int) throws java.lang.IllegalStateException;
    method public void setVideoSize(int, int) throws java.lang.IllegalStateException;
    method public void setVideoSource(int) throws java.lang.IllegalStateException;
    method public void start() throws java.lang.IllegalStateException;
    method public void stop() throws java.lang.IllegalStateException;
    field public static final int MEDIA_ERROR_SERVER_DIED = 100; // 0x64
    field public static final int MEDIA_RECORDER_ERROR_UNKNOWN = 1; // 0x1
    field public static final int MEDIA_RECORDER_INFO_MAX_DURATION_REACHED = 800; // 0x320
    field public static final int MEDIA_RECORDER_INFO_MAX_FILESIZE_APPROACHING = 802; // 0x322
    field public static final int MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED = 801; // 0x321
    field public static final int MEDIA_RECORDER_INFO_NEXT_OUTPUT_FILE_STARTED = 803; // 0x323
    field public static final int MEDIA_RECORDER_INFO_UNKNOWN = 1; // 0x1
  }

  public final class MediaRecorder.AudioEncoder {
    field public static final int AAC = 3; // 0x3
    field public static final int AAC_ELD = 5; // 0x5
    field public static final int AMR_NB = 1; // 0x1
    field public static final int AMR_WB = 2; // 0x2
    field public static final int DEFAULT = 0; // 0x0
    field public static final int HE_AAC = 4; // 0x4
    field public static final int VORBIS = 6; // 0x6
  }

  public final class MediaRecorder.AudioSource {
    field public static final int CAMCORDER = 5; // 0x5
    field public static final int DEFAULT = 0; // 0x0
    field public static final int MIC = 1; // 0x1
    field @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_OUTPUT) public static final int REMOTE_SUBMIX = 8; // 0x8
    field public static final int UNPROCESSED = 9; // 0x9
    field public static final int VOICE_CALL = 4; // 0x4
    field public static final int VOICE_COMMUNICATION = 7; // 0x7
    field public static final int VOICE_DOWNLINK = 3; // 0x3
    field public static final int VOICE_RECOGNITION = 6; // 0x6
    field public static final int VOICE_UPLINK = 2; // 0x2
  }

  public static final class MediaRecorder.MetricsConstants {
    field public static final String AUDIO_BITRATE = "android.media.mediarecorder.audio-bitrate";
    field public static final String AUDIO_CHANNELS = "android.media.mediarecorder.audio-channels";
    field public static final String AUDIO_SAMPLERATE = "android.media.mediarecorder.audio-samplerate";
    field public static final String AUDIO_TIMESCALE = "android.media.mediarecorder.audio-timescale";
    field public static final String CAPTURE_FPS = "android.media.mediarecorder.capture-fps";
    field public static final String CAPTURE_FPS_ENABLE = "android.media.mediarecorder.capture-fpsenable";
    field public static final String FRAMERATE = "android.media.mediarecorder.frame-rate";
    field public static final String HEIGHT = "android.media.mediarecorder.height";
    field public static final String MOVIE_TIMESCALE = "android.media.mediarecorder.movie-timescale";
    field public static final String ROTATION = "android.media.mediarecorder.rotation";
    field public static final String VIDEO_BITRATE = "android.media.mediarecorder.video-bitrate";
    field public static final String VIDEO_IFRAME_INTERVAL = "android.media.mediarecorder.video-iframe-interval";
    field public static final String VIDEO_LEVEL = "android.media.mediarecorder.video-encoder-level";
    field public static final String VIDEO_PROFILE = "android.media.mediarecorder.video-encoder-profile";
    field public static final String VIDEO_TIMESCALE = "android.media.mediarecorder.video-timescale";
    field public static final String WIDTH = "android.media.mediarecorder.width";
  }

  public static interface MediaRecorder.OnErrorListener {
    method public void onError(android.media.MediaRecorder, int, int);
  }

  public static interface MediaRecorder.OnInfoListener {
    method public void onInfo(android.media.MediaRecorder, int, int);
  }

  public final class MediaRecorder.OutputFormat {
    field public static final int AAC_ADTS = 6; // 0x6
    field public static final int AMR_NB = 3; // 0x3
    field public static final int AMR_WB = 4; // 0x4
    field public static final int DEFAULT = 0; // 0x0
    field public static final int MPEG_2_TS = 8; // 0x8
    field public static final int MPEG_4 = 2; // 0x2
    field @Deprecated public static final int RAW_AMR = 3; // 0x3
    field public static final int THREE_GPP = 1; // 0x1
    field public static final int WEBM = 9; // 0x9
  }

  public final class MediaRecorder.VideoEncoder {
    field public static final int DEFAULT = 0; // 0x0
    field public static final int H263 = 1; // 0x1
    field public static final int H264 = 2; // 0x2
    field public static final int HEVC = 5; // 0x5
    field public static final int MPEG_4_SP = 3; // 0x3
    field public static final int VP8 = 4; // 0x4
  }

  public final class MediaRecorder.VideoSource {
    field public static final int CAMERA = 1; // 0x1
    field public static final int DEFAULT = 0; // 0x0
    field public static final int SURFACE = 2; // 0x2
  }

  public class MediaRouter {
    method public void addCallback(int, android.media.MediaRouter.Callback);
    method public void addCallback(int, android.media.MediaRouter.Callback, int);
    method public void addUserRoute(android.media.MediaRouter.UserRouteInfo);
    method public void clearUserRoutes();
    method public android.media.MediaRouter.RouteCategory createRouteCategory(CharSequence, boolean);
    method public android.media.MediaRouter.RouteCategory createRouteCategory(int, boolean);
    method public android.media.MediaRouter.UserRouteInfo createUserRoute(android.media.MediaRouter.RouteCategory);
    method public android.media.MediaRouter.RouteCategory getCategoryAt(int);
    method public int getCategoryCount();
    method public android.media.MediaRouter.RouteInfo getDefaultRoute();
    method public android.media.MediaRouter.RouteInfo getRouteAt(int);
    method public int getRouteCount();
    method public android.media.MediaRouter.RouteInfo getSelectedRoute(int);
    method public void removeCallback(android.media.MediaRouter.Callback);
    method public void removeUserRoute(android.media.MediaRouter.UserRouteInfo);
    method public void selectRoute(int, @NonNull android.media.MediaRouter.RouteInfo);
    field public static final int CALLBACK_FLAG_PERFORM_ACTIVE_SCAN = 1; // 0x1
    field public static final int CALLBACK_FLAG_UNFILTERED_EVENTS = 2; // 0x2
    field public static final int ROUTE_TYPE_LIVE_AUDIO = 1; // 0x1
    field public static final int ROUTE_TYPE_LIVE_VIDEO = 2; // 0x2
    field public static final int ROUTE_TYPE_USER = 8388608; // 0x800000
  }

  public abstract static class MediaRouter.Callback {
    ctor public MediaRouter.Callback();
    method public abstract void onRouteAdded(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
    method public abstract void onRouteChanged(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
    method public abstract void onRouteGrouped(android.media.MediaRouter, android.media.MediaRouter.RouteInfo, android.media.MediaRouter.RouteGroup, int);
    method public void onRoutePresentationDisplayChanged(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
    method public abstract void onRouteRemoved(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
    method public abstract void onRouteSelected(android.media.MediaRouter, int, android.media.MediaRouter.RouteInfo);
    method public abstract void onRouteUngrouped(android.media.MediaRouter, android.media.MediaRouter.RouteInfo, android.media.MediaRouter.RouteGroup);
    method public abstract void onRouteUnselected(android.media.MediaRouter, int, android.media.MediaRouter.RouteInfo);
    method public abstract void onRouteVolumeChanged(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
  }

  public static class MediaRouter.RouteCategory {
    method public CharSequence getName();
    method public CharSequence getName(android.content.Context);
    method public java.util.List<android.media.MediaRouter.RouteInfo> getRoutes(java.util.List<android.media.MediaRouter.RouteInfo>);
    method public int getSupportedTypes();
    method public boolean isGroupable();
  }

  public static class MediaRouter.RouteGroup extends android.media.MediaRouter.RouteInfo {
    method public void addRoute(android.media.MediaRouter.RouteInfo);
    method public void addRoute(android.media.MediaRouter.RouteInfo, int);
    method public android.media.MediaRouter.RouteInfo getRouteAt(int);
    method public int getRouteCount();
    method public void removeRoute(android.media.MediaRouter.RouteInfo);
    method public void removeRoute(int);
    method public void setIconDrawable(android.graphics.drawable.Drawable);
    method public void setIconResource(@DrawableRes int);
  }

  public static class MediaRouter.RouteInfo {
    method public android.media.MediaRouter.RouteCategory getCategory();
    method public CharSequence getDescription();
    method public int getDeviceType();
    method public android.media.MediaRouter.RouteGroup getGroup();
    method public android.graphics.drawable.Drawable getIconDrawable();
    method public CharSequence getName();
    method public CharSequence getName(android.content.Context);
    method public int getPlaybackStream();
    method public int getPlaybackType();
    method public android.view.Display getPresentationDisplay();
    method public CharSequence getStatus();
    method public int getSupportedTypes();
    method public Object getTag();
    method public int getVolume();
    method public int getVolumeHandling();
    method public int getVolumeMax();
    method public boolean isConnecting();
    method public boolean isEnabled();
    method public void requestSetVolume(int);
    method public void requestUpdateVolume(int);
    method public void setTag(Object);
    field public static final int DEVICE_TYPE_BLUETOOTH = 3; // 0x3
    field public static final int DEVICE_TYPE_SPEAKER = 2; // 0x2
    field public static final int DEVICE_TYPE_TV = 1; // 0x1
    field public static final int DEVICE_TYPE_UNKNOWN = 0; // 0x0
    field public static final int PLAYBACK_TYPE_LOCAL = 0; // 0x0
    field public static final int PLAYBACK_TYPE_REMOTE = 1; // 0x1
    field public static final int PLAYBACK_VOLUME_FIXED = 0; // 0x0
    field public static final int PLAYBACK_VOLUME_VARIABLE = 1; // 0x1
  }

  public static class MediaRouter.SimpleCallback extends android.media.MediaRouter.Callback {
    ctor public MediaRouter.SimpleCallback();
    method public void onRouteAdded(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
    method public void onRouteChanged(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
    method public void onRouteGrouped(android.media.MediaRouter, android.media.MediaRouter.RouteInfo, android.media.MediaRouter.RouteGroup, int);
    method public void onRouteRemoved(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
    method public void onRouteSelected(android.media.MediaRouter, int, android.media.MediaRouter.RouteInfo);
    method public void onRouteUngrouped(android.media.MediaRouter, android.media.MediaRouter.RouteInfo, android.media.MediaRouter.RouteGroup);
    method public void onRouteUnselected(android.media.MediaRouter, int, android.media.MediaRouter.RouteInfo);
    method public void onRouteVolumeChanged(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
  }

  public static class MediaRouter.UserRouteInfo extends android.media.MediaRouter.RouteInfo {
    method public android.media.RemoteControlClient getRemoteControlClient();
    method public void setDescription(CharSequence);
    method public void setIconDrawable(android.graphics.drawable.Drawable);
    method public void setIconResource(@DrawableRes int);
    method public void setName(CharSequence);
    method public void setName(int);
    method public void setPlaybackStream(int);
    method public void setPlaybackType(int);
    method public void setRemoteControlClient(android.media.RemoteControlClient);
    method public void setStatus(CharSequence);
    method public void setVolume(int);
    method public void setVolumeCallback(android.media.MediaRouter.VolumeCallback);
    method public void setVolumeHandling(int);
    method public void setVolumeMax(int);
  }

  public abstract static class MediaRouter.VolumeCallback {
    ctor public MediaRouter.VolumeCallback();
    method public abstract void onVolumeSetRequest(android.media.MediaRouter.RouteInfo, int);
    method public abstract void onVolumeUpdateRequest(android.media.MediaRouter.RouteInfo, int);
  }

  public class MediaScannerConnection implements android.content.ServiceConnection {
    ctor public MediaScannerConnection(android.content.Context, android.media.MediaScannerConnection.MediaScannerConnectionClient);
    method public void connect();
    method public void disconnect();
    method public boolean isConnected();
    method public void onServiceConnected(android.content.ComponentName, android.os.IBinder);
    method public void onServiceDisconnected(android.content.ComponentName);
    method public void scanFile(String, String);
    method public static void scanFile(android.content.Context, String[], String[], android.media.MediaScannerConnection.OnScanCompletedListener);
  }

  public static interface MediaScannerConnection.MediaScannerConnectionClient extends android.media.MediaScannerConnection.OnScanCompletedListener {
    method public void onMediaScannerConnected();
  }

  public static interface MediaScannerConnection.OnScanCompletedListener {
    method public void onScanCompleted(String, android.net.Uri);
  }

  public final class MediaSync {
    ctor public MediaSync();
    method @NonNull public android.view.Surface createInputSurface();
    method protected void finalize();
    method public void flush();
    method @NonNull public android.media.PlaybackParams getPlaybackParams();
    method @NonNull public android.media.SyncParams getSyncParams();
    method @Nullable public android.media.MediaTimestamp getTimestamp();
    method public void queueAudio(@NonNull java.nio.ByteBuffer, int, long);
    method public void release();
    method public void setAudioTrack(@Nullable android.media.AudioTrack);
    method public void setCallback(@Nullable android.media.MediaSync.Callback, @Nullable android.os.Handler);
    method public void setOnErrorListener(@Nullable android.media.MediaSync.OnErrorListener, @Nullable android.os.Handler);
    method public void setPlaybackParams(@NonNull android.media.PlaybackParams);
    method public void setSurface(@Nullable android.view.Surface);
    method public void setSyncParams(@NonNull android.media.SyncParams);
    field public static final int MEDIASYNC_ERROR_AUDIOTRACK_FAIL = 1; // 0x1
    field public static final int MEDIASYNC_ERROR_SURFACE_FAIL = 2; // 0x2
  }

  public abstract static class MediaSync.Callback {
    ctor public MediaSync.Callback();
    method public abstract void onAudioBufferConsumed(@NonNull android.media.MediaSync, @NonNull java.nio.ByteBuffer, int);
  }

  public static interface MediaSync.OnErrorListener {
    method public void onError(@NonNull android.media.MediaSync, int, int);
  }

  public class MediaSyncEvent {
    method public static android.media.MediaSyncEvent createEvent(int) throws java.lang.IllegalArgumentException;
    method public int getAudioSessionId();
    method public int getType();
    method public android.media.MediaSyncEvent setAudioSessionId(int) throws java.lang.IllegalArgumentException;
    field public static final int SYNC_EVENT_NONE = 0; // 0x0
    field public static final int SYNC_EVENT_PRESENTATION_COMPLETE = 1; // 0x1
  }

  public final class MediaTimestamp {
    method public long getAnchorMediaTimeUs();
    method public long getAnchorSytemNanoTime();
    method public float getMediaClockRate();
    field public static final android.media.MediaTimestamp TIMESTAMP_UNKNOWN;
  }

  public final class MicrophoneInfo {
    method @NonNull public String getAddress();
    method public java.util.List<android.util.Pair<java.lang.Integer,java.lang.Integer>> getChannelMapping();
    method public String getDescription();
    method public int getDirectionality();
    method public java.util.List<android.util.Pair<java.lang.Float,java.lang.Float>> getFrequencyResponse();
    method public int getGroup();
    method public int getId();
    method public int getIndexInTheGroup();
    method public int getLocation();
    method public float getMaxSpl();
    method public float getMinSpl();
    method public android.media.MicrophoneInfo.Coordinate3F getOrientation();
    method public android.media.MicrophoneInfo.Coordinate3F getPosition();
    method public float getSensitivity();
    method public int getType();
    field public static final int CHANNEL_MAPPING_DIRECT = 1; // 0x1
    field public static final int CHANNEL_MAPPING_PROCESSED = 2; // 0x2
    field public static final int DIRECTIONALITY_BI_DIRECTIONAL = 2; // 0x2
    field public static final int DIRECTIONALITY_CARDIOID = 3; // 0x3
    field public static final int DIRECTIONALITY_HYPER_CARDIOID = 4; // 0x4
    field public static final int DIRECTIONALITY_OMNI = 1; // 0x1
    field public static final int DIRECTIONALITY_SUPER_CARDIOID = 5; // 0x5
    field public static final int DIRECTIONALITY_UNKNOWN = 0; // 0x0
    field public static final int GROUP_UNKNOWN = -1; // 0xffffffff
    field public static final int INDEX_IN_THE_GROUP_UNKNOWN = -1; // 0xffffffff
    field public static final int LOCATION_MAINBODY = 1; // 0x1
    field public static final int LOCATION_MAINBODY_MOVABLE = 2; // 0x2
    field public static final int LOCATION_PERIPHERAL = 3; // 0x3
    field public static final int LOCATION_UNKNOWN = 0; // 0x0
    field public static final android.media.MicrophoneInfo.Coordinate3F ORIENTATION_UNKNOWN;
    field public static final android.media.MicrophoneInfo.Coordinate3F POSITION_UNKNOWN;
    field public static final float SENSITIVITY_UNKNOWN = -3.4028235E38f;
    field public static final float SPL_UNKNOWN = -3.4028235E38f;
  }

  public static final class MicrophoneInfo.Coordinate3F {
    field public final float x;
    field public final float y;
    field public final float z;
  }

  public final class NotProvisionedException extends android.media.MediaDrmException {
    ctor public NotProvisionedException(String);
  }

  public final class PlaybackParams implements android.os.Parcelable {
    ctor public PlaybackParams();
    method public android.media.PlaybackParams allowDefaults();
    method public int describeContents();
    method public int getAudioFallbackMode();
    method public float getPitch();
    method public float getSpeed();
    method public android.media.PlaybackParams setAudioFallbackMode(int);
    method public android.media.PlaybackParams setPitch(float);
    method public android.media.PlaybackParams setSpeed(float);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int AUDIO_FALLBACK_MODE_DEFAULT = 0; // 0x0
    field public static final int AUDIO_FALLBACK_MODE_FAIL = 2; // 0x2
    field public static final int AUDIO_FALLBACK_MODE_MUTE = 1; // 0x1
    field public static final android.os.Parcelable.Creator<android.media.PlaybackParams> CREATOR;
  }

  public final class Rating implements android.os.Parcelable {
    method public int describeContents();
    method public float getPercentRating();
    method public int getRatingStyle();
    method public float getStarRating();
    method public boolean hasHeart();
    method public boolean isRated();
    method public boolean isThumbUp();
    method public static android.media.Rating newHeartRating(boolean);
    method public static android.media.Rating newPercentageRating(float);
    method public static android.media.Rating newStarRating(int, float);
    method public static android.media.Rating newThumbRating(boolean);
    method public static android.media.Rating newUnratedRating(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.Rating> CREATOR;
    field public static final int RATING_3_STARS = 3; // 0x3
    field public static final int RATING_4_STARS = 4; // 0x4
    field public static final int RATING_5_STARS = 5; // 0x5
    field public static final int RATING_HEART = 1; // 0x1
    field public static final int RATING_NONE = 0; // 0x0
    field public static final int RATING_PERCENTAGE = 6; // 0x6
    field public static final int RATING_THUMB_UP_DOWN = 2; // 0x2
  }

  @Deprecated public class RemoteControlClient {
    ctor @Deprecated public RemoteControlClient(android.app.PendingIntent);
    ctor @Deprecated public RemoteControlClient(android.app.PendingIntent, android.os.Looper);
    method @Deprecated public android.media.RemoteControlClient.MetadataEditor editMetadata(boolean);
    method @Deprecated public android.media.session.MediaSession getMediaSession();
    method @Deprecated public void setMetadataUpdateListener(android.media.RemoteControlClient.OnMetadataUpdateListener);
    method @Deprecated public void setOnGetPlaybackPositionListener(android.media.RemoteControlClient.OnGetPlaybackPositionListener);
    method @Deprecated public void setPlaybackPositionUpdateListener(android.media.RemoteControlClient.OnPlaybackPositionUpdateListener);
    method @Deprecated public void setPlaybackState(int);
    method @Deprecated public void setPlaybackState(int, long, float);
    method @Deprecated public void setTransportControlFlags(int);
    field @Deprecated public static final int FLAG_KEY_MEDIA_FAST_FORWARD = 64; // 0x40
    field @Deprecated public static final int FLAG_KEY_MEDIA_NEXT = 128; // 0x80
    field @Deprecated public static final int FLAG_KEY_MEDIA_PAUSE = 16; // 0x10
    field @Deprecated public static final int FLAG_KEY_MEDIA_PLAY = 4; // 0x4
    field @Deprecated public static final int FLAG_KEY_MEDIA_PLAY_PAUSE = 8; // 0x8
    field @Deprecated public static final int FLAG_KEY_MEDIA_POSITION_UPDATE = 256; // 0x100
    field @Deprecated public static final int FLAG_KEY_MEDIA_PREVIOUS = 1; // 0x1
    field @Deprecated public static final int FLAG_KEY_MEDIA_RATING = 512; // 0x200
    field @Deprecated public static final int FLAG_KEY_MEDIA_REWIND = 2; // 0x2
    field @Deprecated public static final int FLAG_KEY_MEDIA_STOP = 32; // 0x20
    field @Deprecated public static final int PLAYSTATE_BUFFERING = 8; // 0x8
    field @Deprecated public static final int PLAYSTATE_ERROR = 9; // 0x9
    field @Deprecated public static final int PLAYSTATE_FAST_FORWARDING = 4; // 0x4
    field @Deprecated public static final int PLAYSTATE_PAUSED = 2; // 0x2
    field @Deprecated public static final int PLAYSTATE_PLAYING = 3; // 0x3
    field @Deprecated public static final int PLAYSTATE_REWINDING = 5; // 0x5
    field @Deprecated public static final int PLAYSTATE_SKIPPING_BACKWARDS = 7; // 0x7
    field @Deprecated public static final int PLAYSTATE_SKIPPING_FORWARDS = 6; // 0x6
    field @Deprecated public static final int PLAYSTATE_STOPPED = 1; // 0x1
  }

  @Deprecated public class RemoteControlClient.MetadataEditor extends android.media.MediaMetadataEditor {
    method @Deprecated public void apply();
    method public Object clone() throws java.lang.CloneNotSupportedException;
    method @Deprecated public android.media.RemoteControlClient.MetadataEditor putBitmap(int, android.graphics.Bitmap) throws java.lang.IllegalArgumentException;
    method @Deprecated public android.media.RemoteControlClient.MetadataEditor putLong(int, long) throws java.lang.IllegalArgumentException;
    method @Deprecated public android.media.RemoteControlClient.MetadataEditor putObject(int, Object) throws java.lang.IllegalArgumentException;
    method @Deprecated public android.media.RemoteControlClient.MetadataEditor putString(int, String) throws java.lang.IllegalArgumentException;
    field @Deprecated public static final int BITMAP_KEY_ARTWORK = 100; // 0x64
  }

  @Deprecated public static interface RemoteControlClient.OnGetPlaybackPositionListener {
    method @Deprecated public long onGetPlaybackPosition();
  }

  @Deprecated public static interface RemoteControlClient.OnMetadataUpdateListener {
    method @Deprecated public void onMetadataUpdate(int, Object);
  }

  @Deprecated public static interface RemoteControlClient.OnPlaybackPositionUpdateListener {
    method @Deprecated public void onPlaybackPositionUpdate(long);
  }

  @Deprecated public final class RemoteController {
    ctor @Deprecated public RemoteController(android.content.Context, android.media.RemoteController.OnClientUpdateListener) throws java.lang.IllegalArgumentException;
    ctor @Deprecated public RemoteController(android.content.Context, android.media.RemoteController.OnClientUpdateListener, android.os.Looper) throws java.lang.IllegalArgumentException;
    method @Deprecated public boolean clearArtworkConfiguration();
    method @Deprecated public android.media.RemoteController.MetadataEditor editMetadata();
    method @Deprecated public long getEstimatedMediaPosition();
    method @Deprecated public boolean seekTo(long) throws java.lang.IllegalArgumentException;
    method @Deprecated public boolean sendMediaKeyEvent(android.view.KeyEvent) throws java.lang.IllegalArgumentException;
    method @Deprecated public boolean setArtworkConfiguration(int, int) throws java.lang.IllegalArgumentException;
    method @Deprecated public boolean setSynchronizationMode(int) throws java.lang.IllegalArgumentException;
    field @Deprecated public static final int POSITION_SYNCHRONIZATION_CHECK = 1; // 0x1
    field @Deprecated public static final int POSITION_SYNCHRONIZATION_NONE = 0; // 0x0
  }

  @Deprecated public class RemoteController.MetadataEditor extends android.media.MediaMetadataEditor {
    method @Deprecated public void apply();
  }

  @Deprecated public static interface RemoteController.OnClientUpdateListener {
    method @Deprecated public void onClientChange(boolean);
    method @Deprecated public void onClientMetadataUpdate(android.media.RemoteController.MetadataEditor);
    method @Deprecated public void onClientPlaybackStateUpdate(int);
    method @Deprecated public void onClientPlaybackStateUpdate(int, long, long, float);
    method @Deprecated public void onClientTransportControlUpdate(int);
  }

  public final class ResourceBusyException extends android.media.MediaDrmException {
    ctor public ResourceBusyException(String);
  }

  public class Ringtone {
    method protected void finalize();
    method public android.media.AudioAttributes getAudioAttributes();
    method @Deprecated public int getStreamType();
    method public String getTitle(android.content.Context);
    method public float getVolume();
    method public boolean isLooping();
    method public boolean isPlaying();
    method public void play();
    method public void setAudioAttributes(android.media.AudioAttributes) throws java.lang.IllegalArgumentException;
    method public void setLooping(boolean);
    method @Deprecated public void setStreamType(int);
    method public void setVolume(float);
    method public void stop();
  }

  public class RingtoneManager {
    ctor public RingtoneManager(android.app.Activity);
    ctor public RingtoneManager(android.content.Context);
    method public static android.net.Uri getActualDefaultRingtoneUri(android.content.Context, int);
    method public android.database.Cursor getCursor();
    method public static int getDefaultType(android.net.Uri);
    method public static android.net.Uri getDefaultUri(int);
    method @Deprecated public boolean getIncludeDrm();
    method public android.media.Ringtone getRingtone(int);
    method public static android.media.Ringtone getRingtone(android.content.Context, android.net.Uri);
    method public int getRingtonePosition(android.net.Uri);
    method public android.net.Uri getRingtoneUri(int);
    method public boolean getStopPreviousRingtone();
    method public static android.net.Uri getValidRingtoneUri(android.content.Context);
    method public int inferStreamType();
    method public static boolean isDefault(android.net.Uri);
    method public static void setActualDefaultRingtoneUri(android.content.Context, int, android.net.Uri);
    method @Deprecated public void setIncludeDrm(boolean);
    method public void setStopPreviousRingtone(boolean);
    method public void setType(int);
    method public void stopPreviousRingtone();
    field public static final String ACTION_RINGTONE_PICKER = "android.intent.action.RINGTONE_PICKER";
    field public static final String EXTRA_RINGTONE_DEFAULT_URI = "android.intent.extra.ringtone.DEFAULT_URI";
    field public static final String EXTRA_RINGTONE_EXISTING_URI = "android.intent.extra.ringtone.EXISTING_URI";
    field @Deprecated public static final String EXTRA_RINGTONE_INCLUDE_DRM = "android.intent.extra.ringtone.INCLUDE_DRM";
    field public static final String EXTRA_RINGTONE_PICKED_URI = "android.intent.extra.ringtone.PICKED_URI";
    field public static final String EXTRA_RINGTONE_SHOW_DEFAULT = "android.intent.extra.ringtone.SHOW_DEFAULT";
    field public static final String EXTRA_RINGTONE_SHOW_SILENT = "android.intent.extra.ringtone.SHOW_SILENT";
    field public static final String EXTRA_RINGTONE_TITLE = "android.intent.extra.ringtone.TITLE";
    field public static final String EXTRA_RINGTONE_TYPE = "android.intent.extra.ringtone.TYPE";
    field public static final int ID_COLUMN_INDEX = 0; // 0x0
    field public static final int TITLE_COLUMN_INDEX = 1; // 0x1
    field public static final int TYPE_ALARM = 4; // 0x4
    field public static final int TYPE_ALL = 7; // 0x7
    field public static final int TYPE_NOTIFICATION = 2; // 0x2
    field public static final int TYPE_RINGTONE = 1; // 0x1
    field public static final int URI_COLUMN_INDEX = 2; // 0x2
  }

  public class SoundPool {
    ctor @Deprecated public SoundPool(int, int, int);
    method public final void autoPause();
    method public final void autoResume();
    method public static void deprecateStreamTypeForPlayback(int, String, String) throws java.lang.IllegalArgumentException;
    method protected void finalize();
    method public int load(String, int);
    method public int load(android.content.Context, int, int);
    method public int load(android.content.res.AssetFileDescriptor, int);
    method public int load(java.io.FileDescriptor, long, long, int);
    method public final void pause(int);
    method public final int play(int, float, float, int, int, float);
    method public final void release();
    method public final void resume(int);
    method public final void setLoop(int, int);
    method public void setOnLoadCompleteListener(android.media.SoundPool.OnLoadCompleteListener);
    method public final void setPriority(int, int);
    method public final void setRate(int, float);
    method public final void setVolume(int, float, float);
    method public final void stop(int);
    method public final boolean unload(int);
  }

  public static class SoundPool.Builder {
    ctor public SoundPool.Builder();
    method public android.media.SoundPool build();
    method public android.media.SoundPool.Builder setAudioAttributes(android.media.AudioAttributes) throws java.lang.IllegalArgumentException;
    method public android.media.SoundPool.Builder setMaxStreams(int) throws java.lang.IllegalArgumentException;
  }

  public static interface SoundPool.OnLoadCompleteListener {
    method public void onLoadComplete(android.media.SoundPool, int, int);
  }

  public final class SubtitleData {
    method @NonNull public byte[] getData();
    method public long getDurationUs();
    method public long getStartTimeUs();
    method public int getTrackIndex();
  }

  public final class SyncParams {
    ctor public SyncParams();
    method public android.media.SyncParams allowDefaults();
    method public int getAudioAdjustMode();
    method public float getFrameRate();
    method public int getSyncSource();
    method public float getTolerance();
    method public android.media.SyncParams setAudioAdjustMode(int);
    method public android.media.SyncParams setFrameRate(float);
    method public android.media.SyncParams setSyncSource(int);
    method public android.media.SyncParams setTolerance(float);
    field public static final int AUDIO_ADJUST_MODE_DEFAULT = 0; // 0x0
    field public static final int AUDIO_ADJUST_MODE_RESAMPLE = 2; // 0x2
    field public static final int AUDIO_ADJUST_MODE_STRETCH = 1; // 0x1
    field public static final int SYNC_SOURCE_AUDIO = 2; // 0x2
    field public static final int SYNC_SOURCE_DEFAULT = 0; // 0x0
    field public static final int SYNC_SOURCE_SYSTEM_CLOCK = 1; // 0x1
    field public static final int SYNC_SOURCE_VSYNC = 3; // 0x3
  }

  public class ThumbnailUtils {
    ctor public ThumbnailUtils();
    method public static android.graphics.Bitmap createVideoThumbnail(String, int);
    method public static android.graphics.Bitmap extractThumbnail(android.graphics.Bitmap, int, int);
    method public static android.graphics.Bitmap extractThumbnail(android.graphics.Bitmap, int, int, int);
    field public static final int OPTIONS_RECYCLE_INPUT = 2; // 0x2
  }

  public final class TimedMetaData {
    method public byte[] getMetaData();
    method public long getTimestamp();
  }

  public final class TimedText {
    method public android.graphics.Rect getBounds();
    method public String getText();
  }

  public class ToneGenerator {
    ctor public ToneGenerator(int, int);
    method protected void finalize();
    method public final int getAudioSessionId();
    method public void release();
    method public boolean startTone(int);
    method public boolean startTone(int, int);
    method public void stopTone();
    field public static final int MAX_VOLUME = 100; // 0x64
    field public static final int MIN_VOLUME = 0; // 0x0
    field public static final int TONE_CDMA_ABBR_ALERT = 97; // 0x61
    field public static final int TONE_CDMA_ABBR_INTERCEPT = 37; // 0x25
    field public static final int TONE_CDMA_ABBR_REORDER = 39; // 0x27
    field public static final int TONE_CDMA_ALERT_AUTOREDIAL_LITE = 87; // 0x57
    field public static final int TONE_CDMA_ALERT_CALL_GUARD = 93; // 0x5d
    field public static final int TONE_CDMA_ALERT_INCALL_LITE = 91; // 0x5b
    field public static final int TONE_CDMA_ALERT_NETWORK_LITE = 86; // 0x56
    field public static final int TONE_CDMA_ANSWER = 42; // 0x2a
    field public static final int TONE_CDMA_CALLDROP_LITE = 95; // 0x5f
    field public static final int TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP = 46; // 0x2e
    field public static final int TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL = 45; // 0x2d
    field public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT3 = 48; // 0x30
    field public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT5 = 50; // 0x32
    field public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT6 = 51; // 0x33
    field public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT7 = 52; // 0x34
    field public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING = 49; // 0x31
    field public static final int TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI = 47; // 0x2f
    field public static final int TONE_CDMA_CONFIRM = 41; // 0x29
    field public static final int TONE_CDMA_DIAL_TONE_LITE = 34; // 0x22
    field public static final int TONE_CDMA_EMERGENCY_RINGBACK = 92; // 0x5c
    field public static final int TONE_CDMA_HIGH_L = 53; // 0x35
    field public static final int TONE_CDMA_HIGH_PBX_L = 71; // 0x47
    field public static final int TONE_CDMA_HIGH_PBX_SLS = 80; // 0x50
    field public static final int TONE_CDMA_HIGH_PBX_SS = 74; // 0x4a
    field public static final int TONE_CDMA_HIGH_PBX_SSL = 77; // 0x4d
    field public static final int TONE_CDMA_HIGH_PBX_S_X4 = 83; // 0x53
    field public static final int TONE_CDMA_HIGH_SLS = 65; // 0x41
    field public static final int TONE_CDMA_HIGH_SS = 56; // 0x38
    field public static final int TONE_CDMA_HIGH_SSL = 59; // 0x3b
    field public static final int TONE_CDMA_HIGH_SS_2 = 62; // 0x3e
    field public static final int TONE_CDMA_HIGH_S_X4 = 68; // 0x44
    field public static final int TONE_CDMA_INTERCEPT = 36; // 0x24
    field public static final int TONE_CDMA_KEYPAD_VOLUME_KEY_LITE = 89; // 0x59
    field public static final int TONE_CDMA_LOW_L = 55; // 0x37
    field public static final int TONE_CDMA_LOW_PBX_L = 73; // 0x49
    field public static final int TONE_CDMA_LOW_PBX_SLS = 82; // 0x52
    field public static final int TONE_CDMA_LOW_PBX_SS = 76; // 0x4c
    field public static final int TONE_CDMA_LOW_PBX_SSL = 79; // 0x4f
    field public static final int TONE_CDMA_LOW_PBX_S_X4 = 85; // 0x55
    field public static final int TONE_CDMA_LOW_SLS = 67; // 0x43
    field public static final int TONE_CDMA_LOW_SS = 58; // 0x3a
    field public static final int TONE_CDMA_LOW_SSL = 61; // 0x3d
    field public static final int TONE_CDMA_LOW_SS_2 = 64; // 0x40
    field public static final int TONE_CDMA_LOW_S_X4 = 70; // 0x46
    field public static final int TONE_CDMA_MED_L = 54; // 0x36
    field public static final int TONE_CDMA_MED_PBX_L = 72; // 0x48
    field public static final int TONE_CDMA_MED_PBX_SLS = 81; // 0x51
    field public static final int TONE_CDMA_MED_PBX_SS = 75; // 0x4b
    field public static final int TONE_CDMA_MED_PBX_SSL = 78; // 0x4e
    field public static final int TONE_CDMA_MED_PBX_S_X4 = 84; // 0x54
    field public static final int TONE_CDMA_MED_SLS = 66; // 0x42
    field public static final int TONE_CDMA_MED_SS = 57; // 0x39
    field public static final int TONE_CDMA_MED_SSL = 60; // 0x3c
    field public static final int TONE_CDMA_MED_SS_2 = 63; // 0x3f
    field public static final int TONE_CDMA_MED_S_X4 = 69; // 0x45
    field public static final int TONE_CDMA_NETWORK_BUSY = 40; // 0x28
    field public static final int TONE_CDMA_NETWORK_BUSY_ONE_SHOT = 96; // 0x60
    field public static final int TONE_CDMA_NETWORK_CALLWAITING = 43; // 0x2b
    field public static final int TONE_CDMA_NETWORK_USA_RINGBACK = 35; // 0x23
    field public static final int TONE_CDMA_ONE_MIN_BEEP = 88; // 0x58
    field public static final int TONE_CDMA_PIP = 44; // 0x2c
    field public static final int TONE_CDMA_PRESSHOLDKEY_LITE = 90; // 0x5a
    field public static final int TONE_CDMA_REORDER = 38; // 0x26
    field public static final int TONE_CDMA_SIGNAL_OFF = 98; // 0x62
    field public static final int TONE_CDMA_SOFT_ERROR_LITE = 94; // 0x5e
    field public static final int TONE_DTMF_0 = 0; // 0x0
    field public static final int TONE_DTMF_1 = 1; // 0x1
    field public static final int TONE_DTMF_2 = 2; // 0x2
    field public static final int TONE_DTMF_3 = 3; // 0x3
    field public static final int TONE_DTMF_4 = 4; // 0x4
    field public static final int TONE_DTMF_5 = 5; // 0x5
    field public static final int TONE_DTMF_6 = 6; // 0x6
    field public static final int TONE_DTMF_7 = 7; // 0x7
    field public static final int TONE_DTMF_8 = 8; // 0x8
    field public static final int TONE_DTMF_9 = 9; // 0x9
    field public static final int TONE_DTMF_A = 12; // 0xc
    field public static final int TONE_DTMF_B = 13; // 0xd
    field public static final int TONE_DTMF_C = 14; // 0xe
    field public static final int TONE_DTMF_D = 15; // 0xf
    field public static final int TONE_DTMF_P = 11; // 0xb
    field public static final int TONE_DTMF_S = 10; // 0xa
    field public static final int TONE_PROP_ACK = 25; // 0x19
    field public static final int TONE_PROP_BEEP = 24; // 0x18
    field public static final int TONE_PROP_BEEP2 = 28; // 0x1c
    field public static final int TONE_PROP_NACK = 26; // 0x1a
    field public static final int TONE_PROP_PROMPT = 27; // 0x1b
    field public static final int TONE_SUP_BUSY = 17; // 0x11
    field public static final int TONE_SUP_CALL_WAITING = 22; // 0x16
    field public static final int TONE_SUP_CONFIRM = 32; // 0x20
    field public static final int TONE_SUP_CONGESTION = 18; // 0x12
    field public static final int TONE_SUP_CONGESTION_ABBREV = 31; // 0x1f
    field public static final int TONE_SUP_DIAL = 16; // 0x10
    field public static final int TONE_SUP_ERROR = 21; // 0x15
    field public static final int TONE_SUP_INTERCEPT = 29; // 0x1d
    field public static final int TONE_SUP_INTERCEPT_ABBREV = 30; // 0x1e
    field public static final int TONE_SUP_PIP = 33; // 0x21
    field public static final int TONE_SUP_RADIO_ACK = 19; // 0x13
    field public static final int TONE_SUP_RADIO_NOTAVAIL = 20; // 0x14
    field public static final int TONE_SUP_RINGTONE = 23; // 0x17
  }

  public final class UnsupportedSchemeException extends android.media.MediaDrmException {
    ctor public UnsupportedSchemeException(String);
  }

  public interface VolumeAutomation {
    method @NonNull public android.media.VolumeShaper createVolumeShaper(@NonNull android.media.VolumeShaper.Configuration);
  }

  public abstract class VolumeProvider {
    ctor public VolumeProvider(int, int, int);
    method public final int getCurrentVolume();
    method public final int getMaxVolume();
    method public final int getVolumeControl();
    method public void onAdjustVolume(int);
    method public void onSetVolumeTo(int);
    method public final void setCurrentVolume(int);
    field public static final int VOLUME_CONTROL_ABSOLUTE = 2; // 0x2
    field public static final int VOLUME_CONTROL_FIXED = 0; // 0x0
    field public static final int VOLUME_CONTROL_RELATIVE = 1; // 0x1
  }

  public final class VolumeShaper implements java.lang.AutoCloseable {
    method public void apply(@NonNull android.media.VolumeShaper.Operation);
    method public void close();
    method protected void finalize();
    method public float getVolume();
    method public void replace(@NonNull android.media.VolumeShaper.Configuration, @NonNull android.media.VolumeShaper.Operation, boolean);
  }

  public static final class VolumeShaper.Configuration implements android.os.Parcelable {
    method public int describeContents();
    method public long getDuration();
    method public int getInterpolatorType();
    method public static int getMaximumCurvePoints();
    method public float[] getTimes();
    method public float[] getVolumes();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.VolumeShaper.Configuration> CREATOR;
    field public static final android.media.VolumeShaper.Configuration CUBIC_RAMP;
    field public static final int INTERPOLATOR_TYPE_CUBIC = 2; // 0x2
    field public static final int INTERPOLATOR_TYPE_CUBIC_MONOTONIC = 3; // 0x3
    field public static final int INTERPOLATOR_TYPE_LINEAR = 1; // 0x1
    field public static final int INTERPOLATOR_TYPE_STEP = 0; // 0x0
    field public static final android.media.VolumeShaper.Configuration LINEAR_RAMP;
    field public static final android.media.VolumeShaper.Configuration SCURVE_RAMP;
    field public static final android.media.VolumeShaper.Configuration SINE_RAMP;
  }

  public static final class VolumeShaper.Configuration.Builder {
    ctor public VolumeShaper.Configuration.Builder();
    ctor public VolumeShaper.Configuration.Builder(@NonNull android.media.VolumeShaper.Configuration);
    method @NonNull public android.media.VolumeShaper.Configuration build();
    method @NonNull public android.media.VolumeShaper.Configuration.Builder invertVolumes();
    method @NonNull public android.media.VolumeShaper.Configuration.Builder reflectTimes();
    method @NonNull public android.media.VolumeShaper.Configuration.Builder scaleToEndVolume(float);
    method @NonNull public android.media.VolumeShaper.Configuration.Builder scaleToStartVolume(float);
    method @NonNull public android.media.VolumeShaper.Configuration.Builder setCurve(@NonNull float[], @NonNull float[]);
    method @NonNull public android.media.VolumeShaper.Configuration.Builder setDuration(long);
    method @NonNull public android.media.VolumeShaper.Configuration.Builder setInterpolatorType(int);
  }

  public static final class VolumeShaper.Operation implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.VolumeShaper.Operation> CREATOR;
    field public static final android.media.VolumeShaper.Operation PLAY;
    field public static final android.media.VolumeShaper.Operation REVERSE;
  }

}

package android.media.audiofx {

  public class AcousticEchoCanceler extends android.media.audiofx.AudioEffect {
    method public static android.media.audiofx.AcousticEchoCanceler create(int);
    method public static boolean isAvailable();
  }

  public class AudioEffect {
    method protected void finalize();
    method public android.media.audiofx.AudioEffect.Descriptor getDescriptor() throws java.lang.IllegalStateException;
    method public boolean getEnabled() throws java.lang.IllegalStateException;
    method public int getId() throws java.lang.IllegalStateException;
    method public boolean hasControl() throws java.lang.IllegalStateException;
    method public static android.media.audiofx.AudioEffect.Descriptor[] queryEffects();
    method public void release();
    method public void setControlStatusListener(android.media.audiofx.AudioEffect.OnControlStatusChangeListener);
    method public void setEnableStatusListener(android.media.audiofx.AudioEffect.OnEnableStatusChangeListener);
    method public int setEnabled(boolean) throws java.lang.IllegalStateException;
    field public static final String ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION = "android.media.action.CLOSE_AUDIO_EFFECT_CONTROL_SESSION";
    field public static final String ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL = "android.media.action.DISPLAY_AUDIO_EFFECT_CONTROL_PANEL";
    field public static final String ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION = "android.media.action.OPEN_AUDIO_EFFECT_CONTROL_SESSION";
    field public static final int ALREADY_EXISTS = -2; // 0xfffffffe
    field public static final int CONTENT_TYPE_GAME = 2; // 0x2
    field public static final int CONTENT_TYPE_MOVIE = 1; // 0x1
    field public static final int CONTENT_TYPE_MUSIC = 0; // 0x0
    field public static final int CONTENT_TYPE_VOICE = 3; // 0x3
    field public static final String EFFECT_AUXILIARY = "Auxiliary";
    field public static final String EFFECT_INSERT = "Insert";
    field public static final java.util.UUID EFFECT_TYPE_AEC;
    field public static final java.util.UUID EFFECT_TYPE_AGC;
    field public static final java.util.UUID EFFECT_TYPE_BASS_BOOST;
    field public static final java.util.UUID EFFECT_TYPE_DYNAMICS_PROCESSING;
    field public static final java.util.UUID EFFECT_TYPE_ENV_REVERB;
    field public static final java.util.UUID EFFECT_TYPE_EQUALIZER;
    field public static final java.util.UUID EFFECT_TYPE_LOUDNESS_ENHANCER;
    field public static final java.util.UUID EFFECT_TYPE_NS;
    field public static final java.util.UUID EFFECT_TYPE_PRESET_REVERB;
    field public static final java.util.UUID EFFECT_TYPE_VIRTUALIZER;
    field public static final int ERROR = -1; // 0xffffffff
    field public static final int ERROR_BAD_VALUE = -4; // 0xfffffffc
    field public static final int ERROR_DEAD_OBJECT = -7; // 0xfffffff9
    field public static final int ERROR_INVALID_OPERATION = -5; // 0xfffffffb
    field public static final int ERROR_NO_INIT = -3; // 0xfffffffd
    field public static final int ERROR_NO_MEMORY = -6; // 0xfffffffa
    field public static final String EXTRA_AUDIO_SESSION = "android.media.extra.AUDIO_SESSION";
    field public static final String EXTRA_CONTENT_TYPE = "android.media.extra.CONTENT_TYPE";
    field public static final String EXTRA_PACKAGE_NAME = "android.media.extra.PACKAGE_NAME";
    field public static final int SUCCESS = 0; // 0x0
  }

  public static class AudioEffect.Descriptor {
    ctor public AudioEffect.Descriptor();
    ctor public AudioEffect.Descriptor(String, String, String, String, String);
    field public String connectMode;
    field public String implementor;
    field public String name;
    field public java.util.UUID type;
    field public java.util.UUID uuid;
  }

  public static interface AudioEffect.OnControlStatusChangeListener {
    method public void onControlStatusChange(android.media.audiofx.AudioEffect, boolean);
  }

  public static interface AudioEffect.OnEnableStatusChangeListener {
    method public void onEnableStatusChange(android.media.audiofx.AudioEffect, boolean);
  }

  public class AutomaticGainControl extends android.media.audiofx.AudioEffect {
    method public static android.media.audiofx.AutomaticGainControl create(int);
    method public static boolean isAvailable();
  }

  public class BassBoost extends android.media.audiofx.AudioEffect {
    ctor public BassBoost(int, int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.RuntimeException, java.lang.UnsupportedOperationException;
    method public android.media.audiofx.BassBoost.Settings getProperties() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short getRoundedStrength() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public boolean getStrengthSupported();
    method public void setParameterListener(android.media.audiofx.BassBoost.OnParameterChangeListener);
    method public void setProperties(android.media.audiofx.BassBoost.Settings) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setStrength(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    field public static final int PARAM_STRENGTH = 1; // 0x1
    field public static final int PARAM_STRENGTH_SUPPORTED = 0; // 0x0
  }

  public static interface BassBoost.OnParameterChangeListener {
    method public void onParameterChange(android.media.audiofx.BassBoost, int, int, short);
  }

  public static class BassBoost.Settings {
    ctor public BassBoost.Settings();
    ctor public BassBoost.Settings(String);
    field public short strength;
  }

  public final class DynamicsProcessing extends android.media.audiofx.AudioEffect {
    ctor public DynamicsProcessing(int);
    ctor public DynamicsProcessing(int, int, @Nullable android.media.audiofx.DynamicsProcessing.Config);
    method public android.media.audiofx.DynamicsProcessing.Channel getChannelByChannelIndex(int);
    method public int getChannelCount();
    method public android.media.audiofx.DynamicsProcessing.Config getConfig();
    method public float getInputGainByChannelIndex(int);
    method public android.media.audiofx.DynamicsProcessing.Limiter getLimiterByChannelIndex(int);
    method public android.media.audiofx.DynamicsProcessing.MbcBand getMbcBandByChannelIndex(int, int);
    method public android.media.audiofx.DynamicsProcessing.Mbc getMbcByChannelIndex(int);
    method public android.media.audiofx.DynamicsProcessing.EqBand getPostEqBandByChannelIndex(int, int);
    method public android.media.audiofx.DynamicsProcessing.Eq getPostEqByChannelIndex(int);
    method public android.media.audiofx.DynamicsProcessing.EqBand getPreEqBandByChannelIndex(int, int);
    method public android.media.audiofx.DynamicsProcessing.Eq getPreEqByChannelIndex(int);
    method public void setAllChannelsTo(android.media.audiofx.DynamicsProcessing.Channel);
    method public void setChannelTo(int, android.media.audiofx.DynamicsProcessing.Channel);
    method public void setInputGainAllChannelsTo(float);
    method public void setInputGainbyChannel(int, float);
    method public void setLimiterAllChannelsTo(android.media.audiofx.DynamicsProcessing.Limiter);
    method public void setLimiterByChannelIndex(int, android.media.audiofx.DynamicsProcessing.Limiter);
    method public void setMbcAllChannelsTo(android.media.audiofx.DynamicsProcessing.Mbc);
    method public void setMbcBandAllChannelsTo(int, android.media.audiofx.DynamicsProcessing.MbcBand);
    method public void setMbcBandByChannelIndex(int, int, android.media.audiofx.DynamicsProcessing.MbcBand);
    method public void setMbcByChannelIndex(int, android.media.audiofx.DynamicsProcessing.Mbc);
    method public void setPostEqAllChannelsTo(android.media.audiofx.DynamicsProcessing.Eq);
    method public void setPostEqBandAllChannelsTo(int, android.media.audiofx.DynamicsProcessing.EqBand);
    method public void setPostEqBandByChannelIndex(int, int, android.media.audiofx.DynamicsProcessing.EqBand);
    method public void setPostEqByChannelIndex(int, android.media.audiofx.DynamicsProcessing.Eq);
    method public void setPreEqAllChannelsTo(android.media.audiofx.DynamicsProcessing.Eq);
    method public void setPreEqBandAllChannelsTo(int, android.media.audiofx.DynamicsProcessing.EqBand);
    method public void setPreEqBandByChannelIndex(int, int, android.media.audiofx.DynamicsProcessing.EqBand);
    method public void setPreEqByChannelIndex(int, android.media.audiofx.DynamicsProcessing.Eq);
    field public static final int VARIANT_FAVOR_FREQUENCY_RESOLUTION = 0; // 0x0
    field public static final int VARIANT_FAVOR_TIME_RESOLUTION = 1; // 0x1
  }

  public static class DynamicsProcessing.BandBase {
    ctor public DynamicsProcessing.BandBase(boolean, float);
    method public float getCutoffFrequency();
    method public boolean isEnabled();
    method public void setCutoffFrequency(float);
    method public void setEnabled(boolean);
  }

  public static class DynamicsProcessing.BandStage extends android.media.audiofx.DynamicsProcessing.Stage {
    ctor public DynamicsProcessing.BandStage(boolean, boolean, int);
    method public int getBandCount();
  }

  public static final class DynamicsProcessing.Channel {
    ctor public DynamicsProcessing.Channel(float, boolean, int, boolean, int, boolean, int, boolean);
    ctor public DynamicsProcessing.Channel(android.media.audiofx.DynamicsProcessing.Channel);
    method public float getInputGain();
    method public android.media.audiofx.DynamicsProcessing.Limiter getLimiter();
    method public android.media.audiofx.DynamicsProcessing.Mbc getMbc();
    method public android.media.audiofx.DynamicsProcessing.MbcBand getMbcBand(int);
    method public android.media.audiofx.DynamicsProcessing.Eq getPostEq();
    method public android.media.audiofx.DynamicsProcessing.EqBand getPostEqBand(int);
    method public android.media.audiofx.DynamicsProcessing.Eq getPreEq();
    method public android.media.audiofx.DynamicsProcessing.EqBand getPreEqBand(int);
    method public void setInputGain(float);
    method public void setLimiter(android.media.audiofx.DynamicsProcessing.Limiter);
    method public void setMbc(android.media.audiofx.DynamicsProcessing.Mbc);
    method public void setMbcBand(int, android.media.audiofx.DynamicsProcessing.MbcBand);
    method public void setPostEq(android.media.audiofx.DynamicsProcessing.Eq);
    method public void setPostEqBand(int, android.media.audiofx.DynamicsProcessing.EqBand);
    method public void setPreEq(android.media.audiofx.DynamicsProcessing.Eq);
    method public void setPreEqBand(int, android.media.audiofx.DynamicsProcessing.EqBand);
  }

  public static final class DynamicsProcessing.Config {
    method public android.media.audiofx.DynamicsProcessing.Channel getChannelByChannelIndex(int);
    method public float getInputGainByChannelIndex(int);
    method public android.media.audiofx.DynamicsProcessing.Limiter getLimiterByChannelIndex(int);
    method public android.media.audiofx.DynamicsProcessing.MbcBand getMbcBandByChannelIndex(int, int);
    method public int getMbcBandCount();
    method public android.media.audiofx.DynamicsProcessing.Mbc getMbcByChannelIndex(int);
    method public android.media.audiofx.DynamicsProcessing.EqBand getPostEqBandByChannelIndex(int, int);
    method public int getPostEqBandCount();
    method public android.media.audiofx.DynamicsProcessing.Eq getPostEqByChannelIndex(int);
    method public android.media.audiofx.DynamicsProcessing.EqBand getPreEqBandByChannelIndex(int, int);
    method public int getPreEqBandCount();
    method public android.media.audiofx.DynamicsProcessing.Eq getPreEqByChannelIndex(int);
    method public float getPreferredFrameDuration();
    method public int getVariant();
    method public boolean isLimiterInUse();
    method public boolean isMbcInUse();
    method public boolean isPostEqInUse();
    method public boolean isPreEqInUse();
    method public void setAllChannelsTo(android.media.audiofx.DynamicsProcessing.Channel);
    method public void setChannelTo(int, android.media.audiofx.DynamicsProcessing.Channel);
    method public void setInputGainAllChannelsTo(float);
    method public void setInputGainByChannelIndex(int, float);
    method public void setLimiterAllChannelsTo(android.media.audiofx.DynamicsProcessing.Limiter);
    method public void setLimiterByChannelIndex(int, android.media.audiofx.DynamicsProcessing.Limiter);
    method public void setMbcAllChannelsTo(android.media.audiofx.DynamicsProcessing.Mbc);
    method public void setMbcBandAllChannelsTo(int, android.media.audiofx.DynamicsProcessing.MbcBand);
    method public void setMbcBandByChannelIndex(int, int, android.media.audiofx.DynamicsProcessing.MbcBand);
    method public void setMbcByChannelIndex(int, android.media.audiofx.DynamicsProcessing.Mbc);
    method public void setPostEqAllChannelsTo(android.media.audiofx.DynamicsProcessing.Eq);
    method public void setPostEqBandAllChannelsTo(int, android.media.audiofx.DynamicsProcessing.EqBand);
    method public void setPostEqBandByChannelIndex(int, int, android.media.audiofx.DynamicsProcessing.EqBand);
    method public void setPostEqByChannelIndex(int, android.media.audiofx.DynamicsProcessing.Eq);
    method public void setPreEqAllChannelsTo(android.media.audiofx.DynamicsProcessing.Eq);
    method public void setPreEqBandAllChannelsTo(int, android.media.audiofx.DynamicsProcessing.EqBand);
    method public void setPreEqBandByChannelIndex(int, int, android.media.audiofx.DynamicsProcessing.EqBand);
    method public void setPreEqByChannelIndex(int, android.media.audiofx.DynamicsProcessing.Eq);
  }

  public static final class DynamicsProcessing.Config.Builder {
    ctor public DynamicsProcessing.Config.Builder(int, int, boolean, int, boolean, int, boolean, int, boolean);
    method public android.media.audiofx.DynamicsProcessing.Config build();
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setAllChannelsTo(android.media.audiofx.DynamicsProcessing.Channel);
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setChannelTo(int, android.media.audiofx.DynamicsProcessing.Channel);
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setInputGainAllChannelsTo(float);
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setInputGainByChannelIndex(int, float);
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setLimiterAllChannelsTo(android.media.audiofx.DynamicsProcessing.Limiter);
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setLimiterByChannelIndex(int, android.media.audiofx.DynamicsProcessing.Limiter);
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setMbcAllChannelsTo(android.media.audiofx.DynamicsProcessing.Mbc);
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setMbcByChannelIndex(int, android.media.audiofx.DynamicsProcessing.Mbc);
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setPostEqAllChannelsTo(android.media.audiofx.DynamicsProcessing.Eq);
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setPostEqByChannelIndex(int, android.media.audiofx.DynamicsProcessing.Eq);
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setPreEqAllChannelsTo(android.media.audiofx.DynamicsProcessing.Eq);
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setPreEqByChannelIndex(int, android.media.audiofx.DynamicsProcessing.Eq);
    method public android.media.audiofx.DynamicsProcessing.Config.Builder setPreferredFrameDuration(float);
  }

  public static final class DynamicsProcessing.Eq extends android.media.audiofx.DynamicsProcessing.BandStage {
    ctor public DynamicsProcessing.Eq(boolean, boolean, int);
    ctor public DynamicsProcessing.Eq(android.media.audiofx.DynamicsProcessing.Eq);
    method public android.media.audiofx.DynamicsProcessing.EqBand getBand(int);
    method public void setBand(int, android.media.audiofx.DynamicsProcessing.EqBand);
  }

  public static final class DynamicsProcessing.EqBand extends android.media.audiofx.DynamicsProcessing.BandBase {
    ctor public DynamicsProcessing.EqBand(boolean, float, float);
    ctor public DynamicsProcessing.EqBand(android.media.audiofx.DynamicsProcessing.EqBand);
    method public float getGain();
    method public void setGain(float);
  }

  public static final class DynamicsProcessing.Limiter extends android.media.audiofx.DynamicsProcessing.Stage {
    ctor public DynamicsProcessing.Limiter(boolean, boolean, int, float, float, float, float, float);
    ctor public DynamicsProcessing.Limiter(android.media.audiofx.DynamicsProcessing.Limiter);
    method public float getAttackTime();
    method public int getLinkGroup();
    method public float getPostGain();
    method public float getRatio();
    method public float getReleaseTime();
    method public float getThreshold();
    method public void setAttackTime(float);
    method public void setLinkGroup(int);
    method public void setPostGain(float);
    method public void setRatio(float);
    method public void setReleaseTime(float);
    method public void setThreshold(float);
  }

  public static final class DynamicsProcessing.Mbc extends android.media.audiofx.DynamicsProcessing.BandStage {
    ctor public DynamicsProcessing.Mbc(boolean, boolean, int);
    ctor public DynamicsProcessing.Mbc(android.media.audiofx.DynamicsProcessing.Mbc);
    method public android.media.audiofx.DynamicsProcessing.MbcBand getBand(int);
    method public void setBand(int, android.media.audiofx.DynamicsProcessing.MbcBand);
  }

  public static final class DynamicsProcessing.MbcBand extends android.media.audiofx.DynamicsProcessing.BandBase {
    ctor public DynamicsProcessing.MbcBand(boolean, float, float, float, float, float, float, float, float, float, float);
    ctor public DynamicsProcessing.MbcBand(android.media.audiofx.DynamicsProcessing.MbcBand);
    method public float getAttackTime();
    method public float getExpanderRatio();
    method public float getKneeWidth();
    method public float getNoiseGateThreshold();
    method public float getPostGain();
    method public float getPreGain();
    method public float getRatio();
    method public float getReleaseTime();
    method public float getThreshold();
    method public void setAttackTime(float);
    method public void setExpanderRatio(float);
    method public void setKneeWidth(float);
    method public void setNoiseGateThreshold(float);
    method public void setPostGain(float);
    method public void setPreGain(float);
    method public void setRatio(float);
    method public void setReleaseTime(float);
    method public void setThreshold(float);
  }

  public static class DynamicsProcessing.Stage {
    ctor public DynamicsProcessing.Stage(boolean, boolean);
    method public boolean isEnabled();
    method public boolean isInUse();
    method public void setEnabled(boolean);
  }

  public class EnvironmentalReverb extends android.media.audiofx.AudioEffect {
    ctor public EnvironmentalReverb(int, int) throws java.lang.IllegalArgumentException, java.lang.RuntimeException, java.lang.UnsupportedOperationException;
    method public short getDecayHFRatio() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public int getDecayTime() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short getDensity() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short getDiffusion() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public android.media.audiofx.EnvironmentalReverb.Settings getProperties() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public int getReflectionsDelay() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short getReflectionsLevel() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public int getReverbDelay() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short getReverbLevel() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short getRoomHFLevel() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short getRoomLevel() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setDecayHFRatio(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setDecayTime(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setDensity(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setDiffusion(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setParameterListener(android.media.audiofx.EnvironmentalReverb.OnParameterChangeListener);
    method public void setProperties(android.media.audiofx.EnvironmentalReverb.Settings) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setReflectionsDelay(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setReflectionsLevel(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setReverbDelay(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setReverbLevel(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setRoomHFLevel(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setRoomLevel(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    field public static final int PARAM_DECAY_HF_RATIO = 3; // 0x3
    field public static final int PARAM_DECAY_TIME = 2; // 0x2
    field public static final int PARAM_DENSITY = 9; // 0x9
    field public static final int PARAM_DIFFUSION = 8; // 0x8
    field public static final int PARAM_REFLECTIONS_DELAY = 5; // 0x5
    field public static final int PARAM_REFLECTIONS_LEVEL = 4; // 0x4
    field public static final int PARAM_REVERB_DELAY = 7; // 0x7
    field public static final int PARAM_REVERB_LEVEL = 6; // 0x6
    field public static final int PARAM_ROOM_HF_LEVEL = 1; // 0x1
    field public static final int PARAM_ROOM_LEVEL = 0; // 0x0
  }

  public static interface EnvironmentalReverb.OnParameterChangeListener {
    method public void onParameterChange(android.media.audiofx.EnvironmentalReverb, int, int, int);
  }

  public static class EnvironmentalReverb.Settings {
    ctor public EnvironmentalReverb.Settings();
    ctor public EnvironmentalReverb.Settings(String);
    field public short decayHFRatio;
    field public int decayTime;
    field public short density;
    field public short diffusion;
    field public int reflectionsDelay;
    field public short reflectionsLevel;
    field public int reverbDelay;
    field public short reverbLevel;
    field public short roomHFLevel;
    field public short roomLevel;
  }

  public class Equalizer extends android.media.audiofx.AudioEffect {
    ctor public Equalizer(int, int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.RuntimeException, java.lang.UnsupportedOperationException;
    method public short getBand(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public int[] getBandFreqRange(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short getBandLevel(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short[] getBandLevelRange() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public int getCenterFreq(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short getCurrentPreset() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short getNumberOfBands() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short getNumberOfPresets() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public String getPresetName(short);
    method public android.media.audiofx.Equalizer.Settings getProperties() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setBandLevel(short, short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setParameterListener(android.media.audiofx.Equalizer.OnParameterChangeListener);
    method public void setProperties(android.media.audiofx.Equalizer.Settings) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void usePreset(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    field public static final int PARAM_BAND_FREQ_RANGE = 4; // 0x4
    field public static final int PARAM_BAND_LEVEL = 2; // 0x2
    field public static final int PARAM_CENTER_FREQ = 3; // 0x3
    field public static final int PARAM_CURRENT_PRESET = 6; // 0x6
    field public static final int PARAM_GET_BAND = 5; // 0x5
    field public static final int PARAM_GET_NUM_OF_PRESETS = 7; // 0x7
    field public static final int PARAM_GET_PRESET_NAME = 8; // 0x8
    field public static final int PARAM_LEVEL_RANGE = 1; // 0x1
    field public static final int PARAM_NUM_BANDS = 0; // 0x0
    field public static final int PARAM_STRING_SIZE_MAX = 32; // 0x20
  }

  public static interface Equalizer.OnParameterChangeListener {
    method public void onParameterChange(android.media.audiofx.Equalizer, int, int, int, int);
  }

  public static class Equalizer.Settings {
    ctor public Equalizer.Settings();
    ctor public Equalizer.Settings(String);
    field public short[] bandLevels;
    field public short curPreset;
    field public short numBands;
  }

  public class LoudnessEnhancer extends android.media.audiofx.AudioEffect {
    ctor public LoudnessEnhancer(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.RuntimeException, java.lang.UnsupportedOperationException;
    method public float getTargetGain() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setTargetGain(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    field public static final int PARAM_TARGET_GAIN_MB = 0; // 0x0
  }

  public class NoiseSuppressor extends android.media.audiofx.AudioEffect {
    method public static android.media.audiofx.NoiseSuppressor create(int);
    method public static boolean isAvailable();
  }

  public class PresetReverb extends android.media.audiofx.AudioEffect {
    ctor public PresetReverb(int, int) throws java.lang.IllegalArgumentException, java.lang.RuntimeException, java.lang.UnsupportedOperationException;
    method public short getPreset() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public android.media.audiofx.PresetReverb.Settings getProperties() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setParameterListener(android.media.audiofx.PresetReverb.OnParameterChangeListener);
    method public void setPreset(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setProperties(android.media.audiofx.PresetReverb.Settings) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    field public static final int PARAM_PRESET = 0; // 0x0
    field public static final short PRESET_LARGEHALL = 5; // 0x5
    field public static final short PRESET_LARGEROOM = 3; // 0x3
    field public static final short PRESET_MEDIUMHALL = 4; // 0x4
    field public static final short PRESET_MEDIUMROOM = 2; // 0x2
    field public static final short PRESET_NONE = 0; // 0x0
    field public static final short PRESET_PLATE = 6; // 0x6
    field public static final short PRESET_SMALLROOM = 1; // 0x1
  }

  public static interface PresetReverb.OnParameterChangeListener {
    method public void onParameterChange(android.media.audiofx.PresetReverb, int, int, short);
  }

  public static class PresetReverb.Settings {
    ctor public PresetReverb.Settings();
    ctor public PresetReverb.Settings(String);
    field public short preset;
  }

  public class Virtualizer extends android.media.audiofx.AudioEffect {
    ctor public Virtualizer(int, int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.RuntimeException, java.lang.UnsupportedOperationException;
    method public boolean canVirtualize(int, int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public boolean forceVirtualizationMode(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public android.media.audiofx.Virtualizer.Settings getProperties() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public short getRoundedStrength() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public boolean getSpeakerAngles(int, int, int[]) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public boolean getStrengthSupported();
    method public int getVirtualizationMode() throws java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setParameterListener(android.media.audiofx.Virtualizer.OnParameterChangeListener);
    method public void setProperties(android.media.audiofx.Virtualizer.Settings) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    method public void setStrength(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
    field public static final int PARAM_STRENGTH = 1; // 0x1
    field public static final int PARAM_STRENGTH_SUPPORTED = 0; // 0x0
    field public static final int VIRTUALIZATION_MODE_AUTO = 1; // 0x1
    field public static final int VIRTUALIZATION_MODE_BINAURAL = 2; // 0x2
    field public static final int VIRTUALIZATION_MODE_OFF = 0; // 0x0
    field public static final int VIRTUALIZATION_MODE_TRANSAURAL = 3; // 0x3
  }

  public static interface Virtualizer.OnParameterChangeListener {
    method public void onParameterChange(android.media.audiofx.Virtualizer, int, int, short);
  }

  public static class Virtualizer.Settings {
    ctor public Virtualizer.Settings();
    ctor public Virtualizer.Settings(String);
    field public short strength;
  }

  public class Visualizer {
    ctor public Visualizer(int) throws java.lang.RuntimeException, java.lang.UnsupportedOperationException;
    method protected void finalize();
    method public int getCaptureSize() throws java.lang.IllegalStateException;
    method public static int[] getCaptureSizeRange();
    method public boolean getEnabled();
    method public int getFft(byte[]) throws java.lang.IllegalStateException;
    method public static int getMaxCaptureRate();
    method public int getMeasurementMode() throws java.lang.IllegalStateException;
    method public int getMeasurementPeakRms(android.media.audiofx.Visualizer.MeasurementPeakRms);
    method public int getSamplingRate() throws java.lang.IllegalStateException;
    method public int getScalingMode() throws java.lang.IllegalStateException;
    method public int getWaveForm(byte[]) throws java.lang.IllegalStateException;
    method public void release();
    method public int setCaptureSize(int) throws java.lang.IllegalStateException;
    method public int setDataCaptureListener(android.media.audiofx.Visualizer.OnDataCaptureListener, int, boolean, boolean);
    method public int setEnabled(boolean) throws java.lang.IllegalStateException;
    method public int setMeasurementMode(int) throws java.lang.IllegalStateException;
    method public int setScalingMode(int) throws java.lang.IllegalStateException;
    field public static final int ALREADY_EXISTS = -2; // 0xfffffffe
    field public static final int ERROR = -1; // 0xffffffff
    field public static final int ERROR_BAD_VALUE = -4; // 0xfffffffc
    field public static final int ERROR_DEAD_OBJECT = -7; // 0xfffffff9
    field public static final int ERROR_INVALID_OPERATION = -5; // 0xfffffffb
    field public static final int ERROR_NO_INIT = -3; // 0xfffffffd
    field public static final int ERROR_NO_MEMORY = -6; // 0xfffffffa
    field public static final int MEASUREMENT_MODE_NONE = 0; // 0x0
    field public static final int MEASUREMENT_MODE_PEAK_RMS = 1; // 0x1
    field public static final int SCALING_MODE_AS_PLAYED = 1; // 0x1
    field public static final int SCALING_MODE_NORMALIZED = 0; // 0x0
    field public static final int STATE_ENABLED = 2; // 0x2
    field public static final int STATE_INITIALIZED = 1; // 0x1
    field public static final int STATE_UNINITIALIZED = 0; // 0x0
    field public static final int SUCCESS = 0; // 0x0
  }

  public static final class Visualizer.MeasurementPeakRms {
    ctor public Visualizer.MeasurementPeakRms();
    field public int mPeak;
    field public int mRms;
  }

  public static interface Visualizer.OnDataCaptureListener {
    method public void onFftDataCapture(android.media.audiofx.Visualizer, byte[], int);
    method public void onWaveFormDataCapture(android.media.audiofx.Visualizer, byte[], int);
  }

}

package android.media.browse {

  public final class MediaBrowser {
    ctor public MediaBrowser(android.content.Context, android.content.ComponentName, android.media.browse.MediaBrowser.ConnectionCallback, android.os.Bundle);
    method public void connect();
    method public void disconnect();
    method @Nullable public android.os.Bundle getExtras();
    method public void getItem(@NonNull String, @NonNull android.media.browse.MediaBrowser.ItemCallback);
    method @NonNull public String getRoot();
    method @NonNull public android.content.ComponentName getServiceComponent();
    method @NonNull public android.media.session.MediaSession.Token getSessionToken();
    method public boolean isConnected();
    method public void subscribe(@NonNull String, @NonNull android.media.browse.MediaBrowser.SubscriptionCallback);
    method public void subscribe(@NonNull String, @NonNull android.os.Bundle, @NonNull android.media.browse.MediaBrowser.SubscriptionCallback);
    method public void unsubscribe(@NonNull String);
    method public void unsubscribe(@NonNull String, @NonNull android.media.browse.MediaBrowser.SubscriptionCallback);
    field public static final String EXTRA_PAGE = "android.media.browse.extra.PAGE";
    field public static final String EXTRA_PAGE_SIZE = "android.media.browse.extra.PAGE_SIZE";
  }

  public static class MediaBrowser.ConnectionCallback {
    ctor public MediaBrowser.ConnectionCallback();
    method public void onConnected();
    method public void onConnectionFailed();
    method public void onConnectionSuspended();
  }

  public abstract static class MediaBrowser.ItemCallback {
    ctor public MediaBrowser.ItemCallback();
    method public void onError(@NonNull String);
    method public void onItemLoaded(android.media.browse.MediaBrowser.MediaItem);
  }

  public static class MediaBrowser.MediaItem implements android.os.Parcelable {
    ctor public MediaBrowser.MediaItem(@NonNull android.media.MediaDescription, int);
    method public int describeContents();
    method @NonNull public android.media.MediaDescription getDescription();
    method public int getFlags();
    method @Nullable public String getMediaId();
    method public boolean isBrowsable();
    method public boolean isPlayable();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.browse.MediaBrowser.MediaItem> CREATOR;
    field public static final int FLAG_BROWSABLE = 1; // 0x1
    field public static final int FLAG_PLAYABLE = 2; // 0x2
  }

  public abstract static class MediaBrowser.SubscriptionCallback {
    ctor public MediaBrowser.SubscriptionCallback();
    method public void onChildrenLoaded(@NonNull String, @NonNull java.util.List<android.media.browse.MediaBrowser.MediaItem>);
    method public void onChildrenLoaded(@NonNull String, @NonNull java.util.List<android.media.browse.MediaBrowser.MediaItem>, @NonNull android.os.Bundle);
    method public void onError(@NonNull String);
    method public void onError(@NonNull String, @NonNull android.os.Bundle);
  }

}

package android.media.effect {

  public abstract class Effect {
    ctor public Effect();
    method public abstract void apply(int, int, int, int);
    method public abstract String getName();
    method public abstract void release();
    method public abstract void setParameter(String, Object);
    method public void setUpdateListener(android.media.effect.EffectUpdateListener);
  }

  public class EffectContext {
    method public static android.media.effect.EffectContext createWithCurrentGlContext();
    method public android.media.effect.EffectFactory getFactory();
    method public void release();
  }

  public class EffectFactory {
    method public android.media.effect.Effect createEffect(String);
    method public static boolean isEffectSupported(String);
    field public static final String EFFECT_AUTOFIX = "android.media.effect.effects.AutoFixEffect";
    field public static final String EFFECT_BACKDROPPER = "android.media.effect.effects.BackDropperEffect";
    field public static final String EFFECT_BITMAPOVERLAY = "android.media.effect.effects.BitmapOverlayEffect";
    field public static final String EFFECT_BLACKWHITE = "android.media.effect.effects.BlackWhiteEffect";
    field public static final String EFFECT_BRIGHTNESS = "android.media.effect.effects.BrightnessEffect";
    field public static final String EFFECT_CONTRAST = "android.media.effect.effects.ContrastEffect";
    field public static final String EFFECT_CROP = "android.media.effect.effects.CropEffect";
    field public static final String EFFECT_CROSSPROCESS = "android.media.effect.effects.CrossProcessEffect";
    field public static final String EFFECT_DOCUMENTARY = "android.media.effect.effects.DocumentaryEffect";
    field public static final String EFFECT_DUOTONE = "android.media.effect.effects.DuotoneEffect";
    field public static final String EFFECT_FILLLIGHT = "android.media.effect.effects.FillLightEffect";
    field public static final String EFFECT_FISHEYE = "android.media.effect.effects.FisheyeEffect";
    field public static final String EFFECT_FLIP = "android.media.effect.effects.FlipEffect";
    field public static final String EFFECT_GRAIN = "android.media.effect.effects.GrainEffect";
    field public static final String EFFECT_GRAYSCALE = "android.media.effect.effects.GrayscaleEffect";
    field public static final String EFFECT_LOMOISH = "android.media.effect.effects.LomoishEffect";
    field public static final String EFFECT_NEGATIVE = "android.media.effect.effects.NegativeEffect";
    field public static final String EFFECT_POSTERIZE = "android.media.effect.effects.PosterizeEffect";
    field public static final String EFFECT_REDEYE = "android.media.effect.effects.RedEyeEffect";
    field public static final String EFFECT_ROTATE = "android.media.effect.effects.RotateEffect";
    field public static final String EFFECT_SATURATE = "android.media.effect.effects.SaturateEffect";
    field public static final String EFFECT_SEPIA = "android.media.effect.effects.SepiaEffect";
    field public static final String EFFECT_SHARPEN = "android.media.effect.effects.SharpenEffect";
    field public static final String EFFECT_STRAIGHTEN = "android.media.effect.effects.StraightenEffect";
    field public static final String EFFECT_TEMPERATURE = "android.media.effect.effects.ColorTemperatureEffect";
    field public static final String EFFECT_TINT = "android.media.effect.effects.TintEffect";
    field public static final String EFFECT_VIGNETTE = "android.media.effect.effects.VignetteEffect";
  }

  public interface EffectUpdateListener {
    method public void onEffectUpdated(android.media.effect.Effect, Object);
  }

}

package android.media.midi {

  public final class MidiDevice implements java.io.Closeable {
    method public void close() throws java.io.IOException;
    method public android.media.midi.MidiDevice.MidiConnection connectPorts(android.media.midi.MidiInputPort, int);
    method public android.media.midi.MidiDeviceInfo getInfo();
    method public android.media.midi.MidiInputPort openInputPort(int);
    method public android.media.midi.MidiOutputPort openOutputPort(int);
  }

  public class MidiDevice.MidiConnection implements java.io.Closeable {
    method public void close() throws java.io.IOException;
  }

  public final class MidiDeviceInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getId();
    method public int getInputPortCount();
    method public int getOutputPortCount();
    method public android.media.midi.MidiDeviceInfo.PortInfo[] getPorts();
    method public android.os.Bundle getProperties();
    method public int getType();
    method public boolean isPrivate();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.midi.MidiDeviceInfo> CREATOR;
    field public static final String PROPERTY_BLUETOOTH_DEVICE = "bluetooth_device";
    field public static final String PROPERTY_MANUFACTURER = "manufacturer";
    field public static final String PROPERTY_NAME = "name";
    field public static final String PROPERTY_PRODUCT = "product";
    field public static final String PROPERTY_SERIAL_NUMBER = "serial_number";
    field public static final String PROPERTY_USB_DEVICE = "usb_device";
    field public static final String PROPERTY_VERSION = "version";
    field public static final int TYPE_BLUETOOTH = 3; // 0x3
    field public static final int TYPE_USB = 1; // 0x1
    field public static final int TYPE_VIRTUAL = 2; // 0x2
  }

  public static final class MidiDeviceInfo.PortInfo {
    method public String getName();
    method public int getPortNumber();
    method public int getType();
    field public static final int TYPE_INPUT = 1; // 0x1
    field public static final int TYPE_OUTPUT = 2; // 0x2
  }

  public abstract class MidiDeviceService extends android.app.Service {
    ctor public MidiDeviceService();
    method public final android.media.midi.MidiDeviceInfo getDeviceInfo();
    method public final android.media.midi.MidiReceiver[] getOutputPortReceivers();
    method public android.os.IBinder onBind(android.content.Intent);
    method public void onClose();
    method public void onDeviceStatusChanged(android.media.midi.MidiDeviceStatus);
    method public abstract android.media.midi.MidiReceiver[] onGetInputPortReceivers();
    field public static final String SERVICE_INTERFACE = "android.media.midi.MidiDeviceService";
  }

  public final class MidiDeviceStatus implements android.os.Parcelable {
    method public int describeContents();
    method public android.media.midi.MidiDeviceInfo getDeviceInfo();
    method public int getOutputPortOpenCount(int);
    method public boolean isInputPortOpen(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.midi.MidiDeviceStatus> CREATOR;
  }

  public final class MidiInputPort extends android.media.midi.MidiReceiver implements java.io.Closeable {
    method public void close() throws java.io.IOException;
    method public int getPortNumber();
    method public void onSend(byte[], int, int, long) throws java.io.IOException;
  }

  public final class MidiManager {
    method public android.media.midi.MidiDeviceInfo[] getDevices();
    method public void openBluetoothDevice(android.bluetooth.BluetoothDevice, android.media.midi.MidiManager.OnDeviceOpenedListener, android.os.Handler);
    method public void openDevice(android.media.midi.MidiDeviceInfo, android.media.midi.MidiManager.OnDeviceOpenedListener, android.os.Handler);
    method public void registerDeviceCallback(android.media.midi.MidiManager.DeviceCallback, android.os.Handler);
    method public void unregisterDeviceCallback(android.media.midi.MidiManager.DeviceCallback);
  }

  public static class MidiManager.DeviceCallback {
    ctor public MidiManager.DeviceCallback();
    method public void onDeviceAdded(android.media.midi.MidiDeviceInfo);
    method public void onDeviceRemoved(android.media.midi.MidiDeviceInfo);
    method public void onDeviceStatusChanged(android.media.midi.MidiDeviceStatus);
  }

  public static interface MidiManager.OnDeviceOpenedListener {
    method public void onDeviceOpened(android.media.midi.MidiDevice);
  }

  public final class MidiOutputPort extends android.media.midi.MidiSender implements java.io.Closeable {
    method public void close() throws java.io.IOException;
    method public int getPortNumber();
    method public void onConnect(android.media.midi.MidiReceiver);
    method public void onDisconnect(android.media.midi.MidiReceiver);
  }

  public abstract class MidiReceiver {
    ctor public MidiReceiver();
    ctor public MidiReceiver(int);
    method public void flush() throws java.io.IOException;
    method public final int getMaxMessageSize();
    method public void onFlush() throws java.io.IOException;
    method public abstract void onSend(byte[], int, int, long) throws java.io.IOException;
    method public void send(byte[], int, int) throws java.io.IOException;
    method public void send(byte[], int, int, long) throws java.io.IOException;
  }

  public abstract class MidiSender {
    ctor public MidiSender();
    method public void connect(android.media.midi.MidiReceiver);
    method public void disconnect(android.media.midi.MidiReceiver);
    method public abstract void onConnect(android.media.midi.MidiReceiver);
    method public abstract void onDisconnect(android.media.midi.MidiReceiver);
  }

}

package android.media.projection {

  public final class MediaProjection {
    method public android.hardware.display.VirtualDisplay createVirtualDisplay(@NonNull String, int, int, int, int, @Nullable android.view.Surface, @Nullable android.hardware.display.VirtualDisplay.Callback, @Nullable android.os.Handler);
    method public void registerCallback(android.media.projection.MediaProjection.Callback, android.os.Handler);
    method public void stop();
    method public void unregisterCallback(android.media.projection.MediaProjection.Callback);
  }

  public abstract static class MediaProjection.Callback {
    ctor public MediaProjection.Callback();
    method public void onStop();
  }

  public final class MediaProjectionManager {
    method public android.content.Intent createScreenCaptureIntent();
    method public android.media.projection.MediaProjection getMediaProjection(int, @NonNull android.content.Intent);
  }

}

package android.media.session {

  public final class MediaController {
    ctor public MediaController(@NonNull android.content.Context, @NonNull android.media.session.MediaSession.Token);
    method public void adjustVolume(int, int);
    method public boolean dispatchMediaButtonEvent(@NonNull android.view.KeyEvent);
    method @Nullable public android.os.Bundle getExtras();
    method public long getFlags();
    method @Nullable public android.media.MediaMetadata getMetadata();
    method public String getPackageName();
    method @Nullable public android.media.session.MediaController.PlaybackInfo getPlaybackInfo();
    method @Nullable public android.media.session.PlaybackState getPlaybackState();
    method @Nullable public java.util.List<android.media.session.MediaSession.QueueItem> getQueue();
    method @Nullable public CharSequence getQueueTitle();
    method public int getRatingType();
    method @Nullable public android.app.PendingIntent getSessionActivity();
    method @NonNull public android.media.session.MediaSession.Token getSessionToken();
    method @NonNull public android.media.session.MediaController.TransportControls getTransportControls();
    method public void registerCallback(@NonNull android.media.session.MediaController.Callback);
    method public void registerCallback(@NonNull android.media.session.MediaController.Callback, @Nullable android.os.Handler);
    method public void sendCommand(@NonNull String, @Nullable android.os.Bundle, @Nullable android.os.ResultReceiver);
    method public void setVolumeTo(int, int);
    method public void unregisterCallback(@NonNull android.media.session.MediaController.Callback);
  }

  public abstract static class MediaController.Callback {
    ctor public MediaController.Callback();
    method public void onAudioInfoChanged(android.media.session.MediaController.PlaybackInfo);
    method public void onExtrasChanged(@Nullable android.os.Bundle);
    method public void onMetadataChanged(@Nullable android.media.MediaMetadata);
    method public void onPlaybackStateChanged(@Nullable android.media.session.PlaybackState);
    method public void onQueueChanged(@Nullable java.util.List<android.media.session.MediaSession.QueueItem>);
    method public void onQueueTitleChanged(@Nullable CharSequence);
    method public void onSessionDestroyed();
    method public void onSessionEvent(@NonNull String, @Nullable android.os.Bundle);
  }

  public static final class MediaController.PlaybackInfo {
    method public android.media.AudioAttributes getAudioAttributes();
    method public int getCurrentVolume();
    method public int getMaxVolume();
    method public int getPlaybackType();
    method public int getVolumeControl();
    field public static final int PLAYBACK_TYPE_LOCAL = 1; // 0x1
    field public static final int PLAYBACK_TYPE_REMOTE = 2; // 0x2
  }

  public final class MediaController.TransportControls {
    method public void fastForward();
    method public void pause();
    method public void play();
    method public void playFromMediaId(String, android.os.Bundle);
    method public void playFromSearch(String, android.os.Bundle);
    method public void playFromUri(android.net.Uri, android.os.Bundle);
    method public void prepare();
    method public void prepareFromMediaId(String, android.os.Bundle);
    method public void prepareFromSearch(String, android.os.Bundle);
    method public void prepareFromUri(android.net.Uri, android.os.Bundle);
    method public void rewind();
    method public void seekTo(long);
    method public void sendCustomAction(@NonNull android.media.session.PlaybackState.CustomAction, @Nullable android.os.Bundle);
    method public void sendCustomAction(@NonNull String, @Nullable android.os.Bundle);
    method public void setRating(android.media.Rating);
    method public void skipToNext();
    method public void skipToPrevious();
    method public void skipToQueueItem(long);
    method public void stop();
  }

  public final class MediaSession {
    ctor public MediaSession(@NonNull android.content.Context, @NonNull String);
    method @NonNull public android.media.session.MediaController getController();
    method @NonNull public android.media.session.MediaSessionManager.RemoteUserInfo getCurrentControllerInfo();
    method @NonNull public android.media.session.MediaSession.Token getSessionToken();
    method public boolean isActive();
    method public void release();
    method public void sendSessionEvent(@NonNull String, @Nullable android.os.Bundle);
    method public void setActive(boolean);
    method public void setCallback(@Nullable android.media.session.MediaSession.Callback);
    method public void setCallback(@Nullable android.media.session.MediaSession.Callback, @Nullable android.os.Handler);
    method public void setExtras(@Nullable android.os.Bundle);
    method public void setFlags(int);
    method public void setMediaButtonReceiver(@Nullable android.app.PendingIntent);
    method public void setMetadata(@Nullable android.media.MediaMetadata);
    method public void setPlaybackState(@Nullable android.media.session.PlaybackState);
    method public void setPlaybackToLocal(android.media.AudioAttributes);
    method public void setPlaybackToRemote(@NonNull android.media.VolumeProvider);
    method public void setQueue(@Nullable java.util.List<android.media.session.MediaSession.QueueItem>);
    method public void setQueueTitle(@Nullable CharSequence);
    method public void setRatingType(int);
    method public void setSessionActivity(@Nullable android.app.PendingIntent);
    field @Deprecated public static final int FLAG_HANDLES_MEDIA_BUTTONS = 1; // 0x1
    field @Deprecated public static final int FLAG_HANDLES_TRANSPORT_CONTROLS = 2; // 0x2
  }

  public abstract static class MediaSession.Callback {
    ctor public MediaSession.Callback();
    method public void onCommand(@NonNull String, @Nullable android.os.Bundle, @Nullable android.os.ResultReceiver);
    method public void onCustomAction(@NonNull String, @Nullable android.os.Bundle);
    method public void onFastForward();
    method public boolean onMediaButtonEvent(@NonNull android.content.Intent);
    method public void onPause();
    method public void onPlay();
    method public void onPlayFromMediaId(String, android.os.Bundle);
    method public void onPlayFromSearch(String, android.os.Bundle);
    method public void onPlayFromUri(android.net.Uri, android.os.Bundle);
    method public void onPrepare();
    method public void onPrepareFromMediaId(String, android.os.Bundle);
    method public void onPrepareFromSearch(String, android.os.Bundle);
    method public void onPrepareFromUri(android.net.Uri, android.os.Bundle);
    method public void onRewind();
    method public void onSeekTo(long);
    method public void onSetRating(@NonNull android.media.Rating);
    method public void onSkipToNext();
    method public void onSkipToPrevious();
    method public void onSkipToQueueItem(long);
    method public void onStop();
  }

  public static final class MediaSession.QueueItem implements android.os.Parcelable {
    ctor public MediaSession.QueueItem(android.media.MediaDescription, long);
    method public int describeContents();
    method public android.media.MediaDescription getDescription();
    method public long getQueueId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.session.MediaSession.QueueItem> CREATOR;
    field public static final int UNKNOWN_ID = -1; // 0xffffffff
  }

  public static final class MediaSession.Token implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.session.MediaSession.Token> CREATOR;
  }

  public final class MediaSessionManager {
    method public void addOnActiveSessionsChangedListener(@NonNull android.media.session.MediaSessionManager.OnActiveSessionsChangedListener, @Nullable android.content.ComponentName);
    method public void addOnActiveSessionsChangedListener(@NonNull android.media.session.MediaSessionManager.OnActiveSessionsChangedListener, @Nullable android.content.ComponentName, @Nullable android.os.Handler);
    method @NonNull public java.util.List<android.media.session.MediaController> getActiveSessions(@Nullable android.content.ComponentName);
    method public boolean isTrustedForMediaControl(@NonNull android.media.session.MediaSessionManager.RemoteUserInfo);
    method public void removeOnActiveSessionsChangedListener(@NonNull android.media.session.MediaSessionManager.OnActiveSessionsChangedListener);
  }

  public static interface MediaSessionManager.OnActiveSessionsChangedListener {
    method public void onActiveSessionsChanged(@Nullable java.util.List<android.media.session.MediaController>);
  }

  public static final class MediaSessionManager.RemoteUserInfo {
    ctor public MediaSessionManager.RemoteUserInfo(@NonNull String, int, int);
    method public String getPackageName();
    method public int getPid();
    method public int getUid();
  }

  public final class PlaybackState implements android.os.Parcelable {
    method public int describeContents();
    method public long getActions();
    method public long getActiveQueueItemId();
    method public long getBufferedPosition();
    method public java.util.List<android.media.session.PlaybackState.CustomAction> getCustomActions();
    method public CharSequence getErrorMessage();
    method @Nullable public android.os.Bundle getExtras();
    method public long getLastPositionUpdateTime();
    method public float getPlaybackSpeed();
    method public long getPosition();
    method public int getState();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final long ACTION_FAST_FORWARD = 64L; // 0x40L
    field public static final long ACTION_PAUSE = 2L; // 0x2L
    field public static final long ACTION_PLAY = 4L; // 0x4L
    field public static final long ACTION_PLAY_FROM_MEDIA_ID = 1024L; // 0x400L
    field public static final long ACTION_PLAY_FROM_SEARCH = 2048L; // 0x800L
    field public static final long ACTION_PLAY_FROM_URI = 8192L; // 0x2000L
    field public static final long ACTION_PLAY_PAUSE = 512L; // 0x200L
    field public static final long ACTION_PREPARE = 16384L; // 0x4000L
    field public static final long ACTION_PREPARE_FROM_MEDIA_ID = 32768L; // 0x8000L
    field public static final long ACTION_PREPARE_FROM_SEARCH = 65536L; // 0x10000L
    field public static final long ACTION_PREPARE_FROM_URI = 131072L; // 0x20000L
    field public static final long ACTION_REWIND = 8L; // 0x8L
    field public static final long ACTION_SEEK_TO = 256L; // 0x100L
    field public static final long ACTION_SET_RATING = 128L; // 0x80L
    field public static final long ACTION_SKIP_TO_NEXT = 32L; // 0x20L
    field public static final long ACTION_SKIP_TO_PREVIOUS = 16L; // 0x10L
    field public static final long ACTION_SKIP_TO_QUEUE_ITEM = 4096L; // 0x1000L
    field public static final long ACTION_STOP = 1L; // 0x1L
    field public static final android.os.Parcelable.Creator<android.media.session.PlaybackState> CREATOR;
    field public static final long PLAYBACK_POSITION_UNKNOWN = -1L; // 0xffffffffffffffffL
    field public static final int STATE_BUFFERING = 6; // 0x6
    field public static final int STATE_CONNECTING = 8; // 0x8
    field public static final int STATE_ERROR = 7; // 0x7
    field public static final int STATE_FAST_FORWARDING = 4; // 0x4
    field public static final int STATE_NONE = 0; // 0x0
    field public static final int STATE_PAUSED = 2; // 0x2
    field public static final int STATE_PLAYING = 3; // 0x3
    field public static final int STATE_REWINDING = 5; // 0x5
    field public static final int STATE_SKIPPING_TO_NEXT = 10; // 0xa
    field public static final int STATE_SKIPPING_TO_PREVIOUS = 9; // 0x9
    field public static final int STATE_SKIPPING_TO_QUEUE_ITEM = 11; // 0xb
    field public static final int STATE_STOPPED = 1; // 0x1
  }

  public static final class PlaybackState.Builder {
    ctor public PlaybackState.Builder();
    ctor public PlaybackState.Builder(android.media.session.PlaybackState);
    method public android.media.session.PlaybackState.Builder addCustomAction(String, String, int);
    method public android.media.session.PlaybackState.Builder addCustomAction(android.media.session.PlaybackState.CustomAction);
    method public android.media.session.PlaybackState build();
    method public android.media.session.PlaybackState.Builder setActions(long);
    method public android.media.session.PlaybackState.Builder setActiveQueueItemId(long);
    method public android.media.session.PlaybackState.Builder setBufferedPosition(long);
    method public android.media.session.PlaybackState.Builder setErrorMessage(CharSequence);
    method public android.media.session.PlaybackState.Builder setExtras(android.os.Bundle);
    method public android.media.session.PlaybackState.Builder setState(int, long, float, long);
    method public android.media.session.PlaybackState.Builder setState(int, long, float);
  }

  public static final class PlaybackState.CustomAction implements android.os.Parcelable {
    method public int describeContents();
    method public String getAction();
    method public android.os.Bundle getExtras();
    method public int getIcon();
    method public CharSequence getName();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.session.PlaybackState.CustomAction> CREATOR;
  }

  public static final class PlaybackState.CustomAction.Builder {
    ctor public PlaybackState.CustomAction.Builder(String, CharSequence, @DrawableRes int);
    method public android.media.session.PlaybackState.CustomAction build();
    method public android.media.session.PlaybackState.CustomAction.Builder setExtras(android.os.Bundle);
  }

}

package android.media.tv {

  public final class TvContentRating {
    method public boolean contains(@NonNull android.media.tv.TvContentRating);
    method public static android.media.tv.TvContentRating createRating(String, String, String, java.lang.String...);
    method public String flattenToString();
    method public String getDomain();
    method public String getMainRating();
    method public String getRatingSystem();
    method public java.util.List<java.lang.String> getSubRatings();
    method public static android.media.tv.TvContentRating unflattenFromString(String);
    field public static final android.media.tv.TvContentRating UNRATED;
  }

  public final class TvContract {
    method public static android.net.Uri buildChannelLogoUri(long);
    method public static android.net.Uri buildChannelLogoUri(android.net.Uri);
    method public static android.net.Uri buildChannelUri(long);
    method public static android.net.Uri buildChannelUriForPassthroughInput(String);
    method public static android.net.Uri buildChannelsUriForInput(@Nullable String);
    method public static String buildInputId(android.content.ComponentName);
    method public static android.net.Uri buildPreviewProgramUri(long);
    method public static android.net.Uri buildPreviewProgramsUriForChannel(long);
    method public static android.net.Uri buildPreviewProgramsUriForChannel(android.net.Uri);
    method public static android.net.Uri buildProgramUri(long);
    method public static android.net.Uri buildProgramsUriForChannel(long);
    method public static android.net.Uri buildProgramsUriForChannel(android.net.Uri);
    method public static android.net.Uri buildProgramsUriForChannel(long, long, long);
    method public static android.net.Uri buildProgramsUriForChannel(android.net.Uri, long, long);
    method public static android.net.Uri buildRecordedProgramUri(long);
    method public static android.net.Uri buildWatchNextProgramUri(long);
    method public static boolean isChannelUri(@NonNull android.net.Uri);
    method public static boolean isChannelUriForPassthroughInput(@NonNull android.net.Uri);
    method public static boolean isChannelUriForTunerInput(@NonNull android.net.Uri);
    method public static boolean isProgramUri(@NonNull android.net.Uri);
    method public static boolean isRecordedProgramUri(@NonNull android.net.Uri);
    method public static void requestChannelBrowsable(android.content.Context, long);
    field public static final String ACTION_INITIALIZE_PROGRAMS = "android.media.tv.action.INITIALIZE_PROGRAMS";
    field public static final String ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT = "android.media.tv.action.PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT";
    field public static final String ACTION_PREVIEW_PROGRAM_BROWSABLE_DISABLED = "android.media.tv.action.PREVIEW_PROGRAM_BROWSABLE_DISABLED";
    field public static final String ACTION_REQUEST_CHANNEL_BROWSABLE = "android.media.tv.action.REQUEST_CHANNEL_BROWSABLE";
    field public static final String ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED = "android.media.tv.action.WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED";
    field public static final String AUTHORITY = "android.media.tv";
    field public static final String EXTRA_CHANNEL_ID = "android.media.tv.extra.CHANNEL_ID";
    field public static final String EXTRA_PREVIEW_PROGRAM_ID = "android.media.tv.extra.PREVIEW_PROGRAM_ID";
    field public static final String EXTRA_WATCH_NEXT_PROGRAM_ID = "android.media.tv.extra.WATCH_NEXT_PROGRAM_ID";
  }

  public static interface TvContract.BaseTvColumns extends android.provider.BaseColumns {
    field public static final String COLUMN_PACKAGE_NAME = "package_name";
  }

  public static final class TvContract.Channels implements android.media.tv.TvContract.BaseTvColumns {
    method @Nullable public static String getVideoResolution(String);
    field public static final String COLUMN_APP_LINK_COLOR = "app_link_color";
    field public static final String COLUMN_APP_LINK_ICON_URI = "app_link_icon_uri";
    field public static final String COLUMN_APP_LINK_INTENT_URI = "app_link_intent_uri";
    field public static final String COLUMN_APP_LINK_POSTER_ART_URI = "app_link_poster_art_uri";
    field public static final String COLUMN_APP_LINK_TEXT = "app_link_text";
    field public static final String COLUMN_BROWSABLE = "browsable";
    field public static final String COLUMN_DESCRIPTION = "description";
    field public static final String COLUMN_DISPLAY_NAME = "display_name";
    field public static final String COLUMN_DISPLAY_NUMBER = "display_number";
    field public static final String COLUMN_INPUT_ID = "input_id";
    field public static final String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
    field public static final String COLUMN_INTERNAL_PROVIDER_ID = "internal_provider_id";
    field public static final String COLUMN_LOCKED = "locked";
    field public static final String COLUMN_NETWORK_AFFILIATION = "network_affiliation";
    field public static final String COLUMN_ORIGINAL_NETWORK_ID = "original_network_id";
    field public static final String COLUMN_SEARCHABLE = "searchable";
    field public static final String COLUMN_SERVICE_ID = "service_id";
    field public static final String COLUMN_SERVICE_TYPE = "service_type";
    field public static final String COLUMN_TRANSIENT = "transient";
    field public static final String COLUMN_TRANSPORT_STREAM_ID = "transport_stream_id";
    field public static final String COLUMN_TYPE = "type";
    field public static final String COLUMN_VERSION_NUMBER = "version_number";
    field public static final String COLUMN_VIDEO_FORMAT = "video_format";
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/channel";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/channel";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String SERVICE_TYPE_AUDIO = "SERVICE_TYPE_AUDIO";
    field public static final String SERVICE_TYPE_AUDIO_VIDEO = "SERVICE_TYPE_AUDIO_VIDEO";
    field public static final String SERVICE_TYPE_OTHER = "SERVICE_TYPE_OTHER";
    field public static final String TYPE_1SEG = "TYPE_1SEG";
    field public static final String TYPE_ATSC_C = "TYPE_ATSC_C";
    field public static final String TYPE_ATSC_M_H = "TYPE_ATSC_M_H";
    field public static final String TYPE_ATSC_T = "TYPE_ATSC_T";
    field public static final String TYPE_CMMB = "TYPE_CMMB";
    field public static final String TYPE_DTMB = "TYPE_DTMB";
    field public static final String TYPE_DVB_C = "TYPE_DVB_C";
    field public static final String TYPE_DVB_C2 = "TYPE_DVB_C2";
    field public static final String TYPE_DVB_H = "TYPE_DVB_H";
    field public static final String TYPE_DVB_S = "TYPE_DVB_S";
    field public static final String TYPE_DVB_S2 = "TYPE_DVB_S2";
    field public static final String TYPE_DVB_SH = "TYPE_DVB_SH";
    field public static final String TYPE_DVB_T = "TYPE_DVB_T";
    field public static final String TYPE_DVB_T2 = "TYPE_DVB_T2";
    field public static final String TYPE_ISDB_C = "TYPE_ISDB_C";
    field public static final String TYPE_ISDB_S = "TYPE_ISDB_S";
    field public static final String TYPE_ISDB_T = "TYPE_ISDB_T";
    field public static final String TYPE_ISDB_TB = "TYPE_ISDB_TB";
    field public static final String TYPE_NTSC = "TYPE_NTSC";
    field public static final String TYPE_OTHER = "TYPE_OTHER";
    field public static final String TYPE_PAL = "TYPE_PAL";
    field public static final String TYPE_PREVIEW = "TYPE_PREVIEW";
    field public static final String TYPE_SECAM = "TYPE_SECAM";
    field public static final String TYPE_S_DMB = "TYPE_S_DMB";
    field public static final String TYPE_T_DMB = "TYPE_T_DMB";
    field public static final String VIDEO_FORMAT_1080I = "VIDEO_FORMAT_1080I";
    field public static final String VIDEO_FORMAT_1080P = "VIDEO_FORMAT_1080P";
    field public static final String VIDEO_FORMAT_2160P = "VIDEO_FORMAT_2160P";
    field public static final String VIDEO_FORMAT_240P = "VIDEO_FORMAT_240P";
    field public static final String VIDEO_FORMAT_360P = "VIDEO_FORMAT_360P";
    field public static final String VIDEO_FORMAT_4320P = "VIDEO_FORMAT_4320P";
    field public static final String VIDEO_FORMAT_480I = "VIDEO_FORMAT_480I";
    field public static final String VIDEO_FORMAT_480P = "VIDEO_FORMAT_480P";
    field public static final String VIDEO_FORMAT_576I = "VIDEO_FORMAT_576I";
    field public static final String VIDEO_FORMAT_576P = "VIDEO_FORMAT_576P";
    field public static final String VIDEO_FORMAT_720P = "VIDEO_FORMAT_720P";
    field public static final String VIDEO_RESOLUTION_ED = "VIDEO_RESOLUTION_ED";
    field public static final String VIDEO_RESOLUTION_FHD = "VIDEO_RESOLUTION_FHD";
    field public static final String VIDEO_RESOLUTION_HD = "VIDEO_RESOLUTION_HD";
    field public static final String VIDEO_RESOLUTION_SD = "VIDEO_RESOLUTION_SD";
    field public static final String VIDEO_RESOLUTION_UHD = "VIDEO_RESOLUTION_UHD";
  }

  public static final class TvContract.Channels.Logo {
    field public static final String CONTENT_DIRECTORY = "logo";
  }

  public static final class TvContract.PreviewPrograms implements android.media.tv.TvContract.BaseTvColumns {
    field public static final int ASPECT_RATIO_16_9 = 0; // 0x0
    field public static final int ASPECT_RATIO_1_1 = 3; // 0x3
    field public static final int ASPECT_RATIO_2_3 = 4; // 0x4
    field public static final int ASPECT_RATIO_3_2 = 1; // 0x1
    field public static final int ASPECT_RATIO_4_3 = 2; // 0x2
    field public static final int AVAILABILITY_AVAILABLE = 0; // 0x0
    field public static final int AVAILABILITY_FREE_WITH_SUBSCRIPTION = 1; // 0x1
    field public static final int AVAILABILITY_PAID_CONTENT = 2; // 0x2
    field public static final String COLUMN_AUDIO_LANGUAGE = "audio_language";
    field public static final String COLUMN_AUTHOR = "author";
    field public static final String COLUMN_AVAILABILITY = "availability";
    field public static final String COLUMN_BROWSABLE = "browsable";
    field public static final String COLUMN_CANONICAL_GENRE = "canonical_genre";
    field public static final String COLUMN_CHANNEL_ID = "channel_id";
    field public static final String COLUMN_CONTENT_ID = "content_id";
    field public static final String COLUMN_CONTENT_RATING = "content_rating";
    field public static final String COLUMN_DURATION_MILLIS = "duration_millis";
    field public static final String COLUMN_EPISODE_DISPLAY_NUMBER = "episode_display_number";
    field public static final String COLUMN_EPISODE_TITLE = "episode_title";
    field public static final String COLUMN_INTENT_URI = "intent_uri";
    field public static final String COLUMN_INTERACTION_COUNT = "interaction_count";
    field public static final String COLUMN_INTERACTION_TYPE = "interaction_type";
    field public static final String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
    field public static final String COLUMN_INTERNAL_PROVIDER_ID = "internal_provider_id";
    field public static final String COLUMN_ITEM_COUNT = "item_count";
    field public static final String COLUMN_LAST_PLAYBACK_POSITION_MILLIS = "last_playback_position_millis";
    field public static final String COLUMN_LIVE = "live";
    field public static final String COLUMN_LOGO_URI = "logo_uri";
    field public static final String COLUMN_LONG_DESCRIPTION = "long_description";
    field public static final String COLUMN_OFFER_PRICE = "offer_price";
    field public static final String COLUMN_POSTER_ART_ASPECT_RATIO = "poster_art_aspect_ratio";
    field public static final String COLUMN_POSTER_ART_URI = "poster_art_uri";
    field public static final String COLUMN_PREVIEW_VIDEO_URI = "preview_video_uri";
    field public static final String COLUMN_RELEASE_DATE = "release_date";
    field public static final String COLUMN_REVIEW_RATING = "review_rating";
    field public static final String COLUMN_REVIEW_RATING_STYLE = "review_rating_style";
    field public static final String COLUMN_SEARCHABLE = "searchable";
    field public static final String COLUMN_SEASON_DISPLAY_NUMBER = "season_display_number";
    field public static final String COLUMN_SEASON_TITLE = "season_title";
    field public static final String COLUMN_SHORT_DESCRIPTION = "short_description";
    field public static final String COLUMN_STARTING_PRICE = "starting_price";
    field public static final String COLUMN_THUMBNAIL_ASPECT_RATIO = "poster_thumbnail_aspect_ratio";
    field public static final String COLUMN_THUMBNAIL_URI = "thumbnail_uri";
    field public static final String COLUMN_TITLE = "title";
    field public static final String COLUMN_TRANSIENT = "transient";
    field public static final String COLUMN_TYPE = "type";
    field public static final String COLUMN_VERSION_NUMBER = "version_number";
    field public static final String COLUMN_VIDEO_HEIGHT = "video_height";
    field public static final String COLUMN_VIDEO_WIDTH = "video_width";
    field public static final String COLUMN_WEIGHT = "weight";
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/preview_program";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/preview_program";
    field public static final android.net.Uri CONTENT_URI;
    field public static final int INTERACTION_TYPE_FANS = 3; // 0x3
    field public static final int INTERACTION_TYPE_FOLLOWERS = 2; // 0x2
    field public static final int INTERACTION_TYPE_LIKES = 4; // 0x4
    field public static final int INTERACTION_TYPE_LISTENS = 1; // 0x1
    field public static final int INTERACTION_TYPE_THUMBS = 5; // 0x5
    field public static final int INTERACTION_TYPE_VIEWERS = 6; // 0x6
    field public static final int INTERACTION_TYPE_VIEWS = 0; // 0x0
    field public static final int REVIEW_RATING_STYLE_PERCENTAGE = 2; // 0x2
    field public static final int REVIEW_RATING_STYLE_STARS = 0; // 0x0
    field public static final int REVIEW_RATING_STYLE_THUMBS_UP_DOWN = 1; // 0x1
    field public static final int TYPE_ALBUM = 8; // 0x8
    field public static final int TYPE_ARTIST = 9; // 0x9
    field public static final int TYPE_CHANNEL = 6; // 0x6
    field public static final int TYPE_CLIP = 4; // 0x4
    field public static final int TYPE_EVENT = 5; // 0x5
    field public static final int TYPE_MOVIE = 0; // 0x0
    field public static final int TYPE_PLAYLIST = 10; // 0xa
    field public static final int TYPE_STATION = 11; // 0xb
    field public static final int TYPE_TRACK = 7; // 0x7
    field public static final int TYPE_TV_EPISODE = 3; // 0x3
    field public static final int TYPE_TV_SEASON = 2; // 0x2
    field public static final int TYPE_TV_SERIES = 1; // 0x1
  }

  public static final class TvContract.Programs implements android.media.tv.TvContract.BaseTvColumns {
    field public static final String COLUMN_AUDIO_LANGUAGE = "audio_language";
    field public static final String COLUMN_BROADCAST_GENRE = "broadcast_genre";
    field public static final String COLUMN_CANONICAL_GENRE = "canonical_genre";
    field public static final String COLUMN_CHANNEL_ID = "channel_id";
    field public static final String COLUMN_CONTENT_RATING = "content_rating";
    field public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
    field public static final String COLUMN_EPISODE_DISPLAY_NUMBER = "episode_display_number";
    field @Deprecated public static final String COLUMN_EPISODE_NUMBER = "episode_number";
    field public static final String COLUMN_EPISODE_TITLE = "episode_title";
    field public static final String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
    field public static final String COLUMN_LONG_DESCRIPTION = "long_description";
    field public static final String COLUMN_POSTER_ART_URI = "poster_art_uri";
    field public static final String COLUMN_RECORDING_PROHIBITED = "recording_prohibited";
    field public static final String COLUMN_REVIEW_RATING = "review_rating";
    field public static final String COLUMN_REVIEW_RATING_STYLE = "review_rating_style";
    field public static final String COLUMN_SEARCHABLE = "searchable";
    field public static final String COLUMN_SEASON_DISPLAY_NUMBER = "season_display_number";
    field @Deprecated public static final String COLUMN_SEASON_NUMBER = "season_number";
    field public static final String COLUMN_SEASON_TITLE = "season_title";
    field public static final String COLUMN_SHORT_DESCRIPTION = "short_description";
    field public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
    field public static final String COLUMN_THUMBNAIL_URI = "thumbnail_uri";
    field public static final String COLUMN_TITLE = "title";
    field public static final String COLUMN_VERSION_NUMBER = "version_number";
    field public static final String COLUMN_VIDEO_HEIGHT = "video_height";
    field public static final String COLUMN_VIDEO_WIDTH = "video_width";
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/program";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/program";
    field public static final android.net.Uri CONTENT_URI;
    field public static final int REVIEW_RATING_STYLE_PERCENTAGE = 2; // 0x2
    field public static final int REVIEW_RATING_STYLE_STARS = 0; // 0x0
    field public static final int REVIEW_RATING_STYLE_THUMBS_UP_DOWN = 1; // 0x1
  }

  public static final class TvContract.Programs.Genres {
    method public static String[] decode(@NonNull String);
    method public static String encode(@NonNull java.lang.String...);
    method public static boolean isCanonical(String);
    field public static final String ANIMAL_WILDLIFE = "ANIMAL_WILDLIFE";
    field public static final String ARTS = "ARTS";
    field public static final String COMEDY = "COMEDY";
    field public static final String DRAMA = "DRAMA";
    field public static final String EDUCATION = "EDUCATION";
    field public static final String ENTERTAINMENT = "ENTERTAINMENT";
    field public static final String FAMILY_KIDS = "FAMILY_KIDS";
    field public static final String GAMING = "GAMING";
    field public static final String LIFE_STYLE = "LIFE_STYLE";
    field public static final String MOVIES = "MOVIES";
    field public static final String MUSIC = "MUSIC";
    field public static final String NEWS = "NEWS";
    field public static final String PREMIER = "PREMIER";
    field public static final String SHOPPING = "SHOPPING";
    field public static final String SPORTS = "SPORTS";
    field public static final String TECH_SCIENCE = "TECH_SCIENCE";
    field public static final String TRAVEL = "TRAVEL";
  }

  public static final class TvContract.RecordedPrograms implements android.media.tv.TvContract.BaseTvColumns {
    field public static final String COLUMN_AUDIO_LANGUAGE = "audio_language";
    field public static final String COLUMN_BROADCAST_GENRE = "broadcast_genre";
    field public static final String COLUMN_CANONICAL_GENRE = "canonical_genre";
    field public static final String COLUMN_CHANNEL_ID = "channel_id";
    field public static final String COLUMN_CONTENT_RATING = "content_rating";
    field public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
    field public static final String COLUMN_EPISODE_DISPLAY_NUMBER = "episode_display_number";
    field public static final String COLUMN_EPISODE_TITLE = "episode_title";
    field public static final String COLUMN_INPUT_ID = "input_id";
    field public static final String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
    field public static final String COLUMN_LONG_DESCRIPTION = "long_description";
    field public static final String COLUMN_POSTER_ART_URI = "poster_art_uri";
    field public static final String COLUMN_RECORDING_DATA_BYTES = "recording_data_bytes";
    field public static final String COLUMN_RECORDING_DATA_URI = "recording_data_uri";
    field public static final String COLUMN_RECORDING_DURATION_MILLIS = "recording_duration_millis";
    field public static final String COLUMN_RECORDING_EXPIRE_TIME_UTC_MILLIS = "recording_expire_time_utc_millis";
    field public static final String COLUMN_REVIEW_RATING = "review_rating";
    field public static final String COLUMN_REVIEW_RATING_STYLE = "review_rating_style";
    field public static final String COLUMN_SEARCHABLE = "searchable";
    field public static final String COLUMN_SEASON_DISPLAY_NUMBER = "season_display_number";
    field public static final String COLUMN_SEASON_TITLE = "season_title";
    field public static final String COLUMN_SHORT_DESCRIPTION = "short_description";
    field public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
    field public static final String COLUMN_THUMBNAIL_URI = "thumbnail_uri";
    field public static final String COLUMN_TITLE = "title";
    field public static final String COLUMN_VERSION_NUMBER = "version_number";
    field public static final String COLUMN_VIDEO_HEIGHT = "video_height";
    field public static final String COLUMN_VIDEO_WIDTH = "video_width";
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/recorded_program";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/recorded_program";
    field public static final android.net.Uri CONTENT_URI;
    field public static final int REVIEW_RATING_STYLE_PERCENTAGE = 2; // 0x2
    field public static final int REVIEW_RATING_STYLE_STARS = 0; // 0x0
    field public static final int REVIEW_RATING_STYLE_THUMBS_UP_DOWN = 1; // 0x1
  }

  public static final class TvContract.WatchNextPrograms implements android.media.tv.TvContract.BaseTvColumns {
    field public static final int ASPECT_RATIO_16_9 = 0; // 0x0
    field public static final int ASPECT_RATIO_1_1 = 3; // 0x3
    field public static final int ASPECT_RATIO_2_3 = 4; // 0x4
    field public static final int ASPECT_RATIO_3_2 = 1; // 0x1
    field public static final int ASPECT_RATIO_4_3 = 2; // 0x2
    field public static final int AVAILABILITY_AVAILABLE = 0; // 0x0
    field public static final int AVAILABILITY_FREE_WITH_SUBSCRIPTION = 1; // 0x1
    field public static final int AVAILABILITY_PAID_CONTENT = 2; // 0x2
    field public static final String COLUMN_AUDIO_LANGUAGE = "audio_language";
    field public static final String COLUMN_AUTHOR = "author";
    field public static final String COLUMN_AVAILABILITY = "availability";
    field public static final String COLUMN_BROWSABLE = "browsable";
    field public static final String COLUMN_CANONICAL_GENRE = "canonical_genre";
    field public static final String COLUMN_CONTENT_ID = "content_id";
    field public static final String COLUMN_CONTENT_RATING = "content_rating";
    field public static final String COLUMN_DURATION_MILLIS = "duration_millis";
    field public static final String COLUMN_EPISODE_DISPLAY_NUMBER = "episode_display_number";
    field public static final String COLUMN_EPISODE_TITLE = "episode_title";
    field public static final String COLUMN_INTENT_URI = "intent_uri";
    field public static final String COLUMN_INTERACTION_COUNT = "interaction_count";
    field public static final String COLUMN_INTERACTION_TYPE = "interaction_type";
    field public static final String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
    field public static final String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
    field public static final String COLUMN_INTERNAL_PROVIDER_ID = "internal_provider_id";
    field public static final String COLUMN_ITEM_COUNT = "item_count";
    field public static final String COLUMN_LAST_ENGAGEMENT_TIME_UTC_MILLIS = "last_engagement_time_utc_millis";
    field public static final String COLUMN_LAST_PLAYBACK_POSITION_MILLIS = "last_playback_position_millis";
    field public static final String COLUMN_LIVE = "live";
    field public static final String COLUMN_LOGO_URI = "logo_uri";
    field public static final String COLUMN_LONG_DESCRIPTION = "long_description";
    field public static final String COLUMN_OFFER_PRICE = "offer_price";
    field public static final String COLUMN_POSTER_ART_ASPECT_RATIO = "poster_art_aspect_ratio";
    field public static final String COLUMN_POSTER_ART_URI = "poster_art_uri";
    field public static final String COLUMN_PREVIEW_VIDEO_URI = "preview_video_uri";
    field public static final String COLUMN_RELEASE_DATE = "release_date";
    field public static final String COLUMN_REVIEW_RATING = "review_rating";
    field public static final String COLUMN_REVIEW_RATING_STYLE = "review_rating_style";
    field public static final String COLUMN_SEARCHABLE = "searchable";
    field public static final String COLUMN_SEASON_DISPLAY_NUMBER = "season_display_number";
    field public static final String COLUMN_SEASON_TITLE = "season_title";
    field public static final String COLUMN_SHORT_DESCRIPTION = "short_description";
    field public static final String COLUMN_STARTING_PRICE = "starting_price";
    field public static final String COLUMN_THUMBNAIL_ASPECT_RATIO = "poster_thumbnail_aspect_ratio";
    field public static final String COLUMN_THUMBNAIL_URI = "thumbnail_uri";
    field public static final String COLUMN_TITLE = "title";
    field public static final String COLUMN_TRANSIENT = "transient";
    field public static final String COLUMN_TYPE = "type";
    field public static final String COLUMN_VERSION_NUMBER = "version_number";
    field public static final String COLUMN_VIDEO_HEIGHT = "video_height";
    field public static final String COLUMN_VIDEO_WIDTH = "video_width";
    field public static final String COLUMN_WATCH_NEXT_TYPE = "watch_next_type";
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/watch_next_program";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/watch_next_program";
    field public static final android.net.Uri CONTENT_URI;
    field public static final int INTERACTION_TYPE_FANS = 3; // 0x3
    field public static final int INTERACTION_TYPE_FOLLOWERS = 2; // 0x2
    field public static final int INTERACTION_TYPE_LIKES = 4; // 0x4
    field public static final int INTERACTION_TYPE_LISTENS = 1; // 0x1
    field public static final int INTERACTION_TYPE_THUMBS = 5; // 0x5
    field public static final int INTERACTION_TYPE_VIEWERS = 6; // 0x6
    field public static final int INTERACTION_TYPE_VIEWS = 0; // 0x0
    field public static final int REVIEW_RATING_STYLE_PERCENTAGE = 2; // 0x2
    field public static final int REVIEW_RATING_STYLE_STARS = 0; // 0x0
    field public static final int REVIEW_RATING_STYLE_THUMBS_UP_DOWN = 1; // 0x1
    field public static final int TYPE_ALBUM = 8; // 0x8
    field public static final int TYPE_ARTIST = 9; // 0x9
    field public static final int TYPE_CHANNEL = 6; // 0x6
    field public static final int TYPE_CLIP = 4; // 0x4
    field public static final int TYPE_EVENT = 5; // 0x5
    field public static final int TYPE_MOVIE = 0; // 0x0
    field public static final int TYPE_PLAYLIST = 10; // 0xa
    field public static final int TYPE_STATION = 11; // 0xb
    field public static final int TYPE_TRACK = 7; // 0x7
    field public static final int TYPE_TV_EPISODE = 3; // 0x3
    field public static final int TYPE_TV_SEASON = 2; // 0x2
    field public static final int TYPE_TV_SERIES = 1; // 0x1
    field public static final int WATCH_NEXT_TYPE_CONTINUE = 0; // 0x0
    field public static final int WATCH_NEXT_TYPE_NEW = 2; // 0x2
    field public static final int WATCH_NEXT_TYPE_NEXT = 1; // 0x1
    field public static final int WATCH_NEXT_TYPE_WATCHLIST = 3; // 0x3
  }

  public final class TvInputInfo implements android.os.Parcelable {
    method public boolean canRecord();
    method @Deprecated public android.content.Intent createSettingsIntent();
    method public android.content.Intent createSetupIntent();
    method public int describeContents();
    method public android.os.Bundle getExtras();
    method public String getId();
    method public String getParentId();
    method public android.content.pm.ServiceInfo getServiceInfo();
    method public int getTunerCount();
    method public int getType();
    method public boolean isHidden(android.content.Context);
    method public boolean isPassthroughInput();
    method public CharSequence loadCustomLabel(android.content.Context);
    method public android.graphics.drawable.Drawable loadIcon(@NonNull android.content.Context);
    method public CharSequence loadLabel(@NonNull android.content.Context);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.tv.TvInputInfo> CREATOR;
    field public static final String EXTRA_INPUT_ID = "android.media.tv.extra.INPUT_ID";
    field public static final int TYPE_COMPONENT = 1004; // 0x3ec
    field public static final int TYPE_COMPOSITE = 1001; // 0x3e9
    field public static final int TYPE_DISPLAY_PORT = 1008; // 0x3f0
    field public static final int TYPE_DVI = 1006; // 0x3ee
    field public static final int TYPE_HDMI = 1007; // 0x3ef
    field public static final int TYPE_OTHER = 1000; // 0x3e8
    field public static final int TYPE_SCART = 1003; // 0x3eb
    field public static final int TYPE_SVIDEO = 1002; // 0x3ea
    field public static final int TYPE_TUNER = 0; // 0x0
    field public static final int TYPE_VGA = 1005; // 0x3ed
  }

  public static final class TvInputInfo.Builder {
    ctor public TvInputInfo.Builder(android.content.Context, android.content.ComponentName);
    method public android.media.tv.TvInputInfo build();
    method public android.media.tv.TvInputInfo.Builder setCanRecord(boolean);
    method public android.media.tv.TvInputInfo.Builder setExtras(android.os.Bundle);
    method public android.media.tv.TvInputInfo.Builder setTunerCount(int);
  }

  public final class TvInputManager {
    method public java.util.List<android.media.tv.TvContentRating> getBlockedRatings();
    method public int getInputState(@NonNull String);
    method @Nullable public android.media.tv.TvInputInfo getTvInputInfo(@NonNull String);
    method public java.util.List<android.media.tv.TvInputInfo> getTvInputList();
    method public boolean isParentalControlsEnabled();
    method public boolean isRatingBlocked(@NonNull android.media.tv.TvContentRating);
    method public void registerCallback(@NonNull android.media.tv.TvInputManager.TvInputCallback, @NonNull android.os.Handler);
    method public void unregisterCallback(@NonNull android.media.tv.TvInputManager.TvInputCallback);
    method public void updateTvInputInfo(@NonNull android.media.tv.TvInputInfo);
    field public static final String ACTION_BLOCKED_RATINGS_CHANGED = "android.media.tv.action.BLOCKED_RATINGS_CHANGED";
    field public static final String ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED = "android.media.tv.action.PARENTAL_CONTROLS_ENABLED_CHANGED";
    field public static final String ACTION_QUERY_CONTENT_RATING_SYSTEMS = "android.media.tv.action.QUERY_CONTENT_RATING_SYSTEMS";
    field public static final String ACTION_SETUP_INPUTS = "android.media.tv.action.SETUP_INPUTS";
    field public static final String ACTION_VIEW_RECORDING_SCHEDULES = "android.media.tv.action.VIEW_RECORDING_SCHEDULES";
    field public static final int INPUT_STATE_CONNECTED = 0; // 0x0
    field public static final int INPUT_STATE_CONNECTED_STANDBY = 1; // 0x1
    field public static final int INPUT_STATE_DISCONNECTED = 2; // 0x2
    field public static final String META_DATA_CONTENT_RATING_SYSTEMS = "android.media.tv.metadata.CONTENT_RATING_SYSTEMS";
    field public static final int RECORDING_ERROR_INSUFFICIENT_SPACE = 1; // 0x1
    field public static final int RECORDING_ERROR_RESOURCE_BUSY = 2; // 0x2
    field public static final int RECORDING_ERROR_UNKNOWN = 0; // 0x0
    field public static final long TIME_SHIFT_INVALID_TIME = -9223372036854775808L; // 0x8000000000000000L
    field public static final int TIME_SHIFT_STATUS_AVAILABLE = 3; // 0x3
    field public static final int TIME_SHIFT_STATUS_UNAVAILABLE = 2; // 0x2
    field public static final int TIME_SHIFT_STATUS_UNKNOWN = 0; // 0x0
    field public static final int TIME_SHIFT_STATUS_UNSUPPORTED = 1; // 0x1
    field public static final int VIDEO_UNAVAILABLE_REASON_AUDIO_ONLY = 4; // 0x4
    field public static final int VIDEO_UNAVAILABLE_REASON_BUFFERING = 3; // 0x3
    field public static final int VIDEO_UNAVAILABLE_REASON_TUNING = 1; // 0x1
    field public static final int VIDEO_UNAVAILABLE_REASON_UNKNOWN = 0; // 0x0
    field public static final int VIDEO_UNAVAILABLE_REASON_WEAK_SIGNAL = 2; // 0x2
  }

  public abstract static class TvInputManager.TvInputCallback {
    ctor public TvInputManager.TvInputCallback();
    method public void onInputAdded(String);
    method public void onInputRemoved(String);
    method public void onInputStateChanged(String, int);
    method public void onInputUpdated(String);
    method public void onTvInputInfoUpdated(android.media.tv.TvInputInfo);
  }

  public abstract class TvInputService extends android.app.Service {
    ctor public TvInputService();
    method public final android.os.IBinder onBind(android.content.Intent);
    method @Nullable public android.media.tv.TvInputService.RecordingSession onCreateRecordingSession(String);
    method @Nullable public abstract android.media.tv.TvInputService.Session onCreateSession(String);
    field public static final String SERVICE_INTERFACE = "android.media.tv.TvInputService";
    field public static final String SERVICE_META_DATA = "android.media.tv.input";
  }

  public abstract static class TvInputService.HardwareSession extends android.media.tv.TvInputService.Session {
    ctor public TvInputService.HardwareSession(android.content.Context);
    method public abstract String getHardwareInputId();
    method public void onHardwareVideoAvailable();
    method public void onHardwareVideoUnavailable(int);
    method public final boolean onSetSurface(android.view.Surface);
  }

  public abstract static class TvInputService.RecordingSession {
    ctor public TvInputService.RecordingSession(android.content.Context);
    method public void notifyError(int);
    method public void notifyRecordingStopped(android.net.Uri);
    method public void notifyTuned(android.net.Uri);
    method public void onAppPrivateCommand(@NonNull String, android.os.Bundle);
    method public abstract void onRelease();
    method public abstract void onStartRecording(@Nullable android.net.Uri);
    method public abstract void onStopRecording();
    method public abstract void onTune(android.net.Uri);
    method public void onTune(android.net.Uri, android.os.Bundle);
  }

  public abstract static class TvInputService.Session implements android.view.KeyEvent.Callback {
    ctor public TvInputService.Session(android.content.Context);
    method public void layoutSurface(int, int, int, int);
    method public void notifyChannelRetuned(android.net.Uri);
    method public void notifyContentAllowed();
    method public void notifyContentBlocked(@NonNull android.media.tv.TvContentRating);
    method public void notifyTimeShiftStatusChanged(int);
    method public void notifyTrackSelected(int, String);
    method public void notifyTracksChanged(java.util.List<android.media.tv.TvTrackInfo>);
    method public void notifyVideoAvailable();
    method public void notifyVideoUnavailable(int);
    method public void onAppPrivateCommand(@NonNull String, android.os.Bundle);
    method public android.view.View onCreateOverlayView();
    method public boolean onGenericMotionEvent(android.view.MotionEvent);
    method public boolean onKeyDown(int, android.view.KeyEvent);
    method public boolean onKeyLongPress(int, android.view.KeyEvent);
    method public boolean onKeyMultiple(int, int, android.view.KeyEvent);
    method public boolean onKeyUp(int, android.view.KeyEvent);
    method public void onOverlayViewSizeChanged(int, int);
    method public abstract void onRelease();
    method public boolean onSelectTrack(int, @Nullable String);
    method public abstract void onSetCaptionEnabled(boolean);
    method public abstract void onSetStreamVolume(@FloatRange(from=0.0, to=1.0) float);
    method public abstract boolean onSetSurface(@Nullable android.view.Surface);
    method public void onSurfaceChanged(int, int, int);
    method public long onTimeShiftGetCurrentPosition();
    method public long onTimeShiftGetStartPosition();
    method public void onTimeShiftPause();
    method public void onTimeShiftPlay(android.net.Uri);
    method public void onTimeShiftResume();
    method public void onTimeShiftSeekTo(long);
    method public void onTimeShiftSetPlaybackParams(android.media.PlaybackParams);
    method public boolean onTouchEvent(android.view.MotionEvent);
    method public boolean onTrackballEvent(android.view.MotionEvent);
    method public abstract boolean onTune(android.net.Uri);
    method public boolean onTune(android.net.Uri, android.os.Bundle);
    method public void onUnblockContent(android.media.tv.TvContentRating);
    method public void setOverlayViewEnabled(boolean);
  }

  public class TvRecordingClient {
    ctor public TvRecordingClient(android.content.Context, String, @NonNull android.media.tv.TvRecordingClient.RecordingCallback, android.os.Handler);
    method public void release();
    method public void sendAppPrivateCommand(@NonNull String, android.os.Bundle);
    method public void startRecording(@Nullable android.net.Uri);
    method public void stopRecording();
    method public void tune(String, android.net.Uri);
    method public void tune(String, android.net.Uri, android.os.Bundle);
  }

  public abstract static class TvRecordingClient.RecordingCallback {
    ctor public TvRecordingClient.RecordingCallback();
    method public void onConnectionFailed(String);
    method public void onDisconnected(String);
    method public void onError(int);
    method public void onRecordingStopped(android.net.Uri);
    method public void onTuned(android.net.Uri);
  }

  public final class TvTrackInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getAudioChannelCount();
    method public int getAudioSampleRate();
    method public CharSequence getDescription();
    method public android.os.Bundle getExtra();
    method public String getId();
    method public String getLanguage();
    method public int getType();
    method public byte getVideoActiveFormatDescription();
    method public float getVideoFrameRate();
    method public int getVideoHeight();
    method public float getVideoPixelAspectRatio();
    method public int getVideoWidth();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.tv.TvTrackInfo> CREATOR;
    field public static final int TYPE_AUDIO = 0; // 0x0
    field public static final int TYPE_SUBTITLE = 2; // 0x2
    field public static final int TYPE_VIDEO = 1; // 0x1
  }

  public static final class TvTrackInfo.Builder {
    ctor public TvTrackInfo.Builder(int, @NonNull String);
    method public android.media.tv.TvTrackInfo build();
    method public android.media.tv.TvTrackInfo.Builder setAudioChannelCount(int);
    method public android.media.tv.TvTrackInfo.Builder setAudioSampleRate(int);
    method public android.media.tv.TvTrackInfo.Builder setDescription(CharSequence);
    method public android.media.tv.TvTrackInfo.Builder setExtra(android.os.Bundle);
    method public android.media.tv.TvTrackInfo.Builder setLanguage(String);
    method public android.media.tv.TvTrackInfo.Builder setVideoActiveFormatDescription(byte);
    method public android.media.tv.TvTrackInfo.Builder setVideoFrameRate(float);
    method public android.media.tv.TvTrackInfo.Builder setVideoHeight(int);
    method public android.media.tv.TvTrackInfo.Builder setVideoPixelAspectRatio(float);
    method public android.media.tv.TvTrackInfo.Builder setVideoWidth(int);
  }

  public class TvView extends android.view.ViewGroup {
    ctor public TvView(android.content.Context);
    ctor public TvView(android.content.Context, android.util.AttributeSet);
    ctor public TvView(android.content.Context, android.util.AttributeSet, int);
    method public boolean dispatchUnhandledInputEvent(android.view.InputEvent);
    method public String getSelectedTrack(int);
    method public java.util.List<android.media.tv.TvTrackInfo> getTracks(int);
    method public boolean onUnhandledInputEvent(android.view.InputEvent);
    method public void reset();
    method public void selectTrack(int, String);
    method public void sendAppPrivateCommand(@NonNull String, android.os.Bundle);
    method public void setCallback(@Nullable android.media.tv.TvView.TvInputCallback);
    method public void setCaptionEnabled(boolean);
    method public void setOnUnhandledInputEventListener(android.media.tv.TvView.OnUnhandledInputEventListener);
    method public void setStreamVolume(@FloatRange(from=0.0, to=1.0) float);
    method public void setTimeShiftPositionCallback(@Nullable android.media.tv.TvView.TimeShiftPositionCallback);
    method public void setZOrderMediaOverlay(boolean);
    method public void setZOrderOnTop(boolean);
    method public void timeShiftPause();
    method public void timeShiftPlay(String, android.net.Uri);
    method public void timeShiftResume();
    method public void timeShiftSeekTo(long);
    method public void timeShiftSetPlaybackParams(@NonNull android.media.PlaybackParams);
    method public void tune(@NonNull String, android.net.Uri);
    method public void tune(String, android.net.Uri, android.os.Bundle);
  }

  public static interface TvView.OnUnhandledInputEventListener {
    method public boolean onUnhandledInputEvent(android.view.InputEvent);
  }

  public abstract static class TvView.TimeShiftPositionCallback {
    ctor public TvView.TimeShiftPositionCallback();
    method public void onTimeShiftCurrentPositionChanged(String, long);
    method public void onTimeShiftStartPositionChanged(String, long);
  }

  public abstract static class TvView.TvInputCallback {
    ctor public TvView.TvInputCallback();
    method public void onChannelRetuned(String, android.net.Uri);
    method public void onConnectionFailed(String);
    method public void onContentAllowed(String);
    method public void onContentBlocked(String, android.media.tv.TvContentRating);
    method public void onDisconnected(String);
    method public void onTimeShiftStatusChanged(String, int);
    method public void onTrackSelected(String, int, String);
    method public void onTracksChanged(String, java.util.List<android.media.tv.TvTrackInfo>);
    method public void onVideoAvailable(String);
    method public void onVideoSizeChanged(String, int, int);
    method public void onVideoUnavailable(String, int);
  }

}

package android.mtp {

  public final class MtpConstants {
    ctor public MtpConstants();
    method public static boolean isAbstractObject(int);
    field public static final int ASSOCIATION_TYPE_GENERIC_FOLDER = 1; // 0x1
    field public static final int FORMAT_3GP_CONTAINER = 47492; // 0xb984
    field public static final int FORMAT_AAC = 47363; // 0xb903
    field public static final int FORMAT_ABSTRACT_AUDIO_ALBUM = 47619; // 0xba03
    field public static final int FORMAT_ABSTRACT_AUDIO_PLAYLIST = 47625; // 0xba09
    field public static final int FORMAT_ABSTRACT_AV_PLAYLIST = 47621; // 0xba05
    field public static final int FORMAT_ABSTRACT_DOCUMENT = 47745; // 0xba81
    field public static final int FORMAT_ABSTRACT_IMAGE_ALBUM = 47618; // 0xba02
    field public static final int FORMAT_ABSTRACT_MEDIACAST = 47627; // 0xba0b
    field public static final int FORMAT_ABSTRACT_MULTIMEDIA_ALBUM = 47617; // 0xba01
    field public static final int FORMAT_ABSTRACT_VIDEO_ALBUM = 47620; // 0xba04
    field public static final int FORMAT_ABSTRACT_VIDEO_PLAYLIST = 47626; // 0xba0a
    field public static final int FORMAT_AIFF = 12295; // 0x3007
    field public static final int FORMAT_ASF = 12300; // 0x300c
    field public static final int FORMAT_ASSOCIATION = 12289; // 0x3001
    field public static final int FORMAT_ASX_PLAYLIST = 47635; // 0xba13
    field public static final int FORMAT_AUDIBLE = 47364; // 0xb904
    field public static final int FORMAT_AVI = 12298; // 0x300a
    field public static final int FORMAT_BMP = 14340; // 0x3804
    field public static final int FORMAT_DEFINED = 14336; // 0x3800
    field public static final int FORMAT_DNG = 14353; // 0x3811
    field public static final int FORMAT_DPOF = 12294; // 0x3006
    field public static final int FORMAT_EXECUTABLE = 12291; // 0x3003
    field public static final int FORMAT_EXIF_JPEG = 14337; // 0x3801
    field public static final int FORMAT_FLAC = 47366; // 0xb906
    field public static final int FORMAT_GIF = 14343; // 0x3807
    field public static final int FORMAT_HTML = 12293; // 0x3005
    field public static final int FORMAT_JFIF = 14344; // 0x3808
    field public static final int FORMAT_JP2 = 14351; // 0x380f
    field public static final int FORMAT_JPX = 14352; // 0x3810
    field public static final int FORMAT_M3U_PLAYLIST = 47633; // 0xba11
    field public static final int FORMAT_MP2 = 47491; // 0xb983
    field public static final int FORMAT_MP3 = 12297; // 0x3009
    field public static final int FORMAT_MP4_CONTAINER = 47490; // 0xb982
    field public static final int FORMAT_MPEG = 12299; // 0x300b
    field public static final int FORMAT_MPL_PLAYLIST = 47634; // 0xba12
    field public static final int FORMAT_MS_EXCEL_SPREADSHEET = 47749; // 0xba85
    field public static final int FORMAT_MS_POWERPOINT_PRESENTATION = 47750; // 0xba86
    field public static final int FORMAT_MS_WORD_DOCUMENT = 47747; // 0xba83
    field public static final int FORMAT_OGG = 47362; // 0xb902
    field public static final int FORMAT_PICT = 14346; // 0x380a
    field public static final int FORMAT_PLS_PLAYLIST = 47636; // 0xba14
    field public static final int FORMAT_PNG = 14347; // 0x380b
    field public static final int FORMAT_SCRIPT = 12290; // 0x3002
    field public static final int FORMAT_TEXT = 12292; // 0x3004
    field public static final int FORMAT_TIFF = 14349; // 0x380d
    field public static final int FORMAT_TIFF_EP = 14338; // 0x3802
    field public static final int FORMAT_UNDEFINED = 12288; // 0x3000
    field public static final int FORMAT_UNDEFINED_AUDIO = 47360; // 0xb900
    field public static final int FORMAT_UNDEFINED_COLLECTION = 47616; // 0xba00
    field public static final int FORMAT_UNDEFINED_DOCUMENT = 47744; // 0xba80
    field public static final int FORMAT_UNDEFINED_FIRMWARE = 47106; // 0xb802
    field public static final int FORMAT_UNDEFINED_VIDEO = 47488; // 0xb980
    field public static final int FORMAT_WAV = 12296; // 0x3008
    field public static final int FORMAT_WINDOWS_IMAGE_FORMAT = 47233; // 0xb881
    field public static final int FORMAT_WMA = 47361; // 0xb901
    field public static final int FORMAT_WMV = 47489; // 0xb981
    field public static final int FORMAT_WPL_PLAYLIST = 47632; // 0xba10
    field public static final int FORMAT_XML_DOCUMENT = 47746; // 0xba82
    field public static final int OPERATION_CLOSE_SESSION = 4099; // 0x1003
    field public static final int OPERATION_COPY_OBJECT = 4122; // 0x101a
    field public static final int OPERATION_DELETE_OBJECT = 4107; // 0x100b
    field public static final int OPERATION_FORMAT_STORE = 4111; // 0x100f
    field public static final int OPERATION_GET_DEVICE_INFO = 4097; // 0x1001
    field public static final int OPERATION_GET_DEVICE_PROP_DESC = 4116; // 0x1014
    field public static final int OPERATION_GET_DEVICE_PROP_VALUE = 4117; // 0x1015
    field public static final int OPERATION_GET_NUM_OBJECTS = 4102; // 0x1006
    field public static final int OPERATION_GET_OBJECT = 4105; // 0x1009
    field public static final int OPERATION_GET_OBJECT_HANDLES = 4103; // 0x1007
    field public static final int OPERATION_GET_OBJECT_INFO = 4104; // 0x1008
    field public static final int OPERATION_GET_OBJECT_PROPS_SUPPORTED = 38913; // 0x9801
    field public static final int OPERATION_GET_OBJECT_PROP_DESC = 38914; // 0x9802
    field public static final int OPERATION_GET_OBJECT_PROP_VALUE = 38915; // 0x9803
    field public static final int OPERATION_GET_OBJECT_REFERENCES = 38928; // 0x9810
    field public static final int OPERATION_GET_PARTIAL_OBJECT = 4123; // 0x101b
    field public static final int OPERATION_GET_PARTIAL_OBJECT_64 = 38337; // 0x95c1
    field public static final int OPERATION_GET_STORAGE_INFO = 4101; // 0x1005
    field public static final int OPERATION_GET_STORAGE_I_DS = 4100; // 0x1004
    field public static final int OPERATION_GET_THUMB = 4106; // 0x100a
    field public static final int OPERATION_INITIATE_CAPTURE = 4110; // 0x100e
    field public static final int OPERATION_INITIATE_OPEN_CAPTURE = 4124; // 0x101c
    field public static final int OPERATION_MOVE_OBJECT = 4121; // 0x1019
    field public static final int OPERATION_OPEN_SESSION = 4098; // 0x1002
    field public static final int OPERATION_POWER_DOWN = 4115; // 0x1013
    field public static final int OPERATION_RESET_DEVICE = 4112; // 0x1010
    field public static final int OPERATION_RESET_DEVICE_PROP_VALUE = 4119; // 0x1017
    field public static final int OPERATION_SELF_TEST = 4113; // 0x1011
    field public static final int OPERATION_SEND_OBJECT = 4109; // 0x100d
    field public static final int OPERATION_SEND_OBJECT_INFO = 4108; // 0x100c
    field public static final int OPERATION_SET_DEVICE_PROP_VALUE = 4118; // 0x1016
    field public static final int OPERATION_SET_OBJECT_PROP_VALUE = 38916; // 0x9804
    field public static final int OPERATION_SET_OBJECT_PROTECTION = 4114; // 0x1012
    field public static final int OPERATION_SET_OBJECT_REFERENCES = 38929; // 0x9811
    field public static final int OPERATION_SKIP = 38944; // 0x9820
    field public static final int OPERATION_TERMINATE_OPEN_CAPTURE = 4120; // 0x1018
    field public static final int PROTECTION_STATUS_NONE = 0; // 0x0
    field public static final int PROTECTION_STATUS_NON_TRANSFERABLE_DATA = 32771; // 0x8003
    field public static final int PROTECTION_STATUS_READ_ONLY = 32769; // 0x8001
    field public static final int PROTECTION_STATUS_READ_ONLY_DATA = 32770; // 0x8002
  }

  public final class MtpDevice {
    ctor public MtpDevice(@NonNull android.hardware.usb.UsbDevice);
    method public void close();
    method public boolean deleteObject(int);
    method public int getDeviceId();
    method @Nullable public android.mtp.MtpDeviceInfo getDeviceInfo();
    method @NonNull public String getDeviceName();
    method @Nullable public byte[] getObject(int, int);
    method @Nullable public int[] getObjectHandles(int, int, int);
    method @Nullable public android.mtp.MtpObjectInfo getObjectInfo(int);
    method public long getParent(int);
    method public long getPartialObject(int, long, long, @NonNull byte[]) throws java.io.IOException;
    method public long getPartialObject64(int, long, long, @NonNull byte[]) throws java.io.IOException;
    method public long getStorageId(int);
    method @Nullable public int[] getStorageIds();
    method @Nullable public android.mtp.MtpStorageInfo getStorageInfo(int);
    method @Nullable public byte[] getThumbnail(int);
    method public boolean importFile(int, @NonNull String);
    method public boolean importFile(int, @NonNull android.os.ParcelFileDescriptor);
    method public boolean open(@NonNull android.hardware.usb.UsbDeviceConnection);
    method @NonNull public android.mtp.MtpEvent readEvent(@Nullable android.os.CancellationSignal) throws java.io.IOException;
    method public boolean sendObject(int, long, @NonNull android.os.ParcelFileDescriptor);
    method @Nullable public android.mtp.MtpObjectInfo sendObjectInfo(@NonNull android.mtp.MtpObjectInfo);
  }

  public class MtpDeviceInfo {
    method @NonNull public final int[] getEventsSupported();
    method @NonNull public final String getManufacturer();
    method @NonNull public final String getModel();
    method @NonNull public final int[] getOperationsSupported();
    method @NonNull public final String getSerialNumber();
    method @NonNull public final String getVersion();
    method public boolean isEventSupported(int);
    method public boolean isOperationSupported(int);
  }

  public class MtpEvent {
    method public int getDevicePropCode();
    method public int getEventCode();
    method public int getObjectFormatCode();
    method public int getObjectHandle();
    method public int getObjectPropCode();
    method public int getParameter1();
    method public int getParameter2();
    method public int getParameter3();
    method public int getStorageId();
    method public int getTransactionId();
    field public static final int EVENT_CANCEL_TRANSACTION = 16385; // 0x4001
    field public static final int EVENT_CAPTURE_COMPLETE = 16397; // 0x400d
    field public static final int EVENT_DEVICE_INFO_CHANGED = 16392; // 0x4008
    field public static final int EVENT_DEVICE_PROP_CHANGED = 16390; // 0x4006
    field public static final int EVENT_DEVICE_RESET = 16395; // 0x400b
    field public static final int EVENT_OBJECT_ADDED = 16386; // 0x4002
    field public static final int EVENT_OBJECT_INFO_CHANGED = 16391; // 0x4007
    field public static final int EVENT_OBJECT_PROP_CHANGED = 51201; // 0xc801
    field public static final int EVENT_OBJECT_PROP_DESC_CHANGED = 51202; // 0xc802
    field public static final int EVENT_OBJECT_REFERENCES_CHANGED = 51203; // 0xc803
    field public static final int EVENT_OBJECT_REMOVED = 16387; // 0x4003
    field public static final int EVENT_REQUEST_OBJECT_TRANSFER = 16393; // 0x4009
    field public static final int EVENT_STORAGE_INFO_CHANGED = 16396; // 0x400c
    field public static final int EVENT_STORE_ADDED = 16388; // 0x4004
    field public static final int EVENT_STORE_FULL = 16394; // 0x400a
    field public static final int EVENT_STORE_REMOVED = 16389; // 0x4005
    field public static final int EVENT_UNDEFINED = 16384; // 0x4000
    field public static final int EVENT_UNREPORTED_STATUS = 16398; // 0x400e
  }

  public final class MtpObjectInfo {
    method public int getAssociationDesc();
    method public int getAssociationType();
    method public int getCompressedSize();
    method public long getCompressedSizeLong();
    method public long getDateCreated();
    method public long getDateModified();
    method public int getFormat();
    method public int getImagePixDepth();
    method public long getImagePixDepthLong();
    method public int getImagePixHeight();
    method public long getImagePixHeightLong();
    method public int getImagePixWidth();
    method public long getImagePixWidthLong();
    method @NonNull public String getKeywords();
    method @NonNull public String getName();
    method public int getObjectHandle();
    method public int getParent();
    method public int getProtectionStatus();
    method public int getSequenceNumber();
    method public long getSequenceNumberLong();
    method public int getStorageId();
    method public int getThumbCompressedSize();
    method public long getThumbCompressedSizeLong();
    method public int getThumbFormat();
    method public int getThumbPixHeight();
    method public long getThumbPixHeightLong();
    method public int getThumbPixWidth();
    method public long getThumbPixWidthLong();
  }

  public static class MtpObjectInfo.Builder {
    ctor public MtpObjectInfo.Builder();
    ctor public MtpObjectInfo.Builder(android.mtp.MtpObjectInfo);
    method public android.mtp.MtpObjectInfo build();
    method public android.mtp.MtpObjectInfo.Builder setAssociationDesc(int);
    method public android.mtp.MtpObjectInfo.Builder setAssociationType(int);
    method public android.mtp.MtpObjectInfo.Builder setCompressedSize(long);
    method public android.mtp.MtpObjectInfo.Builder setDateCreated(long);
    method public android.mtp.MtpObjectInfo.Builder setDateModified(long);
    method public android.mtp.MtpObjectInfo.Builder setFormat(int);
    method public android.mtp.MtpObjectInfo.Builder setImagePixDepth(long);
    method public android.mtp.MtpObjectInfo.Builder setImagePixHeight(long);
    method public android.mtp.MtpObjectInfo.Builder setImagePixWidth(long);
    method public android.mtp.MtpObjectInfo.Builder setKeywords(@NonNull String);
    method public android.mtp.MtpObjectInfo.Builder setName(@NonNull String);
    method public android.mtp.MtpObjectInfo.Builder setObjectHandle(int);
    method public android.mtp.MtpObjectInfo.Builder setParent(int);
    method public android.mtp.MtpObjectInfo.Builder setProtectionStatus(int);
    method public android.mtp.MtpObjectInfo.Builder setSequenceNumber(long);
    method public android.mtp.MtpObjectInfo.Builder setStorageId(int);
    method public android.mtp.MtpObjectInfo.Builder setThumbCompressedSize(long);
    method public android.mtp.MtpObjectInfo.Builder setThumbFormat(int);
    method public android.mtp.MtpObjectInfo.Builder setThumbPixHeight(long);
    method public android.mtp.MtpObjectInfo.Builder setThumbPixWidth(long);
  }

  public final class MtpStorageInfo {
    method @NonNull public String getDescription();
    method public long getFreeSpace();
    method public long getMaxCapacity();
    method public int getStorageId();
    method @NonNull public String getVolumeIdentifier();
  }

}

package android.net {

  public class CaptivePortal implements android.os.Parcelable {
    method public int describeContents();
    method public void ignoreNetwork();
    method public void reportCaptivePortalDismissed();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.CaptivePortal> CREATOR;
  }

  public class ConnectivityManager {
    method public void addDefaultNetworkActiveListener(android.net.ConnectivityManager.OnNetworkActiveListener);
    method public boolean bindProcessToNetwork(@Nullable android.net.Network);
    method public android.net.SocketKeepalive createSocketKeepalive(@NonNull android.net.Network, @NonNull android.net.IpSecManager.UdpEncapsulationSocket, @NonNull java.net.InetAddress, @NonNull java.net.InetAddress, @NonNull java.util.concurrent.Executor, @NonNull android.net.SocketKeepalive.Callback);
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) @Nullable public android.net.Network getActiveNetwork();
    method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.NetworkInfo getActiveNetworkInfo();
    method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.NetworkInfo[] getAllNetworkInfo();
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) @NonNull public android.net.Network[] getAllNetworks();
    method @Deprecated public boolean getBackgroundDataSetting();
    method @Nullable public android.net.Network getBoundNetworkForProcess();
    method public int getConnectionOwnerUid(int, @NonNull java.net.InetSocketAddress, @NonNull java.net.InetSocketAddress);
    method @Nullable public android.net.ProxyInfo getDefaultProxy();
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) @Nullable public android.net.LinkProperties getLinkProperties(@Nullable android.net.Network);
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public int getMultipathPreference(@Nullable android.net.Network);
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) @Nullable public android.net.NetworkCapabilities getNetworkCapabilities(@Nullable android.net.Network);
    method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.NetworkInfo getNetworkInfo(int);
    method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.NetworkInfo getNetworkInfo(@Nullable android.net.Network);
    method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public int getNetworkPreference();
    method @Nullable public byte[] getNetworkWatchlistConfigHash();
    method @Deprecated @Nullable public static android.net.Network getProcessDefaultNetwork();
    method public int getRestrictBackgroundStatus();
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public boolean isActiveNetworkMetered();
    method public boolean isDefaultNetworkActive();
    method @Deprecated public static boolean isNetworkTypeValid(int);
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerDefaultNetworkCallback(@NonNull android.net.ConnectivityManager.NetworkCallback);
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerDefaultNetworkCallback(@NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerNetworkCallback(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback);
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerNetworkCallback(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerNetworkCallback(@NonNull android.net.NetworkRequest, @NonNull android.app.PendingIntent);
    method public void releaseNetworkRequest(@NonNull android.app.PendingIntent);
    method public void removeDefaultNetworkActiveListener(@NonNull android.net.ConnectivityManager.OnNetworkActiveListener);
    method @Deprecated public void reportBadNetwork(@Nullable android.net.Network);
    method public void reportNetworkConnectivity(@Nullable android.net.Network, boolean);
    method public boolean requestBandwidthUpdate(@NonNull android.net.Network);
    method public void requestNetwork(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback);
    method public void requestNetwork(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
    method public void requestNetwork(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback, int);
    method public void requestNetwork(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler, int);
    method public void requestNetwork(@NonNull android.net.NetworkRequest, @NonNull android.app.PendingIntent);
    method @Deprecated public void setNetworkPreference(int);
    method @Deprecated public static boolean setProcessDefaultNetwork(@Nullable android.net.Network);
    method public void unregisterNetworkCallback(@NonNull android.net.ConnectivityManager.NetworkCallback);
    method public void unregisterNetworkCallback(@NonNull android.app.PendingIntent);
    field @Deprecated public static final String ACTION_BACKGROUND_DATA_SETTING_CHANGED = "android.net.conn.BACKGROUND_DATA_SETTING_CHANGED";
    field public static final String ACTION_CAPTIVE_PORTAL_SIGN_IN = "android.net.conn.CAPTIVE_PORTAL";
    field public static final String ACTION_RESTRICT_BACKGROUND_CHANGED = "android.net.conn.RESTRICT_BACKGROUND_CHANGED";
    field @Deprecated public static final String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
    field @Deprecated public static final int DEFAULT_NETWORK_PREFERENCE = 1; // 0x1
    field public static final String EXTRA_CAPTIVE_PORTAL = "android.net.extra.CAPTIVE_PORTAL";
    field public static final String EXTRA_CAPTIVE_PORTAL_URL = "android.net.extra.CAPTIVE_PORTAL_URL";
    field @Deprecated public static final String EXTRA_EXTRA_INFO = "extraInfo";
    field @Deprecated public static final String EXTRA_IS_FAILOVER = "isFailover";
    field public static final String EXTRA_NETWORK = "android.net.extra.NETWORK";
    field @Deprecated public static final String EXTRA_NETWORK_INFO = "networkInfo";
    field public static final String EXTRA_NETWORK_REQUEST = "android.net.extra.NETWORK_REQUEST";
    field public static final String EXTRA_NETWORK_TYPE = "networkType";
    field public static final String EXTRA_NO_CONNECTIVITY = "noConnectivity";
    field @Deprecated public static final String EXTRA_OTHER_NETWORK_INFO = "otherNetwork";
    field public static final String EXTRA_REASON = "reason";
    field public static final int MULTIPATH_PREFERENCE_HANDOVER = 1; // 0x1
    field public static final int MULTIPATH_PREFERENCE_PERFORMANCE = 4; // 0x4
    field public static final int MULTIPATH_PREFERENCE_RELIABILITY = 2; // 0x2
    field public static final int RESTRICT_BACKGROUND_STATUS_DISABLED = 1; // 0x1
    field public static final int RESTRICT_BACKGROUND_STATUS_ENABLED = 3; // 0x3
    field public static final int RESTRICT_BACKGROUND_STATUS_WHITELISTED = 2; // 0x2
    field @Deprecated public static final int TYPE_BLUETOOTH = 7; // 0x7
    field @Deprecated public static final int TYPE_DUMMY = 8; // 0x8
    field @Deprecated public static final int TYPE_ETHERNET = 9; // 0x9
    field @Deprecated public static final int TYPE_MOBILE = 0; // 0x0
    field @Deprecated public static final int TYPE_MOBILE_DUN = 4; // 0x4
    field @Deprecated public static final int TYPE_MOBILE_HIPRI = 5; // 0x5
    field @Deprecated public static final int TYPE_MOBILE_MMS = 2; // 0x2
    field @Deprecated public static final int TYPE_MOBILE_SUPL = 3; // 0x3
    field @Deprecated public static final int TYPE_VPN = 17; // 0x11
    field @Deprecated public static final int TYPE_WIFI = 1; // 0x1
    field @Deprecated public static final int TYPE_WIMAX = 6; // 0x6
  }

  public static class ConnectivityManager.NetworkCallback {
    ctor public ConnectivityManager.NetworkCallback();
    method public void onAvailable(android.net.Network);
    method public void onBlockedStatusChanged(android.net.Network, boolean);
    method public void onCapabilitiesChanged(android.net.Network, android.net.NetworkCapabilities);
    method public void onLinkPropertiesChanged(android.net.Network, android.net.LinkProperties);
    method public void onLosing(android.net.Network, int);
    method public void onLost(android.net.Network);
    method public void onUnavailable();
  }

  public static interface ConnectivityManager.OnNetworkActiveListener {
    method public void onNetworkActive();
  }

  public class Credentials {
    ctor public Credentials(int, int, int);
    method public int getGid();
    method public int getPid();
    method public int getUid();
  }

  public class DhcpInfo implements android.os.Parcelable {
    ctor public DhcpInfo();
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public int dns1;
    field public int dns2;
    field public int gateway;
    field public int ipAddress;
    field public int leaseDuration;
    field public int netmask;
    field public int serverAddress;
  }

  public final class DnsResolver {
    method public static android.net.DnsResolver getInstance();
    method public void query(@Nullable android.net.Network, @NonNull byte[], int, @NonNull android.os.Handler, @NonNull android.net.DnsResolver.RawAnswerListener) throws android.system.ErrnoException;
    method public void query(@Nullable android.net.Network, @NonNull String, int, int, int, @NonNull android.os.Handler, @NonNull android.net.DnsResolver.RawAnswerListener) throws android.system.ErrnoException;
    method public void query(@Nullable android.net.Network, @NonNull String, int, @NonNull android.os.Handler, @NonNull android.net.DnsResolver.InetAddressAnswerListener) throws android.system.ErrnoException;
    field public static final int CLASS_IN = 1; // 0x1
    field public static final int FLAG_EMPTY = 0; // 0x0
    field public static final int FLAG_NO_CACHE_LOOKUP = 4; // 0x4
    field public static final int FLAG_NO_CACHE_STORE = 2; // 0x2
    field public static final int FLAG_NO_RETRY = 1; // 0x1
    field public static final int TYPE_A = 1; // 0x1
    field public static final int TYPE_AAAA = 28; // 0x1c
  }

  public static interface DnsResolver.InetAddressAnswerListener {
    method public void onAnswer(@NonNull java.util.List<java.net.InetAddress>);
  }

  public static interface DnsResolver.RawAnswerListener {
    method public void onAnswer(@Nullable byte[]);
  }

  public class InetAddresses {
    method public static boolean isNumericAddress(String);
    method public static java.net.InetAddress parseNumericAddress(String);
  }

  public final class IpPrefix implements android.os.Parcelable {
    method public boolean contains(java.net.InetAddress);
    method public int describeContents();
    method public java.net.InetAddress getAddress();
    method public int getPrefixLength();
    method public byte[] getRawAddress();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.IpPrefix> CREATOR;
  }

  public final class IpSecAlgorithm implements android.os.Parcelable {
    ctor public IpSecAlgorithm(@NonNull String, @NonNull byte[]);
    ctor public IpSecAlgorithm(@NonNull String, @NonNull byte[], int);
    method public int describeContents();
    method @NonNull public byte[] getKey();
    method @NonNull public String getName();
    method public int getTruncationLengthBits();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final String AUTH_CRYPT_AES_GCM = "rfc4106(gcm(aes))";
    field public static final String AUTH_HMAC_MD5 = "hmac(md5)";
    field public static final String AUTH_HMAC_SHA1 = "hmac(sha1)";
    field public static final String AUTH_HMAC_SHA256 = "hmac(sha256)";
    field public static final String AUTH_HMAC_SHA384 = "hmac(sha384)";
    field public static final String AUTH_HMAC_SHA512 = "hmac(sha512)";
    field public static final android.os.Parcelable.Creator<android.net.IpSecAlgorithm> CREATOR;
    field public static final String CRYPT_AES_CBC = "cbc(aes)";
  }

  public final class IpSecManager {
    method @NonNull public android.net.IpSecManager.SecurityParameterIndex allocateSecurityParameterIndex(@NonNull java.net.InetAddress) throws android.net.IpSecManager.ResourceUnavailableException;
    method @NonNull public android.net.IpSecManager.SecurityParameterIndex allocateSecurityParameterIndex(@NonNull java.net.InetAddress, int) throws android.net.IpSecManager.ResourceUnavailableException, android.net.IpSecManager.SpiUnavailableException;
    method public void applyTransportModeTransform(@NonNull java.net.Socket, int, @NonNull android.net.IpSecTransform) throws java.io.IOException;
    method public void applyTransportModeTransform(@NonNull java.net.DatagramSocket, int, @NonNull android.net.IpSecTransform) throws java.io.IOException;
    method public void applyTransportModeTransform(@NonNull java.io.FileDescriptor, int, @NonNull android.net.IpSecTransform) throws java.io.IOException;
    method @NonNull public android.net.IpSecManager.UdpEncapsulationSocket openUdpEncapsulationSocket(int) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException;
    method @NonNull public android.net.IpSecManager.UdpEncapsulationSocket openUdpEncapsulationSocket() throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException;
    method public void removeTransportModeTransforms(@NonNull java.net.Socket) throws java.io.IOException;
    method public void removeTransportModeTransforms(@NonNull java.net.DatagramSocket) throws java.io.IOException;
    method public void removeTransportModeTransforms(@NonNull java.io.FileDescriptor) throws java.io.IOException;
    field public static final int DIRECTION_IN = 0; // 0x0
    field public static final int DIRECTION_OUT = 1; // 0x1
  }

  public static final class IpSecManager.ResourceUnavailableException extends android.util.AndroidException {
  }

  public static final class IpSecManager.SecurityParameterIndex implements java.lang.AutoCloseable {
    method public void close();
    method public int getSpi();
  }

  public static final class IpSecManager.SpiUnavailableException extends android.util.AndroidException {
    method public int getSpi();
  }

  public static final class IpSecManager.UdpEncapsulationSocket implements java.lang.AutoCloseable {
    method public void close() throws java.io.IOException;
    method public java.io.FileDescriptor getFileDescriptor();
    method public int getPort();
  }

  public final class IpSecTransform implements java.lang.AutoCloseable {
    method public void close();
  }

  public static class IpSecTransform.Builder {
    ctor public IpSecTransform.Builder(@NonNull android.content.Context);
    method @NonNull public android.net.IpSecTransform buildTransportModeTransform(@NonNull java.net.InetAddress, @NonNull android.net.IpSecManager.SecurityParameterIndex) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException, android.net.IpSecManager.SpiUnavailableException;
    method @NonNull public android.net.IpSecTransform.Builder setAuthenticatedEncryption(@NonNull android.net.IpSecAlgorithm);
    method @NonNull public android.net.IpSecTransform.Builder setAuthentication(@NonNull android.net.IpSecAlgorithm);
    method @NonNull public android.net.IpSecTransform.Builder setEncryption(@NonNull android.net.IpSecAlgorithm);
    method @NonNull public android.net.IpSecTransform.Builder setIpv4Encapsulation(@NonNull android.net.IpSecManager.UdpEncapsulationSocket, int);
  }

  public class LinkAddress implements android.os.Parcelable {
    method public int describeContents();
    method public java.net.InetAddress getAddress();
    method public int getFlags();
    method public int getPrefixLength();
    method public int getScope();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.LinkAddress> CREATOR;
  }

  public final class LinkProperties implements android.os.Parcelable {
    method public int describeContents();
    method public java.util.List<java.net.InetAddress> getDnsServers();
    method public String getDomains();
    method public android.net.ProxyInfo getHttpProxy();
    method @Nullable public String getInterfaceName();
    method public java.util.List<android.net.LinkAddress> getLinkAddresses();
    method public int getMtu();
    method @Nullable public String getPrivateDnsServerName();
    method public java.util.List<android.net.RouteInfo> getRoutes();
    method public boolean isPrivateDnsActive();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.LinkProperties> CREATOR;
  }

  public class LocalServerSocket implements java.io.Closeable {
    ctor public LocalServerSocket(String) throws java.io.IOException;
    ctor public LocalServerSocket(java.io.FileDescriptor) throws java.io.IOException;
    method public android.net.LocalSocket accept() throws java.io.IOException;
    method public void close() throws java.io.IOException;
    method public java.io.FileDescriptor getFileDescriptor();
    method public android.net.LocalSocketAddress getLocalSocketAddress();
  }

  public class LocalSocket implements java.io.Closeable {
    ctor public LocalSocket();
    ctor public LocalSocket(int);
    method public void bind(android.net.LocalSocketAddress) throws java.io.IOException;
    method public void close() throws java.io.IOException;
    method public void connect(android.net.LocalSocketAddress) throws java.io.IOException;
    method public void connect(android.net.LocalSocketAddress, int) throws java.io.IOException;
    method public java.io.FileDescriptor[] getAncillaryFileDescriptors() throws java.io.IOException;
    method public java.io.FileDescriptor getFileDescriptor();
    method public java.io.InputStream getInputStream() throws java.io.IOException;
    method public android.net.LocalSocketAddress getLocalSocketAddress();
    method public java.io.OutputStream getOutputStream() throws java.io.IOException;
    method public android.net.Credentials getPeerCredentials() throws java.io.IOException;
    method public int getReceiveBufferSize() throws java.io.IOException;
    method public android.net.LocalSocketAddress getRemoteSocketAddress();
    method public int getSendBufferSize() throws java.io.IOException;
    method public int getSoTimeout() throws java.io.IOException;
    method public boolean isBound();
    method public boolean isClosed();
    method public boolean isConnected();
    method public boolean isInputShutdown();
    method public boolean isOutputShutdown();
    method public void setFileDescriptorsForSend(java.io.FileDescriptor[]);
    method public void setReceiveBufferSize(int) throws java.io.IOException;
    method public void setSendBufferSize(int) throws java.io.IOException;
    method public void setSoTimeout(int) throws java.io.IOException;
    method public void shutdownInput() throws java.io.IOException;
    method public void shutdownOutput() throws java.io.IOException;
    field public static final int SOCKET_DGRAM = 1; // 0x1
    field public static final int SOCKET_SEQPACKET = 3; // 0x3
    field public static final int SOCKET_STREAM = 2; // 0x2
  }

  public class LocalSocketAddress {
    ctor public LocalSocketAddress(String, android.net.LocalSocketAddress.Namespace);
    ctor public LocalSocketAddress(String);
    method public String getName();
    method public android.net.LocalSocketAddress.Namespace getNamespace();
  }

  public enum LocalSocketAddress.Namespace {
    enum_constant public static final android.net.LocalSocketAddress.Namespace ABSTRACT;
    enum_constant public static final android.net.LocalSocketAddress.Namespace FILESYSTEM;
    enum_constant public static final android.net.LocalSocketAddress.Namespace RESERVED;
  }

  public final class MacAddress implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public static android.net.MacAddress fromBytes(@NonNull byte[]);
    method @NonNull public static android.net.MacAddress fromString(@NonNull String);
    method public int getAddressType();
    method public boolean isLocallyAssigned();
    method @NonNull public byte[] toByteArray();
    method @NonNull public String toOuiString();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.net.MacAddress BROADCAST_ADDRESS;
    field public static final android.os.Parcelable.Creator<android.net.MacAddress> CREATOR;
    field public static final int TYPE_BROADCAST = 3; // 0x3
    field public static final int TYPE_MULTICAST = 2; // 0x2
    field public static final int TYPE_UNICAST = 1; // 0x1
  }

  public class MailTo {
    method public String getBody();
    method public String getCc();
    method public java.util.Map<java.lang.String,java.lang.String> getHeaders();
    method public String getSubject();
    method public String getTo();
    method public static boolean isMailTo(String);
    method public static android.net.MailTo parse(String) throws android.net.ParseException;
    field public static final String MAILTO_SCHEME = "mailto:";
  }

  public class Network implements android.os.Parcelable {
    method public void bindSocket(java.net.DatagramSocket) throws java.io.IOException;
    method public void bindSocket(java.net.Socket) throws java.io.IOException;
    method public void bindSocket(java.io.FileDescriptor) throws java.io.IOException;
    method public int describeContents();
    method public static android.net.Network fromNetworkHandle(long);
    method public java.net.InetAddress[] getAllByName(String) throws java.net.UnknownHostException;
    method public java.net.InetAddress getByName(String) throws java.net.UnknownHostException;
    method public long getNetworkHandle();
    method public javax.net.SocketFactory getSocketFactory();
    method public java.net.URLConnection openConnection(java.net.URL) throws java.io.IOException;
    method public java.net.URLConnection openConnection(java.net.URL, java.net.Proxy) throws java.io.IOException;
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.Network> CREATOR;
  }

  public final class NetworkCapabilities implements android.os.Parcelable {
    ctor public NetworkCapabilities(android.net.NetworkCapabilities);
    method public int describeContents();
    method public int getLinkDownstreamBandwidthKbps();
    method public int getLinkUpstreamBandwidthKbps();
    method @Nullable public android.net.TransportInfo getTransportInfo();
    method public boolean hasCapability(int);
    method public boolean hasTransport(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.NetworkCapabilities> CREATOR;
    field public static final int NET_CAPABILITY_CAPTIVE_PORTAL = 17; // 0x11
    field public static final int NET_CAPABILITY_CBS = 5; // 0x5
    field public static final int NET_CAPABILITY_DUN = 2; // 0x2
    field public static final int NET_CAPABILITY_EIMS = 10; // 0xa
    field public static final int NET_CAPABILITY_FOREGROUND = 19; // 0x13
    field public static final int NET_CAPABILITY_FOTA = 3; // 0x3
    field public static final int NET_CAPABILITY_IA = 7; // 0x7
    field public static final int NET_CAPABILITY_IMS = 4; // 0x4
    field public static final int NET_CAPABILITY_INTERNET = 12; // 0xc
    field public static final int NET_CAPABILITY_MMS = 0; // 0x0
    field public static final int NET_CAPABILITY_NOT_CONGESTED = 20; // 0x14
    field public static final int NET_CAPABILITY_NOT_METERED = 11; // 0xb
    field public static final int NET_CAPABILITY_NOT_RESTRICTED = 13; // 0xd
    field public static final int NET_CAPABILITY_NOT_ROAMING = 18; // 0x12
    field public static final int NET_CAPABILITY_NOT_SUSPENDED = 21; // 0x15
    field public static final int NET_CAPABILITY_NOT_VPN = 15; // 0xf
    field public static final int NET_CAPABILITY_RCS = 8; // 0x8
    field public static final int NET_CAPABILITY_SUPL = 1; // 0x1
    field public static final int NET_CAPABILITY_TRUSTED = 14; // 0xe
    field public static final int NET_CAPABILITY_VALIDATED = 16; // 0x10
    field public static final int NET_CAPABILITY_WIFI_P2P = 6; // 0x6
    field public static final int NET_CAPABILITY_XCAP = 9; // 0x9
    field public static final int TRANSPORT_BLUETOOTH = 2; // 0x2
    field public static final int TRANSPORT_CELLULAR = 0; // 0x0
    field public static final int TRANSPORT_ETHERNET = 3; // 0x3
    field public static final int TRANSPORT_LOWPAN = 6; // 0x6
    field public static final int TRANSPORT_VPN = 4; // 0x4
    field public static final int TRANSPORT_WIFI = 1; // 0x1
    field public static final int TRANSPORT_WIFI_AWARE = 5; // 0x5
  }

  @Deprecated public class NetworkInfo implements android.os.Parcelable {
    method @Deprecated public int describeContents();
    method @Deprecated public android.net.NetworkInfo.DetailedState getDetailedState();
    method @Deprecated public String getExtraInfo();
    method @Deprecated public String getReason();
    method @Deprecated public android.net.NetworkInfo.State getState();
    method @Deprecated public int getSubtype();
    method @Deprecated public String getSubtypeName();
    method @Deprecated public int getType();
    method @Deprecated public String getTypeName();
    method @Deprecated public boolean isAvailable();
    method @Deprecated public boolean isConnected();
    method @Deprecated public boolean isConnectedOrConnecting();
    method @Deprecated public boolean isFailover();
    method @Deprecated public boolean isRoaming();
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public static final android.os.Parcelable.Creator<android.net.NetworkInfo> CREATOR;
  }

  @Deprecated public enum NetworkInfo.DetailedState {
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState AUTHENTICATING;
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState BLOCKED;
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState CAPTIVE_PORTAL_CHECK;
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState CONNECTED;
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState CONNECTING;
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState DISCONNECTED;
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState DISCONNECTING;
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState FAILED;
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState IDLE;
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState OBTAINING_IPADDR;
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState SCANNING;
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState SUSPENDED;
    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState VERIFYING_POOR_LINK;
  }

  @Deprecated public enum NetworkInfo.State {
    enum_constant @Deprecated public static final android.net.NetworkInfo.State CONNECTED;
    enum_constant @Deprecated public static final android.net.NetworkInfo.State CONNECTING;
    enum_constant @Deprecated public static final android.net.NetworkInfo.State DISCONNECTED;
    enum_constant @Deprecated public static final android.net.NetworkInfo.State DISCONNECTING;
    enum_constant @Deprecated public static final android.net.NetworkInfo.State SUSPENDED;
    enum_constant @Deprecated public static final android.net.NetworkInfo.State UNKNOWN;
  }

  public class NetworkRequest implements android.os.Parcelable {
    method public int describeContents();
    method public boolean hasCapability(int);
    method public boolean hasTransport(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.NetworkRequest> CREATOR;
  }

  public static class NetworkRequest.Builder {
    ctor public NetworkRequest.Builder();
    method public android.net.NetworkRequest.Builder addCapability(int);
    method public android.net.NetworkRequest.Builder addTransportType(int);
    method public android.net.NetworkRequest build();
    method public android.net.NetworkRequest.Builder removeCapability(int);
    method public android.net.NetworkRequest.Builder removeTransportType(int);
    method public android.net.NetworkRequest.Builder setNetworkSpecifier(String);
    method public android.net.NetworkRequest.Builder setNetworkSpecifier(android.net.NetworkSpecifier);
  }

  public abstract class NetworkSpecifier {
  }

  public class ParseException extends java.lang.RuntimeException {
    field public String response;
  }

  public final class Proxy {
    ctor public Proxy();
    method @Deprecated public static String getDefaultHost();
    method @Deprecated public static int getDefaultPort();
    method @Deprecated public static String getHost(android.content.Context);
    method @Deprecated public static int getPort(android.content.Context);
    field @Deprecated public static final String EXTRA_PROXY_INFO = "android.intent.extra.PROXY_INFO";
    field public static final String PROXY_CHANGE_ACTION = "android.intent.action.PROXY_CHANGE";
  }

  public class ProxyInfo implements android.os.Parcelable {
    method public static android.net.ProxyInfo buildDirectProxy(String, int);
    method public static android.net.ProxyInfo buildDirectProxy(String, int, java.util.List<java.lang.String>);
    method public static android.net.ProxyInfo buildPacProxy(android.net.Uri);
    method public int describeContents();
    method public String[] getExclusionList();
    method public String getHost();
    method public android.net.Uri getPacFileUrl();
    method public int getPort();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.ProxyInfo> CREATOR;
  }

  public final class RouteInfo implements android.os.Parcelable {
    method public int describeContents();
    method public android.net.IpPrefix getDestination();
    method public java.net.InetAddress getGateway();
    method public String getInterface();
    method public boolean hasGateway();
    method public boolean isDefaultRoute();
    method public boolean matches(java.net.InetAddress);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.RouteInfo> CREATOR;
  }

  @Deprecated public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
    ctor @Deprecated public SSLCertificateSocketFactory(int);
    method @Deprecated public java.net.Socket createSocket(java.net.Socket, String, int, boolean) throws java.io.IOException;
    method @Deprecated public java.net.Socket createSocket(java.net.InetAddress, int, java.net.InetAddress, int) throws java.io.IOException;
    method @Deprecated public java.net.Socket createSocket(java.net.InetAddress, int) throws java.io.IOException;
    method @Deprecated public java.net.Socket createSocket(String, int, java.net.InetAddress, int) throws java.io.IOException;
    method @Deprecated public java.net.Socket createSocket(String, int) throws java.io.IOException;
    method @Deprecated public static javax.net.SocketFactory getDefault(int);
    method @Deprecated public static javax.net.ssl.SSLSocketFactory getDefault(int, android.net.SSLSessionCache);
    method @Deprecated public String[] getDefaultCipherSuites();
    method @Deprecated public static javax.net.ssl.SSLSocketFactory getInsecure(int, android.net.SSLSessionCache);
    method @Deprecated public byte[] getNpnSelectedProtocol(java.net.Socket);
    method @Deprecated public String[] getSupportedCipherSuites();
    method @Deprecated public void setHostname(java.net.Socket, String);
    method @Deprecated public void setKeyManagers(javax.net.ssl.KeyManager[]);
    method @Deprecated public void setNpnProtocols(byte[][]);
    method @Deprecated public void setTrustManagers(javax.net.ssl.TrustManager[]);
    method @Deprecated public void setUseSessionTickets(java.net.Socket, boolean);
  }

  public final class SSLSessionCache {
    ctor public SSLSessionCache(java.io.File) throws java.io.IOException;
    ctor public SSLSessionCache(android.content.Context);
  }

  public abstract class SocketKeepalive implements java.lang.AutoCloseable {
    method public final void close();
    method public final void start(@IntRange(from=0xa, to=0xe10) int);
    method public final void stop();
    field public static final int ERROR_HARDWARE_ERROR = -31; // 0xffffffe1
    field public static final int ERROR_HARDWARE_UNSUPPORTED = -30; // 0xffffffe2
    field public static final int ERROR_INVALID_INTERVAL = -24; // 0xffffffe8
    field public static final int ERROR_INVALID_IP_ADDRESS = -21; // 0xffffffeb
    field public static final int ERROR_INVALID_LENGTH = -23; // 0xffffffe9
    field public static final int ERROR_INVALID_NETWORK = -20; // 0xffffffec
    field public static final int ERROR_INVALID_PORT = -22; // 0xffffffea
    field public static final int ERROR_INVALID_SOCKET = -25; // 0xffffffe7
    field public static final int ERROR_SOCKET_NOT_IDLE = -26; // 0xffffffe6
  }

  public static class SocketKeepalive.Callback {
    ctor public SocketKeepalive.Callback();
    method public void onDataReceived();
    method public void onError(int);
    method public void onStarted();
    method public void onStopped();
  }

  public class TrafficStats {
    ctor public TrafficStats();
    method public static void clearThreadStatsTag();
    method public static void clearThreadStatsUid();
    method public static int getAndSetThreadStatsTag(int);
    method public static long getMobileRxBytes();
    method public static long getMobileRxPackets();
    method public static long getMobileTxBytes();
    method public static long getMobileTxPackets();
    method public static int getThreadStatsTag();
    method public static int getThreadStatsUid();
    method public static long getTotalRxBytes();
    method public static long getTotalRxPackets();
    method public static long getTotalTxBytes();
    method public static long getTotalTxPackets();
    method public static long getUidRxBytes(int);
    method public static long getUidRxPackets(int);
    method @Deprecated public static long getUidTcpRxBytes(int);
    method @Deprecated public static long getUidTcpRxSegments(int);
    method @Deprecated public static long getUidTcpTxBytes(int);
    method @Deprecated public static long getUidTcpTxSegments(int);
    method public static long getUidTxBytes(int);
    method public static long getUidTxPackets(int);
    method @Deprecated public static long getUidUdpRxBytes(int);
    method @Deprecated public static long getUidUdpRxPackets(int);
    method @Deprecated public static long getUidUdpTxBytes(int);
    method @Deprecated public static long getUidUdpTxPackets(int);
    method public static void incrementOperationCount(int);
    method public static void incrementOperationCount(int, int);
    method public static void setThreadStatsTag(int);
    method public static void setThreadStatsUid(int);
    method public static void tagDatagramSocket(java.net.DatagramSocket) throws java.net.SocketException;
    method public static void tagFileDescriptor(java.io.FileDescriptor) throws java.io.IOException;
    method public static void tagSocket(java.net.Socket) throws java.net.SocketException;
    method public static void untagDatagramSocket(java.net.DatagramSocket) throws java.net.SocketException;
    method public static void untagFileDescriptor(java.io.FileDescriptor) throws java.io.IOException;
    method public static void untagSocket(java.net.Socket) throws java.net.SocketException;
    field public static final int UNSUPPORTED = -1; // 0xffffffff
  }

  public interface TransportInfo {
  }

  public abstract class Uri implements java.lang.Comparable<android.net.Uri> android.os.Parcelable {
    method public abstract android.net.Uri.Builder buildUpon();
    method public int compareTo(android.net.Uri);
    method public static String decode(String);
    method public static String encode(String);
    method public static String encode(String, String);
    method public static android.net.Uri fromFile(java.io.File);
    method public static android.net.Uri fromParts(String, String, String);
    method @Nullable public abstract String getAuthority();
    method public boolean getBooleanQueryParameter(String, boolean);
    method @Nullable public abstract String getEncodedAuthority();
    method @Nullable public abstract String getEncodedFragment();
    method @Nullable public abstract String getEncodedPath();
    method @Nullable public abstract String getEncodedQuery();
    method public abstract String getEncodedSchemeSpecificPart();
    method @Nullable public abstract String getEncodedUserInfo();
    method @Nullable public abstract String getFragment();
    method @Nullable public abstract String getHost();
    method @Nullable public abstract String getLastPathSegment();
    method @Nullable public abstract String getPath();
    method public abstract java.util.List<java.lang.String> getPathSegments();
    method public abstract int getPort();
    method @Nullable public abstract String getQuery();
    method @Nullable public String getQueryParameter(String);
    method public java.util.Set<java.lang.String> getQueryParameterNames();
    method public java.util.List<java.lang.String> getQueryParameters(String);
    method @Nullable public abstract String getScheme();
    method public abstract String getSchemeSpecificPart();
    method @Nullable public abstract String getUserInfo();
    method public boolean isAbsolute();
    method public abstract boolean isHierarchical();
    method public boolean isOpaque();
    method public abstract boolean isRelative();
    method public android.net.Uri normalizeScheme();
    method public static android.net.Uri parse(String);
    method public String toSafeString();
    method public abstract String toString();
    method public static android.net.Uri withAppendedPath(android.net.Uri, String);
    method public static void writeToParcel(android.os.Parcel, android.net.Uri);
    field public static final android.os.Parcelable.Creator<android.net.Uri> CREATOR;
    field public static final android.net.Uri EMPTY;
  }

  public static final class Uri.Builder {
    ctor public Uri.Builder();
    method public android.net.Uri.Builder appendEncodedPath(String);
    method public android.net.Uri.Builder appendPath(String);
    method public android.net.Uri.Builder appendQueryParameter(String, String);
    method public android.net.Uri.Builder authority(String);
    method public android.net.Uri build();
    method public android.net.Uri.Builder clearQuery();
    method public android.net.Uri.Builder encodedAuthority(String);
    method public android.net.Uri.Builder encodedFragment(String);
    method public android.net.Uri.Builder encodedOpaquePart(String);
    method public android.net.Uri.Builder encodedPath(String);
    method public android.net.Uri.Builder encodedQuery(String);
    method public android.net.Uri.Builder fragment(String);
    method public android.net.Uri.Builder opaquePart(String);
    method public android.net.Uri.Builder path(String);
    method public android.net.Uri.Builder query(String);
    method public android.net.Uri.Builder scheme(String);
  }

  public class UrlQuerySanitizer {
    ctor public UrlQuerySanitizer();
    ctor public UrlQuerySanitizer(String);
    method protected void addSanitizedEntry(String, String);
    method protected void clear();
    method protected int decodeHexDigit(char);
    method public static final android.net.UrlQuerySanitizer.ValueSanitizer getAllButNulAndAngleBracketsLegal();
    method public static final android.net.UrlQuerySanitizer.ValueSanitizer getAllButNulLegal();
    method public static final android.net.UrlQuerySanitizer.ValueSanitizer getAllButWhitespaceLegal();
    method public static final android.net.UrlQuerySanitizer.ValueSanitizer getAllIllegal();
    method public boolean getAllowUnregisteredParamaters();
    method public static final android.net.UrlQuerySanitizer.ValueSanitizer getAmpAndSpaceLegal();
    method public static final android.net.UrlQuerySanitizer.ValueSanitizer getAmpLegal();
    method public android.net.UrlQuerySanitizer.ValueSanitizer getEffectiveValueSanitizer(String);
    method public java.util.List<android.net.UrlQuerySanitizer.ParameterValuePair> getParameterList();
    method public java.util.Set<java.lang.String> getParameterSet();
    method public boolean getPreferFirstRepeatedParameter();
    method public static final android.net.UrlQuerySanitizer.ValueSanitizer getSpaceLegal();
    method public android.net.UrlQuerySanitizer.ValueSanitizer getUnregisteredParameterValueSanitizer();
    method public static final android.net.UrlQuerySanitizer.ValueSanitizer getUrlAndSpaceLegal();
    method public static final android.net.UrlQuerySanitizer.ValueSanitizer getUrlLegal();
    method public String getValue(String);
    method public android.net.UrlQuerySanitizer.ValueSanitizer getValueSanitizer(String);
    method public boolean hasParameter(String);
    method protected boolean isHexDigit(char);
    method protected void parseEntry(String, String);
    method public void parseQuery(String);
    method public void parseUrl(String);
    method public void registerParameter(String, android.net.UrlQuerySanitizer.ValueSanitizer);
    method public void registerParameters(String[], android.net.UrlQuerySanitizer.ValueSanitizer);
    method public void setAllowUnregisteredParamaters(boolean);
    method public void setPreferFirstRepeatedParameter(boolean);
    method public void setUnregisteredParameterValueSanitizer(android.net.UrlQuerySanitizer.ValueSanitizer);
    method public String unescape(String);
  }

  public static class UrlQuerySanitizer.IllegalCharacterValueSanitizer implements android.net.UrlQuerySanitizer.ValueSanitizer {
    ctor public UrlQuerySanitizer.IllegalCharacterValueSanitizer(int);
    method public String sanitize(String);
    field public static final int ALL_BUT_NUL_AND_ANGLE_BRACKETS_LEGAL = 1439; // 0x59f
    field public static final int ALL_BUT_NUL_LEGAL = 1535; // 0x5ff
    field public static final int ALL_BUT_WHITESPACE_LEGAL = 1532; // 0x5fc
    field public static final int ALL_ILLEGAL = 0; // 0x0
    field public static final int ALL_OK = 2047; // 0x7ff
    field public static final int ALL_WHITESPACE_OK = 3; // 0x3
    field public static final int AMP_AND_SPACE_LEGAL = 129; // 0x81
    field public static final int AMP_LEGAL = 128; // 0x80
    field public static final int AMP_OK = 128; // 0x80
    field public static final int DQUOTE_OK = 8; // 0x8
    field public static final int GT_OK = 64; // 0x40
    field public static final int LT_OK = 32; // 0x20
    field public static final int NON_7_BIT_ASCII_OK = 4; // 0x4
    field public static final int NUL_OK = 512; // 0x200
    field public static final int OTHER_WHITESPACE_OK = 2; // 0x2
    field public static final int PCT_OK = 256; // 0x100
    field public static final int SCRIPT_URL_OK = 1024; // 0x400
    field public static final int SPACE_LEGAL = 1; // 0x1
    field public static final int SPACE_OK = 1; // 0x1
    field public static final int SQUOTE_OK = 16; // 0x10
    field public static final int URL_AND_SPACE_LEGAL = 405; // 0x195
    field public static final int URL_LEGAL = 404; // 0x194
  }

  public class UrlQuerySanitizer.ParameterValuePair {
    ctor public UrlQuerySanitizer.ParameterValuePair(String, String);
    field public String mParameter;
    field public String mValue;
  }

  public static interface UrlQuerySanitizer.ValueSanitizer {
    method public String sanitize(String);
  }

  public class VpnService extends android.app.Service {
    ctor public VpnService();
    method public final boolean isAlwaysOn();
    method public final boolean isLockdownEnabled();
    method public android.os.IBinder onBind(android.content.Intent);
    method public void onRevoke();
    method public static android.content.Intent prepare(android.content.Context);
    method public boolean protect(int);
    method public boolean protect(java.net.Socket);
    method public boolean protect(java.net.DatagramSocket);
    method public boolean setUnderlyingNetworks(android.net.Network[]);
    field public static final String SERVICE_INTERFACE = "android.net.VpnService";
    field public static final String SERVICE_META_DATA_SUPPORTS_ALWAYS_ON = "android.net.VpnService.SUPPORTS_ALWAYS_ON";
  }

  public class VpnService.Builder {
    ctor public VpnService.Builder();
    method public android.net.VpnService.Builder addAddress(java.net.InetAddress, int);
    method public android.net.VpnService.Builder addAddress(String, int);
    method public android.net.VpnService.Builder addAllowedApplication(String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.net.VpnService.Builder addDisallowedApplication(String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.net.VpnService.Builder addDnsServer(java.net.InetAddress);
    method public android.net.VpnService.Builder addDnsServer(String);
    method public android.net.VpnService.Builder addRoute(java.net.InetAddress, int);
    method public android.net.VpnService.Builder addRoute(String, int);
    method public android.net.VpnService.Builder addSearchDomain(String);
    method public android.net.VpnService.Builder allowBypass();
    method public android.net.VpnService.Builder allowFamily(int);
    method public android.os.ParcelFileDescriptor establish();
    method public android.net.VpnService.Builder setBlocking(boolean);
    method public android.net.VpnService.Builder setConfigureIntent(android.app.PendingIntent);
    method public android.net.VpnService.Builder setHttpProxy(android.net.ProxyInfo);
    method public android.net.VpnService.Builder setMetered(boolean);
    method public android.net.VpnService.Builder setMtu(int);
    method public android.net.VpnService.Builder setSession(String);
    method public android.net.VpnService.Builder setUnderlyingNetworks(android.net.Network[]);
  }

}

package android.net.http {

  public final class HttpResponseCache extends java.net.ResponseCache implements java.io.Closeable {
    method public void close() throws java.io.IOException;
    method public void delete() throws java.io.IOException;
    method public void flush();
    method public java.net.CacheResponse get(java.net.URI, String, java.util.Map<java.lang.String,java.util.List<java.lang.String>>) throws java.io.IOException;
    method public int getHitCount();
    method public static android.net.http.HttpResponseCache getInstalled();
    method public int getNetworkCount();
    method public int getRequestCount();
    method public static android.net.http.HttpResponseCache install(java.io.File, long) throws java.io.IOException;
    method public long maxSize();
    method public java.net.CacheRequest put(java.net.URI, java.net.URLConnection) throws java.io.IOException;
    method public long size();
  }

  public class SslCertificate {
    ctor @Deprecated public SslCertificate(String, String, String, String);
    ctor @Deprecated public SslCertificate(String, String, java.util.Date, java.util.Date);
    ctor public SslCertificate(java.security.cert.X509Certificate);
    method public android.net.http.SslCertificate.DName getIssuedBy();
    method public android.net.http.SslCertificate.DName getIssuedTo();
    method @Deprecated public String getValidNotAfter();
    method public java.util.Date getValidNotAfterDate();
    method @Deprecated public String getValidNotBefore();
    method public java.util.Date getValidNotBeforeDate();
    method public java.security.cert.X509Certificate getX509Certificate();
    method public static android.net.http.SslCertificate restoreState(android.os.Bundle);
    method public static android.os.Bundle saveState(android.net.http.SslCertificate);
  }

  public class SslCertificate.DName {
    ctor public SslCertificate.DName(String);
    method public String getCName();
    method public String getDName();
    method public String getOName();
    method public String getUName();
  }

  public class SslError {
    ctor @Deprecated public SslError(int, android.net.http.SslCertificate);
    ctor @Deprecated public SslError(int, java.security.cert.X509Certificate);
    ctor public SslError(int, android.net.http.SslCertificate, String);
    ctor public SslError(int, java.security.cert.X509Certificate, String);
    method public boolean addError(int);
    method public android.net.http.SslCertificate getCertificate();
    method public int getPrimaryError();
    method public String getUrl();
    method public boolean hasError(int);
    field public static final int SSL_DATE_INVALID = 4; // 0x4
    field public static final int SSL_EXPIRED = 1; // 0x1
    field public static final int SSL_IDMISMATCH = 2; // 0x2
    field public static final int SSL_INVALID = 5; // 0x5
    field @Deprecated public static final int SSL_MAX_ERROR = 6; // 0x6
    field public static final int SSL_NOTYETVALID = 0; // 0x0
    field public static final int SSL_UNTRUSTED = 3; // 0x3
  }

  public class X509TrustManagerExtensions {
    ctor public X509TrustManagerExtensions(javax.net.ssl.X509TrustManager) throws java.lang.IllegalArgumentException;
    method public java.util.List<java.security.cert.X509Certificate> checkServerTrusted(java.security.cert.X509Certificate[], String, String) throws java.security.cert.CertificateException;
    method public boolean isSameTrustConfiguration(String, String);
    method public boolean isUserAddedCertificate(java.security.cert.X509Certificate);
  }

}

package android.net.nsd {

  public final class NsdManager {
    method public void discoverServices(String, int, android.net.nsd.NsdManager.DiscoveryListener);
    method public void registerService(android.net.nsd.NsdServiceInfo, int, android.net.nsd.NsdManager.RegistrationListener);
    method public void resolveService(android.net.nsd.NsdServiceInfo, android.net.nsd.NsdManager.ResolveListener);
    method public void stopServiceDiscovery(android.net.nsd.NsdManager.DiscoveryListener);
    method public void unregisterService(android.net.nsd.NsdManager.RegistrationListener);
    field public static final String ACTION_NSD_STATE_CHANGED = "android.net.nsd.STATE_CHANGED";
    field public static final String EXTRA_NSD_STATE = "nsd_state";
    field public static final int FAILURE_ALREADY_ACTIVE = 3; // 0x3
    field public static final int FAILURE_INTERNAL_ERROR = 0; // 0x0
    field public static final int FAILURE_MAX_LIMIT = 4; // 0x4
    field public static final int NSD_STATE_DISABLED = 1; // 0x1
    field public static final int NSD_STATE_ENABLED = 2; // 0x2
    field public static final int PROTOCOL_DNS_SD = 1; // 0x1
  }

  public static interface NsdManager.DiscoveryListener {
    method public void onDiscoveryStarted(String);
    method public void onDiscoveryStopped(String);
    method public void onServiceFound(android.net.nsd.NsdServiceInfo);
    method public void onServiceLost(android.net.nsd.NsdServiceInfo);
    method public void onStartDiscoveryFailed(String, int);
    method public void onStopDiscoveryFailed(String, int);
  }

  public static interface NsdManager.RegistrationListener {
    method public void onRegistrationFailed(android.net.nsd.NsdServiceInfo, int);
    method public void onServiceRegistered(android.net.nsd.NsdServiceInfo);
    method public void onServiceUnregistered(android.net.nsd.NsdServiceInfo);
    method public void onUnregistrationFailed(android.net.nsd.NsdServiceInfo, int);
  }

  public static interface NsdManager.ResolveListener {
    method public void onResolveFailed(android.net.nsd.NsdServiceInfo, int);
    method public void onServiceResolved(android.net.nsd.NsdServiceInfo);
  }

  public final class NsdServiceInfo implements android.os.Parcelable {
    ctor public NsdServiceInfo();
    method public int describeContents();
    method public java.util.Map<java.lang.String,byte[]> getAttributes();
    method public java.net.InetAddress getHost();
    method public int getPort();
    method public String getServiceName();
    method public String getServiceType();
    method public void removeAttribute(String);
    method public void setAttribute(String, String);
    method public void setHost(java.net.InetAddress);
    method public void setPort(int);
    method public void setServiceName(String);
    method public void setServiceType(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.nsd.NsdServiceInfo> CREATOR;
  }

}

package android.net.rtp {

  public class AudioCodec {
    method public static android.net.rtp.AudioCodec getCodec(int, String, String);
    method public static android.net.rtp.AudioCodec[] getCodecs();
    field public static final android.net.rtp.AudioCodec AMR;
    field public static final android.net.rtp.AudioCodec GSM;
    field public static final android.net.rtp.AudioCodec GSM_EFR;
    field public static final android.net.rtp.AudioCodec PCMA;
    field public static final android.net.rtp.AudioCodec PCMU;
    field public final String fmtp;
    field public final String rtpmap;
    field public final int type;
  }

  public class AudioGroup {
    ctor public AudioGroup();
    method public void clear();
    method public int getMode();
    method public android.net.rtp.AudioStream[] getStreams();
    method public void sendDtmf(int);
    method public void setMode(int);
    field public static final int MODE_ECHO_SUPPRESSION = 3; // 0x3
    field public static final int MODE_MUTED = 1; // 0x1
    field public static final int MODE_NORMAL = 2; // 0x2
    field public static final int MODE_ON_HOLD = 0; // 0x0
  }

  public class AudioStream extends android.net.rtp.RtpStream {
    ctor public AudioStream(java.net.InetAddress) throws java.net.SocketException;
    method public android.net.rtp.AudioCodec getCodec();
    method public int getDtmfType();
    method public android.net.rtp.AudioGroup getGroup();
    method public final boolean isBusy();
    method public void join(android.net.rtp.AudioGroup);
    method public void setCodec(android.net.rtp.AudioCodec);
    method public void setDtmfType(int);
  }

  public class RtpStream {
    method public void associate(java.net.InetAddress, int);
    method public java.net.InetAddress getLocalAddress();
    method public int getLocalPort();
    method public int getMode();
    method public java.net.InetAddress getRemoteAddress();
    method public int getRemotePort();
    method public boolean isBusy();
    method public void release();
    method public void setMode(int);
    field public static final int MODE_NORMAL = 0; // 0x0
    field public static final int MODE_RECEIVE_ONLY = 2; // 0x2
    field public static final int MODE_SEND_ONLY = 1; // 0x1
  }

}

package android.net.sip {

  public class SipAudioCall {
    ctor public SipAudioCall(android.content.Context, android.net.sip.SipProfile);
    method public void answerCall(int) throws android.net.sip.SipException;
    method public void attachCall(android.net.sip.SipSession, String) throws android.net.sip.SipException;
    method public void close();
    method public void continueCall(int) throws android.net.sip.SipException;
    method public void endCall() throws android.net.sip.SipException;
    method public android.net.sip.SipProfile getLocalProfile();
    method public android.net.sip.SipProfile getPeerProfile();
    method public int getState();
    method public void holdCall(int) throws android.net.sip.SipException;
    method public boolean isInCall();
    method public boolean isMuted();
    method public boolean isOnHold();
    method public void makeCall(android.net.sip.SipProfile, android.net.sip.SipSession, int) throws android.net.sip.SipException;
    method public void sendDtmf(int);
    method public void sendDtmf(int, android.os.Message);
    method public void setListener(android.net.sip.SipAudioCall.Listener);
    method public void setListener(android.net.sip.SipAudioCall.Listener, boolean);
    method public void setSpeakerMode(boolean);
    method public void startAudio();
    method public void toggleMute();
  }

  public static class SipAudioCall.Listener {
    ctor public SipAudioCall.Listener();
    method public void onCallBusy(android.net.sip.SipAudioCall);
    method public void onCallEnded(android.net.sip.SipAudioCall);
    method public void onCallEstablished(android.net.sip.SipAudioCall);
    method public void onCallHeld(android.net.sip.SipAudioCall);
    method public void onCalling(android.net.sip.SipAudioCall);
    method public void onChanged(android.net.sip.SipAudioCall);
    method public void onError(android.net.sip.SipAudioCall, int, String);
    method public void onReadyToCall(android.net.sip.SipAudioCall);
    method public void onRinging(android.net.sip.SipAudioCall, android.net.sip.SipProfile);
    method public void onRingingBack(android.net.sip.SipAudioCall);
  }

  public class SipErrorCode {
    method public static String toString(int);
    field public static final int CLIENT_ERROR = -4; // 0xfffffffc
    field public static final int CROSS_DOMAIN_AUTHENTICATION = -11; // 0xfffffff5
    field public static final int DATA_CONNECTION_LOST = -10; // 0xfffffff6
    field public static final int INVALID_CREDENTIALS = -8; // 0xfffffff8
    field public static final int INVALID_REMOTE_URI = -6; // 0xfffffffa
    field public static final int IN_PROGRESS = -9; // 0xfffffff7
    field public static final int NO_ERROR = 0; // 0x0
    field public static final int PEER_NOT_REACHABLE = -7; // 0xfffffff9
    field public static final int SERVER_ERROR = -2; // 0xfffffffe
    field public static final int SERVER_UNREACHABLE = -12; // 0xfffffff4
    field public static final int SOCKET_ERROR = -1; // 0xffffffff
    field public static final int TIME_OUT = -5; // 0xfffffffb
    field public static final int TRANSACTION_TERMINTED = -3; // 0xfffffffd
  }

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

  public class SipManager {
    method public void close(String) throws android.net.sip.SipException;
    method public android.net.sip.SipSession createSipSession(android.net.sip.SipProfile, android.net.sip.SipSession.Listener) throws android.net.sip.SipException;
    method public static String getCallId(android.content.Intent);
    method public static String getOfferSessionDescription(android.content.Intent);
    method public android.net.sip.SipSession getSessionFor(android.content.Intent) throws android.net.sip.SipException;
    method public static boolean isApiSupported(android.content.Context);
    method public static boolean isIncomingCallIntent(android.content.Intent);
    method public boolean isOpened(String) throws android.net.sip.SipException;
    method public boolean isRegistered(String) throws android.net.sip.SipException;
    method public static boolean isSipWifiOnly(android.content.Context);
    method public static boolean isVoipSupported(android.content.Context);
    method public android.net.sip.SipAudioCall makeAudioCall(android.net.sip.SipProfile, android.net.sip.SipProfile, android.net.sip.SipAudioCall.Listener, int) throws android.net.sip.SipException;
    method public android.net.sip.SipAudioCall makeAudioCall(String, String, android.net.sip.SipAudioCall.Listener, int) throws android.net.sip.SipException;
    method public static android.net.sip.SipManager newInstance(android.content.Context);
    method public void open(android.net.sip.SipProfile) throws android.net.sip.SipException;
    method public void open(android.net.sip.SipProfile, android.app.PendingIntent, android.net.sip.SipRegistrationListener) throws android.net.sip.SipException;
    method public void register(android.net.sip.SipProfile, int, android.net.sip.SipRegistrationListener) throws android.net.sip.SipException;
    method public void setRegistrationListener(String, android.net.sip.SipRegistrationListener) throws android.net.sip.SipException;
    method public android.net.sip.SipAudioCall takeAudioCall(android.content.Intent, android.net.sip.SipAudioCall.Listener) throws android.net.sip.SipException;
    method public void unregister(android.net.sip.SipProfile, android.net.sip.SipRegistrationListener) throws android.net.sip.SipException;
    field public static final String EXTRA_CALL_ID = "android:sipCallID";
    field public static final String EXTRA_OFFER_SD = "android:sipOfferSD";
    field public static final int INCOMING_CALL_RESULT_CODE = 101; // 0x65
  }

  public class SipProfile implements java.lang.Cloneable android.os.Parcelable java.io.Serializable {
    method public int describeContents();
    method public String getAuthUserName();
    method public boolean getAutoRegistration();
    method public String getDisplayName();
    method public String getPassword();
    method public int getPort();
    method public String getProfileName();
    method public String getProtocol();
    method public String getProxyAddress();
    method public boolean getSendKeepAlive();
    method public String getSipDomain();
    method public String getUriString();
    method public String getUserName();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.sip.SipProfile> CREATOR;
  }

  public static class SipProfile.Builder {
    ctor public SipProfile.Builder(android.net.sip.SipProfile);
    ctor public SipProfile.Builder(String) throws java.text.ParseException;
    ctor public SipProfile.Builder(String, String) throws java.text.ParseException;
    method public android.net.sip.SipProfile build();
    method public android.net.sip.SipProfile.Builder setAuthUserName(String);
    method public android.net.sip.SipProfile.Builder setAutoRegistration(boolean);
    method public android.net.sip.SipProfile.Builder setDisplayName(String);
    method public android.net.sip.SipProfile.Builder setOutboundProxy(String);
    method public android.net.sip.SipProfile.Builder setPassword(String);
    method public android.net.sip.SipProfile.Builder setPort(int) throws java.lang.IllegalArgumentException;
    method public android.net.sip.SipProfile.Builder setProfileName(String);
    method public android.net.sip.SipProfile.Builder setProtocol(String) throws java.lang.IllegalArgumentException;
    method public android.net.sip.SipProfile.Builder setSendKeepAlive(boolean);
  }

  public interface SipRegistrationListener {
    method public void onRegistering(String);
    method public void onRegistrationDone(String, long);
    method public void onRegistrationFailed(String, int, String);
  }

  public final class SipSession {
    method public void answerCall(String, int);
    method public void changeCall(String, int);
    method public void endCall();
    method public String getCallId();
    method public String getLocalIp();
    method public android.net.sip.SipProfile getLocalProfile();
    method public android.net.sip.SipProfile getPeerProfile();
    method public int getState();
    method public boolean isInCall();
    method public void makeCall(android.net.sip.SipProfile, String, int);
    method public void register(int);
    method public void setListener(android.net.sip.SipSession.Listener);
    method public void unregister();
  }

  public static class SipSession.Listener {
    ctor public SipSession.Listener();
    method public void onCallBusy(android.net.sip.SipSession);
    method public void onCallChangeFailed(android.net.sip.SipSession, int, String);
    method public void onCallEnded(android.net.sip.SipSession);
    method public void onCallEstablished(android.net.sip.SipSession, String);
    method public void onCalling(android.net.sip.SipSession);
    method public void onError(android.net.sip.SipSession, int, String);
    method public void onRegistering(android.net.sip.SipSession);
    method public void onRegistrationDone(android.net.sip.SipSession, int);
    method public void onRegistrationFailed(android.net.sip.SipSession, int, String);
    method public void onRegistrationTimeout(android.net.sip.SipSession);
    method public void onRinging(android.net.sip.SipSession, android.net.sip.SipProfile, String);
    method public void onRingingBack(android.net.sip.SipSession);
  }

  public static class SipSession.State {
    method public static String toString(int);
    field public static final int DEREGISTERING = 2; // 0x2
    field public static final int INCOMING_CALL = 3; // 0x3
    field public static final int INCOMING_CALL_ANSWERING = 4; // 0x4
    field public static final int IN_CALL = 8; // 0x8
    field public static final int NOT_DEFINED = 101; // 0x65
    field public static final int OUTGOING_CALL = 5; // 0x5
    field public static final int OUTGOING_CALL_CANCELING = 7; // 0x7
    field public static final int OUTGOING_CALL_RING_BACK = 6; // 0x6
    field public static final int PINGING = 9; // 0x9
    field public static final int READY_TO_CALL = 0; // 0x0
    field public static final int REGISTERING = 1; // 0x1
  }

}

package android.net.ssl {

  public class SSLEngines {
    method public static boolean isSupportedEngine(@NonNull javax.net.ssl.SSLEngine);
    method public static void setUseSessionTickets(@NonNull javax.net.ssl.SSLEngine, boolean);
  }

  public class SSLSockets {
    method public static boolean isSupportedSocket(@NonNull javax.net.ssl.SSLSocket);
    method public static void setUseSessionTickets(@NonNull javax.net.ssl.SSLSocket, boolean);
  }

}

package android.net.wifi {

  public class ScanResult implements android.os.Parcelable {
    method public int describeContents();
    method public boolean is80211mcResponder();
    method public boolean isPasspointNetwork();
    method public void writeToParcel(android.os.Parcel, int);
    field public String BSSID;
    field public static final int CHANNEL_WIDTH_160MHZ = 3; // 0x3
    field public static final int CHANNEL_WIDTH_20MHZ = 0; // 0x0
    field public static final int CHANNEL_WIDTH_40MHZ = 1; // 0x1
    field public static final int CHANNEL_WIDTH_80MHZ = 2; // 0x2
    field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4; // 0x4
    field public String SSID;
    field public String capabilities;
    field public int centerFreq0;
    field public int centerFreq1;
    field public int channelWidth;
    field public int frequency;
    field public int level;
    field public CharSequence operatorFriendlyName;
    field public long timestamp;
    field public CharSequence venueName;
  }

  public enum SupplicantState implements android.os.Parcelable {
    method public int describeContents();
    method public static boolean isValidState(android.net.wifi.SupplicantState);
    method public void writeToParcel(android.os.Parcel, int);
    enum_constant public static final android.net.wifi.SupplicantState ASSOCIATED;
    enum_constant public static final android.net.wifi.SupplicantState ASSOCIATING;
    enum_constant public static final android.net.wifi.SupplicantState AUTHENTICATING;
    enum_constant public static final android.net.wifi.SupplicantState COMPLETED;
    enum_constant public static final android.net.wifi.SupplicantState DISCONNECTED;
    enum_constant public static final android.net.wifi.SupplicantState DORMANT;
    enum_constant public static final android.net.wifi.SupplicantState FOUR_WAY_HANDSHAKE;
    enum_constant public static final android.net.wifi.SupplicantState GROUP_HANDSHAKE;
    enum_constant public static final android.net.wifi.SupplicantState INACTIVE;
    enum_constant public static final android.net.wifi.SupplicantState INTERFACE_DISABLED;
    enum_constant public static final android.net.wifi.SupplicantState INVALID;
    enum_constant public static final android.net.wifi.SupplicantState SCANNING;
    enum_constant public static final android.net.wifi.SupplicantState UNINITIALIZED;
  }

  public class WifiConfiguration implements android.os.Parcelable {
    ctor public WifiConfiguration();
    method public int describeContents();
    method public android.net.ProxyInfo getHttpProxy();
    method public boolean isPasspoint();
    method public void setHttpProxy(android.net.ProxyInfo);
    method public void writeToParcel(android.os.Parcel, int);
    field public String BSSID;
    field public String FQDN;
    field public String SSID;
    field public java.util.BitSet allowedAuthAlgorithms;
    field public java.util.BitSet allowedGroupCiphers;
    field public java.util.BitSet allowedKeyManagement;
    field public java.util.BitSet allowedPairwiseCiphers;
    field public java.util.BitSet allowedProtocols;
    field public android.net.wifi.WifiEnterpriseConfig enterpriseConfig;
    field public boolean hiddenSSID;
    field public boolean isHomeProviderNetwork;
    field public int networkId;
    field public String preSharedKey;
    field @Deprecated public int priority;
    field public String providerFriendlyName;
    field public long[] roamingConsortiumIds;
    field public int status;
    field @Deprecated public String[] wepKeys;
    field @Deprecated public int wepTxKeyIndex;
  }

  public static class WifiConfiguration.AuthAlgorithm {
    field public static final int LEAP = 2; // 0x2
    field public static final int OPEN = 0; // 0x0
    field @Deprecated public static final int SHARED = 1; // 0x1
    field public static final String[] strings;
    field public static final String varName = "auth_alg";
  }

  public static class WifiConfiguration.GroupCipher {
    field public static final int CCMP = 3; // 0x3
    field public static final int TKIP = 2; // 0x2
    field @Deprecated public static final int WEP104 = 1; // 0x1
    field @Deprecated public static final int WEP40 = 0; // 0x0
    field public static final String[] strings;
    field public static final String varName = "group";
  }

  public static class WifiConfiguration.KeyMgmt {
    field public static final int IEEE8021X = 3; // 0x3
    field public static final int NONE = 0; // 0x0
    field public static final int WPA_EAP = 2; // 0x2
    field public static final int WPA_PSK = 1; // 0x1
    field public static final String[] strings;
    field public static final String varName = "key_mgmt";
  }

  public static class WifiConfiguration.PairwiseCipher {
    field public static final int CCMP = 2; // 0x2
    field public static final int NONE = 0; // 0x0
    field @Deprecated public static final int TKIP = 1; // 0x1
    field public static final String[] strings;
    field public static final String varName = "pairwise";
  }

  public static class WifiConfiguration.Protocol {
    field public static final int RSN = 1; // 0x1
    field @Deprecated public static final int WPA = 0; // 0x0
    field public static final String[] strings;
    field public static final String varName = "proto";
  }

  public static class WifiConfiguration.Status {
    field public static final int CURRENT = 0; // 0x0
    field public static final int DISABLED = 1; // 0x1
    field public static final int ENABLED = 2; // 0x2
    field public static final String[] strings;
  }

  public class WifiEnterpriseConfig implements android.os.Parcelable {
    ctor public WifiEnterpriseConfig();
    ctor public WifiEnterpriseConfig(android.net.wifi.WifiEnterpriseConfig);
    method public int describeContents();
    method public String getAltSubjectMatch();
    method public String getAnonymousIdentity();
    method @Nullable public java.security.cert.X509Certificate getCaCertificate();
    method @Nullable public java.security.cert.X509Certificate[] getCaCertificates();
    method public java.security.cert.X509Certificate getClientCertificate();
    method @Nullable public java.security.cert.X509Certificate[] getClientCertificateChain();
    method public String getDomainSuffixMatch();
    method public int getEapMethod();
    method public String getIdentity();
    method public String getPassword();
    method public int getPhase2Method();
    method public String getPlmn();
    method public String getRealm();
    method @Deprecated public String getSubjectMatch();
    method public void setAltSubjectMatch(String);
    method public void setAnonymousIdentity(String);
    method public void setCaCertificate(@Nullable java.security.cert.X509Certificate);
    method public void setCaCertificates(@Nullable java.security.cert.X509Certificate[]);
    method public void setClientKeyEntry(java.security.PrivateKey, java.security.cert.X509Certificate);
    method public void setClientKeyEntryWithCertificateChain(java.security.PrivateKey, java.security.cert.X509Certificate[]);
    method public void setDomainSuffixMatch(String);
    method public void setEapMethod(int);
    method public void setIdentity(String);
    method public void setPassword(String);
    method public void setPhase2Method(int);
    method public void setPlmn(String);
    method public void setRealm(String);
    method @Deprecated public void setSubjectMatch(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.WifiEnterpriseConfig> CREATOR;
  }

  public static final class WifiEnterpriseConfig.Eap {
    field public static final int AKA = 5; // 0x5
    field public static final int AKA_PRIME = 6; // 0x6
    field public static final int NONE = -1; // 0xffffffff
    field public static final int PEAP = 0; // 0x0
    field public static final int PWD = 3; // 0x3
    field public static final int SIM = 4; // 0x4
    field public static final int TLS = 1; // 0x1
    field public static final int TTLS = 2; // 0x2
    field public static final int UNAUTH_TLS = 7; // 0x7
  }

  public static final class WifiEnterpriseConfig.Phase2 {
    field public static final int AKA = 6; // 0x6
    field public static final int AKA_PRIME = 7; // 0x7
    field public static final int GTC = 4; // 0x4
    field public static final int MSCHAP = 2; // 0x2
    field public static final int MSCHAPV2 = 3; // 0x3
    field public static final int NONE = 0; // 0x0
    field public static final int PAP = 1; // 0x1
    field public static final int SIM = 5; // 0x5
  }

  public class WifiInfo implements android.os.Parcelable {
    method public int describeContents();
    method public String getBSSID();
    method public static android.net.NetworkInfo.DetailedState getDetailedStateOf(android.net.wifi.SupplicantState);
    method public int getFrequency();
    method public boolean getHiddenSSID();
    method public int getIpAddress();
    method public int getLinkSpeed();
    method public String getMacAddress();
    method public int getNetworkId();
    method public int getRssi();
    method public String getSSID();
    method public android.net.wifi.SupplicantState getSupplicantState();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final String FREQUENCY_UNITS = "MHz";
    field public static final String LINK_SPEED_UNITS = "Mbps";
  }

  public class WifiManager {
    method public int addNetwork(android.net.wifi.WifiConfiguration);
    method public void addOrUpdatePasspointConfiguration(android.net.wifi.hotspot2.PasspointConfiguration);
    method public static int calculateSignalLevel(int, int);
    method @Deprecated public void cancelWps(android.net.wifi.WifiManager.WpsCallback);
    method public static int compareSignalLevel(int, int);
    method public android.net.wifi.WifiManager.MulticastLock createMulticastLock(String);
    method public android.net.wifi.WifiManager.WifiLock createWifiLock(int, String);
    method public android.net.wifi.WifiManager.WifiLock createWifiLock(String);
    method public boolean disableNetwork(int);
    method public boolean disconnect();
    method public boolean enableNetwork(int, boolean);
    method public java.util.List<android.net.wifi.WifiConfiguration> getConfiguredNetworks();
    method public android.net.wifi.WifiInfo getConnectionInfo();
    method public android.net.DhcpInfo getDhcpInfo();
    method public java.util.List<android.net.wifi.hotspot2.PasspointConfiguration> getPasspointConfigurations();
    method public java.util.List<android.net.wifi.ScanResult> getScanResults();
    method public int getWifiState();
    method public boolean is5GHzBandSupported();
    method public boolean isDeviceToApRttSupported();
    method public boolean isEnhancedPowerReportingSupported();
    method public boolean isP2pSupported();
    method public boolean isPreferredNetworkOffloadSupported();
    method public boolean isScanAlwaysAvailable();
    method public boolean isTdlsSupported();
    method public boolean isWifiEnabled();
    method @Deprecated public boolean pingSupplicant();
    method public boolean reassociate();
    method public boolean reconnect();
    method public boolean removeNetwork(int);
    method public void removePasspointConfiguration(String);
    method @Deprecated public boolean saveConfiguration();
    method public void setTdlsEnabled(java.net.InetAddress, boolean);
    method public void setTdlsEnabledWithMacAddress(String, boolean);
    method public boolean setWifiEnabled(boolean);
    method public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, @Nullable android.os.Handler);
    method @Deprecated public boolean startScan();
    method @Deprecated public void startWps(android.net.wifi.WpsInfo, android.net.wifi.WifiManager.WpsCallback);
    method public int updateNetwork(android.net.wifi.WifiConfiguration);
    field public static final String ACTION_PICK_WIFI_NETWORK = "android.net.wifi.PICK_WIFI_NETWORK";
    field public static final String ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE = "android.net.wifi.action.REQUEST_SCAN_ALWAYS_AVAILABLE";
    field @Deprecated public static final int ERROR_AUTHENTICATING = 1; // 0x1
    field @Deprecated public static final String EXTRA_BSSID = "bssid";
    field public static final String EXTRA_NETWORK_INFO = "networkInfo";
    field public static final String EXTRA_NEW_RSSI = "newRssi";
    field @Deprecated public static final String EXTRA_NEW_STATE = "newState";
    field public static final String EXTRA_PREVIOUS_WIFI_STATE = "previous_wifi_state";
    field public static final String EXTRA_RESULTS_UPDATED = "resultsUpdated";
    field @Deprecated public static final String EXTRA_SUPPLICANT_CONNECTED = "connected";
    field @Deprecated public static final String EXTRA_SUPPLICANT_ERROR = "supplicantError";
    field @Deprecated public static final String EXTRA_WIFI_INFO = "wifiInfo";
    field public static final String EXTRA_WIFI_STATE = "wifi_state";
    field public static final String NETWORK_IDS_CHANGED_ACTION = "android.net.wifi.NETWORK_IDS_CHANGED";
    field public static final String NETWORK_STATE_CHANGED_ACTION = "android.net.wifi.STATE_CHANGE";
    field public static final String RSSI_CHANGED_ACTION = "android.net.wifi.RSSI_CHANGED";
    field public static final String SCAN_RESULTS_AVAILABLE_ACTION = "android.net.wifi.SCAN_RESULTS";
    field @Deprecated public static final String SUPPLICANT_CONNECTION_CHANGE_ACTION = "android.net.wifi.supplicant.CONNECTION_CHANGE";
    field @Deprecated public static final String SUPPLICANT_STATE_CHANGED_ACTION = "android.net.wifi.supplicant.STATE_CHANGE";
    field public static final int WIFI_MODE_FULL = 1; // 0x1
    field public static final int WIFI_MODE_FULL_HIGH_PERF = 3; // 0x3
    field public static final int WIFI_MODE_SCAN_ONLY = 2; // 0x2
    field public static final String WIFI_STATE_CHANGED_ACTION = "android.net.wifi.WIFI_STATE_CHANGED";
    field public static final int WIFI_STATE_DISABLED = 1; // 0x1
    field public static final int WIFI_STATE_DISABLING = 0; // 0x0
    field public static final int WIFI_STATE_ENABLED = 3; // 0x3
    field public static final int WIFI_STATE_ENABLING = 2; // 0x2
    field public static final int WIFI_STATE_UNKNOWN = 4; // 0x4
    field @Deprecated public static final int WPS_AUTH_FAILURE = 6; // 0x6
    field @Deprecated public static final int WPS_OVERLAP_ERROR = 3; // 0x3
    field @Deprecated public static final int WPS_TIMED_OUT = 7; // 0x7
    field @Deprecated public static final int WPS_TKIP_ONLY_PROHIBITED = 5; // 0x5
    field @Deprecated public static final int WPS_WEP_PROHIBITED = 4; // 0x4
  }

  public static class WifiManager.LocalOnlyHotspotCallback {
    ctor public WifiManager.LocalOnlyHotspotCallback();
    method public void onFailed(int);
    method public void onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation);
    method public void onStopped();
    field public static final int ERROR_GENERIC = 2; // 0x2
    field public static final int ERROR_INCOMPATIBLE_MODE = 3; // 0x3
    field public static final int ERROR_NO_CHANNEL = 1; // 0x1
    field public static final int ERROR_TETHERING_DISALLOWED = 4; // 0x4
  }

  public class WifiManager.LocalOnlyHotspotReservation implements java.lang.AutoCloseable {
    method public void close();
    method public android.net.wifi.WifiConfiguration getWifiConfiguration();
  }

  public class WifiManager.MulticastLock {
    method public void acquire();
    method public boolean isHeld();
    method public void release();
    method public void setReferenceCounted(boolean);
  }

  public class WifiManager.WifiLock {
    method public void acquire();
    method public boolean isHeld();
    method public void release();
    method public void setReferenceCounted(boolean);
    method public void setWorkSource(android.os.WorkSource);
  }

  @Deprecated public abstract static class WifiManager.WpsCallback {
    ctor @Deprecated public WifiManager.WpsCallback();
    method @Deprecated public abstract void onFailed(int);
    method @Deprecated public abstract void onStarted(String);
    method @Deprecated public abstract void onSucceeded();
  }

  @Deprecated public class WpsInfo implements android.os.Parcelable {
    ctor @Deprecated public WpsInfo();
    ctor @Deprecated public WpsInfo(android.net.wifi.WpsInfo);
    method @Deprecated public int describeContents();
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public String BSSID;
    field @Deprecated public static final android.os.Parcelable.Creator<android.net.wifi.WpsInfo> CREATOR;
    field @Deprecated public static final int DISPLAY = 1; // 0x1
    field @Deprecated public static final int INVALID = 4; // 0x4
    field @Deprecated public static final int KEYPAD = 2; // 0x2
    field @Deprecated public static final int LABEL = 3; // 0x3
    field @Deprecated public static final int PBC = 0; // 0x0
    field @Deprecated public String pin;
    field @Deprecated public int setup;
  }

}

package android.net.wifi.aware {

  public class AttachCallback {
    ctor public AttachCallback();
    method public void onAttachFailed();
    method public void onAttached(android.net.wifi.aware.WifiAwareSession);
  }

  public final class Characteristics implements android.os.Parcelable {
    method public int describeContents();
    method public int getMaxMatchFilterLength();
    method public int getMaxServiceNameLength();
    method public int getMaxServiceSpecificInfoLength();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.aware.Characteristics> CREATOR;
  }

  public class DiscoverySession implements java.lang.AutoCloseable {
    method public void close();
    method public android.net.NetworkSpecifier createNetworkSpecifierOpen(@NonNull android.net.wifi.aware.PeerHandle);
    method public android.net.NetworkSpecifier createNetworkSpecifierPassphrase(@NonNull android.net.wifi.aware.PeerHandle, @NonNull String);
    method public void sendMessage(@NonNull android.net.wifi.aware.PeerHandle, int, @Nullable byte[]);
  }

  public class DiscoverySessionCallback {
    ctor public DiscoverySessionCallback();
    method public void onMessageReceived(android.net.wifi.aware.PeerHandle, byte[]);
    method public void onMessageSendFailed(int);
    method public void onMessageSendSucceeded(int);
    method public void onPublishStarted(@NonNull android.net.wifi.aware.PublishDiscoverySession);
    method public void onServiceDiscovered(android.net.wifi.aware.PeerHandle, byte[], java.util.List<byte[]>);
    method public void onServiceDiscoveredWithinRange(android.net.wifi.aware.PeerHandle, byte[], java.util.List<byte[]>, int);
    method public void onSessionConfigFailed();
    method public void onSessionConfigUpdated();
    method public void onSessionTerminated();
    method public void onSubscribeStarted(@NonNull android.net.wifi.aware.SubscribeDiscoverySession);
  }

  public class IdentityChangedListener {
    ctor public IdentityChangedListener();
    method public void onIdentityChanged(byte[]);
  }

  public class PeerHandle {
  }

  public final class PublishConfig implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.aware.PublishConfig> CREATOR;
    field public static final int PUBLISH_TYPE_SOLICITED = 1; // 0x1
    field public static final int PUBLISH_TYPE_UNSOLICITED = 0; // 0x0
  }

  public static final class PublishConfig.Builder {
    ctor public PublishConfig.Builder();
    method public android.net.wifi.aware.PublishConfig build();
    method public android.net.wifi.aware.PublishConfig.Builder setMatchFilter(@Nullable java.util.List<byte[]>);
    method public android.net.wifi.aware.PublishConfig.Builder setPublishType(int);
    method public android.net.wifi.aware.PublishConfig.Builder setRangingEnabled(boolean);
    method public android.net.wifi.aware.PublishConfig.Builder setServiceName(@NonNull String);
    method public android.net.wifi.aware.PublishConfig.Builder setServiceSpecificInfo(@Nullable byte[]);
    method public android.net.wifi.aware.PublishConfig.Builder setTerminateNotificationEnabled(boolean);
    method public android.net.wifi.aware.PublishConfig.Builder setTtlSec(int);
  }

  public class PublishDiscoverySession extends android.net.wifi.aware.DiscoverySession {
    method public void updatePublish(@NonNull android.net.wifi.aware.PublishConfig);
  }

  public final class SubscribeConfig implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.aware.SubscribeConfig> CREATOR;
    field public static final int SUBSCRIBE_TYPE_ACTIVE = 1; // 0x1
    field public static final int SUBSCRIBE_TYPE_PASSIVE = 0; // 0x0
  }

  public static final class SubscribeConfig.Builder {
    ctor public SubscribeConfig.Builder();
    method public android.net.wifi.aware.SubscribeConfig build();
    method public android.net.wifi.aware.SubscribeConfig.Builder setMatchFilter(@Nullable java.util.List<byte[]>);
    method public android.net.wifi.aware.SubscribeConfig.Builder setMaxDistanceMm(int);
    method public android.net.wifi.aware.SubscribeConfig.Builder setMinDistanceMm(int);
    method public android.net.wifi.aware.SubscribeConfig.Builder setServiceName(@NonNull String);
    method public android.net.wifi.aware.SubscribeConfig.Builder setServiceSpecificInfo(@Nullable byte[]);
    method public android.net.wifi.aware.SubscribeConfig.Builder setSubscribeType(int);
    method public android.net.wifi.aware.SubscribeConfig.Builder setTerminateNotificationEnabled(boolean);
    method public android.net.wifi.aware.SubscribeConfig.Builder setTtlSec(int);
  }

  public class SubscribeDiscoverySession extends android.net.wifi.aware.DiscoverySession {
    method public void updateSubscribe(@NonNull android.net.wifi.aware.SubscribeConfig);
  }

  public class WifiAwareManager {
    method public void attach(@NonNull android.net.wifi.aware.AttachCallback, @Nullable android.os.Handler);
    method public void attach(@NonNull android.net.wifi.aware.AttachCallback, @NonNull android.net.wifi.aware.IdentityChangedListener, @Nullable android.os.Handler);
    method public android.net.wifi.aware.Characteristics getCharacteristics();
    method public boolean isAvailable();
    field public static final String ACTION_WIFI_AWARE_STATE_CHANGED = "android.net.wifi.aware.action.WIFI_AWARE_STATE_CHANGED";
    field public static final int WIFI_AWARE_DATA_PATH_ROLE_INITIATOR = 0; // 0x0
    field public static final int WIFI_AWARE_DATA_PATH_ROLE_RESPONDER = 1; // 0x1
  }

  public class WifiAwareSession implements java.lang.AutoCloseable {
    method public void close();
    method public android.net.NetworkSpecifier createNetworkSpecifierOpen(int, @NonNull byte[]);
    method public android.net.NetworkSpecifier createNetworkSpecifierPassphrase(int, @NonNull byte[], @NonNull String);
    method public void publish(@NonNull android.net.wifi.aware.PublishConfig, @NonNull android.net.wifi.aware.DiscoverySessionCallback, @Nullable android.os.Handler);
    method public void subscribe(@NonNull android.net.wifi.aware.SubscribeConfig, @NonNull android.net.wifi.aware.DiscoverySessionCallback, @Nullable android.os.Handler);
  }

}

package android.net.wifi.hotspot2 {

  public final class ConfigParser {
    method public static android.net.wifi.hotspot2.PasspointConfiguration parsePasspointConfig(String, byte[]);
  }

  public final class PasspointConfiguration implements android.os.Parcelable {
    ctor public PasspointConfiguration();
    ctor public PasspointConfiguration(android.net.wifi.hotspot2.PasspointConfiguration);
    method public int describeContents();
    method public android.net.wifi.hotspot2.pps.Credential getCredential();
    method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp();
    method public void setCredential(android.net.wifi.hotspot2.pps.Credential);
    method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.PasspointConfiguration> CREATOR;
  }

}

package android.net.wifi.hotspot2.omadm {

  public final class PpsMoParser {
    method public static android.net.wifi.hotspot2.PasspointConfiguration parseMoText(String);
  }

}

package android.net.wifi.hotspot2.pps {

  public final class Credential implements android.os.Parcelable {
    ctor public Credential();
    ctor public Credential(android.net.wifi.hotspot2.pps.Credential);
    method public int describeContents();
    method public java.security.cert.X509Certificate getCaCertificate();
    method public android.net.wifi.hotspot2.pps.Credential.CertificateCredential getCertCredential();
    method public java.security.cert.X509Certificate[] getClientCertificateChain();
    method public java.security.PrivateKey getClientPrivateKey();
    method public String getRealm();
    method public android.net.wifi.hotspot2.pps.Credential.SimCredential getSimCredential();
    method public android.net.wifi.hotspot2.pps.Credential.UserCredential getUserCredential();
    method public void setCaCertificate(java.security.cert.X509Certificate);
    method public void setCertCredential(android.net.wifi.hotspot2.pps.Credential.CertificateCredential);
    method public void setClientCertificateChain(java.security.cert.X509Certificate[]);
    method public void setClientPrivateKey(java.security.PrivateKey);
    method public void setRealm(String);
    method public void setSimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential);
    method public void setUserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.pps.Credential> CREATOR;
  }

  public static final class Credential.CertificateCredential implements android.os.Parcelable {
    ctor public Credential.CertificateCredential();
    ctor public Credential.CertificateCredential(android.net.wifi.hotspot2.pps.Credential.CertificateCredential);
    method public int describeContents();
    method public byte[] getCertSha256Fingerprint();
    method public String getCertType();
    method public void setCertSha256Fingerprint(byte[]);
    method public void setCertType(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.pps.Credential.CertificateCredential> CREATOR;
  }

  public static final class Credential.SimCredential implements android.os.Parcelable {
    ctor public Credential.SimCredential();
    ctor public Credential.SimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential);
    method public int describeContents();
    method public int getEapType();
    method public String getImsi();
    method public void setEapType(int);
    method public void setImsi(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.pps.Credential.SimCredential> CREATOR;
  }

  public static final class Credential.UserCredential implements android.os.Parcelable {
    ctor public Credential.UserCredential();
    ctor public Credential.UserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential);
    method public int describeContents();
    method public int getEapType();
    method public String getNonEapInnerMethod();
    method public String getPassword();
    method public String getUsername();
    method public void setEapType(int);
    method public void setNonEapInnerMethod(String);
    method public void setPassword(String);
    method public void setUsername(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.pps.Credential.UserCredential> CREATOR;
  }

  public final class HomeSp implements android.os.Parcelable {
    ctor public HomeSp();
    ctor public HomeSp(android.net.wifi.hotspot2.pps.HomeSp);
    method public int describeContents();
    method public String getFqdn();
    method public String getFriendlyName();
    method public long[] getRoamingConsortiumOis();
    method public void setFqdn(String);
    method public void setFriendlyName(String);
    method public void setRoamingConsortiumOis(long[]);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.pps.HomeSp> CREATOR;
  }

}

package android.net.wifi.p2p {

  public class WifiP2pConfig implements android.os.Parcelable {
    ctor public WifiP2pConfig();
    ctor public WifiP2pConfig(android.net.wifi.p2p.WifiP2pConfig);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pConfig> CREATOR;
    field public String deviceAddress;
    field public int groupOwnerIntent;
    field public android.net.wifi.WpsInfo wps;
  }

  public class WifiP2pDevice implements android.os.Parcelable {
    ctor public WifiP2pDevice();
    ctor public WifiP2pDevice(android.net.wifi.p2p.WifiP2pDevice);
    method public int describeContents();
    method public boolean isGroupOwner();
    method public boolean isServiceDiscoveryCapable();
    method public boolean wpsDisplaySupported();
    method public boolean wpsKeypadSupported();
    method public boolean wpsPbcSupported();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int AVAILABLE = 3; // 0x3
    field public static final int CONNECTED = 0; // 0x0
    field public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pDevice> CREATOR;
    field public static final int FAILED = 2; // 0x2
    field public static final int INVITED = 1; // 0x1
    field public static final int UNAVAILABLE = 4; // 0x4
    field public String deviceAddress;
    field public String deviceName;
    field public String primaryDeviceType;
    field public String secondaryDeviceType;
    field public int status;
  }

  public class WifiP2pDeviceList implements android.os.Parcelable {
    ctor public WifiP2pDeviceList();
    ctor public WifiP2pDeviceList(android.net.wifi.p2p.WifiP2pDeviceList);
    method public int describeContents();
    method public android.net.wifi.p2p.WifiP2pDevice get(String);
    method public java.util.Collection<android.net.wifi.p2p.WifiP2pDevice> getDeviceList();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pDeviceList> CREATOR;
  }

  public class WifiP2pGroup implements android.os.Parcelable {
    ctor public WifiP2pGroup();
    ctor public WifiP2pGroup(android.net.wifi.p2p.WifiP2pGroup);
    method public int describeContents();
    method public java.util.Collection<android.net.wifi.p2p.WifiP2pDevice> getClientList();
    method public String getInterface();
    method public String getNetworkName();
    method public android.net.wifi.p2p.WifiP2pDevice getOwner();
    method public String getPassphrase();
    method public boolean isGroupOwner();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pGroup> CREATOR;
  }

  public class WifiP2pInfo implements android.os.Parcelable {
    ctor public WifiP2pInfo();
    ctor public WifiP2pInfo(android.net.wifi.p2p.WifiP2pInfo);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pInfo> CREATOR;
    field public boolean groupFormed;
    field public java.net.InetAddress groupOwnerAddress;
    field public boolean isGroupOwner;
  }

  public class WifiP2pManager {
    method public void addLocalService(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.nsd.WifiP2pServiceInfo, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method public void addServiceRequest(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.nsd.WifiP2pServiceRequest, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method public void cancelConnect(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method public void clearLocalServices(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method public void clearServiceRequests(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method public void connect(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pConfig, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method public void createGroup(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method public void discoverPeers(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method public void discoverServices(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method public android.net.wifi.p2p.WifiP2pManager.Channel initialize(android.content.Context, android.os.Looper, android.net.wifi.p2p.WifiP2pManager.ChannelListener);
    method public void removeGroup(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method public void removeLocalService(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.nsd.WifiP2pServiceInfo, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method public void removeServiceRequest(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.nsd.WifiP2pServiceRequest, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method public void requestConnectionInfo(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener);
    method public void requestGroupInfo(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.GroupInfoListener);
    method public void requestPeers(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.PeerListListener);
    method public void setDnsSdResponseListeners(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.DnsSdServiceResponseListener, android.net.wifi.p2p.WifiP2pManager.DnsSdTxtRecordListener);
    method public void setServiceResponseListener(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ServiceResponseListener);
    method public void setUpnpServiceResponseListener(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.UpnpServiceResponseListener);
    method public void stopPeerDiscovery(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
    field public static final int BUSY = 2; // 0x2
    field public static final int ERROR = 0; // 0x0
    field public static final String EXTRA_DISCOVERY_STATE = "discoveryState";
    field public static final String EXTRA_NETWORK_INFO = "networkInfo";
    field public static final String EXTRA_P2P_DEVICE_LIST = "wifiP2pDeviceList";
    field public static final String EXTRA_WIFI_P2P_DEVICE = "wifiP2pDevice";
    field public static final String EXTRA_WIFI_P2P_GROUP = "p2pGroupInfo";
    field public static final String EXTRA_WIFI_P2P_INFO = "wifiP2pInfo";
    field public static final String EXTRA_WIFI_STATE = "wifi_p2p_state";
    field public static final int NO_SERVICE_REQUESTS = 3; // 0x3
    field public static final int P2P_UNSUPPORTED = 1; // 0x1
    field public static final String WIFI_P2P_CONNECTION_CHANGED_ACTION = "android.net.wifi.p2p.CONNECTION_STATE_CHANGE";
    field public static final String WIFI_P2P_DISCOVERY_CHANGED_ACTION = "android.net.wifi.p2p.DISCOVERY_STATE_CHANGE";
    field public static final int WIFI_P2P_DISCOVERY_STARTED = 2; // 0x2
    field public static final int WIFI_P2P_DISCOVERY_STOPPED = 1; // 0x1
    field public static final String WIFI_P2P_PEERS_CHANGED_ACTION = "android.net.wifi.p2p.PEERS_CHANGED";
    field public static final String WIFI_P2P_STATE_CHANGED_ACTION = "android.net.wifi.p2p.STATE_CHANGED";
    field public static final int WIFI_P2P_STATE_DISABLED = 1; // 0x1
    field public static final int WIFI_P2P_STATE_ENABLED = 2; // 0x2
    field public static final String WIFI_P2P_THIS_DEVICE_CHANGED_ACTION = "android.net.wifi.p2p.THIS_DEVICE_CHANGED";
  }

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

  public static class WifiP2pManager.Channel implements java.lang.AutoCloseable {
    method public void close();
  }

  public static interface WifiP2pManager.ChannelListener {
    method public void onChannelDisconnected();
  }

  public static interface WifiP2pManager.ConnectionInfoListener {
    method public void onConnectionInfoAvailable(android.net.wifi.p2p.WifiP2pInfo);
  }

  public static interface WifiP2pManager.DnsSdServiceResponseListener {
    method public void onDnsSdServiceAvailable(String, String, android.net.wifi.p2p.WifiP2pDevice);
  }

  public static interface WifiP2pManager.DnsSdTxtRecordListener {
    method public void onDnsSdTxtRecordAvailable(String, java.util.Map<java.lang.String,java.lang.String>, android.net.wifi.p2p.WifiP2pDevice);
  }

  public static interface WifiP2pManager.GroupInfoListener {
    method public void onGroupInfoAvailable(android.net.wifi.p2p.WifiP2pGroup);
  }

  public static interface WifiP2pManager.PeerListListener {
    method public void onPeersAvailable(android.net.wifi.p2p.WifiP2pDeviceList);
  }

  public static interface WifiP2pManager.ServiceResponseListener {
    method public void onServiceAvailable(int, byte[], android.net.wifi.p2p.WifiP2pDevice);
  }

  public static interface WifiP2pManager.UpnpServiceResponseListener {
    method public void onUpnpServiceAvailable(java.util.List<java.lang.String>, android.net.wifi.p2p.WifiP2pDevice);
  }

}

package android.net.wifi.p2p.nsd {

  public class WifiP2pDnsSdServiceInfo extends android.net.wifi.p2p.nsd.WifiP2pServiceInfo {
    method public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceInfo newInstance(String, String, java.util.Map<java.lang.String,java.lang.String>);
  }

  public class WifiP2pDnsSdServiceRequest extends android.net.wifi.p2p.nsd.WifiP2pServiceRequest {
    method public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest newInstance();
    method public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest newInstance(String);
    method public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest newInstance(String, String);
  }

  public class WifiP2pServiceInfo implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int SERVICE_TYPE_ALL = 0; // 0x0
    field public static final int SERVICE_TYPE_BONJOUR = 1; // 0x1
    field public static final int SERVICE_TYPE_UPNP = 2; // 0x2
    field public static final int SERVICE_TYPE_VENDOR_SPECIFIC = 255; // 0xff
  }

  public class WifiP2pServiceRequest implements android.os.Parcelable {
    method public int describeContents();
    method public static android.net.wifi.p2p.nsd.WifiP2pServiceRequest newInstance(int, String);
    method public static android.net.wifi.p2p.nsd.WifiP2pServiceRequest newInstance(int);
    method public void writeToParcel(android.os.Parcel, int);
  }

  public class WifiP2pUpnpServiceInfo extends android.net.wifi.p2p.nsd.WifiP2pServiceInfo {
    method public static android.net.wifi.p2p.nsd.WifiP2pUpnpServiceInfo newInstance(String, String, java.util.List<java.lang.String>);
  }

  public class WifiP2pUpnpServiceRequest extends android.net.wifi.p2p.nsd.WifiP2pServiceRequest {
    method public static android.net.wifi.p2p.nsd.WifiP2pUpnpServiceRequest newInstance();
    method public static android.net.wifi.p2p.nsd.WifiP2pUpnpServiceRequest newInstance(String);
  }

}

package android.net.wifi.rtt {

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

  public static final class RangingRequest.Builder {
    ctor public RangingRequest.Builder();
    method public android.net.wifi.rtt.RangingRequest.Builder addAccessPoint(@NonNull android.net.wifi.ScanResult);
    method public android.net.wifi.rtt.RangingRequest.Builder addAccessPoints(@NonNull java.util.List<android.net.wifi.ScanResult>);
    method public android.net.wifi.rtt.RangingRequest.Builder addWifiAwarePeer(@NonNull android.net.MacAddress);
    method public android.net.wifi.rtt.RangingRequest.Builder addWifiAwarePeer(@NonNull android.net.wifi.aware.PeerHandle);
    method public android.net.wifi.rtt.RangingRequest build();
  }

  public final class RangingResult implements android.os.Parcelable {
    method public int describeContents();
    method public int getDistanceMm();
    method public int getDistanceStdDevMm();
    method @Nullable public android.net.MacAddress getMacAddress();
    method public int getNumAttemptedMeasurements();
    method public int getNumSuccessfulMeasurements();
    method @Nullable public android.net.wifi.aware.PeerHandle getPeerHandle();
    method public long getRangingTimestampMillis();
    method public int getRssi();
    method public int getStatus();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.rtt.RangingResult> CREATOR;
    field public static final int STATUS_FAIL = 1; // 0x1
    field public static final int STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC = 2; // 0x2
    field public static final int STATUS_SUCCESS = 0; // 0x0
  }

  public abstract class RangingResultCallback {
    ctor public RangingResultCallback();
    method public abstract void onRangingFailure(int);
    method public abstract void onRangingResults(@NonNull java.util.List<android.net.wifi.rtt.RangingResult>);
    field public static final int STATUS_CODE_FAIL = 1; // 0x1
    field public static final int STATUS_CODE_FAIL_RTT_NOT_AVAILABLE = 2; // 0x2
  }

  public class WifiRttManager {
    method public boolean isAvailable();
    method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.CHANGE_WIFI_STATE, android.Manifest.permission.ACCESS_WIFI_STATE}) public void startRanging(@NonNull android.net.wifi.rtt.RangingRequest, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.rtt.RangingResultCallback);
    field public static final String ACTION_WIFI_RTT_STATE_CHANGED = "android.net.wifi.rtt.action.WIFI_RTT_STATE_CHANGED";
  }

}

package android.nfc {

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

  public final class NdefMessage implements android.os.Parcelable {
    ctor public NdefMessage(byte[]) throws android.nfc.FormatException;
    ctor public NdefMessage(android.nfc.NdefRecord, android.nfc.NdefRecord...);
    ctor public NdefMessage(android.nfc.NdefRecord[]);
    method public int describeContents();
    method public int getByteArrayLength();
    method public android.nfc.NdefRecord[] getRecords();
    method public byte[] toByteArray();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.nfc.NdefMessage> CREATOR;
  }

  public final class NdefRecord implements android.os.Parcelable {
    ctor public NdefRecord(short, byte[], byte[], byte[]);
    ctor @Deprecated public NdefRecord(byte[]) throws android.nfc.FormatException;
    method public static android.nfc.NdefRecord createApplicationRecord(String);
    method public static android.nfc.NdefRecord createExternal(String, String, byte[]);
    method public static android.nfc.NdefRecord createMime(String, byte[]);
    method public static android.nfc.NdefRecord createTextRecord(String, String);
    method public static android.nfc.NdefRecord createUri(android.net.Uri);
    method public static android.nfc.NdefRecord createUri(String);
    method public int describeContents();
    method public byte[] getId();
    method public byte[] getPayload();
    method public short getTnf();
    method public byte[] getType();
    method @Deprecated public byte[] toByteArray();
    method public String toMimeType();
    method public android.net.Uri toUri();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.nfc.NdefRecord> CREATOR;
    field public static final byte[] RTD_ALTERNATIVE_CARRIER;
    field public static final byte[] RTD_HANDOVER_CARRIER;
    field public static final byte[] RTD_HANDOVER_REQUEST;
    field public static final byte[] RTD_HANDOVER_SELECT;
    field public static final byte[] RTD_SMART_POSTER;
    field public static final byte[] RTD_TEXT;
    field public static final byte[] RTD_URI;
    field public static final short TNF_ABSOLUTE_URI = 3; // 0x3
    field public static final short TNF_EMPTY = 0; // 0x0
    field public static final short TNF_EXTERNAL_TYPE = 4; // 0x4
    field public static final short TNF_MIME_MEDIA = 2; // 0x2
    field public static final short TNF_UNCHANGED = 6; // 0x6
    field public static final short TNF_UNKNOWN = 5; // 0x5
    field public static final short TNF_WELL_KNOWN = 1; // 0x1
  }

  public final class NfcAdapter {
    method public boolean deviceSupportsNfcSecure();
    method public void disableForegroundDispatch(android.app.Activity);
    method @Deprecated public void disableForegroundNdefPush(android.app.Activity);
    method public void disableReaderMode(android.app.Activity);
    method public void enableForegroundDispatch(android.app.Activity, android.app.PendingIntent, android.content.IntentFilter[], String[][]);
    method @Deprecated public void enableForegroundNdefPush(android.app.Activity, android.nfc.NdefMessage);
    method public void enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle);
    method public static android.nfc.NfcAdapter getDefaultAdapter(android.content.Context);
    method @NonNull public java.util.List<java.lang.String> getSupportedOffHostSecureElements();
    method public boolean ignore(android.nfc.Tag, int, android.nfc.NfcAdapter.OnTagRemovedListener, android.os.Handler);
    method @Deprecated public boolean invokeBeam(android.app.Activity);
    method public boolean isEnabled();
    method @Deprecated public boolean isNdefPushEnabled();
    method public boolean isNfcSecureEnabled();
    method @Deprecated public void setBeamPushUris(android.net.Uri[], android.app.Activity);
    method @Deprecated public void setBeamPushUrisCallback(android.nfc.NfcAdapter.CreateBeamUrisCallback, android.app.Activity);
    method @Deprecated public void setNdefPushMessage(android.nfc.NdefMessage, android.app.Activity, android.app.Activity...);
    method @Deprecated public void setNdefPushMessageCallback(android.nfc.NfcAdapter.CreateNdefMessageCallback, android.app.Activity, android.app.Activity...);
    method @Deprecated public void setOnNdefPushCompleteCallback(android.nfc.NfcAdapter.OnNdefPushCompleteCallback, android.app.Activity, android.app.Activity...);
    field public static final String ACTION_ADAPTER_STATE_CHANGED = "android.nfc.action.ADAPTER_STATE_CHANGED";
    field public static final String ACTION_NDEF_DISCOVERED = "android.nfc.action.NDEF_DISCOVERED";
    field public static final String ACTION_TAG_DISCOVERED = "android.nfc.action.TAG_DISCOVERED";
    field public static final String ACTION_TECH_DISCOVERED = "android.nfc.action.TECH_DISCOVERED";
    field @RequiresPermission(android.Manifest.permission.NFC_TRANSACTION_EVENT) public static final String ACTION_TRANSACTION_DETECTED = "android.nfc.action.TRANSACTION_DETECTED";
    field public static final String EXTRA_ADAPTER_STATE = "android.nfc.extra.ADAPTER_STATE";
    field public static final String EXTRA_AID = "android.nfc.extra.AID";
    field public static final String EXTRA_DATA = "android.nfc.extra.DATA";
    field public static final String EXTRA_ID = "android.nfc.extra.ID";
    field public static final String EXTRA_NDEF_MESSAGES = "android.nfc.extra.NDEF_MESSAGES";
    field public static final String EXTRA_READER_PRESENCE_CHECK_DELAY = "presence";
    field public static final String EXTRA_SECURE_ELEMENT_NAME = "android.nfc.extra.SECURE_ELEMENT_NAME";
    field public static final String EXTRA_TAG = "android.nfc.extra.TAG";
    field public static final int FLAG_READER_NFC_A = 1; // 0x1
    field public static final int FLAG_READER_NFC_B = 2; // 0x2
    field public static final int FLAG_READER_NFC_BARCODE = 16; // 0x10
    field public static final int FLAG_READER_NFC_F = 4; // 0x4
    field public static final int FLAG_READER_NFC_V = 8; // 0x8
    field public static final int FLAG_READER_NO_PLATFORM_SOUNDS = 256; // 0x100
    field public static final int FLAG_READER_SKIP_NDEF_CHECK = 128; // 0x80
    field public static final int STATE_OFF = 1; // 0x1
    field public static final int STATE_ON = 3; // 0x3
    field public static final int STATE_TURNING_OFF = 4; // 0x4
    field public static final int STATE_TURNING_ON = 2; // 0x2
  }

  @Deprecated public static interface NfcAdapter.CreateBeamUrisCallback {
    method @Deprecated public android.net.Uri[] createBeamUris(android.nfc.NfcEvent);
  }

  @Deprecated public static interface NfcAdapter.CreateNdefMessageCallback {
    method @Deprecated public android.nfc.NdefMessage createNdefMessage(android.nfc.NfcEvent);
  }

  @Deprecated public static interface NfcAdapter.OnNdefPushCompleteCallback {
    method @Deprecated public void onNdefPushComplete(android.nfc.NfcEvent);
  }

  public static interface NfcAdapter.OnTagRemovedListener {
    method public void onTagRemoved();
  }

  public static interface NfcAdapter.ReaderCallback {
    method public void onTagDiscovered(android.nfc.Tag);
  }

  public final class NfcEvent {
    field public final android.nfc.NfcAdapter nfcAdapter;
    field public final int peerLlcpMajorVersion;
    field public final int peerLlcpMinorVersion;
  }

  public final class NfcManager {
    method public android.nfc.NfcAdapter getDefaultAdapter();
  }

  public final class Tag implements android.os.Parcelable {
    method public int describeContents();
    method public byte[] getId();
    method public String[] getTechList();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.nfc.Tag> CREATOR;
  }

  public class TagLostException extends java.io.IOException {
    ctor public TagLostException();
    ctor public TagLostException(String);
  }

}

package android.nfc.cardemulation {

  public final class CardEmulation {
    method public boolean categoryAllowsForegroundPreference(String);
    method public java.util.List<java.lang.String> getAidsForService(android.content.ComponentName, String);
    method public static android.nfc.cardemulation.CardEmulation getInstance(android.nfc.NfcAdapter);
    method public int getSelectionModeForCategory(String);
    method public boolean isDefaultServiceForAid(android.content.ComponentName, String);
    method public boolean isDefaultServiceForCategory(android.content.ComponentName, String);
    method public boolean registerAidsForService(android.content.ComponentName, String, java.util.List<java.lang.String>);
    method public boolean removeAidsForService(android.content.ComponentName, String);
    method public boolean setOffHostForService(android.content.ComponentName, String);
    method public boolean setPreferredService(android.app.Activity, android.content.ComponentName);
    method public boolean supportsAidPrefixRegistration();
    method public boolean unsetOffHostForService(android.content.ComponentName);
    method public boolean unsetPreferredService(android.app.Activity);
    field public static final String ACTION_CHANGE_DEFAULT = "android.nfc.cardemulation.action.ACTION_CHANGE_DEFAULT";
    field public static final String CATEGORY_OTHER = "other";
    field public static final String CATEGORY_PAYMENT = "payment";
    field public static final String EXTRA_CATEGORY = "category";
    field public static final String EXTRA_SERVICE_COMPONENT = "component";
    field public static final int SELECTION_MODE_ALWAYS_ASK = 1; // 0x1
    field public static final int SELECTION_MODE_ASK_IF_CONFLICT = 2; // 0x2
    field public static final int SELECTION_MODE_PREFER_DEFAULT = 0; // 0x0
  }

  public abstract class HostApduService extends android.app.Service {
    ctor public HostApduService();
    method public final void notifyUnhandled();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract void onDeactivated(int);
    method public abstract byte[] processCommandApdu(byte[], android.os.Bundle);
    method public final void sendResponseApdu(byte[]);
    field public static final int DEACTIVATION_DESELECTED = 1; // 0x1
    field public static final int DEACTIVATION_LINK_LOSS = 0; // 0x0
    field public static final String SERVICE_INTERFACE = "android.nfc.cardemulation.action.HOST_APDU_SERVICE";
    field public static final String SERVICE_META_DATA = "android.nfc.cardemulation.host_apdu_service";
  }

  public abstract class HostNfcFService extends android.app.Service {
    ctor public HostNfcFService();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract void onDeactivated(int);
    method public abstract byte[] processNfcFPacket(byte[], android.os.Bundle);
    method public final void sendResponsePacket(byte[]);
    field public static final int DEACTIVATION_LINK_LOSS = 0; // 0x0
    field public static final String SERVICE_INTERFACE = "android.nfc.cardemulation.action.HOST_NFCF_SERVICE";
    field public static final String SERVICE_META_DATA = "android.nfc.cardemulation.host_nfcf_service";
  }

  public final class NfcFCardEmulation {
    method public boolean disableService(android.app.Activity) throws java.lang.RuntimeException;
    method public boolean enableService(android.app.Activity, android.content.ComponentName) throws java.lang.RuntimeException;
    method public static android.nfc.cardemulation.NfcFCardEmulation getInstance(android.nfc.NfcAdapter);
    method public String getNfcid2ForService(android.content.ComponentName) throws java.lang.RuntimeException;
    method public String getSystemCodeForService(android.content.ComponentName) throws java.lang.RuntimeException;
    method public boolean registerSystemCodeForService(android.content.ComponentName, String) throws java.lang.RuntimeException;
    method public boolean setNfcid2ForService(android.content.ComponentName, String) throws java.lang.RuntimeException;
    method public boolean unregisterSystemCodeForService(android.content.ComponentName) throws java.lang.RuntimeException;
  }

  public abstract class OffHostApduService extends android.app.Service {
    ctor public OffHostApduService();
    field public static final String SERVICE_INTERFACE = "android.nfc.cardemulation.action.OFF_HOST_APDU_SERVICE";
    field public static final String SERVICE_META_DATA = "android.nfc.cardemulation.off_host_apdu_service";
  }

}

package android.nfc.tech {

  public final class IsoDep implements android.nfc.tech.TagTechnology {
    method public void close() throws java.io.IOException;
    method public void connect() throws java.io.IOException;
    method public static android.nfc.tech.IsoDep get(android.nfc.Tag);
    method public byte[] getHiLayerResponse();
    method public byte[] getHistoricalBytes();
    method public int getMaxTransceiveLength();
    method public android.nfc.Tag getTag();
    method public int getTimeout();
    method public boolean isConnected();
    method public boolean isExtendedLengthApduSupported();
    method public void setTimeout(int);
    method public byte[] transceive(byte[]) throws java.io.IOException;
  }

  public final class MifareClassic implements android.nfc.tech.TagTechnology {
    method public boolean authenticateSectorWithKeyA(int, byte[]) throws java.io.IOException;
    method public boolean authenticateSectorWithKeyB(int, byte[]) throws java.io.IOException;
    method public int blockToSector(int);
    method public void close() throws java.io.IOException;
    method public void connect() throws java.io.IOException;
    method public void decrement(int, int) throws java.io.IOException;
    method public static android.nfc.tech.MifareClassic get(android.nfc.Tag);
    method public int getBlockCount();
    method public int getBlockCountInSector(int);
    method public int getMaxTransceiveLength();
    method public int getSectorCount();
    method public int getSize();
    method public android.nfc.Tag getTag();
    method public int getTimeout();
    method public int getType();
    method public void increment(int, int) throws java.io.IOException;
    method public boolean isConnected();
    method public byte[] readBlock(int) throws java.io.IOException;
    method public void restore(int) throws java.io.IOException;
    method public int sectorToBlock(int);
    method public void setTimeout(int);
    method public byte[] transceive(byte[]) throws java.io.IOException;
    method public void transfer(int) throws java.io.IOException;
    method public void writeBlock(int, byte[]) throws java.io.IOException;
    field public static final int BLOCK_SIZE = 16; // 0x10
    field public static final byte[] KEY_DEFAULT;
    field public static final byte[] KEY_MIFARE_APPLICATION_DIRECTORY;
    field public static final byte[] KEY_NFC_FORUM;
    field public static final int SIZE_1K = 1024; // 0x400
    field public static final int SIZE_2K = 2048; // 0x800
    field public static final int SIZE_4K = 4096; // 0x1000
    field public static final int SIZE_MINI = 320; // 0x140
    field public static final int TYPE_CLASSIC = 0; // 0x0
    field public static final int TYPE_PLUS = 1; // 0x1
    field public static final int TYPE_PRO = 2; // 0x2
    field public static final int TYPE_UNKNOWN = -1; // 0xffffffff
  }

  public final class MifareUltralight implements android.nfc.tech.TagTechnology {
    method public void close() throws java.io.IOException;
    method public void connect() throws java.io.IOException;
    method public static android.nfc.tech.MifareUltralight get(android.nfc.Tag);
    method public int getMaxTransceiveLength();
    method public android.nfc.Tag getTag();
    method public int getTimeout();
    method public int getType();
    method public boolean isConnected();
    method public byte[] readPages(int) throws java.io.IOException;
    method public void setTimeout(int);
    method public byte[] transceive(byte[]) throws java.io.IOException;
    method public void writePage(int, byte[]) throws java.io.IOException;
    field public static final int PAGE_SIZE = 4; // 0x4
    field public static final int TYPE_ULTRALIGHT = 1; // 0x1
    field public static final int TYPE_ULTRALIGHT_C = 2; // 0x2
    field public static final int TYPE_UNKNOWN = -1; // 0xffffffff
  }

  public final class Ndef implements android.nfc.tech.TagTechnology {
    method public boolean canMakeReadOnly();
    method public void close() throws java.io.IOException;
    method public void connect() throws java.io.IOException;
    method public static android.nfc.tech.Ndef get(android.nfc.Tag);
    method public android.nfc.NdefMessage getCachedNdefMessage();
    method public int getMaxSize();
    method public android.nfc.NdefMessage getNdefMessage() throws android.nfc.FormatException, java.io.IOException;
    method public android.nfc.Tag getTag();
    method public String getType();
    method public boolean isConnected();
    method public boolean isWritable();
    method public boolean makeReadOnly() throws java.io.IOException;
    method public void writeNdefMessage(android.nfc.NdefMessage) throws android.nfc.FormatException, java.io.IOException;
    field public static final String MIFARE_CLASSIC = "com.nxp.ndef.mifareclassic";
    field public static final String NFC_FORUM_TYPE_1 = "org.nfcforum.ndef.type1";
    field public static final String NFC_FORUM_TYPE_2 = "org.nfcforum.ndef.type2";
    field public static final String NFC_FORUM_TYPE_3 = "org.nfcforum.ndef.type3";
    field public static final String NFC_FORUM_TYPE_4 = "org.nfcforum.ndef.type4";
  }

  public final class NdefFormatable implements android.nfc.tech.TagTechnology {
    method public void close() throws java.io.IOException;
    method public void connect() throws java.io.IOException;
    method public void format(android.nfc.NdefMessage) throws android.nfc.FormatException, java.io.IOException;
    method public void formatReadOnly(android.nfc.NdefMessage) throws android.nfc.FormatException, java.io.IOException;
    method public static android.nfc.tech.NdefFormatable get(android.nfc.Tag);
    method public android.nfc.Tag getTag();
    method public boolean isConnected();
  }

  public final class NfcA implements android.nfc.tech.TagTechnology {
    method public void close() throws java.io.IOException;
    method public void connect() throws java.io.IOException;
    method public static android.nfc.tech.NfcA get(android.nfc.Tag);
    method public byte[] getAtqa();
    method public int getMaxTransceiveLength();
    method public short getSak();
    method public android.nfc.Tag getTag();
    method public int getTimeout();
    method public boolean isConnected();
    method public void setTimeout(int);
    method public byte[] transceive(byte[]) throws java.io.IOException;
  }

  public final class NfcB implements android.nfc.tech.TagTechnology {
    method public void close() throws java.io.IOException;
    method public void connect() throws java.io.IOException;
    method public static android.nfc.tech.NfcB get(android.nfc.Tag);
    method public byte[] getApplicationData();
    method public int getMaxTransceiveLength();
    method public byte[] getProtocolInfo();
    method public android.nfc.Tag getTag();
    method public boolean isConnected();
    method public byte[] transceive(byte[]) throws java.io.IOException;
  }

  public final class NfcBarcode implements android.nfc.tech.TagTechnology {
    method public void close() throws java.io.IOException;
    method public void connect() throws java.io.IOException;
    method public static android.nfc.tech.NfcBarcode get(android.nfc.Tag);
    method public byte[] getBarcode();
    method public android.nfc.Tag getTag();
    method public int getType();
    method public boolean isConnected();
    field public static final int TYPE_KOVIO = 1; // 0x1
    field public static final int TYPE_UNKNOWN = -1; // 0xffffffff
  }

  public final class NfcF implements android.nfc.tech.TagTechnology {
    method public void close() throws java.io.IOException;
    method public void connect() throws java.io.IOException;
    method public static android.nfc.tech.NfcF get(android.nfc.Tag);
    method public byte[] getManufacturer();
    method public int getMaxTransceiveLength();
    method public byte[] getSystemCode();
    method public android.nfc.Tag getTag();
    method public int getTimeout();
    method public boolean isConnected();
    method public void setTimeout(int);
    method public byte[] transceive(byte[]) throws java.io.IOException;
  }

  public final class NfcV implements android.nfc.tech.TagTechnology {
    method public void close() throws java.io.IOException;
    method public void connect() throws java.io.IOException;
    method public static android.nfc.tech.NfcV get(android.nfc.Tag);
    method public byte getDsfId();
    method public int getMaxTransceiveLength();
    method public byte getResponseFlags();
    method public android.nfc.Tag getTag();
    method public boolean isConnected();
    method public byte[] transceive(byte[]) throws java.io.IOException;
  }

  public interface TagTechnology extends java.io.Closeable {
    method public void connect() throws java.io.IOException;
    method public android.nfc.Tag getTag();
    method public boolean isConnected();
  }

}

package android.opengl {

  public class EGL14 {
    ctor public EGL14();
    method public static boolean eglBindAPI(int);
    method public static boolean eglBindTexImage(android.opengl.EGLDisplay, android.opengl.EGLSurface, int);
    method public static boolean eglChooseConfig(android.opengl.EGLDisplay, int[], int, android.opengl.EGLConfig[], int, int, int[], int);
    method public static boolean eglCopyBuffers(android.opengl.EGLDisplay, android.opengl.EGLSurface, int);
    method public static android.opengl.EGLContext eglCreateContext(android.opengl.EGLDisplay, android.opengl.EGLConfig, android.opengl.EGLContext, int[], int);
    method public static android.opengl.EGLSurface eglCreatePbufferFromClientBuffer(android.opengl.EGLDisplay, int, int, android.opengl.EGLConfig, int[], int);
    method public static android.opengl.EGLSurface eglCreatePbufferSurface(android.opengl.EGLDisplay, android.opengl.EGLConfig, int[], int);
    method @Deprecated public static android.opengl.EGLSurface eglCreatePixmapSurface(android.opengl.EGLDisplay, android.opengl.EGLConfig, int, int[], int);
    method public static android.opengl.EGLSurface eglCreateWindowSurface(android.opengl.EGLDisplay, android.opengl.EGLConfig, Object, int[], int);
    method public static boolean eglDestroyContext(android.opengl.EGLDisplay, android.opengl.EGLContext);
    method public static boolean eglDestroySurface(android.opengl.EGLDisplay, android.opengl.EGLSurface);
    method public static boolean eglGetConfigAttrib(android.opengl.EGLDisplay, android.opengl.EGLConfig, int, int[], int);
    method public static boolean eglGetConfigs(android.opengl.EGLDisplay, android.opengl.EGLConfig[], int, int, int[], int);
    method public static android.opengl.EGLContext eglGetCurrentContext();
    method public static android.opengl.EGLDisplay eglGetCurrentDisplay();
    method public static android.opengl.EGLSurface eglGetCurrentSurface(int);
    method public static android.opengl.EGLDisplay eglGetDisplay(int);
    method public static int eglGetError();
    method public static boolean eglInitialize(android.opengl.EGLDisplay, int[], int, int[], int);
    method public static boolean eglMakeCurrent(android.opengl.EGLDisplay, android.opengl.EGLSurface, android.opengl.EGLSurface, android.opengl.EGLContext);
    method public static int eglQueryAPI();
    method public static boolean eglQueryContext(android.opengl.EGLDisplay, android.opengl.EGLContext, int, int[], int);
    method public static String eglQueryString(android.opengl.EGLDisplay, int);
    method public static boolean eglQuerySurface(android.opengl.EGLDisplay, android.opengl.EGLSurface, int, int[], int);
    method public static boolean eglReleaseTexImage(android.opengl.EGLDisplay, android.opengl.EGLSurface, int);
    method public static boolean eglReleaseThread();
    method public static boolean eglSurfaceAttrib(android.opengl.EGLDisplay, android.opengl.EGLSurface, int, int);
    method public static boolean eglSwapBuffers(android.opengl.EGLDisplay, android.opengl.EGLSurface);
    method public static boolean eglSwapInterval(android.opengl.EGLDisplay, int);
    method public static boolean eglTerminate(android.opengl.EGLDisplay);
    method public static boolean eglWaitClient();
    method public static boolean eglWaitGL();
    method public static boolean eglWaitNative(int);
    field public static final int EGL_ALPHA_MASK_SIZE = 12350; // 0x303e
    field public static final int EGL_ALPHA_SIZE = 12321; // 0x3021
    field public static final int EGL_BACK_BUFFER = 12420; // 0x3084
    field public static final int EGL_BAD_ACCESS = 12290; // 0x3002
    field public static final int EGL_BAD_ALLOC = 12291; // 0x3003
    field public static final int EGL_BAD_ATTRIBUTE = 12292; // 0x3004
    field public static final int EGL_BAD_CONFIG = 12293; // 0x3005
    field public static final int EGL_BAD_CONTEXT = 12294; // 0x3006
    field public static final int EGL_BAD_CURRENT_SURFACE = 12295; // 0x3007
    field public static final int EGL_BAD_DISPLAY = 12296; // 0x3008
    field public static final int EGL_BAD_MATCH = 12297; // 0x3009
    field public static final int EGL_BAD_NATIVE_PIXMAP = 12298; // 0x300a
    field public static final int EGL_BAD_NATIVE_WINDOW = 12299; // 0x300b
    field public static final int EGL_BAD_PARAMETER = 12300; // 0x300c
    field public static final int EGL_BAD_SURFACE = 12301; // 0x300d
    field public static final int EGL_BIND_TO_TEXTURE_RGB = 12345; // 0x3039
    field public static final int EGL_BIND_TO_TEXTURE_RGBA = 12346; // 0x303a
    field public static final int EGL_BLUE_SIZE = 12322; // 0x3022
    field public static final int EGL_BUFFER_DESTROYED = 12437; // 0x3095
    field public static final int EGL_BUFFER_PRESERVED = 12436; // 0x3094
    field public static final int EGL_BUFFER_SIZE = 12320; // 0x3020
    field public static final int EGL_CLIENT_APIS = 12429; // 0x308d
    field public static final int EGL_COLOR_BUFFER_TYPE = 12351; // 0x303f
    field public static final int EGL_CONFIG_CAVEAT = 12327; // 0x3027
    field public static final int EGL_CONFIG_ID = 12328; // 0x3028
    field public static final int EGL_CONFORMANT = 12354; // 0x3042
    field public static final int EGL_CONTEXT_CLIENT_TYPE = 12439; // 0x3097
    field public static final int EGL_CONTEXT_CLIENT_VERSION = 12440; // 0x3098
    field public static final int EGL_CONTEXT_LOST = 12302; // 0x300e
    field public static final int EGL_CORE_NATIVE_ENGINE = 12379; // 0x305b
    field public static final int EGL_DEFAULT_DISPLAY = 0; // 0x0
    field public static final int EGL_DEPTH_SIZE = 12325; // 0x3025
    field public static final int EGL_DISPLAY_SCALING = 10000; // 0x2710
    field public static final int EGL_DRAW = 12377; // 0x3059
    field public static final int EGL_EXTENSIONS = 12373; // 0x3055
    field public static final int EGL_FALSE = 0; // 0x0
    field public static final int EGL_GREEN_SIZE = 12323; // 0x3023
    field public static final int EGL_HEIGHT = 12374; // 0x3056
    field public static final int EGL_HORIZONTAL_RESOLUTION = 12432; // 0x3090
    field public static final int EGL_LARGEST_PBUFFER = 12376; // 0x3058
    field public static final int EGL_LEVEL = 12329; // 0x3029
    field public static final int EGL_LUMINANCE_BUFFER = 12431; // 0x308f
    field public static final int EGL_LUMINANCE_SIZE = 12349; // 0x303d
    field public static final int EGL_MATCH_NATIVE_PIXMAP = 12353; // 0x3041
    field public static final int EGL_MAX_PBUFFER_HEIGHT = 12330; // 0x302a
    field public static final int EGL_MAX_PBUFFER_PIXELS = 12331; // 0x302b
    field public static final int EGL_MAX_PBUFFER_WIDTH = 12332; // 0x302c
    field public static final int EGL_MAX_SWAP_INTERVAL = 12348; // 0x303c
    field public static final int EGL_MIN_SWAP_INTERVAL = 12347; // 0x303b
    field public static final int EGL_MIPMAP_LEVEL = 12419; // 0x3083
    field public static final int EGL_MIPMAP_TEXTURE = 12418; // 0x3082
    field public static final int EGL_MULTISAMPLE_RESOLVE = 12441; // 0x3099
    field public static final int EGL_MULTISAMPLE_RESOLVE_BOX = 12443; // 0x309b
    field public static final int EGL_MULTISAMPLE_RESOLVE_BOX_BIT = 512; // 0x200
    field public static final int EGL_MULTISAMPLE_RESOLVE_DEFAULT = 12442; // 0x309a
    field public static final int EGL_NATIVE_RENDERABLE = 12333; // 0x302d
    field public static final int EGL_NATIVE_VISUAL_ID = 12334; // 0x302e
    field public static final int EGL_NATIVE_VISUAL_TYPE = 12335; // 0x302f
    field public static final int EGL_NONE = 12344; // 0x3038
    field public static final int EGL_NON_CONFORMANT_CONFIG = 12369; // 0x3051
    field public static final int EGL_NOT_INITIALIZED = 12289; // 0x3001
    field public static android.opengl.EGLContext EGL_NO_CONTEXT;
    field public static android.opengl.EGLDisplay EGL_NO_DISPLAY;
    field public static android.opengl.EGLSurface EGL_NO_SURFACE;
    field public static final int EGL_NO_TEXTURE = 12380; // 0x305c
    field public static final int EGL_OPENGL_API = 12450; // 0x30a2
    field public static final int EGL_OPENGL_BIT = 8; // 0x8
    field public static final int EGL_OPENGL_ES2_BIT = 4; // 0x4
    field public static final int EGL_OPENGL_ES_API = 12448; // 0x30a0
    field public static final int EGL_OPENGL_ES_BIT = 1; // 0x1
    field public static final int EGL_OPENVG_API = 12449; // 0x30a1
    field public static final int EGL_OPENVG_BIT = 2; // 0x2
    field public static final int EGL_OPENVG_IMAGE = 12438; // 0x3096
    field public static final int EGL_PBUFFER_BIT = 1; // 0x1
    field public static final int EGL_PIXEL_ASPECT_RATIO = 12434; // 0x3092
    field public static final int EGL_PIXMAP_BIT = 2; // 0x2
    field public static final int EGL_READ = 12378; // 0x305a
    field public static final int EGL_RED_SIZE = 12324; // 0x3024
    field public static final int EGL_RENDERABLE_TYPE = 12352; // 0x3040
    field public static final int EGL_RENDER_BUFFER = 12422; // 0x3086
    field public static final int EGL_RGB_BUFFER = 12430; // 0x308e
    field public static final int EGL_SAMPLES = 12337; // 0x3031
    field public static final int EGL_SAMPLE_BUFFERS = 12338; // 0x3032
    field public static final int EGL_SINGLE_BUFFER = 12421; // 0x3085
    field public static final int EGL_SLOW_CONFIG = 12368; // 0x3050
    field public static final int EGL_STENCIL_SIZE = 12326; // 0x3026
    field public static final int EGL_SUCCESS = 12288; // 0x3000
    field public static final int EGL_SURFACE_TYPE = 12339; // 0x3033
    field public static final int EGL_SWAP_BEHAVIOR = 12435; // 0x3093
    field public static final int EGL_SWAP_BEHAVIOR_PRESERVED_BIT = 1024; // 0x400
    field public static final int EGL_TEXTURE_2D = 12383; // 0x305f
    field public static final int EGL_TEXTURE_FORMAT = 12416; // 0x3080
    field public static final int EGL_TEXTURE_RGB = 12381; // 0x305d
    field public static final int EGL_TEXTURE_RGBA = 12382; // 0x305e
    field public static final int EGL_TEXTURE_TARGET = 12417; // 0x3081
    field public static final int EGL_TRANSPARENT_BLUE_VALUE = 12341; // 0x3035
    field public static final int EGL_TRANSPARENT_GREEN_VALUE = 12342; // 0x3036
    field public static final int EGL_TRANSPARENT_RED_VALUE = 12343; // 0x3037
    field public static final int EGL_TRANSPARENT_RGB = 12370; // 0x3052
    field public static final int EGL_TRANSPARENT_TYPE = 12340; // 0x3034
    field public static final int EGL_TRUE = 1; // 0x1
    field public static final int EGL_VENDOR = 12371; // 0x3053
    field public static final int EGL_VERSION = 12372; // 0x3054
    field public static final int EGL_VERTICAL_RESOLUTION = 12433; // 0x3091
    field public static final int EGL_VG_ALPHA_FORMAT = 12424; // 0x3088
    field public static final int EGL_VG_ALPHA_FORMAT_NONPRE = 12427; // 0x308b
    field public static final int EGL_VG_ALPHA_FORMAT_PRE = 12428; // 0x308c
    field public static final int EGL_VG_ALPHA_FORMAT_PRE_BIT = 64; // 0x40
    field public static final int EGL_VG_COLORSPACE = 12423; // 0x3087
    field public static final int EGL_VG_COLORSPACE_LINEAR = 12426; // 0x308a
    field public static final int EGL_VG_COLORSPACE_LINEAR_BIT = 32; // 0x20
    field public static final int EGL_VG_COLORSPACE_sRGB = 12425; // 0x3089
    field public static final int EGL_WIDTH = 12375; // 0x3057
    field public static final int EGL_WINDOW_BIT = 4; // 0x4
  }

  public class EGLConfig extends android.opengl.EGLObjectHandle {
  }

  public class EGLContext extends android.opengl.EGLObjectHandle {
  }

  public class EGLDisplay extends android.opengl.EGLObjectHandle {
  }

  public class EGLExt {
    ctor public EGLExt();
    method public static boolean eglPresentationTimeANDROID(android.opengl.EGLDisplay, android.opengl.EGLSurface, long);
    field public static final int EGL_CONTEXT_FLAGS_KHR = 12540; // 0x30fc
    field public static final int EGL_CONTEXT_MAJOR_VERSION_KHR = 12440; // 0x3098
    field public static final int EGL_CONTEXT_MINOR_VERSION_KHR = 12539; // 0x30fb
    field public static final int EGL_OPENGL_ES3_BIT_KHR = 64; // 0x40
    field public static final int EGL_RECORDABLE_ANDROID = 12610; // 0x3142
  }

  public abstract class EGLObjectHandle {
    ctor @Deprecated protected EGLObjectHandle(int);
    ctor protected EGLObjectHandle(long);
    method @Deprecated public int getHandle();
    method public long getNativeHandle();
  }

  public class EGLSurface extends android.opengl.EGLObjectHandle {
  }

  public class ETC1 {
    ctor public ETC1();
    method public static void decodeBlock(java.nio.Buffer, java.nio.Buffer);
    method public static void decodeImage(java.nio.Buffer, java.nio.Buffer, int, int, int, int);
    method public static void encodeBlock(java.nio.Buffer, int, java.nio.Buffer);
    method public static void encodeImage(java.nio.Buffer, int, int, int, int, java.nio.Buffer);
    method public static void formatHeader(java.nio.Buffer, int, int);
    method public static int getEncodedDataSize(int, int);
    method public static int getHeight(java.nio.Buffer);
    method public static int getWidth(java.nio.Buffer);
    method public static boolean isValid(java.nio.Buffer);
    field public static final int DECODED_BLOCK_SIZE = 48; // 0x30
    field public static final int ENCODED_BLOCK_SIZE = 8; // 0x8
    field public static final int ETC1_RGB8_OES = 36196; // 0x8d64
    field public static final int ETC_PKM_HEADER_SIZE = 16; // 0x10
  }

  public class ETC1Util {
    ctor public ETC1Util();
    method public static android.opengl.ETC1Util.ETC1Texture compressTexture(java.nio.Buffer, int, int, int, int);
    method public static android.opengl.ETC1Util.ETC1Texture createTexture(java.io.InputStream) throws java.io.IOException;
    method public static boolean isETC1Supported();
    method public static void loadTexture(int, int, int, int, int, java.io.InputStream) throws java.io.IOException;
    method public static void loadTexture(int, int, int, int, int, android.opengl.ETC1Util.ETC1Texture);
    method public static void writeTexture(android.opengl.ETC1Util.ETC1Texture, java.io.OutputStream) throws java.io.IOException;
  }

  public static class ETC1Util.ETC1Texture {
    ctor public ETC1Util.ETC1Texture(int, int, java.nio.ByteBuffer);
    method public java.nio.ByteBuffer getData();
    method public int getHeight();
    method public int getWidth();
  }

  public class GLDebugHelper {
    ctor public GLDebugHelper();
    method public static javax.microedition.khronos.opengles.GL wrap(javax.microedition.khronos.opengles.GL, int, java.io.Writer);
    method public static javax.microedition.khronos.egl.EGL wrap(javax.microedition.khronos.egl.EGL, int, java.io.Writer);
    field public static final int CONFIG_CHECK_GL_ERROR = 1; // 0x1
    field public static final int CONFIG_CHECK_THREAD = 2; // 0x2
    field public static final int CONFIG_LOG_ARGUMENT_NAMES = 4; // 0x4
    field public static final int ERROR_WRONG_THREAD = 28672; // 0x7000
  }

  public class GLES10 {
    ctor public GLES10();
    method public static void glActiveTexture(int);
    method public static void glAlphaFunc(int, float);
    method public static void glAlphaFuncx(int, int);
    method public static void glBindTexture(int, int);
    method public static void glBlendFunc(int, int);
    method public static void glClear(int);
    method public static void glClearColor(float, float, float, float);
    method public static void glClearColorx(int, int, int, int);
    method public static void glClearDepthf(float);
    method public static void glClearDepthx(int);
    method public static void glClearStencil(int);
    method public static void glClientActiveTexture(int);
    method public static void glColor4f(float, float, float, float);
    method public static void glColor4x(int, int, int, int);
    method public static void glColorMask(boolean, boolean, boolean, boolean);
    method public static void glColorPointer(int, int, int, java.nio.Buffer);
    method public static void glCompressedTexImage2D(int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glCompressedTexSubImage2D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glCopyTexImage2D(int, int, int, int, int, int, int, int);
    method public static void glCopyTexSubImage2D(int, int, int, int, int, int, int, int);
    method public static void glCullFace(int);
    method public static void glDeleteTextures(int, int[], int);
    method public static void glDeleteTextures(int, java.nio.IntBuffer);
    method public static void glDepthFunc(int);
    method public static void glDepthMask(boolean);
    method public static void glDepthRangef(float, float);
    method public static void glDepthRangex(int, int);
    method public static void glDisable(int);
    method public static void glDisableClientState(int);
    method public static void glDrawArrays(int, int, int);
    method public static void glDrawElements(int, int, int, java.nio.Buffer);
    method public static void glEnable(int);
    method public static void glEnableClientState(int);
    method public static void glFinish();
    method public static void glFlush();
    method public static void glFogf(int, float);
    method public static void glFogfv(int, float[], int);
    method public static void glFogfv(int, java.nio.FloatBuffer);
    method public static void glFogx(int, int);
    method public static void glFogxv(int, int[], int);
    method public static void glFogxv(int, java.nio.IntBuffer);
    method public static void glFrontFace(int);
    method public static void glFrustumf(float, float, float, float, float, float);
    method public static void glFrustumx(int, int, int, int, int, int);
    method public static void glGenTextures(int, int[], int);
    method public static void glGenTextures(int, java.nio.IntBuffer);
    method public static int glGetError();
    method public static void glGetIntegerv(int, int[], int);
    method public static void glGetIntegerv(int, java.nio.IntBuffer);
    method public static String glGetString(int);
    method public static void glHint(int, int);
    method public static void glLightModelf(int, float);
    method public static void glLightModelfv(int, float[], int);
    method public static void glLightModelfv(int, java.nio.FloatBuffer);
    method public static void glLightModelx(int, int);
    method public static void glLightModelxv(int, int[], int);
    method public static void glLightModelxv(int, java.nio.IntBuffer);
    method public static void glLightf(int, int, float);
    method public static void glLightfv(int, int, float[], int);
    method public static void glLightfv(int, int, java.nio.FloatBuffer);
    method public static void glLightx(int, int, int);
    method public static void glLightxv(int, int, int[], int);
    method public static void glLightxv(int, int, java.nio.IntBuffer);
    method public static void glLineWidth(float);
    method public static void glLineWidthx(int);
    method public static void glLoadIdentity();
    method public static void glLoadMatrixf(float[], int);
    method public static void glLoadMatrixf(java.nio.FloatBuffer);
    method public static void glLoadMatrixx(int[], int);
    method public static void glLoadMatrixx(java.nio.IntBuffer);
    method public static void glLogicOp(int);
    method public static void glMaterialf(int, int, float);
    method public static void glMaterialfv(int, int, float[], int);
    method public static void glMaterialfv(int, int, java.nio.FloatBuffer);
    method public static void glMaterialx(int, int, int);
    method public static void glMaterialxv(int, int, int[], int);
    method public static void glMaterialxv(int, int, java.nio.IntBuffer);
    method public static void glMatrixMode(int);
    method public static void glMultMatrixf(float[], int);
    method public static void glMultMatrixf(java.nio.FloatBuffer);
    method public static void glMultMatrixx(int[], int);
    method public static void glMultMatrixx(java.nio.IntBuffer);
    method public static void glMultiTexCoord4f(int, float, float, float, float);
    method public static void glMultiTexCoord4x(int, int, int, int, int);
    method public static void glNormal3f(float, float, float);
    method public static void glNormal3x(int, int, int);
    method public static void glNormalPointer(int, int, java.nio.Buffer);
    method public static void glOrthof(float, float, float, float, float, float);
    method public static void glOrthox(int, int, int, int, int, int);
    method public static void glPixelStorei(int, int);
    method public static void glPointSize(float);
    method public static void glPointSizex(int);
    method public static void glPolygonOffset(float, float);
    method public static void glPolygonOffsetx(int, int);
    method public static void glPopMatrix();
    method public static void glPushMatrix();
    method public static void glReadPixels(int, int, int, int, int, int, java.nio.Buffer);
    method public static void glRotatef(float, float, float, float);
    method public static void glRotatex(int, int, int, int);
    method public static void glSampleCoverage(float, boolean);
    method public static void glSampleCoveragex(int, boolean);
    method public static void glScalef(float, float, float);
    method public static void glScalex(int, int, int);
    method public static void glScissor(int, int, int, int);
    method public static void glShadeModel(int);
    method public static void glStencilFunc(int, int, int);
    method public static void glStencilMask(int);
    method public static void glStencilOp(int, int, int);
    method public static void glTexCoordPointer(int, int, int, java.nio.Buffer);
    method public static void glTexEnvf(int, int, float);
    method public static void glTexEnvfv(int, int, float[], int);
    method public static void glTexEnvfv(int, int, java.nio.FloatBuffer);
    method public static void glTexEnvx(int, int, int);
    method public static void glTexEnvxv(int, int, int[], int);
    method public static void glTexEnvxv(int, int, java.nio.IntBuffer);
    method public static void glTexImage2D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glTexParameterf(int, int, float);
    method public static void glTexParameterx(int, int, int);
    method public static void glTexSubImage2D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glTranslatef(float, float, float);
    method public static void glTranslatex(int, int, int);
    method public static void glVertexPointer(int, int, int, java.nio.Buffer);
    method public static void glViewport(int, int, int, int);
    field public static final int GL_ADD = 260; // 0x104
    field public static final int GL_ALIASED_LINE_WIDTH_RANGE = 33902; // 0x846e
    field public static final int GL_ALIASED_POINT_SIZE_RANGE = 33901; // 0x846d
    field public static final int GL_ALPHA = 6406; // 0x1906
    field public static final int GL_ALPHA_BITS = 3413; // 0xd55
    field public static final int GL_ALPHA_TEST = 3008; // 0xbc0
    field public static final int GL_ALWAYS = 519; // 0x207
    field public static final int GL_AMBIENT = 4608; // 0x1200
    field public static final int GL_AMBIENT_AND_DIFFUSE = 5634; // 0x1602
    field public static final int GL_AND = 5377; // 0x1501
    field public static final int GL_AND_INVERTED = 5380; // 0x1504
    field public static final int GL_AND_REVERSE = 5378; // 0x1502
    field public static final int GL_BACK = 1029; // 0x405
    field public static final int GL_BLEND = 3042; // 0xbe2
    field public static final int GL_BLUE_BITS = 3412; // 0xd54
    field public static final int GL_BYTE = 5120; // 0x1400
    field public static final int GL_CCW = 2305; // 0x901
    field public static final int GL_CLAMP_TO_EDGE = 33071; // 0x812f
    field public static final int GL_CLEAR = 5376; // 0x1500
    field public static final int GL_COLOR_ARRAY = 32886; // 0x8076
    field public static final int GL_COLOR_BUFFER_BIT = 16384; // 0x4000
    field public static final int GL_COLOR_LOGIC_OP = 3058; // 0xbf2
    field public static final int GL_COLOR_MATERIAL = 2903; // 0xb57
    field public static final int GL_COMPRESSED_TEXTURE_FORMATS = 34467; // 0x86a3
    field public static final int GL_CONSTANT_ATTENUATION = 4615; // 0x1207
    field public static final int GL_COPY = 5379; // 0x1503
    field public static final int GL_COPY_INVERTED = 5388; // 0x150c
    field public static final int GL_CULL_FACE = 2884; // 0xb44
    field public static final int GL_CW = 2304; // 0x900
    field public static final int GL_DECAL = 8449; // 0x2101
    field public static final int GL_DECR = 7683; // 0x1e03
    field public static final int GL_DEPTH_BITS = 3414; // 0xd56
    field public static final int GL_DEPTH_BUFFER_BIT = 256; // 0x100
    field public static final int GL_DEPTH_TEST = 2929; // 0xb71
    field public static final int GL_DIFFUSE = 4609; // 0x1201
    field public static final int GL_DITHER = 3024; // 0xbd0
    field public static final int GL_DONT_CARE = 4352; // 0x1100
    field public static final int GL_DST_ALPHA = 772; // 0x304
    field public static final int GL_DST_COLOR = 774; // 0x306
    field public static final int GL_EMISSION = 5632; // 0x1600
    field public static final int GL_EQUAL = 514; // 0x202
    field public static final int GL_EQUIV = 5385; // 0x1509
    field public static final int GL_EXP = 2048; // 0x800
    field public static final int GL_EXP2 = 2049; // 0x801
    field public static final int GL_EXTENSIONS = 7939; // 0x1f03
    field public static final int GL_FALSE = 0; // 0x0
    field public static final int GL_FASTEST = 4353; // 0x1101
    field public static final int GL_FIXED = 5132; // 0x140c
    field public static final int GL_FLAT = 7424; // 0x1d00
    field public static final int GL_FLOAT = 5126; // 0x1406
    field public static final int GL_FOG = 2912; // 0xb60
    field public static final int GL_FOG_COLOR = 2918; // 0xb66
    field public static final int GL_FOG_DENSITY = 2914; // 0xb62
    field public static final int GL_FOG_END = 2916; // 0xb64
    field public static final int GL_FOG_HINT = 3156; // 0xc54
    field public static final int GL_FOG_MODE = 2917; // 0xb65
    field public static final int GL_FOG_START = 2915; // 0xb63
    field public static final int GL_FRONT = 1028; // 0x404
    field public static final int GL_FRONT_AND_BACK = 1032; // 0x408
    field public static final int GL_GEQUAL = 518; // 0x206
    field public static final int GL_GREATER = 516; // 0x204
    field public static final int GL_GREEN_BITS = 3411; // 0xd53
    field public static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = 35739; // 0x8b9b
    field public static final int GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = 35738; // 0x8b9a
    field public static final int GL_INCR = 7682; // 0x1e02
    field public static final int GL_INVALID_ENUM = 1280; // 0x500
    field public static final int GL_INVALID_OPERATION = 1282; // 0x502
    field public static final int GL_INVALID_VALUE = 1281; // 0x501
    field public static final int GL_INVERT = 5386; // 0x150a
    field public static final int GL_KEEP = 7680; // 0x1e00
    field public static final int GL_LEQUAL = 515; // 0x203
    field public static final int GL_LESS = 513; // 0x201
    field public static final int GL_LIGHT0 = 16384; // 0x4000
    field public static final int GL_LIGHT1 = 16385; // 0x4001
    field public static final int GL_LIGHT2 = 16386; // 0x4002
    field public static final int GL_LIGHT3 = 16387; // 0x4003
    field public static final int GL_LIGHT4 = 16388; // 0x4004
    field public static final int GL_LIGHT5 = 16389; // 0x4005
    field public static final int GL_LIGHT6 = 16390; // 0x4006
    field public static final int GL_LIGHT7 = 16391; // 0x4007
    field public static final int GL_LIGHTING = 2896; // 0xb50
    field public static final int GL_LIGHT_MODEL_AMBIENT = 2899; // 0xb53
    field public static final int GL_LIGHT_MODEL_TWO_SIDE = 2898; // 0xb52
    field public static final int GL_LINEAR = 9729; // 0x2601
    field public static final int GL_LINEAR_ATTENUATION = 4616; // 0x1208
    field public static final int GL_LINEAR_MIPMAP_LINEAR = 9987; // 0x2703
    field public static final int GL_LINEAR_MIPMAP_NEAREST = 9985; // 0x2701
    field public static final int GL_LINES = 1; // 0x1
    field public static final int GL_LINE_LOOP = 2; // 0x2
    field public static final int GL_LINE_SMOOTH = 2848; // 0xb20
    field public static final int GL_LINE_SMOOTH_HINT = 3154; // 0xc52
    field public static final int GL_LINE_STRIP = 3; // 0x3
    field public static final int GL_LUMINANCE = 6409; // 0x1909
    field public static final int GL_LUMINANCE_ALPHA = 6410; // 0x190a
    field public static final int GL_MAX_ELEMENTS_INDICES = 33001; // 0x80e9
    field public static final int GL_MAX_ELEMENTS_VERTICES = 33000; // 0x80e8
    field public static final int GL_MAX_LIGHTS = 3377; // 0xd31
    field public static final int GL_MAX_MODELVIEW_STACK_DEPTH = 3382; // 0xd36
    field public static final int GL_MAX_PROJECTION_STACK_DEPTH = 3384; // 0xd38
    field public static final int GL_MAX_TEXTURE_SIZE = 3379; // 0xd33
    field public static final int GL_MAX_TEXTURE_STACK_DEPTH = 3385; // 0xd39
    field public static final int GL_MAX_TEXTURE_UNITS = 34018; // 0x84e2
    field public static final int GL_MAX_VIEWPORT_DIMS = 3386; // 0xd3a
    field public static final int GL_MODELVIEW = 5888; // 0x1700
    field public static final int GL_MODULATE = 8448; // 0x2100
    field public static final int GL_MULTISAMPLE = 32925; // 0x809d
    field public static final int GL_NAND = 5390; // 0x150e
    field public static final int GL_NEAREST = 9728; // 0x2600
    field public static final int GL_NEAREST_MIPMAP_LINEAR = 9986; // 0x2702
    field public static final int GL_NEAREST_MIPMAP_NEAREST = 9984; // 0x2700
    field public static final int GL_NEVER = 512; // 0x200
    field public static final int GL_NICEST = 4354; // 0x1102
    field public static final int GL_NOOP = 5381; // 0x1505
    field public static final int GL_NOR = 5384; // 0x1508
    field public static final int GL_NORMALIZE = 2977; // 0xba1
    field public static final int GL_NORMAL_ARRAY = 32885; // 0x8075
    field public static final int GL_NOTEQUAL = 517; // 0x205
    field public static final int GL_NO_ERROR = 0; // 0x0
    field public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 34466; // 0x86a2
    field public static final int GL_ONE = 1; // 0x1
    field public static final int GL_ONE_MINUS_DST_ALPHA = 773; // 0x305
    field public static final int GL_ONE_MINUS_DST_COLOR = 775; // 0x307
    field public static final int GL_ONE_MINUS_SRC_ALPHA = 771; // 0x303
    field public static final int GL_ONE_MINUS_SRC_COLOR = 769; // 0x301
    field public static final int GL_OR = 5383; // 0x1507
    field public static final int GL_OR_INVERTED = 5389; // 0x150d
    field public static final int GL_OR_REVERSE = 5387; // 0x150b
    field public static final int GL_OUT_OF_MEMORY = 1285; // 0x505
    field public static final int GL_PACK_ALIGNMENT = 3333; // 0xd05
    field public static final int GL_PALETTE4_R5_G6_B5_OES = 35730; // 0x8b92
    field public static final int GL_PALETTE4_RGB5_A1_OES = 35732; // 0x8b94
    field public static final int GL_PALETTE4_RGB8_OES = 35728; // 0x8b90
    field public static final int GL_PALETTE4_RGBA4_OES = 35731; // 0x8b93
    field public static final int GL_PALETTE4_RGBA8_OES = 35729; // 0x8b91
    field public static final int GL_PALETTE8_R5_G6_B5_OES = 35735; // 0x8b97
    field public static final int GL_PALETTE8_RGB5_A1_OES = 35737; // 0x8b99
    field public static final int GL_PALETTE8_RGB8_OES = 35733; // 0x8b95
    field public static final int GL_PALETTE8_RGBA4_OES = 35736; // 0x8b98
    field public static final int GL_PALETTE8_RGBA8_OES = 35734; // 0x8b96
    field public static final int GL_PERSPECTIVE_CORRECTION_HINT = 3152; // 0xc50
    field public static final int GL_POINTS = 0; // 0x0
    field public static final int GL_POINT_FADE_THRESHOLD_SIZE = 33064; // 0x8128
    field public static final int GL_POINT_SIZE = 2833; // 0xb11
    field public static final int GL_POINT_SMOOTH = 2832; // 0xb10
    field public static final int GL_POINT_SMOOTH_HINT = 3153; // 0xc51
    field public static final int GL_POLYGON_OFFSET_FILL = 32823; // 0x8037
    field public static final int GL_POLYGON_SMOOTH_HINT = 3155; // 0xc53
    field public static final int GL_POSITION = 4611; // 0x1203
    field public static final int GL_PROJECTION = 5889; // 0x1701
    field public static final int GL_QUADRATIC_ATTENUATION = 4617; // 0x1209
    field public static final int GL_RED_BITS = 3410; // 0xd52
    field public static final int GL_RENDERER = 7937; // 0x1f01
    field public static final int GL_REPEAT = 10497; // 0x2901
    field public static final int GL_REPLACE = 7681; // 0x1e01
    field public static final int GL_RESCALE_NORMAL = 32826; // 0x803a
    field public static final int GL_RGB = 6407; // 0x1907
    field public static final int GL_RGBA = 6408; // 0x1908
    field public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 32926; // 0x809e
    field public static final int GL_SAMPLE_ALPHA_TO_ONE = 32927; // 0x809f
    field public static final int GL_SAMPLE_COVERAGE = 32928; // 0x80a0
    field public static final int GL_SCISSOR_TEST = 3089; // 0xc11
    field public static final int GL_SET = 5391; // 0x150f
    field public static final int GL_SHININESS = 5633; // 0x1601
    field public static final int GL_SHORT = 5122; // 0x1402
    field public static final int GL_SMOOTH = 7425; // 0x1d01
    field public static final int GL_SMOOTH_LINE_WIDTH_RANGE = 2850; // 0xb22
    field public static final int GL_SMOOTH_POINT_SIZE_RANGE = 2834; // 0xb12
    field public static final int GL_SPECULAR = 4610; // 0x1202
    field public static final int GL_SPOT_CUTOFF = 4614; // 0x1206
    field public static final int GL_SPOT_DIRECTION = 4612; // 0x1204
    field public static final int GL_SPOT_EXPONENT = 4613; // 0x1205
    field public static final int GL_SRC_ALPHA = 770; // 0x302
    field public static final int GL_SRC_ALPHA_SATURATE = 776; // 0x308
    field public static final int GL_SRC_COLOR = 768; // 0x300
    field public static final int GL_STACK_OVERFLOW = 1283; // 0x503
    field public static final int GL_STACK_UNDERFLOW = 1284; // 0x504
    field public static final int GL_STENCIL_BITS = 3415; // 0xd57
    field public static final int GL_STENCIL_BUFFER_BIT = 1024; // 0x400
    field public static final int GL_STENCIL_TEST = 2960; // 0xb90
    field public static final int GL_SUBPIXEL_BITS = 3408; // 0xd50
    field public static final int GL_TEXTURE = 5890; // 0x1702
    field public static final int GL_TEXTURE0 = 33984; // 0x84c0
    field public static final int GL_TEXTURE1 = 33985; // 0x84c1
    field public static final int GL_TEXTURE10 = 33994; // 0x84ca
    field public static final int GL_TEXTURE11 = 33995; // 0x84cb
    field public static final int GL_TEXTURE12 = 33996; // 0x84cc
    field public static final int GL_TEXTURE13 = 33997; // 0x84cd
    field public static final int GL_TEXTURE14 = 33998; // 0x84ce
    field public static final int GL_TEXTURE15 = 33999; // 0x84cf
    field public static final int GL_TEXTURE16 = 34000; // 0x84d0
    field public static final int GL_TEXTURE17 = 34001; // 0x84d1
    field public static final int GL_TEXTURE18 = 34002; // 0x84d2
    field public static final int GL_TEXTURE19 = 34003; // 0x84d3
    field public static final int GL_TEXTURE2 = 33986; // 0x84c2
    field public static final int GL_TEXTURE20 = 34004; // 0x84d4
    field public static final int GL_TEXTURE21 = 34005; // 0x84d5
    field public static final int GL_TEXTURE22 = 34006; // 0x84d6
    field public static final int GL_TEXTURE23 = 34007; // 0x84d7
    field public static final int GL_TEXTURE24 = 34008; // 0x84d8
    field public static final int GL_TEXTURE25 = 34009; // 0x84d9
    field public static final int GL_TEXTURE26 = 34010; // 0x84da
    field public static final int GL_TEXTURE27 = 34011; // 0x84db
    field public static final int GL_TEXTURE28 = 34012; // 0x84dc
    field public static final int GL_TEXTURE29 = 34013; // 0x84dd
    field public static final int GL_TEXTURE3 = 33987; // 0x84c3
    field public static final int GL_TEXTURE30 = 34014; // 0x84de
    field public static final int GL_TEXTURE31 = 34015; // 0x84df
    field public static final int GL_TEXTURE4 = 33988; // 0x84c4
    field public static final int GL_TEXTURE5 = 33989; // 0x84c5
    field public static final int GL_TEXTURE6 = 33990; // 0x84c6
    field public static final int GL_TEXTURE7 = 33991; // 0x84c7
    field public static final int GL_TEXTURE8 = 33992; // 0x84c8
    field public static final int GL_TEXTURE9 = 33993; // 0x84c9
    field public static final int GL_TEXTURE_2D = 3553; // 0xde1
    field public static final int GL_TEXTURE_COORD_ARRAY = 32888; // 0x8078
    field public static final int GL_TEXTURE_ENV = 8960; // 0x2300
    field public static final int GL_TEXTURE_ENV_COLOR = 8705; // 0x2201
    field public static final int GL_TEXTURE_ENV_MODE = 8704; // 0x2200
    field public static final int GL_TEXTURE_MAG_FILTER = 10240; // 0x2800
    field public static final int GL_TEXTURE_MIN_FILTER = 10241; // 0x2801
    field public static final int GL_TEXTURE_WRAP_S = 10242; // 0x2802
    field public static final int GL_TEXTURE_WRAP_T = 10243; // 0x2803
    field public static final int GL_TRIANGLES = 4; // 0x4
    field public static final int GL_TRIANGLE_FAN = 6; // 0x6
    field public static final int GL_TRIANGLE_STRIP = 5; // 0x5
    field public static final int GL_TRUE = 1; // 0x1
    field public static final int GL_UNPACK_ALIGNMENT = 3317; // 0xcf5
    field public static final int GL_UNSIGNED_BYTE = 5121; // 0x1401
    field public static final int GL_UNSIGNED_SHORT = 5123; // 0x1403
    field public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 32819; // 0x8033
    field public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 32820; // 0x8034
    field public static final int GL_UNSIGNED_SHORT_5_6_5 = 33635; // 0x8363
    field public static final int GL_VENDOR = 7936; // 0x1f00
    field public static final int GL_VERSION = 7938; // 0x1f02
    field public static final int GL_VERTEX_ARRAY = 32884; // 0x8074
    field public static final int GL_XOR = 5382; // 0x1506
    field public static final int GL_ZERO = 0; // 0x0
  }

  public class GLES10Ext {
    ctor public GLES10Ext();
    method public static int glQueryMatrixxOES(int[], int, int[], int);
    method public static int glQueryMatrixxOES(java.nio.IntBuffer, java.nio.IntBuffer);
  }

  public class GLES11 extends android.opengl.GLES10 {
    ctor public GLES11();
    method public static void glBindBuffer(int, int);
    method public static void glBufferData(int, int, java.nio.Buffer, int);
    method public static void glBufferSubData(int, int, int, java.nio.Buffer);
    method public static void glClipPlanef(int, float[], int);
    method public static void glClipPlanef(int, java.nio.FloatBuffer);
    method public static void glClipPlanex(int, int[], int);
    method public static void glClipPlanex(int, java.nio.IntBuffer);
    method public static void glColor4ub(byte, byte, byte, byte);
    method public static void glColorPointer(int, int, int, int);
    method public static void glDeleteBuffers(int, int[], int);
    method public static void glDeleteBuffers(int, java.nio.IntBuffer);
    method public static void glDrawElements(int, int, int, int);
    method public static void glGenBuffers(int, int[], int);
    method public static void glGenBuffers(int, java.nio.IntBuffer);
    method public static void glGetBooleanv(int, boolean[], int);
    method public static void glGetBooleanv(int, java.nio.IntBuffer);
    method public static void glGetBufferParameteriv(int, int, int[], int);
    method public static void glGetBufferParameteriv(int, int, java.nio.IntBuffer);
    method public static void glGetClipPlanef(int, float[], int);
    method public static void glGetClipPlanef(int, java.nio.FloatBuffer);
    method public static void glGetClipPlanex(int, int[], int);
    method public static void glGetClipPlanex(int, java.nio.IntBuffer);
    method public static void glGetFixedv(int, int[], int);
    method public static void glGetFixedv(int, java.nio.IntBuffer);
    method public static void glGetFloatv(int, float[], int);
    method public static void glGetFloatv(int, java.nio.FloatBuffer);
    method public static void glGetLightfv(int, int, float[], int);
    method public static void glGetLightfv(int, int, java.nio.FloatBuffer);
    method public static void glGetLightxv(int, int, int[], int);
    method public static void glGetLightxv(int, int, java.nio.IntBuffer);
    method public static void glGetMaterialfv(int, int, float[], int);
    method public static void glGetMaterialfv(int, int, java.nio.FloatBuffer);
    method public static void glGetMaterialxv(int, int, int[], int);
    method public static void glGetMaterialxv(int, int, java.nio.IntBuffer);
    method public static void glGetTexEnvfv(int, int, float[], int);
    method public static void glGetTexEnvfv(int, int, java.nio.FloatBuffer);
    method public static void glGetTexEnviv(int, int, int[], int);
    method public static void glGetTexEnviv(int, int, java.nio.IntBuffer);
    method public static void glGetTexEnvxv(int, int, int[], int);
    method public static void glGetTexEnvxv(int, int, java.nio.IntBuffer);
    method public static void glGetTexParameterfv(int, int, float[], int);
    method public static void glGetTexParameterfv(int, int, java.nio.FloatBuffer);
    method public static void glGetTexParameteriv(int, int, int[], int);
    method public static void glGetTexParameteriv(int, int, java.nio.IntBuffer);
    method public static void glGetTexParameterxv(int, int, int[], int);
    method public static void glGetTexParameterxv(int, int, java.nio.IntBuffer);
    method public static boolean glIsBuffer(int);
    method public static boolean glIsEnabled(int);
    method public static boolean glIsTexture(int);
    method public static void glNormalPointer(int, int, int);
    method public static void glPointParameterf(int, float);
    method public static void glPointParameterfv(int, float[], int);
    method public static void glPointParameterfv(int, java.nio.FloatBuffer);
    method public static void glPointParameterx(int, int);
    method public static void glPointParameterxv(int, int[], int);
    method public static void glPointParameterxv(int, java.nio.IntBuffer);
    method public static void glPointSizePointerOES(int, int, java.nio.Buffer);
    method public static void glTexCoordPointer(int, int, int, int);
    method public static void glTexEnvi(int, int, int);
    method public static void glTexEnviv(int, int, int[], int);
    method public static void glTexEnviv(int, int, java.nio.IntBuffer);
    method public static void glTexParameterfv(int, int, float[], int);
    method public static void glTexParameterfv(int, int, java.nio.FloatBuffer);
    method public static void glTexParameteri(int, int, int);
    method public static void glTexParameteriv(int, int, int[], int);
    method public static void glTexParameteriv(int, int, java.nio.IntBuffer);
    method public static void glTexParameterxv(int, int, int[], int);
    method public static void glTexParameterxv(int, int, java.nio.IntBuffer);
    method public static void glVertexPointer(int, int, int, int);
    field public static final int GL_ACTIVE_TEXTURE = 34016; // 0x84e0
    field public static final int GL_ADD_SIGNED = 34164; // 0x8574
    field public static final int GL_ALPHA_SCALE = 3356; // 0xd1c
    field public static final int GL_ALPHA_TEST_FUNC = 3009; // 0xbc1
    field public static final int GL_ALPHA_TEST_REF = 3010; // 0xbc2
    field public static final int GL_ARRAY_BUFFER = 34962; // 0x8892
    field public static final int GL_ARRAY_BUFFER_BINDING = 34964; // 0x8894
    field public static final int GL_BLEND_DST = 3040; // 0xbe0
    field public static final int GL_BLEND_SRC = 3041; // 0xbe1
    field public static final int GL_BUFFER_ACCESS = 35003; // 0x88bb
    field public static final int GL_BUFFER_SIZE = 34660; // 0x8764
    field public static final int GL_BUFFER_USAGE = 34661; // 0x8765
    field public static final int GL_CLIENT_ACTIVE_TEXTURE = 34017; // 0x84e1
    field public static final int GL_CLIP_PLANE0 = 12288; // 0x3000
    field public static final int GL_CLIP_PLANE1 = 12289; // 0x3001
    field public static final int GL_CLIP_PLANE2 = 12290; // 0x3002
    field public static final int GL_CLIP_PLANE3 = 12291; // 0x3003
    field public static final int GL_CLIP_PLANE4 = 12292; // 0x3004
    field public static final int GL_CLIP_PLANE5 = 12293; // 0x3005
    field public static final int GL_COLOR_ARRAY_BUFFER_BINDING = 34968; // 0x8898
    field public static final int GL_COLOR_ARRAY_POINTER = 32912; // 0x8090
    field public static final int GL_COLOR_ARRAY_SIZE = 32897; // 0x8081
    field public static final int GL_COLOR_ARRAY_STRIDE = 32899; // 0x8083
    field public static final int GL_COLOR_ARRAY_TYPE = 32898; // 0x8082
    field public static final int GL_COLOR_CLEAR_VALUE = 3106; // 0xc22
    field public static final int GL_COLOR_WRITEMASK = 3107; // 0xc23
    field public static final int GL_COMBINE = 34160; // 0x8570
    field public static final int GL_COMBINE_ALPHA = 34162; // 0x8572
    field public static final int GL_COMBINE_RGB = 34161; // 0x8571
    field public static final int GL_CONSTANT = 34166; // 0x8576
    field public static final int GL_COORD_REPLACE_OES = 34914; // 0x8862
    field public static final int GL_CULL_FACE_MODE = 2885; // 0xb45
    field public static final int GL_CURRENT_COLOR = 2816; // 0xb00
    field public static final int GL_CURRENT_NORMAL = 2818; // 0xb02
    field public static final int GL_CURRENT_TEXTURE_COORDS = 2819; // 0xb03
    field public static final int GL_DEPTH_CLEAR_VALUE = 2931; // 0xb73
    field public static final int GL_DEPTH_FUNC = 2932; // 0xb74
    field public static final int GL_DEPTH_RANGE = 2928; // 0xb70
    field public static final int GL_DEPTH_WRITEMASK = 2930; // 0xb72
    field public static final int GL_DOT3_RGB = 34478; // 0x86ae
    field public static final int GL_DOT3_RGBA = 34479; // 0x86af
    field public static final int GL_DYNAMIC_DRAW = 35048; // 0x88e8
    field public static final int GL_ELEMENT_ARRAY_BUFFER = 34963; // 0x8893
    field public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING = 34965; // 0x8895
    field public static final int GL_FRONT_FACE = 2886; // 0xb46
    field public static final int GL_GENERATE_MIPMAP = 33169; // 0x8191
    field public static final int GL_GENERATE_MIPMAP_HINT = 33170; // 0x8192
    field public static final int GL_INTERPOLATE = 34165; // 0x8575
    field public static final int GL_LINE_WIDTH = 2849; // 0xb21
    field public static final int GL_LOGIC_OP_MODE = 3056; // 0xbf0
    field public static final int GL_MATRIX_MODE = 2976; // 0xba0
    field public static final int GL_MAX_CLIP_PLANES = 3378; // 0xd32
    field public static final int GL_MODELVIEW_MATRIX = 2982; // 0xba6
    field public static final int GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES = 35213; // 0x898d
    field public static final int GL_MODELVIEW_STACK_DEPTH = 2979; // 0xba3
    field public static final int GL_NORMAL_ARRAY_BUFFER_BINDING = 34967; // 0x8897
    field public static final int GL_NORMAL_ARRAY_POINTER = 32911; // 0x808f
    field public static final int GL_NORMAL_ARRAY_STRIDE = 32895; // 0x807f
    field public static final int GL_NORMAL_ARRAY_TYPE = 32894; // 0x807e
    field public static final int GL_OPERAND0_ALPHA = 34200; // 0x8598
    field public static final int GL_OPERAND0_RGB = 34192; // 0x8590
    field public static final int GL_OPERAND1_ALPHA = 34201; // 0x8599
    field public static final int GL_OPERAND1_RGB = 34193; // 0x8591
    field public static final int GL_OPERAND2_ALPHA = 34202; // 0x859a
    field public static final int GL_OPERAND2_RGB = 34194; // 0x8592
    field public static final int GL_POINT_DISTANCE_ATTENUATION = 33065; // 0x8129
    field public static final int GL_POINT_FADE_THRESHOLD_SIZE = 33064; // 0x8128
    field public static final int GL_POINT_SIZE = 2833; // 0xb11
    field public static final int GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES = 35743; // 0x8b9f
    field public static final int GL_POINT_SIZE_ARRAY_OES = 35740; // 0x8b9c
    field public static final int GL_POINT_SIZE_ARRAY_POINTER_OES = 35212; // 0x898c
    field public static final int GL_POINT_SIZE_ARRAY_STRIDE_OES = 35211; // 0x898b
    field public static final int GL_POINT_SIZE_ARRAY_TYPE_OES = 35210; // 0x898a
    field public static final int GL_POINT_SIZE_MAX = 33063; // 0x8127
    field public static final int GL_POINT_SIZE_MIN = 33062; // 0x8126
    field public static final int GL_POINT_SPRITE_OES = 34913; // 0x8861
    field public static final int GL_POLYGON_OFFSET_FACTOR = 32824; // 0x8038
    field public static final int GL_POLYGON_OFFSET_UNITS = 10752; // 0x2a00
    field public static final int GL_PREVIOUS = 34168; // 0x8578
    field public static final int GL_PRIMARY_COLOR = 34167; // 0x8577
    field public static final int GL_PROJECTION_MATRIX = 2983; // 0xba7
    field public static final int GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES = 35214; // 0x898e
    field public static final int GL_PROJECTION_STACK_DEPTH = 2980; // 0xba4
    field public static final int GL_RGB_SCALE = 34163; // 0x8573
    field public static final int GL_SAMPLES = 32937; // 0x80a9
    field public static final int GL_SAMPLE_BUFFERS = 32936; // 0x80a8
    field public static final int GL_SAMPLE_COVERAGE_INVERT = 32939; // 0x80ab
    field public static final int GL_SAMPLE_COVERAGE_VALUE = 32938; // 0x80aa
    field public static final int GL_SCISSOR_BOX = 3088; // 0xc10
    field public static final int GL_SHADE_MODEL = 2900; // 0xb54
    field public static final int GL_SRC0_ALPHA = 34184; // 0x8588
    field public static final int GL_SRC0_RGB = 34176; // 0x8580
    field public static final int GL_SRC1_ALPHA = 34185; // 0x8589
    field public static final int GL_SRC1_RGB = 34177; // 0x8581
    field public static final int GL_SRC2_ALPHA = 34186; // 0x858a
    field public static final int GL_SRC2_RGB = 34178; // 0x8582
    field public static final int GL_STATIC_DRAW = 35044; // 0x88e4
    field public static final int GL_STENCIL_CLEAR_VALUE = 2961; // 0xb91
    field public static final int GL_STENCIL_FAIL = 2964; // 0xb94
    field public static final int GL_STENCIL_FUNC = 2962; // 0xb92
    field public static final int GL_STENCIL_PASS_DEPTH_FAIL = 2965; // 0xb95
    field public static final int GL_STENCIL_PASS_DEPTH_PASS = 2966; // 0xb96
    field public static final int GL_STENCIL_REF = 2967; // 0xb97
    field public static final int GL_STENCIL_VALUE_MASK = 2963; // 0xb93
    field public static final int GL_STENCIL_WRITEMASK = 2968; // 0xb98
    field public static final int GL_SUBTRACT = 34023; // 0x84e7
    field public static final int GL_TEXTURE_BINDING_2D = 32873; // 0x8069
    field public static final int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 34970; // 0x889a
    field public static final int GL_TEXTURE_COORD_ARRAY_POINTER = 32914; // 0x8092
    field public static final int GL_TEXTURE_COORD_ARRAY_SIZE = 32904; // 0x8088
    field public static final int GL_TEXTURE_COORD_ARRAY_STRIDE = 32906; // 0x808a
    field public static final int GL_TEXTURE_COORD_ARRAY_TYPE = 32905; // 0x8089
    field public static final int GL_TEXTURE_MATRIX = 2984; // 0xba8
    field public static final int GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES = 35215; // 0x898f
    field public static final int GL_TEXTURE_STACK_DEPTH = 2981; // 0xba5
    field public static final int GL_VERTEX_ARRAY_BUFFER_BINDING = 34966; // 0x8896
    field public static final int GL_VERTEX_ARRAY_POINTER = 32910; // 0x808e
    field public static final int GL_VERTEX_ARRAY_SIZE = 32890; // 0x807a
    field public static final int GL_VERTEX_ARRAY_STRIDE = 32892; // 0x807c
    field public static final int GL_VERTEX_ARRAY_TYPE = 32891; // 0x807b
    field public static final int GL_VIEWPORT = 2978; // 0xba2
    field public static final int GL_WRITE_ONLY = 35001; // 0x88b9
  }

  public class GLES11Ext {
    ctor public GLES11Ext();
    method public static void glAlphaFuncxOES(int, int);
    method public static void glBindFramebufferOES(int, int);
    method public static void glBindRenderbufferOES(int, int);
    method public static void glBlendEquationOES(int);
    method public static void glBlendEquationSeparateOES(int, int);
    method public static void glBlendFuncSeparateOES(int, int, int, int);
    method public static int glCheckFramebufferStatusOES(int);
    method public static void glClearColorxOES(int, int, int, int);
    method public static void glClearDepthfOES(float);
    method public static void glClearDepthxOES(int);
    method public static void glClipPlanefOES(int, float[], int);
    method public static void glClipPlanefOES(int, java.nio.FloatBuffer);
    method public static void glClipPlanexOES(int, int[], int);
    method public static void glClipPlanexOES(int, java.nio.IntBuffer);
    method public static void glColor4xOES(int, int, int, int);
    method public static void glCurrentPaletteMatrixOES(int);
    method public static void glDeleteFramebuffersOES(int, int[], int);
    method public static void glDeleteFramebuffersOES(int, java.nio.IntBuffer);
    method public static void glDeleteRenderbuffersOES(int, int[], int);
    method public static void glDeleteRenderbuffersOES(int, java.nio.IntBuffer);
    method public static void glDepthRangefOES(float, float);
    method public static void glDepthRangexOES(int, int);
    method public static void glDrawTexfOES(float, float, float, float, float);
    method public static void glDrawTexfvOES(float[], int);
    method public static void glDrawTexfvOES(java.nio.FloatBuffer);
    method public static void glDrawTexiOES(int, int, int, int, int);
    method public static void glDrawTexivOES(int[], int);
    method public static void glDrawTexivOES(java.nio.IntBuffer);
    method public static void glDrawTexsOES(short, short, short, short, short);
    method public static void glDrawTexsvOES(short[], int);
    method public static void glDrawTexsvOES(java.nio.ShortBuffer);
    method public static void glDrawTexxOES(int, int, int, int, int);
    method public static void glDrawTexxvOES(int[], int);
    method public static void glDrawTexxvOES(java.nio.IntBuffer);
    method public static void glEGLImageTargetRenderbufferStorageOES(int, java.nio.Buffer);
    method public static void glEGLImageTargetTexture2DOES(int, java.nio.Buffer);
    method public static void glFogxOES(int, int);
    method public static void glFogxvOES(int, int[], int);
    method public static void glFogxvOES(int, java.nio.IntBuffer);
    method public static void glFramebufferRenderbufferOES(int, int, int, int);
    method public static void glFramebufferTexture2DOES(int, int, int, int, int);
    method public static void glFrustumfOES(float, float, float, float, float, float);
    method public static void glFrustumxOES(int, int, int, int, int, int);
    method public static void glGenFramebuffersOES(int, int[], int);
    method public static void glGenFramebuffersOES(int, java.nio.IntBuffer);
    method public static void glGenRenderbuffersOES(int, int[], int);
    method public static void glGenRenderbuffersOES(int, java.nio.IntBuffer);
    method public static void glGenerateMipmapOES(int);
    method public static void glGetClipPlanefOES(int, float[], int);
    method public static void glGetClipPlanefOES(int, java.nio.FloatBuffer);
    method public static void glGetClipPlanexOES(int, int[], int);
    method public static void glGetClipPlanexOES(int, java.nio.IntBuffer);
    method public static void glGetFixedvOES(int, int[], int);
    method public static void glGetFixedvOES(int, java.nio.IntBuffer);
    method public static void glGetFramebufferAttachmentParameterivOES(int, int, int, int[], int);
    method public static void glGetFramebufferAttachmentParameterivOES(int, int, int, java.nio.IntBuffer);
    method public static void glGetLightxvOES(int, int, int[], int);
    method public static void glGetLightxvOES(int, int, java.nio.IntBuffer);
    method public static void glGetMaterialxvOES(int, int, int[], int);
    method public static void glGetMaterialxvOES(int, int, java.nio.IntBuffer);
    method public static void glGetRenderbufferParameterivOES(int, int, int[], int);
    method public static void glGetRenderbufferParameterivOES(int, int, java.nio.IntBuffer);
    method public static void glGetTexEnvxvOES(int, int, int[], int);
    method public static void glGetTexEnvxvOES(int, int, java.nio.IntBuffer);
    method public static void glGetTexGenfvOES(int, int, float[], int);
    method public static void glGetTexGenfvOES(int, int, java.nio.FloatBuffer);
    method public static void glGetTexGenivOES(int, int, int[], int);
    method public static void glGetTexGenivOES(int, int, java.nio.IntBuffer);
    method public static void glGetTexGenxvOES(int, int, int[], int);
    method public static void glGetTexGenxvOES(int, int, java.nio.IntBuffer);
    method public static void glGetTexParameterxvOES(int, int, int[], int);
    method public static void glGetTexParameterxvOES(int, int, java.nio.IntBuffer);
    method public static boolean glIsFramebufferOES(int);
    method public static boolean glIsRenderbufferOES(int);
    method public static void glLightModelxOES(int, int);
    method public static void glLightModelxvOES(int, int[], int);
    method public static void glLightModelxvOES(int, java.nio.IntBuffer);
    method public static void glLightxOES(int, int, int);
    method public static void glLightxvOES(int, int, int[], int);
    method public static void glLightxvOES(int, int, java.nio.IntBuffer);
    method public static void glLineWidthxOES(int);
    method public static void glLoadMatrixxOES(int[], int);
    method public static void glLoadMatrixxOES(java.nio.IntBuffer);
    method public static void glLoadPaletteFromModelViewMatrixOES();
    method public static void glMaterialxOES(int, int, int);
    method public static void glMaterialxvOES(int, int, int[], int);
    method public static void glMaterialxvOES(int, int, java.nio.IntBuffer);
    method public static void glMatrixIndexPointerOES(int, int, int, java.nio.Buffer);
    method public static void glMultMatrixxOES(int[], int);
    method public static void glMultMatrixxOES(java.nio.IntBuffer);
    method public static void glMultiTexCoord4xOES(int, int, int, int, int);
    method public static void glNormal3xOES(int, int, int);
    method public static void glOrthofOES(float, float, float, float, float, float);
    method public static void glOrthoxOES(int, int, int, int, int, int);
    method public static void glPointParameterxOES(int, int);
    method public static void glPointParameterxvOES(int, int[], int);
    method public static void glPointParameterxvOES(int, java.nio.IntBuffer);
    method public static void glPointSizexOES(int);
    method public static void glPolygonOffsetxOES(int, int);
    method public static void glRenderbufferStorageOES(int, int, int, int);
    method public static void glRotatexOES(int, int, int, int);
    method public static void glSampleCoveragexOES(int, boolean);
    method public static void glScalexOES(int, int, int);
    method public static void glTexEnvxOES(int, int, int);
    method public static void glTexEnvxvOES(int, int, int[], int);
    method public static void glTexEnvxvOES(int, int, java.nio.IntBuffer);
    method public static void glTexGenfOES(int, int, float);
    method public static void glTexGenfvOES(int, int, float[], int);
    method public static void glTexGenfvOES(int, int, java.nio.FloatBuffer);
    method public static void glTexGeniOES(int, int, int);
    method public static void glTexGenivOES(int, int, int[], int);
    method public static void glTexGenivOES(int, int, java.nio.IntBuffer);
    method public static void glTexGenxOES(int, int, int);
    method public static void glTexGenxvOES(int, int, int[], int);
    method public static void glTexGenxvOES(int, int, java.nio.IntBuffer);
    method public static void glTexParameterxOES(int, int, int);
    method public static void glTexParameterxvOES(int, int, int[], int);
    method public static void glTexParameterxvOES(int, int, java.nio.IntBuffer);
    method public static void glTranslatexOES(int, int, int);
    method public static void glWeightPointerOES(int, int, int, java.nio.Buffer);
    field public static final int GL_3DC_XY_AMD = 34810; // 0x87fa
    field public static final int GL_3DC_X_AMD = 34809; // 0x87f9
    field public static final int GL_ATC_RGBA_EXPLICIT_ALPHA_AMD = 35987; // 0x8c93
    field public static final int GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD = 34798; // 0x87ee
    field public static final int GL_ATC_RGB_AMD = 35986; // 0x8c92
    field public static final int GL_BGRA = 32993; // 0x80e1
    field public static final int GL_BLEND_DST_ALPHA_OES = 32970; // 0x80ca
    field public static final int GL_BLEND_DST_RGB_OES = 32968; // 0x80c8
    field public static final int GL_BLEND_EQUATION_ALPHA_OES = 34877; // 0x883d
    field public static final int GL_BLEND_EQUATION_OES = 32777; // 0x8009
    field public static final int GL_BLEND_EQUATION_RGB_OES = 32777; // 0x8009
    field public static final int GL_BLEND_SRC_ALPHA_OES = 32971; // 0x80cb
    field public static final int GL_BLEND_SRC_RGB_OES = 32969; // 0x80c9
    field public static final int GL_BUFFER_ACCESS_OES = 35003; // 0x88bb
    field public static final int GL_BUFFER_MAPPED_OES = 35004; // 0x88bc
    field public static final int GL_BUFFER_MAP_POINTER_OES = 35005; // 0x88bd
    field public static final int GL_COLOR_ATTACHMENT0_OES = 36064; // 0x8ce0
    field public static final int GL_CURRENT_PALETTE_MATRIX_OES = 34883; // 0x8843
    field public static final int GL_DECR_WRAP_OES = 34056; // 0x8508
    field public static final int GL_DEPTH24_STENCIL8_OES = 35056; // 0x88f0
    field public static final int GL_DEPTH_ATTACHMENT_OES = 36096; // 0x8d00
    field public static final int GL_DEPTH_COMPONENT16_OES = 33189; // 0x81a5
    field public static final int GL_DEPTH_COMPONENT24_OES = 33190; // 0x81a6
    field public static final int GL_DEPTH_COMPONENT32_OES = 33191; // 0x81a7
    field public static final int GL_DEPTH_STENCIL_OES = 34041; // 0x84f9
    field public static final int GL_ETC1_RGB8_OES = 36196; // 0x8d64
    field public static final int GL_FIXED_OES = 5132; // 0x140c
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES = 36049; // 0x8cd1
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES = 36048; // 0x8cd0
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES = 36051; // 0x8cd3
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES = 36050; // 0x8cd2
    field public static final int GL_FRAMEBUFFER_BINDING_OES = 36006; // 0x8ca6
    field public static final int GL_FRAMEBUFFER_COMPLETE_OES = 36053; // 0x8cd5
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES = 36054; // 0x8cd6
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES = 36057; // 0x8cd9
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES = 36058; // 0x8cda
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES = 36055; // 0x8cd7
    field public static final int GL_FRAMEBUFFER_OES = 36160; // 0x8d40
    field public static final int GL_FRAMEBUFFER_UNSUPPORTED_OES = 36061; // 0x8cdd
    field public static final int GL_FUNC_ADD_OES = 32774; // 0x8006
    field public static final int GL_FUNC_REVERSE_SUBTRACT_OES = 32779; // 0x800b
    field public static final int GL_FUNC_SUBTRACT_OES = 32778; // 0x800a
    field public static final int GL_INCR_WRAP_OES = 34055; // 0x8507
    field public static final int GL_INVALID_FRAMEBUFFER_OPERATION_OES = 1286; // 0x506
    field public static final int GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES = 35742; // 0x8b9e
    field public static final int GL_MATRIX_INDEX_ARRAY_OES = 34884; // 0x8844
    field public static final int GL_MATRIX_INDEX_ARRAY_POINTER_OES = 34889; // 0x8849
    field public static final int GL_MATRIX_INDEX_ARRAY_SIZE_OES = 34886; // 0x8846
    field public static final int GL_MATRIX_INDEX_ARRAY_STRIDE_OES = 34888; // 0x8848
    field public static final int GL_MATRIX_INDEX_ARRAY_TYPE_OES = 34887; // 0x8847
    field public static final int GL_MATRIX_PALETTE_OES = 34880; // 0x8840
    field public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES = 34076; // 0x851c
    field public static final int GL_MAX_PALETTE_MATRICES_OES = 34882; // 0x8842
    field public static final int GL_MAX_RENDERBUFFER_SIZE_OES = 34024; // 0x84e8
    field public static final int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047; // 0x84ff
    field public static final int GL_MAX_VERTEX_UNITS_OES = 34468; // 0x86a4
    field public static final int GL_MIRRORED_REPEAT_OES = 33648; // 0x8370
    field public static final int GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES = 35213; // 0x898d
    field public static final int GL_NONE_OES = 0; // 0x0
    field public static final int GL_NORMAL_MAP_OES = 34065; // 0x8511
    field public static final int GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES = 35214; // 0x898e
    field public static final int GL_REFLECTION_MAP_OES = 34066; // 0x8512
    field public static final int GL_RENDERBUFFER_ALPHA_SIZE_OES = 36179; // 0x8d53
    field public static final int GL_RENDERBUFFER_BINDING_OES = 36007; // 0x8ca7
    field public static final int GL_RENDERBUFFER_BLUE_SIZE_OES = 36178; // 0x8d52
    field public static final int GL_RENDERBUFFER_DEPTH_SIZE_OES = 36180; // 0x8d54
    field public static final int GL_RENDERBUFFER_GREEN_SIZE_OES = 36177; // 0x8d51
    field public static final int GL_RENDERBUFFER_HEIGHT_OES = 36163; // 0x8d43
    field public static final int GL_RENDERBUFFER_INTERNAL_FORMAT_OES = 36164; // 0x8d44
    field public static final int GL_RENDERBUFFER_OES = 36161; // 0x8d41
    field public static final int GL_RENDERBUFFER_RED_SIZE_OES = 36176; // 0x8d50
    field public static final int GL_RENDERBUFFER_STENCIL_SIZE_OES = 36181; // 0x8d55
    field public static final int GL_RENDERBUFFER_WIDTH_OES = 36162; // 0x8d42
    field public static final int GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES = 36200; // 0x8d68
    field public static final int GL_RGB565_OES = 36194; // 0x8d62
    field public static final int GL_RGB5_A1_OES = 32855; // 0x8057
    field public static final int GL_RGB8_OES = 32849; // 0x8051
    field public static final int GL_RGBA4_OES = 32854; // 0x8056
    field public static final int GL_RGBA8_OES = 32856; // 0x8058
    field public static final int GL_SAMPLER_EXTERNAL_OES = 36198; // 0x8d66
    field public static final int GL_STENCIL_ATTACHMENT_OES = 36128; // 0x8d20
    field public static final int GL_STENCIL_INDEX1_OES = 36166; // 0x8d46
    field public static final int GL_STENCIL_INDEX4_OES = 36167; // 0x8d47
    field public static final int GL_STENCIL_INDEX8_OES = 36168; // 0x8d48
    field public static final int GL_TEXTURE_BINDING_CUBE_MAP_OES = 34068; // 0x8514
    field public static final int GL_TEXTURE_BINDING_EXTERNAL_OES = 36199; // 0x8d67
    field public static final int GL_TEXTURE_CROP_RECT_OES = 35741; // 0x8b9d
    field public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES = 34070; // 0x8516
    field public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES = 34072; // 0x8518
    field public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES = 34074; // 0x851a
    field public static final int GL_TEXTURE_CUBE_MAP_OES = 34067; // 0x8513
    field public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES = 34069; // 0x8515
    field public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES = 34071; // 0x8517
    field public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES = 34073; // 0x8519
    field public static final int GL_TEXTURE_EXTERNAL_OES = 36197; // 0x8d65
    field public static final int GL_TEXTURE_GEN_MODE_OES = 9472; // 0x2500
    field public static final int GL_TEXTURE_GEN_STR_OES = 36192; // 0x8d60
    field public static final int GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES = 35215; // 0x898f
    field public static final int GL_TEXTURE_MAX_ANISOTROPY_EXT = 34046; // 0x84fe
    field public static final int GL_UNSIGNED_INT_24_8_OES = 34042; // 0x84fa
    field public static final int GL_WEIGHT_ARRAY_BUFFER_BINDING_OES = 34974; // 0x889e
    field public static final int GL_WEIGHT_ARRAY_OES = 34477; // 0x86ad
    field public static final int GL_WEIGHT_ARRAY_POINTER_OES = 34476; // 0x86ac
    field public static final int GL_WEIGHT_ARRAY_SIZE_OES = 34475; // 0x86ab
    field public static final int GL_WEIGHT_ARRAY_STRIDE_OES = 34474; // 0x86aa
    field public static final int GL_WEIGHT_ARRAY_TYPE_OES = 34473; // 0x86a9
    field public static final int GL_WRITE_ONLY_OES = 35001; // 0x88b9
  }

  public class GLES20 {
    ctor public GLES20();
    method public static void glActiveTexture(int);
    method public static void glAttachShader(int, int);
    method public static void glBindAttribLocation(int, int, String);
    method public static void glBindBuffer(int, int);
    method public static void glBindFramebuffer(int, int);
    method public static void glBindRenderbuffer(int, int);
    method public static void glBindTexture(int, int);
    method public static void glBlendColor(float, float, float, float);
    method public static void glBlendEquation(int);
    method public static void glBlendEquationSeparate(int, int);
    method public static void glBlendFunc(int, int);
    method public static void glBlendFuncSeparate(int, int, int, int);
    method public static void glBufferData(int, int, java.nio.Buffer, int);
    method public static void glBufferSubData(int, int, int, java.nio.Buffer);
    method public static int glCheckFramebufferStatus(int);
    method public static void glClear(int);
    method public static void glClearColor(float, float, float, float);
    method public static void glClearDepthf(float);
    method public static void glClearStencil(int);
    method public static void glColorMask(boolean, boolean, boolean, boolean);
    method public static void glCompileShader(int);
    method public static void glCompressedTexImage2D(int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glCompressedTexSubImage2D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glCopyTexImage2D(int, int, int, int, int, int, int, int);
    method public static void glCopyTexSubImage2D(int, int, int, int, int, int, int, int);
    method public static int glCreateProgram();
    method public static int glCreateShader(int);
    method public static void glCullFace(int);
    method public static void glDeleteBuffers(int, int[], int);
    method public static void glDeleteBuffers(int, java.nio.IntBuffer);
    method public static void glDeleteFramebuffers(int, int[], int);
    method public static void glDeleteFramebuffers(int, java.nio.IntBuffer);
    method public static void glDeleteProgram(int);
    method public static void glDeleteRenderbuffers(int, int[], int);
    method public static void glDeleteRenderbuffers(int, java.nio.IntBuffer);
    method public static void glDeleteShader(int);
    method public static void glDeleteTextures(int, int[], int);
    method public static void glDeleteTextures(int, java.nio.IntBuffer);
    method public static void glDepthFunc(int);
    method public static void glDepthMask(boolean);
    method public static void glDepthRangef(float, float);
    method public static void glDetachShader(int, int);
    method public static void glDisable(int);
    method public static void glDisableVertexAttribArray(int);
    method public static void glDrawArrays(int, int, int);
    method public static void glDrawElements(int, int, int, int);
    method public static void glDrawElements(int, int, int, java.nio.Buffer);
    method public static void glEnable(int);
    method public static void glEnableVertexAttribArray(int);
    method public static void glFinish();
    method public static void glFlush();
    method public static void glFramebufferRenderbuffer(int, int, int, int);
    method public static void glFramebufferTexture2D(int, int, int, int, int);
    method public static void glFrontFace(int);
    method public static void glGenBuffers(int, int[], int);
    method public static void glGenBuffers(int, java.nio.IntBuffer);
    method public static void glGenFramebuffers(int, int[], int);
    method public static void glGenFramebuffers(int, java.nio.IntBuffer);
    method public static void glGenRenderbuffers(int, int[], int);
    method public static void glGenRenderbuffers(int, java.nio.IntBuffer);
    method public static void glGenTextures(int, int[], int);
    method public static void glGenTextures(int, java.nio.IntBuffer);
    method public static void glGenerateMipmap(int);
    method public static void glGetActiveAttrib(int, int, int, int[], int, int[], int, int[], int, byte[], int);
    method public static String glGetActiveAttrib(int, int, int[], int, int[], int);
    method public static String glGetActiveAttrib(int, int, java.nio.IntBuffer, java.nio.IntBuffer);
    method public static void glGetActiveUniform(int, int, int, int[], int, int[], int, int[], int, byte[], int);
    method public static String glGetActiveUniform(int, int, int[], int, int[], int);
    method public static String glGetActiveUniform(int, int, java.nio.IntBuffer, java.nio.IntBuffer);
    method public static void glGetAttachedShaders(int, int, int[], int, int[], int);
    method public static void glGetAttachedShaders(int, int, java.nio.IntBuffer, java.nio.IntBuffer);
    method public static int glGetAttribLocation(int, String);
    method public static void glGetBooleanv(int, boolean[], int);
    method public static void glGetBooleanv(int, java.nio.IntBuffer);
    method public static void glGetBufferParameteriv(int, int, int[], int);
    method public static void glGetBufferParameteriv(int, int, java.nio.IntBuffer);
    method public static int glGetError();
    method public static void glGetFloatv(int, float[], int);
    method public static void glGetFloatv(int, java.nio.FloatBuffer);
    method public static void glGetFramebufferAttachmentParameteriv(int, int, int, int[], int);
    method public static void glGetFramebufferAttachmentParameteriv(int, int, int, java.nio.IntBuffer);
    method public static void glGetIntegerv(int, int[], int);
    method public static void glGetIntegerv(int, java.nio.IntBuffer);
    method public static String glGetProgramInfoLog(int);
    method public static void glGetProgramiv(int, int, int[], int);
    method public static void glGetProgramiv(int, int, java.nio.IntBuffer);
    method public static void glGetRenderbufferParameteriv(int, int, int[], int);
    method public static void glGetRenderbufferParameteriv(int, int, java.nio.IntBuffer);
    method public static String glGetShaderInfoLog(int);
    method public static void glGetShaderPrecisionFormat(int, int, int[], int, int[], int);
    method public static void glGetShaderPrecisionFormat(int, int, java.nio.IntBuffer, java.nio.IntBuffer);
    method public static void glGetShaderSource(int, int, int[], int, byte[], int);
    method public static String glGetShaderSource(int);
    method public static void glGetShaderiv(int, int, int[], int);
    method public static void glGetShaderiv(int, int, java.nio.IntBuffer);
    method public static String glGetString(int);
    method public static void glGetTexParameterfv(int, int, float[], int);
    method public static void glGetTexParameterfv(int, int, java.nio.FloatBuffer);
    method public static void glGetTexParameteriv(int, int, int[], int);
    method public static void glGetTexParameteriv(int, int, java.nio.IntBuffer);
    method public static int glGetUniformLocation(int, String);
    method public static void glGetUniformfv(int, int, float[], int);
    method public static void glGetUniformfv(int, int, java.nio.FloatBuffer);
    method public static void glGetUniformiv(int, int, int[], int);
    method public static void glGetUniformiv(int, int, java.nio.IntBuffer);
    method public static void glGetVertexAttribfv(int, int, float[], int);
    method public static void glGetVertexAttribfv(int, int, java.nio.FloatBuffer);
    method public static void glGetVertexAttribiv(int, int, int[], int);
    method public static void glGetVertexAttribiv(int, int, java.nio.IntBuffer);
    method public static void glHint(int, int);
    method public static boolean glIsBuffer(int);
    method public static boolean glIsEnabled(int);
    method public static boolean glIsFramebuffer(int);
    method public static boolean glIsProgram(int);
    method public static boolean glIsRenderbuffer(int);
    method public static boolean glIsShader(int);
    method public static boolean glIsTexture(int);
    method public static void glLineWidth(float);
    method public static void glLinkProgram(int);
    method public static void glPixelStorei(int, int);
    method public static void glPolygonOffset(float, float);
    method public static void glReadPixels(int, int, int, int, int, int, java.nio.Buffer);
    method public static void glReleaseShaderCompiler();
    method public static void glRenderbufferStorage(int, int, int, int);
    method public static void glSampleCoverage(float, boolean);
    method public static void glScissor(int, int, int, int);
    method public static void glShaderBinary(int, int[], int, int, java.nio.Buffer, int);
    method public static void glShaderBinary(int, java.nio.IntBuffer, int, java.nio.Buffer, int);
    method public static void glShaderSource(int, String);
    method public static void glStencilFunc(int, int, int);
    method public static void glStencilFuncSeparate(int, int, int, int);
    method public static void glStencilMask(int);
    method public static void glStencilMaskSeparate(int, int);
    method public static void glStencilOp(int, int, int);
    method public static void glStencilOpSeparate(int, int, int, int);
    method public static void glTexImage2D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glTexParameterf(int, int, float);
    method public static void glTexParameterfv(int, int, float[], int);
    method public static void glTexParameterfv(int, int, java.nio.FloatBuffer);
    method public static void glTexParameteri(int, int, int);
    method public static void glTexParameteriv(int, int, int[], int);
    method public static void glTexParameteriv(int, int, java.nio.IntBuffer);
    method public static void glTexSubImage2D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glUniform1f(int, float);
    method public static void glUniform1fv(int, int, float[], int);
    method public static void glUniform1fv(int, int, java.nio.FloatBuffer);
    method public static void glUniform1i(int, int);
    method public static void glUniform1iv(int, int, int[], int);
    method public static void glUniform1iv(int, int, java.nio.IntBuffer);
    method public static void glUniform2f(int, float, float);
    method public static void glUniform2fv(int, int, float[], int);
    method public static void glUniform2fv(int, int, java.nio.FloatBuffer);
    method public static void glUniform2i(int, int, int);
    method public static void glUniform2iv(int, int, int[], int);
    method public static void glUniform2iv(int, int, java.nio.IntBuffer);
    method public static void glUniform3f(int, float, float, float);
    method public static void glUniform3fv(int, int, float[], int);
    method public static void glUniform3fv(int, int, java.nio.FloatBuffer);
    method public static void glUniform3i(int, int, int, int);
    method public static void glUniform3iv(int, int, int[], int);
    method public static void glUniform3iv(int, int, java.nio.IntBuffer);
    method public static void glUniform4f(int, float, float, float, float);
    method public static void glUniform4fv(int, int, float[], int);
    method public static void glUniform4fv(int, int, java.nio.FloatBuffer);
    method public static void glUniform4i(int, int, int, int, int);
    method public static void glUniform4iv(int, int, int[], int);
    method public static void glUniform4iv(int, int, java.nio.IntBuffer);
    method public static void glUniformMatrix2fv(int, int, boolean, float[], int);
    method public static void glUniformMatrix2fv(int, int, boolean, java.nio.FloatBuffer);
    method public static void glUniformMatrix3fv(int, int, boolean, float[], int);
    method public static void glUniformMatrix3fv(int, int, boolean, java.nio.FloatBuffer);
    method public static void glUniformMatrix4fv(int, int, boolean, float[], int);
    method public static void glUniformMatrix4fv(int, int, boolean, java.nio.FloatBuffer);
    method public static void glUseProgram(int);
    method public static void glValidateProgram(int);
    method public static void glVertexAttrib1f(int, float);
    method public static void glVertexAttrib1fv(int, float[], int);
    method public static void glVertexAttrib1fv(int, java.nio.FloatBuffer);
    method public static void glVertexAttrib2f(int, float, float);
    method public static void glVertexAttrib2fv(int, float[], int);
    method public static void glVertexAttrib2fv(int, java.nio.FloatBuffer);
    method public static void glVertexAttrib3f(int, float, float, float);
    method public static void glVertexAttrib3fv(int, float[], int);
    method public static void glVertexAttrib3fv(int, java.nio.FloatBuffer);
    method public static void glVertexAttrib4f(int, float, float, float, float);
    method public static void glVertexAttrib4fv(int, float[], int);
    method public static void glVertexAttrib4fv(int, java.nio.FloatBuffer);
    method public static void glVertexAttribPointer(int, int, int, boolean, int, int);
    method public static void glVertexAttribPointer(int, int, int, boolean, int, java.nio.Buffer);
    method public static void glViewport(int, int, int, int);
    field public static final int GL_ACTIVE_ATTRIBUTES = 35721; // 0x8b89
    field public static final int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 35722; // 0x8b8a
    field public static final int GL_ACTIVE_TEXTURE = 34016; // 0x84e0
    field public static final int GL_ACTIVE_UNIFORMS = 35718; // 0x8b86
    field public static final int GL_ACTIVE_UNIFORM_MAX_LENGTH = 35719; // 0x8b87
    field public static final int GL_ALIASED_LINE_WIDTH_RANGE = 33902; // 0x846e
    field public static final int GL_ALIASED_POINT_SIZE_RANGE = 33901; // 0x846d
    field public static final int GL_ALPHA = 6406; // 0x1906
    field public static final int GL_ALPHA_BITS = 3413; // 0xd55
    field public static final int GL_ALWAYS = 519; // 0x207
    field public static final int GL_ARRAY_BUFFER = 34962; // 0x8892
    field public static final int GL_ARRAY_BUFFER_BINDING = 34964; // 0x8894
    field public static final int GL_ATTACHED_SHADERS = 35717; // 0x8b85
    field public static final int GL_BACK = 1029; // 0x405
    field public static final int GL_BLEND = 3042; // 0xbe2
    field public static final int GL_BLEND_COLOR = 32773; // 0x8005
    field public static final int GL_BLEND_DST_ALPHA = 32970; // 0x80ca
    field public static final int GL_BLEND_DST_RGB = 32968; // 0x80c8
    field public static final int GL_BLEND_EQUATION = 32777; // 0x8009
    field public static final int GL_BLEND_EQUATION_ALPHA = 34877; // 0x883d
    field public static final int GL_BLEND_EQUATION_RGB = 32777; // 0x8009
    field public static final int GL_BLEND_SRC_ALPHA = 32971; // 0x80cb
    field public static final int GL_BLEND_SRC_RGB = 32969; // 0x80c9
    field public static final int GL_BLUE_BITS = 3412; // 0xd54
    field public static final int GL_BOOL = 35670; // 0x8b56
    field public static final int GL_BOOL_VEC2 = 35671; // 0x8b57
    field public static final int GL_BOOL_VEC3 = 35672; // 0x8b58
    field public static final int GL_BOOL_VEC4 = 35673; // 0x8b59
    field public static final int GL_BUFFER_SIZE = 34660; // 0x8764
    field public static final int GL_BUFFER_USAGE = 34661; // 0x8765
    field public static final int GL_BYTE = 5120; // 0x1400
    field public static final int GL_CCW = 2305; // 0x901
    field public static final int GL_CLAMP_TO_EDGE = 33071; // 0x812f
    field public static final int GL_COLOR_ATTACHMENT0 = 36064; // 0x8ce0
    field public static final int GL_COLOR_BUFFER_BIT = 16384; // 0x4000
    field public static final int GL_COLOR_CLEAR_VALUE = 3106; // 0xc22
    field public static final int GL_COLOR_WRITEMASK = 3107; // 0xc23
    field public static final int GL_COMPILE_STATUS = 35713; // 0x8b81
    field public static final int GL_COMPRESSED_TEXTURE_FORMATS = 34467; // 0x86a3
    field public static final int GL_CONSTANT_ALPHA = 32771; // 0x8003
    field public static final int GL_CONSTANT_COLOR = 32769; // 0x8001
    field public static final int GL_CULL_FACE = 2884; // 0xb44
    field public static final int GL_CULL_FACE_MODE = 2885; // 0xb45
    field public static final int GL_CURRENT_PROGRAM = 35725; // 0x8b8d
    field public static final int GL_CURRENT_VERTEX_ATTRIB = 34342; // 0x8626
    field public static final int GL_CW = 2304; // 0x900
    field public static final int GL_DECR = 7683; // 0x1e03
    field public static final int GL_DECR_WRAP = 34056; // 0x8508
    field public static final int GL_DELETE_STATUS = 35712; // 0x8b80
    field public static final int GL_DEPTH_ATTACHMENT = 36096; // 0x8d00
    field public static final int GL_DEPTH_BITS = 3414; // 0xd56
    field public static final int GL_DEPTH_BUFFER_BIT = 256; // 0x100
    field public static final int GL_DEPTH_CLEAR_VALUE = 2931; // 0xb73
    field public static final int GL_DEPTH_COMPONENT = 6402; // 0x1902
    field public static final int GL_DEPTH_COMPONENT16 = 33189; // 0x81a5
    field public static final int GL_DEPTH_FUNC = 2932; // 0xb74
    field public static final int GL_DEPTH_RANGE = 2928; // 0xb70
    field public static final int GL_DEPTH_TEST = 2929; // 0xb71
    field public static final int GL_DEPTH_WRITEMASK = 2930; // 0xb72
    field public static final int GL_DITHER = 3024; // 0xbd0
    field public static final int GL_DONT_CARE = 4352; // 0x1100
    field public static final int GL_DST_ALPHA = 772; // 0x304
    field public static final int GL_DST_COLOR = 774; // 0x306
    field public static final int GL_DYNAMIC_DRAW = 35048; // 0x88e8
    field public static final int GL_ELEMENT_ARRAY_BUFFER = 34963; // 0x8893
    field public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING = 34965; // 0x8895
    field public static final int GL_EQUAL = 514; // 0x202
    field public static final int GL_EXTENSIONS = 7939; // 0x1f03
    field public static final int GL_FALSE = 0; // 0x0
    field public static final int GL_FASTEST = 4353; // 0x1101
    field public static final int GL_FIXED = 5132; // 0x140c
    field public static final int GL_FLOAT = 5126; // 0x1406
    field public static final int GL_FLOAT_MAT2 = 35674; // 0x8b5a
    field public static final int GL_FLOAT_MAT3 = 35675; // 0x8b5b
    field public static final int GL_FLOAT_MAT4 = 35676; // 0x8b5c
    field public static final int GL_FLOAT_VEC2 = 35664; // 0x8b50
    field public static final int GL_FLOAT_VEC3 = 35665; // 0x8b51
    field public static final int GL_FLOAT_VEC4 = 35666; // 0x8b52
    field public static final int GL_FRAGMENT_SHADER = 35632; // 0x8b30
    field public static final int GL_FRAMEBUFFER = 36160; // 0x8d40
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049; // 0x8cd1
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048; // 0x8cd0
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051; // 0x8cd3
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050; // 0x8cd2
    field public static final int GL_FRAMEBUFFER_BINDING = 36006; // 0x8ca6
    field public static final int GL_FRAMEBUFFER_COMPLETE = 36053; // 0x8cd5
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054; // 0x8cd6
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057; // 0x8cd9
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055; // 0x8cd7
    field public static final int GL_FRAMEBUFFER_UNSUPPORTED = 36061; // 0x8cdd
    field public static final int GL_FRONT = 1028; // 0x404
    field public static final int GL_FRONT_AND_BACK = 1032; // 0x408
    field public static final int GL_FRONT_FACE = 2886; // 0xb46
    field public static final int GL_FUNC_ADD = 32774; // 0x8006
    field public static final int GL_FUNC_REVERSE_SUBTRACT = 32779; // 0x800b
    field public static final int GL_FUNC_SUBTRACT = 32778; // 0x800a
    field public static final int GL_GENERATE_MIPMAP_HINT = 33170; // 0x8192
    field public static final int GL_GEQUAL = 518; // 0x206
    field public static final int GL_GREATER = 516; // 0x204
    field public static final int GL_GREEN_BITS = 3411; // 0xd53
    field public static final int GL_HIGH_FLOAT = 36338; // 0x8df2
    field public static final int GL_HIGH_INT = 36341; // 0x8df5
    field public static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT = 35739; // 0x8b9b
    field public static final int GL_IMPLEMENTATION_COLOR_READ_TYPE = 35738; // 0x8b9a
    field public static final int GL_INCR = 7682; // 0x1e02
    field public static final int GL_INCR_WRAP = 34055; // 0x8507
    field public static final int GL_INFO_LOG_LENGTH = 35716; // 0x8b84
    field public static final int GL_INT = 5124; // 0x1404
    field public static final int GL_INT_VEC2 = 35667; // 0x8b53
    field public static final int GL_INT_VEC3 = 35668; // 0x8b54
    field public static final int GL_INT_VEC4 = 35669; // 0x8b55
    field public static final int GL_INVALID_ENUM = 1280; // 0x500
    field public static final int GL_INVALID_FRAMEBUFFER_OPERATION = 1286; // 0x506
    field public static final int GL_INVALID_OPERATION = 1282; // 0x502
    field public static final int GL_INVALID_VALUE = 1281; // 0x501
    field public static final int GL_INVERT = 5386; // 0x150a
    field public static final int GL_KEEP = 7680; // 0x1e00
    field public static final int GL_LEQUAL = 515; // 0x203
    field public static final int GL_LESS = 513; // 0x201
    field public static final int GL_LINEAR = 9729; // 0x2601
    field public static final int GL_LINEAR_MIPMAP_LINEAR = 9987; // 0x2703
    field public static final int GL_LINEAR_MIPMAP_NEAREST = 9985; // 0x2701
    field public static final int GL_LINES = 1; // 0x1
    field public static final int GL_LINE_LOOP = 2; // 0x2
    field public static final int GL_LINE_STRIP = 3; // 0x3
    field public static final int GL_LINE_WIDTH = 2849; // 0xb21
    field public static final int GL_LINK_STATUS = 35714; // 0x8b82
    field public static final int GL_LOW_FLOAT = 36336; // 0x8df0
    field public static final int GL_LOW_INT = 36339; // 0x8df3
    field public static final int GL_LUMINANCE = 6409; // 0x1909
    field public static final int GL_LUMINANCE_ALPHA = 6410; // 0x190a
    field public static final int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661; // 0x8b4d
    field public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 34076; // 0x851c
    field public static final int GL_MAX_FRAGMENT_UNIFORM_VECTORS = 36349; // 0x8dfd
    field public static final int GL_MAX_RENDERBUFFER_SIZE = 34024; // 0x84e8
    field public static final int GL_MAX_TEXTURE_IMAGE_UNITS = 34930; // 0x8872
    field public static final int GL_MAX_TEXTURE_SIZE = 3379; // 0xd33
    field public static final int GL_MAX_VARYING_VECTORS = 36348; // 0x8dfc
    field public static final int GL_MAX_VERTEX_ATTRIBS = 34921; // 0x8869
    field public static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660; // 0x8b4c
    field public static final int GL_MAX_VERTEX_UNIFORM_VECTORS = 36347; // 0x8dfb
    field public static final int GL_MAX_VIEWPORT_DIMS = 3386; // 0xd3a
    field public static final int GL_MEDIUM_FLOAT = 36337; // 0x8df1
    field public static final int GL_MEDIUM_INT = 36340; // 0x8df4
    field public static final int GL_MIRRORED_REPEAT = 33648; // 0x8370
    field public static final int GL_NEAREST = 9728; // 0x2600
    field public static final int GL_NEAREST_MIPMAP_LINEAR = 9986; // 0x2702
    field public static final int GL_NEAREST_MIPMAP_NEAREST = 9984; // 0x2700
    field public static final int GL_NEVER = 512; // 0x200
    field public static final int GL_NICEST = 4354; // 0x1102
    field public static final int GL_NONE = 0; // 0x0
    field public static final int GL_NOTEQUAL = 517; // 0x205
    field public static final int GL_NO_ERROR = 0; // 0x0
    field public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 34466; // 0x86a2
    field public static final int GL_NUM_SHADER_BINARY_FORMATS = 36345; // 0x8df9
    field public static final int GL_ONE = 1; // 0x1
    field public static final int GL_ONE_MINUS_CONSTANT_ALPHA = 32772; // 0x8004
    field public static final int GL_ONE_MINUS_CONSTANT_COLOR = 32770; // 0x8002
    field public static final int GL_ONE_MINUS_DST_ALPHA = 773; // 0x305
    field public static final int GL_ONE_MINUS_DST_COLOR = 775; // 0x307
    field public static final int GL_ONE_MINUS_SRC_ALPHA = 771; // 0x303
    field public static final int GL_ONE_MINUS_SRC_COLOR = 769; // 0x301
    field public static final int GL_OUT_OF_MEMORY = 1285; // 0x505
    field public static final int GL_PACK_ALIGNMENT = 3333; // 0xd05
    field public static final int GL_POINTS = 0; // 0x0
    field public static final int GL_POLYGON_OFFSET_FACTOR = 32824; // 0x8038
    field public static final int GL_POLYGON_OFFSET_FILL = 32823; // 0x8037
    field public static final int GL_POLYGON_OFFSET_UNITS = 10752; // 0x2a00
    field public static final int GL_RED_BITS = 3410; // 0xd52
    field public static final int GL_RENDERBUFFER = 36161; // 0x8d41
    field public static final int GL_RENDERBUFFER_ALPHA_SIZE = 36179; // 0x8d53
    field public static final int GL_RENDERBUFFER_BINDING = 36007; // 0x8ca7
    field public static final int GL_RENDERBUFFER_BLUE_SIZE = 36178; // 0x8d52
    field public static final int GL_RENDERBUFFER_DEPTH_SIZE = 36180; // 0x8d54
    field public static final int GL_RENDERBUFFER_GREEN_SIZE = 36177; // 0x8d51
    field public static final int GL_RENDERBUFFER_HEIGHT = 36163; // 0x8d43
    field public static final int GL_RENDERBUFFER_INTERNAL_FORMAT = 36164; // 0x8d44
    field public static final int GL_RENDERBUFFER_RED_SIZE = 36176; // 0x8d50
    field public static final int GL_RENDERBUFFER_STENCIL_SIZE = 36181; // 0x8d55
    field public static final int GL_RENDERBUFFER_WIDTH = 36162; // 0x8d42
    field public static final int GL_RENDERER = 7937; // 0x1f01
    field public static final int GL_REPEAT = 10497; // 0x2901
    field public static final int GL_REPLACE = 7681; // 0x1e01
    field public static final int GL_RGB = 6407; // 0x1907
    field public static final int GL_RGB565 = 36194; // 0x8d62
    field public static final int GL_RGB5_A1 = 32855; // 0x8057
    field public static final int GL_RGBA = 6408; // 0x1908
    field public static final int GL_RGBA4 = 32854; // 0x8056
    field public static final int GL_SAMPLER_2D = 35678; // 0x8b5e
    field public static final int GL_SAMPLER_CUBE = 35680; // 0x8b60
    field public static final int GL_SAMPLES = 32937; // 0x80a9
    field public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 32926; // 0x809e
    field public static final int GL_SAMPLE_BUFFERS = 32936; // 0x80a8
    field public static final int GL_SAMPLE_COVERAGE = 32928; // 0x80a0
    field public static final int GL_SAMPLE_COVERAGE_INVERT = 32939; // 0x80ab
    field public static final int GL_SAMPLE_COVERAGE_VALUE = 32938; // 0x80aa
    field public static final int GL_SCISSOR_BOX = 3088; // 0xc10
    field public static final int GL_SCISSOR_TEST = 3089; // 0xc11
    field public static final int GL_SHADER_BINARY_FORMATS = 36344; // 0x8df8
    field public static final int GL_SHADER_COMPILER = 36346; // 0x8dfa
    field public static final int GL_SHADER_SOURCE_LENGTH = 35720; // 0x8b88
    field public static final int GL_SHADER_TYPE = 35663; // 0x8b4f
    field public static final int GL_SHADING_LANGUAGE_VERSION = 35724; // 0x8b8c
    field public static final int GL_SHORT = 5122; // 0x1402
    field public static final int GL_SRC_ALPHA = 770; // 0x302
    field public static final int GL_SRC_ALPHA_SATURATE = 776; // 0x308
    field public static final int GL_SRC_COLOR = 768; // 0x300
    field public static final int GL_STATIC_DRAW = 35044; // 0x88e4
    field public static final int GL_STENCIL_ATTACHMENT = 36128; // 0x8d20
    field public static final int GL_STENCIL_BACK_FAIL = 34817; // 0x8801
    field public static final int GL_STENCIL_BACK_FUNC = 34816; // 0x8800
    field public static final int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 34818; // 0x8802
    field public static final int GL_STENCIL_BACK_PASS_DEPTH_PASS = 34819; // 0x8803
    field public static final int GL_STENCIL_BACK_REF = 36003; // 0x8ca3
    field public static final int GL_STENCIL_BACK_VALUE_MASK = 36004; // 0x8ca4
    field public static final int GL_STENCIL_BACK_WRITEMASK = 36005; // 0x8ca5
    field public static final int GL_STENCIL_BITS = 3415; // 0xd57
    field public static final int GL_STENCIL_BUFFER_BIT = 1024; // 0x400
    field public static final int GL_STENCIL_CLEAR_VALUE = 2961; // 0xb91
    field public static final int GL_STENCIL_FAIL = 2964; // 0xb94
    field public static final int GL_STENCIL_FUNC = 2962; // 0xb92
    field @Deprecated public static final int GL_STENCIL_INDEX = 6401; // 0x1901
    field public static final int GL_STENCIL_INDEX8 = 36168; // 0x8d48
    field public static final int GL_STENCIL_PASS_DEPTH_FAIL = 2965; // 0xb95
    field public static final int GL_STENCIL_PASS_DEPTH_PASS = 2966; // 0xb96
    field public static final int GL_STENCIL_REF = 2967; // 0xb97
    field public static final int GL_STENCIL_TEST = 2960; // 0xb90
    field public static final int GL_STENCIL_VALUE_MASK = 2963; // 0xb93
    field public static final int GL_STENCIL_WRITEMASK = 2968; // 0xb98
    field public static final int GL_STREAM_DRAW = 35040; // 0x88e0
    field public static final int GL_SUBPIXEL_BITS = 3408; // 0xd50
    field public static final int GL_TEXTURE = 5890; // 0x1702
    field public static final int GL_TEXTURE0 = 33984; // 0x84c0
    field public static final int GL_TEXTURE1 = 33985; // 0x84c1
    field public static final int GL_TEXTURE10 = 33994; // 0x84ca
    field public static final int GL_TEXTURE11 = 33995; // 0x84cb
    field public static final int GL_TEXTURE12 = 33996; // 0x84cc
    field public static final int GL_TEXTURE13 = 33997; // 0x84cd
    field public static final int GL_TEXTURE14 = 33998; // 0x84ce
    field public static final int GL_TEXTURE15 = 33999; // 0x84cf
    field public static final int GL_TEXTURE16 = 34000; // 0x84d0
    field public static final int GL_TEXTURE17 = 34001; // 0x84d1
    field public static final int GL_TEXTURE18 = 34002; // 0x84d2
    field public static final int GL_TEXTURE19 = 34003; // 0x84d3
    field public static final int GL_TEXTURE2 = 33986; // 0x84c2
    field public static final int GL_TEXTURE20 = 34004; // 0x84d4
    field public static final int GL_TEXTURE21 = 34005; // 0x84d5
    field public static final int GL_TEXTURE22 = 34006; // 0x84d6
    field public static final int GL_TEXTURE23 = 34007; // 0x84d7
    field public static final int GL_TEXTURE24 = 34008; // 0x84d8
    field public static final int GL_TEXTURE25 = 34009; // 0x84d9
    field public static final int GL_TEXTURE26 = 34010; // 0x84da
    field public static final int GL_TEXTURE27 = 34011; // 0x84db
    field public static final int GL_TEXTURE28 = 34012; // 0x84dc
    field public static final int GL_TEXTURE29 = 34013; // 0x84dd
    field public static final int GL_TEXTURE3 = 33987; // 0x84c3
    field public static final int GL_TEXTURE30 = 34014; // 0x84de
    field public static final int GL_TEXTURE31 = 34015; // 0x84df
    field public static final int GL_TEXTURE4 = 33988; // 0x84c4
    field public static final int GL_TEXTURE5 = 33989; // 0x84c5
    field public static final int GL_TEXTURE6 = 33990; // 0x84c6
    field public static final int GL_TEXTURE7 = 33991; // 0x84c7
    field public static final int GL_TEXTURE8 = 33992; // 0x84c8
    field public static final int GL_TEXTURE9 = 33993; // 0x84c9
    field public static final int GL_TEXTURE_2D = 3553; // 0xde1
    field public static final int GL_TEXTURE_BINDING_2D = 32873; // 0x8069
    field public static final int GL_TEXTURE_BINDING_CUBE_MAP = 34068; // 0x8514
    field public static final int GL_TEXTURE_CUBE_MAP = 34067; // 0x8513
    field public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 34070; // 0x8516
    field public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072; // 0x8518
    field public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074; // 0x851a
    field public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 34069; // 0x8515
    field public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 34071; // 0x8517
    field public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 34073; // 0x8519
    field public static final int GL_TEXTURE_MAG_FILTER = 10240; // 0x2800
    field public static final int GL_TEXTURE_MIN_FILTER = 10241; // 0x2801
    field public static final int GL_TEXTURE_WRAP_S = 10242; // 0x2802
    field public static final int GL_TEXTURE_WRAP_T = 10243; // 0x2803
    field public static final int GL_TRIANGLES = 4; // 0x4
    field public static final int GL_TRIANGLE_FAN = 6; // 0x6
    field public static final int GL_TRIANGLE_STRIP = 5; // 0x5
    field public static final int GL_TRUE = 1; // 0x1
    field public static final int GL_UNPACK_ALIGNMENT = 3317; // 0xcf5
    field public static final int GL_UNSIGNED_BYTE = 5121; // 0x1401
    field public static final int GL_UNSIGNED_INT = 5125; // 0x1405
    field public static final int GL_UNSIGNED_SHORT = 5123; // 0x1403
    field public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 32819; // 0x8033
    field public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 32820; // 0x8034
    field public static final int GL_UNSIGNED_SHORT_5_6_5 = 33635; // 0x8363
    field public static final int GL_VALIDATE_STATUS = 35715; // 0x8b83
    field public static final int GL_VENDOR = 7936; // 0x1f00
    field public static final int GL_VERSION = 7938; // 0x1f02
    field public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975; // 0x889f
    field public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED = 34338; // 0x8622
    field public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922; // 0x886a
    field public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER = 34373; // 0x8645
    field public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE = 34339; // 0x8623
    field public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE = 34340; // 0x8624
    field public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE = 34341; // 0x8625
    field public static final int GL_VERTEX_SHADER = 35633; // 0x8b31
    field public static final int GL_VIEWPORT = 2978; // 0xba2
    field public static final int GL_ZERO = 0; // 0x0
  }

  public class GLES30 extends android.opengl.GLES20 {
    ctor public GLES30();
    method public static void glBeginQuery(int, int);
    method public static void glBeginTransformFeedback(int);
    method public static void glBindBufferBase(int, int, int);
    method public static void glBindBufferRange(int, int, int, int, int);
    method public static void glBindSampler(int, int);
    method public static void glBindTransformFeedback(int, int);
    method public static void glBindVertexArray(int);
    method public static void glBlitFramebuffer(int, int, int, int, int, int, int, int, int, int);
    method public static void glClearBufferfi(int, int, float, int);
    method public static void glClearBufferfv(int, int, float[], int);
    method public static void glClearBufferfv(int, int, java.nio.FloatBuffer);
    method public static void glClearBufferiv(int, int, int[], int);
    method public static void glClearBufferiv(int, int, java.nio.IntBuffer);
    method public static void glClearBufferuiv(int, int, int[], int);
    method public static void glClearBufferuiv(int, int, java.nio.IntBuffer);
    method public static int glClientWaitSync(long, int, long);
    method public static void glCompressedTexImage3D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glCompressedTexImage3D(int, int, int, int, int, int, int, int, int);
    method public static void glCompressedTexSubImage3D(int, int, int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glCompressedTexSubImage3D(int, int, int, int, int, int, int, int, int, int, int);
    method public static void glCopyBufferSubData(int, int, int, int, int);
    method public static void glCopyTexSubImage3D(int, int, int, int, int, int, int, int, int);
    method public static void glDeleteQueries(int, int[], int);
    method public static void glDeleteQueries(int, java.nio.IntBuffer);
    method public static void glDeleteSamplers(int, int[], int);
    method public static void glDeleteSamplers(int, java.nio.IntBuffer);
    method public static void glDeleteSync(long);
    method public static void glDeleteTransformFeedbacks(int, int[], int);
    method public static void glDeleteTransformFeedbacks(int, java.nio.IntBuffer);
    method public static void glDeleteVertexArrays(int, int[], int);
    method public static void glDeleteVertexArrays(int, java.nio.IntBuffer);
    method public static void glDrawArraysInstanced(int, int, int, int);
    method public static void glDrawBuffers(int, int[], int);
    method public static void glDrawBuffers(int, java.nio.IntBuffer);
    method public static void glDrawElementsInstanced(int, int, int, java.nio.Buffer, int);
    method public static void glDrawElementsInstanced(int, int, int, int, int);
    method public static void glDrawRangeElements(int, int, int, int, int, java.nio.Buffer);
    method public static void glDrawRangeElements(int, int, int, int, int, int);
    method public static void glEndQuery(int);
    method public static void glEndTransformFeedback();
    method public static long glFenceSync(int, int);
    method public static void glFlushMappedBufferRange(int, int, int);
    method public static void glFramebufferTextureLayer(int, int, int, int, int);
    method public static void glGenQueries(int, int[], int);
    method public static void glGenQueries(int, java.nio.IntBuffer);
    method public static void glGenSamplers(int, int[], int);
    method public static void glGenSamplers(int, java.nio.IntBuffer);
    method public static void glGenTransformFeedbacks(int, int[], int);
    method public static void glGenTransformFeedbacks(int, java.nio.IntBuffer);
    method public static void glGenVertexArrays(int, int[], int);
    method public static void glGenVertexArrays(int, java.nio.IntBuffer);
    method public static void glGetActiveUniformBlockName(int, int, int, int[], int, byte[], int);
    method public static void glGetActiveUniformBlockName(int, int, java.nio.Buffer, java.nio.Buffer);
    method public static String glGetActiveUniformBlockName(int, int);
    method public static void glGetActiveUniformBlockiv(int, int, int, int[], int);
    method public static void glGetActiveUniformBlockiv(int, int, int, java.nio.IntBuffer);
    method public static void glGetActiveUniformsiv(int, int, int[], int, int, int[], int);
    method public static void glGetActiveUniformsiv(int, int, java.nio.IntBuffer, int, java.nio.IntBuffer);
    method public static void glGetBufferParameteri64v(int, int, long[], int);
    method public static void glGetBufferParameteri64v(int, int, java.nio.LongBuffer);
    method public static java.nio.Buffer glGetBufferPointerv(int, int);
    method public static int glGetFragDataLocation(int, String);
    method public static void glGetInteger64i_v(int, int, long[], int);
    method public static void glGetInteger64i_v(int, int, java.nio.LongBuffer);
    method public static void glGetInteger64v(int, long[], int);
    method public static void glGetInteger64v(int, java.nio.LongBuffer);
    method public static void glGetIntegeri_v(int, int, int[], int);
    method public static void glGetIntegeri_v(int, int, java.nio.IntBuffer);
    method public static void glGetInternalformativ(int, int, int, int, int[], int);
    method public static void glGetInternalformativ(int, int, int, int, java.nio.IntBuffer);
    method public static void glGetProgramBinary(int, int, int[], int, int[], int, java.nio.Buffer);
    method public static void glGetProgramBinary(int, int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.Buffer);
    method public static void glGetQueryObjectuiv(int, int, int[], int);
    method public static void glGetQueryObjectuiv(int, int, java.nio.IntBuffer);
    method public static void glGetQueryiv(int, int, int[], int);
    method public static void glGetQueryiv(int, int, java.nio.IntBuffer);
    method public static void glGetSamplerParameterfv(int, int, float[], int);
    method public static void glGetSamplerParameterfv(int, int, java.nio.FloatBuffer);
    method public static void glGetSamplerParameteriv(int, int, int[], int);
    method public static void glGetSamplerParameteriv(int, int, java.nio.IntBuffer);
    method public static String glGetStringi(int, int);
    method public static void glGetSynciv(long, int, int, int[], int, int[], int);
    method public static void glGetSynciv(long, int, int, java.nio.IntBuffer, java.nio.IntBuffer);
    method public static void glGetTransformFeedbackVarying(int, int, int, int[], int, int[], int, int[], int, byte[], int);
    method @Deprecated public static void glGetTransformFeedbackVarying(int, int, int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, byte);
    method public static void glGetTransformFeedbackVarying(int, int, int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.ByteBuffer);
    method public static String glGetTransformFeedbackVarying(int, int, int[], int, int[], int);
    method public static String glGetTransformFeedbackVarying(int, int, java.nio.IntBuffer, java.nio.IntBuffer);
    method public static int glGetUniformBlockIndex(int, String);
    method public static void glGetUniformIndices(int, String[], int[], int);
    method public static void glGetUniformIndices(int, String[], java.nio.IntBuffer);
    method public static void glGetUniformuiv(int, int, int[], int);
    method public static void glGetUniformuiv(int, int, java.nio.IntBuffer);
    method public static void glGetVertexAttribIiv(int, int, int[], int);
    method public static void glGetVertexAttribIiv(int, int, java.nio.IntBuffer);
    method public static void glGetVertexAttribIuiv(int, int, int[], int);
    method public static void glGetVertexAttribIuiv(int, int, java.nio.IntBuffer);
    method public static void glInvalidateFramebuffer(int, int, int[], int);
    method public static void glInvalidateFramebuffer(int, int, java.nio.IntBuffer);
    method public static void glInvalidateSubFramebuffer(int, int, int[], int, int, int, int, int);
    method public static void glInvalidateSubFramebuffer(int, int, java.nio.IntBuffer, int, int, int, int);
    method public static boolean glIsQuery(int);
    method public static boolean glIsSampler(int);
    method public static boolean glIsSync(long);
    method public static boolean glIsTransformFeedback(int);
    method public static boolean glIsVertexArray(int);
    method public static java.nio.Buffer glMapBufferRange(int, int, int, int);
    method public static void glPauseTransformFeedback();
    method public static void glProgramBinary(int, int, java.nio.Buffer, int);
    method public static void glProgramParameteri(int, int, int);
    method public static void glReadBuffer(int);
    method public static void glReadPixels(int, int, int, int, int, int, int);
    method public static void glRenderbufferStorageMultisample(int, int, int, int, int);
    method public static void glResumeTransformFeedback();
    method public static void glSamplerParameterf(int, int, float);
    method public static void glSamplerParameterfv(int, int, float[], int);
    method public static void glSamplerParameterfv(int, int, java.nio.FloatBuffer);
    method public static void glSamplerParameteri(int, int, int);
    method public static void glSamplerParameteriv(int, int, int[], int);
    method public static void glSamplerParameteriv(int, int, java.nio.IntBuffer);
    method public static void glTexImage3D(int, int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glTexImage3D(int, int, int, int, int, int, int, int, int, int);
    method public static void glTexStorage2D(int, int, int, int, int);
    method public static void glTexStorage3D(int, int, int, int, int, int);
    method public static void glTexSubImage3D(int, int, int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glTexSubImage3D(int, int, int, int, int, int, int, int, int, int, int);
    method public static void glTransformFeedbackVaryings(int, String[], int);
    method public static void glUniform1ui(int, int);
    method public static void glUniform1uiv(int, int, int[], int);
    method public static void glUniform1uiv(int, int, java.nio.IntBuffer);
    method public static void glUniform2ui(int, int, int);
    method public static void glUniform2uiv(int, int, int[], int);
    method public static void glUniform2uiv(int, int, java.nio.IntBuffer);
    method public static void glUniform3ui(int, int, int, int);
    method public static void glUniform3uiv(int, int, int[], int);
    method public static void glUniform3uiv(int, int, java.nio.IntBuffer);
    method public static void glUniform4ui(int, int, int, int, int);
    method public static void glUniform4uiv(int, int, int[], int);
    method public static void glUniform4uiv(int, int, java.nio.IntBuffer);
    method public static void glUniformBlockBinding(int, int, int);
    method public static void glUniformMatrix2x3fv(int, int, boolean, float[], int);
    method public static void glUniformMatrix2x3fv(int, int, boolean, java.nio.FloatBuffer);
    method public static void glUniformMatrix2x4fv(int, int, boolean, float[], int);
    method public static void glUniformMatrix2x4fv(int, int, boolean, java.nio.FloatBuffer);
    method public static void glUniformMatrix3x2fv(int, int, boolean, float[], int);
    method public static void glUniformMatrix3x2fv(int, int, boolean, java.nio.FloatBuffer);
    method public static void glUniformMatrix3x4fv(int, int, boolean, float[], int);
    method public static void glUniformMatrix3x4fv(int, int, boolean, java.nio.FloatBuffer);
    method public static void glUniformMatrix4x2fv(int, int, boolean, float[], int);
    method public static void glUniformMatrix4x2fv(int, int, boolean, java.nio.FloatBuffer);
    method public static void glUniformMatrix4x3fv(int, int, boolean, float[], int);
    method public static void glUniformMatrix4x3fv(int, int, boolean, java.nio.FloatBuffer);
    method public static boolean glUnmapBuffer(int);
    method public static void glVertexAttribDivisor(int, int);
    method public static void glVertexAttribI4i(int, int, int, int, int);
    method public static void glVertexAttribI4iv(int, int[], int);
    method public static void glVertexAttribI4iv(int, java.nio.IntBuffer);
    method public static void glVertexAttribI4ui(int, int, int, int, int);
    method public static void glVertexAttribI4uiv(int, int[], int);
    method public static void glVertexAttribI4uiv(int, java.nio.IntBuffer);
    method public static void glVertexAttribIPointer(int, int, int, int, java.nio.Buffer);
    method public static void glVertexAttribIPointer(int, int, int, int, int);
    method public static void glWaitSync(long, int, long);
    field public static final int GL_ACTIVE_UNIFORM_BLOCKS = 35382; // 0x8a36
    field public static final int GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 35381; // 0x8a35
    field public static final int GL_ALREADY_SIGNALED = 37146; // 0x911a
    field public static final int GL_ANY_SAMPLES_PASSED = 35887; // 0x8c2f
    field public static final int GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 36202; // 0x8d6a
    field public static final int GL_BLUE = 6405; // 0x1905
    field public static final int GL_BUFFER_ACCESS_FLAGS = 37151; // 0x911f
    field public static final int GL_BUFFER_MAPPED = 35004; // 0x88bc
    field public static final int GL_BUFFER_MAP_LENGTH = 37152; // 0x9120
    field public static final int GL_BUFFER_MAP_OFFSET = 37153; // 0x9121
    field public static final int GL_BUFFER_MAP_POINTER = 35005; // 0x88bd
    field public static final int GL_COLOR = 6144; // 0x1800
    field public static final int GL_COLOR_ATTACHMENT1 = 36065; // 0x8ce1
    field public static final int GL_COLOR_ATTACHMENT10 = 36074; // 0x8cea
    field public static final int GL_COLOR_ATTACHMENT11 = 36075; // 0x8ceb
    field public static final int GL_COLOR_ATTACHMENT12 = 36076; // 0x8cec
    field public static final int GL_COLOR_ATTACHMENT13 = 36077; // 0x8ced
    field public static final int GL_COLOR_ATTACHMENT14 = 36078; // 0x8cee
    field public static final int GL_COLOR_ATTACHMENT15 = 36079; // 0x8cef
    field public static final int GL_COLOR_ATTACHMENT2 = 36066; // 0x8ce2
    field public static final int GL_COLOR_ATTACHMENT3 = 36067; // 0x8ce3
    field public static final int GL_COLOR_ATTACHMENT4 = 36068; // 0x8ce4
    field public static final int GL_COLOR_ATTACHMENT5 = 36069; // 0x8ce5
    field public static final int GL_COLOR_ATTACHMENT6 = 36070; // 0x8ce6
    field public static final int GL_COLOR_ATTACHMENT7 = 36071; // 0x8ce7
    field public static final int GL_COLOR_ATTACHMENT8 = 36072; // 0x8ce8
    field public static final int GL_COLOR_ATTACHMENT9 = 36073; // 0x8ce9
    field public static final int GL_COMPARE_REF_TO_TEXTURE = 34894; // 0x884e
    field public static final int GL_COMPRESSED_R11_EAC = 37488; // 0x9270
    field public static final int GL_COMPRESSED_RG11_EAC = 37490; // 0x9272
    field public static final int GL_COMPRESSED_RGB8_ETC2 = 37492; // 0x9274
    field public static final int GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494; // 0x9276
    field public static final int GL_COMPRESSED_RGBA8_ETC2_EAC = 37496; // 0x9278
    field public static final int GL_COMPRESSED_SIGNED_R11_EAC = 37489; // 0x9271
    field public static final int GL_COMPRESSED_SIGNED_RG11_EAC = 37491; // 0x9273
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497; // 0x9279
    field public static final int GL_COMPRESSED_SRGB8_ETC2 = 37493; // 0x9275
    field public static final int GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495; // 0x9277
    field public static final int GL_CONDITION_SATISFIED = 37148; // 0x911c
    field public static final int GL_COPY_READ_BUFFER = 36662; // 0x8f36
    field public static final int GL_COPY_READ_BUFFER_BINDING = 36662; // 0x8f36
    field public static final int GL_COPY_WRITE_BUFFER = 36663; // 0x8f37
    field public static final int GL_COPY_WRITE_BUFFER_BINDING = 36663; // 0x8f37
    field public static final int GL_CURRENT_QUERY = 34917; // 0x8865
    field public static final int GL_DEPTH = 6145; // 0x1801
    field public static final int GL_DEPTH24_STENCIL8 = 35056; // 0x88f0
    field public static final int GL_DEPTH32F_STENCIL8 = 36013; // 0x8cad
    field public static final int GL_DEPTH_COMPONENT24 = 33190; // 0x81a6
    field public static final int GL_DEPTH_COMPONENT32F = 36012; // 0x8cac
    field public static final int GL_DEPTH_STENCIL = 34041; // 0x84f9
    field public static final int GL_DEPTH_STENCIL_ATTACHMENT = 33306; // 0x821a
    field public static final int GL_DRAW_BUFFER0 = 34853; // 0x8825
    field public static final int GL_DRAW_BUFFER1 = 34854; // 0x8826
    field public static final int GL_DRAW_BUFFER10 = 34863; // 0x882f
    field public static final int GL_DRAW_BUFFER11 = 34864; // 0x8830
    field public static final int GL_DRAW_BUFFER12 = 34865; // 0x8831
    field public static final int GL_DRAW_BUFFER13 = 34866; // 0x8832
    field public static final int GL_DRAW_BUFFER14 = 34867; // 0x8833
    field public static final int GL_DRAW_BUFFER15 = 34868; // 0x8834
    field public static final int GL_DRAW_BUFFER2 = 34855; // 0x8827
    field public static final int GL_DRAW_BUFFER3 = 34856; // 0x8828
    field public static final int GL_DRAW_BUFFER4 = 34857; // 0x8829
    field public static final int GL_DRAW_BUFFER5 = 34858; // 0x882a
    field public static final int GL_DRAW_BUFFER6 = 34859; // 0x882b
    field public static final int GL_DRAW_BUFFER7 = 34860; // 0x882c
    field public static final int GL_DRAW_BUFFER8 = 34861; // 0x882d
    field public static final int GL_DRAW_BUFFER9 = 34862; // 0x882e
    field public static final int GL_DRAW_FRAMEBUFFER = 36009; // 0x8ca9
    field public static final int GL_DRAW_FRAMEBUFFER_BINDING = 36006; // 0x8ca6
    field public static final int GL_DYNAMIC_COPY = 35050; // 0x88ea
    field public static final int GL_DYNAMIC_READ = 35049; // 0x88e9
    field public static final int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 36269; // 0x8dad
    field public static final int GL_FLOAT_MAT2x3 = 35685; // 0x8b65
    field public static final int GL_FLOAT_MAT2x4 = 35686; // 0x8b66
    field public static final int GL_FLOAT_MAT3x2 = 35687; // 0x8b67
    field public static final int GL_FLOAT_MAT3x4 = 35688; // 0x8b68
    field public static final int GL_FLOAT_MAT4x2 = 35689; // 0x8b69
    field public static final int GL_FLOAT_MAT4x3 = 35690; // 0x8b6a
    field public static final int GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 35723; // 0x8b8b
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301; // 0x8215
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300; // 0x8214
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296; // 0x8210
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297; // 0x8211
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302; // 0x8216
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299; // 0x8213
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298; // 0x8212
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303; // 0x8217
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052; // 0x8cd4
    field public static final int GL_FRAMEBUFFER_DEFAULT = 33304; // 0x8218
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182; // 0x8d56
    field public static final int GL_FRAMEBUFFER_UNDEFINED = 33305; // 0x8219
    field public static final int GL_GREEN = 6404; // 0x1904
    field public static final int GL_HALF_FLOAT = 5131; // 0x140b
    field public static final int GL_INTERLEAVED_ATTRIBS = 35980; // 0x8c8c
    field public static final int GL_INT_2_10_10_10_REV = 36255; // 0x8d9f
    field public static final int GL_INT_SAMPLER_2D = 36298; // 0x8dca
    field public static final int GL_INT_SAMPLER_2D_ARRAY = 36303; // 0x8dcf
    field public static final int GL_INT_SAMPLER_3D = 36299; // 0x8dcb
    field public static final int GL_INT_SAMPLER_CUBE = 36300; // 0x8dcc
    field public static final int GL_INVALID_INDEX = -1; // 0xffffffff
    field public static final int GL_MAJOR_VERSION = 33307; // 0x821b
    field public static final int GL_MAP_FLUSH_EXPLICIT_BIT = 16; // 0x10
    field public static final int GL_MAP_INVALIDATE_BUFFER_BIT = 8; // 0x8
    field public static final int GL_MAP_INVALIDATE_RANGE_BIT = 4; // 0x4
    field public static final int GL_MAP_READ_BIT = 1; // 0x1
    field public static final int GL_MAP_UNSYNCHRONIZED_BIT = 32; // 0x20
    field public static final int GL_MAP_WRITE_BIT = 2; // 0x2
    field public static final int GL_MAX = 32776; // 0x8008
    field public static final int GL_MAX_3D_TEXTURE_SIZE = 32883; // 0x8073
    field public static final int GL_MAX_ARRAY_TEXTURE_LAYERS = 35071; // 0x88ff
    field public static final int GL_MAX_COLOR_ATTACHMENTS = 36063; // 0x8cdf
    field public static final int GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379; // 0x8a33
    field public static final int GL_MAX_COMBINED_UNIFORM_BLOCKS = 35374; // 0x8a2e
    field public static final int GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377; // 0x8a31
    field public static final int GL_MAX_DRAW_BUFFERS = 34852; // 0x8824
    field public static final int GL_MAX_ELEMENTS_INDICES = 33001; // 0x80e9
    field public static final int GL_MAX_ELEMENTS_VERTICES = 33000; // 0x80e8
    field public static final int GL_MAX_ELEMENT_INDEX = 36203; // 0x8d6b
    field public static final int GL_MAX_FRAGMENT_INPUT_COMPONENTS = 37157; // 0x9125
    field public static final int GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 35373; // 0x8a2d
    field public static final int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657; // 0x8b49
    field public static final int GL_MAX_PROGRAM_TEXEL_OFFSET = 35077; // 0x8905
    field public static final int GL_MAX_SAMPLES = 36183; // 0x8d57
    field public static final int GL_MAX_SERVER_WAIT_TIMEOUT = 37137; // 0x9111
    field public static final int GL_MAX_TEXTURE_LOD_BIAS = 34045; // 0x84fd
    field public static final int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978; // 0x8c8a
    field public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979; // 0x8c8b
    field public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968; // 0x8c80
    field public static final int GL_MAX_UNIFORM_BLOCK_SIZE = 35376; // 0x8a30
    field public static final int GL_MAX_UNIFORM_BUFFER_BINDINGS = 35375; // 0x8a2f
    field public static final int GL_MAX_VARYING_COMPONENTS = 35659; // 0x8b4b
    field public static final int GL_MAX_VERTEX_OUTPUT_COMPONENTS = 37154; // 0x9122
    field public static final int GL_MAX_VERTEX_UNIFORM_BLOCKS = 35371; // 0x8a2b
    field public static final int GL_MAX_VERTEX_UNIFORM_COMPONENTS = 35658; // 0x8b4a
    field public static final int GL_MIN = 32775; // 0x8007
    field public static final int GL_MINOR_VERSION = 33308; // 0x821c
    field public static final int GL_MIN_PROGRAM_TEXEL_OFFSET = 35076; // 0x8904
    field public static final int GL_NUM_EXTENSIONS = 33309; // 0x821d
    field public static final int GL_NUM_PROGRAM_BINARY_FORMATS = 34814; // 0x87fe
    field public static final int GL_NUM_SAMPLE_COUNTS = 37760; // 0x9380
    field public static final int GL_OBJECT_TYPE = 37138; // 0x9112
    field public static final int GL_PACK_ROW_LENGTH = 3330; // 0xd02
    field public static final int GL_PACK_SKIP_PIXELS = 3332; // 0xd04
    field public static final int GL_PACK_SKIP_ROWS = 3331; // 0xd03
    field public static final int GL_PIXEL_PACK_BUFFER = 35051; // 0x88eb
    field public static final int GL_PIXEL_PACK_BUFFER_BINDING = 35053; // 0x88ed
    field public static final int GL_PIXEL_UNPACK_BUFFER = 35052; // 0x88ec
    field public static final int GL_PIXEL_UNPACK_BUFFER_BINDING = 35055; // 0x88ef
    field public static final int GL_PRIMITIVE_RESTART_FIXED_INDEX = 36201; // 0x8d69
    field public static final int GL_PROGRAM_BINARY_FORMATS = 34815; // 0x87ff
    field public static final int GL_PROGRAM_BINARY_LENGTH = 34625; // 0x8741
    field public static final int GL_PROGRAM_BINARY_RETRIEVABLE_HINT = 33367; // 0x8257
    field public static final int GL_QUERY_RESULT = 34918; // 0x8866
    field public static final int GL_QUERY_RESULT_AVAILABLE = 34919; // 0x8867
    field public static final int GL_R11F_G11F_B10F = 35898; // 0x8c3a
    field public static final int GL_R16F = 33325; // 0x822d
    field public static final int GL_R16I = 33331; // 0x8233
    field public static final int GL_R16UI = 33332; // 0x8234
    field public static final int GL_R32F = 33326; // 0x822e
    field public static final int GL_R32I = 33333; // 0x8235
    field public static final int GL_R32UI = 33334; // 0x8236
    field public static final int GL_R8 = 33321; // 0x8229
    field public static final int GL_R8I = 33329; // 0x8231
    field public static final int GL_R8UI = 33330; // 0x8232
    field public static final int GL_R8_SNORM = 36756; // 0x8f94
    field public static final int GL_RASTERIZER_DISCARD = 35977; // 0x8c89
    field public static final int GL_READ_BUFFER = 3074; // 0xc02
    field public static final int GL_READ_FRAMEBUFFER = 36008; // 0x8ca8
    field public static final int GL_READ_FRAMEBUFFER_BINDING = 36010; // 0x8caa
    field public static final int GL_RED = 6403; // 0x1903
    field public static final int GL_RED_INTEGER = 36244; // 0x8d94
    field public static final int GL_RENDERBUFFER_SAMPLES = 36011; // 0x8cab
    field public static final int GL_RG = 33319; // 0x8227
    field public static final int GL_RG16F = 33327; // 0x822f
    field public static final int GL_RG16I = 33337; // 0x8239
    field public static final int GL_RG16UI = 33338; // 0x823a
    field public static final int GL_RG32F = 33328; // 0x8230
    field public static final int GL_RG32I = 33339; // 0x823b
    field public static final int GL_RG32UI = 33340; // 0x823c
    field public static final int GL_RG8 = 33323; // 0x822b
    field public static final int GL_RG8I = 33335; // 0x8237
    field public static final int GL_RG8UI = 33336; // 0x8238
    field public static final int GL_RG8_SNORM = 36757; // 0x8f95
    field public static final int GL_RGB10_A2 = 32857; // 0x8059
    field public static final int GL_RGB10_A2UI = 36975; // 0x906f
    field public static final int GL_RGB16F = 34843; // 0x881b
    field public static final int GL_RGB16I = 36233; // 0x8d89
    field public static final int GL_RGB16UI = 36215; // 0x8d77
    field public static final int GL_RGB32F = 34837; // 0x8815
    field public static final int GL_RGB32I = 36227; // 0x8d83
    field public static final int GL_RGB32UI = 36209; // 0x8d71
    field public static final int GL_RGB8 = 32849; // 0x8051
    field public static final int GL_RGB8I = 36239; // 0x8d8f
    field public static final int GL_RGB8UI = 36221; // 0x8d7d
    field public static final int GL_RGB8_SNORM = 36758; // 0x8f96
    field public static final int GL_RGB9_E5 = 35901; // 0x8c3d
    field public static final int GL_RGBA16F = 34842; // 0x881a
    field public static final int GL_RGBA16I = 36232; // 0x8d88
    field public static final int GL_RGBA16UI = 36214; // 0x8d76
    field public static final int GL_RGBA32F = 34836; // 0x8814
    field public static final int GL_RGBA32I = 36226; // 0x8d82
    field public static final int GL_RGBA32UI = 36208; // 0x8d70
    field public static final int GL_RGBA8 = 32856; // 0x8058
    field public static final int GL_RGBA8I = 36238; // 0x8d8e
    field public static final int GL_RGBA8UI = 36220; // 0x8d7c
    field public static final int GL_RGBA8_SNORM = 36759; // 0x8f97
    field public static final int GL_RGBA_INTEGER = 36249; // 0x8d99
    field public static final int GL_RGB_INTEGER = 36248; // 0x8d98
    field public static final int GL_RG_INTEGER = 33320; // 0x8228
    field public static final int GL_SAMPLER_2D_ARRAY = 36289; // 0x8dc1
    field public static final int GL_SAMPLER_2D_ARRAY_SHADOW = 36292; // 0x8dc4
    field public static final int GL_SAMPLER_2D_SHADOW = 35682; // 0x8b62
    field public static final int GL_SAMPLER_3D = 35679; // 0x8b5f
    field public static final int GL_SAMPLER_BINDING = 35097; // 0x8919
    field public static final int GL_SAMPLER_CUBE_SHADOW = 36293; // 0x8dc5
    field public static final int GL_SEPARATE_ATTRIBS = 35981; // 0x8c8d
    field public static final int GL_SIGNALED = 37145; // 0x9119
    field public static final int GL_SIGNED_NORMALIZED = 36764; // 0x8f9c
    field public static final int GL_SRGB = 35904; // 0x8c40
    field public static final int GL_SRGB8 = 35905; // 0x8c41
    field public static final int GL_SRGB8_ALPHA8 = 35907; // 0x8c43
    field public static final int GL_STATIC_COPY = 35046; // 0x88e6
    field public static final int GL_STATIC_READ = 35045; // 0x88e5
    field public static final int GL_STENCIL = 6146; // 0x1802
    field public static final int GL_STREAM_COPY = 35042; // 0x88e2
    field public static final int GL_STREAM_READ = 35041; // 0x88e1
    field public static final int GL_SYNC_CONDITION = 37139; // 0x9113
    field public static final int GL_SYNC_FENCE = 37142; // 0x9116
    field public static final int GL_SYNC_FLAGS = 37141; // 0x9115
    field public static final int GL_SYNC_FLUSH_COMMANDS_BIT = 1; // 0x1
    field public static final int GL_SYNC_GPU_COMMANDS_COMPLETE = 37143; // 0x9117
    field public static final int GL_SYNC_STATUS = 37140; // 0x9114
    field public static final int GL_TEXTURE_2D_ARRAY = 35866; // 0x8c1a
    field public static final int GL_TEXTURE_3D = 32879; // 0x806f
    field public static final int GL_TEXTURE_BASE_LEVEL = 33084; // 0x813c
    field public static final int GL_TEXTURE_BINDING_2D_ARRAY = 35869; // 0x8c1d
    field public static final int GL_TEXTURE_BINDING_3D = 32874; // 0x806a
    field public static final int GL_TEXTURE_COMPARE_FUNC = 34893; // 0x884d
    field public static final int GL_TEXTURE_COMPARE_MODE = 34892; // 0x884c
    field public static final int GL_TEXTURE_IMMUTABLE_FORMAT = 37167; // 0x912f
    field public static final int GL_TEXTURE_IMMUTABLE_LEVELS = 33503; // 0x82df
    field public static final int GL_TEXTURE_MAX_LEVEL = 33085; // 0x813d
    field public static final int GL_TEXTURE_MAX_LOD = 33083; // 0x813b
    field public static final int GL_TEXTURE_MIN_LOD = 33082; // 0x813a
    field public static final int GL_TEXTURE_SWIZZLE_A = 36421; // 0x8e45
    field public static final int GL_TEXTURE_SWIZZLE_B = 36420; // 0x8e44
    field public static final int GL_TEXTURE_SWIZZLE_G = 36419; // 0x8e43
    field public static final int GL_TEXTURE_SWIZZLE_R = 36418; // 0x8e42
    field public static final int GL_TEXTURE_WRAP_R = 32882; // 0x8072
    field public static final int GL_TIMEOUT_EXPIRED = 37147; // 0x911b
    field public static final long GL_TIMEOUT_IGNORED = -1L; // 0xffffffffffffffffL
    field public static final int GL_TRANSFORM_FEEDBACK = 36386; // 0x8e22
    field public static final int GL_TRANSFORM_FEEDBACK_ACTIVE = 36388; // 0x8e24
    field public static final int GL_TRANSFORM_FEEDBACK_BINDING = 36389; // 0x8e25
    field public static final int GL_TRANSFORM_FEEDBACK_BUFFER = 35982; // 0x8c8e
    field public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983; // 0x8c8f
    field public static final int GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 35967; // 0x8c7f
    field public static final int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973; // 0x8c85
    field public static final int GL_TRANSFORM_FEEDBACK_BUFFER_START = 35972; // 0x8c84
    field public static final int GL_TRANSFORM_FEEDBACK_PAUSED = 36387; // 0x8e23
    field public static final int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976; // 0x8c88
    field public static final int GL_TRANSFORM_FEEDBACK_VARYINGS = 35971; // 0x8c83
    field public static final int GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 35958; // 0x8c76
    field public static final int GL_UNIFORM_ARRAY_STRIDE = 35388; // 0x8a3c
    field public static final int GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394; // 0x8a42
    field public static final int GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395; // 0x8a43
    field public static final int GL_UNIFORM_BLOCK_BINDING = 35391; // 0x8a3f
    field public static final int GL_UNIFORM_BLOCK_DATA_SIZE = 35392; // 0x8a40
    field public static final int GL_UNIFORM_BLOCK_INDEX = 35386; // 0x8a3a
    field public static final int GL_UNIFORM_BLOCK_NAME_LENGTH = 35393; // 0x8a41
    field public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398; // 0x8a46
    field public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396; // 0x8a44
    field public static final int GL_UNIFORM_BUFFER = 35345; // 0x8a11
    field public static final int GL_UNIFORM_BUFFER_BINDING = 35368; // 0x8a28
    field public static final int GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380; // 0x8a34
    field public static final int GL_UNIFORM_BUFFER_SIZE = 35370; // 0x8a2a
    field public static final int GL_UNIFORM_BUFFER_START = 35369; // 0x8a29
    field public static final int GL_UNIFORM_IS_ROW_MAJOR = 35390; // 0x8a3e
    field public static final int GL_UNIFORM_MATRIX_STRIDE = 35389; // 0x8a3d
    field public static final int GL_UNIFORM_NAME_LENGTH = 35385; // 0x8a39
    field public static final int GL_UNIFORM_OFFSET = 35387; // 0x8a3b
    field public static final int GL_UNIFORM_SIZE = 35384; // 0x8a38
    field public static final int GL_UNIFORM_TYPE = 35383; // 0x8a37
    field public static final int GL_UNPACK_IMAGE_HEIGHT = 32878; // 0x806e
    field public static final int GL_UNPACK_ROW_LENGTH = 3314; // 0xcf2
    field public static final int GL_UNPACK_SKIP_IMAGES = 32877; // 0x806d
    field public static final int GL_UNPACK_SKIP_PIXELS = 3316; // 0xcf4
    field public static final int GL_UNPACK_SKIP_ROWS = 3315; // 0xcf3
    field public static final int GL_UNSIGNALED = 37144; // 0x9118
    field public static final int GL_UNSIGNED_INT_10F_11F_11F_REV = 35899; // 0x8c3b
    field public static final int GL_UNSIGNED_INT_24_8 = 34042; // 0x84fa
    field public static final int GL_UNSIGNED_INT_2_10_10_10_REV = 33640; // 0x8368
    field public static final int GL_UNSIGNED_INT_5_9_9_9_REV = 35902; // 0x8c3e
    field public static final int GL_UNSIGNED_INT_SAMPLER_2D = 36306; // 0x8dd2
    field public static final int GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311; // 0x8dd7
    field public static final int GL_UNSIGNED_INT_SAMPLER_3D = 36307; // 0x8dd3
    field public static final int GL_UNSIGNED_INT_SAMPLER_CUBE = 36308; // 0x8dd4
    field public static final int GL_UNSIGNED_INT_VEC2 = 36294; // 0x8dc6
    field public static final int GL_UNSIGNED_INT_VEC3 = 36295; // 0x8dc7
    field public static final int GL_UNSIGNED_INT_VEC4 = 36296; // 0x8dc8
    field public static final int GL_UNSIGNED_NORMALIZED = 35863; // 0x8c17
    field public static final int GL_VERTEX_ARRAY_BINDING = 34229; // 0x85b5
    field public static final int GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 35070; // 0x88fe
    field public static final int GL_VERTEX_ATTRIB_ARRAY_INTEGER = 35069; // 0x88fd
    field public static final int GL_WAIT_FAILED = 37149; // 0x911d
  }

  public class GLES31 extends android.opengl.GLES30 {
    method public static void glActiveShaderProgram(int, int);
    method public static void glBindImageTexture(int, int, int, boolean, int, int, int);
    method public static void glBindProgramPipeline(int);
    method public static void glBindVertexBuffer(int, int, long, int);
    method public static int glCreateShaderProgramv(int, String[]);
    method public static void glDeleteProgramPipelines(int, int[], int);
    method public static void glDeleteProgramPipelines(int, java.nio.IntBuffer);
    method public static void glDispatchCompute(int, int, int);
    method public static void glDispatchComputeIndirect(long);
    method public static void glDrawArraysIndirect(int, long);
    method public static void glDrawElementsIndirect(int, int, long);
    method public static void glFramebufferParameteri(int, int, int);
    method public static void glGenProgramPipelines(int, int[], int);
    method public static void glGenProgramPipelines(int, java.nio.IntBuffer);
    method public static void glGetBooleani_v(int, int, boolean[], int);
    method public static void glGetBooleani_v(int, int, java.nio.IntBuffer);
    method public static void glGetFramebufferParameteriv(int, int, int[], int);
    method public static void glGetFramebufferParameteriv(int, int, java.nio.IntBuffer);
    method public static void glGetMultisamplefv(int, int, float[], int);
    method public static void glGetMultisamplefv(int, int, java.nio.FloatBuffer);
    method public static void glGetProgramInterfaceiv(int, int, int, int[], int);
    method public static void glGetProgramInterfaceiv(int, int, int, java.nio.IntBuffer);
    method public static String glGetProgramPipelineInfoLog(int);
    method public static void glGetProgramPipelineiv(int, int, int[], int);
    method public static void glGetProgramPipelineiv(int, int, java.nio.IntBuffer);
    method public static int glGetProgramResourceIndex(int, int, String);
    method public static int glGetProgramResourceLocation(int, int, String);
    method public static String glGetProgramResourceName(int, int, int);
    method public static void glGetProgramResourceiv(int, int, int, int, int[], int, int, int[], int, int[], int);
    method public static void glGetProgramResourceiv(int, int, int, int, java.nio.IntBuffer, int, java.nio.IntBuffer, java.nio.IntBuffer);
    method public static void glGetTexLevelParameterfv(int, int, int, float[], int);
    method public static void glGetTexLevelParameterfv(int, int, int, java.nio.FloatBuffer);
    method public static void glGetTexLevelParameteriv(int, int, int, int[], int);
    method public static void glGetTexLevelParameteriv(int, int, int, java.nio.IntBuffer);
    method public static boolean glIsProgramPipeline(int);
    method public static void glMemoryBarrier(int);
    method public static void glMemoryBarrierByRegion(int);
    method public static void glProgramUniform1f(int, int, float);
    method public static void glProgramUniform1fv(int, int, int, float[], int);
    method public static void glProgramUniform1fv(int, int, int, java.nio.FloatBuffer);
    method public static void glProgramUniform1i(int, int, int);
    method public static void glProgramUniform1iv(int, int, int, int[], int);
    method public static void glProgramUniform1iv(int, int, int, java.nio.IntBuffer);
    method public static void glProgramUniform1ui(int, int, int);
    method public static void glProgramUniform1uiv(int, int, int, int[], int);
    method public static void glProgramUniform1uiv(int, int, int, java.nio.IntBuffer);
    method public static void glProgramUniform2f(int, int, float, float);
    method public static void glProgramUniform2fv(int, int, int, float[], int);
    method public static void glProgramUniform2fv(int, int, int, java.nio.FloatBuffer);
    method public static void glProgramUniform2i(int, int, int, int);
    method public static void glProgramUniform2iv(int, int, int, int[], int);
    method public static void glProgramUniform2iv(int, int, int, java.nio.IntBuffer);
    method public static void glProgramUniform2ui(int, int, int, int);
    method public static void glProgramUniform2uiv(int, int, int, int[], int);
    method public static void glProgramUniform2uiv(int, int, int, java.nio.IntBuffer);
    method public static void glProgramUniform3f(int, int, float, float, float);
    method public static void glProgramUniform3fv(int, int, int, float[], int);
    method public static void glProgramUniform3fv(int, int, int, java.nio.FloatBuffer);
    method public static void glProgramUniform3i(int, int, int, int, int);
    method public static void glProgramUniform3iv(int, int, int, int[], int);
    method public static void glProgramUniform3iv(int, int, int, java.nio.IntBuffer);
    method public static void glProgramUniform3ui(int, int, int, int, int);
    method public static void glProgramUniform3uiv(int, int, int, int[], int);
    method public static void glProgramUniform3uiv(int, int, int, java.nio.IntBuffer);
    method public static void glProgramUniform4f(int, int, float, float, float, float);
    method public static void glProgramUniform4fv(int, int, int, float[], int);
    method public static void glProgramUniform4fv(int, int, int, java.nio.FloatBuffer);
    method public static void glProgramUniform4i(int, int, int, int, int, int);
    method public static void glProgramUniform4iv(int, int, int, int[], int);
    method public static void glProgramUniform4iv(int, int, int, java.nio.IntBuffer);
    method public static void glProgramUniform4ui(int, int, int, int, int, int);
    method public static void glProgramUniform4uiv(int, int, int, int[], int);
    method public static void glProgramUniform4uiv(int, int, int, java.nio.IntBuffer);
    method public static void glProgramUniformMatrix2fv(int, int, int, boolean, float[], int);
    method public static void glProgramUniformMatrix2fv(int, int, int, boolean, java.nio.FloatBuffer);
    method public static void glProgramUniformMatrix2x3fv(int, int, int, boolean, float[], int);
    method public static void glProgramUniformMatrix2x3fv(int, int, int, boolean, java.nio.FloatBuffer);
    method public static void glProgramUniformMatrix2x4fv(int, int, int, boolean, float[], int);
    method public static void glProgramUniformMatrix2x4fv(int, int, int, boolean, java.nio.FloatBuffer);
    method public static void glProgramUniformMatrix3fv(int, int, int, boolean, float[], int);
    method public static void glProgramUniformMatrix3fv(int, int, int, boolean, java.nio.FloatBuffer);
    method public static void glProgramUniformMatrix3x2fv(int, int, int, boolean, float[], int);
    method public static void glProgramUniformMatrix3x2fv(int, int, int, boolean, java.nio.FloatBuffer);
    method public static void glProgramUniformMatrix3x4fv(int, int, int, boolean, float[], int);
    method public static void glProgramUniformMatrix3x4fv(int, int, int, boolean, java.nio.FloatBuffer);
    method public static void glProgramUniformMatrix4fv(int, int, int, boolean, float[], int);
    method public static void glProgramUniformMatrix4fv(int, int, int, boolean, java.nio.FloatBuffer);
    method public static void glProgramUniformMatrix4x2fv(int, int, int, boolean, float[], int);
    method public static void glProgramUniformMatrix4x2fv(int, int, int, boolean, java.nio.FloatBuffer);
    method public static void glProgramUniformMatrix4x3fv(int, int, int, boolean, float[], int);
    method public static void glProgramUniformMatrix4x3fv(int, int, int, boolean, java.nio.FloatBuffer);
    method public static void glSampleMaski(int, int);
    method public static void glTexStorage2DMultisample(int, int, int, int, int, boolean);
    method public static void glUseProgramStages(int, int, int);
    method public static void glValidateProgramPipeline(int);
    method public static void glVertexAttribBinding(int, int);
    method public static void glVertexAttribFormat(int, int, int, boolean, int);
    method public static void glVertexAttribIFormat(int, int, int, int);
    method public static void glVertexBindingDivisor(int, int);
    field public static final int GL_ACTIVE_ATOMIC_COUNTER_BUFFERS = 37593; // 0x92d9
    field public static final int GL_ACTIVE_PROGRAM = 33369; // 0x8259
    field public static final int GL_ACTIVE_RESOURCES = 37621; // 0x92f5
    field public static final int GL_ACTIVE_VARIABLES = 37637; // 0x9305
    field public static final int GL_ALL_BARRIER_BITS = -1; // 0xffffffff
    field public static final int GL_ALL_SHADER_BITS = -1; // 0xffffffff
    field public static final int GL_ARRAY_SIZE = 37627; // 0x92fb
    field public static final int GL_ARRAY_STRIDE = 37630; // 0x92fe
    field public static final int GL_ATOMIC_COUNTER_BARRIER_BIT = 4096; // 0x1000
    field public static final int GL_ATOMIC_COUNTER_BUFFER = 37568; // 0x92c0
    field public static final int GL_ATOMIC_COUNTER_BUFFER_BINDING = 37569; // 0x92c1
    field public static final int GL_ATOMIC_COUNTER_BUFFER_INDEX = 37633; // 0x9301
    field public static final int GL_ATOMIC_COUNTER_BUFFER_SIZE = 37571; // 0x92c3
    field public static final int GL_ATOMIC_COUNTER_BUFFER_START = 37570; // 0x92c2
    field public static final int GL_BLOCK_INDEX = 37629; // 0x92fd
    field public static final int GL_BUFFER_BINDING = 37634; // 0x9302
    field public static final int GL_BUFFER_DATA_SIZE = 37635; // 0x9303
    field public static final int GL_BUFFER_UPDATE_BARRIER_BIT = 512; // 0x200
    field public static final int GL_BUFFER_VARIABLE = 37605; // 0x92e5
    field public static final int GL_COMMAND_BARRIER_BIT = 64; // 0x40
    field public static final int GL_COMPUTE_SHADER = 37305; // 0x91b9
    field public static final int GL_COMPUTE_SHADER_BIT = 32; // 0x20
    field public static final int GL_COMPUTE_WORK_GROUP_SIZE = 33383; // 0x8267
    field public static final int GL_DEPTH_STENCIL_TEXTURE_MODE = 37098; // 0x90ea
    field public static final int GL_DISPATCH_INDIRECT_BUFFER = 37102; // 0x90ee
    field public static final int GL_DISPATCH_INDIRECT_BUFFER_BINDING = 37103; // 0x90ef
    field public static final int GL_DRAW_INDIRECT_BUFFER = 36671; // 0x8f3f
    field public static final int GL_DRAW_INDIRECT_BUFFER_BINDING = 36675; // 0x8f43
    field public static final int GL_ELEMENT_ARRAY_BARRIER_BIT = 2; // 0x2
    field public static final int GL_FRAGMENT_SHADER_BIT = 2; // 0x2
    field public static final int GL_FRAMEBUFFER_BARRIER_BIT = 1024; // 0x400
    field public static final int GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 37652; // 0x9314
    field public static final int GL_FRAMEBUFFER_DEFAULT_HEIGHT = 37649; // 0x9311
    field public static final int GL_FRAMEBUFFER_DEFAULT_SAMPLES = 37651; // 0x9313
    field public static final int GL_FRAMEBUFFER_DEFAULT_WIDTH = 37648; // 0x9310
    field public static final int GL_IMAGE_2D = 36941; // 0x904d
    field public static final int GL_IMAGE_2D_ARRAY = 36947; // 0x9053
    field public static final int GL_IMAGE_3D = 36942; // 0x904e
    field public static final int GL_IMAGE_BINDING_ACCESS = 36670; // 0x8f3e
    field public static final int GL_IMAGE_BINDING_FORMAT = 36974; // 0x906e
    field public static final int GL_IMAGE_BINDING_LAYER = 36669; // 0x8f3d
    field public static final int GL_IMAGE_BINDING_LAYERED = 36668; // 0x8f3c
    field public static final int GL_IMAGE_BINDING_LEVEL = 36667; // 0x8f3b
    field public static final int GL_IMAGE_BINDING_NAME = 36666; // 0x8f3a
    field public static final int GL_IMAGE_CUBE = 36944; // 0x9050
    field public static final int GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 37065; // 0x90c9
    field public static final int GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 37064; // 0x90c8
    field public static final int GL_IMAGE_FORMAT_COMPATIBILITY_TYPE = 37063; // 0x90c7
    field public static final int GL_INT_IMAGE_2D = 36952; // 0x9058
    field public static final int GL_INT_IMAGE_2D_ARRAY = 36958; // 0x905e
    field public static final int GL_INT_IMAGE_3D = 36953; // 0x9059
    field public static final int GL_INT_IMAGE_CUBE = 36955; // 0x905b
    field public static final int GL_INT_SAMPLER_2D_MULTISAMPLE = 37129; // 0x9109
    field public static final int GL_IS_ROW_MAJOR = 37632; // 0x9300
    field public static final int GL_LOCATION = 37646; // 0x930e
    field public static final int GL_MATRIX_STRIDE = 37631; // 0x92ff
    field public static final int GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 37596; // 0x92dc
    field public static final int GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE = 37592; // 0x92d8
    field public static final int GL_MAX_COLOR_TEXTURE_SAMPLES = 37134; // 0x910e
    field public static final int GL_MAX_COMBINED_ATOMIC_COUNTERS = 37591; // 0x92d7
    field public static final int GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 37585; // 0x92d1
    field public static final int GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 33382; // 0x8266
    field public static final int GL_MAX_COMBINED_IMAGE_UNIFORMS = 37071; // 0x90cf
    field public static final int GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 36665; // 0x8f39
    field public static final int GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS = 37084; // 0x90dc
    field public static final int GL_MAX_COMPUTE_ATOMIC_COUNTERS = 33381; // 0x8265
    field public static final int GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 33380; // 0x8264
    field public static final int GL_MAX_COMPUTE_IMAGE_UNIFORMS = 37309; // 0x91bd
    field public static final int GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 37083; // 0x90db
    field public static final int GL_MAX_COMPUTE_SHARED_MEMORY_SIZE = 33378; // 0x8262
    field public static final int GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 37308; // 0x91bc
    field public static final int GL_MAX_COMPUTE_UNIFORM_BLOCKS = 37307; // 0x91bb
    field public static final int GL_MAX_COMPUTE_UNIFORM_COMPONENTS = 33379; // 0x8263
    field public static final int GL_MAX_COMPUTE_WORK_GROUP_COUNT = 37310; // 0x91be
    field public static final int GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 37099; // 0x90eb
    field public static final int GL_MAX_COMPUTE_WORK_GROUP_SIZE = 37311; // 0x91bf
    field public static final int GL_MAX_DEPTH_TEXTURE_SAMPLES = 37135; // 0x910f
    field public static final int GL_MAX_FRAGMENT_ATOMIC_COUNTERS = 37590; // 0x92d6
    field public static final int GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 37584; // 0x92d0
    field public static final int GL_MAX_FRAGMENT_IMAGE_UNIFORMS = 37070; // 0x90ce
    field public static final int GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 37082; // 0x90da
    field public static final int GL_MAX_FRAMEBUFFER_HEIGHT = 37654; // 0x9316
    field public static final int GL_MAX_FRAMEBUFFER_SAMPLES = 37656; // 0x9318
    field public static final int GL_MAX_FRAMEBUFFER_WIDTH = 37653; // 0x9315
    field public static final int GL_MAX_IMAGE_UNITS = 36664; // 0x8f38
    field public static final int GL_MAX_INTEGER_SAMPLES = 37136; // 0x9110
    field public static final int GL_MAX_NAME_LENGTH = 37622; // 0x92f6
    field public static final int GL_MAX_NUM_ACTIVE_VARIABLES = 37623; // 0x92f7
    field public static final int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 36447; // 0x8e5f
    field public static final int GL_MAX_SAMPLE_MASK_WORDS = 36441; // 0x8e59
    field public static final int GL_MAX_SHADER_STORAGE_BLOCK_SIZE = 37086; // 0x90de
    field public static final int GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS = 37085; // 0x90dd
    field public static final int GL_MAX_UNIFORM_LOCATIONS = 33390; // 0x826e
    field public static final int GL_MAX_VERTEX_ATOMIC_COUNTERS = 37586; // 0x92d2
    field public static final int GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 37580; // 0x92cc
    field public static final int GL_MAX_VERTEX_ATTRIB_BINDINGS = 33498; // 0x82da
    field public static final int GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 33497; // 0x82d9
    field public static final int GL_MAX_VERTEX_ATTRIB_STRIDE = 33509; // 0x82e5
    field public static final int GL_MAX_VERTEX_IMAGE_UNIFORMS = 37066; // 0x90ca
    field public static final int GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS = 37078; // 0x90d6
    field public static final int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 36446; // 0x8e5e
    field public static final int GL_NAME_LENGTH = 37625; // 0x92f9
    field public static final int GL_NUM_ACTIVE_VARIABLES = 37636; // 0x9304
    field public static final int GL_OFFSET = 37628; // 0x92fc
    field public static final int GL_PIXEL_BUFFER_BARRIER_BIT = 128; // 0x80
    field public static final int GL_PROGRAM_INPUT = 37603; // 0x92e3
    field public static final int GL_PROGRAM_OUTPUT = 37604; // 0x92e4
    field public static final int GL_PROGRAM_PIPELINE_BINDING = 33370; // 0x825a
    field public static final int GL_PROGRAM_SEPARABLE = 33368; // 0x8258
    field public static final int GL_READ_ONLY = 35000; // 0x88b8
    field public static final int GL_READ_WRITE = 35002; // 0x88ba
    field public static final int GL_REFERENCED_BY_COMPUTE_SHADER = 37643; // 0x930b
    field public static final int GL_REFERENCED_BY_FRAGMENT_SHADER = 37642; // 0x930a
    field public static final int GL_REFERENCED_BY_VERTEX_SHADER = 37638; // 0x9306
    field public static final int GL_SAMPLER_2D_MULTISAMPLE = 37128; // 0x9108
    field public static final int GL_SAMPLE_MASK = 36433; // 0x8e51
    field public static final int GL_SAMPLE_MASK_VALUE = 36434; // 0x8e52
    field public static final int GL_SAMPLE_POSITION = 36432; // 0x8e50
    field public static final int GL_SHADER_IMAGE_ACCESS_BARRIER_BIT = 32; // 0x20
    field public static final int GL_SHADER_STORAGE_BARRIER_BIT = 8192; // 0x2000
    field public static final int GL_SHADER_STORAGE_BLOCK = 37606; // 0x92e6
    field public static final int GL_SHADER_STORAGE_BUFFER = 37074; // 0x90d2
    field public static final int GL_SHADER_STORAGE_BUFFER_BINDING = 37075; // 0x90d3
    field public static final int GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 37087; // 0x90df
    field public static final int GL_SHADER_STORAGE_BUFFER_SIZE = 37077; // 0x90d5
    field public static final int GL_SHADER_STORAGE_BUFFER_START = 37076; // 0x90d4
    field public static final int GL_STENCIL_INDEX = 6401; // 0x1901
    field public static final int GL_TEXTURE_2D_MULTISAMPLE = 37120; // 0x9100
    field public static final int GL_TEXTURE_ALPHA_SIZE = 32863; // 0x805f
    field public static final int GL_TEXTURE_ALPHA_TYPE = 35859; // 0x8c13
    field public static final int GL_TEXTURE_BINDING_2D_MULTISAMPLE = 37124; // 0x9104
    field public static final int GL_TEXTURE_BLUE_SIZE = 32862; // 0x805e
    field public static final int GL_TEXTURE_BLUE_TYPE = 35858; // 0x8c12
    field public static final int GL_TEXTURE_COMPRESSED = 34465; // 0x86a1
    field public static final int GL_TEXTURE_DEPTH = 32881; // 0x8071
    field public static final int GL_TEXTURE_DEPTH_SIZE = 34890; // 0x884a
    field public static final int GL_TEXTURE_DEPTH_TYPE = 35862; // 0x8c16
    field public static final int GL_TEXTURE_FETCH_BARRIER_BIT = 8; // 0x8
    field public static final int GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 37127; // 0x9107
    field public static final int GL_TEXTURE_GREEN_SIZE = 32861; // 0x805d
    field public static final int GL_TEXTURE_GREEN_TYPE = 35857; // 0x8c11
    field public static final int GL_TEXTURE_HEIGHT = 4097; // 0x1001
    field public static final int GL_TEXTURE_INTERNAL_FORMAT = 4099; // 0x1003
    field public static final int GL_TEXTURE_RED_SIZE = 32860; // 0x805c
    field public static final int GL_TEXTURE_RED_TYPE = 35856; // 0x8c10
    field public static final int GL_TEXTURE_SAMPLES = 37126; // 0x9106
    field public static final int GL_TEXTURE_SHARED_SIZE = 35903; // 0x8c3f
    field public static final int GL_TEXTURE_STENCIL_SIZE = 35057; // 0x88f1
    field public static final int GL_TEXTURE_UPDATE_BARRIER_BIT = 256; // 0x100
    field public static final int GL_TEXTURE_WIDTH = 4096; // 0x1000
    field public static final int GL_TOP_LEVEL_ARRAY_SIZE = 37644; // 0x930c
    field public static final int GL_TOP_LEVEL_ARRAY_STRIDE = 37645; // 0x930d
    field public static final int GL_TRANSFORM_FEEDBACK_BARRIER_BIT = 2048; // 0x800
    field public static final int GL_TRANSFORM_FEEDBACK_VARYING = 37620; // 0x92f4
    field public static final int GL_TYPE = 37626; // 0x92fa
    field public static final int GL_UNIFORM = 37601; // 0x92e1
    field public static final int GL_UNIFORM_BARRIER_BIT = 4; // 0x4
    field public static final int GL_UNIFORM_BLOCK = 37602; // 0x92e2
    field public static final int GL_UNSIGNED_INT_ATOMIC_COUNTER = 37595; // 0x92db
    field public static final int GL_UNSIGNED_INT_IMAGE_2D = 36963; // 0x9063
    field public static final int GL_UNSIGNED_INT_IMAGE_2D_ARRAY = 36969; // 0x9069
    field public static final int GL_UNSIGNED_INT_IMAGE_3D = 36964; // 0x9064
    field public static final int GL_UNSIGNED_INT_IMAGE_CUBE = 36966; // 0x9066
    field public static final int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 37130; // 0x910a
    field public static final int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 1; // 0x1
    field public static final int GL_VERTEX_ATTRIB_BINDING = 33492; // 0x82d4
    field public static final int GL_VERTEX_ATTRIB_RELATIVE_OFFSET = 33493; // 0x82d5
    field public static final int GL_VERTEX_BINDING_BUFFER = 36687; // 0x8f4f
    field public static final int GL_VERTEX_BINDING_DIVISOR = 33494; // 0x82d6
    field public static final int GL_VERTEX_BINDING_OFFSET = 33495; // 0x82d7
    field public static final int GL_VERTEX_BINDING_STRIDE = 33496; // 0x82d8
    field public static final int GL_VERTEX_SHADER_BIT = 1; // 0x1
    field public static final int GL_WRITE_ONLY = 35001; // 0x88b9
  }

  public class GLES31Ext {
    method public static void glBlendBarrierKHR();
    method public static void glBlendEquationSeparateiEXT(int, int, int);
    method public static void glBlendEquationiEXT(int, int);
    method public static void glBlendFuncSeparateiEXT(int, int, int, int, int);
    method public static void glBlendFunciEXT(int, int, int);
    method public static void glColorMaskiEXT(int, boolean, boolean, boolean, boolean);
    method public static void glCopyImageSubDataEXT(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int);
    method public static void glDebugMessageCallbackKHR(android.opengl.GLES31Ext.DebugProcKHR);
    method public static void glDebugMessageControlKHR(int, int, int, int, int[], int, boolean);
    method public static void glDebugMessageControlKHR(int, int, int, int, java.nio.IntBuffer, boolean);
    method public static void glDebugMessageInsertKHR(int, int, int, int, String);
    method public static void glDisableiEXT(int, int);
    method public static void glEnableiEXT(int, int);
    method public static void glFramebufferTextureEXT(int, int, int, int);
    method public static android.opengl.GLES31Ext.DebugProcKHR glGetDebugMessageCallbackKHR();
    method public static int glGetDebugMessageLogKHR(int, int, int[], int, int[], int, int[], int, int[], int, int[], int, byte[], int);
    method public static int glGetDebugMessageLogKHR(int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.ByteBuffer);
    method public static String[] glGetDebugMessageLogKHR(int, int[], int, int[], int, int[], int, int[], int);
    method public static String[] glGetDebugMessageLogKHR(int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer);
    method public static String glGetObjectLabelKHR(int, int);
    method public static String glGetObjectPtrLabelKHR(long);
    method public static void glGetSamplerParameterIivEXT(int, int, int[], int);
    method public static void glGetSamplerParameterIivEXT(int, int, java.nio.IntBuffer);
    method public static void glGetSamplerParameterIuivEXT(int, int, int[], int);
    method public static void glGetSamplerParameterIuivEXT(int, int, java.nio.IntBuffer);
    method public static void glGetTexParameterIivEXT(int, int, int[], int);
    method public static void glGetTexParameterIivEXT(int, int, java.nio.IntBuffer);
    method public static void glGetTexParameterIuivEXT(int, int, int[], int);
    method public static void glGetTexParameterIuivEXT(int, int, java.nio.IntBuffer);
    method public static boolean glIsEnablediEXT(int, int);
    method public static void glMinSampleShadingOES(float);
    method public static void glObjectLabelKHR(int, int, int, String);
    method public static void glObjectPtrLabelKHR(long, String);
    method public static void glPatchParameteriEXT(int, int);
    method public static void glPopDebugGroupKHR();
    method public static void glPrimitiveBoundingBoxEXT(float, float, float, float, float, float, float, float);
    method public static void glPushDebugGroupKHR(int, int, int, String);
    method public static void glSamplerParameterIivEXT(int, int, int[], int);
    method public static void glSamplerParameterIivEXT(int, int, java.nio.IntBuffer);
    method public static void glSamplerParameterIuivEXT(int, int, int[], int);
    method public static void glSamplerParameterIuivEXT(int, int, java.nio.IntBuffer);
    method public static void glTexBufferEXT(int, int, int);
    method public static void glTexBufferRangeEXT(int, int, int, int, int);
    method public static void glTexParameterIivEXT(int, int, int[], int);
    method public static void glTexParameterIivEXT(int, int, java.nio.IntBuffer);
    method public static void glTexParameterIuivEXT(int, int, int[], int);
    method public static void glTexParameterIuivEXT(int, int, java.nio.IntBuffer);
    method public static void glTexStorage3DMultisampleOES(int, int, int, int, int, int, boolean);
    field public static final int GL_BLEND_ADVANCED_COHERENT_KHR = 37509; // 0x9285
    field public static final int GL_BUFFER_KHR = 33504; // 0x82e0
    field public static final int GL_CLAMP_TO_BORDER_EXT = 33069; // 0x812d
    field public static final int GL_COLORBURN_KHR = 37530; // 0x929a
    field public static final int GL_COLORDODGE_KHR = 37529; // 0x9299
    field public static final int GL_COMPRESSED_RGBA_ASTC_10x10_KHR = 37819; // 0x93bb
    field public static final int GL_COMPRESSED_RGBA_ASTC_10x5_KHR = 37816; // 0x93b8
    field public static final int GL_COMPRESSED_RGBA_ASTC_10x6_KHR = 37817; // 0x93b9
    field public static final int GL_COMPRESSED_RGBA_ASTC_10x8_KHR = 37818; // 0x93ba
    field public static final int GL_COMPRESSED_RGBA_ASTC_12x10_KHR = 37820; // 0x93bc
    field public static final int GL_COMPRESSED_RGBA_ASTC_12x12_KHR = 37821; // 0x93bd
    field public static final int GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 37808; // 0x93b0
    field public static final int GL_COMPRESSED_RGBA_ASTC_5x4_KHR = 37809; // 0x93b1
    field public static final int GL_COMPRESSED_RGBA_ASTC_5x5_KHR = 37810; // 0x93b2
    field public static final int GL_COMPRESSED_RGBA_ASTC_6x5_KHR = 37811; // 0x93b3
    field public static final int GL_COMPRESSED_RGBA_ASTC_6x6_KHR = 37812; // 0x93b4
    field public static final int GL_COMPRESSED_RGBA_ASTC_8x5_KHR = 37813; // 0x93b5
    field public static final int GL_COMPRESSED_RGBA_ASTC_8x6_KHR = 37814; // 0x93b6
    field public static final int GL_COMPRESSED_RGBA_ASTC_8x8_KHR = 37815; // 0x93b7
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 37851; // 0x93db
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 37848; // 0x93d8
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 37849; // 0x93d9
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 37850; // 0x93da
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 37852; // 0x93dc
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 37853; // 0x93dd
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 37840; // 0x93d0
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 37841; // 0x93d1
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 37842; // 0x93d2
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 37843; // 0x93d3
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 37844; // 0x93d4
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 37845; // 0x93d5
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 37846; // 0x93d6
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 37847; // 0x93d7
    field public static final int GL_CONTEXT_FLAG_DEBUG_BIT_KHR = 2; // 0x2
    field public static final int GL_DARKEN_KHR = 37527; // 0x9297
    field public static final int GL_DEBUG_CALLBACK_FUNCTION_KHR = 33348; // 0x8244
    field public static final int GL_DEBUG_CALLBACK_USER_PARAM_KHR = 33349; // 0x8245
    field public static final int GL_DEBUG_GROUP_STACK_DEPTH_KHR = 33389; // 0x826d
    field public static final int GL_DEBUG_LOGGED_MESSAGES_KHR = 37189; // 0x9145
    field public static final int GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR = 33347; // 0x8243
    field public static final int GL_DEBUG_OUTPUT_KHR = 37600; // 0x92e0
    field public static final int GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR = 33346; // 0x8242
    field public static final int GL_DEBUG_SEVERITY_HIGH_KHR = 37190; // 0x9146
    field public static final int GL_DEBUG_SEVERITY_LOW_KHR = 37192; // 0x9148
    field public static final int GL_DEBUG_SEVERITY_MEDIUM_KHR = 37191; // 0x9147
    field public static final int GL_DEBUG_SEVERITY_NOTIFICATION_KHR = 33387; // 0x826b
    field public static final int GL_DEBUG_SOURCE_API_KHR = 33350; // 0x8246
    field public static final int GL_DEBUG_SOURCE_APPLICATION_KHR = 33354; // 0x824a
    field public static final int GL_DEBUG_SOURCE_OTHER_KHR = 33355; // 0x824b
    field public static final int GL_DEBUG_SOURCE_SHADER_COMPILER_KHR = 33352; // 0x8248
    field public static final int GL_DEBUG_SOURCE_THIRD_PARTY_KHR = 33353; // 0x8249
    field public static final int GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR = 33351; // 0x8247
    field public static final int GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR = 33357; // 0x824d
    field public static final int GL_DEBUG_TYPE_ERROR_KHR = 33356; // 0x824c
    field public static final int GL_DEBUG_TYPE_MARKER_KHR = 33384; // 0x8268
    field public static final int GL_DEBUG_TYPE_OTHER_KHR = 33361; // 0x8251
    field public static final int GL_DEBUG_TYPE_PERFORMANCE_KHR = 33360; // 0x8250
    field public static final int GL_DEBUG_TYPE_POP_GROUP_KHR = 33386; // 0x826a
    field public static final int GL_DEBUG_TYPE_PORTABILITY_KHR = 33359; // 0x824f
    field public static final int GL_DEBUG_TYPE_PUSH_GROUP_KHR = 33385; // 0x8269
    field public static final int GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR = 33358; // 0x824e
    field public static final int GL_DECODE_EXT = 35401; // 0x8a49
    field public static final int GL_DIFFERENCE_KHR = 37534; // 0x929e
    field public static final int GL_EXCLUSION_KHR = 37536; // 0x92a0
    field public static final int GL_FIRST_VERTEX_CONVENTION_EXT = 36429; // 0x8e4d
    field public static final int GL_FRACTIONAL_EVEN_EXT = 36476; // 0x8e7c
    field public static final int GL_FRACTIONAL_ODD_EXT = 36475; // 0x8e7b
    field public static final int GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES = 36445; // 0x8e5d
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT = 36263; // 0x8da7
    field public static final int GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT = 37650; // 0x9312
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT = 36264; // 0x8da8
    field public static final int GL_GEOMETRY_LINKED_INPUT_TYPE_EXT = 35095; // 0x8917
    field public static final int GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT = 35096; // 0x8918
    field public static final int GL_GEOMETRY_LINKED_VERTICES_OUT_EXT = 35094; // 0x8916
    field public static final int GL_GEOMETRY_SHADER_BIT_EXT = 4; // 0x4
    field public static final int GL_GEOMETRY_SHADER_EXT = 36313; // 0x8dd9
    field public static final int GL_GEOMETRY_SHADER_INVOCATIONS_EXT = 34943; // 0x887f
    field public static final int GL_HARDLIGHT_KHR = 37531; // 0x929b
    field public static final int GL_HSL_COLOR_KHR = 37551; // 0x92af
    field public static final int GL_HSL_HUE_KHR = 37549; // 0x92ad
    field public static final int GL_HSL_LUMINOSITY_KHR = 37552; // 0x92b0
    field public static final int GL_HSL_SATURATION_KHR = 37550; // 0x92ae
    field public static final int GL_IMAGE_BUFFER_EXT = 36945; // 0x9051
    field public static final int GL_IMAGE_CUBE_MAP_ARRAY_EXT = 36948; // 0x9054
    field public static final int GL_INT_IMAGE_BUFFER_EXT = 36956; // 0x905c
    field public static final int GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 36959; // 0x905f
    field public static final int GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES = 37132; // 0x910c
    field public static final int GL_INT_SAMPLER_BUFFER_EXT = 36304; // 0x8dd0
    field public static final int GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT = 36878; // 0x900e
    field public static final int GL_ISOLINES_EXT = 36474; // 0x8e7a
    field public static final int GL_IS_PER_PATCH_EXT = 37607; // 0x92e7
    field public static final int GL_LAST_VERTEX_CONVENTION_EXT = 36430; // 0x8e4e
    field public static final int GL_LAYER_PROVOKING_VERTEX_EXT = 33374; // 0x825e
    field public static final int GL_LIGHTEN_KHR = 37528; // 0x9298
    field public static final int GL_LINES_ADJACENCY_EXT = 10; // 0xa
    field public static final int GL_LINE_STRIP_ADJACENCY_EXT = 11; // 0xb
    field public static final int GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT = 35378; // 0x8a32
    field public static final int GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT = 36382; // 0x8e1e
    field public static final int GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT = 36383; // 0x8e1f
    field public static final int GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR = 33388; // 0x826c
    field public static final int GL_MAX_DEBUG_LOGGED_MESSAGES_KHR = 37188; // 0x9144
    field public static final int GL_MAX_DEBUG_MESSAGE_LENGTH_KHR = 37187; // 0x9143
    field public static final int GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES = 36444; // 0x8e5c
    field public static final int GL_MAX_FRAMEBUFFER_LAYERS_EXT = 37655; // 0x9317
    field public static final int GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT = 37589; // 0x92d5
    field public static final int GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT = 37583; // 0x92cf
    field public static final int GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT = 37069; // 0x90cd
    field public static final int GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT = 37155; // 0x9123
    field public static final int GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT = 37156; // 0x9124
    field public static final int GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT = 36320; // 0x8de0
    field public static final int GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT = 36442; // 0x8e5a
    field public static final int GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT = 37079; // 0x90d7
    field public static final int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT = 35881; // 0x8c29
    field public static final int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT = 36321; // 0x8de1
    field public static final int GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT = 35372; // 0x8a2c
    field public static final int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT = 36319; // 0x8ddf
    field public static final int GL_MAX_LABEL_LENGTH_KHR = 33512; // 0x82e8
    field public static final int GL_MAX_PATCH_VERTICES_EXT = 36477; // 0x8e7d
    field public static final int GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT = 37587; // 0x92d3
    field public static final int GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT = 37581; // 0x92cd
    field public static final int GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT = 37067; // 0x90cb
    field public static final int GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT = 34924; // 0x886c
    field public static final int GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT = 36483; // 0x8e83
    field public static final int GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT = 37080; // 0x90d8
    field public static final int GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT = 36481; // 0x8e81
    field public static final int GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT = 36485; // 0x8e85
    field public static final int GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT = 36489; // 0x8e89
    field public static final int GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT = 36479; // 0x8e7f
    field public static final int GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT = 37588; // 0x92d4
    field public static final int GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT = 37582; // 0x92ce
    field public static final int GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT = 37068; // 0x90cc
    field public static final int GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT = 34925; // 0x886d
    field public static final int GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT = 36486; // 0x8e86
    field public static final int GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT = 37081; // 0x90d9
    field public static final int GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT = 36482; // 0x8e82
    field public static final int GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT = 36490; // 0x8e8a
    field public static final int GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT = 36480; // 0x8e80
    field public static final int GL_MAX_TESS_GEN_LEVEL_EXT = 36478; // 0x8e7e
    field public static final int GL_MAX_TESS_PATCH_COMPONENTS_EXT = 36484; // 0x8e84
    field public static final int GL_MAX_TEXTURE_BUFFER_SIZE_EXT = 35883; // 0x8c2b
    field public static final int GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES = 36443; // 0x8e5b
    field public static final int GL_MIN_SAMPLE_SHADING_VALUE_OES = 35895; // 0x8c37
    field public static final int GL_MULTIPLY_KHR = 37524; // 0x9294
    field public static final int GL_OVERLAY_KHR = 37526; // 0x9296
    field public static final int GL_PATCHES_EXT = 14; // 0xe
    field public static final int GL_PATCH_VERTICES_EXT = 36466; // 0x8e72
    field public static final int GL_PRIMITIVES_GENERATED_EXT = 35975; // 0x8c87
    field public static final int GL_PRIMITIVE_BOUNDING_BOX_EXT = 37566; // 0x92be
    field public static final int GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 33313; // 0x8221
    field public static final int GL_PROGRAM_KHR = 33506; // 0x82e2
    field public static final int GL_QUADS_EXT = 7; // 0x7
    field public static final int GL_QUERY_KHR = 33507; // 0x82e3
    field public static final int GL_REFERENCED_BY_GEOMETRY_SHADER_EXT = 37641; // 0x9309
    field public static final int GL_REFERENCED_BY_TESS_CONTROL_SHADER_EXT = 37639; // 0x9307
    field public static final int GL_REFERENCED_BY_TESS_EVALUATION_SHADER_EXT = 37640; // 0x9308
    field public static final int GL_SAMPLER_2D_MULTISAMPLE_ARRAY_OES = 37131; // 0x910b
    field public static final int GL_SAMPLER_BUFFER_EXT = 36290; // 0x8dc2
    field public static final int GL_SAMPLER_CUBE_MAP_ARRAY_EXT = 36876; // 0x900c
    field public static final int GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT = 36877; // 0x900d
    field public static final int GL_SAMPLER_KHR = 33510; // 0x82e6
    field public static final int GL_SAMPLE_SHADING_OES = 35894; // 0x8c36
    field public static final int GL_SCREEN_KHR = 37525; // 0x9295
    field public static final int GL_SHADER_KHR = 33505; // 0x82e1
    field public static final int GL_SKIP_DECODE_EXT = 35402; // 0x8a4a
    field public static final int GL_SOFTLIGHT_KHR = 37532; // 0x929c
    field public static final int GL_STACK_OVERFLOW_KHR = 1283; // 0x503
    field public static final int GL_STACK_UNDERFLOW_KHR = 1284; // 0x504
    field public static final int GL_STENCIL_INDEX8_OES = 36168; // 0x8d48
    field public static final int GL_STENCIL_INDEX_OES = 6401; // 0x1901
    field public static final int GL_TESS_CONTROL_OUTPUT_VERTICES_EXT = 36469; // 0x8e75
    field public static final int GL_TESS_CONTROL_SHADER_BIT_EXT = 8; // 0x8
    field public static final int GL_TESS_CONTROL_SHADER_EXT = 36488; // 0x8e88
    field public static final int GL_TESS_EVALUATION_SHADER_BIT_EXT = 16; // 0x10
    field public static final int GL_TESS_EVALUATION_SHADER_EXT = 36487; // 0x8e87
    field public static final int GL_TESS_GEN_MODE_EXT = 36470; // 0x8e76
    field public static final int GL_TESS_GEN_POINT_MODE_EXT = 36473; // 0x8e79
    field public static final int GL_TESS_GEN_SPACING_EXT = 36471; // 0x8e77
    field public static final int GL_TESS_GEN_VERTEX_ORDER_EXT = 36472; // 0x8e78
    field public static final int GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES = 37122; // 0x9102
    field public static final int GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_OES = 37125; // 0x9105
    field public static final int GL_TEXTURE_BINDING_BUFFER_EXT = 35884; // 0x8c2c
    field public static final int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT = 36874; // 0x900a
    field public static final int GL_TEXTURE_BORDER_COLOR_EXT = 4100; // 0x1004
    field public static final int GL_TEXTURE_BUFFER_BINDING_EXT = 35882; // 0x8c2a
    field public static final int GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT = 35885; // 0x8c2d
    field public static final int GL_TEXTURE_BUFFER_EXT = 35882; // 0x8c2a
    field public static final int GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_EXT = 37279; // 0x919f
    field public static final int GL_TEXTURE_BUFFER_OFFSET_EXT = 37277; // 0x919d
    field public static final int GL_TEXTURE_BUFFER_SIZE_EXT = 37278; // 0x919e
    field public static final int GL_TEXTURE_CUBE_MAP_ARRAY_EXT = 36873; // 0x9009
    field public static final int GL_TEXTURE_SRGB_DECODE_EXT = 35400; // 0x8a48
    field public static final int GL_TRIANGLES_ADJACENCY_EXT = 12; // 0xc
    field public static final int GL_TRIANGLE_STRIP_ADJACENCY_EXT = 13; // 0xd
    field public static final int GL_UNDEFINED_VERTEX_EXT = 33376; // 0x8260
    field public static final int GL_UNSIGNED_INT_IMAGE_BUFFER_EXT = 36967; // 0x9067
    field public static final int GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 36970; // 0x906a
    field public static final int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES = 37133; // 0x910d
    field public static final int GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT = 36312; // 0x8dd8
    field public static final int GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT = 36879; // 0x900f
    field public static final int GL_VERTEX_ARRAY_KHR = 32884; // 0x8074
  }

  public static interface GLES31Ext.DebugProcKHR {
    method public void onMessage(int, int, int, int, String);
  }

  public class GLES32 extends android.opengl.GLES31 {
    method public static void glBlendBarrier();
    method public static void glBlendEquationSeparatei(int, int, int);
    method public static void glBlendEquationi(int, int);
    method public static void glBlendFuncSeparatei(int, int, int, int, int);
    method public static void glBlendFunci(int, int, int);
    method public static void glColorMaski(int, boolean, boolean, boolean, boolean);
    method public static void glCopyImageSubData(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int);
    method public static void glDebugMessageCallback(android.opengl.GLES32.DebugProc);
    method public static void glDebugMessageControl(int, int, int, int, int[], int, boolean);
    method public static void glDebugMessageControl(int, int, int, int, java.nio.IntBuffer, boolean);
    method public static void glDebugMessageInsert(int, int, int, int, int, String);
    method public static void glDisablei(int, int);
    method public static void glDrawElementsBaseVertex(int, int, int, java.nio.Buffer, int);
    method public static void glDrawElementsInstancedBaseVertex(int, int, int, java.nio.Buffer, int, int);
    method public static void glDrawElementsInstancedBaseVertex(int, int, int, int, int, int);
    method public static void glDrawRangeElementsBaseVertex(int, int, int, int, int, java.nio.Buffer, int);
    method public static void glEnablei(int, int);
    method public static void glFramebufferTexture(int, int, int, int);
    method public static int glGetDebugMessageLog(int, int, int[], int, int[], int, int[], int, int[], int, int[], int, byte[], int);
    method public static int glGetDebugMessageLog(int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.ByteBuffer);
    method public static String[] glGetDebugMessageLog(int, int[], int, int[], int, int[], int, int[], int);
    method public static String[] glGetDebugMessageLog(int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer);
    method public static int glGetGraphicsResetStatus();
    method public static String glGetObjectLabel(int, int);
    method public static String glGetObjectPtrLabel(long);
    method public static long glGetPointerv(int);
    method public static void glGetSamplerParameterIiv(int, int, int[], int);
    method public static void glGetSamplerParameterIiv(int, int, java.nio.IntBuffer);
    method public static void glGetSamplerParameterIuiv(int, int, int[], int);
    method public static void glGetSamplerParameterIuiv(int, int, java.nio.IntBuffer);
    method public static void glGetTexParameterIiv(int, int, int[], int);
    method public static void glGetTexParameterIiv(int, int, java.nio.IntBuffer);
    method public static void glGetTexParameterIuiv(int, int, int[], int);
    method public static void glGetTexParameterIuiv(int, int, java.nio.IntBuffer);
    method public static void glGetnUniformfv(int, int, int, float[], int);
    method public static void glGetnUniformfv(int, int, int, java.nio.FloatBuffer);
    method public static void glGetnUniformiv(int, int, int, int[], int);
    method public static void glGetnUniformiv(int, int, int, java.nio.IntBuffer);
    method public static void glGetnUniformuiv(int, int, int, int[], int);
    method public static void glGetnUniformuiv(int, int, int, java.nio.IntBuffer);
    method public static boolean glIsEnabledi(int, int);
    method public static void glMinSampleShading(float);
    method public static void glObjectLabel(int, int, int, String);
    method public static void glObjectPtrLabel(long, String);
    method public static void glPatchParameteri(int, int);
    method public static void glPopDebugGroup();
    method public static void glPrimitiveBoundingBox(float, float, float, float, float, float, float, float);
    method public static void glPushDebugGroup(int, int, int, String);
    method public static void glReadnPixels(int, int, int, int, int, int, int, java.nio.Buffer);
    method public static void glSamplerParameterIiv(int, int, int[], int);
    method public static void glSamplerParameterIiv(int, int, java.nio.IntBuffer);
    method public static void glSamplerParameterIuiv(int, int, int[], int);
    method public static void glSamplerParameterIuiv(int, int, java.nio.IntBuffer);
    method public static void glTexBuffer(int, int, int);
    method public static void glTexBufferRange(int, int, int, int, int);
    method public static void glTexParameterIiv(int, int, int[], int);
    method public static void glTexParameterIiv(int, int, java.nio.IntBuffer);
    method public static void glTexParameterIuiv(int, int, int[], int);
    method public static void glTexParameterIuiv(int, int, java.nio.IntBuffer);
    method public static void glTexStorage3DMultisample(int, int, int, int, int, int, boolean);
    field public static final int GL_BUFFER = 33504; // 0x82e0
    field public static final int GL_CLAMP_TO_BORDER = 33069; // 0x812d
    field public static final int GL_COLORBURN = 37530; // 0x929a
    field public static final int GL_COLORDODGE = 37529; // 0x9299
    field public static final int GL_COMPRESSED_RGBA_ASTC_10x10 = 37819; // 0x93bb
    field public static final int GL_COMPRESSED_RGBA_ASTC_10x5 = 37816; // 0x93b8
    field public static final int GL_COMPRESSED_RGBA_ASTC_10x6 = 37817; // 0x93b9
    field public static final int GL_COMPRESSED_RGBA_ASTC_10x8 = 37818; // 0x93ba
    field public static final int GL_COMPRESSED_RGBA_ASTC_12x10 = 37820; // 0x93bc
    field public static final int GL_COMPRESSED_RGBA_ASTC_12x12 = 37821; // 0x93bd
    field public static final int GL_COMPRESSED_RGBA_ASTC_4x4 = 37808; // 0x93b0
    field public static final int GL_COMPRESSED_RGBA_ASTC_5x4 = 37809; // 0x93b1
    field public static final int GL_COMPRESSED_RGBA_ASTC_5x5 = 37810; // 0x93b2
    field public static final int GL_COMPRESSED_RGBA_ASTC_6x5 = 37811; // 0x93b3
    field public static final int GL_COMPRESSED_RGBA_ASTC_6x6 = 37812; // 0x93b4
    field public static final int GL_COMPRESSED_RGBA_ASTC_8x5 = 37813; // 0x93b5
    field public static final int GL_COMPRESSED_RGBA_ASTC_8x6 = 37814; // 0x93b6
    field public static final int GL_COMPRESSED_RGBA_ASTC_8x8 = 37815; // 0x93b7
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10 = 37851; // 0x93db
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5 = 37848; // 0x93d8
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6 = 37849; // 0x93d9
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8 = 37850; // 0x93da
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10 = 37852; // 0x93dc
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12 = 37853; // 0x93dd
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4 = 37840; // 0x93d0
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4 = 37841; // 0x93d1
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5 = 37842; // 0x93d2
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5 = 37843; // 0x93d3
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6 = 37844; // 0x93d4
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5 = 37845; // 0x93d5
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6 = 37846; // 0x93d6
    field public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8 = 37847; // 0x93d7
    field public static final int GL_CONTEXT_FLAGS = 33310; // 0x821e
    field public static final int GL_CONTEXT_FLAG_DEBUG_BIT = 2; // 0x2
    field public static final int GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT = 4; // 0x4
    field public static final int GL_CONTEXT_LOST = 1287; // 0x507
    field public static final int GL_DARKEN = 37527; // 0x9297
    field public static final int GL_DEBUG_CALLBACK_FUNCTION = 33348; // 0x8244
    field public static final int GL_DEBUG_CALLBACK_USER_PARAM = 33349; // 0x8245
    field public static final int GL_DEBUG_GROUP_STACK_DEPTH = 33389; // 0x826d
    field public static final int GL_DEBUG_LOGGED_MESSAGES = 37189; // 0x9145
    field public static final int GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 33347; // 0x8243
    field public static final int GL_DEBUG_OUTPUT = 37600; // 0x92e0
    field public static final int GL_DEBUG_OUTPUT_SYNCHRONOUS = 33346; // 0x8242
    field public static final int GL_DEBUG_SEVERITY_HIGH = 37190; // 0x9146
    field public static final int GL_DEBUG_SEVERITY_LOW = 37192; // 0x9148
    field public static final int GL_DEBUG_SEVERITY_MEDIUM = 37191; // 0x9147
    field public static final int GL_DEBUG_SEVERITY_NOTIFICATION = 33387; // 0x826b
    field public static final int GL_DEBUG_SOURCE_API = 33350; // 0x8246
    field public static final int GL_DEBUG_SOURCE_APPLICATION = 33354; // 0x824a
    field public static final int GL_DEBUG_SOURCE_OTHER = 33355; // 0x824b
    field public static final int GL_DEBUG_SOURCE_SHADER_COMPILER = 33352; // 0x8248
    field public static final int GL_DEBUG_SOURCE_THIRD_PARTY = 33353; // 0x8249
    field public static final int GL_DEBUG_SOURCE_WINDOW_SYSTEM = 33351; // 0x8247
    field public static final int GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR = 33357; // 0x824d
    field public static final int GL_DEBUG_TYPE_ERROR = 33356; // 0x824c
    field public static final int GL_DEBUG_TYPE_MARKER = 33384; // 0x8268
    field public static final int GL_DEBUG_TYPE_OTHER = 33361; // 0x8251
    field public static final int GL_DEBUG_TYPE_PERFORMANCE = 33360; // 0x8250
    field public static final int GL_DEBUG_TYPE_POP_GROUP = 33386; // 0x826a
    field public static final int GL_DEBUG_TYPE_PORTABILITY = 33359; // 0x824f
    field public static final int GL_DEBUG_TYPE_PUSH_GROUP = 33385; // 0x8269
    field public static final int GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR = 33358; // 0x824e
    field public static final int GL_DIFFERENCE = 37534; // 0x929e
    field public static final int GL_EXCLUSION = 37536; // 0x92a0
    field public static final int GL_FIRST_VERTEX_CONVENTION = 36429; // 0x8e4d
    field public static final int GL_FRACTIONAL_EVEN = 36476; // 0x8e7c
    field public static final int GL_FRACTIONAL_ODD = 36475; // 0x8e7b
    field public static final int GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = 36445; // 0x8e5d
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_LAYERED = 36263; // 0x8da7
    field public static final int GL_FRAMEBUFFER_DEFAULT_LAYERS = 37650; // 0x9312
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 36264; // 0x8da8
    field public static final int GL_GEOMETRY_INPUT_TYPE = 35095; // 0x8917
    field public static final int GL_GEOMETRY_OUTPUT_TYPE = 35096; // 0x8918
    field public static final int GL_GEOMETRY_SHADER = 36313; // 0x8dd9
    field public static final int GL_GEOMETRY_SHADER_BIT = 4; // 0x4
    field public static final int GL_GEOMETRY_SHADER_INVOCATIONS = 34943; // 0x887f
    field public static final int GL_GEOMETRY_VERTICES_OUT = 35094; // 0x8916
    field public static final int GL_GUILTY_CONTEXT_RESET = 33363; // 0x8253
    field public static final int GL_HARDLIGHT = 37531; // 0x929b
    field public static final int GL_HSL_COLOR = 37551; // 0x92af
    field public static final int GL_HSL_HUE = 37549; // 0x92ad
    field public static final int GL_HSL_LUMINOSITY = 37552; // 0x92b0
    field public static final int GL_HSL_SATURATION = 37550; // 0x92ae
    field public static final int GL_IMAGE_BUFFER = 36945; // 0x9051
    field public static final int GL_IMAGE_CUBE_MAP_ARRAY = 36948; // 0x9054
    field public static final int GL_INNOCENT_CONTEXT_RESET = 33364; // 0x8254
    field public static final int GL_INT_IMAGE_BUFFER = 36956; // 0x905c
    field public static final int GL_INT_IMAGE_CUBE_MAP_ARRAY = 36959; // 0x905f
    field public static final int GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 37132; // 0x910c
    field public static final int GL_INT_SAMPLER_BUFFER = 36304; // 0x8dd0
    field public static final int GL_INT_SAMPLER_CUBE_MAP_ARRAY = 36878; // 0x900e
    field public static final int GL_ISOLINES = 36474; // 0x8e7a
    field public static final int GL_IS_PER_PATCH = 37607; // 0x92e7
    field public static final int GL_LAST_VERTEX_CONVENTION = 36430; // 0x8e4e
    field public static final int GL_LAYER_PROVOKING_VERTEX = 33374; // 0x825e
    field public static final int GL_LIGHTEN = 37528; // 0x9298
    field public static final int GL_LINES_ADJACENCY = 10; // 0xa
    field public static final int GL_LINE_STRIP_ADJACENCY = 11; // 0xb
    field public static final int GL_LOSE_CONTEXT_ON_RESET = 33362; // 0x8252
    field public static final int GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 35378; // 0x8a32
    field public static final int GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 36382; // 0x8e1e
    field public static final int GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 36383; // 0x8e1f
    field public static final int GL_MAX_DEBUG_GROUP_STACK_DEPTH = 33388; // 0x826c
    field public static final int GL_MAX_DEBUG_LOGGED_MESSAGES = 37188; // 0x9144
    field public static final int GL_MAX_DEBUG_MESSAGE_LENGTH = 37187; // 0x9143
    field public static final int GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = 36444; // 0x8e5c
    field public static final int GL_MAX_FRAMEBUFFER_LAYERS = 37655; // 0x9317
    field public static final int GL_MAX_GEOMETRY_ATOMIC_COUNTERS = 37589; // 0x92d5
    field public static final int GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 37583; // 0x92cf
    field public static final int GL_MAX_GEOMETRY_IMAGE_UNIFORMS = 37069; // 0x90cd
    field public static final int GL_MAX_GEOMETRY_INPUT_COMPONENTS = 37155; // 0x9123
    field public static final int GL_MAX_GEOMETRY_OUTPUT_COMPONENTS = 37156; // 0x9124
    field public static final int GL_MAX_GEOMETRY_OUTPUT_VERTICES = 36320; // 0x8de0
    field public static final int GL_MAX_GEOMETRY_SHADER_INVOCATIONS = 36442; // 0x8e5a
    field public static final int GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 37079; // 0x90d7
    field public static final int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 35881; // 0x8c29
    field public static final int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 36321; // 0x8de1
    field public static final int GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 35372; // 0x8a2c
    field public static final int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS = 36319; // 0x8ddf
    field public static final int GL_MAX_LABEL_LENGTH = 33512; // 0x82e8
    field public static final int GL_MAX_PATCH_VERTICES = 36477; // 0x8e7d
    field public static final int GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS = 37587; // 0x92d3
    field public static final int GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 37581; // 0x92cd
    field public static final int GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS = 37067; // 0x90cb
    field public static final int GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = 34924; // 0x886c
    field public static final int GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 36483; // 0x8e83
    field public static final int GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 37080; // 0x90d8
    field public static final int GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 36481; // 0x8e81
    field public static final int GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 36485; // 0x8e85
    field public static final int GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = 36489; // 0x8e89
    field public static final int GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 36479; // 0x8e7f
    field public static final int GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 37588; // 0x92d4
    field public static final int GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 37582; // 0x92ce
    field public static final int GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 37068; // 0x90cc
    field public static final int GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = 34925; // 0x886d
    field public static final int GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 36486; // 0x8e86
    field public static final int GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 37081; // 0x90d9
    field public static final int GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 36482; // 0x8e82
    field public static final int GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 36490; // 0x8e8a
    field public static final int GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 36480; // 0x8e80
    field public static final int GL_MAX_TESS_GEN_LEVEL = 36478; // 0x8e7e
    field public static final int GL_MAX_TESS_PATCH_COMPONENTS = 36484; // 0x8e84
    field public static final int GL_MAX_TEXTURE_BUFFER_SIZE = 35883; // 0x8c2b
    field public static final int GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = 36443; // 0x8e5b
    field public static final int GL_MIN_SAMPLE_SHADING_VALUE = 35895; // 0x8c37
    field public static final int GL_MULTIPLY = 37524; // 0x9294
    field public static final int GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY = 37762; // 0x9382
    field public static final int GL_MULTISAMPLE_LINE_WIDTH_RANGE = 37761; // 0x9381
    field public static final int GL_NO_RESET_NOTIFICATION = 33377; // 0x8261
    field public static final int GL_OVERLAY = 37526; // 0x9296
    field public static final int GL_PATCHES = 14; // 0xe
    field public static final int GL_PATCH_VERTICES = 36466; // 0x8e72
    field public static final int GL_PRIMITIVES_GENERATED = 35975; // 0x8c87
    field public static final int GL_PRIMITIVE_BOUNDING_BOX = 37566; // 0x92be
    field public static final int GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 33313; // 0x8221
    field public static final int GL_PROGRAM = 33506; // 0x82e2
    field public static final int GL_PROGRAM_PIPELINE = 33508; // 0x82e4
    field public static final int GL_QUADS = 7; // 0x7
    field public static final int GL_QUERY = 33507; // 0x82e3
    field public static final int GL_REFERENCED_BY_GEOMETRY_SHADER = 37641; // 0x9309
    field public static final int GL_REFERENCED_BY_TESS_CONTROL_SHADER = 37639; // 0x9307
    field public static final int GL_REFERENCED_BY_TESS_EVALUATION_SHADER = 37640; // 0x9308
    field public static final int GL_RESET_NOTIFICATION_STRATEGY = 33366; // 0x8256
    field public static final int GL_SAMPLER = 33510; // 0x82e6
    field public static final int GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 37131; // 0x910b
    field public static final int GL_SAMPLER_BUFFER = 36290; // 0x8dc2
    field public static final int GL_SAMPLER_CUBE_MAP_ARRAY = 36876; // 0x900c
    field public static final int GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW = 36877; // 0x900d
    field public static final int GL_SAMPLE_SHADING = 35894; // 0x8c36
    field public static final int GL_SCREEN = 37525; // 0x9295
    field public static final int GL_SHADER = 33505; // 0x82e1
    field public static final int GL_SOFTLIGHT = 37532; // 0x929c
    field public static final int GL_STACK_OVERFLOW = 1283; // 0x503
    field public static final int GL_STACK_UNDERFLOW = 1284; // 0x504
    field public static final int GL_TESS_CONTROL_OUTPUT_VERTICES = 36469; // 0x8e75
    field public static final int GL_TESS_CONTROL_SHADER = 36488; // 0x8e88
    field public static final int GL_TESS_CONTROL_SHADER_BIT = 8; // 0x8
    field public static final int GL_TESS_EVALUATION_SHADER = 36487; // 0x8e87
    field public static final int GL_TESS_EVALUATION_SHADER_BIT = 16; // 0x10
    field public static final int GL_TESS_GEN_MODE = 36470; // 0x8e76
    field public static final int GL_TESS_GEN_POINT_MODE = 36473; // 0x8e79
    field public static final int GL_TESS_GEN_SPACING = 36471; // 0x8e77
    field public static final int GL_TESS_GEN_VERTEX_ORDER = 36472; // 0x8e78
    field public static final int GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 37122; // 0x9102
    field public static final int GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 37125; // 0x9105
    field public static final int GL_TEXTURE_BINDING_BUFFER = 35884; // 0x8c2c
    field public static final int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY = 36874; // 0x900a
    field public static final int GL_TEXTURE_BORDER_COLOR = 4100; // 0x1004
    field public static final int GL_TEXTURE_BUFFER = 35882; // 0x8c2a
    field public static final int GL_TEXTURE_BUFFER_BINDING = 35882; // 0x8c2a
    field public static final int GL_TEXTURE_BUFFER_DATA_STORE_BINDING = 35885; // 0x8c2d
    field public static final int GL_TEXTURE_BUFFER_OFFSET = 37277; // 0x919d
    field public static final int GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT = 37279; // 0x919f
    field public static final int GL_TEXTURE_BUFFER_SIZE = 37278; // 0x919e
    field public static final int GL_TEXTURE_CUBE_MAP_ARRAY = 36873; // 0x9009
    field public static final int GL_TRIANGLES_ADJACENCY = 12; // 0xc
    field public static final int GL_TRIANGLE_STRIP_ADJACENCY = 13; // 0xd
    field public static final int GL_UNDEFINED_VERTEX = 33376; // 0x8260
    field public static final int GL_UNKNOWN_CONTEXT_RESET = 33365; // 0x8255
    field public static final int GL_UNSIGNED_INT_IMAGE_BUFFER = 36967; // 0x9067
    field public static final int GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 36970; // 0x906a
    field public static final int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 37133; // 0x910d
    field public static final int GL_UNSIGNED_INT_SAMPLER_BUFFER = 36312; // 0x8dd8
    field public static final int GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 36879; // 0x900f
    field public static final int GL_VERTEX_ARRAY = 32884; // 0x8074
  }

  public static interface GLES32.DebugProc {
    method public void onMessage(int, int, int, int, String);
  }

  public class GLException extends java.lang.RuntimeException {
    ctor public GLException(int);
    ctor public GLException(int, String);
  }

  public class GLSurfaceView extends android.view.SurfaceView implements android.view.SurfaceHolder.Callback2 {
    ctor public GLSurfaceView(android.content.Context);
    ctor public GLSurfaceView(android.content.Context, android.util.AttributeSet);
    method public int getDebugFlags();
    method public boolean getPreserveEGLContextOnPause();
    method public int getRenderMode();
    method public void onPause();
    method public void onResume();
    method public void queueEvent(Runnable);
    method public void requestRender();
    method public void setDebugFlags(int);
    method public void setEGLConfigChooser(android.opengl.GLSurfaceView.EGLConfigChooser);
    method public void setEGLConfigChooser(boolean);
    method public void setEGLConfigChooser(int, int, int, int, int, int);
    method public void setEGLContextClientVersion(int);
    method public void setEGLContextFactory(android.opengl.GLSurfaceView.EGLContextFactory);
    method public void setEGLWindowSurfaceFactory(android.opengl.GLSurfaceView.EGLWindowSurfaceFactory);
    method public void setGLWrapper(android.opengl.GLSurfaceView.GLWrapper);
    method public void setPreserveEGLContextOnPause(boolean);
    method public void setRenderMode(int);
    method public void setRenderer(android.opengl.GLSurfaceView.Renderer);
    method public void surfaceChanged(android.view.SurfaceHolder, int, int, int);
    method public void surfaceCreated(android.view.SurfaceHolder);
    method public void surfaceDestroyed(android.view.SurfaceHolder);
    method @Deprecated public void surfaceRedrawNeeded(android.view.SurfaceHolder);
    field public static final int DEBUG_CHECK_GL_ERROR = 1; // 0x1
    field public static final int DEBUG_LOG_GL_CALLS = 2; // 0x2
    field public static final int RENDERMODE_CONTINUOUSLY = 1; // 0x1
    field public static final int RENDERMODE_WHEN_DIRTY = 0; // 0x0
  }

  public static interface GLSurfaceView.EGLConfigChooser {
    method public javax.microedition.khronos.egl.EGLConfig chooseConfig(javax.microedition.khronos.egl.EGL10, javax.microedition.khronos.egl.EGLDisplay);
  }

  public static interface GLSurfaceView.EGLContextFactory {
    method public javax.microedition.khronos.egl.EGLContext createContext(javax.microedition.khronos.egl.EGL10, javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig);
    method public void destroyContext(javax.microedition.khronos.egl.EGL10, javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLContext);
  }

  public static interface GLSurfaceView.EGLWindowSurfaceFactory {
    method public javax.microedition.khronos.egl.EGLSurface createWindowSurface(javax.microedition.khronos.egl.EGL10, javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig, Object);
    method public void destroySurface(javax.microedition.khronos.egl.EGL10, javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLSurface);
  }

  public static interface GLSurfaceView.GLWrapper {
    method public javax.microedition.khronos.opengles.GL wrap(javax.microedition.khronos.opengles.GL);
  }

  public static interface GLSurfaceView.Renderer {
    method public void onDrawFrame(javax.microedition.khronos.opengles.GL10);
    method public void onSurfaceChanged(javax.microedition.khronos.opengles.GL10, int, int);
    method public void onSurfaceCreated(javax.microedition.khronos.opengles.GL10, javax.microedition.khronos.egl.EGLConfig);
  }

  public class GLU {
    ctor public GLU();
    method public static String gluErrorString(int);
    method public static void gluLookAt(javax.microedition.khronos.opengles.GL10, float, float, float, float, float, float, float, float, float);
    method public static void gluOrtho2D(javax.microedition.khronos.opengles.GL10, float, float, float, float);
    method public static void gluPerspective(javax.microedition.khronos.opengles.GL10, float, float, float, float);
    method public static int gluProject(float, float, float, float[], int, float[], int, int[], int, float[], int);
    method public static int gluUnProject(float, float, float, float[], int, float[], int, int[], int, float[], int);
  }

  public final class GLUtils {
    method public static String getEGLErrorString(int);
    method public static int getInternalFormat(android.graphics.Bitmap);
    method public static int getType(android.graphics.Bitmap);
    method public static void texImage2D(int, int, int, android.graphics.Bitmap, int);
    method public static void texImage2D(int, int, int, android.graphics.Bitmap, int, int);
    method public static void texImage2D(int, int, android.graphics.Bitmap, int);
    method public static void texSubImage2D(int, int, int, int, android.graphics.Bitmap);
    method public static void texSubImage2D(int, int, int, int, android.graphics.Bitmap, int, int);
  }

  public class Matrix {
    ctor @Deprecated public Matrix();
    method public static void frustumM(float[], int, float, float, float, float, float, float);
    method public static boolean invertM(float[], int, float[], int);
    method public static float length(float, float, float);
    method public static void multiplyMM(float[], int, float[], int, float[], int);
    method public static void multiplyMV(float[], int, float[], int, float[], int);
    method public static void orthoM(float[], int, float, float, float, float, float, float);
    method public static void perspectiveM(float[], int, float, float, float, float);
    method public static void rotateM(float[], int, float[], int, float, float, float, float);
    method public static void rotateM(float[], int, float, float, float, float);
    method public static void scaleM(float[], int, float[], int, float, float, float);
    method public static void scaleM(float[], int, float, float, float);
    method public static void setIdentityM(float[], int);
    method public static void setLookAtM(float[], int, float, float, float, float, float, float, float, float, float);
    method public static void setRotateEulerM(float[], int, float, float, float);
    method public static void setRotateM(float[], int, float, float, float, float);
    method public static void translateM(float[], int, float[], int, float, float, float);
    method public static void translateM(float[], int, float, float, float);
    method public static void transposeM(float[], int, float[], int);
  }

  public class Visibility {
    ctor public Visibility();
    method public static void computeBoundingSphere(float[], int, int, float[], int);
    method public static int frustumCullSpheres(float[], int, float[], int, int, int[], int, int);
    method public static int visibilityTest(float[], int, float[], int, char[], int, int);
  }

}

package android.os {

  public abstract class AsyncTask<Params, Progress, Result> {
    ctor public AsyncTask();
    method public final boolean cancel(boolean);
    method @WorkerThread protected abstract Result doInBackground(Params...);
    method @MainThread public final android.os.AsyncTask<Params,Progress,Result> execute(Params...);
    method @MainThread public static void execute(Runnable);
    method @MainThread public final android.os.AsyncTask<Params,Progress,Result> executeOnExecutor(java.util.concurrent.Executor, Params...);
    method public final Result get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
    method public final Result get(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
    method public final android.os.AsyncTask.Status getStatus();
    method public final boolean isCancelled();
    method @MainThread protected void onCancelled(Result);
    method @MainThread protected void onCancelled();
    method @MainThread protected void onPostExecute(Result);
    method @MainThread protected void onPreExecute();
    method @MainThread protected void onProgressUpdate(Progress...);
    method @WorkerThread protected final void publishProgress(Progress...);
    field public static final java.util.concurrent.Executor SERIAL_EXECUTOR;
    field public static final java.util.concurrent.Executor THREAD_POOL_EXECUTOR;
  }

  public enum AsyncTask.Status {
    enum_constant public static final android.os.AsyncTask.Status FINISHED;
    enum_constant public static final android.os.AsyncTask.Status PENDING;
    enum_constant public static final android.os.AsyncTask.Status RUNNING;
  }

  public class BadParcelableException extends android.util.AndroidRuntimeException {
    ctor public BadParcelableException(String);
    ctor public BadParcelableException(Exception);
  }

  public class BaseBundle {
    method public void clear();
    method public boolean containsKey(String);
    method @Nullable public Object get(String);
    method public boolean getBoolean(String);
    method public boolean getBoolean(String, boolean);
    method @Nullable public boolean[] getBooleanArray(@Nullable String);
    method public double getDouble(String);
    method public double getDouble(String, double);
    method @Nullable public double[] getDoubleArray(@Nullable String);
    method public int getInt(String);
    method public int getInt(String, int);
    method @Nullable public int[] getIntArray(@Nullable String);
    method public long getLong(String);
    method public long getLong(String, long);
    method @Nullable public long[] getLongArray(@Nullable String);
    method @Nullable public String getString(@Nullable String);
    method public String getString(@Nullable String, String);
    method @Nullable public String[] getStringArray(@Nullable String);
    method public boolean isEmpty();
    method public java.util.Set<java.lang.String> keySet();
    method public void putAll(android.os.PersistableBundle);
    method public void putBoolean(@Nullable String, boolean);
    method public void putBooleanArray(@Nullable String, @Nullable boolean[]);
    method public void putDouble(@Nullable String, double);
    method public void putDoubleArray(@Nullable String, @Nullable double[]);
    method public void putInt(@Nullable String, int);
    method public void putIntArray(@Nullable String, @Nullable int[]);
    method public void putLong(@Nullable String, long);
    method public void putLongArray(@Nullable String, @Nullable long[]);
    method public void putString(@Nullable String, @Nullable String);
    method public void putStringArray(@Nullable String, @Nullable String[]);
    method public void remove(String);
    method public int size();
  }

  public class BatteryManager {
    method public long computeChargeTimeRemaining();
    method public int getIntProperty(int);
    method public long getLongProperty(int);
    method public boolean isCharging();
    field public static final String ACTION_CHARGING = "android.os.action.CHARGING";
    field public static final String ACTION_DISCHARGING = "android.os.action.DISCHARGING";
    field public static final int BATTERY_HEALTH_COLD = 7; // 0x7
    field public static final int BATTERY_HEALTH_DEAD = 4; // 0x4
    field public static final int BATTERY_HEALTH_GOOD = 2; // 0x2
    field public static final int BATTERY_HEALTH_OVERHEAT = 3; // 0x3
    field public static final int BATTERY_HEALTH_OVER_VOLTAGE = 5; // 0x5
    field public static final int BATTERY_HEALTH_UNKNOWN = 1; // 0x1
    field public static final int BATTERY_HEALTH_UNSPECIFIED_FAILURE = 6; // 0x6
    field public static final int BATTERY_PLUGGED_AC = 1; // 0x1
    field public static final int BATTERY_PLUGGED_USB = 2; // 0x2
    field public static final int BATTERY_PLUGGED_WIRELESS = 4; // 0x4
    field public static final int BATTERY_PROPERTY_CAPACITY = 4; // 0x4
    field public static final int BATTERY_PROPERTY_CHARGE_COUNTER = 1; // 0x1
    field public static final int BATTERY_PROPERTY_CURRENT_AVERAGE = 3; // 0x3
    field public static final int BATTERY_PROPERTY_CURRENT_NOW = 2; // 0x2
    field public static final int BATTERY_PROPERTY_ENERGY_COUNTER = 5; // 0x5
    field public static final int BATTERY_PROPERTY_STATUS = 6; // 0x6
    field public static final int BATTERY_STATUS_CHARGING = 2; // 0x2
    field public static final int BATTERY_STATUS_DISCHARGING = 3; // 0x3
    field public static final int BATTERY_STATUS_FULL = 5; // 0x5
    field public static final int BATTERY_STATUS_NOT_CHARGING = 4; // 0x4
    field public static final int BATTERY_STATUS_UNKNOWN = 1; // 0x1
    field public static final String EXTRA_BATTERY_LOW = "battery_low";
    field public static final String EXTRA_HEALTH = "health";
    field public static final String EXTRA_ICON_SMALL = "icon-small";
    field public static final String EXTRA_LEVEL = "level";
    field public static final String EXTRA_PLUGGED = "plugged";
    field public static final String EXTRA_PRESENT = "present";
    field public static final String EXTRA_SCALE = "scale";
    field public static final String EXTRA_STATUS = "status";
    field public static final String EXTRA_TECHNOLOGY = "technology";
    field public static final String EXTRA_TEMPERATURE = "temperature";
    field public static final String EXTRA_VOLTAGE = "voltage";
  }

  public class Binder implements android.os.IBinder {
    ctor public Binder();
    method public void attachInterface(@Nullable android.os.IInterface, @Nullable String);
    method public static final long clearCallingIdentity();
    method public void dump(@NonNull java.io.FileDescriptor, @Nullable String[]);
    method protected void dump(@NonNull java.io.FileDescriptor, @NonNull java.io.PrintWriter, @Nullable String[]);
    method public void dumpAsync(@NonNull java.io.FileDescriptor, @Nullable String[]);
    method public static final void flushPendingCommands();
    method public static final int getCallingPid();
    method public static final int getCallingUid();
    method @NonNull public static final android.os.UserHandle getCallingUserHandle();
    method @Nullable public String getInterfaceDescriptor();
    method public boolean isBinderAlive();
    method public static final void joinThreadPool();
    method public void linkToDeath(@NonNull android.os.IBinder.DeathRecipient, int);
    method protected boolean onTransact(int, @NonNull android.os.Parcel, @Nullable android.os.Parcel, int) throws android.os.RemoteException;
    method public boolean pingBinder();
    method @Nullable public android.os.IInterface queryLocalInterface(@NonNull String);
    method public static final void restoreCallingIdentity(long);
    method public final boolean transact(int, @NonNull android.os.Parcel, @Nullable android.os.Parcel, int) throws android.os.RemoteException;
    method public boolean unlinkToDeath(@NonNull android.os.IBinder.DeathRecipient, int);
  }

  public class Build {
    ctor public Build();
    method public static String getRadioVersion();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static String getSerial();
    field public static final String BOARD;
    field public static final String BOOTLOADER;
    field public static final String BRAND;
    field @Deprecated public static final String CPU_ABI;
    field @Deprecated public static final String CPU_ABI2;
    field public static final String DEVICE;
    field public static final String DISPLAY;
    field public static final String FINGERPRINT;
    field public static final String HARDWARE;
    field public static final String HOST;
    field public static final String ID;
    field public static final String MANUFACTURER;
    field public static final String MODEL;
    field public static final String PRODUCT;
    field @Deprecated public static final String RADIO;
    field @Deprecated public static final String SERIAL;
    field public static final String[] SUPPORTED_32_BIT_ABIS;
    field public static final String[] SUPPORTED_64_BIT_ABIS;
    field public static final String[] SUPPORTED_ABIS;
    field public static final String TAGS;
    field public static final long TIME;
    field public static final String TYPE;
    field public static final String UNKNOWN = "unknown";
    field public static final String USER;
  }

  public static class Build.VERSION {
    ctor public Build.VERSION();
    field public static final String BASE_OS;
    field public static final String CODENAME;
    field public static final String INCREMENTAL;
    field public static final int PREVIEW_SDK_INT;
    field public static final String RELEASE;
    field @Deprecated public static final String SDK;
    field public static final int SDK_INT;
    field public static final String SECURITY_PATCH;
  }

  public static class Build.VERSION_CODES {
    ctor public Build.VERSION_CODES();
    field public static final int BASE = 1; // 0x1
    field public static final int BASE_1_1 = 2; // 0x2
    field public static final int CUPCAKE = 3; // 0x3
    field public static final int CUR_DEVELOPMENT = 10000; // 0x2710
    field public static final int DONUT = 4; // 0x4
    field public static final int ECLAIR = 5; // 0x5
    field public static final int ECLAIR_0_1 = 6; // 0x6
    field public static final int ECLAIR_MR1 = 7; // 0x7
    field public static final int FROYO = 8; // 0x8
    field public static final int GINGERBREAD = 9; // 0x9
    field public static final int GINGERBREAD_MR1 = 10; // 0xa
    field public static final int HONEYCOMB = 11; // 0xb
    field public static final int HONEYCOMB_MR1 = 12; // 0xc
    field public static final int HONEYCOMB_MR2 = 13; // 0xd
    field public static final int ICE_CREAM_SANDWICH = 14; // 0xe
    field public static final int ICE_CREAM_SANDWICH_MR1 = 15; // 0xf
    field public static final int JELLY_BEAN = 16; // 0x10
    field public static final int JELLY_BEAN_MR1 = 17; // 0x11
    field public static final int JELLY_BEAN_MR2 = 18; // 0x12
    field public static final int KITKAT = 19; // 0x13
    field public static final int KITKAT_WATCH = 20; // 0x14
    field public static final int LOLLIPOP = 21; // 0x15
    field public static final int LOLLIPOP_MR1 = 22; // 0x16
    field public static final int M = 23; // 0x17
    field public static final int N = 24; // 0x18
    field public static final int N_MR1 = 25; // 0x19
    field public static final int O = 26; // 0x1a
    field public static final int O_MR1 = 27; // 0x1b
    field public static final int P = 28; // 0x1c
    field public static final int Q = 10000; // 0x2710
  }

  public final class Bundle extends android.os.BaseBundle implements java.lang.Cloneable android.os.Parcelable {
    ctor public Bundle();
    ctor public Bundle(ClassLoader);
    ctor public Bundle(int);
    ctor public Bundle(android.os.Bundle);
    ctor public Bundle(android.os.PersistableBundle);
    method public Object clone();
    method public android.os.Bundle deepCopy();
    method public int describeContents();
    method @Nullable public android.os.IBinder getBinder(@Nullable String);
    method @Nullable public android.os.Bundle getBundle(@Nullable String);
    method public byte getByte(String);
    method public Byte getByte(String, byte);
    method @Nullable public byte[] getByteArray(@Nullable String);
    method public char getChar(String);
    method public char getChar(String, char);
    method @Nullable public char[] getCharArray(@Nullable String);
    method @Nullable public CharSequence getCharSequence(@Nullable String);
    method public CharSequence getCharSequence(@Nullable String, CharSequence);
    method @Nullable public CharSequence[] getCharSequenceArray(@Nullable String);
    method @Nullable public java.util.ArrayList<java.lang.CharSequence> getCharSequenceArrayList(@Nullable String);
    method public ClassLoader getClassLoader();
    method public float getFloat(String);
    method public float getFloat(String, float);
    method @Nullable public float[] getFloatArray(@Nullable String);
    method @Nullable public java.util.ArrayList<java.lang.Integer> getIntegerArrayList(@Nullable String);
    method @Nullable public <T extends android.os.Parcelable> T getParcelable(@Nullable String);
    method @Nullable public android.os.Parcelable[] getParcelableArray(@Nullable String);
    method @Nullable public <T extends android.os.Parcelable> java.util.ArrayList<T> getParcelableArrayList(@Nullable String);
    method @Nullable public java.io.Serializable getSerializable(@Nullable String);
    method public short getShort(String);
    method public short getShort(String, short);
    method @Nullable public short[] getShortArray(@Nullable String);
    method @Nullable public android.util.Size getSize(@Nullable String);
    method @Nullable public android.util.SizeF getSizeF(@Nullable String);
    method @Nullable public <T extends android.os.Parcelable> android.util.SparseArray<T> getSparseParcelableArray(@Nullable String);
    method @Nullable public java.util.ArrayList<java.lang.String> getStringArrayList(@Nullable String);
    method public boolean hasFileDescriptors();
    method public void putAll(android.os.Bundle);
    method public void putBinder(@Nullable String, @Nullable android.os.IBinder);
    method public void putBundle(@Nullable String, @Nullable android.os.Bundle);
    method public void putByte(@Nullable String, byte);
    method public void putByteArray(@Nullable String, @Nullable byte[]);
    method public void putChar(@Nullable String, char);
    method public void putCharArray(@Nullable String, @Nullable char[]);
    method public void putCharSequence(@Nullable String, @Nullable CharSequence);
    method public void putCharSequenceArray(@Nullable String, @Nullable CharSequence[]);
    method public void putCharSequenceArrayList(@Nullable String, @Nullable java.util.ArrayList<java.lang.CharSequence>);
    method public void putFloat(@Nullable String, float);
    method public void putFloatArray(@Nullable String, @Nullable float[]);
    method public void putIntegerArrayList(@Nullable String, @Nullable java.util.ArrayList<java.lang.Integer>);
    method public void putParcelable(@Nullable String, @Nullable android.os.Parcelable);
    method public void putParcelableArray(@Nullable String, @Nullable android.os.Parcelable[]);
    method public void putParcelableArrayList(@Nullable String, @Nullable java.util.ArrayList<? extends android.os.Parcelable>);
    method public void putSerializable(@Nullable String, @Nullable java.io.Serializable);
    method public void putShort(@Nullable String, short);
    method public void putShortArray(@Nullable String, @Nullable short[]);
    method public void putSize(@Nullable String, @Nullable android.util.Size);
    method public void putSizeF(@Nullable String, @Nullable android.util.SizeF);
    method public void putSparseParcelableArray(@Nullable String, @Nullable android.util.SparseArray<? extends android.os.Parcelable>);
    method public void putStringArrayList(@Nullable String, @Nullable java.util.ArrayList<java.lang.String>);
    method public void readFromParcel(android.os.Parcel);
    method public void setClassLoader(ClassLoader);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.Bundle> CREATOR;
    field public static final android.os.Bundle EMPTY;
  }

  public final class CancellationSignal {
    ctor public CancellationSignal();
    method public void cancel();
    method public boolean isCanceled();
    method public void setOnCancelListener(android.os.CancellationSignal.OnCancelListener);
    method public void throwIfCanceled();
  }

  public static interface CancellationSignal.OnCancelListener {
    method public void onCancel();
  }

  public class ConditionVariable {
    ctor public ConditionVariable();
    ctor public ConditionVariable(boolean);
    method public void block();
    method public boolean block(long);
    method public void close();
    method public void open();
  }

  public abstract class CountDownTimer {
    ctor public CountDownTimer(long, long);
    method public final void cancel();
    method public abstract void onFinish();
    method public abstract void onTick(long);
    method public final android.os.CountDownTimer start();
  }

  public final class CpuUsageInfo implements android.os.Parcelable {
    method public int describeContents();
    method public long getActive();
    method public long getTotal();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.CpuUsageInfo> CREATOR;
  }

  public class DeadObjectException extends android.os.RemoteException {
    ctor public DeadObjectException();
    ctor public DeadObjectException(String);
  }

  public class DeadSystemException extends android.os.DeadObjectException {
    ctor public DeadSystemException();
  }

  public final class Debug {
    method public static void attachJvmtiAgent(@NonNull String, @Nullable String, @Nullable ClassLoader) throws java.io.IOException;
    method @Deprecated public static void changeDebugPort(int);
    method public static void dumpHprofData(String) throws java.io.IOException;
    method public static boolean dumpService(String, java.io.FileDescriptor, String[]);
    method public static void enableEmulatorTraceOutput();
    method public static int getBinderDeathObjectCount();
    method public static int getBinderLocalObjectCount();
    method public static int getBinderProxyObjectCount();
    method public static int getBinderReceivedTransactions();
    method public static int getBinderSentTransactions();
    method @Deprecated public static int getGlobalAllocCount();
    method @Deprecated public static int getGlobalAllocSize();
    method @Deprecated public static int getGlobalClassInitCount();
    method @Deprecated public static int getGlobalClassInitTime();
    method @Deprecated public static int getGlobalExternalAllocCount();
    method @Deprecated public static int getGlobalExternalAllocSize();
    method @Deprecated public static int getGlobalExternalFreedCount();
    method @Deprecated public static int getGlobalExternalFreedSize();
    method @Deprecated public static int getGlobalFreedCount();
    method @Deprecated public static int getGlobalFreedSize();
    method @Deprecated public static int getGlobalGcInvocationCount();
    method public static int getLoadedClassCount();
    method public static void getMemoryInfo(android.os.Debug.MemoryInfo);
    method public static long getNativeHeapAllocatedSize();
    method public static long getNativeHeapFreeSize();
    method public static long getNativeHeapSize();
    method public static long getPss();
    method public static String getRuntimeStat(String);
    method public static java.util.Map<java.lang.String,java.lang.String> getRuntimeStats();
    method @Deprecated public static int getThreadAllocCount();
    method @Deprecated public static int getThreadAllocSize();
    method @Deprecated public static int getThreadExternalAllocCount();
    method @Deprecated public static int getThreadExternalAllocSize();
    method @Deprecated public static int getThreadGcInvocationCount();
    method public static boolean isDebuggerConnected();
    method public static void printLoadedClasses(int);
    method @Deprecated public static void resetAllCounts();
    method @Deprecated public static void resetGlobalAllocCount();
    method @Deprecated public static void resetGlobalAllocSize();
    method @Deprecated public static void resetGlobalClassInitCount();
    method @Deprecated public static void resetGlobalClassInitTime();
    method @Deprecated public static void resetGlobalExternalAllocCount();
    method @Deprecated public static void resetGlobalExternalAllocSize();
    method @Deprecated public static void resetGlobalExternalFreedCount();
    method @Deprecated public static void resetGlobalExternalFreedSize();
    method @Deprecated public static void resetGlobalFreedCount();
    method @Deprecated public static void resetGlobalFreedSize();
    method @Deprecated public static void resetGlobalGcInvocationCount();
    method @Deprecated public static void resetThreadAllocCount();
    method @Deprecated public static void resetThreadAllocSize();
    method @Deprecated public static void resetThreadExternalAllocCount();
    method @Deprecated public static void resetThreadExternalAllocSize();
    method @Deprecated public static void resetThreadGcInvocationCount();
    method @Deprecated public static int setAllocationLimit(int);
    method @Deprecated public static int setGlobalAllocationLimit(int);
    method @Deprecated public static void startAllocCounting();
    method public static void startMethodTracing();
    method public static void startMethodTracing(String);
    method public static void startMethodTracing(String, int);
    method public static void startMethodTracing(String, int, int);
    method public static void startMethodTracingSampling(String, int, int);
    method public static void startNativeTracing();
    method @Deprecated public static void stopAllocCounting();
    method public static void stopMethodTracing();
    method public static void stopNativeTracing();
    method public static long threadCpuTimeNanos();
    method public static void waitForDebugger();
    method public static boolean waitingForDebugger();
    field public static final int SHOW_CLASSLOADER = 2; // 0x2
    field public static final int SHOW_FULL_DETAIL = 1; // 0x1
    field public static final int SHOW_INITIALIZED = 4; // 0x4
    field @Deprecated public static final int TRACE_COUNT_ALLOCS = 1; // 0x1
  }

  @Deprecated public static class Debug.InstructionCount {
    ctor @Deprecated public Debug.InstructionCount();
    method @Deprecated public boolean collect();
    method @Deprecated public int globalMethodInvocations();
    method @Deprecated public int globalTotal();
    method @Deprecated public boolean resetAndStart();
  }

  public static class Debug.MemoryInfo implements android.os.Parcelable {
    ctor public Debug.MemoryInfo();
    method public int describeContents();
    method public String getMemoryStat(String);
    method public java.util.Map<java.lang.String,java.lang.String> getMemoryStats();
    method public int getTotalPrivateClean();
    method public int getTotalPrivateDirty();
    method public int getTotalPss();
    method public int getTotalSharedClean();
    method public int getTotalSharedDirty();
    method public int getTotalSwappablePss();
    method public void readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.Debug.MemoryInfo> CREATOR;
    field public int dalvikPrivateDirty;
    field public int dalvikPss;
    field public int dalvikSharedDirty;
    field public int nativePrivateDirty;
    field public int nativePss;
    field public int nativeSharedDirty;
    field public int otherPrivateDirty;
    field public int otherPss;
    field public int otherSharedDirty;
  }

  public class DropBoxManager {
    ctor protected DropBoxManager();
    method public void addData(String, byte[], int);
    method public void addFile(String, java.io.File, int) throws java.io.IOException;
    method public void addText(String, String);
    method @RequiresPermission(allOf={android.Manifest.permission.READ_LOGS, android.Manifest.permission.PACKAGE_USAGE_STATS}) @Nullable public android.os.DropBoxManager.Entry getNextEntry(String, long);
    method public boolean isTagEnabled(String);
    field public static final String ACTION_DROPBOX_ENTRY_ADDED = "android.intent.action.DROPBOX_ENTRY_ADDED";
    field public static final String EXTRA_TAG = "tag";
    field public static final String EXTRA_TIME = "time";
    field public static final int IS_EMPTY = 1; // 0x1
    field public static final int IS_GZIPPED = 4; // 0x4
    field public static final int IS_TEXT = 2; // 0x2
  }

  public static class DropBoxManager.Entry implements java.io.Closeable android.os.Parcelable {
    ctor public DropBoxManager.Entry(String, long);
    ctor public DropBoxManager.Entry(String, long, String);
    ctor public DropBoxManager.Entry(String, long, byte[], int);
    ctor public DropBoxManager.Entry(String, long, android.os.ParcelFileDescriptor, int);
    ctor public DropBoxManager.Entry(String, long, java.io.File, int) throws java.io.IOException;
    method public void close();
    method public int describeContents();
    method public int getFlags();
    method public java.io.InputStream getInputStream() throws java.io.IOException;
    method public String getTag();
    method public String getText(int);
    method public long getTimeMillis();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.DropBoxManager.Entry> CREATOR;
  }

  public class Environment {
    ctor public Environment();
    method public static java.io.File getDataDirectory();
    method public static java.io.File getDownloadCacheDirectory();
    method public static java.io.File getExternalStorageDirectory();
    method public static java.io.File getExternalStoragePublicDirectory(String);
    method public static String getExternalStorageState();
    method public static String getExternalStorageState(java.io.File);
    method public static java.io.File getRootDirectory();
    method @Deprecated public static String getStorageState(java.io.File);
    method public static boolean isExternalStorageEmulated();
    method public static boolean isExternalStorageEmulated(java.io.File);
    method public static boolean isExternalStorageRemovable();
    method public static boolean isExternalStorageRemovable(java.io.File);
    field public static String DIRECTORY_ALARMS;
    field public static String DIRECTORY_DCIM;
    field public static String DIRECTORY_DOCUMENTS;
    field public static String DIRECTORY_DOWNLOADS;
    field public static String DIRECTORY_MOVIES;
    field public static String DIRECTORY_MUSIC;
    field public static String DIRECTORY_NOTIFICATIONS;
    field public static String DIRECTORY_PICTURES;
    field public static String DIRECTORY_PODCASTS;
    field public static String DIRECTORY_RINGTONES;
    field public static final String MEDIA_BAD_REMOVAL = "bad_removal";
    field public static final String MEDIA_CHECKING = "checking";
    field public static final String MEDIA_EJECTING = "ejecting";
    field public static final String MEDIA_MOUNTED = "mounted";
    field public static final String MEDIA_MOUNTED_READ_ONLY = "mounted_ro";
    field public static final String MEDIA_NOFS = "nofs";
    field public static final String MEDIA_REMOVED = "removed";
    field public static final String MEDIA_SHARED = "shared";
    field public static final String MEDIA_UNKNOWN = "unknown";
    field public static final String MEDIA_UNMOUNTABLE = "unmountable";
    field public static final String MEDIA_UNMOUNTED = "unmounted";
  }

  public abstract class FileObserver {
    ctor public FileObserver(String);
    ctor public FileObserver(String, int);
    method protected void finalize();
    method public abstract void onEvent(int, @Nullable String);
    method public void startWatching();
    method public void stopWatching();
    field public static final int ACCESS = 1; // 0x1
    field public static final int ALL_EVENTS = 4095; // 0xfff
    field public static final int ATTRIB = 4; // 0x4
    field public static final int CLOSE_NOWRITE = 16; // 0x10
    field public static final int CLOSE_WRITE = 8; // 0x8
    field public static final int CREATE = 256; // 0x100
    field public static final int DELETE = 512; // 0x200
    field public static final int DELETE_SELF = 1024; // 0x400
    field public static final int MODIFY = 2; // 0x2
    field public static final int MOVED_FROM = 64; // 0x40
    field public static final int MOVED_TO = 128; // 0x80
    field public static final int MOVE_SELF = 2048; // 0x800
    field public static final int OPEN = 32; // 0x20
  }

  public class FileUriExposedException extends java.lang.RuntimeException {
    ctor public FileUriExposedException(String);
  }

  public class Handler {
    ctor public Handler();
    ctor public Handler(android.os.Handler.Callback);
    ctor public Handler(android.os.Looper);
    ctor public Handler(android.os.Looper, android.os.Handler.Callback);
    method @NonNull public static android.os.Handler createAsync(@NonNull android.os.Looper);
    method @NonNull public static android.os.Handler createAsync(@NonNull android.os.Looper, @NonNull android.os.Handler.Callback);
    method public void dispatchMessage(android.os.Message);
    method public final void dump(android.util.Printer, String);
    method public final android.os.Looper getLooper();
    method public String getMessageName(android.os.Message);
    method public void handleMessage(android.os.Message);
    method public final boolean hasMessages(int);
    method public final boolean hasMessages(int, Object);
    method public final android.os.Message obtainMessage();
    method public final android.os.Message obtainMessage(int);
    method public final android.os.Message obtainMessage(int, Object);
    method public final android.os.Message obtainMessage(int, int, int);
    method public final android.os.Message obtainMessage(int, int, int, Object);
    method public final boolean post(Runnable);
    method public final boolean postAtFrontOfQueue(Runnable);
    method public final boolean postAtTime(Runnable, long);
    method public final boolean postAtTime(Runnable, Object, long);
    method public final boolean postDelayed(Runnable, long);
    method public final boolean postDelayed(Runnable, Object, long);
    method public final void removeCallbacks(Runnable);
    method public final void removeCallbacks(Runnable, Object);
    method public final void removeCallbacksAndMessages(Object);
    method public final void removeMessages(int);
    method public final void removeMessages(int, Object);
    method public final boolean sendEmptyMessage(int);
    method public final boolean sendEmptyMessageAtTime(int, long);
    method public final boolean sendEmptyMessageDelayed(int, long);
    method public final boolean sendMessage(android.os.Message);
    method public final boolean sendMessageAtFrontOfQueue(android.os.Message);
    method public boolean sendMessageAtTime(android.os.Message, long);
    method public final boolean sendMessageDelayed(android.os.Message, long);
  }

  public static interface Handler.Callback {
    method public boolean handleMessage(android.os.Message);
  }

  public class HandlerThread extends java.lang.Thread {
    ctor public HandlerThread(String);
    ctor public HandlerThread(String, int);
    method public android.os.Looper getLooper();
    method public int getThreadId();
    method protected void onLooperPrepared();
    method public boolean quit();
    method public boolean quitSafely();
  }

  public class HardwarePropertiesManager {
    method @NonNull public android.os.CpuUsageInfo[] getCpuUsages();
    method @NonNull public float[] getDeviceTemperatures(int, int);
    method @NonNull public float[] getFanSpeeds();
    field public static final int DEVICE_TEMPERATURE_BATTERY = 2; // 0x2
    field public static final int DEVICE_TEMPERATURE_CPU = 0; // 0x0
    field public static final int DEVICE_TEMPERATURE_GPU = 1; // 0x1
    field public static final int DEVICE_TEMPERATURE_SKIN = 3; // 0x3
    field public static final int TEMPERATURE_CURRENT = 0; // 0x0
    field public static final int TEMPERATURE_SHUTDOWN = 2; // 0x2
    field public static final int TEMPERATURE_THROTTLING = 1; // 0x1
    field public static final int TEMPERATURE_THROTTLING_BELOW_VR_MIN = 3; // 0x3
    field public static final float UNDEFINED_TEMPERATURE = -3.4028235E38f;
  }

  public interface IBinder {
    method public void dump(@NonNull java.io.FileDescriptor, @Nullable String[]) throws android.os.RemoteException;
    method public void dumpAsync(@NonNull java.io.FileDescriptor, @Nullable String[]) throws android.os.RemoteException;
    method @Nullable public String getInterfaceDescriptor() throws android.os.RemoteException;
    method public boolean isBinderAlive();
    method public void linkToDeath(@NonNull android.os.IBinder.DeathRecipient, int) throws android.os.RemoteException;
    method public boolean pingBinder();
    method @Nullable public android.os.IInterface queryLocalInterface(@NonNull String);
    method public boolean transact(int, @NonNull android.os.Parcel, @Nullable android.os.Parcel, int) throws android.os.RemoteException;
    method public boolean unlinkToDeath(@NonNull android.os.IBinder.DeathRecipient, int);
    field public static final int DUMP_TRANSACTION = 1598311760; // 0x5f444d50
    field public static final int FIRST_CALL_TRANSACTION = 1; // 0x1
    field public static final int FLAG_ONEWAY = 1; // 0x1
    field public static final int INTERFACE_TRANSACTION = 1598968902; // 0x5f4e5446
    field public static final int LAST_CALL_TRANSACTION = 16777215; // 0xffffff
    field public static final int LIKE_TRANSACTION = 1598835019; // 0x5f4c494b
    field public static final int PING_TRANSACTION = 1599098439; // 0x5f504e47
    field public static final int TWEET_TRANSACTION = 1599362900; // 0x5f545754
  }

  public static interface IBinder.DeathRecipient {
    method public void binderDied();
  }

  public interface IInterface {
    method public android.os.IBinder asBinder();
  }

  public final class LocaleList implements android.os.Parcelable {
    ctor public LocaleList(@NonNull java.util.Locale...);
    method public int describeContents();
    method @NonNull public static android.os.LocaleList forLanguageTags(@Nullable String);
    method public java.util.Locale get(int);
    method @NonNull @Size(min=1) public static android.os.LocaleList getAdjustedDefault();
    method @NonNull @Size(min=1) public static android.os.LocaleList getDefault();
    method @NonNull public static android.os.LocaleList getEmptyLocaleList();
    method @Nullable public java.util.Locale getFirstMatch(String[]);
    method @IntRange(from=0xffffffff) public int indexOf(java.util.Locale);
    method public boolean isEmpty();
    method public static void setDefault(@NonNull @Size(min=1) android.os.LocaleList);
    method @IntRange(from=0) public int size();
    method @NonNull public String toLanguageTags();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.LocaleList> CREATOR;
  }

  public final class Looper {
    method public void dump(@NonNull android.util.Printer, @NonNull String);
    method public static android.os.Looper getMainLooper();
    method @NonNull public android.os.MessageQueue getQueue();
    method @NonNull public Thread getThread();
    method public boolean isCurrentThread();
    method public static void loop();
    method @Nullable public static android.os.Looper myLooper();
    method @NonNull public static android.os.MessageQueue myQueue();
    method public static void prepare();
    method public static void prepareMainLooper();
    method public void quit();
    method public void quitSafely();
    method public void setMessageLogging(@Nullable android.util.Printer);
  }

  public class MemoryFile {
    ctor public MemoryFile(String, int) throws java.io.IOException;
    method @Deprecated public boolean allowPurging(boolean) throws java.io.IOException;
    method public void close();
    method public java.io.InputStream getInputStream();
    method public java.io.OutputStream getOutputStream();
    method @Deprecated public boolean isPurgingAllowed();
    method public int length();
    method public int readBytes(byte[], int, int, int) throws java.io.IOException;
    method public void writeBytes(byte[], int, int, int) throws java.io.IOException;
  }

  public final class Message implements android.os.Parcelable {
    ctor public Message();
    method public void copyFrom(android.os.Message);
    method public int describeContents();
    method public Runnable getCallback();
    method public android.os.Bundle getData();
    method public android.os.Handler getTarget();
    method public long getWhen();
    method public boolean isAsynchronous();
    method public static android.os.Message obtain();
    method public static android.os.Message obtain(android.os.Message);
    method public static android.os.Message obtain(android.os.Handler);
    method public static android.os.Message obtain(android.os.Handler, Runnable);
    method public static android.os.Message obtain(android.os.Handler, int);
    method public static android.os.Message obtain(android.os.Handler, int, Object);
    method public static android.os.Message obtain(android.os.Handler, int, int, int);
    method public static android.os.Message obtain(android.os.Handler, int, int, int, Object);
    method public android.os.Bundle peekData();
    method public void recycle();
    method public void sendToTarget();
    method public void setAsynchronous(boolean);
    method public void setData(android.os.Bundle);
    method public void setTarget(android.os.Handler);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.Message> CREATOR;
    field public int arg1;
    field public int arg2;
    field public Object obj;
    field public android.os.Messenger replyTo;
    field public int sendingUid;
    field public int what;
  }

  public final class MessageQueue {
    method public void addIdleHandler(@NonNull android.os.MessageQueue.IdleHandler);
    method public void addOnFileDescriptorEventListener(@NonNull java.io.FileDescriptor, int, @NonNull android.os.MessageQueue.OnFileDescriptorEventListener);
    method public boolean isIdle();
    method public void removeIdleHandler(@NonNull android.os.MessageQueue.IdleHandler);
    method public void removeOnFileDescriptorEventListener(@NonNull java.io.FileDescriptor);
  }

  public static interface MessageQueue.IdleHandler {
    method public boolean queueIdle();
  }

  public static interface MessageQueue.OnFileDescriptorEventListener {
    method public int onFileDescriptorEvents(@NonNull java.io.FileDescriptor, int);
    field public static final int EVENT_ERROR = 4; // 0x4
    field public static final int EVENT_INPUT = 1; // 0x1
    field public static final int EVENT_OUTPUT = 2; // 0x2
  }

  public final class Messenger implements android.os.Parcelable {
    ctor public Messenger(android.os.Handler);
    ctor public Messenger(android.os.IBinder);
    method public int describeContents();
    method public android.os.IBinder getBinder();
    method public static android.os.Messenger readMessengerOrNullFromParcel(android.os.Parcel);
    method public void send(android.os.Message) throws android.os.RemoteException;
    method public static void writeMessengerOrNullToParcel(android.os.Messenger, android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.Messenger> CREATOR;
  }

  public class NetworkOnMainThreadException extends java.lang.RuntimeException {
    ctor public NetworkOnMainThreadException();
  }

  public class OperationCanceledException extends java.lang.RuntimeException {
    ctor public OperationCanceledException();
    ctor public OperationCanceledException(String);
  }

  public final class Parcel {
    method public void appendFrom(android.os.Parcel, int, int);
    method @Nullable public android.os.IBinder[] createBinderArray();
    method @Nullable public java.util.ArrayList<android.os.IBinder> createBinderArrayList();
    method @Nullable public boolean[] createBooleanArray();
    method @Nullable public byte[] createByteArray();
    method @Nullable public char[] createCharArray();
    method @Nullable public double[] createDoubleArray();
    method @Nullable public float[] createFloatArray();
    method @Nullable public int[] createIntArray();
    method @Nullable public long[] createLongArray();
    method @Nullable public String[] createStringArray();
    method @Nullable public java.util.ArrayList<java.lang.String> createStringArrayList();
    method @Nullable public <T> T[] createTypedArray(@NonNull android.os.Parcelable.Creator<T>);
    method @Nullable public <T> java.util.ArrayList<T> createTypedArrayList(@NonNull android.os.Parcelable.Creator<T>);
    method public int dataAvail();
    method public int dataCapacity();
    method public int dataPosition();
    method public int dataSize();
    method public void enforceInterface(String);
    method public boolean hasFileDescriptors();
    method public byte[] marshall();
    method @NonNull public static android.os.Parcel obtain();
    method @Nullable public Object[] readArray(@Nullable ClassLoader);
    method @Nullable public java.util.ArrayList readArrayList(@Nullable ClassLoader);
    method public void readBinderArray(android.os.IBinder[]);
    method public void readBinderList(java.util.List<android.os.IBinder>);
    method public void readBooleanArray(boolean[]);
    method @Nullable public android.os.Bundle readBundle();
    method @Nullable public android.os.Bundle readBundle(@Nullable ClassLoader);
    method public byte readByte();
    method public void readByteArray(byte[]);
    method public void readCharArray(char[]);
    method public double readDouble();
    method public void readDoubleArray(double[]);
    method public void readException();
    method public void readException(int, String);
    method public android.os.ParcelFileDescriptor readFileDescriptor();
    method public float readFloat();
    method public void readFloatArray(float[]);
    method @Nullable public java.util.HashMap readHashMap(@Nullable ClassLoader);
    method public int readInt();
    method public void readIntArray(int[]);
    method public void readList(java.util.List, ClassLoader);
    method public long readLong();
    method public void readLongArray(long[]);
    method public void readMap(java.util.Map, ClassLoader);
    method @Nullable public <T extends android.os.Parcelable> T readParcelable(@Nullable ClassLoader);
    method @Nullable public android.os.Parcelable[] readParcelableArray(@Nullable ClassLoader);
    method @Nullable public android.os.PersistableBundle readPersistableBundle();
    method @Nullable public android.os.PersistableBundle readPersistableBundle(@Nullable ClassLoader);
    method @Nullable public java.io.Serializable readSerializable();
    method @NonNull public android.util.Size readSize();
    method @NonNull public android.util.SizeF readSizeF();
    method @Nullable public android.util.SparseArray readSparseArray(@Nullable ClassLoader);
    method @Nullable public android.util.SparseBooleanArray readSparseBooleanArray();
    method @Nullable public String readString();
    method public void readStringArray(String[]);
    method public void readStringList(java.util.List<java.lang.String>);
    method public android.os.IBinder readStrongBinder();
    method public <T> void readTypedArray(T[], android.os.Parcelable.Creator<T>);
    method public <T> void readTypedList(java.util.List<T>, android.os.Parcelable.Creator<T>);
    method @Nullable public <T> T readTypedObject(@NonNull android.os.Parcelable.Creator<T>);
    method @Nullable public Object readValue(@Nullable ClassLoader);
    method public void recycle();
    method public void setDataCapacity(int);
    method public void setDataPosition(int);
    method public void setDataSize(int);
    method public void unmarshall(byte[], int, int);
    method public void writeArray(Object[]);
    method public void writeBinderArray(android.os.IBinder[]);
    method public void writeBinderList(java.util.List<android.os.IBinder>);
    method public void writeBooleanArray(boolean[]);
    method public void writeBundle(android.os.Bundle);
    method public void writeByte(byte);
    method public void writeByteArray(byte[]);
    method public void writeByteArray(byte[], int, int);
    method public void writeCharArray(char[]);
    method public void writeDouble(double);
    method public void writeDoubleArray(double[]);
    method public void writeException(Exception);
    method public void writeFileDescriptor(java.io.FileDescriptor);
    method public void writeFloat(float);
    method public void writeFloatArray(float[]);
    method public void writeInt(int);
    method public void writeIntArray(int[]);
    method public void writeInterfaceToken(String);
    method public void writeList(java.util.List);
    method public void writeLong(long);
    method public void writeLongArray(long[]);
    method public void writeMap(java.util.Map);
    method public void writeNoException();
    method public void writeParcelable(android.os.Parcelable, int);
    method public <T extends android.os.Parcelable> void writeParcelableArray(T[], int);
    method public void writePersistableBundle(android.os.PersistableBundle);
    method public void writeSerializable(java.io.Serializable);
    method public void writeSize(android.util.Size);
    method public void writeSizeF(android.util.SizeF);
    method public void writeSparseArray(android.util.SparseArray<java.lang.Object>);
    method public void writeSparseBooleanArray(android.util.SparseBooleanArray);
    method public void writeString(String);
    method public void writeStringArray(String[]);
    method public void writeStringList(java.util.List<java.lang.String>);
    method public void writeStrongBinder(android.os.IBinder);
    method public void writeStrongInterface(android.os.IInterface);
    method public <T extends android.os.Parcelable> void writeTypedArray(T[], int);
    method public <T extends android.os.Parcelable> void writeTypedList(java.util.List<T>);
    method public <T extends android.os.Parcelable> void writeTypedObject(T, int);
    method public void writeValue(Object);
    field public static final android.os.Parcelable.Creator<java.lang.String> STRING_CREATOR;
  }

  public class ParcelFileDescriptor implements java.io.Closeable android.os.Parcelable {
    ctor public ParcelFileDescriptor(android.os.ParcelFileDescriptor);
    method public static android.os.ParcelFileDescriptor adoptFd(int);
    method public boolean canDetectErrors();
    method public void checkError() throws java.io.IOException;
    method public void close() throws java.io.IOException;
    method public void closeWithError(String) throws java.io.IOException;
    method public static android.os.ParcelFileDescriptor[] createPipe() throws java.io.IOException;
    method public static android.os.ParcelFileDescriptor[] createReliablePipe() throws java.io.IOException;
    method public static android.os.ParcelFileDescriptor[] createReliableSocketPair() throws java.io.IOException;
    method public static android.os.ParcelFileDescriptor[] createSocketPair() throws java.io.IOException;
    method public int describeContents();
    method public int detachFd();
    method public static android.os.ParcelFileDescriptor dup(java.io.FileDescriptor) throws java.io.IOException;
    method public android.os.ParcelFileDescriptor dup() throws java.io.IOException;
    method public static android.os.ParcelFileDescriptor fromDatagramSocket(java.net.DatagramSocket);
    method public static android.os.ParcelFileDescriptor fromFd(int) throws java.io.IOException;
    method public static android.os.ParcelFileDescriptor fromSocket(java.net.Socket);
    method public int getFd();
    method public java.io.FileDescriptor getFileDescriptor();
    method public long getStatSize();
    method public static android.os.ParcelFileDescriptor open(java.io.File, int) throws java.io.FileNotFoundException;
    method public static android.os.ParcelFileDescriptor open(java.io.File, int, android.os.Handler, android.os.ParcelFileDescriptor.OnCloseListener) throws java.io.IOException;
    method public static int parseMode(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.ParcelFileDescriptor> CREATOR;
    field public static final int MODE_APPEND = 33554432; // 0x2000000
    field public static final int MODE_CREATE = 134217728; // 0x8000000
    field public static final int MODE_READ_ONLY = 268435456; // 0x10000000
    field public static final int MODE_READ_WRITE = 805306368; // 0x30000000
    field public static final int MODE_TRUNCATE = 67108864; // 0x4000000
    field @Deprecated public static final int MODE_WORLD_READABLE = 1; // 0x1
    field @Deprecated public static final int MODE_WORLD_WRITEABLE = 2; // 0x2
    field public static final int MODE_WRITE_ONLY = 536870912; // 0x20000000
  }

  public static class ParcelFileDescriptor.AutoCloseInputStream extends java.io.FileInputStream {
    ctor public ParcelFileDescriptor.AutoCloseInputStream(android.os.ParcelFileDescriptor);
  }

  public static class ParcelFileDescriptor.AutoCloseOutputStream extends java.io.FileOutputStream {
    ctor public ParcelFileDescriptor.AutoCloseOutputStream(android.os.ParcelFileDescriptor);
  }

  public static class ParcelFileDescriptor.FileDescriptorDetachedException extends java.io.IOException {
    ctor public ParcelFileDescriptor.FileDescriptorDetachedException();
  }

  public static interface ParcelFileDescriptor.OnCloseListener {
    method public void onClose(java.io.IOException);
  }

  public class ParcelFormatException extends java.lang.RuntimeException {
    ctor public ParcelFormatException();
    ctor public ParcelFormatException(String);
  }

  public final class ParcelUuid implements android.os.Parcelable {
    ctor public ParcelUuid(java.util.UUID);
    method public int describeContents();
    method public static android.os.ParcelUuid fromString(String);
    method public java.util.UUID getUuid();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.ParcelUuid> CREATOR;
  }

  public interface Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CONTENTS_FILE_DESCRIPTOR = 1; // 0x1
    field public static final int PARCELABLE_WRITE_RETURN_VALUE = 1; // 0x1
  }

  public static interface Parcelable.ClassLoaderCreator<T> extends android.os.Parcelable.Creator<T> {
    method public T createFromParcel(android.os.Parcel, ClassLoader);
  }

  public static interface Parcelable.Creator<T> {
    method public T createFromParcel(android.os.Parcel);
    method public T[] newArray(int);
  }

  public class PatternMatcher implements android.os.Parcelable {
    ctor public PatternMatcher(String, int);
    ctor public PatternMatcher(android.os.Parcel);
    method public int describeContents();
    method public final String getPath();
    method public final int getType();
    method public boolean match(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.PatternMatcher> CREATOR;
    field public static final int PATTERN_ADVANCED_GLOB = 3; // 0x3
    field public static final int PATTERN_LITERAL = 0; // 0x0
    field public static final int PATTERN_PREFIX = 1; // 0x1
    field public static final int PATTERN_SIMPLE_GLOB = 2; // 0x2
  }

  public final class PersistableBundle extends android.os.BaseBundle implements java.lang.Cloneable android.os.Parcelable {
    ctor public PersistableBundle();
    ctor public PersistableBundle(int);
    ctor public PersistableBundle(android.os.PersistableBundle);
    method public Object clone();
    method public android.os.PersistableBundle deepCopy();
    method public int describeContents();
    method @Nullable public android.os.PersistableBundle getPersistableBundle(@Nullable String);
    method public void putPersistableBundle(@Nullable String, @Nullable android.os.PersistableBundle);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.PersistableBundle> CREATOR;
    field public static final android.os.PersistableBundle EMPTY;
  }

  public final class PowerManager {
    method public int getLocationPowerSaveMode();
    method public boolean isDeviceIdleMode();
    method public boolean isIgnoringBatteryOptimizations(String);
    method public boolean isInteractive();
    method public boolean isPowerSaveMode();
    method @Deprecated public boolean isScreenOn();
    method public boolean isSustainedPerformanceModeSupported();
    method public boolean isWakeLockLevelSupported(int);
    method public android.os.PowerManager.WakeLock newWakeLock(int, String);
    method public void reboot(String);
    field public static final int ACQUIRE_CAUSES_WAKEUP = 268435456; // 0x10000000
    field public static final String ACTION_DEVICE_IDLE_MODE_CHANGED = "android.os.action.DEVICE_IDLE_MODE_CHANGED";
    field public static final String ACTION_POWER_SAVE_MODE_CHANGED = "android.os.action.POWER_SAVE_MODE_CHANGED";
    field @Deprecated public static final int FULL_WAKE_LOCK = 26; // 0x1a
    field public static final int LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF = 2; // 0x2
    field public static final int LOCATION_MODE_FOREGROUND_ONLY = 3; // 0x3
    field public static final int LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF = 1; // 0x1
    field public static final int LOCATION_MODE_NO_CHANGE = 0; // 0x0
    field public static final int ON_AFTER_RELEASE = 536870912; // 0x20000000
    field public static final int PARTIAL_WAKE_LOCK = 1; // 0x1
    field public static final int PROXIMITY_SCREEN_OFF_WAKE_LOCK = 32; // 0x20
    field public static final int RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY = 1; // 0x1
    field @Deprecated public static final int SCREEN_BRIGHT_WAKE_LOCK = 10; // 0xa
    field @Deprecated public static final int SCREEN_DIM_WAKE_LOCK = 6; // 0x6
  }

  public final class PowerManager.WakeLock {
    method public void acquire();
    method public void acquire(long);
    method public boolean isHeld();
    method public void release();
    method public void release(int);
    method public void setReferenceCounted(boolean);
    method public void setWorkSource(android.os.WorkSource);
  }

  public class Process {
    ctor public Process();
    method public static final long getElapsedCpuTime();
    method public static final int[] getExclusiveCores();
    method public static final int getGidForName(String);
    method public static final long getStartElapsedRealtime();
    method public static final long getStartUptimeMillis();
    method public static final int getThreadPriority(int) throws java.lang.IllegalArgumentException;
    method public static final int getUidForName(String);
    method public static final boolean is64Bit();
    method public static boolean isApplicationUid(int);
    method public static final boolean isIsolated();
    method public static final void killProcess(int);
    method public static final int myPid();
    method public static final int myTid();
    method public static final int myUid();
    method public static android.os.UserHandle myUserHandle();
    method public static final void sendSignal(int, int);
    method public static final void setThreadPriority(int, int) throws java.lang.IllegalArgumentException, java.lang.SecurityException;
    method public static final void setThreadPriority(int) throws java.lang.IllegalArgumentException, java.lang.SecurityException;
    method @Deprecated public static final boolean supportsProcesses();
    field public static final int BLUETOOTH_UID = 1002; // 0x3ea
    field public static final int FIRST_APPLICATION_UID = 10000; // 0x2710
    field public static final int INVALID_UID = -1; // 0xffffffff
    field public static final int LAST_APPLICATION_UID = 19999; // 0x4e1f
    field public static final int PHONE_UID = 1001; // 0x3e9
    field public static final int ROOT_UID = 0; // 0x0
    field public static final int SHELL_UID = 2000; // 0x7d0
    field public static final int SIGNAL_KILL = 9; // 0x9
    field public static final int SIGNAL_QUIT = 3; // 0x3
    field public static final int SIGNAL_USR1 = 10; // 0xa
    field public static final int SYSTEM_UID = 1000; // 0x3e8
    field public static final int THREAD_PRIORITY_AUDIO = -16; // 0xfffffff0
    field public static final int THREAD_PRIORITY_BACKGROUND = 10; // 0xa
    field public static final int THREAD_PRIORITY_DEFAULT = 0; // 0x0
    field public static final int THREAD_PRIORITY_DISPLAY = -4; // 0xfffffffc
    field public static final int THREAD_PRIORITY_FOREGROUND = -2; // 0xfffffffe
    field public static final int THREAD_PRIORITY_LESS_FAVORABLE = 1; // 0x1
    field public static final int THREAD_PRIORITY_LOWEST = 19; // 0x13
    field public static final int THREAD_PRIORITY_MORE_FAVORABLE = -1; // 0xffffffff
    field public static final int THREAD_PRIORITY_URGENT_AUDIO = -19; // 0xffffffed
    field public static final int THREAD_PRIORITY_URGENT_DISPLAY = -8; // 0xfffffff8
    field public static final int THREAD_PRIORITY_VIDEO = -10; // 0xfffffff6
  }

  public abstract class ProxyFileDescriptorCallback {
    ctor public ProxyFileDescriptorCallback();
    method public void onFsync() throws android.system.ErrnoException;
    method public long onGetSize() throws android.system.ErrnoException;
    method public int onRead(long, int, byte[]) throws android.system.ErrnoException;
    method public abstract void onRelease();
    method public int onWrite(long, int, byte[]) throws android.system.ErrnoException;
  }

  public class RecoverySystem {
    method @RequiresPermission("android.permission.RECOVERY") public static void installPackage(android.content.Context, java.io.File) throws java.io.IOException;
    method public static void rebootWipeCache(android.content.Context) throws java.io.IOException;
    method public static void rebootWipeUserData(android.content.Context) throws java.io.IOException;
    method public static void verifyPackage(java.io.File, android.os.RecoverySystem.ProgressListener, java.io.File) throws java.security.GeneralSecurityException, java.io.IOException;
  }

  public static interface RecoverySystem.ProgressListener {
    method public void onProgress(int);
  }

  public class RemoteCallbackList<E extends android.os.IInterface> {
    ctor public RemoteCallbackList();
    method public int beginBroadcast();
    method public void finishBroadcast();
    method public Object getBroadcastCookie(int);
    method public E getBroadcastItem(int);
    method public Object getRegisteredCallbackCookie(int);
    method public int getRegisteredCallbackCount();
    method public E getRegisteredCallbackItem(int);
    method public void kill();
    method public void onCallbackDied(E);
    method public void onCallbackDied(E, Object);
    method public boolean register(E);
    method public boolean register(E, Object);
    method public boolean unregister(E);
  }

  public class RemoteException extends android.util.AndroidException {
    ctor public RemoteException();
    ctor public RemoteException(String);
  }

  public class ResultReceiver implements android.os.Parcelable {
    ctor public ResultReceiver(android.os.Handler);
    method public int describeContents();
    method protected void onReceiveResult(int, android.os.Bundle);
    method public void send(int, android.os.Bundle);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.ResultReceiver> CREATOR;
  }

  public final class SharedMemory implements java.io.Closeable android.os.Parcelable {
    method public void close();
    method @NonNull public static android.os.SharedMemory create(@Nullable String, int) throws android.system.ErrnoException;
    method public int describeContents();
    method public int getSize();
    method @NonNull public java.nio.ByteBuffer map(int, int, int) throws android.system.ErrnoException;
    method @NonNull public java.nio.ByteBuffer mapReadOnly() throws android.system.ErrnoException;
    method @NonNull public java.nio.ByteBuffer mapReadWrite() throws android.system.ErrnoException;
    method public boolean setProtect(int);
    method public static void unmap(@NonNull java.nio.ByteBuffer);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.SharedMemory> CREATOR;
  }

  public class StatFs {
    ctor public StatFs(String);
    method @Deprecated public int getAvailableBlocks();
    method public long getAvailableBlocksLong();
    method public long getAvailableBytes();
    method @Deprecated public int getBlockCount();
    method public long getBlockCountLong();
    method @Deprecated public int getBlockSize();
    method public long getBlockSizeLong();
    method @Deprecated public int getFreeBlocks();
    method public long getFreeBlocksLong();
    method public long getFreeBytes();
    method public long getTotalBytes();
    method public void restat(String);
  }

  public final class StrictMode {
    method public static android.os.StrictMode.ThreadPolicy allowThreadDiskReads();
    method public static android.os.StrictMode.ThreadPolicy allowThreadDiskWrites();
    method public static void enableDefaults();
    method public static android.os.StrictMode.ThreadPolicy getThreadPolicy();
    method public static android.os.StrictMode.VmPolicy getVmPolicy();
    method public static void noteSlowCall(String);
    method public static void setThreadPolicy(android.os.StrictMode.ThreadPolicy);
    method public static void setVmPolicy(android.os.StrictMode.VmPolicy);
  }

  public static interface StrictMode.OnThreadViolationListener {
    method public void onThreadViolation(android.os.strictmode.Violation);
  }

  public static interface StrictMode.OnVmViolationListener {
    method public void onVmViolation(android.os.strictmode.Violation);
  }

  public static final class StrictMode.ThreadPolicy {
    field public static final android.os.StrictMode.ThreadPolicy LAX;
  }

  public static final class StrictMode.ThreadPolicy.Builder {
    ctor public StrictMode.ThreadPolicy.Builder();
    ctor public StrictMode.ThreadPolicy.Builder(android.os.StrictMode.ThreadPolicy);
    method public android.os.StrictMode.ThreadPolicy build();
    method public android.os.StrictMode.ThreadPolicy.Builder detectAll();
    method public android.os.StrictMode.ThreadPolicy.Builder detectCustomSlowCalls();
    method public android.os.StrictMode.ThreadPolicy.Builder detectDiskReads();
    method public android.os.StrictMode.ThreadPolicy.Builder detectDiskWrites();
    method public android.os.StrictMode.ThreadPolicy.Builder detectNetwork();
    method public android.os.StrictMode.ThreadPolicy.Builder detectResourceMismatches();
    method public android.os.StrictMode.ThreadPolicy.Builder detectUnbufferedIo();
    method public android.os.StrictMode.ThreadPolicy.Builder penaltyDeath();
    method public android.os.StrictMode.ThreadPolicy.Builder penaltyDeathOnNetwork();
    method public android.os.StrictMode.ThreadPolicy.Builder penaltyDialog();
    method public android.os.StrictMode.ThreadPolicy.Builder penaltyDropBox();
    method public android.os.StrictMode.ThreadPolicy.Builder penaltyFlashScreen();
    method public android.os.StrictMode.ThreadPolicy.Builder penaltyListener(@NonNull java.util.concurrent.Executor, @NonNull android.os.StrictMode.OnThreadViolationListener);
    method public android.os.StrictMode.ThreadPolicy.Builder penaltyLog();
    method public android.os.StrictMode.ThreadPolicy.Builder permitAll();
    method public android.os.StrictMode.ThreadPolicy.Builder permitCustomSlowCalls();
    method public android.os.StrictMode.ThreadPolicy.Builder permitDiskReads();
    method public android.os.StrictMode.ThreadPolicy.Builder permitDiskWrites();
    method public android.os.StrictMode.ThreadPolicy.Builder permitNetwork();
    method public android.os.StrictMode.ThreadPolicy.Builder permitResourceMismatches();
    method public android.os.StrictMode.ThreadPolicy.Builder permitUnbufferedIo();
  }

  public static final class StrictMode.VmPolicy {
    field public static final android.os.StrictMode.VmPolicy LAX;
  }

  public static final class StrictMode.VmPolicy.Builder {
    ctor public StrictMode.VmPolicy.Builder();
    ctor public StrictMode.VmPolicy.Builder(android.os.StrictMode.VmPolicy);
    method public android.os.StrictMode.VmPolicy build();
    method public android.os.StrictMode.VmPolicy.Builder detectActivityLeaks();
    method public android.os.StrictMode.VmPolicy.Builder detectAll();
    method public android.os.StrictMode.VmPolicy.Builder detectCleartextNetwork();
    method public android.os.StrictMode.VmPolicy.Builder detectContentUriWithoutPermission();
    method public android.os.StrictMode.VmPolicy.Builder detectFileUriExposure();
    method public android.os.StrictMode.VmPolicy.Builder detectLeakedClosableObjects();
    method public android.os.StrictMode.VmPolicy.Builder detectLeakedRegistrationObjects();
    method public android.os.StrictMode.VmPolicy.Builder detectLeakedSqlLiteObjects();
    method public android.os.StrictMode.VmPolicy.Builder detectNonSdkApiUsage();
    method public android.os.StrictMode.VmPolicy.Builder detectUntaggedSockets();
    method public android.os.StrictMode.VmPolicy.Builder penaltyDeath();
    method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnCleartextNetwork();
    method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnFileUriExposure();
    method public android.os.StrictMode.VmPolicy.Builder penaltyDropBox();
    method public android.os.StrictMode.VmPolicy.Builder penaltyListener(@NonNull java.util.concurrent.Executor, @NonNull android.os.StrictMode.OnVmViolationListener);
    method public android.os.StrictMode.VmPolicy.Builder penaltyLog();
    method public android.os.StrictMode.VmPolicy.Builder permitNonSdkApiUsage();
    method public android.os.StrictMode.VmPolicy.Builder setClassInstanceLimit(Class, int);
  }

  public final class SystemClock {
    method public static long currentThreadTimeMillis();
    method public static long elapsedRealtime();
    method public static long elapsedRealtimeNanos();
    method public static boolean setCurrentTimeMillis(long);
    method public static void sleep(long);
    method public static long uptimeMillis();
  }

  public class TestLooperManager {
    method public void execute(android.os.Message);
    method public android.os.MessageQueue getMessageQueue();
    method public boolean hasMessages(android.os.Handler, Object, int);
    method public boolean hasMessages(android.os.Handler, Object, Runnable);
    method public android.os.Message next();
    method public void recycle(android.os.Message);
    method public void release();
  }

  public abstract class TokenWatcher {
    ctor public TokenWatcher(android.os.Handler, String);
    method public void acquire(android.os.IBinder, String);
    method public abstract void acquired();
    method public void cleanup(android.os.IBinder, boolean);
    method public void dump();
    method public void dump(java.io.PrintWriter);
    method public boolean isAcquired();
    method public void release(android.os.IBinder);
    method public abstract void released();
  }

  public final class Trace {
    method public static void beginSection(String);
    method public static void endSection();
  }

  public class TransactionTooLargeException extends android.os.RemoteException {
    ctor public TransactionTooLargeException();
    ctor public TransactionTooLargeException(String);
  }

  public final class UserHandle implements android.os.Parcelable {
    ctor public UserHandle(android.os.Parcel);
    method public int describeContents();
    method public static android.os.UserHandle getUserHandleForUid(int);
    method public static android.os.UserHandle readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    method public static void writeToParcel(android.os.UserHandle, android.os.Parcel);
    field public static final android.os.Parcelable.Creator<android.os.UserHandle> CREATOR;
  }

  public class UserManager {
    method public static android.content.Intent createUserCreationIntent(@Nullable String, @Nullable String, @Nullable String, @Nullable android.os.PersistableBundle);
    method @WorkerThread public android.os.Bundle getApplicationRestrictions(String);
    method public long getSerialNumberForUser(android.os.UserHandle);
    method public int getUserCount();
    method public long getUserCreationTime(android.os.UserHandle);
    method public android.os.UserHandle getUserForSerialNumber(long);
    method public String getUserName();
    method public java.util.List<android.os.UserHandle> getUserProfiles();
    method public android.os.Bundle getUserRestrictions();
    method public android.os.Bundle getUserRestrictions(android.os.UserHandle);
    method public boolean hasUserRestriction(String);
    method public boolean isDemoUser();
    method public boolean isQuietModeEnabled(android.os.UserHandle);
    method public boolean isSystemUser();
    method public boolean isUserAGoat();
    method public boolean isUserRunning(android.os.UserHandle);
    method public boolean isUserRunningOrStopping(android.os.UserHandle);
    method public boolean isUserUnlocked();
    method public boolean isUserUnlocked(android.os.UserHandle);
    method public boolean requestQuietModeEnabled(boolean, @NonNull android.os.UserHandle);
    method @Deprecated public boolean setRestrictionsChallenge(String);
    method @Deprecated public void setUserRestriction(String, boolean);
    method @Deprecated public void setUserRestrictions(android.os.Bundle);
    method @Deprecated public void setUserRestrictions(android.os.Bundle, android.os.UserHandle);
    method public static boolean supportsMultipleUsers();
    field public static final String ALLOW_PARENT_PROFILE_APP_LINKING = "allow_parent_profile_app_linking";
    field public static final String DISALLOW_ADD_MANAGED_PROFILE = "no_add_managed_profile";
    field public static final String DISALLOW_ADD_USER = "no_add_user";
    field public static final String DISALLOW_ADJUST_VOLUME = "no_adjust_volume";
    field public static final String DISALLOW_AIRPLANE_MODE = "no_airplane_mode";
    field public static final String DISALLOW_AMBIENT_DISPLAY = "no_ambient_display";
    field public static final String DISALLOW_APPS_CONTROL = "no_control_apps";
    field public static final String DISALLOW_AUTOFILL = "no_autofill";
    field public static final String DISALLOW_BLUETOOTH = "no_bluetooth";
    field public static final String DISALLOW_BLUETOOTH_SHARING = "no_bluetooth_sharing";
    field public static final String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth";
    field public static final String DISALLOW_CONFIG_BRIGHTNESS = "no_config_brightness";
    field public static final String DISALLOW_CONFIG_CELL_BROADCASTS = "no_config_cell_broadcasts";
    field public static final String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials";
    field public static final String DISALLOW_CONFIG_DATE_TIME = "no_config_date_time";
    field public static final String DISALLOW_CONFIG_LOCALE = "no_config_locale";
    field public static final String DISALLOW_CONFIG_LOCATION = "no_config_location";
    field public static final String DISALLOW_CONFIG_MOBILE_NETWORKS = "no_config_mobile_networks";
    field public static final String DISALLOW_CONFIG_SCREEN_TIMEOUT = "no_config_screen_timeout";
    field public static final String DISALLOW_CONFIG_TETHERING = "no_config_tethering";
    field public static final String DISALLOW_CONFIG_VPN = "no_config_vpn";
    field public static final String DISALLOW_CONFIG_WIFI = "no_config_wifi";
    field public static final String DISALLOW_CREATE_WINDOWS = "no_create_windows";
    field public static final String DISALLOW_CROSS_PROFILE_COPY_PASTE = "no_cross_profile_copy_paste";
    field public static final String DISALLOW_DATA_ROAMING = "no_data_roaming";
    field public static final String DISALLOW_DEBUGGING_FEATURES = "no_debugging_features";
    field public static final String DISALLOW_FACTORY_RESET = "no_factory_reset";
    field public static final String DISALLOW_FUN = "no_fun";
    field public static final String DISALLOW_INSTALL_APPS = "no_install_apps";
    field public static final String DISALLOW_INSTALL_UNKNOWN_SOURCES = "no_install_unknown_sources";
    field public static final String DISALLOW_MODIFY_ACCOUNTS = "no_modify_accounts";
    field public static final String DISALLOW_MOUNT_PHYSICAL_MEDIA = "no_physical_media";
    field public static final String DISALLOW_NETWORK_RESET = "no_network_reset";
    field public static final String DISALLOW_OUTGOING_BEAM = "no_outgoing_beam";
    field public static final String DISALLOW_OUTGOING_CALLS = "no_outgoing_calls";
    field public static final String DISALLOW_PRINTING = "no_printing";
    field public static final String DISALLOW_REMOVE_MANAGED_PROFILE = "no_remove_managed_profile";
    field public static final String DISALLOW_REMOVE_USER = "no_remove_user";
    field public static final String DISALLOW_SAFE_BOOT = "no_safe_boot";
    field public static final String DISALLOW_SET_USER_ICON = "no_set_user_icon";
    field public static final String DISALLOW_SET_WALLPAPER = "no_set_wallpaper";
    field public static final String DISALLOW_SHARE_INTO_MANAGED_PROFILE = "no_sharing_into_profile";
    field public static final String DISALLOW_SHARE_LOCATION = "no_share_location";
    field public static final String DISALLOW_SMS = "no_sms";
    field public static final String DISALLOW_SYSTEM_ERROR_DIALOGS = "no_system_error_dialogs";
    field public static final String DISALLOW_UNIFIED_PASSWORD = "no_unified_password";
    field public static final String DISALLOW_UNINSTALL_APPS = "no_uninstall_apps";
    field public static final String DISALLOW_UNMUTE_MICROPHONE = "no_unmute_microphone";
    field public static final String DISALLOW_USB_FILE_TRANSFER = "no_usb_file_transfer";
    field public static final String DISALLOW_USER_SWITCH = "no_user_switch";
    field public static final String ENSURE_VERIFY_APPS = "ensure_verify_apps";
    field public static final String KEY_RESTRICTIONS_PENDING = "restrictions_pending";
    field public static final int USER_CREATION_FAILED_NOT_PERMITTED = 1; // 0x1
    field public static final int USER_CREATION_FAILED_NO_MORE_USERS = 2; // 0x2
    field public static final int USER_OPERATION_ERROR_CURRENT_USER = 4; // 0x4
    field public static final int USER_OPERATION_ERROR_LOW_STORAGE = 5; // 0x5
    field public static final int USER_OPERATION_ERROR_MANAGED_PROFILE = 2; // 0x2
    field public static final int USER_OPERATION_ERROR_MAX_RUNNING_USERS = 3; // 0x3
    field public static final int USER_OPERATION_ERROR_MAX_USERS = 6; // 0x6
    field public static final int USER_OPERATION_ERROR_UNKNOWN = 1; // 0x1
    field public static final int USER_OPERATION_SUCCESS = 0; // 0x0
  }

  public static class UserManager.UserOperationException extends java.lang.RuntimeException {
    method public int getUserOperationResult();
  }

  public abstract class VibrationEffect implements android.os.Parcelable {
    method public static android.os.VibrationEffect createOneShot(long, int);
    method public static android.os.VibrationEffect createWaveform(long[], int);
    method public static android.os.VibrationEffect createWaveform(long[], int[], int);
    method public int describeContents();
    field public static final android.os.Parcelable.Creator<android.os.VibrationEffect> CREATOR;
    field public static final int DEFAULT_AMPLITUDE = -1; // 0xffffffff
  }

  public abstract class Vibrator {
    method @RequiresPermission(android.Manifest.permission.VIBRATE) public abstract void cancel();
    method public abstract boolean hasAmplitudeControl();
    method public abstract boolean hasVibrator();
    method @Deprecated @RequiresPermission(android.Manifest.permission.VIBRATE) public void vibrate(long);
    method @Deprecated @RequiresPermission(android.Manifest.permission.VIBRATE) public void vibrate(long, android.media.AudioAttributes);
    method @Deprecated @RequiresPermission(android.Manifest.permission.VIBRATE) public void vibrate(long[], int);
    method @Deprecated @RequiresPermission(android.Manifest.permission.VIBRATE) public void vibrate(long[], int, android.media.AudioAttributes);
    method @RequiresPermission(android.Manifest.permission.VIBRATE) public void vibrate(android.os.VibrationEffect);
    method @RequiresPermission(android.Manifest.permission.VIBRATE) public void vibrate(android.os.VibrationEffect, android.media.AudioAttributes);
  }

  public class WorkSource implements android.os.Parcelable {
    ctor public WorkSource();
    ctor public WorkSource(android.os.WorkSource);
    method public boolean add(android.os.WorkSource);
    method public void clear();
    method public int describeContents();
    method public boolean diff(android.os.WorkSource);
    method public boolean remove(android.os.WorkSource);
    method public void set(android.os.WorkSource);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.WorkSource> CREATOR;
  }

}

package android.os.health {

  public class HealthStats {
    method public String getDataType();
    method public long getMeasurement(int);
    method public int getMeasurementKeyAt(int);
    method public int getMeasurementKeyCount();
    method public java.util.Map<java.lang.String,java.lang.Long> getMeasurements(int);
    method public int getMeasurementsKeyAt(int);
    method public int getMeasurementsKeyCount();
    method public java.util.Map<java.lang.String,android.os.health.HealthStats> getStats(int);
    method public int getStatsKeyAt(int);
    method public int getStatsKeyCount();
    method public android.os.health.TimerStat getTimer(int);
    method public int getTimerCount(int);
    method public int getTimerKeyAt(int);
    method public int getTimerKeyCount();
    method public long getTimerTime(int);
    method public java.util.Map<java.lang.String,android.os.health.TimerStat> getTimers(int);
    method public int getTimersKeyAt(int);
    method public int getTimersKeyCount();
    method public boolean hasMeasurement(int);
    method public boolean hasMeasurements(int);
    method public boolean hasStats(int);
    method public boolean hasTimer(int);
    method public boolean hasTimers(int);
  }

  public final class PackageHealthStats {
    field public static final int MEASUREMENTS_WAKEUP_ALARMS_COUNT = 40002; // 0x9c42
    field public static final int STATS_SERVICES = 40001; // 0x9c41
  }

  public final class PidHealthStats {
    field public static final int MEASUREMENT_WAKE_NESTING_COUNT = 20001; // 0x4e21
    field public static final int MEASUREMENT_WAKE_START_MS = 20003; // 0x4e23
    field public static final int MEASUREMENT_WAKE_SUM_MS = 20002; // 0x4e22
  }

  public final class ProcessHealthStats {
    field public static final int MEASUREMENT_ANR_COUNT = 30005; // 0x7535
    field public static final int MEASUREMENT_CRASHES_COUNT = 30004; // 0x7534
    field public static final int MEASUREMENT_FOREGROUND_MS = 30006; // 0x7536
    field public static final int MEASUREMENT_STARTS_COUNT = 30003; // 0x7533
    field public static final int MEASUREMENT_SYSTEM_TIME_MS = 30002; // 0x7532
    field public static final int MEASUREMENT_USER_TIME_MS = 30001; // 0x7531
  }

  public final class ServiceHealthStats {
    field public static final int MEASUREMENT_LAUNCH_COUNT = 50002; // 0xc352
    field public static final int MEASUREMENT_START_SERVICE_COUNT = 50001; // 0xc351
  }

  public class SystemHealthManager {
    method public android.os.health.HealthStats takeMyUidSnapshot();
    method public android.os.health.HealthStats takeUidSnapshot(int);
    method public android.os.health.HealthStats[] takeUidSnapshots(int[]);
  }

  public final class TimerStat implements android.os.Parcelable {
    ctor public TimerStat();
    ctor public TimerStat(int, long);
    ctor public TimerStat(android.os.Parcel);
    method public int describeContents();
    method public int getCount();
    method public long getTime();
    method public void setCount(int);
    method public void setTime(long);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.health.TimerStat> CREATOR;
  }

  public final class UidHealthStats {
    field public static final int MEASUREMENT_BLUETOOTH_IDLE_MS = 10020; // 0x2724
    field public static final int MEASUREMENT_BLUETOOTH_POWER_MAMS = 10023; // 0x2727
    field public static final int MEASUREMENT_BLUETOOTH_RX_BYTES = 10052; // 0x2744
    field public static final int MEASUREMENT_BLUETOOTH_RX_MS = 10021; // 0x2725
    field public static final int MEASUREMENT_BLUETOOTH_RX_PACKETS = 10058; // 0x274a
    field public static final int MEASUREMENT_BLUETOOTH_TX_BYTES = 10053; // 0x2745
    field public static final int MEASUREMENT_BLUETOOTH_TX_MS = 10022; // 0x2726
    field public static final int MEASUREMENT_BLUETOOTH_TX_PACKETS = 10059; // 0x274b
    field public static final int MEASUREMENT_BUTTON_USER_ACTIVITY_COUNT = 10046; // 0x273e
    field @Deprecated public static final int MEASUREMENT_CPU_POWER_MAMS = 10064; // 0x2750
    field public static final int MEASUREMENT_MOBILE_IDLE_MS = 10024; // 0x2728
    field public static final int MEASUREMENT_MOBILE_POWER_MAMS = 10027; // 0x272b
    field public static final int MEASUREMENT_MOBILE_RX_BYTES = 10048; // 0x2740
    field public static final int MEASUREMENT_MOBILE_RX_MS = 10025; // 0x2729
    field public static final int MEASUREMENT_MOBILE_RX_PACKETS = 10054; // 0x2746
    field public static final int MEASUREMENT_MOBILE_TX_BYTES = 10049; // 0x2741
    field public static final int MEASUREMENT_MOBILE_TX_MS = 10026; // 0x272a
    field public static final int MEASUREMENT_MOBILE_TX_PACKETS = 10055; // 0x2747
    field public static final int MEASUREMENT_OTHER_USER_ACTIVITY_COUNT = 10045; // 0x273d
    field public static final int MEASUREMENT_REALTIME_BATTERY_MS = 10001; // 0x2711
    field public static final int MEASUREMENT_REALTIME_SCREEN_OFF_BATTERY_MS = 10003; // 0x2713
    field public static final int MEASUREMENT_SYSTEM_CPU_TIME_MS = 10063; // 0x274f
    field public static final int MEASUREMENT_TOUCH_USER_ACTIVITY_COUNT = 10047; // 0x273f
    field public static final int MEASUREMENT_UPTIME_BATTERY_MS = 10002; // 0x2712
    field public static final int MEASUREMENT_UPTIME_SCREEN_OFF_BATTERY_MS = 10004; // 0x2714
    field public static final int MEASUREMENT_USER_CPU_TIME_MS = 10062; // 0x274e
    field public static final int MEASUREMENT_WIFI_FULL_LOCK_MS = 10029; // 0x272d
    field public static final int MEASUREMENT_WIFI_IDLE_MS = 10016; // 0x2720
    field public static final int MEASUREMENT_WIFI_MULTICAST_MS = 10031; // 0x272f
    field public static final int MEASUREMENT_WIFI_POWER_MAMS = 10019; // 0x2723
    field public static final int MEASUREMENT_WIFI_RUNNING_MS = 10028; // 0x272c
    field public static final int MEASUREMENT_WIFI_RX_BYTES = 10050; // 0x2742
    field public static final int MEASUREMENT_WIFI_RX_MS = 10017; // 0x2721
    field public static final int MEASUREMENT_WIFI_RX_PACKETS = 10056; // 0x2748
    field public static final int MEASUREMENT_WIFI_TX_BYTES = 10051; // 0x2743
    field public static final int MEASUREMENT_WIFI_TX_MS = 10018; // 0x2722
    field public static final int MEASUREMENT_WIFI_TX_PACKETS = 10057; // 0x2749
    field public static final int STATS_PACKAGES = 10015; // 0x271f
    field public static final int STATS_PIDS = 10013; // 0x271d
    field public static final int STATS_PROCESSES = 10014; // 0x271e
    field public static final int TIMERS_JOBS = 10010; // 0x271a
    field public static final int TIMERS_SENSORS = 10012; // 0x271c
    field public static final int TIMERS_SYNCS = 10009; // 0x2719
    field public static final int TIMERS_WAKELOCKS_DRAW = 10008; // 0x2718
    field public static final int TIMERS_WAKELOCKS_FULL = 10005; // 0x2715
    field public static final int TIMERS_WAKELOCKS_PARTIAL = 10006; // 0x2716
    field public static final int TIMERS_WAKELOCKS_WINDOW = 10007; // 0x2717
    field public static final int TIMER_AUDIO = 10032; // 0x2730
    field public static final int TIMER_BLUETOOTH_SCAN = 10037; // 0x2735
    field public static final int TIMER_CAMERA = 10035; // 0x2733
    field public static final int TIMER_FLASHLIGHT = 10034; // 0x2732
    field public static final int TIMER_FOREGROUND_ACTIVITY = 10036; // 0x2734
    field public static final int TIMER_GPS_SENSOR = 10011; // 0x271b
    field public static final int TIMER_MOBILE_RADIO_ACTIVE = 10061; // 0x274d
    field public static final int TIMER_PROCESS_STATE_BACKGROUND_MS = 10042; // 0x273a
    field public static final int TIMER_PROCESS_STATE_CACHED_MS = 10043; // 0x273b
    field public static final int TIMER_PROCESS_STATE_FOREGROUND_MS = 10041; // 0x2739
    field public static final int TIMER_PROCESS_STATE_FOREGROUND_SERVICE_MS = 10039; // 0x2737
    field public static final int TIMER_PROCESS_STATE_TOP_MS = 10038; // 0x2736
    field public static final int TIMER_PROCESS_STATE_TOP_SLEEPING_MS = 10040; // 0x2738
    field public static final int TIMER_VIBRATOR = 10044; // 0x273c
    field public static final int TIMER_VIDEO = 10033; // 0x2731
    field public static final int TIMER_WIFI_SCAN = 10030; // 0x272e
  }

}

package android.os.storage {

  public abstract class OnObbStateChangeListener {
    ctor public OnObbStateChangeListener();
    method public void onObbStateChange(String, int);
    field public static final int ERROR_ALREADY_MOUNTED = 24; // 0x18
    field public static final int ERROR_COULD_NOT_MOUNT = 21; // 0x15
    field public static final int ERROR_COULD_NOT_UNMOUNT = 22; // 0x16
    field public static final int ERROR_INTERNAL = 20; // 0x14
    field public static final int ERROR_NOT_MOUNTED = 23; // 0x17
    field public static final int ERROR_PERMISSION_DENIED = 25; // 0x19
    field public static final int MOUNTED = 1; // 0x1
    field public static final int UNMOUNTED = 2; // 0x2
  }

  public class StorageManager {
    method @WorkerThread public void allocateBytes(@NonNull java.util.UUID, long) throws java.io.IOException;
    method @WorkerThread public void allocateBytes(java.io.FileDescriptor, long) throws java.io.IOException;
    method @WorkerThread public long getAllocatableBytes(@NonNull java.util.UUID) throws java.io.IOException;
    method @WorkerThread public long getCacheQuotaBytes(@NonNull java.util.UUID) throws java.io.IOException;
    method @WorkerThread public long getCacheSizeBytes(@NonNull java.util.UUID) throws java.io.IOException;
    method public String getMountedObbPath(String);
    method @NonNull public android.os.storage.StorageVolume getPrimaryStorageVolume();
    method @Nullable public android.os.storage.StorageVolume getStorageVolume(java.io.File);
    method @NonNull public java.util.List<android.os.storage.StorageVolume> getStorageVolumes();
    method @NonNull public java.util.UUID getUuidForPath(@NonNull java.io.File) throws java.io.IOException;
    method public boolean isAllocationSupported(@NonNull java.io.FileDescriptor);
    method public boolean isCacheBehaviorGroup(java.io.File) throws java.io.IOException;
    method public boolean isCacheBehaviorTombstone(java.io.File) throws java.io.IOException;
    method public boolean isEncrypted(java.io.File);
    method public boolean isObbMounted(String);
    method public boolean mountObb(String, String, android.os.storage.OnObbStateChangeListener);
    method @NonNull public android.os.ParcelFileDescriptor openProxyFileDescriptor(int, android.os.ProxyFileDescriptorCallback, android.os.Handler) throws java.io.IOException;
    method public void setCacheBehaviorGroup(java.io.File, boolean) throws java.io.IOException;
    method public void setCacheBehaviorTombstone(java.io.File, boolean) throws java.io.IOException;
    method public boolean unmountObb(String, boolean, android.os.storage.OnObbStateChangeListener);
    field public static final String ACTION_MANAGE_STORAGE = "android.os.storage.action.MANAGE_STORAGE";
    field public static final String EXTRA_REQUESTED_BYTES = "android.os.storage.extra.REQUESTED_BYTES";
    field public static final String EXTRA_UUID = "android.os.storage.extra.UUID";
    field public static final java.util.UUID UUID_DEFAULT;
  }

  public final class StorageVolume implements android.os.Parcelable {
    method @Nullable public android.content.Intent createAccessIntent(String);
    method public int describeContents();
    method public String getDescription(android.content.Context);
    method public String getState();
    method @Nullable public String getUuid();
    method public boolean isEmulated();
    method public boolean isPrimary();
    method public boolean isRemovable();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.storage.StorageVolume> CREATOR;
    field public static final String EXTRA_STORAGE_VOLUME = "android.os.storage.extra.STORAGE_VOLUME";
  }

}

package android.os.strictmode {

  public final class CleartextNetworkViolation extends android.os.strictmode.Violation {
  }

  public final class ContentUriWithoutPermissionViolation extends android.os.strictmode.Violation {
  }

  public final class CustomViolation extends android.os.strictmode.Violation {
  }

  public final class DiskReadViolation extends android.os.strictmode.Violation {
  }

  public final class DiskWriteViolation extends android.os.strictmode.Violation {
  }

  public final class FileUriExposedViolation extends android.os.strictmode.Violation {
  }

  public class InstanceCountViolation extends android.os.strictmode.Violation {
    method public long getNumberOfInstances();
  }

  public final class IntentReceiverLeakedViolation extends android.os.strictmode.Violation {
  }

  public final class LeakedClosableViolation extends android.os.strictmode.Violation {
  }

  public final class NetworkViolation extends android.os.strictmode.Violation {
  }

  public final class NonSdkApiUsedViolation extends android.os.strictmode.Violation {
  }

  public final class ResourceMismatchViolation extends android.os.strictmode.Violation {
  }

  public final class ServiceConnectionLeakedViolation extends android.os.strictmode.Violation {
  }

  public final class SqliteObjectLeakedViolation extends android.os.strictmode.Violation {
  }

  public final class UnbufferedIoViolation extends android.os.strictmode.Violation {
  }

  public final class UntaggedSocketViolation extends android.os.strictmode.Violation {
  }

  public abstract class Violation extends java.lang.Throwable {
  }

  public final class WebViewMethodCalledOnWrongThreadViolation extends android.os.strictmode.Violation {
  }

}

package android.preference {

  public class CheckBoxPreference extends android.preference.TwoStatePreference {
    ctor public CheckBoxPreference(android.content.Context, android.util.AttributeSet, int);
    ctor public CheckBoxPreference(android.content.Context, android.util.AttributeSet, int, int);
    ctor public CheckBoxPreference(android.content.Context, android.util.AttributeSet);
    ctor public CheckBoxPreference(android.content.Context);
  }

  public abstract class DialogPreference extends android.preference.Preference implements android.content.DialogInterface.OnClickListener android.content.DialogInterface.OnDismissListener android.preference.PreferenceManager.OnActivityDestroyListener {
    ctor public DialogPreference(android.content.Context, android.util.AttributeSet, int, int);
    ctor public DialogPreference(android.content.Context, android.util.AttributeSet, int);
    ctor public DialogPreference(android.content.Context, android.util.AttributeSet);
    ctor public DialogPreference(android.content.Context);
    method public android.app.Dialog getDialog();
    method public android.graphics.drawable.Drawable getDialogIcon();
    method public int getDialogLayoutResource();
    method public CharSequence getDialogMessage();
    method public CharSequence getDialogTitle();
    method public CharSequence getNegativeButtonText();
    method public CharSequence getPositiveButtonText();
    method public void onActivityDestroy();
    method @CallSuper protected void onBindDialogView(android.view.View);
    method public void onClick(android.content.DialogInterface, int);
    method protected android.view.View onCreateDialogView();
    method protected void onDialogClosed(boolean);
    method public void onDismiss(android.content.DialogInterface);
    method protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder);
    method public void setDialogIcon(android.graphics.drawable.Drawable);
    method public void setDialogIcon(@DrawableRes int);
    method public void setDialogLayoutResource(int);
    method public void setDialogMessage(CharSequence);
    method public void setDialogMessage(int);
    method public void setDialogTitle(CharSequence);
    method public void setDialogTitle(int);
    method public void setNegativeButtonText(CharSequence);
    method public void setNegativeButtonText(@StringRes int);
    method public void setPositiveButtonText(CharSequence);
    method public void setPositiveButtonText(@StringRes int);
    method protected void showDialog(android.os.Bundle);
  }

  public class EditTextPreference extends android.preference.DialogPreference {
    ctor public EditTextPreference(android.content.Context, android.util.AttributeSet, int, int);
    ctor public EditTextPreference(android.content.Context, android.util.AttributeSet, int);
    ctor public EditTextPreference(android.content.Context, android.util.AttributeSet);
    ctor public EditTextPreference(android.content.Context);
    method public android.widget.EditText getEditText();
    method public String getText();
    method protected void onAddEditTextToDialogView(android.view.View, android.widget.EditText);
    method public void setText(String);
  }

  public class ListPreference extends android.preference.DialogPreference {
    ctor public ListPreference(android.content.Context, android.util.AttributeSet, int, int);
    ctor public ListPreference(android.content.Context, android.util.AttributeSet, int);
    ctor public ListPreference(android.content.Context, android.util.AttributeSet);
    ctor public ListPreference(android.content.Context);
    method public int findIndexOfValue(String);
    method public CharSequence[] getEntries();
    method public CharSequence getEntry();
    method public CharSequence[] getEntryValues();
    method public String getValue();
    method public void setEntries(CharSequence[]);
    method public void setEntries(@ArrayRes int);
    method public void setEntryValues(CharSequence[]);
    method public void setEntryValues(@ArrayRes int);
    method public void setValue(String);
    method public void setValueIndex(int);
  }

  public class MultiSelectListPreference extends android.preference.DialogPreference {
    ctor public MultiSelectListPreference(android.content.Context, android.util.AttributeSet, int, int);
    ctor public MultiSelectListPreference(android.content.Context, android.util.AttributeSet, int);
    ctor public MultiSelectListPreference(android.content.Context, android.util.AttributeSet);
    ctor public MultiSelectListPreference(android.content.Context);
    method public int findIndexOfValue(String);
    method public CharSequence[] getEntries();
    method public CharSequence[] getEntryValues();
    method public java.util.Set<java.lang.String> getValues();
    method public void setEntries(CharSequence[]);
    method public void setEntries(@ArrayRes int);
    method public void setEntryValues(CharSequence[]);
    method public void setEntryValues(@ArrayRes int);
    method public void setValues(java.util.Set<java.lang.String>);
  }

  public class Preference implements java.lang.Comparable<android.preference.Preference> {
    ctor public Preference(android.content.Context, android.util.AttributeSet, int, int);
    ctor public Preference(android.content.Context, android.util.AttributeSet, int);
    ctor public Preference(android.content.Context, android.util.AttributeSet);
    ctor public Preference(android.content.Context);
    method protected boolean callChangeListener(Object);
    method public int compareTo(android.preference.Preference);
    method protected android.preference.Preference findPreferenceInHierarchy(String);
    method public android.content.Context getContext();
    method public String getDependency();
    method public android.content.SharedPreferences.Editor getEditor();
    method public android.os.Bundle getExtras();
    method public String getFragment();
    method public android.graphics.drawable.Drawable getIcon();
    method public android.content.Intent getIntent();
    method public String getKey();
    method @LayoutRes public int getLayoutResource();
    method public android.preference.Preference.OnPreferenceChangeListener getOnPreferenceChangeListener();
    method public android.preference.Preference.OnPreferenceClickListener getOnPreferenceClickListener();
    method public int getOrder();
    method @Nullable public android.preference.PreferenceGroup getParent();
    method protected boolean getPersistedBoolean(boolean);
    method protected float getPersistedFloat(float);
    method protected int getPersistedInt(int);
    method protected long getPersistedLong(long);
    method protected String getPersistedString(String);
    method public java.util.Set<java.lang.String> getPersistedStringSet(java.util.Set<java.lang.String>);
    method @Nullable public android.preference.PreferenceDataStore getPreferenceDataStore();
    method public android.preference.PreferenceManager getPreferenceManager();
    method public android.content.SharedPreferences getSharedPreferences();
    method public boolean getShouldDisableView();
    method public CharSequence getSummary();
    method public CharSequence getTitle();
    method @StringRes public int getTitleRes();
    method public android.view.View getView(android.view.View, android.view.ViewGroup);
    method @LayoutRes public int getWidgetLayoutResource();
    method public boolean hasKey();
    method public boolean isEnabled();
    method public boolean isIconSpaceReserved();
    method public boolean isPersistent();
    method public boolean isRecycleEnabled();
    method public boolean isSelectable();
    method public boolean isSingleLineTitle();
    method protected void notifyChanged();
    method public void notifyDependencyChange(boolean);
    method protected void notifyHierarchyChanged();
    method protected void onAttachedToActivity();
    method protected void onAttachedToHierarchy(android.preference.PreferenceManager);
    method @CallSuper protected void onBindView(android.view.View);
    method protected void onClick();
    method @CallSuper protected android.view.View onCreateView(android.view.ViewGroup);
    method public void onDependencyChanged(android.preference.Preference, boolean);
    method protected Object onGetDefaultValue(android.content.res.TypedArray, int);
    method public void onParentChanged(android.preference.Preference, boolean);
    method @CallSuper protected void onPrepareForRemoval();
    method protected void onRestoreInstanceState(android.os.Parcelable);
    method protected android.os.Parcelable onSaveInstanceState();
    method protected void onSetInitialValue(boolean, Object);
    method public android.os.Bundle peekExtras();
    method protected boolean persistBoolean(boolean);
    method protected boolean persistFloat(float);
    method protected boolean persistInt(int);
    method protected boolean persistLong(long);
    method protected boolean persistString(String);
    method public boolean persistStringSet(java.util.Set<java.lang.String>);
    method public void restoreHierarchyState(android.os.Bundle);
    method public void saveHierarchyState(android.os.Bundle);
    method public void setDefaultValue(Object);
    method public void setDependency(String);
    method public void setEnabled(boolean);
    method public void setFragment(String);
    method public void setIcon(android.graphics.drawable.Drawable);
    method public void setIcon(@DrawableRes int);
    method public void setIconSpaceReserved(boolean);
    method public void setIntent(android.content.Intent);
    method public void setKey(String);
    method public void setLayoutResource(@LayoutRes int);
    method public void setOnPreferenceChangeListener(android.preference.Preference.OnPreferenceChangeListener);
    method public void setOnPreferenceClickListener(android.preference.Preference.OnPreferenceClickListener);
    method public void setOrder(int);
    method public void setPersistent(boolean);
    method public void setPreferenceDataStore(android.preference.PreferenceDataStore);
    method @CallSuper public void setRecycleEnabled(boolean);
    method public void setSelectable(boolean);
    method public void setShouldDisableView(boolean);
    method public void setSingleLineTitle(boolean);
    method public void setSummary(CharSequence);
    method public void setSummary(@StringRes int);
    method public void setTitle(CharSequence);
    method public void setTitle(@StringRes int);
    method public void setWidgetLayoutResource(@LayoutRes int);
    method public boolean shouldCommit();
    method public boolean shouldDisableDependents();
    method protected boolean shouldPersist();
    field public static final int DEFAULT_ORDER = 2147483647; // 0x7fffffff
  }

  public static class Preference.BaseSavedState extends android.view.AbsSavedState {
    ctor public Preference.BaseSavedState(android.os.Parcel);
    ctor public Preference.BaseSavedState(android.os.Parcelable);
    field public static final android.os.Parcelable.Creator<android.preference.Preference.BaseSavedState> CREATOR;
  }

  public static interface Preference.OnPreferenceChangeListener {
    method public boolean onPreferenceChange(android.preference.Preference, Object);
  }

  public static interface Preference.OnPreferenceClickListener {
    method public boolean onPreferenceClick(android.preference.Preference);
  }

  public abstract class PreferenceActivity extends android.app.ListActivity implements android.preference.PreferenceFragment.OnPreferenceStartFragmentCallback {
    ctor public PreferenceActivity();
    method @Deprecated public void addPreferencesFromIntent(android.content.Intent);
    method @Deprecated public void addPreferencesFromResource(int);
    method @Deprecated public android.preference.Preference findPreference(CharSequence);
    method public void finishPreferencePanel(android.app.Fragment, int, android.content.Intent);
    method @Deprecated public android.preference.PreferenceManager getPreferenceManager();
    method @Deprecated public android.preference.PreferenceScreen getPreferenceScreen();
    method public boolean hasHeaders();
    method public void invalidateHeaders();
    method public boolean isMultiPane();
    method protected boolean isValidFragment(String);
    method public void loadHeadersFromResource(@XmlRes int, java.util.List<android.preference.PreferenceActivity.Header>);
    method public void onBuildHeaders(java.util.List<android.preference.PreferenceActivity.Header>);
    method public android.content.Intent onBuildStartFragmentIntent(String, android.os.Bundle, @StringRes int, int);
    method public android.preference.PreferenceActivity.Header onGetInitialHeader();
    method public android.preference.PreferenceActivity.Header onGetNewHeader();
    method public void onHeaderClick(android.preference.PreferenceActivity.Header, int);
    method public boolean onIsHidingHeaders();
    method public boolean onIsMultiPane();
    method public boolean onPreferenceStartFragment(android.preference.PreferenceFragment, android.preference.Preference);
    method @Deprecated public boolean onPreferenceTreeClick(android.preference.PreferenceScreen, android.preference.Preference);
    method public void setListFooter(android.view.View);
    method public void setParentTitle(CharSequence, CharSequence, android.view.View.OnClickListener);
    method @Deprecated public void setPreferenceScreen(android.preference.PreferenceScreen);
    method public void showBreadCrumbs(CharSequence, CharSequence);
    method public void startPreferenceFragment(android.app.Fragment, boolean);
    method public void startPreferencePanel(String, android.os.Bundle, @StringRes int, CharSequence, android.app.Fragment, int);
    method public void startWithFragment(String, android.os.Bundle, android.app.Fragment, int);
    method public void startWithFragment(String, android.os.Bundle, android.app.Fragment, int, @StringRes int, @StringRes int);
    method public void switchToHeader(String, android.os.Bundle);
    method public void switchToHeader(android.preference.PreferenceActivity.Header);
    field public static final String EXTRA_NO_HEADERS = ":android:no_headers";
    field public static final String EXTRA_SHOW_FRAGMENT = ":android:show_fragment";
    field public static final String EXTRA_SHOW_FRAGMENT_ARGUMENTS = ":android:show_fragment_args";
    field public static final String EXTRA_SHOW_FRAGMENT_SHORT_TITLE = ":android:show_fragment_short_title";
    field public static final String EXTRA_SHOW_FRAGMENT_TITLE = ":android:show_fragment_title";
    field public static final long HEADER_ID_UNDEFINED = -1L; // 0xffffffffffffffffL
  }

  public static final class PreferenceActivity.Header implements android.os.Parcelable {
    ctor public PreferenceActivity.Header();
    method public int describeContents();
    method public CharSequence getBreadCrumbShortTitle(android.content.res.Resources);
    method public CharSequence getBreadCrumbTitle(android.content.res.Resources);
    method public CharSequence getSummary(android.content.res.Resources);
    method public CharSequence getTitle(android.content.res.Resources);
    method public void readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.preference.PreferenceActivity.Header> CREATOR;
    field public CharSequence breadCrumbShortTitle;
    field @StringRes public int breadCrumbShortTitleRes;
    field public CharSequence breadCrumbTitle;
    field @StringRes public int breadCrumbTitleRes;
    field public android.os.Bundle extras;
    field public String fragment;
    field public android.os.Bundle fragmentArguments;
    field public int iconRes;
    field public long id;
    field public android.content.Intent intent;
    field public CharSequence summary;
    field @StringRes public int summaryRes;
    field public CharSequence title;
    field @StringRes public int titleRes;
  }

  public class PreferenceCategory extends android.preference.PreferenceGroup {
    ctor public PreferenceCategory(android.content.Context, android.util.AttributeSet, int, int);
    ctor public PreferenceCategory(android.content.Context, android.util.AttributeSet, int);
    ctor public PreferenceCategory(android.content.Context, android.util.AttributeSet);
    ctor public PreferenceCategory(android.content.Context);
  }

  public interface PreferenceDataStore {
    method public default boolean getBoolean(String, boolean);
    method public default float getFloat(String, float);
    method public default int getInt(String, int);
    method public default long getLong(String, long);
    method @Nullable public default String getString(String, @Nullable String);
    method @Nullable public default java.util.Set<java.lang.String> getStringSet(String, @Nullable java.util.Set<java.lang.String>);
    method public default void putBoolean(String, boolean);
    method public default void putFloat(String, float);
    method public default void putInt(String, int);
    method public default void putLong(String, long);
    method public default void putString(String, @Nullable String);
    method public default void putStringSet(String, @Nullable java.util.Set<java.lang.String>);
  }

  @Deprecated public abstract class PreferenceFragment extends android.app.Fragment {
    ctor @Deprecated public PreferenceFragment();
    method @Deprecated public void addPreferencesFromIntent(android.content.Intent);
    method @Deprecated public void addPreferencesFromResource(@XmlRes int);
    method @Deprecated public android.preference.Preference findPreference(CharSequence);
    method @Deprecated public android.preference.PreferenceManager getPreferenceManager();
    method @Deprecated public android.preference.PreferenceScreen getPreferenceScreen();
    method @Deprecated public boolean onPreferenceTreeClick(android.preference.PreferenceScreen, android.preference.Preference);
    method @Deprecated public void setPreferenceScreen(android.preference.PreferenceScreen);
  }

  @Deprecated public static interface PreferenceFragment.OnPreferenceStartFragmentCallback {
    method @Deprecated public boolean onPreferenceStartFragment(android.preference.PreferenceFragment, android.preference.Preference);
  }

  public abstract class PreferenceGroup extends android.preference.Preference {
    ctor public PreferenceGroup(android.content.Context, android.util.AttributeSet, int, int);
    ctor public PreferenceGroup(android.content.Context, android.util.AttributeSet, int);
    ctor public PreferenceGroup(android.content.Context, android.util.AttributeSet);
    method public void addItemFromInflater(android.preference.Preference);
    method public boolean addPreference(android.preference.Preference);
    method protected void dispatchRestoreInstanceState(android.os.Bundle);
    method protected void dispatchSaveInstanceState(android.os.Bundle);
    method public android.preference.Preference findPreference(CharSequence);
    method public android.preference.Preference getPreference(int);
    method public int getPreferenceCount();
    method protected boolean isOnSameScreenAsChildren();
    method public boolean isOrderingAsAdded();
    method protected boolean onPrepareAddPreference(android.preference.Preference);
    method public void removeAll();
    method public boolean removePreference(android.preference.Preference);
    method public void setOrderingAsAdded(boolean);
  }

  public class PreferenceManager {
    method public android.preference.PreferenceScreen createPreferenceScreen(android.content.Context);
    method @Nullable public android.preference.Preference findPreference(CharSequence);
    method public static android.content.SharedPreferences getDefaultSharedPreferences(android.content.Context);
    method public static String getDefaultSharedPreferencesName(android.content.Context);
    method @Nullable public android.preference.PreferenceDataStore getPreferenceDataStore();
    method public android.content.SharedPreferences getSharedPreferences();
    method public int getSharedPreferencesMode();
    method public String getSharedPreferencesName();
    method public boolean isStorageDefault();
    method public boolean isStorageDeviceProtected();
    method public static void setDefaultValues(android.content.Context, @XmlRes int, boolean);
    method public static void setDefaultValues(android.content.Context, String, int, int, boolean);
    method public void setPreferenceDataStore(android.preference.PreferenceDataStore);
    method public void setSharedPreferencesMode(int);
    method public void setSharedPreferencesName(String);
    method public void setStorageDefault();
    method public void setStorageDeviceProtected();
    field public static final String KEY_HAS_SET_DEFAULT_VALUES = "_has_set_default_values";
    field public static final String METADATA_KEY_PREFERENCES = "android.preference";
  }

  public static interface PreferenceManager.OnActivityDestroyListener {
    method public void onActivityDestroy();
  }

  public static interface PreferenceManager.OnActivityResultListener {
    method public boolean onActivityResult(int, int, android.content.Intent);
  }

  public static interface PreferenceManager.OnActivityStopListener {
    method public void onActivityStop();
  }

  public final class PreferenceScreen extends android.preference.PreferenceGroup implements android.widget.AdapterView.OnItemClickListener android.content.DialogInterface.OnDismissListener {
    method public void bind(android.widget.ListView);
    method public android.app.Dialog getDialog();
    method public android.widget.ListAdapter getRootAdapter();
    method protected android.widget.ListAdapter onCreateRootAdapter();
    method public void onDismiss(android.content.DialogInterface);
    method public void onItemClick(android.widget.AdapterView, android.view.View, int, long);
  }

  public class RingtonePreference extends android.preference.Preference implements android.preference.PreferenceManager.OnActivityResultListener {
    ctor public RingtonePreference(android.content.Context, android.util.AttributeSet, int, int);
    ctor public RingtonePreference(android.content.Context, android.util.AttributeSet, int);
    ctor public RingtonePreference(android.content.Context, android.util.AttributeSet);
    ctor public RingtonePreference(android.content.Context);
    method public int getRingtoneType();
    method public boolean getShowDefault();
    method public boolean getShowSilent();
    method public boolean onActivityResult(int, int, android.content.Intent);
    method protected void onPrepareRingtonePickerIntent(android.content.Intent);
    method protected android.net.Uri onRestoreRingtone();
    method protected void onSaveRingtone(android.net.Uri);
    method public void setRingtoneType(int);
    method public void setShowDefault(boolean);
    method public void setShowSilent(boolean);
  }

  public class SwitchPreference extends android.preference.TwoStatePreference {
    ctor public SwitchPreference(android.content.Context, android.util.AttributeSet, int, int);
    ctor public SwitchPreference(android.content.Context, android.util.AttributeSet, int);
    ctor public SwitchPreference(android.content.Context, android.util.AttributeSet);
    ctor public SwitchPreference(android.content.Context);
    method public CharSequence getSwitchTextOff();
    method public CharSequence getSwitchTextOn();
    method public void setSwitchTextOff(CharSequence);
    method public void setSwitchTextOff(@StringRes int);
    method public void setSwitchTextOn(CharSequence);
    method public void setSwitchTextOn(@StringRes int);
  }

  public abstract class TwoStatePreference extends android.preference.Preference {
    ctor public TwoStatePreference(android.content.Context, android.util.AttributeSet, int, int);
    ctor public TwoStatePreference(android.content.Context, android.util.AttributeSet, int);
    ctor public TwoStatePreference(android.content.Context, android.util.AttributeSet);
    ctor public TwoStatePreference(android.content.Context);
    method public boolean getDisableDependentsState();
    method public CharSequence getSummaryOff();
    method public CharSequence getSummaryOn();
    method public boolean isChecked();
    method public void setChecked(boolean);
    method public void setDisableDependentsState(boolean);
    method public void setSummaryOff(CharSequence);
    method public void setSummaryOff(@StringRes int);
    method public void setSummaryOn(CharSequence);
    method public void setSummaryOn(@StringRes int);
  }

}

package android.print {

  public final class PageRange implements android.os.Parcelable {
    ctor public PageRange(@IntRange(from=0) int, @IntRange(from=0) int);
    method public int describeContents();
    method @IntRange(from=0) public int getEnd();
    method @IntRange(from=0) public int getStart();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.print.PageRange ALL_PAGES;
    field public static final android.os.Parcelable.Creator<android.print.PageRange> CREATOR;
  }

  public final class PrintAttributes implements android.os.Parcelable {
    method public int describeContents();
    method @IntRange(from=0) public int getColorMode();
    method @IntRange(from=0) public int getDuplexMode();
    method @Nullable public android.print.PrintAttributes.MediaSize getMediaSize();
    method @Nullable public android.print.PrintAttributes.Margins getMinMargins();
    method @Nullable public android.print.PrintAttributes.Resolution getResolution();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int COLOR_MODE_COLOR = 2; // 0x2
    field public static final int COLOR_MODE_MONOCHROME = 1; // 0x1
    field public static final android.os.Parcelable.Creator<android.print.PrintAttributes> CREATOR;
    field public static final int DUPLEX_MODE_LONG_EDGE = 2; // 0x2
    field public static final int DUPLEX_MODE_NONE = 1; // 0x1
    field public static final int DUPLEX_MODE_SHORT_EDGE = 4; // 0x4
  }

  public static final class PrintAttributes.Builder {
    ctor public PrintAttributes.Builder();
    method @NonNull public android.print.PrintAttributes build();
    method @NonNull public android.print.PrintAttributes.Builder setColorMode(int);
    method @NonNull public android.print.PrintAttributes.Builder setDuplexMode(int);
    method @NonNull public android.print.PrintAttributes.Builder setMediaSize(@NonNull android.print.PrintAttributes.MediaSize);
    method @NonNull public android.print.PrintAttributes.Builder setMinMargins(@NonNull android.print.PrintAttributes.Margins);
    method @NonNull public android.print.PrintAttributes.Builder setResolution(@NonNull android.print.PrintAttributes.Resolution);
  }

  public static final class PrintAttributes.Margins {
    ctor public PrintAttributes.Margins(int, int, int, int);
    method public int getBottomMils();
    method public int getLeftMils();
    method public int getRightMils();
    method public int getTopMils();
    field public static final android.print.PrintAttributes.Margins NO_MARGINS;
  }

  public static final class PrintAttributes.MediaSize {
    ctor public PrintAttributes.MediaSize(@NonNull String, @NonNull String, @IntRange(from=1) int, @IntRange(from=1) int);
    method @NonNull public android.print.PrintAttributes.MediaSize asLandscape();
    method @NonNull public android.print.PrintAttributes.MediaSize asPortrait();
    method @IntRange(from=1) public int getHeightMils();
    method @NonNull public String getId();
    method @NonNull public String getLabel(@NonNull android.content.pm.PackageManager);
    method @IntRange(from=1) public int getWidthMils();
    method public boolean isPortrait();
    field public static final android.print.PrintAttributes.MediaSize ISO_A0;
    field public static final android.print.PrintAttributes.MediaSize ISO_A1;
    field public static final android.print.PrintAttributes.MediaSize ISO_A10;
    field public static final android.print.PrintAttributes.MediaSize ISO_A2;
    field public static final android.print.PrintAttributes.MediaSize ISO_A3;
    field public static final android.print.PrintAttributes.MediaSize ISO_A4;
    field public static final android.print.PrintAttributes.MediaSize ISO_A5;
    field public static final android.print.PrintAttributes.MediaSize ISO_A6;
    field public static final android.print.PrintAttributes.MediaSize ISO_A7;
    field public static final android.print.PrintAttributes.MediaSize ISO_A8;
    field public static final android.print.PrintAttributes.MediaSize ISO_A9;
    field public static final android.print.PrintAttributes.MediaSize ISO_B0;
    field public static final android.print.PrintAttributes.MediaSize ISO_B1;
    field public static final android.print.PrintAttributes.MediaSize ISO_B10;
    field public static final android.print.PrintAttributes.MediaSize ISO_B2;
    field public static final android.print.PrintAttributes.MediaSize ISO_B3;
    field public static final android.print.PrintAttributes.MediaSize ISO_B4;
    field public static final android.print.PrintAttributes.MediaSize ISO_B5;
    field public static final android.print.PrintAttributes.MediaSize ISO_B6;
    field public static final android.print.PrintAttributes.MediaSize ISO_B7;
    field public static final android.print.PrintAttributes.MediaSize ISO_B8;
    field public static final android.print.PrintAttributes.MediaSize ISO_B9;
    field public static final android.print.PrintAttributes.MediaSize ISO_C0;
    field public static final android.print.PrintAttributes.MediaSize ISO_C1;
    field public static final android.print.PrintAttributes.MediaSize ISO_C10;
    field public static final android.print.PrintAttributes.MediaSize ISO_C2;
    field public static final android.print.PrintAttributes.MediaSize ISO_C3;
    field public static final android.print.PrintAttributes.MediaSize ISO_C4;
    field public static final android.print.PrintAttributes.MediaSize ISO_C5;
    field public static final android.print.PrintAttributes.MediaSize ISO_C6;
    field public static final android.print.PrintAttributes.MediaSize ISO_C7;
    field public static final android.print.PrintAttributes.MediaSize ISO_C8;
    field public static final android.print.PrintAttributes.MediaSize ISO_C9;
    field public static final android.print.PrintAttributes.MediaSize JIS_B0;
    field public static final android.print.PrintAttributes.MediaSize JIS_B1;
    field public static final android.print.PrintAttributes.MediaSize JIS_B10;
    field public static final android.print.PrintAttributes.MediaSize JIS_B2;
    field public static final android.print.PrintAttributes.MediaSize JIS_B3;
    field public static final android.print.PrintAttributes.MediaSize JIS_B4;
    field public static final android.print.PrintAttributes.MediaSize JIS_B5;
    field public static final android.print.PrintAttributes.MediaSize JIS_B6;
    field public static final android.print.PrintAttributes.MediaSize JIS_B7;
    field public static final android.print.PrintAttributes.MediaSize JIS_B8;
    field public static final android.print.PrintAttributes.MediaSize JIS_B9;
    field public static final android.print.PrintAttributes.MediaSize JIS_EXEC;
    field public static final android.print.PrintAttributes.MediaSize JPN_CHOU2;
    field public static final android.print.PrintAttributes.MediaSize JPN_CHOU3;
    field public static final android.print.PrintAttributes.MediaSize JPN_CHOU4;
    field public static final android.print.PrintAttributes.MediaSize JPN_HAGAKI;
    field public static final android.print.PrintAttributes.MediaSize JPN_KAHU;
    field public static final android.print.PrintAttributes.MediaSize JPN_KAKU2;
    field public static final android.print.PrintAttributes.MediaSize JPN_OUFUKU;
    field public static final android.print.PrintAttributes.MediaSize JPN_YOU4;
    field public static final android.print.PrintAttributes.MediaSize NA_FOOLSCAP;
    field public static final android.print.PrintAttributes.MediaSize NA_GOVT_LETTER;
    field public static final android.print.PrintAttributes.MediaSize NA_INDEX_3X5;
    field public static final android.print.PrintAttributes.MediaSize NA_INDEX_4X6;
    field public static final android.print.PrintAttributes.MediaSize NA_INDEX_5X8;
    field public static final android.print.PrintAttributes.MediaSize NA_JUNIOR_LEGAL;
    field public static final android.print.PrintAttributes.MediaSize NA_LEDGER;
    field public static final android.print.PrintAttributes.MediaSize NA_LEGAL;
    field public static final android.print.PrintAttributes.MediaSize NA_LETTER;
    field public static final android.print.PrintAttributes.MediaSize NA_MONARCH;
    field public static final android.print.PrintAttributes.MediaSize NA_QUARTO;
    field public static final android.print.PrintAttributes.MediaSize NA_TABLOID;
    field public static final android.print.PrintAttributes.MediaSize OM_DAI_PA_KAI;
    field public static final android.print.PrintAttributes.MediaSize OM_JUURO_KU_KAI;
    field public static final android.print.PrintAttributes.MediaSize OM_PA_KAI;
    field public static final android.print.PrintAttributes.MediaSize PRC_1;
    field public static final android.print.PrintAttributes.MediaSize PRC_10;
    field public static final android.print.PrintAttributes.MediaSize PRC_16K;
    field public static final android.print.PrintAttributes.MediaSize PRC_2;
    field public static final android.print.PrintAttributes.MediaSize PRC_3;
    field public static final android.print.PrintAttributes.MediaSize PRC_4;
    field public static final android.print.PrintAttributes.MediaSize PRC_5;
    field public static final android.print.PrintAttributes.MediaSize PRC_6;
    field public static final android.print.PrintAttributes.MediaSize PRC_7;
    field public static final android.print.PrintAttributes.MediaSize PRC_8;
    field public static final android.print.PrintAttributes.MediaSize PRC_9;
    field public static final android.print.PrintAttributes.MediaSize ROC_16K;
    field public static final android.print.PrintAttributes.MediaSize ROC_8K;
    field public static final android.print.PrintAttributes.MediaSize UNKNOWN_LANDSCAPE;
    field public static final android.print.PrintAttributes.MediaSize UNKNOWN_PORTRAIT;
  }

  public static final class PrintAttributes.Resolution {
    ctor public PrintAttributes.Resolution(@NonNull String, @NonNull String, @IntRange(from=1) int, @IntRange(from=1) int);
    method @IntRange(from=1) public int getHorizontalDpi();
    method @NonNull public String getId();
    method @NonNull public String getLabel();
    method @IntRange(from=1) public int getVerticalDpi();
  }

  public abstract class PrintDocumentAdapter {
    ctor public PrintDocumentAdapter();
    method public void onFinish();
    method public abstract void onLayout(android.print.PrintAttributes, android.print.PrintAttributes, android.os.CancellationSignal, android.print.PrintDocumentAdapter.LayoutResultCallback, android.os.Bundle);
    method public void onStart();
    method public abstract void onWrite(android.print.PageRange[], android.os.ParcelFileDescriptor, android.os.CancellationSignal, android.print.PrintDocumentAdapter.WriteResultCallback);
    field public static final String EXTRA_PRINT_PREVIEW = "EXTRA_PRINT_PREVIEW";
  }

  public abstract static class PrintDocumentAdapter.LayoutResultCallback {
    method public void onLayoutCancelled();
    method public void onLayoutFailed(CharSequence);
    method public void onLayoutFinished(android.print.PrintDocumentInfo, boolean);
  }

  public abstract static class PrintDocumentAdapter.WriteResultCallback {
    method public void onWriteCancelled();
    method public void onWriteFailed(CharSequence);
    method public void onWriteFinished(android.print.PageRange[]);
  }

  public final class PrintDocumentInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getContentType();
    method @IntRange(from=0) public long getDataSize();
    method @NonNull public String getName();
    method @IntRange(from=0xffffffff) public int getPageCount();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CONTENT_TYPE_DOCUMENT = 0; // 0x0
    field public static final int CONTENT_TYPE_PHOTO = 1; // 0x1
    field public static final int CONTENT_TYPE_UNKNOWN = -1; // 0xffffffff
    field public static final android.os.Parcelable.Creator<android.print.PrintDocumentInfo> CREATOR;
    field public static final int PAGE_COUNT_UNKNOWN = -1; // 0xffffffff
  }

  public static final class PrintDocumentInfo.Builder {
    ctor public PrintDocumentInfo.Builder(@NonNull String);
    method @NonNull public android.print.PrintDocumentInfo build();
    method @NonNull public android.print.PrintDocumentInfo.Builder setContentType(int);
    method @NonNull public android.print.PrintDocumentInfo.Builder setPageCount(@IntRange(from=0xffffffff) int);
  }

  public final class PrintJob {
    method public void cancel();
    method @Nullable public android.print.PrintJobId getId();
    method @NonNull public android.print.PrintJobInfo getInfo();
    method public boolean isBlocked();
    method public boolean isCancelled();
    method public boolean isCompleted();
    method public boolean isFailed();
    method public boolean isQueued();
    method public boolean isStarted();
    method public void restart();
  }

  public final class PrintJobId implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.print.PrintJobId> CREATOR;
  }

  public final class PrintJobInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getAdvancedIntOption(String);
    method public String getAdvancedStringOption(String);
    method @NonNull public android.print.PrintAttributes getAttributes();
    method @IntRange(from=0) public int getCopies();
    method public long getCreationTime();
    method @Nullable public android.print.PrintJobId getId();
    method @NonNull public String getLabel();
    method @Nullable public android.print.PageRange[] getPages();
    method @Nullable public android.print.PrinterId getPrinterId();
    method public int getState();
    method public boolean hasAdvancedOption(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.print.PrintJobInfo> CREATOR;
    field public static final int STATE_BLOCKED = 4; // 0x4
    field public static final int STATE_CANCELED = 7; // 0x7
    field public static final int STATE_COMPLETED = 5; // 0x5
    field public static final int STATE_CREATED = 1; // 0x1
    field public static final int STATE_FAILED = 6; // 0x6
    field public static final int STATE_QUEUED = 2; // 0x2
    field public static final int STATE_STARTED = 3; // 0x3
  }

  public static final class PrintJobInfo.Builder {
    ctor public PrintJobInfo.Builder(@Nullable android.print.PrintJobInfo);
    method @NonNull public android.print.PrintJobInfo build();
    method public void putAdvancedOption(@NonNull String, @Nullable String);
    method public void putAdvancedOption(@NonNull String, int);
    method public void setAttributes(@NonNull android.print.PrintAttributes);
    method public void setCopies(@IntRange(from=1) int);
    method public void setPages(@NonNull android.print.PageRange[]);
  }

  public final class PrintManager {
    method @NonNull public java.util.List<android.print.PrintJob> getPrintJobs();
    method @NonNull public android.print.PrintJob print(@NonNull String, @NonNull android.print.PrintDocumentAdapter, @Nullable android.print.PrintAttributes);
  }

  public final class PrinterCapabilitiesInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getColorModes();
    method @NonNull public android.print.PrintAttributes getDefaults();
    method public int getDuplexModes();
    method @NonNull public java.util.List<android.print.PrintAttributes.MediaSize> getMediaSizes();
    method @NonNull public android.print.PrintAttributes.Margins getMinMargins();
    method @NonNull public java.util.List<android.print.PrintAttributes.Resolution> getResolutions();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.print.PrinterCapabilitiesInfo> CREATOR;
  }

  public static final class PrinterCapabilitiesInfo.Builder {
    ctor public PrinterCapabilitiesInfo.Builder(@NonNull android.print.PrinterId);
    method @NonNull public android.print.PrinterCapabilitiesInfo.Builder addMediaSize(@NonNull android.print.PrintAttributes.MediaSize, boolean);
    method @NonNull public android.print.PrinterCapabilitiesInfo.Builder addResolution(@NonNull android.print.PrintAttributes.Resolution, boolean);
    method @NonNull public android.print.PrinterCapabilitiesInfo build();
    method @NonNull public android.print.PrinterCapabilitiesInfo.Builder setColorModes(int, int);
    method @NonNull public android.print.PrinterCapabilitiesInfo.Builder setDuplexModes(int, int);
    method @NonNull public android.print.PrinterCapabilitiesInfo.Builder setMinMargins(@NonNull android.print.PrintAttributes.Margins);
  }

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

  public final class PrinterInfo implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.print.PrinterCapabilitiesInfo getCapabilities();
    method @Nullable public String getDescription();
    method @NonNull public android.print.PrinterId getId();
    method @NonNull public String getName();
    method public int getStatus();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.print.PrinterInfo> CREATOR;
    field public static final int STATUS_BUSY = 2; // 0x2
    field public static final int STATUS_IDLE = 1; // 0x1
    field public static final int STATUS_UNAVAILABLE = 3; // 0x3
  }

  public static final class PrinterInfo.Builder {
    ctor public PrinterInfo.Builder(@NonNull android.print.PrinterId, @NonNull String, int);
    ctor public PrinterInfo.Builder(@NonNull android.print.PrinterInfo);
    method @NonNull public android.print.PrinterInfo build();
    method @NonNull public android.print.PrinterInfo.Builder setCapabilities(@NonNull android.print.PrinterCapabilitiesInfo);
    method @NonNull public android.print.PrinterInfo.Builder setDescription(@NonNull String);
    method @NonNull public android.print.PrinterInfo.Builder setHasCustomPrinterIcon(boolean);
    method @NonNull public android.print.PrinterInfo.Builder setIconResourceId(@DrawableRes int);
    method @NonNull public android.print.PrinterInfo.Builder setInfoIntent(@NonNull android.app.PendingIntent);
    method @NonNull public android.print.PrinterInfo.Builder setName(@NonNull String);
    method @NonNull public android.print.PrinterInfo.Builder setStatus(int);
  }

}

package android.print.pdf {

  public class PrintedPdfDocument extends android.graphics.pdf.PdfDocument {
    ctor public PrintedPdfDocument(@NonNull android.content.Context, @NonNull android.print.PrintAttributes);
    method @NonNull public android.graphics.Rect getPageContentRect();
    method @IntRange(from=0) public int getPageHeight();
    method @IntRange(from=0) public int getPageWidth();
    method @NonNull public android.graphics.pdf.PdfDocument.Page startPage(@IntRange(from=0) int);
  }

}

package android.printservice {

  public final class CustomPrinterIconCallback {
    method public boolean onCustomPrinterIconLoaded(@Nullable android.graphics.drawable.Icon);
  }

  public final class PrintDocument {
    method @Nullable public android.os.ParcelFileDescriptor getData();
    method @NonNull public android.print.PrintDocumentInfo getInfo();
  }

  public final class PrintJob {
    method @MainThread public boolean block(@Nullable String);
    method @MainThread public boolean cancel();
    method @MainThread public boolean complete();
    method @MainThread public boolean fail(@Nullable String);
    method @MainThread public int getAdvancedIntOption(String);
    method @MainThread public String getAdvancedStringOption(String);
    method @MainThread @NonNull public android.printservice.PrintDocument getDocument();
    method @MainThread public android.print.PrintJobId getId();
    method @MainThread @NonNull public android.print.PrintJobInfo getInfo();
    method @MainThread @Nullable public String getTag();
    method @MainThread public boolean hasAdvancedOption(String);
    method @MainThread public boolean isBlocked();
    method @MainThread public boolean isCancelled();
    method @MainThread public boolean isCompleted();
    method @MainThread public boolean isFailed();
    method @MainThread public boolean isQueued();
    method @MainThread public boolean isStarted();
    method @MainThread public void setProgress(@FloatRange(from=0.0, to=1.0) float);
    method @MainThread public void setStatus(@Nullable CharSequence);
    method @MainThread public void setStatus(@StringRes int);
    method @MainThread public boolean setTag(@NonNull String);
    method @MainThread public boolean start();
  }

  public abstract class PrintService extends android.app.Service {
    ctor public PrintService();
    method protected final void attachBaseContext(android.content.Context);
    method @NonNull public final android.print.PrinterId generatePrinterId(String);
    method public final java.util.List<android.printservice.PrintJob> getActivePrintJobs();
    method public final android.os.IBinder onBind(android.content.Intent);
    method protected void onConnected();
    method @Nullable protected abstract android.printservice.PrinterDiscoverySession onCreatePrinterDiscoverySession();
    method protected void onDisconnected();
    method protected abstract void onPrintJobQueued(android.printservice.PrintJob);
    method protected abstract void onRequestCancelPrintJob(android.printservice.PrintJob);
    field public static final String EXTRA_CAN_SELECT_PRINTER = "android.printservice.extra.CAN_SELECT_PRINTER";
    field public static final String EXTRA_PRINTER_INFO = "android.intent.extra.print.EXTRA_PRINTER_INFO";
    field public static final String EXTRA_PRINT_DOCUMENT_INFO = "android.printservice.extra.PRINT_DOCUMENT_INFO";
    field public static final String EXTRA_PRINT_JOB_INFO = "android.intent.extra.print.PRINT_JOB_INFO";
    field public static final String EXTRA_SELECT_PRINTER = "android.printservice.extra.SELECT_PRINTER";
    field public static final String SERVICE_INTERFACE = "android.printservice.PrintService";
    field public static final String SERVICE_META_DATA = "android.printservice";
  }

  public abstract class PrinterDiscoverySession {
    ctor public PrinterDiscoverySession();
    method public final void addPrinters(@NonNull java.util.List<android.print.PrinterInfo>);
    method @NonNull public final java.util.List<android.print.PrinterInfo> getPrinters();
    method @NonNull public final java.util.List<android.print.PrinterId> getTrackedPrinters();
    method public final boolean isDestroyed();
    method public final boolean isPrinterDiscoveryStarted();
    method public abstract void onDestroy();
    method public void onRequestCustomPrinterIcon(@NonNull android.print.PrinterId, @NonNull android.os.CancellationSignal, @NonNull android.printservice.CustomPrinterIconCallback);
    method public abstract void onStartPrinterDiscovery(@NonNull java.util.List<android.print.PrinterId>);
    method public abstract void onStartPrinterStateTracking(@NonNull android.print.PrinterId);
    method public abstract void onStopPrinterDiscovery();
    method public abstract void onStopPrinterStateTracking(@NonNull android.print.PrinterId);
    method public abstract void onValidatePrinters(@NonNull java.util.List<android.print.PrinterId>);
    method public final void removePrinters(@NonNull java.util.List<android.print.PrinterId>);
  }

}

package android.provider {

  public final class AlarmClock {
    ctor public AlarmClock();
    field public static final String ACTION_DISMISS_ALARM = "android.intent.action.DISMISS_ALARM";
    field public static final String ACTION_DISMISS_TIMER = "android.intent.action.DISMISS_TIMER";
    field public static final String ACTION_SET_ALARM = "android.intent.action.SET_ALARM";
    field public static final String ACTION_SET_TIMER = "android.intent.action.SET_TIMER";
    field public static final String ACTION_SHOW_ALARMS = "android.intent.action.SHOW_ALARMS";
    field public static final String ACTION_SHOW_TIMERS = "android.intent.action.SHOW_TIMERS";
    field public static final String ACTION_SNOOZE_ALARM = "android.intent.action.SNOOZE_ALARM";
    field public static final String ALARM_SEARCH_MODE_ALL = "android.all";
    field public static final String ALARM_SEARCH_MODE_LABEL = "android.label";
    field public static final String ALARM_SEARCH_MODE_NEXT = "android.next";
    field public static final String ALARM_SEARCH_MODE_TIME = "android.time";
    field public static final String EXTRA_ALARM_SEARCH_MODE = "android.intent.extra.alarm.SEARCH_MODE";
    field public static final String EXTRA_ALARM_SNOOZE_DURATION = "android.intent.extra.alarm.SNOOZE_DURATION";
    field public static final String EXTRA_DAYS = "android.intent.extra.alarm.DAYS";
    field public static final String EXTRA_HOUR = "android.intent.extra.alarm.HOUR";
    field public static final String EXTRA_IS_PM = "android.intent.extra.alarm.IS_PM";
    field public static final String EXTRA_LENGTH = "android.intent.extra.alarm.LENGTH";
    field public static final String EXTRA_MESSAGE = "android.intent.extra.alarm.MESSAGE";
    field public static final String EXTRA_MINUTES = "android.intent.extra.alarm.MINUTES";
    field public static final String EXTRA_RINGTONE = "android.intent.extra.alarm.RINGTONE";
    field public static final String EXTRA_SKIP_UI = "android.intent.extra.alarm.SKIP_UI";
    field public static final String EXTRA_VIBRATE = "android.intent.extra.alarm.VIBRATE";
    field public static final String VALUE_RINGTONE_SILENT = "silent";
  }

  public interface BaseColumns {
    field public static final String _COUNT = "_count";
    field public static final String _ID = "_id";
  }

  public class BlockedNumberContract {
    method public static boolean canCurrentUserBlockNumbers(android.content.Context);
    method @WorkerThread public static boolean isBlocked(android.content.Context, String);
    method @WorkerThread public static int unblock(android.content.Context, String);
    field public static final String AUTHORITY = "com.android.blockednumber";
    field public static final android.net.Uri AUTHORITY_URI;
  }

  public static class BlockedNumberContract.BlockedNumbers {
    field public static final String COLUMN_E164_NUMBER = "e164_number";
    field public static final String COLUMN_ID = "_id";
    field public static final String COLUMN_ORIGINAL_NUMBER = "original_number";
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/blocked_number";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/blocked_number";
    field public static final android.net.Uri CONTENT_URI;
  }

  public class Browser {
    ctor public Browser();
    method public static final void sendString(android.content.Context, String);
    field public static final String EXTRA_APPLICATION_ID = "com.android.browser.application_id";
    field public static final String EXTRA_CREATE_NEW_TAB = "create_new_tab";
    field public static final String EXTRA_HEADERS = "com.android.browser.headers";
    field public static final String INITIAL_ZOOM_LEVEL = "browser.initialZoomLevel";
  }

  public final class CalendarContract {
    field public static final String ACCOUNT_TYPE_LOCAL = "LOCAL";
    field public static final String ACTION_EVENT_REMINDER = "android.intent.action.EVENT_REMINDER";
    field public static final String ACTION_HANDLE_CUSTOM_EVENT = "android.provider.calendar.action.HANDLE_CUSTOM_EVENT";
    field public static final String AUTHORITY = "com.android.calendar";
    field public static final String CALLER_IS_SYNCADAPTER = "caller_is_syncadapter";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String EXTRA_CUSTOM_APP_URI = "customAppUri";
    field public static final String EXTRA_EVENT_ALL_DAY = "allDay";
    field public static final String EXTRA_EVENT_BEGIN_TIME = "beginTime";
    field public static final String EXTRA_EVENT_END_TIME = "endTime";
  }

  public static final class CalendarContract.Attendees implements android.provider.BaseColumns android.provider.CalendarContract.AttendeesColumns android.provider.CalendarContract.EventsColumns {
    method public static android.database.Cursor query(android.content.ContentResolver, long, String[]);
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static interface CalendarContract.AttendeesColumns {
    field public static final String ATTENDEE_EMAIL = "attendeeEmail";
    field public static final String ATTENDEE_IDENTITY = "attendeeIdentity";
    field public static final String ATTENDEE_ID_NAMESPACE = "attendeeIdNamespace";
    field public static final String ATTENDEE_NAME = "attendeeName";
    field public static final String ATTENDEE_RELATIONSHIP = "attendeeRelationship";
    field public static final String ATTENDEE_STATUS = "attendeeStatus";
    field public static final int ATTENDEE_STATUS_ACCEPTED = 1; // 0x1
    field public static final int ATTENDEE_STATUS_DECLINED = 2; // 0x2
    field public static final int ATTENDEE_STATUS_INVITED = 3; // 0x3
    field public static final int ATTENDEE_STATUS_NONE = 0; // 0x0
    field public static final int ATTENDEE_STATUS_TENTATIVE = 4; // 0x4
    field public static final String ATTENDEE_TYPE = "attendeeType";
    field public static final String EVENT_ID = "event_id";
    field public static final int RELATIONSHIP_ATTENDEE = 1; // 0x1
    field public static final int RELATIONSHIP_NONE = 0; // 0x0
    field public static final int RELATIONSHIP_ORGANIZER = 2; // 0x2
    field public static final int RELATIONSHIP_PERFORMER = 3; // 0x3
    field public static final int RELATIONSHIP_SPEAKER = 4; // 0x4
    field public static final int TYPE_NONE = 0; // 0x0
    field public static final int TYPE_OPTIONAL = 2; // 0x2
    field public static final int TYPE_REQUIRED = 1; // 0x1
    field public static final int TYPE_RESOURCE = 3; // 0x3
  }

  public static final class CalendarContract.CalendarAlerts implements android.provider.BaseColumns android.provider.CalendarContract.CalendarAlertsColumns android.provider.CalendarContract.CalendarColumns android.provider.CalendarContract.EventsColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final android.net.Uri CONTENT_URI_BY_INSTANCE;
  }

  protected static interface CalendarContract.CalendarAlertsColumns {
    field public static final String ALARM_TIME = "alarmTime";
    field public static final String BEGIN = "begin";
    field public static final String CREATION_TIME = "creationTime";
    field public static final String DEFAULT_SORT_ORDER = "begin ASC,title ASC";
    field public static final String END = "end";
    field public static final String EVENT_ID = "event_id";
    field public static final String MINUTES = "minutes";
    field public static final String NOTIFY_TIME = "notifyTime";
    field public static final String RECEIVED_TIME = "receivedTime";
    field public static final String STATE = "state";
    field public static final int STATE_DISMISSED = 2; // 0x2
    field public static final int STATE_FIRED = 1; // 0x1
    field public static final int STATE_SCHEDULED = 0; // 0x0
  }

  public static final class CalendarContract.CalendarCache implements android.provider.CalendarContract.CalendarCacheColumns {
    field public static final String KEY_TIMEZONE_INSTANCES = "timezoneInstances";
    field public static final String KEY_TIMEZONE_INSTANCES_PREVIOUS = "timezoneInstancesPrevious";
    field public static final String KEY_TIMEZONE_TYPE = "timezoneType";
    field public static final String TIMEZONE_TYPE_AUTO = "auto";
    field public static final String TIMEZONE_TYPE_HOME = "home";
    field public static final android.net.Uri URI;
  }

  protected static interface CalendarContract.CalendarCacheColumns {
    field public static final String KEY = "key";
    field public static final String VALUE = "value";
  }

  protected static interface CalendarContract.CalendarColumns {
    field public static final String ALLOWED_ATTENDEE_TYPES = "allowedAttendeeTypes";
    field public static final String ALLOWED_AVAILABILITY = "allowedAvailability";
    field public static final String ALLOWED_REMINDERS = "allowedReminders";
    field public static final String CALENDAR_ACCESS_LEVEL = "calendar_access_level";
    field public static final String CALENDAR_COLOR = "calendar_color";
    field public static final String CALENDAR_COLOR_KEY = "calendar_color_index";
    field public static final String CALENDAR_DISPLAY_NAME = "calendar_displayName";
    field public static final String CALENDAR_TIME_ZONE = "calendar_timezone";
    field public static final int CAL_ACCESS_CONTRIBUTOR = 500; // 0x1f4
    field public static final int CAL_ACCESS_EDITOR = 600; // 0x258
    field public static final int CAL_ACCESS_FREEBUSY = 100; // 0x64
    field public static final int CAL_ACCESS_NONE = 0; // 0x0
    field public static final int CAL_ACCESS_OVERRIDE = 400; // 0x190
    field public static final int CAL_ACCESS_OWNER = 700; // 0x2bc
    field public static final int CAL_ACCESS_READ = 200; // 0xc8
    field public static final int CAL_ACCESS_RESPOND = 300; // 0x12c
    field public static final int CAL_ACCESS_ROOT = 800; // 0x320
    field public static final String CAN_MODIFY_TIME_ZONE = "canModifyTimeZone";
    field public static final String CAN_ORGANIZER_RESPOND = "canOrganizerRespond";
    field public static final String IS_PRIMARY = "isPrimary";
    field public static final String MAX_REMINDERS = "maxReminders";
    field public static final String OWNER_ACCOUNT = "ownerAccount";
    field public static final String SYNC_EVENTS = "sync_events";
    field public static final String VISIBLE = "visible";
  }

  public static final class CalendarContract.CalendarEntity implements android.provider.BaseColumns android.provider.CalendarContract.CalendarColumns android.provider.CalendarContract.SyncColumns {
    method public static android.content.EntityIterator newEntityIterator(android.database.Cursor);
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static interface CalendarContract.CalendarSyncColumns {
    field public static final String CAL_SYNC1 = "cal_sync1";
    field public static final String CAL_SYNC10 = "cal_sync10";
    field public static final String CAL_SYNC2 = "cal_sync2";
    field public static final String CAL_SYNC3 = "cal_sync3";
    field public static final String CAL_SYNC4 = "cal_sync4";
    field public static final String CAL_SYNC5 = "cal_sync5";
    field public static final String CAL_SYNC6 = "cal_sync6";
    field public static final String CAL_SYNC7 = "cal_sync7";
    field public static final String CAL_SYNC8 = "cal_sync8";
    field public static final String CAL_SYNC9 = "cal_sync9";
  }

  public static final class CalendarContract.Calendars implements android.provider.BaseColumns android.provider.CalendarContract.CalendarColumns android.provider.CalendarContract.SyncColumns {
    field public static final String CALENDAR_LOCATION = "calendar_location";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "calendar_displayName";
    field public static final String NAME = "name";
  }

  public static final class CalendarContract.Colors implements android.provider.CalendarContract.ColorsColumns {
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static interface CalendarContract.ColorsColumns extends android.provider.SyncStateContract.Columns {
    field public static final String COLOR = "color";
    field public static final String COLOR_KEY = "color_index";
    field public static final String COLOR_TYPE = "color_type";
    field public static final int TYPE_CALENDAR = 0; // 0x0
    field public static final int TYPE_EVENT = 1; // 0x1
  }

  public static final class CalendarContract.EventDays implements android.provider.CalendarContract.EventDaysColumns {
    method public static android.database.Cursor query(android.content.ContentResolver, int, int, String[]);
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static interface CalendarContract.EventDaysColumns {
    field public static final String ENDDAY = "endDay";
    field public static final String STARTDAY = "startDay";
  }

  public static final class CalendarContract.Events implements android.provider.BaseColumns android.provider.CalendarContract.CalendarColumns android.provider.CalendarContract.EventsColumns android.provider.CalendarContract.SyncColumns {
    field public static final android.net.Uri CONTENT_EXCEPTION_URI;
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static interface CalendarContract.EventsColumns {
    field public static final int ACCESS_CONFIDENTIAL = 1; // 0x1
    field public static final int ACCESS_DEFAULT = 0; // 0x0
    field public static final String ACCESS_LEVEL = "accessLevel";
    field public static final int ACCESS_PRIVATE = 2; // 0x2
    field public static final int ACCESS_PUBLIC = 3; // 0x3
    field public static final String ALL_DAY = "allDay";
    field public static final String AVAILABILITY = "availability";
    field public static final int AVAILABILITY_BUSY = 0; // 0x0
    field public static final int AVAILABILITY_FREE = 1; // 0x1
    field public static final int AVAILABILITY_TENTATIVE = 2; // 0x2
    field public static final String CALENDAR_ID = "calendar_id";
    field public static final String CAN_INVITE_OTHERS = "canInviteOthers";
    field public static final String CUSTOM_APP_PACKAGE = "customAppPackage";
    field public static final String CUSTOM_APP_URI = "customAppUri";
    field public static final String DESCRIPTION = "description";
    field public static final String DISPLAY_COLOR = "displayColor";
    field public static final String DTEND = "dtend";
    field public static final String DTSTART = "dtstart";
    field public static final String DURATION = "duration";
    field public static final String EVENT_COLOR = "eventColor";
    field public static final String EVENT_COLOR_KEY = "eventColor_index";
    field public static final String EVENT_END_TIMEZONE = "eventEndTimezone";
    field public static final String EVENT_LOCATION = "eventLocation";
    field public static final String EVENT_TIMEZONE = "eventTimezone";
    field public static final String EXDATE = "exdate";
    field public static final String EXRULE = "exrule";
    field public static final String GUESTS_CAN_INVITE_OTHERS = "guestsCanInviteOthers";
    field public static final String GUESTS_CAN_MODIFY = "guestsCanModify";
    field public static final String GUESTS_CAN_SEE_GUESTS = "guestsCanSeeGuests";
    field public static final String HAS_ALARM = "hasAlarm";
    field public static final String HAS_ATTENDEE_DATA = "hasAttendeeData";
    field public static final String HAS_EXTENDED_PROPERTIES = "hasExtendedProperties";
    field public static final String IS_ORGANIZER = "isOrganizer";
    field public static final String LAST_DATE = "lastDate";
    field public static final String LAST_SYNCED = "lastSynced";
    field public static final String ORGANIZER = "organizer";
    field public static final String ORIGINAL_ALL_DAY = "originalAllDay";
    field public static final String ORIGINAL_ID = "original_id";
    field public static final String ORIGINAL_INSTANCE_TIME = "originalInstanceTime";
    field public static final String ORIGINAL_SYNC_ID = "original_sync_id";
    field public static final String RDATE = "rdate";
    field public static final String RRULE = "rrule";
    field public static final String SELF_ATTENDEE_STATUS = "selfAttendeeStatus";
    field public static final String STATUS = "eventStatus";
    field public static final int STATUS_CANCELED = 2; // 0x2
    field public static final int STATUS_CONFIRMED = 1; // 0x1
    field public static final int STATUS_TENTATIVE = 0; // 0x0
    field public static final String SYNC_DATA1 = "sync_data1";
    field public static final String SYNC_DATA10 = "sync_data10";
    field public static final String SYNC_DATA2 = "sync_data2";
    field public static final String SYNC_DATA3 = "sync_data3";
    field public static final String SYNC_DATA4 = "sync_data4";
    field public static final String SYNC_DATA5 = "sync_data5";
    field public static final String SYNC_DATA6 = "sync_data6";
    field public static final String SYNC_DATA7 = "sync_data7";
    field public static final String SYNC_DATA8 = "sync_data8";
    field public static final String SYNC_DATA9 = "sync_data9";
    field public static final String TITLE = "title";
    field public static final String UID_2445 = "uid2445";
  }

  public static final class CalendarContract.EventsEntity implements android.provider.BaseColumns android.provider.CalendarContract.EventsColumns android.provider.CalendarContract.SyncColumns {
    method public static android.content.EntityIterator newEntityIterator(android.database.Cursor, android.content.ContentResolver);
    method public static android.content.EntityIterator newEntityIterator(android.database.Cursor, android.content.ContentProviderClient);
    field public static final android.net.Uri CONTENT_URI;
  }

  public static final class CalendarContract.ExtendedProperties implements android.provider.BaseColumns android.provider.CalendarContract.EventsColumns android.provider.CalendarContract.ExtendedPropertiesColumns {
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static interface CalendarContract.ExtendedPropertiesColumns {
    field public static final String EVENT_ID = "event_id";
    field public static final String NAME = "name";
    field public static final String VALUE = "value";
  }

  public static final class CalendarContract.Instances implements android.provider.BaseColumns android.provider.CalendarContract.CalendarColumns android.provider.CalendarContract.EventsColumns {
    method public static android.database.Cursor query(android.content.ContentResolver, String[], long, long);
    method public static android.database.Cursor query(android.content.ContentResolver, String[], long, long, String);
    field public static final String BEGIN = "begin";
    field public static final android.net.Uri CONTENT_BY_DAY_URI;
    field public static final android.net.Uri CONTENT_SEARCH_BY_DAY_URI;
    field public static final android.net.Uri CONTENT_SEARCH_URI;
    field public static final android.net.Uri CONTENT_URI;
    field public static final String END = "end";
    field public static final String END_DAY = "endDay";
    field public static final String END_MINUTE = "endMinute";
    field public static final String EVENT_ID = "event_id";
    field public static final String START_DAY = "startDay";
    field public static final String START_MINUTE = "startMinute";
  }

  public static final class CalendarContract.Reminders implements android.provider.BaseColumns android.provider.CalendarContract.EventsColumns android.provider.CalendarContract.RemindersColumns {
    method public static android.database.Cursor query(android.content.ContentResolver, long, String[]);
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static interface CalendarContract.RemindersColumns {
    field public static final String EVENT_ID = "event_id";
    field public static final String METHOD = "method";
    field public static final int METHOD_ALARM = 4; // 0x4
    field public static final int METHOD_ALERT = 1; // 0x1
    field public static final int METHOD_DEFAULT = 0; // 0x0
    field public static final int METHOD_EMAIL = 2; // 0x2
    field public static final int METHOD_SMS = 3; // 0x3
    field public static final String MINUTES = "minutes";
    field public static final int MINUTES_DEFAULT = -1; // 0xffffffff
  }

  protected static interface CalendarContract.SyncColumns extends android.provider.CalendarContract.CalendarSyncColumns {
    field public static final String ACCOUNT_NAME = "account_name";
    field public static final String ACCOUNT_TYPE = "account_type";
    field public static final String CAN_PARTIALLY_UPDATE = "canPartiallyUpdate";
    field public static final String DELETED = "deleted";
    field public static final String DIRTY = "dirty";
    field public static final String MUTATORS = "mutators";
    field public static final String _SYNC_ID = "_sync_id";
  }

  public static final class CalendarContract.SyncState implements android.provider.SyncStateContract.Columns {
    field public static final android.net.Uri CONTENT_URI;
  }

  public class CallLog {
    ctor public CallLog();
    field public static final String AUTHORITY = "call_log";
    field public static final android.net.Uri CONTENT_URI;
  }

  public static class CallLog.Calls implements android.provider.BaseColumns {
    ctor public CallLog.Calls();
    method public static String getLastOutgoingCall(android.content.Context);
    field public static final int ANSWERED_EXTERNALLY_TYPE = 7; // 0x7
    field public static final int BLOCKED_TYPE = 6; // 0x6
    field public static final String BLOCK_REASON = "block_reason";
    field public static final int BLOCK_REASON_BLOCKED_NUMBER = 3; // 0x3
    field public static final int BLOCK_REASON_CALL_SCREENING_SERVICE = 1; // 0x1
    field public static final int BLOCK_REASON_DIRECT_TO_VOICEMAIL = 2; // 0x2
    field public static final int BLOCK_REASON_NOT_BLOCKED = 0; // 0x0
    field public static final int BLOCK_REASON_NOT_IN_CONTACTS = 7; // 0x7
    field public static final int BLOCK_REASON_PAY_PHONE = 6; // 0x6
    field public static final int BLOCK_REASON_RESTRICTED_NUMBER = 5; // 0x5
    field public static final int BLOCK_REASON_UNKNOWN_NUMBER = 4; // 0x4
    field public static final String CACHED_FORMATTED_NUMBER = "formatted_number";
    field public static final String CACHED_LOOKUP_URI = "lookup_uri";
    field public static final String CACHED_MATCHED_NUMBER = "matched_number";
    field public static final String CACHED_NAME = "name";
    field public static final String CACHED_NORMALIZED_NUMBER = "normalized_number";
    field public static final String CACHED_NUMBER_LABEL = "numberlabel";
    field public static final String CACHED_NUMBER_TYPE = "numbertype";
    field public static final String CACHED_PHOTO_ID = "photo_id";
    field public static final String CACHED_PHOTO_URI = "photo_uri";
    field public static final String CALL_ID_APP_NAME = "call_id_app_name";
    field public static final String CALL_ID_DESCRIPTION = "call_id_description";
    field public static final String CALL_ID_DETAILS = "call_id_details";
    field public static final String CALL_ID_NAME = "call_id_name";
    field public static final String CALL_ID_NUISANCE_CONFIDENCE = "call_id_nuisance_confidence";
    field public static final String CALL_ID_PACKAGE_NAME = "call_id_package_name";
    field public static final String CALL_SCREENING_APP_NAME = "call_screening_app_name";
    field public static final String CALL_SCREENING_COMPONENT_NAME = "call_screening_component_name";
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/calls";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/calls";
    field public static final android.net.Uri CONTENT_URI;
    field public static final android.net.Uri CONTENT_URI_WITH_VOICEMAIL;
    field public static final String COUNTRY_ISO = "countryiso";
    field public static final String DATA_USAGE = "data_usage";
    field public static final String DATE = "date";
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
    field public static final String DURATION = "duration";
    field public static final String EXTRA_CALL_TYPE_FILTER = "android.provider.extra.CALL_TYPE_FILTER";
    field public static final String FEATURES = "features";
    field public static final int FEATURES_HD_CALL = 4; // 0x4
    field public static final int FEATURES_PULLED_EXTERNALLY = 2; // 0x2
    field public static final int FEATURES_RTT = 32; // 0x20
    field public static final int FEATURES_VIDEO = 1; // 0x1
    field public static final int FEATURES_WIFI = 8; // 0x8
    field public static final String GEOCODED_LOCATION = "geocoded_location";
    field public static final int INCOMING_TYPE = 1; // 0x1
    field public static final String IS_READ = "is_read";
    field public static final String LAST_MODIFIED = "last_modified";
    field public static final String LIMIT_PARAM_KEY = "limit";
    field public static final int MISSED_TYPE = 3; // 0x3
    field public static final String NEW = "new";
    field public static final String NUMBER = "number";
    field public static final String NUMBER_PRESENTATION = "presentation";
    field public static final String OFFSET_PARAM_KEY = "offset";
    field public static final int OUTGOING_TYPE = 2; // 0x2
    field public static final String PHONE_ACCOUNT_COMPONENT_NAME = "subscription_component_name";
    field public static final String PHONE_ACCOUNT_ID = "subscription_id";
    field public static final String POST_DIAL_DIGITS = "post_dial_digits";
    field public static final int PRESENTATION_ALLOWED = 1; // 0x1
    field public static final int PRESENTATION_PAYPHONE = 4; // 0x4
    field public static final int PRESENTATION_RESTRICTED = 2; // 0x2
    field public static final int PRESENTATION_UNKNOWN = 3; // 0x3
    field public static final int REJECTED_TYPE = 5; // 0x5
    field public static final String TRANSCRIPTION = "transcription";
    field public static final String TYPE = "type";
    field public static final String VIA_NUMBER = "via_number";
    field public static final int VOICEMAIL_TYPE = 4; // 0x4
    field public static final String VOICEMAIL_URI = "voicemail_uri";
  }

  @Deprecated public class Contacts {
    field @Deprecated public static final String AUTHORITY = "contacts";
    field @Deprecated public static final android.net.Uri CONTENT_URI;
    field @Deprecated public static final int KIND_EMAIL = 1; // 0x1
    field @Deprecated public static final int KIND_IM = 3; // 0x3
    field @Deprecated public static final int KIND_ORGANIZATION = 4; // 0x4
    field @Deprecated public static final int KIND_PHONE = 5; // 0x5
    field @Deprecated public static final int KIND_POSTAL = 2; // 0x2
  }

  @Deprecated public static final class Contacts.ContactMethods implements android.provider.BaseColumns android.provider.Contacts.ContactMethodsColumns android.provider.Contacts.PeopleColumns {
    method @Deprecated public void addPostalLocation(android.content.Context, long, double, double);
    method @Deprecated public static Object decodeImProtocol(String);
    method @Deprecated public static String encodeCustomImProtocol(String);
    method @Deprecated public static String encodePredefinedImProtocol(int);
    method @Deprecated public static CharSequence getDisplayLabel(android.content.Context, int, int, CharSequence);
    field @Deprecated public static final String CONTENT_EMAIL_ITEM_TYPE = "vnd.android.cursor.item/email";
    field @Deprecated public static final String CONTENT_EMAIL_TYPE = "vnd.android.cursor.dir/email";
    field @Deprecated public static final android.net.Uri CONTENT_EMAIL_URI;
    field @Deprecated public static final String CONTENT_IM_ITEM_TYPE = "vnd.android.cursor.item/jabber-im";
    field @Deprecated public static final String CONTENT_POSTAL_ITEM_TYPE = "vnd.android.cursor.item/postal-address";
    field @Deprecated public static final String CONTENT_POSTAL_TYPE = "vnd.android.cursor.dir/postal-address";
    field @Deprecated public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact-methods";
    field @Deprecated public static final android.net.Uri CONTENT_URI;
    field @Deprecated public static final String DEFAULT_SORT_ORDER = "name ASC";
    field @Deprecated public static final String PERSON_ID = "person";
    field @Deprecated public static final String POSTAL_LOCATION_LATITUDE = "data";
    field @Deprecated public static final String POSTAL_LOCATION_LONGITUDE = "aux_data";
    field @Deprecated public static final int PROTOCOL_AIM = 0; // 0x0
    field @Deprecated public static final int PROTOCOL_GOOGLE_TALK = 5; // 0x5
    field @Deprecated public static final int PROTOCOL_ICQ = 6; // 0x6
    field @Deprecated public static final int PROTOCOL_JABBER = 7; // 0x7
    field @Deprecated public static final int PROTOCOL_MSN = 1; // 0x1
    field @Deprecated public static final int PROTOCOL_QQ = 4; // 0x4
    field @Deprecated public static final int PROTOCOL_SKYPE = 3; // 0x3
    field @Deprecated public static final int PROTOCOL_YAHOO = 2; // 0x2
  }

  @Deprecated public static interface Contacts.ContactMethodsColumns {
    field @Deprecated public static final String AUX_DATA = "aux_data";
    field @Deprecated public static final String DATA = "data";
    field @Deprecated public static final String ISPRIMARY = "isprimary";
    field @Deprecated public static final String KIND = "kind";
    field @Deprecated public static final String LABEL = "label";
    field @Deprecated public static final String TYPE = "type";
    field @Deprecated public static final int TYPE_CUSTOM = 0; // 0x0
    field @Deprecated public static final int TYPE_HOME = 1; // 0x1
    field @Deprecated public static final int TYPE_OTHER = 3; // 0x3
    field @Deprecated public static final int TYPE_WORK = 2; // 0x2
  }

  @Deprecated public static final class Contacts.Extensions implements android.provider.BaseColumns android.provider.Contacts.ExtensionsColumns {
    field @Deprecated public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_extensions";
    field @Deprecated public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact_extensions";
    field @Deprecated public static final android.net.Uri CONTENT_URI;
    field @Deprecated public static final String DEFAULT_SORT_ORDER = "person, name ASC";
    field @Deprecated public static final String PERSON_ID = "person";
  }

  @Deprecated public static interface Contacts.ExtensionsColumns {
    field @Deprecated public static final String NAME = "name";
    field @Deprecated public static final String VALUE = "value";
  }

  @Deprecated public static final class Contacts.GroupMembership implements android.provider.BaseColumns android.provider.Contacts.GroupsColumns {
    field @Deprecated public static final String CONTENT_DIRECTORY = "groupmembership";
    field @Deprecated public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contactsgroupmembership";
    field @Deprecated public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contactsgroupmembership";
    field @Deprecated public static final android.net.Uri CONTENT_URI;
    field @Deprecated public static final String DEFAULT_SORT_ORDER = "group_id ASC";
    field @Deprecated public static final String GROUP_ID = "group_id";
    field @Deprecated public static final String GROUP_SYNC_ACCOUNT = "group_sync_account";
    field @Deprecated public static final String GROUP_SYNC_ACCOUNT_TYPE = "group_sync_account_type";
    field @Deprecated public static final String GROUP_SYNC_ID = "group_sync_id";
    field @Deprecated public static final String PERSON_ID = "person";
    field @Deprecated public static final android.net.Uri RAW_CONTENT_URI;
  }

  @Deprecated public static final class Contacts.Groups implements android.provider.BaseColumns android.provider.Contacts.GroupsColumns {
    field @Deprecated public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contactsgroup";
    field @Deprecated public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contactsgroup";
    field @Deprecated public static final android.net.Uri CONTENT_URI;
    field @Deprecated public static final String DEFAULT_SORT_ORDER = "name ASC";
    field @Deprecated public static final android.net.Uri DELETED_CONTENT_URI;
    field @Deprecated public static final String GROUP_ANDROID_STARRED = "Starred in Android";
    field @Deprecated public static final String GROUP_MY_CONTACTS = "Contacts";
  }

  @Deprecated public static interface Contacts.GroupsColumns {
    field @Deprecated public static final String NAME = "name";
    field @Deprecated public static final String NOTES = "notes";
    field @Deprecated public static final String SHOULD_SYNC = "should_sync";
    field @Deprecated public static final String SYSTEM_ID = "system_id";
  }

  @Deprecated public static final class Contacts.Intents {
    ctor @Deprecated public Contacts.Intents();
    field @Deprecated public static final String ATTACH_IMAGE = "com.android.contacts.action.ATTACH_IMAGE";
    field @Deprecated public static final String EXTRA_CREATE_DESCRIPTION = "com.android.contacts.action.CREATE_DESCRIPTION";
    field @Deprecated public static final String EXTRA_FORCE_CREATE = "com.android.contacts.action.FORCE_CREATE";
    field @Deprecated public static final String SEARCH_SUGGESTION_CLICKED = "android.provider.Contacts.SEARCH_SUGGESTION_CLICKED";
    field @Deprecated public static final String SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED = "android.provider.Contacts.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED";
    field @Deprecated public static final String SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED = "android.provider.Contacts.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED";
    field @Deprecated public static final String SHOW_OR_CREATE_CONTACT = "com.android.contacts.action.SHOW_OR_CREATE_CONTACT";
  }

  @Deprecated public static final class Contacts.Intents.Insert {
    ctor @Deprecated public Contacts.Intents.Insert();
    field @Deprecated public static final String ACTION = "android.intent.action.INSERT";
    field @Deprecated public static final String COMPANY = "company";
    field @Deprecated public static final String EMAIL = "email";
    field @Deprecated public static final String EMAIL_ISPRIMARY = "email_isprimary";
    field @Deprecated public static final String EMAIL_TYPE = "email_type";
    field @Deprecated public static final String FULL_MODE = "full_mode";
    field @Deprecated public static final String IM_HANDLE = "im_handle";
    field @Deprecated public static final String IM_ISPRIMARY = "im_isprimary";
    field @Deprecated public static final String IM_PROTOCOL = "im_protocol";
    field @Deprecated public static final String JOB_TITLE = "job_title";
    field @Deprecated public static final String NAME = "name";
    field @Deprecated public static final String NOTES = "notes";
    field @Deprecated public static final String PHONE = "phone";
    field @Deprecated public static final String PHONETIC_NAME = "phonetic_name";
    field @Deprecated public static final String PHONE_ISPRIMARY = "phone_isprimary";
    field @Deprecated public static final String PHONE_TYPE = "phone_type";
    field @Deprecated public static final String POSTAL = "postal";
    field @Deprecated public static final String POSTAL_ISPRIMARY = "postal_isprimary";
    field @Deprecated public static final String POSTAL_TYPE = "postal_type";
    field @Deprecated public static final String SECONDARY_EMAIL = "secondary_email";
    field @Deprecated public static final String SECONDARY_EMAIL_TYPE = "secondary_email_type";
    field @Deprecated public static final String SECONDARY_PHONE = "secondary_phone";
    field @Deprecated public static final String SECONDARY_PHONE_TYPE = "secondary_phone_type";
    field @Deprecated public static final String TERTIARY_EMAIL = "tertiary_email";
    field @Deprecated public static final String TERTIARY_EMAIL_TYPE = "tertiary_email_type";
    field @Deprecated public static final String TERTIARY_PHONE = "tertiary_phone";
    field @Deprecated public static final String TERTIARY_PHONE_TYPE = "tertiary_phone_type";
  }

  @Deprecated public static final class Contacts.Intents.UI {
    ctor @Deprecated public Contacts.Intents.UI();
    field @Deprecated public static final String FILTER_CONTACTS_ACTION = "com.android.contacts.action.FILTER_CONTACTS";
    field @Deprecated public static final String FILTER_TEXT_EXTRA_KEY = "com.android.contacts.extra.FILTER_TEXT";
    field @Deprecated public static final String GROUP_NAME_EXTRA_KEY = "com.android.contacts.extra.GROUP";
    field @Deprecated public static final String LIST_ALL_CONTACTS_ACTION = "com.android.contacts.action.LIST_ALL_CONTACTS";
    field @Deprecated public static final String LIST_CONTACTS_WITH_PHONES_ACTION = "com.android.contacts.action.LIST_CONTACTS_WITH_PHONES";
    field @Deprecated public static final String LIST_DEFAULT = "com.android.contacts.action.LIST_DEFAULT";
    field @Deprecated public static final String LIST_FREQUENT_ACTION = "com.android.contacts.action.LIST_FREQUENT";
    field @Deprecated public static final String LIST_GROUP_ACTION = "com.android.contacts.action.LIST_GROUP";
    field @Deprecated public static final String LIST_STARRED_ACTION = "com.android.contacts.action.LIST_STARRED";
    field @Deprecated public static final String LIST_STREQUENT_ACTION = "com.android.contacts.action.LIST_STREQUENT";
    field @Deprecated public static final String TITLE_EXTRA_KEY = "com.android.contacts.extra.TITLE_EXTRA";
  }

  @Deprecated public static interface Contacts.OrganizationColumns {
    field @Deprecated public static final String COMPANY = "company";
    field @Deprecated public static final String ISPRIMARY = "isprimary";
    field @Deprecated public static final String LABEL = "label";
    field @Deprecated public static final String PERSON_ID = "person";
    field @Deprecated public static final String TITLE = "title";
    field @Deprecated public static final String TYPE = "type";
    field @Deprecated public static final int TYPE_CUSTOM = 0; // 0x0
    field @Deprecated public static final int TYPE_OTHER = 2; // 0x2
    field @Deprecated public static final int TYPE_WORK = 1; // 0x1
  }

  @Deprecated public static final class Contacts.Organizations implements android.provider.BaseColumns android.provider.Contacts.OrganizationColumns {
    method @Deprecated public static CharSequence getDisplayLabel(android.content.Context, int, CharSequence);
    field @Deprecated public static final String CONTENT_DIRECTORY = "organizations";
    field @Deprecated public static final android.net.Uri CONTENT_URI;
    field @Deprecated public static final String DEFAULT_SORT_ORDER = "company, title, isprimary ASC";
  }

  @Deprecated public static final class Contacts.People implements android.provider.BaseColumns android.provider.Contacts.PeopleColumns android.provider.Contacts.PhonesColumns android.provider.Contacts.PresenceColumns {
    method @Deprecated public static android.net.Uri addToGroup(android.content.ContentResolver, long, String);
    method @Deprecated public static android.net.Uri addToGroup(android.content.ContentResolver, long, long);
    method @Deprecated public static android.net.Uri addToMyContactsGroup(android.content.ContentResolver, long);
    method @Deprecated public static android.net.Uri createPersonInMyContactsGroup(android.content.ContentResolver, android.content.ContentValues);
    method @Deprecated public static android.graphics.Bitmap loadContactPhoto(android.content.Context, android.net.Uri, int, android.graphics.BitmapFactory.Options);
    method @Deprecated public static void markAsContacted(android.content.ContentResolver, long);
    method @Deprecated public static java.io.InputStream openContactPhotoInputStream(android.content.ContentResolver, android.net.Uri);
    method @Deprecated public static android.database.Cursor queryGroups(android.content.ContentResolver, long);
    method @Deprecated public static void setPhotoData(android.content.ContentResolver, android.net.Uri, byte[]);
    field @Deprecated public static final android.net.Uri CONTENT_FILTER_URI;
    field @Deprecated public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/person";
    field @Deprecated public static final String CONTENT_TYPE = "vnd.android.cursor.dir/person";
    field @Deprecated public static final android.net.Uri CONTENT_URI;
    field @Deprecated public static final String DEFAULT_SORT_ORDER = "name ASC";
    field @Deprecated public static final android.net.Uri DELETED_CONTENT_URI;
    field @Deprecated public static final String PRIMARY_EMAIL_ID = "primary_email";
    field @Deprecated public static final String PRIMARY_ORGANIZATION_ID = "primary_organization";
    field @Deprecated public static final String PRIMARY_PHONE_ID = "primary_phone";
  }

  @Deprecated public static final class Contacts.People.ContactMethods implements android.provider.BaseColumns android.provider.Contacts.ContactMethodsColumns android.provider.Contacts.PeopleColumns {
    field @Deprecated public static final String CONTENT_DIRECTORY = "contact_methods";
    field @Deprecated public static final String DEFAULT_SORT_ORDER = "data ASC";
  }

  @Deprecated public static class Contacts.People.Extensions implements android.provider.BaseColumns android.provider.Contacts.ExtensionsColumns {
    field @Deprecated public static final String CONTENT_DIRECTORY = "extensions";
    field @Deprecated public static final String DEFAULT_SORT_ORDER = "name ASC";
    field @Deprecated public static final String PERSON_ID = "person";
  }

  @Deprecated public static final class Contacts.People.Phones implements android.provider.BaseColumns android.provider.Contacts.PeopleColumns android.provider.Contacts.PhonesColumns {
    field @Deprecated public static final String CONTENT_DIRECTORY = "phones";
    field @Deprecated public static final String DEFAULT_SORT_ORDER = "number ASC";
  }

  @Deprecated public static interface Contacts.PeopleColumns {
    field @Deprecated public static final String CUSTOM_RINGTONE = "custom_ringtone";
    field @Deprecated public static final String DISPLAY_NAME = "display_name";
    field @Deprecated public static final String LAST_TIME_CONTACTED = "last_time_contacted";
    field @Deprecated public static final String NAME = "name";
    field @Deprecated public static final String NOTES = "notes";
    field @Deprecated public static final String PHONETIC_NAME = "phonetic_name";
    field @Deprecated public static final String PHOTO_VERSION = "photo_version";
    field @Deprecated public static final String SEND_TO_VOICEMAIL = "send_to_voicemail";
    field @Deprecated public static final String STARRED = "starred";
    field @Deprecated public static final String TIMES_CONTACTED = "times_contacted";
  }

  @Deprecated public static final class Contacts.Phones implements android.provider.BaseColumns android.provider.Contacts.PeopleColumns android.provider.Contacts.PhonesColumns {
    method @Deprecated public static CharSequence getDisplayLabel(android.content.Context, int, CharSequence, CharSequence[]);
    method @Deprecated public static CharSequence getDisplayLabel(android.content.Context, int, CharSequence);
    field @Deprecated public static final android.net.Uri CONTENT_FILTER_URL;
    field @Deprecated public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone";
    field @Deprecated public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone";
    field @Deprecated public static final android.net.Uri CONTENT_URI;
    field @Deprecated public static final String DEFAULT_SORT_ORDER = "name ASC";
    field @Deprecated public static final String PERSON_ID = "person";
  }

  @Deprecated public static interface Contacts.PhonesColumns {
    field @Deprecated public static final String ISPRIMARY = "isprimary";
    field @Deprecated public static final String LABEL = "label";
    field @Deprecated public static final String NUMBER = "number";
    field @Deprecated public static final String NUMBER_KEY = "number_key";
    field @Deprecated public static final String TYPE = "type";
    field @Deprecated public static final int TYPE_CUSTOM = 0; // 0x0
    field @Deprecated public static final int TYPE_FAX_HOME = 5; // 0x5
    field @Deprecated public static final int TYPE_FAX_WORK = 4; // 0x4
    field @Deprecated public static final int TYPE_HOME = 1; // 0x1
    field @Deprecated public static final int TYPE_MOBILE = 2; // 0x2
    field @Deprecated public static final int TYPE_OTHER = 7; // 0x7
    field @Deprecated public static final int TYPE_PAGER = 6; // 0x6
    field @Deprecated public static final int TYPE_WORK = 3; // 0x3
  }

  @Deprecated public static final class Contacts.Photos implements android.provider.BaseColumns android.provider.Contacts.PhotosColumns {
    field @Deprecated public static final String CONTENT_DIRECTORY = "photo";
    field @Deprecated public static final android.net.Uri CONTENT_URI;
    field @Deprecated public static final String DEFAULT_SORT_ORDER = "person ASC";
  }

  @Deprecated public static interface Contacts.PhotosColumns {
    field @Deprecated public static final String DATA = "data";
    field @Deprecated public static final String DOWNLOAD_REQUIRED = "download_required";
    field @Deprecated public static final String EXISTS_ON_SERVER = "exists_on_server";
    field @Deprecated public static final String LOCAL_VERSION = "local_version";
    field @Deprecated public static final String PERSON_ID = "person";
    field @Deprecated public static final String SYNC_ERROR = "sync_error";
  }

  @Deprecated public static interface Contacts.PresenceColumns {
    field @Deprecated public static final int AVAILABLE = 5; // 0x5
    field @Deprecated public static final int AWAY = 2; // 0x2
    field @Deprecated public static final int DO_NOT_DISTURB = 4; // 0x4
    field @Deprecated public static final int IDLE = 3; // 0x3
    field @Deprecated public static final String IM_ACCOUNT = "im_account";
    field @Deprecated public static final String IM_HANDLE = "im_handle";
    field @Deprecated public static final String IM_PROTOCOL = "im_protocol";
    field @Deprecated public static final int INVISIBLE = 1; // 0x1
    field @Deprecated public static final int OFFLINE = 0; // 0x0
    field @Deprecated public static final String PRESENCE_CUSTOM_STATUS = "status";
    field @Deprecated public static final String PRESENCE_STATUS = "mode";
    field @Deprecated public static final String PRIORITY = "priority";
  }

  @Deprecated public static final class Contacts.Settings implements android.provider.BaseColumns android.provider.Contacts.SettingsColumns {
    method @Deprecated public static String getSetting(android.content.ContentResolver, String, String);
    method @Deprecated public static void setSetting(android.content.ContentResolver, String, String, String);
    field @Deprecated public static final String CONTENT_DIRECTORY = "settings";
    field @Deprecated public static final android.net.Uri CONTENT_URI;
    field @Deprecated public static final String DEFAULT_SORT_ORDER = "key ASC";
    field @Deprecated public static final String SYNC_EVERYTHING = "syncEverything";
  }

  @Deprecated public static interface Contacts.SettingsColumns {
    field @Deprecated public static final String KEY = "key";
    field @Deprecated public static final String VALUE = "value";
    field @Deprecated public static final String _SYNC_ACCOUNT = "_sync_account";
    field @Deprecated public static final String _SYNC_ACCOUNT_TYPE = "_sync_account_type";
  }

  public final class ContactsContract {
    ctor public ContactsContract();
    method public static boolean isProfileId(long);
    field public static final String AUTHORITY = "com.android.contacts";
    field public static final android.net.Uri AUTHORITY_URI;
    field public static final String CALLER_IS_SYNCADAPTER = "caller_is_syncadapter";
    field public static final String DEFERRED_SNIPPETING = "deferred_snippeting";
    field public static final String DEFERRED_SNIPPETING_QUERY = "deferred_snippeting_query";
    field public static final String DIRECTORY_PARAM_KEY = "directory";
    field public static final String LIMIT_PARAM_KEY = "limit";
    field public static final String PRIMARY_ACCOUNT_NAME = "name_for_primary_account";
    field public static final String PRIMARY_ACCOUNT_TYPE = "type_for_primary_account";
    field public static final String REMOVE_DUPLICATE_ENTRIES = "remove_duplicate_entries";
    field public static final String STREQUENT_PHONE_ONLY = "strequent_phone_only";
  }

  public static final class ContactsContract.AggregationExceptions implements android.provider.BaseColumns {
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/aggregation_exception";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/aggregation_exception";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String RAW_CONTACT_ID1 = "raw_contact_id1";
    field public static final String RAW_CONTACT_ID2 = "raw_contact_id2";
    field public static final String TYPE = "type";
    field public static final int TYPE_AUTOMATIC = 0; // 0x0
    field public static final int TYPE_KEEP_SEPARATE = 2; // 0x2
    field public static final int TYPE_KEEP_TOGETHER = 1; // 0x1
  }

  protected static interface ContactsContract.BaseSyncColumns {
    field public static final String SYNC1 = "sync1";
    field public static final String SYNC2 = "sync2";
    field public static final String SYNC3 = "sync3";
    field public static final String SYNC4 = "sync4";
  }

  public static final class ContactsContract.CommonDataKinds {
  }

  public static interface ContactsContract.CommonDataKinds.BaseTypes {
    field public static final int TYPE_CUSTOM = 0; // 0x0
  }

  public static final class ContactsContract.CommonDataKinds.Callable implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    ctor public ContactsContract.CommonDataKinds.Callable();
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final android.net.Uri CONTENT_URI;
    field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
  }

  protected static interface ContactsContract.CommonDataKinds.CommonColumns extends android.provider.ContactsContract.CommonDataKinds.BaseTypes {
    field public static final String DATA = "data1";
    field public static final String LABEL = "data3";
    field public static final String TYPE = "data2";
  }

  public static final class ContactsContract.CommonDataKinds.Contactables implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    ctor public ContactsContract.CommonDataKinds.Contactables();
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final android.net.Uri CONTENT_URI;
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String VISIBLE_CONTACTS_ONLY = "visible_contacts_only";
  }

  public static final class ContactsContract.CommonDataKinds.Email implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    method public static CharSequence getTypeLabel(android.content.res.Resources, int, CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final String ADDRESS = "data1";
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/email_v2";
    field public static final android.net.Uri CONTENT_LOOKUP_URI;
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/email_v2";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DISPLAY_NAME = "data4";
    field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
    field public static final android.net.Uri ENTERPRISE_CONTENT_LOOKUP_URI;
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final int TYPE_HOME = 1; // 0x1
    field public static final int TYPE_MOBILE = 4; // 0x4
    field public static final int TYPE_OTHER = 3; // 0x3
    field public static final int TYPE_WORK = 2; // 0x2
  }

  public static final class ContactsContract.CommonDataKinds.Event implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    method public static CharSequence getTypeLabel(android.content.res.Resources, int, CharSequence);
    method public static int getTypeResource(Integer);
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_event";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String START_DATE = "data1";
    field public static final int TYPE_ANNIVERSARY = 1; // 0x1
    field public static final int TYPE_BIRTHDAY = 3; // 0x3
    field public static final int TYPE_OTHER = 2; // 0x2
  }

  public static final class ContactsContract.CommonDataKinds.GroupMembership implements android.provider.ContactsContract.DataColumnsWithJoins {
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/group_membership";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String GROUP_ROW_ID = "data1";
    field public static final String GROUP_SOURCE_ID = "group_sourceid";
  }

  public static final class ContactsContract.CommonDataKinds.Identity implements android.provider.ContactsContract.DataColumnsWithJoins {
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/identity";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String IDENTITY = "data1";
    field public static final String NAMESPACE = "data2";
  }

  public static final class ContactsContract.CommonDataKinds.Im implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    method public static CharSequence getProtocolLabel(android.content.res.Resources, int, CharSequence);
    method public static int getProtocolLabelResource(int);
    method public static CharSequence getTypeLabel(android.content.res.Resources, int, CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im";
    field public static final String CUSTOM_PROTOCOL = "data6";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String PROTOCOL = "data5";
    field public static final int PROTOCOL_AIM = 0; // 0x0
    field public static final int PROTOCOL_CUSTOM = -1; // 0xffffffff
    field public static final int PROTOCOL_GOOGLE_TALK = 5; // 0x5
    field public static final int PROTOCOL_ICQ = 6; // 0x6
    field public static final int PROTOCOL_JABBER = 7; // 0x7
    field public static final int PROTOCOL_MSN = 1; // 0x1
    field public static final int PROTOCOL_NETMEETING = 8; // 0x8
    field public static final int PROTOCOL_QQ = 4; // 0x4
    field public static final int PROTOCOL_SKYPE = 3; // 0x3
    field public static final int PROTOCOL_YAHOO = 2; // 0x2
    field public static final int TYPE_HOME = 1; // 0x1
    field public static final int TYPE_OTHER = 3; // 0x3
    field public static final int TYPE_WORK = 2; // 0x2
  }

  public static final class ContactsContract.CommonDataKinds.Nickname implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/nickname";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String NAME = "data1";
    field public static final int TYPE_DEFAULT = 1; // 0x1
    field public static final int TYPE_INITIALS = 5; // 0x5
    field public static final int TYPE_MAIDEN_NAME = 3; // 0x3
    field @Deprecated public static final int TYPE_MAINDEN_NAME = 3; // 0x3
    field public static final int TYPE_OTHER_NAME = 2; // 0x2
    field public static final int TYPE_SHORT_NAME = 4; // 0x4
  }

  public static final class ContactsContract.CommonDataKinds.Note implements android.provider.ContactsContract.DataColumnsWithJoins {
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/note";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String NOTE = "data1";
  }

  public static final class ContactsContract.CommonDataKinds.Organization implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    method public static CharSequence getTypeLabel(android.content.res.Resources, int, CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final String COMPANY = "data1";
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/organization";
    field public static final String DEPARTMENT = "data5";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String JOB_DESCRIPTION = "data6";
    field public static final String OFFICE_LOCATION = "data9";
    field public static final String PHONETIC_NAME = "data8";
    field public static final String PHONETIC_NAME_STYLE = "data10";
    field public static final String SYMBOL = "data7";
    field public static final String TITLE = "data4";
    field public static final int TYPE_OTHER = 2; // 0x2
    field public static final int TYPE_WORK = 1; // 0x1
  }

  public static final class ContactsContract.CommonDataKinds.Phone implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    method public static CharSequence getTypeLabel(android.content.res.Resources, int, CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone_v2";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone_v2";
    field public static final android.net.Uri CONTENT_URI;
    field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String NORMALIZED_NUMBER = "data4";
    field public static final String NUMBER = "data1";
    field public static final String SEARCH_DISPLAY_NAME_KEY = "search_display_name";
    field public static final String SEARCH_PHONE_NUMBER_KEY = "search_phone_number";
    field public static final int TYPE_ASSISTANT = 19; // 0x13
    field public static final int TYPE_CALLBACK = 8; // 0x8
    field public static final int TYPE_CAR = 9; // 0x9
    field public static final int TYPE_COMPANY_MAIN = 10; // 0xa
    field public static final int TYPE_FAX_HOME = 5; // 0x5
    field public static final int TYPE_FAX_WORK = 4; // 0x4
    field public static final int TYPE_HOME = 1; // 0x1
    field public static final int TYPE_ISDN = 11; // 0xb
    field public static final int TYPE_MAIN = 12; // 0xc
    field public static final int TYPE_MMS = 20; // 0x14
    field public static final int TYPE_MOBILE = 2; // 0x2
    field public static final int TYPE_OTHER = 7; // 0x7
    field public static final int TYPE_OTHER_FAX = 13; // 0xd
    field public static final int TYPE_PAGER = 6; // 0x6
    field public static final int TYPE_RADIO = 14; // 0xe
    field public static final int TYPE_TELEX = 15; // 0xf
    field public static final int TYPE_TTY_TDD = 16; // 0x10
    field public static final int TYPE_WORK = 3; // 0x3
    field public static final int TYPE_WORK_MOBILE = 17; // 0x11
    field public static final int TYPE_WORK_PAGER = 18; // 0x12
  }

  public static final class ContactsContract.CommonDataKinds.Photo implements android.provider.ContactsContract.DataColumnsWithJoins {
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/photo";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String PHOTO = "data15";
    field public static final String PHOTO_FILE_ID = "data14";
  }

  public static final class ContactsContract.CommonDataKinds.Relation implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    method public static CharSequence getTypeLabel(android.content.res.Resources, int, CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/relation";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String NAME = "data1";
    field public static final int TYPE_ASSISTANT = 1; // 0x1
    field public static final int TYPE_BROTHER = 2; // 0x2
    field public static final int TYPE_CHILD = 3; // 0x3
    field public static final int TYPE_DOMESTIC_PARTNER = 4; // 0x4
    field public static final int TYPE_FATHER = 5; // 0x5
    field public static final int TYPE_FRIEND = 6; // 0x6
    field public static final int TYPE_MANAGER = 7; // 0x7
    field public static final int TYPE_MOTHER = 8; // 0x8
    field public static final int TYPE_PARENT = 9; // 0x9
    field public static final int TYPE_PARTNER = 10; // 0xa
    field public static final int TYPE_REFERRED_BY = 11; // 0xb
    field public static final int TYPE_RELATIVE = 12; // 0xc
    field public static final int TYPE_SISTER = 13; // 0xd
    field public static final int TYPE_SPOUSE = 14; // 0xe
  }

  public static final class ContactsContract.CommonDataKinds.SipAddress implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    method public static CharSequence getTypeLabel(android.content.res.Resources, int, CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/sip_address";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String SIP_ADDRESS = "data1";
    field public static final int TYPE_HOME = 1; // 0x1
    field public static final int TYPE_OTHER = 3; // 0x3
    field public static final int TYPE_WORK = 2; // 0x2
  }

  public static final class ContactsContract.CommonDataKinds.StructuredName implements android.provider.ContactsContract.DataColumnsWithJoins {
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/name";
    field public static final String DISPLAY_NAME = "data1";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String FAMILY_NAME = "data3";
    field public static final String FULL_NAME_STYLE = "data10";
    field public static final String GIVEN_NAME = "data2";
    field public static final String MIDDLE_NAME = "data5";
    field public static final String PHONETIC_FAMILY_NAME = "data9";
    field public static final String PHONETIC_GIVEN_NAME = "data7";
    field public static final String PHONETIC_MIDDLE_NAME = "data8";
    field public static final String PHONETIC_NAME_STYLE = "data11";
    field public static final String PREFIX = "data4";
    field public static final String SUFFIX = "data6";
  }

  public static final class ContactsContract.CommonDataKinds.StructuredPostal implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    method public static CharSequence getTypeLabel(android.content.res.Resources, int, CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final String CITY = "data7";
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/postal-address_v2";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/postal-address_v2";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String COUNTRY = "data10";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String FORMATTED_ADDRESS = "data1";
    field public static final String NEIGHBORHOOD = "data6";
    field public static final String POBOX = "data5";
    field public static final String POSTCODE = "data9";
    field public static final String REGION = "data8";
    field public static final String STREET = "data4";
    field public static final int TYPE_HOME = 1; // 0x1
    field public static final int TYPE_OTHER = 3; // 0x3
    field public static final int TYPE_WORK = 2; // 0x2
  }

  public static final class ContactsContract.CommonDataKinds.Website implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/website";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final int TYPE_BLOG = 2; // 0x2
    field public static final int TYPE_FTP = 6; // 0x6
    field public static final int TYPE_HOME = 4; // 0x4
    field public static final int TYPE_HOMEPAGE = 1; // 0x1
    field public static final int TYPE_OTHER = 7; // 0x7
    field public static final int TYPE_PROFILE = 3; // 0x3
    field public static final int TYPE_WORK = 5; // 0x5
    field public static final String URL = "data1";
  }

  protected static interface ContactsContract.ContactNameColumns {
    field public static final String DISPLAY_NAME_ALTERNATIVE = "display_name_alt";
    field public static final String DISPLAY_NAME_PRIMARY = "display_name";
    field public static final String DISPLAY_NAME_SOURCE = "display_name_source";
    field public static final String PHONETIC_NAME = "phonetic_name";
    field public static final String PHONETIC_NAME_STYLE = "phonetic_name_style";
    field public static final String SORT_KEY_ALTERNATIVE = "sort_key_alt";
    field public static final String SORT_KEY_PRIMARY = "sort_key";
  }

  protected static interface ContactsContract.ContactOptionsColumns {
    field public static final String CUSTOM_RINGTONE = "custom_ringtone";
    field public static final String LAST_TIME_CONTACTED = "last_time_contacted";
    field public static final String PINNED = "pinned";
    field public static final String SEND_TO_VOICEMAIL = "send_to_voicemail";
    field public static final String STARRED = "starred";
    field public static final String TIMES_CONTACTED = "times_contacted";
  }

  protected static interface ContactsContract.ContactStatusColumns {
    field public static final String CONTACT_CHAT_CAPABILITY = "contact_chat_capability";
    field public static final String CONTACT_PRESENCE = "contact_presence";
    field public static final String CONTACT_STATUS = "contact_status";
    field public static final String CONTACT_STATUS_ICON = "contact_status_icon";
    field public static final String CONTACT_STATUS_LABEL = "contact_status_label";
    field public static final String CONTACT_STATUS_RES_PACKAGE = "contact_status_res_package";
    field public static final String CONTACT_STATUS_TIMESTAMP = "contact_status_ts";
  }

  public static class ContactsContract.Contacts implements android.provider.BaseColumns android.provider.ContactsContract.ContactNameColumns android.provider.ContactsContract.ContactOptionsColumns android.provider.ContactsContract.ContactStatusColumns android.provider.ContactsContract.ContactsColumns {
    method public static android.net.Uri getLookupUri(android.content.ContentResolver, android.net.Uri);
    method public static android.net.Uri getLookupUri(long, String);
    method public static boolean isEnterpriseContactId(long);
    method public static android.net.Uri lookupContact(android.content.ContentResolver, android.net.Uri);
    method @Deprecated public static void markAsContacted(android.content.ContentResolver, long);
    method public static java.io.InputStream openContactPhotoInputStream(android.content.ContentResolver, android.net.Uri, boolean);
    method public static java.io.InputStream openContactPhotoInputStream(android.content.ContentResolver, android.net.Uri);
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final android.net.Uri CONTENT_FREQUENT_URI;
    field public static final android.net.Uri CONTENT_GROUP_URI;
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact";
    field public static final android.net.Uri CONTENT_LOOKUP_URI;
    field public static final android.net.Uri CONTENT_MULTI_VCARD_URI;
    field public static final android.net.Uri CONTENT_STREQUENT_FILTER_URI;
    field public static final android.net.Uri CONTENT_STREQUENT_URI;
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String CONTENT_VCARD_TYPE = "text/x-vcard";
    field public static final android.net.Uri CONTENT_VCARD_URI;
    field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String QUERY_PARAMETER_VCARD_NO_PHOTO = "no_photo";
  }

  public static final class ContactsContract.Contacts.AggregationSuggestions implements android.provider.BaseColumns android.provider.ContactsContract.ContactOptionsColumns android.provider.ContactsContract.ContactStatusColumns android.provider.ContactsContract.ContactsColumns {
    field public static final String CONTENT_DIRECTORY = "suggestions";
  }

  public static final class ContactsContract.Contacts.AggregationSuggestions.Builder {
    ctor public ContactsContract.Contacts.AggregationSuggestions.Builder();
    method public android.provider.ContactsContract.Contacts.AggregationSuggestions.Builder addNameParameter(String);
    method public android.net.Uri build();
    method public android.provider.ContactsContract.Contacts.AggregationSuggestions.Builder setContactId(long);
    method public android.provider.ContactsContract.Contacts.AggregationSuggestions.Builder setLimit(int);
  }

  public static final class ContactsContract.Contacts.Data implements android.provider.BaseColumns android.provider.ContactsContract.DataColumns {
    field public static final String CONTENT_DIRECTORY = "data";
  }

  public static final class ContactsContract.Contacts.Entity implements android.provider.BaseColumns android.provider.ContactsContract.BaseSyncColumns android.provider.ContactsContract.ContactNameColumns android.provider.ContactsContract.ContactOptionsColumns android.provider.ContactsContract.ContactStatusColumns android.provider.ContactsContract.ContactsColumns android.provider.ContactsContract.DataColumns android.provider.ContactsContract.DataUsageStatColumns android.provider.ContactsContract.RawContactsColumns android.provider.ContactsContract.StatusColumns android.provider.ContactsContract.SyncColumns {
    field public static final String CONTENT_DIRECTORY = "entities";
    field public static final String DATA_ID = "data_id";
    field public static final String RAW_CONTACT_ID = "raw_contact_id";
  }

  public static final class ContactsContract.Contacts.Photo implements android.provider.BaseColumns android.provider.ContactsContract.DataColumnsWithJoins {
    field public static final String CONTENT_DIRECTORY = "photo";
    field public static final String DISPLAY_PHOTO = "display_photo";
    field public static final String PHOTO = "data15";
    field public static final String PHOTO_FILE_ID = "data14";
  }

  protected static interface ContactsContract.ContactsColumns {
    field public static final String CONTACT_LAST_UPDATED_TIMESTAMP = "contact_last_updated_timestamp";
    field public static final String DISPLAY_NAME = "display_name";
    field public static final String HAS_PHONE_NUMBER = "has_phone_number";
    field public static final String IN_DEFAULT_DIRECTORY = "in_default_directory";
    field public static final String IN_VISIBLE_GROUP = "in_visible_group";
    field public static final String IS_USER_PROFILE = "is_user_profile";
    field public static final String LOOKUP_KEY = "lookup";
    field public static final String NAME_RAW_CONTACT_ID = "name_raw_contact_id";
    field public static final String PHOTO_FILE_ID = "photo_file_id";
    field public static final String PHOTO_ID = "photo_id";
    field public static final String PHOTO_THUMBNAIL_URI = "photo_thumb_uri";
    field public static final String PHOTO_URI = "photo_uri";
  }

  public static final class ContactsContract.Data implements android.provider.ContactsContract.DataColumnsWithJoins {
    method public static android.net.Uri getContactLookupUri(android.content.ContentResolver, android.net.Uri);
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/data";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final String VISIBLE_CONTACTS_ONLY = "visible_contacts_only";
  }

  protected static interface ContactsContract.DataColumns {
    field public static final String CARRIER_PRESENCE = "carrier_presence";
    field public static final int CARRIER_PRESENCE_VT_CAPABLE = 1; // 0x1
    field public static final String DATA1 = "data1";
    field public static final String DATA10 = "data10";
    field public static final String DATA11 = "data11";
    field public static final String DATA12 = "data12";
    field public static final String DATA13 = "data13";
    field public static final String DATA14 = "data14";
    field public static final String DATA15 = "data15";
    field public static final String DATA2 = "data2";
    field public static final String DATA3 = "data3";
    field public static final String DATA4 = "data4";
    field public static final String DATA5 = "data5";
    field public static final String DATA6 = "data6";
    field public static final String DATA7 = "data7";
    field public static final String DATA8 = "data8";
    field public static final String DATA9 = "data9";
    field public static final String DATA_VERSION = "data_version";
    field public static final String IS_PRIMARY = "is_primary";
    field public static final String IS_READ_ONLY = "is_read_only";
    field public static final String IS_SUPER_PRIMARY = "is_super_primary";
    field public static final String MIMETYPE = "mimetype";
    field public static final String PREFERRED_PHONE_ACCOUNT_COMPONENT_NAME = "preferred_phone_account_component_name";
    field public static final String PREFERRED_PHONE_ACCOUNT_ID = "preferred_phone_account_id";
    field public static final String RAW_CONTACT_ID = "raw_contact_id";
    field public static final String RES_PACKAGE = "res_package";
    field public static final String SYNC1 = "data_sync1";
    field public static final String SYNC2 = "data_sync2";
    field public static final String SYNC3 = "data_sync3";
    field public static final String SYNC4 = "data_sync4";
  }

  protected static interface ContactsContract.DataColumnsWithJoins extends android.provider.BaseColumns android.provider.ContactsContract.ContactNameColumns android.provider.ContactsContract.ContactOptionsColumns android.provider.ContactsContract.ContactStatusColumns android.provider.ContactsContract.ContactsColumns android.provider.ContactsContract.DataColumns android.provider.ContactsContract.DataUsageStatColumns android.provider.ContactsContract.RawContactsColumns android.provider.ContactsContract.StatusColumns {
  }

  public static final class ContactsContract.DataUsageFeedback {
    ctor public ContactsContract.DataUsageFeedback();
    field public static final android.net.Uri DELETE_USAGE_URI;
    field public static final android.net.Uri FEEDBACK_URI;
    field public static final String USAGE_TYPE = "type";
    field public static final String USAGE_TYPE_CALL = "call";
    field public static final String USAGE_TYPE_LONG_TEXT = "long_text";
    field public static final String USAGE_TYPE_SHORT_TEXT = "short_text";
  }

  protected static interface ContactsContract.DataUsageStatColumns {
    field public static final String LAST_TIME_USED = "last_time_used";
    field public static final String TIMES_USED = "times_used";
  }

  public static final class ContactsContract.DeletedContacts implements android.provider.ContactsContract.DeletedContactsColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final long DAYS_KEPT_MILLISECONDS = 2592000000L; // 0x9a7ec800L
  }

  protected static interface ContactsContract.DeletedContactsColumns {
    field public static final String CONTACT_DELETED_TIMESTAMP = "contact_deleted_timestamp";
    field public static final String CONTACT_ID = "contact_id";
  }

  public static final class ContactsContract.Directory implements android.provider.BaseColumns {
    method public static boolean isEnterpriseDirectoryId(long);
    method public static boolean isRemoteDirectoryId(long);
    method public static void notifyDirectoryChange(android.content.ContentResolver);
    field public static final String ACCOUNT_NAME = "accountName";
    field public static final String ACCOUNT_TYPE = "accountType";
    field public static final String CALLER_PACKAGE_PARAM_KEY = "callerPackage";
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_directory";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact_directories";
    field public static final android.net.Uri CONTENT_URI;
    field public static final long DEFAULT = 0L; // 0x0L
    field public static final String DIRECTORY_AUTHORITY = "authority";
    field public static final String DISPLAY_NAME = "displayName";
    field public static final android.net.Uri ENTERPRISE_CONTENT_URI;
    field public static final long ENTERPRISE_DEFAULT = 1000000000L; // 0x3b9aca00L
    field public static final long ENTERPRISE_LOCAL_INVISIBLE = 1000000001L; // 0x3b9aca01L
    field public static final String EXPORT_SUPPORT = "exportSupport";
    field public static final int EXPORT_SUPPORT_ANY_ACCOUNT = 2; // 0x2
    field public static final int EXPORT_SUPPORT_NONE = 0; // 0x0
    field public static final int EXPORT_SUPPORT_SAME_ACCOUNT_ONLY = 1; // 0x1
    field public static final long LOCAL_INVISIBLE = 1L; // 0x1L
    field public static final String PACKAGE_NAME = "packageName";
    field public static final String PHOTO_SUPPORT = "photoSupport";
    field public static final int PHOTO_SUPPORT_FULL = 3; // 0x3
    field public static final int PHOTO_SUPPORT_FULL_SIZE_ONLY = 2; // 0x2
    field public static final int PHOTO_SUPPORT_NONE = 0; // 0x0
    field public static final int PHOTO_SUPPORT_THUMBNAIL_ONLY = 1; // 0x1
    field public static final String SHORTCUT_SUPPORT = "shortcutSupport";
    field public static final int SHORTCUT_SUPPORT_DATA_ITEMS_ONLY = 1; // 0x1
    field public static final int SHORTCUT_SUPPORT_FULL = 2; // 0x2
    field public static final int SHORTCUT_SUPPORT_NONE = 0; // 0x0
    field public static final String TYPE_RESOURCE_ID = "typeResourceId";
  }

  public static interface ContactsContract.DisplayNameSources {
    field public static final int EMAIL = 10; // 0xa
    field public static final int NICKNAME = 35; // 0x23
    field public static final int ORGANIZATION = 30; // 0x1e
    field public static final int PHONE = 20; // 0x14
    field public static final int STRUCTURED_NAME = 40; // 0x28
    field public static final int STRUCTURED_PHONETIC_NAME = 37; // 0x25
    field public static final int UNDEFINED = 0; // 0x0
  }

  public static final class ContactsContract.DisplayPhoto {
    field public static final android.net.Uri CONTENT_MAX_DIMENSIONS_URI;
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DISPLAY_MAX_DIM = "display_max_dim";
    field public static final String THUMBNAIL_MAX_DIM = "thumbnail_max_dim";
  }

  public static interface ContactsContract.FullNameStyle {
    field public static final int CHINESE = 3; // 0x3
    field public static final int CJK = 2; // 0x2
    field public static final int JAPANESE = 4; // 0x4
    field public static final int KOREAN = 5; // 0x5
    field public static final int UNDEFINED = 0; // 0x0
    field public static final int WESTERN = 1; // 0x1
  }

  public static final class ContactsContract.Groups implements android.provider.BaseColumns android.provider.ContactsContract.GroupsColumns android.provider.ContactsContract.SyncColumns {
    method public static android.content.EntityIterator newEntityIterator(android.database.Cursor);
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/group";
    field public static final android.net.Uri CONTENT_SUMMARY_URI;
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/group";
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static interface ContactsContract.GroupsColumns {
    field public static final String AUTO_ADD = "auto_add";
    field public static final String DATA_SET = "data_set";
    field public static final String DELETED = "deleted";
    field public static final String FAVORITES = "favorites";
    field public static final String GROUP_IS_READ_ONLY = "group_is_read_only";
    field public static final String GROUP_VISIBLE = "group_visible";
    field public static final String NOTES = "notes";
    field public static final String RES_PACKAGE = "res_package";
    field public static final String SHOULD_SYNC = "should_sync";
    field public static final String SUMMARY_COUNT = "summ_count";
    field public static final String SUMMARY_WITH_PHONES = "summ_phones";
    field public static final String SYSTEM_ID = "system_id";
    field public static final String TITLE = "title";
    field public static final String TITLE_RES = "title_res";
  }

  public static final class ContactsContract.Intents {
    ctor public ContactsContract.Intents();
    field public static final String ACTION_VOICE_SEND_MESSAGE_TO_CONTACTS = "android.provider.action.VOICE_SEND_MESSAGE_TO_CONTACTS";
    field public static final String ATTACH_IMAGE = "com.android.contacts.action.ATTACH_IMAGE";
    field public static final String CONTACTS_DATABASE_CREATED = "android.provider.Contacts.DATABASE_CREATED";
    field public static final String EXTRA_CREATE_DESCRIPTION = "com.android.contacts.action.CREATE_DESCRIPTION";
    field public static final String EXTRA_FORCE_CREATE = "com.android.contacts.action.FORCE_CREATE";
    field public static final String EXTRA_RECIPIENT_CONTACT_CHAT_ID = "android.provider.extra.RECIPIENT_CONTACT_CHAT_ID";
    field public static final String EXTRA_RECIPIENT_CONTACT_NAME = "android.provider.extra.RECIPIENT_CONTACT_NAME";
    field public static final String EXTRA_RECIPIENT_CONTACT_URI = "android.provider.extra.RECIPIENT_CONTACT_URI";
    field public static final String INVITE_CONTACT = "com.android.contacts.action.INVITE_CONTACT";
    field public static final String METADATA_ACCOUNT_TYPE = "android.provider.account_type";
    field public static final String METADATA_MIMETYPE = "android.provider.mimetype";
    field public static final String SEARCH_SUGGESTION_CLICKED = "android.provider.Contacts.SEARCH_SUGGESTION_CLICKED";
    field public static final String SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED = "android.provider.Contacts.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED";
    field public static final String SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED = "android.provider.Contacts.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED";
    field public static final String SHOW_OR_CREATE_CONTACT = "com.android.contacts.action.SHOW_OR_CREATE_CONTACT";
  }

  public static final class ContactsContract.Intents.Insert {
    ctor public ContactsContract.Intents.Insert();
    field public static final String ACTION = "android.intent.action.INSERT";
    field public static final String COMPANY = "company";
    field public static final String DATA = "data";
    field public static final String EMAIL = "email";
    field public static final String EMAIL_ISPRIMARY = "email_isprimary";
    field public static final String EMAIL_TYPE = "email_type";
    field public static final String EXTRA_ACCOUNT = "android.provider.extra.ACCOUNT";
    field public static final String EXTRA_DATA_SET = "android.provider.extra.DATA_SET";
    field public static final String FULL_MODE = "full_mode";
    field public static final String IM_HANDLE = "im_handle";
    field public static final String IM_ISPRIMARY = "im_isprimary";
    field public static final String IM_PROTOCOL = "im_protocol";
    field public static final String JOB_TITLE = "job_title";
    field public static final String NAME = "name";
    field public static final String NOTES = "notes";
    field public static final String PHONE = "phone";
    field public static final String PHONETIC_NAME = "phonetic_name";
    field public static final String PHONE_ISPRIMARY = "phone_isprimary";
    field public static final String PHONE_TYPE = "phone_type";
    field public static final String POSTAL = "postal";
    field public static final String POSTAL_ISPRIMARY = "postal_isprimary";
    field public static final String POSTAL_TYPE = "postal_type";
    field public static final String SECONDARY_EMAIL = "secondary_email";
    field public static final String SECONDARY_EMAIL_TYPE = "secondary_email_type";
    field public static final String SECONDARY_PHONE = "secondary_phone";
    field public static final String SECONDARY_PHONE_TYPE = "secondary_phone_type";
    field public static final String TERTIARY_EMAIL = "tertiary_email";
    field public static final String TERTIARY_EMAIL_TYPE = "tertiary_email_type";
    field public static final String TERTIARY_PHONE = "tertiary_phone";
    field public static final String TERTIARY_PHONE_TYPE = "tertiary_phone_type";
  }

  public static final class ContactsContract.PhoneLookup implements android.provider.BaseColumns android.provider.ContactsContract.ContactNameColumns android.provider.ContactsContract.ContactOptionsColumns android.provider.ContactsContract.ContactsColumns android.provider.ContactsContract.PhoneLookupColumns {
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
    field public static final String QUERY_PARAMETER_SIP_ADDRESS = "sip";
  }

  protected static interface ContactsContract.PhoneLookupColumns {
    field public static final String CONTACT_ID = "contact_id";
    field public static final String DATA_ID = "data_id";
    field public static final String LABEL = "label";
    field public static final String NORMALIZED_NUMBER = "normalized_number";
    field public static final String NUMBER = "number";
    field public static final String TYPE = "type";
  }

  public static interface ContactsContract.PhoneticNameStyle {
    field public static final int JAPANESE = 4; // 0x4
    field public static final int KOREAN = 5; // 0x5
    field public static final int PINYIN = 3; // 0x3
    field public static final int UNDEFINED = 0; // 0x0
  }

  public static final class ContactsContract.PinnedPositions {
    ctor public ContactsContract.PinnedPositions();
    method public static void pin(android.content.ContentResolver, long, int);
    method public static void undemote(android.content.ContentResolver, long);
    field public static final int DEMOTED = -1; // 0xffffffff
    field public static final int UNPINNED = 0; // 0x0
  }

  @Deprecated public static final class ContactsContract.Presence extends android.provider.ContactsContract.StatusUpdates {
    ctor @Deprecated public ContactsContract.Presence();
  }

  protected static interface ContactsContract.PresenceColumns {
    field public static final String CUSTOM_PROTOCOL = "custom_protocol";
    field public static final String DATA_ID = "presence_data_id";
    field public static final String IM_ACCOUNT = "im_account";
    field public static final String IM_HANDLE = "im_handle";
    field public static final String PROTOCOL = "protocol";
  }

  public static final class ContactsContract.Profile implements android.provider.BaseColumns android.provider.ContactsContract.ContactNameColumns android.provider.ContactsContract.ContactOptionsColumns android.provider.ContactsContract.ContactStatusColumns android.provider.ContactsContract.ContactsColumns {
    field public static final android.net.Uri CONTENT_RAW_CONTACTS_URI;
    field public static final android.net.Uri CONTENT_URI;
    field public static final android.net.Uri CONTENT_VCARD_URI;
    field public static final long MIN_ID = 9223372034707292160L; // 0x7fffffff80000000L
  }

  public static final class ContactsContract.ProfileSyncState implements android.provider.SyncStateContract.Columns {
    method public static byte[] get(android.content.ContentProviderClient, android.accounts.Account) throws android.os.RemoteException;
    method public static android.util.Pair<android.net.Uri,byte[]> getWithUri(android.content.ContentProviderClient, android.accounts.Account) throws android.os.RemoteException;
    method public static android.content.ContentProviderOperation newSetOperation(android.accounts.Account, byte[]);
    method public static void set(android.content.ContentProviderClient, android.accounts.Account, byte[]) throws android.os.RemoteException;
    field public static final String CONTENT_DIRECTORY = "syncstate";
    field public static final android.net.Uri CONTENT_URI;
  }

  public static final class ContactsContract.ProviderStatus {
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/provider_status";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DATABASE_CREATION_TIMESTAMP = "database_creation_timestamp";
    field public static final String STATUS = "status";
    field public static final int STATUS_BUSY = 1; // 0x1
    field public static final int STATUS_EMPTY = 2; // 0x2
    field public static final int STATUS_NORMAL = 0; // 0x0
  }

  public static final class ContactsContract.QuickContact {
    ctor public ContactsContract.QuickContact();
    method public static void showQuickContact(android.content.Context, android.view.View, android.net.Uri, int, String[]);
    method public static void showQuickContact(android.content.Context, android.graphics.Rect, android.net.Uri, int, String[]);
    method public static void showQuickContact(android.content.Context, android.view.View, android.net.Uri, String[], String);
    method public static void showQuickContact(android.content.Context, android.graphics.Rect, android.net.Uri, String[], String);
    field public static final String ACTION_QUICK_CONTACT = "android.provider.action.QUICK_CONTACT";
    field public static final String EXTRA_EXCLUDE_MIMES = "android.provider.extra.EXCLUDE_MIMES";
    field public static final String EXTRA_MODE = "android.provider.extra.MODE";
    field public static final String EXTRA_PRIORITIZED_MIMETYPE = "android.provider.extra.PRIORITIZED_MIMETYPE";
    field public static final int MODE_LARGE = 3; // 0x3
    field public static final int MODE_MEDIUM = 2; // 0x2
    field public static final int MODE_SMALL = 1; // 0x1
  }

  public static final class ContactsContract.RawContacts implements android.provider.BaseColumns android.provider.ContactsContract.ContactNameColumns android.provider.ContactsContract.ContactOptionsColumns android.provider.ContactsContract.RawContactsColumns android.provider.ContactsContract.SyncColumns {
    method public static android.net.Uri getContactLookupUri(android.content.ContentResolver, android.net.Uri);
    method public static android.content.EntityIterator newEntityIterator(android.database.Cursor);
    field public static final int AGGREGATION_MODE_DEFAULT = 0; // 0x0
    field public static final int AGGREGATION_MODE_DISABLED = 3; // 0x3
    field @Deprecated public static final int AGGREGATION_MODE_IMMEDIATE = 1; // 0x1
    field public static final int AGGREGATION_MODE_SUSPENDED = 2; // 0x2
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/raw_contact";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/raw_contact";
    field public static final android.net.Uri CONTENT_URI;
  }

  public static final class ContactsContract.RawContacts.Data implements android.provider.BaseColumns android.provider.ContactsContract.DataColumns {
    field public static final String CONTENT_DIRECTORY = "data";
  }

  public static final class ContactsContract.RawContacts.DisplayPhoto {
    field public static final String CONTENT_DIRECTORY = "display_photo";
  }

  public static final class ContactsContract.RawContacts.Entity implements android.provider.BaseColumns android.provider.ContactsContract.DataColumns {
    field public static final String CONTENT_DIRECTORY = "entity";
    field public static final String DATA_ID = "data_id";
  }

  protected static interface ContactsContract.RawContactsColumns {
    field public static final String ACCOUNT_TYPE_AND_DATA_SET = "account_type_and_data_set";
    field public static final String AGGREGATION_MODE = "aggregation_mode";
    field public static final String BACKUP_ID = "backup_id";
    field public static final String CONTACT_ID = "contact_id";
    field public static final String DATA_SET = "data_set";
    field public static final String DELETED = "deleted";
    field public static final String METADATA_DIRTY = "metadata_dirty";
    field public static final String RAW_CONTACT_IS_READ_ONLY = "raw_contact_is_read_only";
    field public static final String RAW_CONTACT_IS_USER_PROFILE = "raw_contact_is_user_profile";
  }

  public static final class ContactsContract.RawContactsEntity implements android.provider.BaseColumns android.provider.ContactsContract.DataColumns android.provider.ContactsContract.RawContactsColumns {
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/raw_contact_entity";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DATA_ID = "data_id";
    field public static final android.net.Uri PROFILE_CONTENT_URI;
  }

  public static class ContactsContract.SearchSnippets {
    ctor public ContactsContract.SearchSnippets();
    field public static final String DEFERRED_SNIPPETING_KEY = "deferred_snippeting";
    field public static final String SNIPPET = "snippet";
  }

  public static final class ContactsContract.Settings implements android.provider.ContactsContract.SettingsColumns {
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/setting";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/setting";
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static interface ContactsContract.SettingsColumns {
    field public static final String ACCOUNT_NAME = "account_name";
    field public static final String ACCOUNT_TYPE = "account_type";
    field public static final String ANY_UNSYNCED = "any_unsynced";
    field public static final String DATA_SET = "data_set";
    field public static final String SHOULD_SYNC = "should_sync";
    field public static final String UNGROUPED_COUNT = "summ_count";
    field public static final String UNGROUPED_VISIBLE = "ungrouped_visible";
    field public static final String UNGROUPED_WITH_PHONES = "summ_phones";
  }

  protected static interface ContactsContract.StatusColumns {
    field public static final int AVAILABLE = 5; // 0x5
    field public static final int AWAY = 2; // 0x2
    field public static final int CAPABILITY_HAS_CAMERA = 4; // 0x4
    field public static final int CAPABILITY_HAS_VIDEO = 2; // 0x2
    field public static final int CAPABILITY_HAS_VOICE = 1; // 0x1
    field public static final String CHAT_CAPABILITY = "chat_capability";
    field public static final int DO_NOT_DISTURB = 4; // 0x4
    field public static final int IDLE = 3; // 0x3
    field public static final int INVISIBLE = 1; // 0x1
    field public static final int OFFLINE = 0; // 0x0
    field public static final String PRESENCE = "mode";
    field @Deprecated public static final String PRESENCE_CUSTOM_STATUS = "status";
    field @Deprecated public static final String PRESENCE_STATUS = "mode";
    field public static final String STATUS = "status";
    field public static final String STATUS_ICON = "status_icon";
    field public static final String STATUS_LABEL = "status_label";
    field public static final String STATUS_RES_PACKAGE = "status_res_package";
    field public static final String STATUS_TIMESTAMP = "status_ts";
  }

  public static class ContactsContract.StatusUpdates implements android.provider.ContactsContract.PresenceColumns android.provider.ContactsContract.StatusColumns {
    method public static final int getPresenceIconResourceId(int);
    method public static final int getPresencePrecedence(int);
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/status-update";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/status-update";
    field public static final android.net.Uri CONTENT_URI;
    field public static final android.net.Uri PROFILE_CONTENT_URI;
  }

  protected static interface ContactsContract.SyncColumns extends android.provider.ContactsContract.BaseSyncColumns {
    field public static final String ACCOUNT_NAME = "account_name";
    field public static final String ACCOUNT_TYPE = "account_type";
    field public static final String DIRTY = "dirty";
    field public static final String SOURCE_ID = "sourceid";
    field public static final String VERSION = "version";
  }

  public static final class ContactsContract.SyncState implements android.provider.SyncStateContract.Columns {
    method public static byte[] get(android.content.ContentProviderClient, android.accounts.Account) throws android.os.RemoteException;
    method public static android.util.Pair<android.net.Uri,byte[]> getWithUri(android.content.ContentProviderClient, android.accounts.Account) throws android.os.RemoteException;
    method public static android.content.ContentProviderOperation newSetOperation(android.accounts.Account, byte[]);
    method public static void set(android.content.ContentProviderClient, android.accounts.Account, byte[]) throws android.os.RemoteException;
    field public static final String CONTENT_DIRECTORY = "syncstate";
    field public static final android.net.Uri CONTENT_URI;
  }

  public final class DocumentsContract {
    method public static android.net.Uri buildChildDocumentsUri(String, String);
    method public static android.net.Uri buildChildDocumentsUriUsingTree(android.net.Uri, String);
    method public static android.net.Uri buildDocumentUri(String, String);
    method public static android.net.Uri buildDocumentUriUsingTree(android.net.Uri, String);
    method public static android.net.Uri buildRecentDocumentsUri(String, String);
    method public static android.net.Uri buildRootUri(String, String);
    method public static android.net.Uri buildRootsUri(String);
    method public static android.net.Uri buildSearchDocumentsUri(String, String, String);
    method public static android.net.Uri buildTreeDocumentUri(String, String);
    method public static android.net.Uri copyDocument(android.content.ContentResolver, android.net.Uri, android.net.Uri) throws java.io.FileNotFoundException;
    method public static android.net.Uri createDocument(android.content.ContentResolver, android.net.Uri, String, String) throws java.io.FileNotFoundException;
    method public static android.content.IntentSender createWebLinkIntent(android.content.ContentResolver, android.net.Uri, android.os.Bundle) throws java.io.FileNotFoundException;
    method public static boolean deleteDocument(android.content.ContentResolver, android.net.Uri) throws java.io.FileNotFoundException;
    method public static void ejectRoot(android.content.ContentResolver, android.net.Uri);
    method public static android.provider.DocumentsContract.Path findDocumentPath(android.content.ContentResolver, android.net.Uri) throws java.io.FileNotFoundException;
    method public static String getDocumentId(android.net.Uri);
    method public static android.graphics.Bitmap getDocumentThumbnail(android.content.ContentResolver, android.net.Uri, android.graphics.Point, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public static String getRootId(android.net.Uri);
    method public static String getSearchDocumentsQuery(android.net.Uri);
    method public static String getTreeDocumentId(android.net.Uri);
    method public static boolean isDocumentUri(android.content.Context, @Nullable android.net.Uri);
    method public static boolean isTreeUri(android.net.Uri);
    method public static android.net.Uri moveDocument(android.content.ContentResolver, android.net.Uri, android.net.Uri, android.net.Uri) throws java.io.FileNotFoundException;
    method public static boolean removeDocument(android.content.ContentResolver, android.net.Uri, android.net.Uri) throws java.io.FileNotFoundException;
    method public static android.net.Uri renameDocument(android.content.ContentResolver, android.net.Uri, String) throws java.io.FileNotFoundException;
    field public static final String ACTION_DOCUMENT_SETTINGS = "android.provider.action.DOCUMENT_SETTINGS";
    field public static final String EXTRA_ERROR = "error";
    field public static final String EXTRA_EXCLUDE_SELF = "android.provider.extra.EXCLUDE_SELF";
    field public static final String EXTRA_INFO = "info";
    field public static final String EXTRA_INITIAL_URI = "android.provider.extra.INITIAL_URI";
    field public static final String EXTRA_LOADING = "loading";
    field public static final String EXTRA_ORIENTATION = "android.provider.extra.ORIENTATION";
    field public static final String EXTRA_PROMPT = "android.provider.extra.PROMPT";
    field public static final String PROVIDER_INTERFACE = "android.content.action.DOCUMENTS_PROVIDER";
  }

  public static final class DocumentsContract.Document {
    field public static final String COLUMN_DISPLAY_NAME = "_display_name";
    field public static final String COLUMN_DOCUMENT_ID = "document_id";
    field public static final String COLUMN_FLAGS = "flags";
    field public static final String COLUMN_ICON = "icon";
    field public static final String COLUMN_LAST_MODIFIED = "last_modified";
    field public static final String COLUMN_MIME_TYPE = "mime_type";
    field public static final String COLUMN_SIZE = "_size";
    field public static final String COLUMN_SUMMARY = "summary";
    field public static final int FLAG_DIR_PREFERS_GRID = 16; // 0x10
    field public static final int FLAG_DIR_PREFERS_LAST_MODIFIED = 32; // 0x20
    field public static final int FLAG_DIR_SUPPORTS_CREATE = 8; // 0x8
    field public static final int FLAG_SUPPORTS_COPY = 128; // 0x80
    field public static final int FLAG_SUPPORTS_DELETE = 4; // 0x4
    field public static final int FLAG_SUPPORTS_MOVE = 256; // 0x100
    field public static final int FLAG_SUPPORTS_REMOVE = 1024; // 0x400
    field public static final int FLAG_SUPPORTS_RENAME = 64; // 0x40
    field public static final int FLAG_SUPPORTS_SETTINGS = 2048; // 0x800
    field public static final int FLAG_SUPPORTS_THUMBNAIL = 1; // 0x1
    field public static final int FLAG_SUPPORTS_WRITE = 2; // 0x2
    field public static final int FLAG_VIRTUAL_DOCUMENT = 512; // 0x200
    field public static final int FLAG_WEB_LINKABLE = 4096; // 0x1000
    field public static final String MIME_TYPE_DIR = "vnd.android.document/directory";
  }

  public static final class DocumentsContract.Path implements android.os.Parcelable {
    ctor public DocumentsContract.Path(@Nullable String, java.util.List<java.lang.String>);
    method public int describeContents();
    method public java.util.List<java.lang.String> getPath();
    method @Nullable public String getRootId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.provider.DocumentsContract.Path> CREATOR;
  }

  public static final class DocumentsContract.Root {
    field public static final String COLUMN_AVAILABLE_BYTES = "available_bytes";
    field public static final String COLUMN_CAPACITY_BYTES = "capacity_bytes";
    field public static final String COLUMN_DOCUMENT_ID = "document_id";
    field public static final String COLUMN_FLAGS = "flags";
    field public static final String COLUMN_ICON = "icon";
    field public static final String COLUMN_MIME_TYPES = "mime_types";
    field public static final String COLUMN_ROOT_ID = "root_id";
    field public static final String COLUMN_SUMMARY = "summary";
    field public static final String COLUMN_TITLE = "title";
    field public static final int FLAG_LOCAL_ONLY = 2; // 0x2
    field public static final int FLAG_SUPPORTS_CREATE = 1; // 0x1
    field public static final int FLAG_SUPPORTS_EJECT = 32; // 0x20
    field public static final int FLAG_SUPPORTS_IS_CHILD = 16; // 0x10
    field public static final int FLAG_SUPPORTS_RECENTS = 4; // 0x4
    field public static final int FLAG_SUPPORTS_SEARCH = 8; // 0x8
    field public static final String MIME_TYPE_ITEM = "vnd.android.document/root";
  }

  public abstract class DocumentsProvider extends android.content.ContentProvider {
    ctor public DocumentsProvider();
    method public String copyDocument(String, String) throws java.io.FileNotFoundException;
    method public String createDocument(String, String, String) throws java.io.FileNotFoundException;
    method public android.content.IntentSender createWebLinkIntent(String, @Nullable android.os.Bundle) throws java.io.FileNotFoundException;
    method public final int delete(android.net.Uri, String, String[]);
    method public void deleteDocument(String) throws java.io.FileNotFoundException;
    method public void ejectRoot(String);
    method public android.provider.DocumentsContract.Path findDocumentPath(@Nullable String, String) throws java.io.FileNotFoundException;
    method public String[] getDocumentStreamTypes(String, String);
    method public String getDocumentType(String) throws java.io.FileNotFoundException;
    method public final String getType(android.net.Uri);
    method public final android.net.Uri insert(android.net.Uri, android.content.ContentValues);
    method public boolean isChildDocument(String, String);
    method public String moveDocument(String, String, String) throws java.io.FileNotFoundException;
    method public final android.content.res.AssetFileDescriptor openAssetFile(android.net.Uri, String) throws java.io.FileNotFoundException;
    method public final android.content.res.AssetFileDescriptor openAssetFile(android.net.Uri, String, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public abstract android.os.ParcelFileDescriptor openDocument(String, String, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public android.content.res.AssetFileDescriptor openDocumentThumbnail(String, android.graphics.Point, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public final android.os.ParcelFileDescriptor openFile(android.net.Uri, String) throws java.io.FileNotFoundException;
    method public final android.os.ParcelFileDescriptor openFile(android.net.Uri, String, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public final android.content.res.AssetFileDescriptor openTypedAssetFile(android.net.Uri, String, android.os.Bundle) throws java.io.FileNotFoundException;
    method public final android.content.res.AssetFileDescriptor openTypedAssetFile(android.net.Uri, String, android.os.Bundle, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public android.content.res.AssetFileDescriptor openTypedDocument(String, String, android.os.Bundle, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public final android.database.Cursor query(android.net.Uri, String[], String, String[], String);
    method public final android.database.Cursor query(android.net.Uri, String[], android.os.Bundle, android.os.CancellationSignal);
    method public abstract android.database.Cursor queryChildDocuments(String, String[], String) throws java.io.FileNotFoundException;
    method public android.database.Cursor queryChildDocuments(String, @Nullable String[], @Nullable android.os.Bundle) throws java.io.FileNotFoundException;
    method public abstract android.database.Cursor queryDocument(String, String[]) throws java.io.FileNotFoundException;
    method public android.database.Cursor queryRecentDocuments(String, String[]) throws java.io.FileNotFoundException;
    method public android.database.Cursor queryRecentDocuments(String, String[], @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public abstract android.database.Cursor queryRoots(String[]) throws java.io.FileNotFoundException;
    method public android.database.Cursor querySearchDocuments(String, String, String[]) throws java.io.FileNotFoundException;
    method public void removeDocument(String, String) throws java.io.FileNotFoundException;
    method public String renameDocument(String, String) throws java.io.FileNotFoundException;
    method public final void revokeDocumentPermission(String);
    method public final int update(android.net.Uri, android.content.ContentValues, String, String[]);
  }

  public final class FontRequest {
    ctor public FontRequest(@NonNull String, @NonNull String, @NonNull String);
    ctor public FontRequest(@NonNull String, @NonNull String, @NonNull String, @NonNull java.util.List<java.util.List<byte[]>>);
    method public java.util.List<java.util.List<byte[]>> getCertificates();
    method public String getProviderAuthority();
    method public String getProviderPackage();
    method public String getQuery();
  }

  public class FontsContract {
    method public static android.graphics.Typeface buildTypeface(@NonNull android.content.Context, @Nullable android.os.CancellationSignal, @NonNull android.provider.FontsContract.FontInfo[]);
    method @NonNull public static android.provider.FontsContract.FontFamilyResult fetchFonts(@NonNull android.content.Context, @Nullable android.os.CancellationSignal, @NonNull android.provider.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException;
    method public static void requestFonts(@NonNull android.content.Context, @NonNull android.provider.FontRequest, @NonNull android.os.Handler, @Nullable android.os.CancellationSignal, @NonNull android.provider.FontsContract.FontRequestCallback);
  }

  public static final class FontsContract.Columns implements android.provider.BaseColumns {
    field public static final String FILE_ID = "file_id";
    field public static final String ITALIC = "font_italic";
    field public static final String RESULT_CODE = "result_code";
    field public static final int RESULT_CODE_FONT_NOT_FOUND = 1; // 0x1
    field public static final int RESULT_CODE_FONT_UNAVAILABLE = 2; // 0x2
    field public static final int RESULT_CODE_MALFORMED_QUERY = 3; // 0x3
    field public static final int RESULT_CODE_OK = 0; // 0x0
    field public static final String TTC_INDEX = "font_ttc_index";
    field public static final String VARIATION_SETTINGS = "font_variation_settings";
    field public static final String WEIGHT = "font_weight";
  }

  public static class FontsContract.FontFamilyResult {
    method @NonNull public android.provider.FontsContract.FontInfo[] getFonts();
    method public int getStatusCode();
    field public static final int STATUS_OK = 0; // 0x0
    field public static final int STATUS_REJECTED = 3; // 0x3
    field public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2; // 0x2
    field public static final int STATUS_WRONG_CERTIFICATES = 1; // 0x1
  }

  public static class FontsContract.FontInfo {
    method @Nullable public android.graphics.fonts.FontVariationAxis[] getAxes();
    method public int getResultCode();
    method @IntRange(from=0) public int getTtcIndex();
    method @NonNull public android.net.Uri getUri();
    method @IntRange(from=1, to=1000) public int getWeight();
    method public boolean isItalic();
  }

  public static class FontsContract.FontRequestCallback {
    ctor public FontsContract.FontRequestCallback();
    method public void onTypefaceRequestFailed(int);
    method public void onTypefaceRetrieved(android.graphics.Typeface);
    field public static final int FAIL_REASON_FONT_LOAD_ERROR = -3; // 0xfffffffd
    field public static final int FAIL_REASON_FONT_NOT_FOUND = 1; // 0x1
    field public static final int FAIL_REASON_FONT_UNAVAILABLE = 2; // 0x2
    field public static final int FAIL_REASON_MALFORMED_QUERY = 3; // 0x3
    field public static final int FAIL_REASON_PROVIDER_NOT_FOUND = -1; // 0xffffffff
    field public static final int FAIL_REASON_WRONG_CERTIFICATES = -2; // 0xfffffffe
  }

  @Deprecated public final class LiveFolders implements android.provider.BaseColumns {
    field @Deprecated public static final String ACTION_CREATE_LIVE_FOLDER = "android.intent.action.CREATE_LIVE_FOLDER";
    field @Deprecated public static final String DESCRIPTION = "description";
    field @Deprecated public static final int DISPLAY_MODE_GRID = 1; // 0x1
    field @Deprecated public static final int DISPLAY_MODE_LIST = 2; // 0x2
    field @Deprecated public static final String EXTRA_LIVE_FOLDER_BASE_INTENT = "android.intent.extra.livefolder.BASE_INTENT";
    field @Deprecated public static final String EXTRA_LIVE_FOLDER_DISPLAY_MODE = "android.intent.extra.livefolder.DISPLAY_MODE";
    field @Deprecated public static final String EXTRA_LIVE_FOLDER_ICON = "android.intent.extra.livefolder.ICON";
    field @Deprecated public static final String EXTRA_LIVE_FOLDER_NAME = "android.intent.extra.livefolder.NAME";
    field @Deprecated public static final String ICON_BITMAP = "icon_bitmap";
    field @Deprecated public static final String ICON_PACKAGE = "icon_package";
    field @Deprecated public static final String ICON_RESOURCE = "icon_resource";
    field @Deprecated public static final String INTENT = "intent";
    field @Deprecated public static final String NAME = "name";
  }

  public final class MediaStore {
    ctor public MediaStore();
    method public static android.net.Uri getDocumentUri(android.content.Context, android.net.Uri);
    method public static android.net.Uri getMediaScannerUri();
    method public static String getVersion(android.content.Context);
    field public static final String ACTION_IMAGE_CAPTURE = "android.media.action.IMAGE_CAPTURE";
    field public static final String ACTION_IMAGE_CAPTURE_SECURE = "android.media.action.IMAGE_CAPTURE_SECURE";
    field public static final String ACTION_VIDEO_CAPTURE = "android.media.action.VIDEO_CAPTURE";
    field public static final String AUTHORITY = "media";
    field public static final String EXTRA_DURATION_LIMIT = "android.intent.extra.durationLimit";
    field public static final String EXTRA_FINISH_ON_COMPLETION = "android.intent.extra.finishOnCompletion";
    field public static final String EXTRA_FULL_SCREEN = "android.intent.extra.fullScreen";
    field public static final String EXTRA_MEDIA_ALBUM = "android.intent.extra.album";
    field public static final String EXTRA_MEDIA_ARTIST = "android.intent.extra.artist";
    field public static final String EXTRA_MEDIA_FOCUS = "android.intent.extra.focus";
    field public static final String EXTRA_MEDIA_GENRE = "android.intent.extra.genre";
    field public static final String EXTRA_MEDIA_PLAYLIST = "android.intent.extra.playlist";
    field public static final String EXTRA_MEDIA_RADIO_CHANNEL = "android.intent.extra.radio_channel";
    field public static final String EXTRA_MEDIA_TITLE = "android.intent.extra.title";
    field public static final String EXTRA_OUTPUT = "output";
    field public static final String EXTRA_SCREEN_ORIENTATION = "android.intent.extra.screenOrientation";
    field public static final String EXTRA_SHOW_ACTION_ICONS = "android.intent.extra.showActionIcons";
    field public static final String EXTRA_SIZE_LIMIT = "android.intent.extra.sizeLimit";
    field public static final String EXTRA_VIDEO_QUALITY = "android.intent.extra.videoQuality";
    field public static final String INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH = "android.media.action.MEDIA_PLAY_FROM_SEARCH";
    field public static final String INTENT_ACTION_MEDIA_SEARCH = "android.intent.action.MEDIA_SEARCH";
    field @Deprecated public static final String INTENT_ACTION_MUSIC_PLAYER = "android.intent.action.MUSIC_PLAYER";
    field public static final String INTENT_ACTION_STILL_IMAGE_CAMERA = "android.media.action.STILL_IMAGE_CAMERA";
    field public static final String INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE = "android.media.action.STILL_IMAGE_CAMERA_SECURE";
    field public static final String INTENT_ACTION_TEXT_OPEN_FROM_SEARCH = "android.media.action.TEXT_OPEN_FROM_SEARCH";
    field public static final String INTENT_ACTION_VIDEO_CAMERA = "android.media.action.VIDEO_CAMERA";
    field public static final String INTENT_ACTION_VIDEO_PLAY_FROM_SEARCH = "android.media.action.VIDEO_PLAY_FROM_SEARCH";
    field public static final String MEDIA_IGNORE_FILENAME = ".nomedia";
    field public static final String MEDIA_SCANNER_VOLUME = "volume";
    field public static final String META_DATA_STILL_IMAGE_CAMERA_PREWARM_SERVICE = "android.media.still_image_camera_preview_service";
    field public static final String UNKNOWN_STRING = "<unknown>";
  }

  public static final class MediaStore.Audio {
    ctor public MediaStore.Audio();
    method public static String keyFor(String);
  }

  public static interface MediaStore.Audio.AlbumColumns {
    field public static final String ALBUM = "album";
    field public static final String ALBUM_ART = "album_art";
    field public static final String ALBUM_ID = "album_id";
    field public static final String ALBUM_KEY = "album_key";
    field public static final String ARTIST = "artist";
    field public static final String FIRST_YEAR = "minyear";
    field public static final String LAST_YEAR = "maxyear";
    field public static final String NUMBER_OF_SONGS = "numsongs";
    field public static final String NUMBER_OF_SONGS_FOR_ARTIST = "numsongs_by_artist";
  }

  public static final class MediaStore.Audio.Albums implements android.provider.BaseColumns android.provider.MediaStore.Audio.AlbumColumns {
    ctor public MediaStore.Audio.Albums();
    method public static android.net.Uri getContentUri(String);
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/albums";
    field public static final String DEFAULT_SORT_ORDER = "album_key";
    field public static final String ENTRY_CONTENT_TYPE = "vnd.android.cursor.item/album";
    field public static final android.net.Uri EXTERNAL_CONTENT_URI;
    field public static final android.net.Uri INTERNAL_CONTENT_URI;
  }

  public static interface MediaStore.Audio.ArtistColumns {
    field public static final String ARTIST = "artist";
    field public static final String ARTIST_KEY = "artist_key";
    field public static final String NUMBER_OF_ALBUMS = "number_of_albums";
    field public static final String NUMBER_OF_TRACKS = "number_of_tracks";
  }

  public static final class MediaStore.Audio.Artists implements android.provider.BaseColumns android.provider.MediaStore.Audio.ArtistColumns {
    ctor public MediaStore.Audio.Artists();
    method public static android.net.Uri getContentUri(String);
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/artists";
    field public static final String DEFAULT_SORT_ORDER = "artist_key";
    field public static final String ENTRY_CONTENT_TYPE = "vnd.android.cursor.item/artist";
    field public static final android.net.Uri EXTERNAL_CONTENT_URI;
    field public static final android.net.Uri INTERNAL_CONTENT_URI;
  }

  public static final class MediaStore.Audio.Artists.Albums implements android.provider.MediaStore.Audio.AlbumColumns {
    ctor public MediaStore.Audio.Artists.Albums();
    method public static android.net.Uri getContentUri(String, long);
  }

  public static interface MediaStore.Audio.AudioColumns extends android.provider.MediaStore.MediaColumns {
    field public static final String ALBUM = "album";
    field public static final String ALBUM_ID = "album_id";
    field public static final String ALBUM_KEY = "album_key";
    field public static final String ARTIST = "artist";
    field public static final String ARTIST_ID = "artist_id";
    field public static final String ARTIST_KEY = "artist_key";
    field public static final String BOOKMARK = "bookmark";
    field public static final String COMPOSER = "composer";
    field public static final String DURATION = "duration";
    field public static final String IS_ALARM = "is_alarm";
    field public static final String IS_MUSIC = "is_music";
    field public static final String IS_NOTIFICATION = "is_notification";
    field public static final String IS_PODCAST = "is_podcast";
    field public static final String IS_RINGTONE = "is_ringtone";
    field public static final String TITLE_KEY = "title_key";
    field public static final String TRACK = "track";
    field public static final String YEAR = "year";
  }

  public static final class MediaStore.Audio.Genres implements android.provider.BaseColumns android.provider.MediaStore.Audio.GenresColumns {
    ctor public MediaStore.Audio.Genres();
    method public static android.net.Uri getContentUri(String);
    method public static android.net.Uri getContentUriForAudioId(String, int);
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/genre";
    field public static final String DEFAULT_SORT_ORDER = "name";
    field public static final String ENTRY_CONTENT_TYPE = "vnd.android.cursor.item/genre";
    field public static final android.net.Uri EXTERNAL_CONTENT_URI;
    field public static final android.net.Uri INTERNAL_CONTENT_URI;
  }

  public static final class MediaStore.Audio.Genres.Members implements android.provider.MediaStore.Audio.AudioColumns {
    ctor public MediaStore.Audio.Genres.Members();
    method public static android.net.Uri getContentUri(String, long);
    field public static final String AUDIO_ID = "audio_id";
    field public static final String CONTENT_DIRECTORY = "members";
    field public static final String DEFAULT_SORT_ORDER = "title_key";
    field public static final String GENRE_ID = "genre_id";
  }

  public static interface MediaStore.Audio.GenresColumns {
    field public static final String NAME = "name";
  }

  public static final class MediaStore.Audio.Media implements android.provider.MediaStore.Audio.AudioColumns {
    ctor public MediaStore.Audio.Media();
    method public static android.net.Uri getContentUri(String);
    method public static android.net.Uri getContentUriForPath(String);
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/audio";
    field public static final String DEFAULT_SORT_ORDER = "title_key";
    field public static final String ENTRY_CONTENT_TYPE = "vnd.android.cursor.item/audio";
    field public static final android.net.Uri EXTERNAL_CONTENT_URI;
    field public static final String EXTRA_MAX_BYTES = "android.provider.MediaStore.extra.MAX_BYTES";
    field public static final android.net.Uri INTERNAL_CONTENT_URI;
    field public static final String RECORD_SOUND_ACTION = "android.provider.MediaStore.RECORD_SOUND";
  }

  public static final class MediaStore.Audio.Playlists implements android.provider.BaseColumns android.provider.MediaStore.Audio.PlaylistsColumns {
    ctor public MediaStore.Audio.Playlists();
    method public static android.net.Uri getContentUri(String);
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/playlist";
    field public static final String DEFAULT_SORT_ORDER = "name";
    field public static final String ENTRY_CONTENT_TYPE = "vnd.android.cursor.item/playlist";
    field public static final android.net.Uri EXTERNAL_CONTENT_URI;
    field public static final android.net.Uri INTERNAL_CONTENT_URI;
  }

  public static final class MediaStore.Audio.Playlists.Members implements android.provider.MediaStore.Audio.AudioColumns {
    ctor public MediaStore.Audio.Playlists.Members();
    method public static android.net.Uri getContentUri(String, long);
    method public static boolean moveItem(android.content.ContentResolver, long, int, int);
    field public static final String AUDIO_ID = "audio_id";
    field public static final String CONTENT_DIRECTORY = "members";
    field public static final String DEFAULT_SORT_ORDER = "play_order";
    field public static final String PLAYLIST_ID = "playlist_id";
    field public static final String PLAY_ORDER = "play_order";
    field public static final String _ID = "_id";
  }

  public static interface MediaStore.Audio.PlaylistsColumns {
    field public static final String DATA = "_data";
    field public static final String DATE_ADDED = "date_added";
    field public static final String DATE_MODIFIED = "date_modified";
    field public static final String NAME = "name";
  }

  public static final class MediaStore.Audio.Radio {
    field public static final String ENTRY_CONTENT_TYPE = "vnd.android.cursor.item/radio";
  }

  public static final class MediaStore.Files {
    ctor public MediaStore.Files();
    method public static android.net.Uri getContentUri(String);
    method public static android.net.Uri getContentUri(String, long);
  }

  public static interface MediaStore.Files.FileColumns extends android.provider.MediaStore.MediaColumns {
    field public static final String MEDIA_TYPE = "media_type";
    field public static final int MEDIA_TYPE_AUDIO = 2; // 0x2
    field public static final int MEDIA_TYPE_IMAGE = 1; // 0x1
    field public static final int MEDIA_TYPE_NONE = 0; // 0x0
    field public static final int MEDIA_TYPE_PLAYLIST = 4; // 0x4
    field public static final int MEDIA_TYPE_VIDEO = 3; // 0x3
    field public static final String MIME_TYPE = "mime_type";
    field public static final String PARENT = "parent";
    field public static final String TITLE = "title";
  }

  public static final class MediaStore.Images {
    ctor public MediaStore.Images();
  }

  public static interface MediaStore.Images.ImageColumns extends android.provider.MediaStore.MediaColumns {
    field public static final String BUCKET_DISPLAY_NAME = "bucket_display_name";
    field public static final String BUCKET_ID = "bucket_id";
    field public static final String DATE_TAKEN = "datetaken";
    field public static final String DESCRIPTION = "description";
    field public static final String IS_PRIVATE = "isprivate";
    field public static final String LATITUDE = "latitude";
    field public static final String LONGITUDE = "longitude";
    field public static final String MINI_THUMB_MAGIC = "mini_thumb_magic";
    field public static final String ORIENTATION = "orientation";
    field public static final String PICASA_ID = "picasa_id";
  }

  public static final class MediaStore.Images.Media implements android.provider.MediaStore.Images.ImageColumns {
    ctor public MediaStore.Images.Media();
    method public static android.graphics.Bitmap getBitmap(android.content.ContentResolver, android.net.Uri) throws java.io.FileNotFoundException, java.io.IOException;
    method public static android.net.Uri getContentUri(String);
    method public static String insertImage(android.content.ContentResolver, String, String, String) throws java.io.FileNotFoundException;
    method public static String insertImage(android.content.ContentResolver, android.graphics.Bitmap, String, String);
    method public static android.database.Cursor query(android.content.ContentResolver, android.net.Uri, String[]);
    method public static android.database.Cursor query(android.content.ContentResolver, android.net.Uri, String[], String, String);
    method public static android.database.Cursor query(android.content.ContentResolver, android.net.Uri, String[], String, String[], String);
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/image";
    field public static final String DEFAULT_SORT_ORDER = "bucket_display_name";
    field public static final android.net.Uri EXTERNAL_CONTENT_URI;
    field public static final android.net.Uri INTERNAL_CONTENT_URI;
  }

  public static class MediaStore.Images.Thumbnails implements android.provider.BaseColumns {
    ctor public MediaStore.Images.Thumbnails();
    method public static void cancelThumbnailRequest(android.content.ContentResolver, long);
    method public static void cancelThumbnailRequest(android.content.ContentResolver, long, long);
    method public static android.net.Uri getContentUri(String);
    method public static android.graphics.Bitmap getThumbnail(android.content.ContentResolver, long, int, android.graphics.BitmapFactory.Options);
    method public static android.graphics.Bitmap getThumbnail(android.content.ContentResolver, long, long, int, android.graphics.BitmapFactory.Options);
    method public static final android.database.Cursor query(android.content.ContentResolver, android.net.Uri, String[]);
    method public static final android.database.Cursor queryMiniThumbnail(android.content.ContentResolver, long, int, String[]);
    method public static final android.database.Cursor queryMiniThumbnails(android.content.ContentResolver, android.net.Uri, int, String[]);
    field public static final String DATA = "_data";
    field public static final String DEFAULT_SORT_ORDER = "image_id ASC";
    field public static final android.net.Uri EXTERNAL_CONTENT_URI;
    field public static final int FULL_SCREEN_KIND = 2; // 0x2
    field public static final String HEIGHT = "height";
    field public static final String IMAGE_ID = "image_id";
    field public static final android.net.Uri INTERNAL_CONTENT_URI;
    field public static final String KIND = "kind";
    field public static final int MICRO_KIND = 3; // 0x3
    field public static final int MINI_KIND = 1; // 0x1
    field public static final String THUMB_DATA = "thumb_data";
    field public static final String WIDTH = "width";
  }

  public static interface MediaStore.MediaColumns extends android.provider.BaseColumns {
    field public static final String DATA = "_data";
    field public static final String DATE_ADDED = "date_added";
    field public static final String DATE_MODIFIED = "date_modified";
    field public static final String DISPLAY_NAME = "_display_name";
    field public static final String HEIGHT = "height";
    field public static final String MIME_TYPE = "mime_type";
    field public static final String SIZE = "_size";
    field public static final String TITLE = "title";
    field public static final String WIDTH = "width";
  }

  public static final class MediaStore.Video {
    ctor public MediaStore.Video();
    method public static android.database.Cursor query(android.content.ContentResolver, android.net.Uri, String[]);
    field public static final String DEFAULT_SORT_ORDER = "_display_name";
  }

  public static final class MediaStore.Video.Media implements android.provider.MediaStore.Video.VideoColumns {
    ctor public MediaStore.Video.Media();
    method public static android.net.Uri getContentUri(String);
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/video";
    field public static final String DEFAULT_SORT_ORDER = "title";
    field public static final android.net.Uri EXTERNAL_CONTENT_URI;
    field public static final android.net.Uri INTERNAL_CONTENT_URI;
  }

  public static class MediaStore.Video.Thumbnails implements android.provider.BaseColumns {
    ctor public MediaStore.Video.Thumbnails();
    method public static void cancelThumbnailRequest(android.content.ContentResolver, long);
    method public static void cancelThumbnailRequest(android.content.ContentResolver, long, long);
    method public static android.net.Uri getContentUri(String);
    method public static android.graphics.Bitmap getThumbnail(android.content.ContentResolver, long, int, android.graphics.BitmapFactory.Options);
    method public static android.graphics.Bitmap getThumbnail(android.content.ContentResolver, long, long, int, android.graphics.BitmapFactory.Options);
    field public static final String DATA = "_data";
    field public static final String DEFAULT_SORT_ORDER = "video_id ASC";
    field public static final android.net.Uri EXTERNAL_CONTENT_URI;
    field public static final int FULL_SCREEN_KIND = 2; // 0x2
    field public static final String HEIGHT = "height";
    field public static final android.net.Uri INTERNAL_CONTENT_URI;
    field public static final String KIND = "kind";
    field public static final int MICRO_KIND = 3; // 0x3
    field public static final int MINI_KIND = 1; // 0x1
    field public static final String VIDEO_ID = "video_id";
    field public static final String WIDTH = "width";
  }

  public static interface MediaStore.Video.VideoColumns extends android.provider.MediaStore.MediaColumns {
    field public static final String ALBUM = "album";
    field public static final String ARTIST = "artist";
    field public static final String BOOKMARK = "bookmark";
    field public static final String BUCKET_DISPLAY_NAME = "bucket_display_name";
    field public static final String BUCKET_ID = "bucket_id";
    field public static final String CATEGORY = "category";
    field public static final String DATE_TAKEN = "datetaken";
    field public static final String DESCRIPTION = "description";
    field public static final String DURATION = "duration";
    field public static final String IS_PRIVATE = "isprivate";
    field public static final String LANGUAGE = "language";
    field public static final String LATITUDE = "latitude";
    field public static final String LONGITUDE = "longitude";
    field public static final String MINI_THUMB_MAGIC = "mini_thumb_magic";
    field public static final String RESOLUTION = "resolution";
    field public static final String TAGS = "tags";
  }

  public interface OpenableColumns {
    field public static final String DISPLAY_NAME = "_display_name";
    field public static final String SIZE = "_size";
  }

  public class SearchRecentSuggestions {
    ctor public SearchRecentSuggestions(android.content.Context, String, int);
    method public void clearHistory();
    method public void saveRecentQuery(String, String);
    method protected void truncateHistory(android.content.ContentResolver, int);
    field public static final String[] QUERIES_PROJECTION_1LINE;
    field public static final String[] QUERIES_PROJECTION_2LINE;
    field public static final int QUERIES_PROJECTION_DATE_INDEX = 1; // 0x1
    field public static final int QUERIES_PROJECTION_DISPLAY1_INDEX = 3; // 0x3
    field public static final int QUERIES_PROJECTION_DISPLAY2_INDEX = 4; // 0x4
    field public static final int QUERIES_PROJECTION_QUERY_INDEX = 2; // 0x2
  }

  public final class Settings {
    ctor public Settings();
    method public static boolean canDrawOverlays(android.content.Context);
    field public static final String ACTION_ACCESSIBILITY_SETTINGS = "android.settings.ACCESSIBILITY_SETTINGS";
    field public static final String ACTION_ADD_ACCOUNT = "android.settings.ADD_ACCOUNT_SETTINGS";
    field public static final String ACTION_AIRPLANE_MODE_SETTINGS = "android.settings.AIRPLANE_MODE_SETTINGS";
    field public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
    field public static final String ACTION_APPLICATION_DETAILS_SETTINGS = "android.settings.APPLICATION_DETAILS_SETTINGS";
    field public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
    field public static final String ACTION_APPLICATION_SETTINGS = "android.settings.APPLICATION_SETTINGS";
    field public static final String ACTION_APP_NOTIFICATION_SETTINGS = "android.settings.APP_NOTIFICATION_SETTINGS";
    field public static final String ACTION_BATTERY_SAVER_SETTINGS = "android.settings.BATTERY_SAVER_SETTINGS";
    field public static final String ACTION_BLUETOOTH_SETTINGS = "android.settings.BLUETOOTH_SETTINGS";
    field public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
    field public static final String ACTION_CAST_SETTINGS = "android.settings.CAST_SETTINGS";
    field public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS = "android.settings.CHANNEL_NOTIFICATION_SETTINGS";
    field public static final String ACTION_DATA_ROAMING_SETTINGS = "android.settings.DATA_ROAMING_SETTINGS";
    field public static final String ACTION_DATA_USAGE_SETTINGS = "android.settings.DATA_USAGE_SETTINGS";
    field public static final String ACTION_DATE_SETTINGS = "android.settings.DATE_SETTINGS";
    field public static final String ACTION_DEVICE_INFO_SETTINGS = "android.settings.DEVICE_INFO_SETTINGS";
    field public static final String ACTION_DISPLAY_SETTINGS = "android.settings.DISPLAY_SETTINGS";
    field public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
    field public static final String ACTION_FINGERPRINT_ENROLL = "android.settings.FINGERPRINT_ENROLL";
    field public static final String ACTION_HARD_KEYBOARD_SETTINGS = "android.settings.HARD_KEYBOARD_SETTINGS";
    field public static final String ACTION_HOME_SETTINGS = "android.settings.HOME_SETTINGS";
    field public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS = "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
    field public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS = "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
    field public static final String ACTION_INPUT_METHOD_SETTINGS = "android.settings.INPUT_METHOD_SETTINGS";
    field public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
    field public static final String ACTION_INTERNAL_STORAGE_SETTINGS = "android.settings.INTERNAL_STORAGE_SETTINGS";
    field public static final String ACTION_LOCALE_SETTINGS = "android.settings.LOCALE_SETTINGS";
    field public static final String ACTION_LOCATION_SOURCE_SETTINGS = "android.settings.LOCATION_SOURCE_SETTINGS";
    field public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
    field public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = "android.settings.MANAGE_APPLICATIONS_SETTINGS";
    field public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
    field public static final String ACTION_MANAGE_OVERLAY_PERMISSION = "android.settings.action.MANAGE_OVERLAY_PERMISSION";
    field public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES = "android.settings.MANAGE_UNKNOWN_APP_SOURCES";
    field public static final String ACTION_MANAGE_WRITE_SETTINGS = "android.settings.action.MANAGE_WRITE_SETTINGS";
    field public static final String ACTION_MEMORY_CARD_SETTINGS = "android.settings.MEMORY_CARD_SETTINGS";
    field public static final String ACTION_NETWORK_OPERATOR_SETTINGS = "android.settings.NETWORK_OPERATOR_SETTINGS";
    field public static final String ACTION_NFCSHARING_SETTINGS = "android.settings.NFCSHARING_SETTINGS";
    field public static final String ACTION_NFC_PAYMENT_SETTINGS = "android.settings.NFC_PAYMENT_SETTINGS";
    field public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
    field public static final String ACTION_NIGHT_DISPLAY_SETTINGS = "android.settings.NIGHT_DISPLAY_SETTINGS";
    field public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
    field public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
    field public static final String ACTION_PRINT_SETTINGS = "android.settings.ACTION_PRINT_SETTINGS";
    field public static final String ACTION_PRIVACY_SETTINGS = "android.settings.PRIVACY_SETTINGS";
    field public static final String ACTION_QUICK_LAUNCH_SETTINGS = "android.settings.QUICK_LAUNCH_SETTINGS";
    field public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
    field public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE = "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
    field public static final String ACTION_SEARCH_SETTINGS = "android.search.action.SEARCH_SETTINGS";
    field public static final String ACTION_SECURITY_SETTINGS = "android.settings.SECURITY_SETTINGS";
    field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
    field public static final String ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
    field public static final String ACTION_SOUND_SETTINGS = "android.settings.SOUND_SETTINGS";
    field public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS = "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS";
    field public static final String ACTION_SYNC_SETTINGS = "android.settings.SYNC_SETTINGS";
    field public static final String ACTION_USAGE_ACCESS_SETTINGS = "android.settings.USAGE_ACCESS_SETTINGS";
    field public static final String ACTION_USER_DICTIONARY_SETTINGS = "android.settings.USER_DICTIONARY_SETTINGS";
    field public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE = "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
    field public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE = "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
    field public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE = "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
    field public static final String ACTION_VOICE_INPUT_SETTINGS = "android.settings.VOICE_INPUT_SETTINGS";
    field public static final String ACTION_VPN_SETTINGS = "android.settings.VPN_SETTINGS";
    field public static final String ACTION_VR_LISTENER_SETTINGS = "android.settings.VR_LISTENER_SETTINGS";
    field public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
    field public static final String ACTION_WIFI_IP_SETTINGS = "android.settings.WIFI_IP_SETTINGS";
    field public static final String ACTION_WIFI_SETTINGS = "android.settings.WIFI_SETTINGS";
    field public static final String ACTION_WIRELESS_SETTINGS = "android.settings.WIRELESS_SETTINGS";
    field public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
    field public static final String AUTHORITY = "settings";
    field public static final String EXTRA_ACCOUNT_TYPES = "account_types";
    field public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
    field public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE";
    field public static final String EXTRA_AUTHORITIES = "authorities";
    field public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED = "android.settings.extra.battery_saver_mode_enabled";
    field public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID";
    field public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED = "android.settings.extra.do_not_disturb_mode_enabled";
    field public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES = "android.settings.extra.do_not_disturb_mode_minutes";
    field public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
    field public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID";
    field public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG = "android.intent.category.USAGE_ACCESS_CONFIG";
    field public static final String METADATA_USAGE_ACCESS_REASON = "android.settings.metadata.USAGE_ACCESS_REASON";
  }

  public static final class Settings.Global extends android.provider.Settings.NameValueTable {
    ctor public Settings.Global();
    method public static float getFloat(android.content.ContentResolver, String, float);
    method public static float getFloat(android.content.ContentResolver, String) throws android.provider.Settings.SettingNotFoundException;
    method public static int getInt(android.content.ContentResolver, String, int);
    method public static int getInt(android.content.ContentResolver, String) throws android.provider.Settings.SettingNotFoundException;
    method public static long getLong(android.content.ContentResolver, String, long);
    method public static long getLong(android.content.ContentResolver, String) throws android.provider.Settings.SettingNotFoundException;
    method public static String getString(android.content.ContentResolver, String);
    method public static android.net.Uri getUriFor(String);
    method public static boolean putFloat(android.content.ContentResolver, String, float);
    method public static boolean putInt(android.content.ContentResolver, String, int);
    method public static boolean putLong(android.content.ContentResolver, String, long);
    method public static boolean putString(android.content.ContentResolver, String, String);
    field public static final String ADB_ENABLED = "adb_enabled";
    field public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
    field public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
    field public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
    field public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
    field public static final String AUTO_TIME = "auto_time";
    field public static final String AUTO_TIME_ZONE = "auto_time_zone";
    field public static final String BLUETOOTH_ON = "bluetooth_on";
    field public static final String BOOT_COUNT = "boot_count";
    field public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DATA_ROAMING = "data_roaming";
    field public static final String DEBUG_APP = "debug_app";
    field public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
    field public static final String DEVICE_NAME = "device_name";
    field public static final String DEVICE_PROVISIONED = "device_provisioned";
    field public static final String HTTP_PROXY = "http_proxy";
    field @Deprecated public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
    field public static final String MODE_RINGER = "mode_ringer";
    field public static final String NETWORK_PREFERENCE = "network_preference";
    field public static final String RADIO_BLUETOOTH = "bluetooth";
    field public static final String RADIO_CELL = "cell";
    field public static final String RADIO_NFC = "nfc";
    field public static final String RADIO_WIFI = "wifi";
    field @Deprecated public static final String SHOW_PROCESSES = "show_processes";
    field public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
    field public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
    field public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
    field public static final String USE_GOOGLE_MAIL = "use_google_mail";
    field public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
    field public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN = "wifi_device_owner_configs_lockdown";
    field public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
    field public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = "wifi_mobile_data_transition_wakelock_timeout_ms";
    field @Deprecated public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = "wifi_networks_available_notification_on";
    field public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = "wifi_networks_available_repeat_delay";
    field public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
    field public static final String WIFI_ON = "wifi_on";
    field public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
    field public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; // 0x0
    field public static final int WIFI_SLEEP_POLICY_NEVER = 2; // 0x2
    field public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; // 0x1
    field public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
    field public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
  }

  public static class Settings.NameValueTable implements android.provider.BaseColumns {
    ctor public Settings.NameValueTable();
    method public static android.net.Uri getUriFor(android.net.Uri, String);
    method protected static boolean putString(android.content.ContentResolver, android.net.Uri, String, String);
    field public static final String NAME = "name";
    field public static final String VALUE = "value";
  }

  public static final class Settings.Secure extends android.provider.Settings.NameValueTable {
    ctor public Settings.Secure();
    method public static float getFloat(android.content.ContentResolver, String, float);
    method public static float getFloat(android.content.ContentResolver, String) throws android.provider.Settings.SettingNotFoundException;
    method public static int getInt(android.content.ContentResolver, String, int);
    method public static int getInt(android.content.ContentResolver, String) throws android.provider.Settings.SettingNotFoundException;
    method public static long getLong(android.content.ContentResolver, String, long);
    method public static long getLong(android.content.ContentResolver, String) throws android.provider.Settings.SettingNotFoundException;
    method public static String getString(android.content.ContentResolver, String);
    method public static android.net.Uri getUriFor(String);
    method @Deprecated public static boolean isLocationProviderEnabled(android.content.ContentResolver, String);
    method public static boolean putFloat(android.content.ContentResolver, String, float);
    method public static boolean putInt(android.content.ContentResolver, String, int);
    method public static boolean putLong(android.content.ContentResolver, String, long);
    method public static boolean putString(android.content.ContentResolver, String, String);
    method @Deprecated public static void setLocationProviderEnabled(android.content.ContentResolver, String, boolean);
    field public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = "accessibility_display_inversion_enabled";
    field public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
    field @Deprecated public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
    field @Deprecated public static final String ADB_ENABLED = "adb_enabled";
    field public static final String ALLOWED_GEOLOCATION_ORIGINS = "allowed_geolocation_origins";
    field @Deprecated public static final String ALLOW_MOCK_LOCATION = "mock_location";
    field public static final String ANDROID_ID = "android_id";
    field @Deprecated public static final String BACKGROUND_DATA = "background_data";
    field @Deprecated public static final String BLUETOOTH_ON = "bluetooth_on";
    field public static final android.net.Uri CONTENT_URI;
    field @Deprecated public static final String DATA_ROAMING = "data_roaming";
    field public static final String DEFAULT_INPUT_METHOD = "default_input_method";
    field @Deprecated public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
    field @Deprecated public static final String DEVICE_PROVISIONED = "device_provisioned";
    field public static final String ENABLED_ACCESSIBILITY_SERVICES = "enabled_accessibility_services";
    field public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
    field @Deprecated public static final String HTTP_PROXY = "http_proxy";
    field public static final String INPUT_METHOD_SELECTOR_VISIBILITY = "input_method_selector_visibility";
    field @Deprecated public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
    field @Deprecated public static final String LOCATION_MODE = "location_mode";
    field @Deprecated public static final int LOCATION_MODE_BATTERY_SAVING = 2; // 0x2
    field @Deprecated public static final int LOCATION_MODE_HIGH_ACCURACY = 3; // 0x3
    field @Deprecated public static final int LOCATION_MODE_OFF = 0; // 0x0
    field @Deprecated public static final int LOCATION_MODE_SENSORS_ONLY = 1; // 0x1
    field @Deprecated public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
    field @Deprecated public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
    field @Deprecated public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
    field @Deprecated public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
    field @Deprecated public static final String LOGGING_ID = "logging_id";
    field @Deprecated public static final String NETWORK_PREFERENCE = "network_preference";
    field public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
    field public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
    field public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
    field public static final String RTT_CALLING_MODE = "rtt_calling_mode";
    field public static final String SELECTED_INPUT_METHOD_SUBTYPE = "selected_input_method_subtype";
    field public static final String SETTINGS_CLASSNAME = "settings_classname";
    field public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
    field public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
    field @Deprecated public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
    field @Deprecated public static final String TTS_DEFAULT_LANG = "tts_default_lang";
    field public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
    field public static final String TTS_DEFAULT_RATE = "tts_default_rate";
    field public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
    field @Deprecated public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
    field public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
    field @Deprecated public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
    field @Deprecated public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
    field @Deprecated public static final String USE_GOOGLE_MAIL = "use_google_mail";
    field @Deprecated public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
    field @Deprecated public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = "wifi_mobile_data_transition_wakelock_timeout_ms";
    field @Deprecated public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = "wifi_networks_available_notification_on";
    field @Deprecated public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = "wifi_networks_available_repeat_delay";
    field @Deprecated public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
    field @Deprecated public static final String WIFI_ON = "wifi_on";
    field @Deprecated public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = "wifi_watchdog_acceptable_packet_loss_percentage";
    field @Deprecated public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
    field @Deprecated public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = "wifi_watchdog_background_check_delay_ms";
    field @Deprecated public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = "wifi_watchdog_background_check_enabled";
    field @Deprecated public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = "wifi_watchdog_background_check_timeout_ms";
    field @Deprecated public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = "wifi_watchdog_initial_ignored_ping_count";
    field @Deprecated public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
    field @Deprecated public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
    field @Deprecated public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
    field @Deprecated public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
    field @Deprecated public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
    field @Deprecated public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
  }

  public static class Settings.SettingNotFoundException extends android.util.AndroidException {
    ctor public Settings.SettingNotFoundException(String);
  }

  public static final class Settings.System extends android.provider.Settings.NameValueTable {
    ctor public Settings.System();
    method public static boolean canWrite(android.content.Context);
    method public static void getConfiguration(android.content.ContentResolver, android.content.res.Configuration);
    method public static float getFloat(android.content.ContentResolver, String, float);
    method public static float getFloat(android.content.ContentResolver, String) throws android.provider.Settings.SettingNotFoundException;
    method public static int getInt(android.content.ContentResolver, String, int);
    method public static int getInt(android.content.ContentResolver, String) throws android.provider.Settings.SettingNotFoundException;
    method public static long getLong(android.content.ContentResolver, String, long);
    method public static long getLong(android.content.ContentResolver, String) throws android.provider.Settings.SettingNotFoundException;
    method @Deprecated public static boolean getShowGTalkServiceStatus(android.content.ContentResolver);
    method public static String getString(android.content.ContentResolver, String);
    method public static android.net.Uri getUriFor(String);
    method public static boolean putConfiguration(android.content.ContentResolver, android.content.res.Configuration);
    method public static boolean putFloat(android.content.ContentResolver, String, float);
    method public static boolean putInt(android.content.ContentResolver, String, int);
    method public static boolean putLong(android.content.ContentResolver, String, long);
    method public static boolean putString(android.content.ContentResolver, String, String);
    method @Deprecated public static void setShowGTalkServiceStatus(android.content.ContentResolver, boolean);
    field public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
    field @Deprecated public static final String ADB_ENABLED = "adb_enabled";
    field @Deprecated public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
    field @Deprecated public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
    field public static final String ALARM_ALERT = "alarm_alert";
    field @Deprecated public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
    field @Deprecated public static final String ANDROID_ID = "android_id";
    field @Deprecated public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
    field @Deprecated public static final String AUTO_TIME = "auto_time";
    field @Deprecated public static final String AUTO_TIME_ZONE = "auto_time_zone";
    field public static final String BLUETOOTH_DISCOVERABILITY = "bluetooth_discoverability";
    field public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = "bluetooth_discoverability_timeout";
    field @Deprecated public static final String BLUETOOTH_ON = "bluetooth_on";
    field public static final android.net.Uri CONTENT_URI;
    field @Deprecated public static final String DATA_ROAMING = "data_roaming";
    field public static final String DATE_FORMAT = "date_format";
    field @Deprecated public static final String DEBUG_APP = "debug_app";
    field public static final android.net.Uri DEFAULT_ALARM_ALERT_URI;
    field public static final android.net.Uri DEFAULT_NOTIFICATION_URI;
    field public static final android.net.Uri DEFAULT_RINGTONE_URI;
    field @Deprecated public static final String DEVICE_PROVISIONED = "device_provisioned";
    field @Deprecated public static final String DIM_SCREEN = "dim_screen";
    field public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
    field public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
    field public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
    field public static final String FONT_SCALE = "font_scale";
    field public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
    field @Deprecated public static final String HTTP_PROXY = "http_proxy";
    field @Deprecated public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
    field @Deprecated public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
    field @Deprecated public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
    field @Deprecated public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
    field @Deprecated public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
    field @Deprecated public static final String LOGGING_ID = "logging_id";
    field @Deprecated public static final String MODE_RINGER = "mode_ringer";
    field public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
    field public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
    field @Deprecated public static final String NETWORK_PREFERENCE = "network_preference";
    field @Deprecated public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
    field public static final String NOTIFICATION_SOUND = "notification_sound";
    field @Deprecated public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
    field @Deprecated public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
    field @Deprecated public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
    field @Deprecated public static final String RADIO_BLUETOOTH = "bluetooth";
    field @Deprecated public static final String RADIO_CELL = "cell";
    field @Deprecated public static final String RADIO_NFC = "nfc";
    field @Deprecated public static final String RADIO_WIFI = "wifi";
    field public static final String RINGTONE = "ringtone";
    field public static final String SCREEN_BRIGHTNESS = "screen_brightness";
    field public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
    field public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; // 0x1
    field public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; // 0x0
    field public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
    field @Deprecated public static final String SETTINGS_CLASSNAME = "settings_classname";
    field public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
    field public static final String SHOW_GTALK_SERVICE_STATUS = "SHOW_GTALK_SERVICE_STATUS";
    field @Deprecated public static final String SHOW_PROCESSES = "show_processes";
    field @Deprecated public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
    field public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
    field @Deprecated public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
    field public static final String TEXT_AUTO_CAPS = "auto_caps";
    field public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
    field public static final String TEXT_AUTO_REPLACE = "auto_replace";
    field public static final String TEXT_SHOW_PASSWORD = "show_password";
    field public static final String TIME_12_24 = "time_12_24";
    field @Deprecated public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
    field @Deprecated public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
    field public static final String USER_ROTATION = "user_rotation";
    field @Deprecated public static final String USE_GOOGLE_MAIL = "use_google_mail";
    field public static final String VIBRATE_ON = "vibrate_on";
    field public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
    field @Deprecated public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
    field @Deprecated public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
    field @Deprecated public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
    field @Deprecated public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = "wifi_mobile_data_transition_wakelock_timeout_ms";
    field @Deprecated public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = "wifi_networks_available_notification_on";
    field @Deprecated public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = "wifi_networks_available_repeat_delay";
    field @Deprecated public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
    field @Deprecated public static final String WIFI_ON = "wifi_on";
    field @Deprecated public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
    field @Deprecated public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; // 0x0
    field @Deprecated public static final int WIFI_SLEEP_POLICY_NEVER = 2; // 0x2
    field @Deprecated public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; // 0x1
    field @Deprecated public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
    field @Deprecated public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
    field @Deprecated public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
    field @Deprecated public static final String WIFI_STATIC_IP = "wifi_static_ip";
    field @Deprecated public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
    field @Deprecated public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
    field @Deprecated public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = "wifi_watchdog_acceptable_packet_loss_percentage";
    field @Deprecated public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
    field @Deprecated public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = "wifi_watchdog_background_check_delay_ms";
    field @Deprecated public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = "wifi_watchdog_background_check_enabled";
    field @Deprecated public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = "wifi_watchdog_background_check_timeout_ms";
    field @Deprecated public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = "wifi_watchdog_initial_ignored_ping_count";
    field @Deprecated public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
    field @Deprecated public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
    field @Deprecated public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
    field @Deprecated public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
    field @Deprecated public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
    field @Deprecated public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
  }

  public class SettingsSlicesContract {
    field public static final String AUTHORITY = "android.settings.slices";
    field public static final android.net.Uri BASE_URI;
    field public static final String KEY_AIRPLANE_MODE = "airplane_mode";
    field public static final String KEY_BATTERY_SAVER = "battery_saver";
    field public static final String KEY_BLUETOOTH = "bluetooth";
    field public static final String KEY_LOCATION = "location";
    field public static final String KEY_WIFI = "wifi";
    field public static final String PATH_SETTING_ACTION = "action";
    field public static final String PATH_SETTING_INTENT = "intent";
  }

  public class SyncStateContract {
    ctor public SyncStateContract();
  }

  public static interface SyncStateContract.Columns extends android.provider.BaseColumns {
    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";
  }

  public static class SyncStateContract.Constants implements android.provider.SyncStateContract.Columns {
    ctor public SyncStateContract.Constants();
    field public static final String CONTENT_DIRECTORY = "syncstate";
  }

  public static final class SyncStateContract.Helpers {
    ctor public SyncStateContract.Helpers();
    method public static byte[] get(android.content.ContentProviderClient, android.net.Uri, android.accounts.Account) throws android.os.RemoteException;
    method public static android.util.Pair<android.net.Uri,byte[]> getWithUri(android.content.ContentProviderClient, android.net.Uri, android.accounts.Account) throws android.os.RemoteException;
    method public static android.net.Uri insert(android.content.ContentProviderClient, android.net.Uri, android.accounts.Account, byte[]) throws android.os.RemoteException;
    method public static android.content.ContentProviderOperation newSetOperation(android.net.Uri, android.accounts.Account, byte[]);
    method public static android.content.ContentProviderOperation newUpdateOperation(android.net.Uri, byte[]);
    method public static void set(android.content.ContentProviderClient, android.net.Uri, android.accounts.Account, byte[]) throws android.os.RemoteException;
    method public static void update(android.content.ContentProviderClient, android.net.Uri, byte[]) throws android.os.RemoteException;
  }

  public final class Telephony {
  }

  public static interface Telephony.BaseMmsColumns extends android.provider.BaseColumns {
    field public static final String CONTENT_CLASS = "ct_cls";
    field public static final String CONTENT_LOCATION = "ct_l";
    field public static final String CONTENT_TYPE = "ct_t";
    field public static final String CREATOR = "creator";
    field public static final String DATE = "date";
    field public static final String DATE_SENT = "date_sent";
    field public static final String DELIVERY_REPORT = "d_rpt";
    field public static final String DELIVERY_TIME = "d_tm";
    field public static final String EXPIRY = "exp";
    field public static final String LOCKED = "locked";
    field public static final String MESSAGE_BOX = "msg_box";
    field public static final int MESSAGE_BOX_ALL = 0; // 0x0
    field public static final int MESSAGE_BOX_DRAFTS = 3; // 0x3
    field public static final int MESSAGE_BOX_FAILED = 5; // 0x5
    field public static final int MESSAGE_BOX_INBOX = 1; // 0x1
    field public static final int MESSAGE_BOX_OUTBOX = 4; // 0x4
    field public static final int MESSAGE_BOX_SENT = 2; // 0x2
    field public static final String MESSAGE_CLASS = "m_cls";
    field public static final String MESSAGE_ID = "m_id";
    field public static final String MESSAGE_SIZE = "m_size";
    field public static final String MESSAGE_TYPE = "m_type";
    field public static final String MMS_VERSION = "v";
    field public static final String PRIORITY = "pri";
    field public static final String READ = "read";
    field public static final String READ_REPORT = "rr";
    field public static final String READ_STATUS = "read_status";
    field public static final String REPORT_ALLOWED = "rpt_a";
    field public static final String RESPONSE_STATUS = "resp_st";
    field public static final String RESPONSE_TEXT = "resp_txt";
    field public static final String RETRIEVE_STATUS = "retr_st";
    field public static final String RETRIEVE_TEXT = "retr_txt";
    field public static final String RETRIEVE_TEXT_CHARSET = "retr_txt_cs";
    field public static final String SEEN = "seen";
    field public static final String STATUS = "st";
    field public static final String SUBJECT = "sub";
    field public static final String SUBJECT_CHARSET = "sub_cs";
    field public static final String SUBSCRIPTION_ID = "sub_id";
    field public static final String TEXT_ONLY = "text_only";
    field public static final String THREAD_ID = "thread_id";
    field public static final String TRANSACTION_ID = "tr_id";
  }

  public static interface Telephony.CanonicalAddressesColumns extends android.provider.BaseColumns {
    field public static final String ADDRESS = "address";
  }

  public static final class Telephony.CarrierId implements android.provider.BaseColumns {
    method public static android.net.Uri getPreciseCarrierIdUriForSubscriptionId(int);
    method public static android.net.Uri getUriForSubscriptionId(int);
    field public static final String CARRIER_ID = "carrier_id";
    field public static final String CARRIER_NAME = "carrier_name";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String PRECISE_CARRIER_ID = "precise_carrier_id";
    field public static final String PRECISE_CARRIER_ID_NAME = "precise_carrier_id_name";
  }

  public static final class Telephony.Carriers implements android.provider.BaseColumns {
    field public static final String APN = "apn";
    field public static final String AUTH_TYPE = "authtype";
    field @Deprecated public static final String BEARER = "bearer";
    field public static final String CARRIER_ENABLED = "carrier_enabled";
    field public static final String CARRIER_ID = "carrier_id";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String CURRENT = "current";
    field public static final String DEFAULT_SORT_ORDER = "name ASC";
    field @Deprecated public static final String MCC = "mcc";
    field public static final String MMSC = "mmsc";
    field public static final String MMSPORT = "mmsport";
    field public static final String MMSPROXY = "mmsproxy";
    field @Deprecated public static final String MNC = "mnc";
    field @Deprecated public static final String MVNO_MATCH_DATA = "mvno_match_data";
    field @Deprecated public static final String MVNO_TYPE = "mvno_type";
    field public static final String NAME = "name";
    field public static final String NETWORK_TYPE_BITMASK = "network_type_bitmask";
    field @Deprecated public static final String NUMERIC = "numeric";
    field public static final String PASSWORD = "password";
    field public static final String PORT = "port";
    field public static final String PROTOCOL = "protocol";
    field public static final String PROXY = "proxy";
    field public static final String ROAMING_PROTOCOL = "roaming_protocol";
    field public static final String SERVER = "server";
    field public static final android.net.Uri SIM_APN_URI;
    field public static final String SUBSCRIPTION_ID = "sub_id";
    field public static final String TYPE = "type";
    field public static final String USER = "user";
  }

  public static final class Telephony.Mms implements android.provider.Telephony.BaseMmsColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
    field public static final android.net.Uri REPORT_REQUEST_URI;
    field public static final android.net.Uri REPORT_STATUS_URI;
  }

  public static final class Telephony.Mms.Addr implements android.provider.BaseColumns {
    field public static final String ADDRESS = "address";
    field public static final String CHARSET = "charset";
    field public static final String CONTACT_ID = "contact_id";
    field public static final String MSG_ID = "msg_id";
    field public static final String TYPE = "type";
  }

  public static final class Telephony.Mms.Draft implements android.provider.Telephony.BaseMmsColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
  }

  public static final class Telephony.Mms.Inbox implements android.provider.Telephony.BaseMmsColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
  }

  public static final class Telephony.Mms.Intents {
    field public static final String CONTENT_CHANGED_ACTION = "android.intent.action.CONTENT_CHANGED";
    field public static final String DELETED_CONTENTS = "deleted_contents";
  }

  public static final class Telephony.Mms.Outbox implements android.provider.Telephony.BaseMmsColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
  }

  public static final class Telephony.Mms.Part implements android.provider.BaseColumns {
    field public static final String CHARSET = "chset";
    field public static final String CONTENT_DISPOSITION = "cd";
    field public static final String CONTENT_ID = "cid";
    field public static final String CONTENT_LOCATION = "cl";
    field public static final String CONTENT_TYPE = "ct";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String CT_START = "ctt_s";
    field public static final String CT_TYPE = "ctt_t";
    field public static final String FILENAME = "fn";
    field public static final String MSG_ID = "mid";
    field public static final String NAME = "name";
    field public static final String SEQ = "seq";
    field public static final String TEXT = "text";
    field public static final String _DATA = "_data";
  }

  public static final class Telephony.Mms.Rate {
    field public static final android.net.Uri CONTENT_URI;
    field public static final String SENT_TIME = "sent_time";
  }

  public static final class Telephony.Mms.Sent implements android.provider.Telephony.BaseMmsColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
  }

  public static final class Telephony.MmsSms implements android.provider.BaseColumns {
    field public static final android.net.Uri CONTENT_CONVERSATIONS_URI;
    field public static final android.net.Uri CONTENT_DRAFT_URI;
    field public static final android.net.Uri CONTENT_FILTER_BYPHONE_URI;
    field public static final android.net.Uri CONTENT_LOCKED_URI;
    field public static final android.net.Uri CONTENT_UNDELIVERED_URI;
    field public static final android.net.Uri CONTENT_URI;
    field public static final int ERR_TYPE_GENERIC = 1; // 0x1
    field public static final int ERR_TYPE_GENERIC_PERMANENT = 10; // 0xa
    field public static final int ERR_TYPE_MMS_PROTO_PERMANENT = 12; // 0xc
    field public static final int ERR_TYPE_MMS_PROTO_TRANSIENT = 3; // 0x3
    field public static final int ERR_TYPE_SMS_PROTO_PERMANENT = 11; // 0xb
    field public static final int ERR_TYPE_SMS_PROTO_TRANSIENT = 2; // 0x2
    field public static final int ERR_TYPE_TRANSPORT_FAILURE = 4; // 0x4
    field public static final int MMS_PROTO = 1; // 0x1
    field public static final int NO_ERROR = 0; // 0x0
    field public static final android.net.Uri SEARCH_URI;
    field public static final int SMS_PROTO = 0; // 0x0
    field public static final String TYPE_DISCRIMINATOR_COLUMN = "transport_type";
  }

  public static final class Telephony.MmsSms.PendingMessages implements android.provider.BaseColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DUE_TIME = "due_time";
    field public static final String ERROR_CODE = "err_code";
    field public static final String ERROR_TYPE = "err_type";
    field public static final String LAST_TRY = "last_try";
    field public static final String MSG_ID = "msg_id";
    field public static final String MSG_TYPE = "msg_type";
    field public static final String PROTO_TYPE = "proto_type";
    field public static final String RETRY_INDEX = "retry_index";
    field public static final String SUBSCRIPTION_ID = "pending_sub_id";
  }

  public static final class Telephony.ServiceStateTable {
    method public static android.net.Uri getUriForSubscriptionId(int);
    method public static android.net.Uri getUriForSubscriptionIdAndField(int, String);
    field public static final String AUTHORITY = "service-state";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String IS_MANUAL_NETWORK_SELECTION = "is_manual_network_selection";
    field public static final String VOICE_OPERATOR_NUMERIC = "voice_operator_numeric";
    field public static final String VOICE_REG_STATE = "voice_reg_state";
  }

  public static final class Telephony.Sms implements android.provider.BaseColumns android.provider.Telephony.TextBasedSmsColumns {
    method public static String getDefaultSmsPackage(android.content.Context);
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
  }

  public static final class Telephony.Sms.Conversations implements android.provider.BaseColumns android.provider.Telephony.TextBasedSmsColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
    field public static final String MESSAGE_COUNT = "msg_count";
    field public static final String SNIPPET = "snippet";
  }

  public static final class Telephony.Sms.Draft implements android.provider.BaseColumns android.provider.Telephony.TextBasedSmsColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
  }

  public static final class Telephony.Sms.Inbox implements android.provider.BaseColumns android.provider.Telephony.TextBasedSmsColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
  }

  public static final class Telephony.Sms.Intents {
    method public static android.telephony.SmsMessage[] getMessagesFromIntent(android.content.Intent);
    field public static final String ACTION_CHANGE_DEFAULT = "android.provider.Telephony.ACTION_CHANGE_DEFAULT";
    field public static final String ACTION_DEFAULT_SMS_PACKAGE_CHANGED = "android.provider.action.DEFAULT_SMS_PACKAGE_CHANGED";
    field public static final String ACTION_EXTERNAL_PROVIDER_CHANGE = "android.provider.action.EXTERNAL_PROVIDER_CHANGE";
    field public static final String DATA_SMS_RECEIVED_ACTION = "android.intent.action.DATA_SMS_RECEIVED";
    field public static final String EXTRA_IS_DEFAULT_SMS_APP = "android.provider.extra.IS_DEFAULT_SMS_APP";
    field public static final String EXTRA_PACKAGE_NAME = "package";
    field public static final int RESULT_SMS_DUPLICATED = 5; // 0x5
    field public static final int RESULT_SMS_GENERIC_ERROR = 2; // 0x2
    field public static final int RESULT_SMS_HANDLED = 1; // 0x1
    field public static final int RESULT_SMS_OUT_OF_MEMORY = 3; // 0x3
    field public static final int RESULT_SMS_UNSUPPORTED = 4; // 0x4
    field @Deprecated public static final String SECRET_CODE_ACTION = "android.provider.Telephony.SECRET_CODE";
    field public static final String SIM_FULL_ACTION = "android.provider.Telephony.SIM_FULL";
    field public static final String SMS_CB_RECEIVED_ACTION = "android.provider.Telephony.SMS_CB_RECEIVED";
    field public static final String SMS_DELIVER_ACTION = "android.provider.Telephony.SMS_DELIVER";
    field public static final String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_RECEIVED";
    field public static final String SMS_REJECTED_ACTION = "android.provider.Telephony.SMS_REJECTED";
    field public static final String SMS_SERVICE_CATEGORY_PROGRAM_DATA_RECEIVED_ACTION = "android.provider.Telephony.SMS_SERVICE_CATEGORY_PROGRAM_DATA_RECEIVED";
    field public static final String WAP_PUSH_DELIVER_ACTION = "android.provider.Telephony.WAP_PUSH_DELIVER";
    field public static final String WAP_PUSH_RECEIVED_ACTION = "android.provider.Telephony.WAP_PUSH_RECEIVED";
  }

  public static final class Telephony.Sms.Outbox implements android.provider.BaseColumns android.provider.Telephony.TextBasedSmsColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
  }

  public static final class Telephony.Sms.Sent implements android.provider.BaseColumns android.provider.Telephony.TextBasedSmsColumns {
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
  }

  public static interface Telephony.TextBasedSmsColumns {
    field public static final String ADDRESS = "address";
    field public static final String BODY = "body";
    field public static final String CREATOR = "creator";
    field public static final String DATE = "date";
    field public static final String DATE_SENT = "date_sent";
    field public static final String ERROR_CODE = "error_code";
    field public static final String LOCKED = "locked";
    field public static final int MESSAGE_TYPE_ALL = 0; // 0x0
    field public static final int MESSAGE_TYPE_DRAFT = 3; // 0x3
    field public static final int MESSAGE_TYPE_FAILED = 5; // 0x5
    field public static final int MESSAGE_TYPE_INBOX = 1; // 0x1
    field public static final int MESSAGE_TYPE_OUTBOX = 4; // 0x4
    field public static final int MESSAGE_TYPE_QUEUED = 6; // 0x6
    field public static final int MESSAGE_TYPE_SENT = 2; // 0x2
    field public static final String PERSON = "person";
    field public static final String PROTOCOL = "protocol";
    field public static final String READ = "read";
    field public static final String REPLY_PATH_PRESENT = "reply_path_present";
    field public static final String SEEN = "seen";
    field public static final String SERVICE_CENTER = "service_center";
    field public static final String STATUS = "status";
    field public static final int STATUS_COMPLETE = 0; // 0x0
    field public static final int STATUS_FAILED = 64; // 0x40
    field public static final int STATUS_NONE = -1; // 0xffffffff
    field public static final int STATUS_PENDING = 32; // 0x20
    field public static final String SUBJECT = "subject";
    field public static final String SUBSCRIPTION_ID = "sub_id";
    field public static final String THREAD_ID = "thread_id";
    field public static final String TYPE = "type";
  }

  public static final class Telephony.Threads implements android.provider.Telephony.ThreadsColumns {
    method public static long getOrCreateThreadId(android.content.Context, String);
    method public static long getOrCreateThreadId(android.content.Context, java.util.Set<java.lang.String>);
    field public static final int BROADCAST_THREAD = 1; // 0x1
    field public static final int COMMON_THREAD = 0; // 0x0
    field public static final android.net.Uri CONTENT_URI;
    field public static final android.net.Uri OBSOLETE_THREADS_URI;
  }

  public static interface Telephony.ThreadsColumns extends android.provider.BaseColumns {
    field public static final String ARCHIVED = "archived";
    field public static final String DATE = "date";
    field public static final String ERROR = "error";
    field public static final String HAS_ATTACHMENT = "has_attachment";
    field public static final String MESSAGE_COUNT = "message_count";
    field public static final String READ = "read";
    field public static final String RECIPIENT_IDS = "recipient_ids";
    field public static final String SNIPPET = "snippet";
    field public static final String SNIPPET_CHARSET = "snippet_cs";
    field public static final String TYPE = "type";
  }

  public class UserDictionary {
    ctor public UserDictionary();
    field public static final String AUTHORITY = "user_dictionary";
    field public static final android.net.Uri CONTENT_URI;
  }

  public static class UserDictionary.Words implements android.provider.BaseColumns {
    ctor public UserDictionary.Words();
    method @Deprecated public static void addWord(android.content.Context, String, int, int);
    method public static void addWord(android.content.Context, String, int, String, java.util.Locale);
    field public static final String APP_ID = "appid";
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.google.userword";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.google.userword";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DEFAULT_SORT_ORDER = "frequency DESC";
    field public static final String FREQUENCY = "frequency";
    field public static final String LOCALE = "locale";
    field @Deprecated public static final int LOCALE_TYPE_ALL = 0; // 0x0
    field @Deprecated public static final int LOCALE_TYPE_CURRENT = 1; // 0x1
    field public static final String SHORTCUT = "shortcut";
    field public static final String WORD = "word";
    field public static final String _ID = "_id";
  }

  public class VoicemailContract {
    field public static final String ACTION_FETCH_VOICEMAIL = "android.intent.action.FETCH_VOICEMAIL";
    field public static final String ACTION_NEW_VOICEMAIL = "android.intent.action.NEW_VOICEMAIL";
    field public static final String ACTION_SYNC_VOICEMAIL = "android.provider.action.SYNC_VOICEMAIL";
    field public static final String AUTHORITY = "com.android.voicemail";
    field public static final String EXTRA_PHONE_ACCOUNT_HANDLE = "android.provider.extra.PHONE_ACCOUNT_HANDLE";
    field public static final String EXTRA_SELF_CHANGE = "com.android.voicemail.extra.SELF_CHANGE";
    field public static final String PARAM_KEY_SOURCE_PACKAGE = "source_package";
  }

  public static final class VoicemailContract.Status implements android.provider.BaseColumns {
    method public static android.net.Uri buildSourceUri(String);
    field public static final String CONFIGURATION_STATE = "configuration_state";
    field public static final int CONFIGURATION_STATE_CAN_BE_CONFIGURED = 2; // 0x2
    field public static final int CONFIGURATION_STATE_CONFIGURING = 3; // 0x3
    field public static final int CONFIGURATION_STATE_DISABLED = 5; // 0x5
    field public static final int CONFIGURATION_STATE_FAILED = 4; // 0x4
    field public static final int CONFIGURATION_STATE_NOT_CONFIGURED = 1; // 0x1
    field public static final int CONFIGURATION_STATE_OK = 0; // 0x0
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DATA_CHANNEL_STATE = "data_channel_state";
    field public static final int DATA_CHANNEL_STATE_BAD_CONFIGURATION = 3; // 0x3
    field public static final int DATA_CHANNEL_STATE_COMMUNICATION_ERROR = 4; // 0x4
    field public static final int DATA_CHANNEL_STATE_NO_CONNECTION = 1; // 0x1
    field public static final int DATA_CHANNEL_STATE_NO_CONNECTION_CELLULAR_REQUIRED = 2; // 0x2
    field public static final int DATA_CHANNEL_STATE_OK = 0; // 0x0
    field public static final int DATA_CHANNEL_STATE_SERVER_CONNECTION_ERROR = 6; // 0x6
    field public static final int DATA_CHANNEL_STATE_SERVER_ERROR = 5; // 0x5
    field public static final String DIR_TYPE = "vnd.android.cursor.dir/voicemail.source.status";
    field public static final String ITEM_TYPE = "vnd.android.cursor.item/voicemail.source.status";
    field public static final String NOTIFICATION_CHANNEL_STATE = "notification_channel_state";
    field public static final int NOTIFICATION_CHANNEL_STATE_MESSAGE_WAITING = 2; // 0x2
    field public static final int NOTIFICATION_CHANNEL_STATE_NO_CONNECTION = 1; // 0x1
    field public static final int NOTIFICATION_CHANNEL_STATE_OK = 0; // 0x0
    field public static final String PHONE_ACCOUNT_COMPONENT_NAME = "phone_account_component_name";
    field public static final String PHONE_ACCOUNT_ID = "phone_account_id";
    field public static final String QUOTA_OCCUPIED = "quota_occupied";
    field public static final String QUOTA_TOTAL = "quota_total";
    field public static final int QUOTA_UNAVAILABLE = -1; // 0xffffffff
    field public static final String SETTINGS_URI = "settings_uri";
    field public static final String SOURCE_PACKAGE = "source_package";
    field public static final String SOURCE_TYPE = "source_type";
    field public static final String VOICEMAIL_ACCESS_URI = "voicemail_access_uri";
  }

  public static final class VoicemailContract.Voicemails implements android.provider.BaseColumns android.provider.OpenableColumns {
    method public static android.net.Uri buildSourceUri(String);
    field public static final String ARCHIVED = "archived";
    field public static final String BACKED_UP = "backed_up";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String DATE = "date";
    field public static final String DELETED = "deleted";
    field public static final String DIRTY = "dirty";
    field public static final int DIRTY_RETAIN = -1; // 0xffffffff
    field public static final String DIR_TYPE = "vnd.android.cursor.dir/voicemails";
    field public static final String DURATION = "duration";
    field public static final String HAS_CONTENT = "has_content";
    field public static final String IS_OMTP_VOICEMAIL = "is_omtp_voicemail";
    field public static final String IS_READ = "is_read";
    field public static final String ITEM_TYPE = "vnd.android.cursor.item/voicemail";
    field public static final String LAST_MODIFIED = "last_modified";
    field public static final String MIME_TYPE = "mime_type";
    field public static final String NEW = "new";
    field public static final String NUMBER = "number";
    field public static final String PHONE_ACCOUNT_COMPONENT_NAME = "subscription_component_name";
    field public static final String PHONE_ACCOUNT_ID = "subscription_id";
    field public static final String RESTORED = "restored";
    field public static final String SOURCE_DATA = "source_data";
    field public static final String SOURCE_PACKAGE = "source_package";
    field public static final String TRANSCRIPTION = "transcription";
  }

}

package android.renderscript {

  public class Allocation extends android.renderscript.BaseObj {
    method public void copy1DRangeFrom(int, int, Object);
    method public void copy1DRangeFrom(int, int, int[]);
    method public void copy1DRangeFrom(int, int, short[]);
    method public void copy1DRangeFrom(int, int, byte[]);
    method public void copy1DRangeFrom(int, int, float[]);
    method public void copy1DRangeFrom(int, int, android.renderscript.Allocation, int);
    method public void copy1DRangeFromUnchecked(int, int, Object);
    method public void copy1DRangeFromUnchecked(int, int, int[]);
    method public void copy1DRangeFromUnchecked(int, int, short[]);
    method public void copy1DRangeFromUnchecked(int, int, byte[]);
    method public void copy1DRangeFromUnchecked(int, int, float[]);
    method public void copy1DRangeTo(int, int, Object);
    method public void copy1DRangeTo(int, int, int[]);
    method public void copy1DRangeTo(int, int, short[]);
    method public void copy1DRangeTo(int, int, byte[]);
    method public void copy1DRangeTo(int, int, float[]);
    method public void copy1DRangeToUnchecked(int, int, Object);
    method public void copy1DRangeToUnchecked(int, int, int[]);
    method public void copy1DRangeToUnchecked(int, int, short[]);
    method public void copy1DRangeToUnchecked(int, int, byte[]);
    method public void copy1DRangeToUnchecked(int, int, float[]);
    method public void copy2DRangeFrom(int, int, int, int, Object);
    method public void copy2DRangeFrom(int, int, int, int, byte[]);
    method public void copy2DRangeFrom(int, int, int, int, short[]);
    method public void copy2DRangeFrom(int, int, int, int, int[]);
    method public void copy2DRangeFrom(int, int, int, int, float[]);
    method public void copy2DRangeFrom(int, int, int, int, android.renderscript.Allocation, int, int);
    method public void copy2DRangeFrom(int, int, android.graphics.Bitmap);
    method public void copy2DRangeTo(int, int, int, int, Object);
    method public void copy2DRangeTo(int, int, int, int, byte[]);
    method public void copy2DRangeTo(int, int, int, int, short[]);
    method public void copy2DRangeTo(int, int, int, int, int[]);
    method public void copy2DRangeTo(int, int, int, int, float[]);
    method public void copy3DRangeFrom(int, int, int, int, int, int, Object);
    method public void copy3DRangeFrom(int, int, int, int, int, int, android.renderscript.Allocation, int, int, int);
    method public void copy3DRangeTo(int, int, int, int, int, int, Object);
    method public void copyFrom(android.renderscript.BaseObj[]);
    method public void copyFrom(Object);
    method public void copyFrom(int[]);
    method public void copyFrom(short[]);
    method public void copyFrom(byte[]);
    method public void copyFrom(float[]);
    method public void copyFrom(android.graphics.Bitmap);
    method public void copyFrom(android.renderscript.Allocation);
    method public void copyFromUnchecked(Object);
    method public void copyFromUnchecked(int[]);
    method public void copyFromUnchecked(short[]);
    method public void copyFromUnchecked(byte[]);
    method public void copyFromUnchecked(float[]);
    method public void copyTo(android.graphics.Bitmap);
    method public void copyTo(Object);
    method public void copyTo(byte[]);
    method public void copyTo(short[]);
    method public void copyTo(int[]);
    method public void copyTo(float[]);
    method public static android.renderscript.Allocation[] createAllocations(android.renderscript.RenderScript, android.renderscript.Type, int, int);
    method public static android.renderscript.Allocation createCubemapFromBitmap(android.renderscript.RenderScript, android.graphics.Bitmap, android.renderscript.Allocation.MipmapControl, int);
    method public static android.renderscript.Allocation createCubemapFromBitmap(android.renderscript.RenderScript, android.graphics.Bitmap);
    method public static android.renderscript.Allocation createCubemapFromCubeFaces(android.renderscript.RenderScript, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.renderscript.Allocation.MipmapControl, int);
    method public static android.renderscript.Allocation createCubemapFromCubeFaces(android.renderscript.RenderScript, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap);
    method public static android.renderscript.Allocation createFromBitmap(android.renderscript.RenderScript, android.graphics.Bitmap, android.renderscript.Allocation.MipmapControl, int);
    method public static android.renderscript.Allocation createFromBitmap(android.renderscript.RenderScript, android.graphics.Bitmap);
    method public static android.renderscript.Allocation createFromBitmapResource(android.renderscript.RenderScript, android.content.res.Resources, int, android.renderscript.Allocation.MipmapControl, int);
    method public static android.renderscript.Allocation createFromBitmapResource(android.renderscript.RenderScript, android.content.res.Resources, int);
    method public static android.renderscript.Allocation createFromString(android.renderscript.RenderScript, String, int);
    method public static android.renderscript.Allocation createSized(android.renderscript.RenderScript, android.renderscript.Element, int, int);
    method public static android.renderscript.Allocation createSized(android.renderscript.RenderScript, android.renderscript.Element, int);
    method public static android.renderscript.Allocation createTyped(android.renderscript.RenderScript, android.renderscript.Type, android.renderscript.Allocation.MipmapControl, int);
    method public static android.renderscript.Allocation createTyped(android.renderscript.RenderScript, android.renderscript.Type, int);
    method public static android.renderscript.Allocation createTyped(android.renderscript.RenderScript, android.renderscript.Type);
    method public void generateMipmaps();
    method public java.nio.ByteBuffer getByteBuffer();
    method public int getBytesSize();
    method public android.renderscript.Element getElement();
    method public long getStride();
    method public android.view.Surface getSurface();
    method public long getTimeStamp();
    method public android.renderscript.Type getType();
    method public int getUsage();
    method public void ioReceive();
    method public void ioSend();
    method @Deprecated public void resize(int);
    method public void setAutoPadding(boolean);
    method public void setFromFieldPacker(int, android.renderscript.FieldPacker);
    method public void setFromFieldPacker(int, int, android.renderscript.FieldPacker);
    method public void setFromFieldPacker(int, int, int, int, android.renderscript.FieldPacker);
    method public void setOnBufferAvailableListener(android.renderscript.Allocation.OnBufferAvailableListener);
    method public void setSurface(android.view.Surface);
    method public void syncAll(int);
    field public static final int USAGE_GRAPHICS_CONSTANTS = 8; // 0x8
    field public static final int USAGE_GRAPHICS_RENDER_TARGET = 16; // 0x10
    field public static final int USAGE_GRAPHICS_TEXTURE = 2; // 0x2
    field public static final int USAGE_GRAPHICS_VERTEX = 4; // 0x4
    field public static final int USAGE_IO_INPUT = 32; // 0x20
    field public static final int USAGE_IO_OUTPUT = 64; // 0x40
    field public static final int USAGE_SCRIPT = 1; // 0x1
    field public static final int USAGE_SHARED = 128; // 0x80
  }

  public enum Allocation.MipmapControl {
    enum_constant public static final android.renderscript.Allocation.MipmapControl MIPMAP_FULL;
    enum_constant public static final android.renderscript.Allocation.MipmapControl MIPMAP_NONE;
    enum_constant public static final android.renderscript.Allocation.MipmapControl MIPMAP_ON_SYNC_TO_TEXTURE;
  }

  public static interface Allocation.OnBufferAvailableListener {
    method public void onBufferAvailable(android.renderscript.Allocation);
  }

  public class AllocationAdapter extends android.renderscript.Allocation {
    method public static android.renderscript.AllocationAdapter create1D(android.renderscript.RenderScript, android.renderscript.Allocation);
    method public static android.renderscript.AllocationAdapter create2D(android.renderscript.RenderScript, android.renderscript.Allocation);
    method public static android.renderscript.AllocationAdapter createTyped(android.renderscript.RenderScript, android.renderscript.Allocation, android.renderscript.Type);
    method public void resize(int);
    method public void setFace(android.renderscript.Type.CubemapFace);
    method public void setLOD(int);
    method public void setX(int);
    method public void setY(int);
    method public void setZ(int);
  }

  public class BaseObj {
    method public void destroy();
    method public String getName();
    method public void setName(String);
  }

  public class Byte2 {
    ctor public Byte2();
    ctor public Byte2(byte, byte);
    field public byte x;
    field public byte y;
  }

  public class Byte3 {
    ctor public Byte3();
    ctor public Byte3(byte, byte, byte);
    field public byte x;
    field public byte y;
    field public byte z;
  }

  public class Byte4 {
    ctor public Byte4();
    ctor public Byte4(byte, byte, byte, byte);
    field public byte w;
    field public byte x;
    field public byte y;
    field public byte z;
  }

  public class Double2 {
    ctor public Double2();
    ctor public Double2(double, double);
    field public double x;
    field public double y;
  }

  public class Double3 {
    ctor public Double3();
    ctor public Double3(double, double, double);
    field public double x;
    field public double y;
    field public double z;
  }

  public class Double4 {
    ctor public Double4();
    ctor public Double4(double, double, double, double);
    field public double w;
    field public double x;
    field public double y;
    field public double z;
  }

  public class Element extends android.renderscript.BaseObj {
    method public static android.renderscript.Element ALLOCATION(android.renderscript.RenderScript);
    method public static android.renderscript.Element A_8(android.renderscript.RenderScript);
    method public static android.renderscript.Element BOOLEAN(android.renderscript.RenderScript);
    method public static android.renderscript.Element ELEMENT(android.renderscript.RenderScript);
    method public static android.renderscript.Element F16(android.renderscript.RenderScript);
    method public static android.renderscript.Element F16_2(android.renderscript.RenderScript);
    method public static android.renderscript.Element F16_3(android.renderscript.RenderScript);
    method public static android.renderscript.Element F16_4(android.renderscript.RenderScript);
    method public static android.renderscript.Element F32(android.renderscript.RenderScript);
    method public static android.renderscript.Element F32_2(android.renderscript.RenderScript);
    method public static android.renderscript.Element F32_3(android.renderscript.RenderScript);
    method public static android.renderscript.Element F32_4(android.renderscript.RenderScript);
    method public static android.renderscript.Element F64(android.renderscript.RenderScript);
    method public static android.renderscript.Element F64_2(android.renderscript.RenderScript);
    method public static android.renderscript.Element F64_3(android.renderscript.RenderScript);
    method public static android.renderscript.Element F64_4(android.renderscript.RenderScript);
    method public static android.renderscript.Element FONT(android.renderscript.RenderScript);
    method public static android.renderscript.Element I16(android.renderscript.RenderScript);
    method public static android.renderscript.Element I16_2(android.renderscript.RenderScript);
    method public static android.renderscript.Element I16_3(android.renderscript.RenderScript);
    method public static android.renderscript.Element I16_4(android.renderscript.RenderScript);
    method public static android.renderscript.Element I32(android.renderscript.RenderScript);
    method public static android.renderscript.Element I32_2(android.renderscript.RenderScript);
    method public static android.renderscript.Element I32_3(android.renderscript.RenderScript);
    method public static android.renderscript.Element I32_4(android.renderscript.RenderScript);
    method public static android.renderscript.Element I64(android.renderscript.RenderScript);
    method public static android.renderscript.Element I64_2(android.renderscript.RenderScript);
    method public static android.renderscript.Element I64_3(android.renderscript.RenderScript);
    method public static android.renderscript.Element I64_4(android.renderscript.RenderScript);
    method public static android.renderscript.Element I8(android.renderscript.RenderScript);
    method public static android.renderscript.Element I8_2(android.renderscript.RenderScript);
    method public static android.renderscript.Element I8_3(android.renderscript.RenderScript);
    method public static android.renderscript.Element I8_4(android.renderscript.RenderScript);
    method @Deprecated public static android.renderscript.Element MATRIX4X4(android.renderscript.RenderScript);
    method public static android.renderscript.Element MATRIX_2X2(android.renderscript.RenderScript);
    method public static android.renderscript.Element MATRIX_3X3(android.renderscript.RenderScript);
    method public static android.renderscript.Element MATRIX_4X4(android.renderscript.RenderScript);
    method public static android.renderscript.Element MESH(android.renderscript.RenderScript);
    method public static android.renderscript.Element PROGRAM_FRAGMENT(android.renderscript.RenderScript);
    method public static android.renderscript.Element PROGRAM_RASTER(android.renderscript.RenderScript);
    method public static android.renderscript.Element PROGRAM_STORE(android.renderscript.RenderScript);
    method public static android.renderscript.Element PROGRAM_VERTEX(android.renderscript.RenderScript);
    method public static android.renderscript.Element RGBA_4444(android.renderscript.RenderScript);
    method public static android.renderscript.Element RGBA_5551(android.renderscript.RenderScript);
    method public static android.renderscript.Element RGBA_8888(android.renderscript.RenderScript);
    method public static android.renderscript.Element RGB_565(android.renderscript.RenderScript);
    method public static android.renderscript.Element RGB_888(android.renderscript.RenderScript);
    method public static android.renderscript.Element SAMPLER(android.renderscript.RenderScript);
    method public static android.renderscript.Element SCRIPT(android.renderscript.RenderScript);
    method public static android.renderscript.Element TYPE(android.renderscript.RenderScript);
    method public static android.renderscript.Element U16(android.renderscript.RenderScript);
    method public static android.renderscript.Element U16_2(android.renderscript.RenderScript);
    method public static android.renderscript.Element U16_3(android.renderscript.RenderScript);
    method public static android.renderscript.Element U16_4(android.renderscript.RenderScript);
    method public static android.renderscript.Element U32(android.renderscript.RenderScript);
    method public static android.renderscript.Element U32_2(android.renderscript.RenderScript);
    method public static android.renderscript.Element U32_3(android.renderscript.RenderScript);
    method public static android.renderscript.Element U32_4(android.renderscript.RenderScript);
    method public static android.renderscript.Element U64(android.renderscript.RenderScript);
    method public static android.renderscript.Element U64_2(android.renderscript.RenderScript);
    method public static android.renderscript.Element U64_3(android.renderscript.RenderScript);
    method public static android.renderscript.Element U64_4(android.renderscript.RenderScript);
    method public static android.renderscript.Element U8(android.renderscript.RenderScript);
    method public static android.renderscript.Element U8_2(android.renderscript.RenderScript);
    method public static android.renderscript.Element U8_3(android.renderscript.RenderScript);
    method public static android.renderscript.Element U8_4(android.renderscript.RenderScript);
    method public static android.renderscript.Element YUV(android.renderscript.RenderScript);
    method public static android.renderscript.Element createPixel(android.renderscript.RenderScript, android.renderscript.Element.DataType, android.renderscript.Element.DataKind);
    method public static android.renderscript.Element createVector(android.renderscript.RenderScript, android.renderscript.Element.DataType, int);
    method public int getBytesSize();
    method public android.renderscript.Element.DataKind getDataKind();
    method public android.renderscript.Element.DataType getDataType();
    method public android.renderscript.Element getSubElement(int);
    method public int getSubElementArraySize(int);
    method public int getSubElementCount();
    method public String getSubElementName(int);
    method public int getSubElementOffsetBytes(int);
    method public int getVectorSize();
    method public boolean isCompatible(android.renderscript.Element);
    method public boolean isComplex();
  }

  public static class Element.Builder {
    ctor public Element.Builder(android.renderscript.RenderScript);
    method public android.renderscript.Element.Builder add(android.renderscript.Element, String, int);
    method public android.renderscript.Element.Builder add(android.renderscript.Element, String);
    method public android.renderscript.Element create();
  }

  public enum Element.DataKind {
    enum_constant public static final android.renderscript.Element.DataKind PIXEL_A;
    enum_constant public static final android.renderscript.Element.DataKind PIXEL_DEPTH;
    enum_constant public static final android.renderscript.Element.DataKind PIXEL_L;
    enum_constant public static final android.renderscript.Element.DataKind PIXEL_LA;
    enum_constant public static final android.renderscript.Element.DataKind PIXEL_RGB;
    enum_constant public static final android.renderscript.Element.DataKind PIXEL_RGBA;
    enum_constant public static final android.renderscript.Element.DataKind PIXEL_YUV;
    enum_constant public static final android.renderscript.Element.DataKind USER;
  }

  public enum Element.DataType {
    enum_constant public static final android.renderscript.Element.DataType BOOLEAN;
    enum_constant public static final android.renderscript.Element.DataType FLOAT_16;
    enum_constant public static final android.renderscript.Element.DataType FLOAT_32;
    enum_constant public static final android.renderscript.Element.DataType FLOAT_64;
    enum_constant public static final android.renderscript.Element.DataType MATRIX_2X2;
    enum_constant public static final android.renderscript.Element.DataType MATRIX_3X3;
    enum_constant public static final android.renderscript.Element.DataType MATRIX_4X4;
    enum_constant public static final android.renderscript.Element.DataType NONE;
    enum_constant public static final android.renderscript.Element.DataType RS_ALLOCATION;
    enum_constant public static final android.renderscript.Element.DataType RS_ELEMENT;
    enum_constant public static final android.renderscript.Element.DataType RS_FONT;
    enum_constant public static final android.renderscript.Element.DataType RS_MESH;
    enum_constant public static final android.renderscript.Element.DataType RS_PROGRAM_FRAGMENT;
    enum_constant public static final android.renderscript.Element.DataType RS_PROGRAM_RASTER;
    enum_constant public static final android.renderscript.Element.DataType RS_PROGRAM_STORE;
    enum_constant public static final android.renderscript.Element.DataType RS_PROGRAM_VERTEX;
    enum_constant public static final android.renderscript.Element.DataType RS_SAMPLER;
    enum_constant public static final android.renderscript.Element.DataType RS_SCRIPT;
    enum_constant public static final android.renderscript.Element.DataType RS_TYPE;
    enum_constant public static final android.renderscript.Element.DataType SIGNED_16;
    enum_constant public static final android.renderscript.Element.DataType SIGNED_32;
    enum_constant public static final android.renderscript.Element.DataType SIGNED_64;
    enum_constant public static final android.renderscript.Element.DataType SIGNED_8;
    enum_constant public static final android.renderscript.Element.DataType UNSIGNED_16;
    enum_constant public static final android.renderscript.Element.DataType UNSIGNED_32;
    enum_constant public static final android.renderscript.Element.DataType UNSIGNED_4_4_4_4;
    enum_constant public static final android.renderscript.Element.DataType UNSIGNED_5_5_5_1;
    enum_constant public static final android.renderscript.Element.DataType UNSIGNED_5_6_5;
    enum_constant public static final android.renderscript.Element.DataType UNSIGNED_64;
    enum_constant public static final android.renderscript.Element.DataType UNSIGNED_8;
  }

  public class FieldPacker {
    ctor public FieldPacker(int);
    ctor public FieldPacker(byte[]);
    method public void addBoolean(boolean);
    method public void addF32(float);
    method public void addF32(android.renderscript.Float2);
    method public void addF32(android.renderscript.Float3);
    method public void addF32(android.renderscript.Float4);
    method public void addF64(double);
    method public void addF64(android.renderscript.Double2);
    method public void addF64(android.renderscript.Double3);
    method public void addF64(android.renderscript.Double4);
    method public void addI16(short);
    method public void addI16(android.renderscript.Short2);
    method public void addI16(android.renderscript.Short3);
    method public void addI16(android.renderscript.Short4);
    method public void addI32(int);
    method public void addI32(android.renderscript.Int2);
    method public void addI32(android.renderscript.Int3);
    method public void addI32(android.renderscript.Int4);
    method public void addI64(long);
    method public void addI64(android.renderscript.Long2);
    method public void addI64(android.renderscript.Long3);
    method public void addI64(android.renderscript.Long4);
    method public void addI8(byte);
    method public void addI8(android.renderscript.Byte2);
    method public void addI8(android.renderscript.Byte3);
    method public void addI8(android.renderscript.Byte4);
    method public void addMatrix(android.renderscript.Matrix4f);
    method public void addMatrix(android.renderscript.Matrix3f);
    method public void addMatrix(android.renderscript.Matrix2f);
    method public void addObj(android.renderscript.BaseObj);
    method public void addU16(int);
    method public void addU16(android.renderscript.Int2);
    method public void addU16(android.renderscript.Int3);
    method public void addU16(android.renderscript.Int4);
    method public void addU32(long);
    method public void addU32(android.renderscript.Long2);
    method public void addU32(android.renderscript.Long3);
    method public void addU32(android.renderscript.Long4);
    method public void addU64(long);
    method public void addU64(android.renderscript.Long2);
    method public void addU64(android.renderscript.Long3);
    method public void addU64(android.renderscript.Long4);
    method public void addU8(short);
    method public void addU8(android.renderscript.Short2);
    method public void addU8(android.renderscript.Short3);
    method public void addU8(android.renderscript.Short4);
    method public void align(int);
    method public final byte[] getData();
    method public void reset();
    method public void reset(int);
    method public void skip(int);
    method public boolean subBoolean();
    method public android.renderscript.Byte2 subByte2();
    method public android.renderscript.Byte3 subByte3();
    method public android.renderscript.Byte4 subByte4();
    method public android.renderscript.Double2 subDouble2();
    method public android.renderscript.Double3 subDouble3();
    method public android.renderscript.Double4 subDouble4();
    method public float subF32();
    method public double subF64();
    method public android.renderscript.Float2 subFloat2();
    method public android.renderscript.Float3 subFloat3();
    method public android.renderscript.Float4 subFloat4();
    method public short subI16();
    method public int subI32();
    method public long subI64();
    method public byte subI8();
    method public android.renderscript.Int2 subInt2();
    method public android.renderscript.Int3 subInt3();
    method public android.renderscript.Int4 subInt4();
    method public android.renderscript.Long2 subLong2();
    method public android.renderscript.Long3 subLong3();
    method public android.renderscript.Long4 subLong4();
    method public android.renderscript.Matrix2f subMatrix2f();
    method public android.renderscript.Matrix3f subMatrix3f();
    method public android.renderscript.Matrix4f subMatrix4f();
    method public android.renderscript.Short2 subShort2();
    method public android.renderscript.Short3 subShort3();
    method public android.renderscript.Short4 subShort4();
    method public void subalign(int);
  }

  public class Float2 {
    ctor public Float2();
    ctor public Float2(float, float);
    field public float x;
    field public float y;
  }

  public class Float3 {
    ctor public Float3();
    ctor public Float3(float, float, float);
    field public float x;
    field public float y;
    field public float z;
  }

  public class Float4 {
    ctor public Float4();
    ctor public Float4(float, float, float, float);
    field public float w;
    field public float x;
    field public float y;
    field public float z;
  }

  public class Int2 {
    ctor public Int2();
    ctor public Int2(int, int);
    field public int x;
    field public int y;
  }

  public class Int3 {
    ctor public Int3();
    ctor public Int3(int, int, int);
    field public int x;
    field public int y;
    field public int z;
  }

  public class Int4 {
    ctor public Int4();
    ctor public Int4(int, int, int, int);
    field public int w;
    field public int x;
    field public int y;
    field public int z;
  }

  public class Long2 {
    ctor public Long2();
    ctor public Long2(long, long);
    field public long x;
    field public long y;
  }

  public class Long3 {
    ctor public Long3();
    ctor public Long3(long, long, long);
    field public long x;
    field public long y;
    field public long z;
  }

  public class Long4 {
    ctor public Long4();
    ctor public Long4(long, long, long, long);
    field public long w;
    field public long x;
    field public long y;
    field public long z;
  }

  public class Matrix2f {
    ctor public Matrix2f();
    ctor public Matrix2f(float[]);
    method public float get(int, int);
    method public float[] getArray();
    method public void load(android.renderscript.Matrix2f);
    method public void loadIdentity();
    method public void loadMultiply(android.renderscript.Matrix2f, android.renderscript.Matrix2f);
    method public void loadRotate(float);
    method public void loadScale(float, float);
    method public void multiply(android.renderscript.Matrix2f);
    method public void rotate(float);
    method public void scale(float, float);
    method public void set(int, int, float);
    method public void transpose();
  }

  public class Matrix3f {
    ctor public Matrix3f();
    ctor public Matrix3f(float[]);
    method public float get(int, int);
    method public float[] getArray();
    method public void load(android.renderscript.Matrix3f);
    method public void loadIdentity();
    method public void loadMultiply(android.renderscript.Matrix3f, android.renderscript.Matrix3f);
    method public void loadRotate(float, float, float, float);
    method public void loadRotate(float);
    method public void loadScale(float, float);
    method public void loadScale(float, float, float);
    method public void loadTranslate(float, float);
    method public void multiply(android.renderscript.Matrix3f);
    method public void rotate(float, float, float, float);
    method public void rotate(float);
    method public void scale(float, float);
    method public void scale(float, float, float);
    method public void set(int, int, float);
    method public void translate(float, float);
    method public void transpose();
  }

  public class Matrix4f {
    ctor public Matrix4f();
    ctor public Matrix4f(float[]);
    method public float get(int, int);
    method public float[] getArray();
    method public boolean inverse();
    method public boolean inverseTranspose();
    method public void load(android.renderscript.Matrix4f);
    method public void loadFrustum(float, float, float, float, float, float);
    method public void loadIdentity();
    method public void loadMultiply(android.renderscript.Matrix4f, android.renderscript.Matrix4f);
    method public void loadOrtho(float, float, float, float, float, float);
    method public void loadOrthoWindow(int, int);
    method public void loadPerspective(float, float, float, float);
    method public void loadProjectionNormalized(int, int);
    method public void loadRotate(float, float, float, float);
    method public void loadScale(float, float, float);
    method public void loadTranslate(float, float, float);
    method public void multiply(android.renderscript.Matrix4f);
    method public void rotate(float, float, float, float);
    method public void scale(float, float, float);
    method public void set(int, int, float);
    method public void translate(float, float, float);
    method public void transpose();
  }

  public class RSDriverException extends android.renderscript.RSRuntimeException {
    ctor public RSDriverException(String);
  }

  public class RSIllegalArgumentException extends android.renderscript.RSRuntimeException {
    ctor public RSIllegalArgumentException(String);
  }

  public class RSInvalidStateException extends android.renderscript.RSRuntimeException {
    ctor public RSInvalidStateException(String);
  }

  public class RSRuntimeException extends java.lang.RuntimeException {
    ctor public RSRuntimeException(String);
  }

  public class RenderScript {
    method public void contextDump();
    method public static android.renderscript.RenderScript create(android.content.Context);
    method public static android.renderscript.RenderScript create(android.content.Context, android.renderscript.RenderScript.ContextType);
    method public static android.renderscript.RenderScript create(android.content.Context, android.renderscript.RenderScript.ContextType, int);
    method public static android.renderscript.RenderScript createMultiContext(android.content.Context, android.renderscript.RenderScript.ContextType, int, int);
    method public void destroy();
    method public void finish();
    method public final android.content.Context getApplicationContext();
    method public android.renderscript.RenderScript.RSErrorHandler getErrorHandler();
    method public android.renderscript.RenderScript.RSMessageHandler getMessageHandler();
    method public static long getMinorVersion();
    method public static void releaseAllContexts();
    method public void sendMessage(int, int[]);
    method public void setErrorHandler(android.renderscript.RenderScript.RSErrorHandler);
    method public void setMessageHandler(android.renderscript.RenderScript.RSMessageHandler);
    method public void setPriority(android.renderscript.RenderScript.Priority);
    field public static final int CREATE_FLAG_LOW_LATENCY = 2; // 0x2
    field public static final int CREATE_FLAG_LOW_POWER = 4; // 0x4
    field public static final int CREATE_FLAG_NONE = 0; // 0x0
  }

  public enum RenderScript.ContextType {
    enum_constant public static final android.renderscript.RenderScript.ContextType DEBUG;
    enum_constant public static final android.renderscript.RenderScript.ContextType NORMAL;
    enum_constant public static final android.renderscript.RenderScript.ContextType PROFILE;
  }

  public enum RenderScript.Priority {
    enum_constant public static final android.renderscript.RenderScript.Priority LOW;
    enum_constant public static final android.renderscript.RenderScript.Priority NORMAL;
  }

  public static class RenderScript.RSErrorHandler implements java.lang.Runnable {
    ctor public RenderScript.RSErrorHandler();
    method public void run();
    field protected String mErrorMessage;
    field protected int mErrorNum;
  }

  public static class RenderScript.RSMessageHandler implements java.lang.Runnable {
    ctor public RenderScript.RSMessageHandler();
    method public void run();
    field protected int[] mData;
    field protected int mID;
    field protected int mLength;
  }

  public class Sampler extends android.renderscript.BaseObj {
    method public static android.renderscript.Sampler CLAMP_LINEAR(android.renderscript.RenderScript);
    method public static android.renderscript.Sampler CLAMP_LINEAR_MIP_LINEAR(android.renderscript.RenderScript);
    method public static android.renderscript.Sampler CLAMP_NEAREST(android.renderscript.RenderScript);
    method public static android.renderscript.Sampler MIRRORED_REPEAT_LINEAR(android.renderscript.RenderScript);
    method public static android.renderscript.Sampler MIRRORED_REPEAT_LINEAR_MIP_LINEAR(android.renderscript.RenderScript);
    method public static android.renderscript.Sampler MIRRORED_REPEAT_NEAREST(android.renderscript.RenderScript);
    method public static android.renderscript.Sampler WRAP_LINEAR(android.renderscript.RenderScript);
    method public static android.renderscript.Sampler WRAP_LINEAR_MIP_LINEAR(android.renderscript.RenderScript);
    method public static android.renderscript.Sampler WRAP_NEAREST(android.renderscript.RenderScript);
    method public float getAnisotropy();
    method public android.renderscript.Sampler.Value getMagnification();
    method public android.renderscript.Sampler.Value getMinification();
    method public android.renderscript.Sampler.Value getWrapS();
    method public android.renderscript.Sampler.Value getWrapT();
  }

  public static class Sampler.Builder {
    ctor public Sampler.Builder(android.renderscript.RenderScript);
    method public android.renderscript.Sampler create();
    method public void setAnisotropy(float);
    method public void setMagnification(android.renderscript.Sampler.Value);
    method public void setMinification(android.renderscript.Sampler.Value);
    method public void setWrapS(android.renderscript.Sampler.Value);
    method public void setWrapT(android.renderscript.Sampler.Value);
  }

  public enum Sampler.Value {
    enum_constant public static final android.renderscript.Sampler.Value CLAMP;
    enum_constant public static final android.renderscript.Sampler.Value LINEAR;
    enum_constant public static final android.renderscript.Sampler.Value LINEAR_MIP_LINEAR;
    enum_constant public static final android.renderscript.Sampler.Value LINEAR_MIP_NEAREST;
    enum_constant public static final android.renderscript.Sampler.Value MIRRORED_REPEAT;
    enum_constant public static final android.renderscript.Sampler.Value NEAREST;
    enum_constant public static final android.renderscript.Sampler.Value WRAP;
  }

  public class Script extends android.renderscript.BaseObj {
    method public void bindAllocation(android.renderscript.Allocation, int);
    method protected android.renderscript.Script.FieldID createFieldID(int, android.renderscript.Element);
    method protected android.renderscript.Script.InvokeID createInvokeID(int);
    method protected android.renderscript.Script.KernelID createKernelID(int, int, android.renderscript.Element, android.renderscript.Element);
    method protected void forEach(int, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.FieldPacker);
    method protected void forEach(int, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.FieldPacker, android.renderscript.Script.LaunchOptions);
    method protected void forEach(int, android.renderscript.Allocation[], android.renderscript.Allocation, android.renderscript.FieldPacker);
    method protected void forEach(int, android.renderscript.Allocation[], android.renderscript.Allocation, android.renderscript.FieldPacker, android.renderscript.Script.LaunchOptions);
    method public boolean getVarB(int);
    method public double getVarD(int);
    method public float getVarF(int);
    method public int getVarI(int);
    method public long getVarJ(int);
    method public void getVarV(int, android.renderscript.FieldPacker);
    method protected void invoke(int);
    method protected void invoke(int, android.renderscript.FieldPacker);
    method protected void reduce(int, android.renderscript.Allocation[], android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void setTimeZone(String);
    method public void setVar(int, float);
    method public void setVar(int, double);
    method public void setVar(int, int);
    method public void setVar(int, long);
    method public void setVar(int, boolean);
    method public void setVar(int, android.renderscript.BaseObj);
    method public void setVar(int, android.renderscript.FieldPacker);
    method public void setVar(int, android.renderscript.FieldPacker, android.renderscript.Element, int[]);
  }

  public static class Script.Builder {
  }

  public static class Script.FieldBase {
    ctor protected Script.FieldBase();
    method public android.renderscript.Allocation getAllocation();
    method public android.renderscript.Element getElement();
    method public android.renderscript.Type getType();
    method protected void init(android.renderscript.RenderScript, int);
    method protected void init(android.renderscript.RenderScript, int, int);
    method public void updateAllocation();
    field protected android.renderscript.Allocation mAllocation;
    field protected android.renderscript.Element mElement;
  }

  public static final class Script.FieldID extends android.renderscript.BaseObj {
  }

  public static final class Script.InvokeID extends android.renderscript.BaseObj {
  }

  public static final class Script.KernelID extends android.renderscript.BaseObj {
  }

  public static final class Script.LaunchOptions {
    ctor public Script.LaunchOptions();
    method public int getXEnd();
    method public int getXStart();
    method public int getYEnd();
    method public int getYStart();
    method public int getZEnd();
    method public int getZStart();
    method public android.renderscript.Script.LaunchOptions setX(int, int);
    method public android.renderscript.Script.LaunchOptions setY(int, int);
    method public android.renderscript.Script.LaunchOptions setZ(int, int);
  }

  public class ScriptC extends android.renderscript.Script {
    ctor protected ScriptC(int, android.renderscript.RenderScript);
    ctor protected ScriptC(long, android.renderscript.RenderScript);
    ctor protected ScriptC(android.renderscript.RenderScript, android.content.res.Resources, int);
    ctor protected ScriptC(android.renderscript.RenderScript, String, byte[], byte[]);
  }

  public final class ScriptGroup extends android.renderscript.BaseObj {
    method public Object[] execute(java.lang.Object...);
    method @Deprecated public void execute();
    method @Deprecated public void setInput(android.renderscript.Script.KernelID, android.renderscript.Allocation);
    method @Deprecated public void setOutput(android.renderscript.Script.KernelID, android.renderscript.Allocation);
  }

  public static final class ScriptGroup.Binding {
    ctor public ScriptGroup.Binding(android.renderscript.Script.FieldID, Object);
  }

  @Deprecated public static final class ScriptGroup.Builder {
    ctor @Deprecated public ScriptGroup.Builder(android.renderscript.RenderScript);
    method @Deprecated public android.renderscript.ScriptGroup.Builder addConnection(android.renderscript.Type, android.renderscript.Script.KernelID, android.renderscript.Script.FieldID);
    method @Deprecated public android.renderscript.ScriptGroup.Builder addConnection(android.renderscript.Type, android.renderscript.Script.KernelID, android.renderscript.Script.KernelID);
    method @Deprecated public android.renderscript.ScriptGroup.Builder addKernel(android.renderscript.Script.KernelID);
    method @Deprecated public android.renderscript.ScriptGroup create();
  }

  public static final class ScriptGroup.Builder2 {
    ctor public ScriptGroup.Builder2(android.renderscript.RenderScript);
    method public android.renderscript.ScriptGroup.Input addInput();
    method public android.renderscript.ScriptGroup.Closure addInvoke(android.renderscript.Script.InvokeID, java.lang.Object...);
    method public android.renderscript.ScriptGroup.Closure addKernel(android.renderscript.Script.KernelID, android.renderscript.Type, java.lang.Object...);
    method public android.renderscript.ScriptGroup create(String, android.renderscript.ScriptGroup.Future...);
  }

  public static final class ScriptGroup.Closure extends android.renderscript.BaseObj {
    method public android.renderscript.ScriptGroup.Future getGlobal(android.renderscript.Script.FieldID);
    method public android.renderscript.ScriptGroup.Future getReturn();
  }

  public static final class ScriptGroup.Future {
  }

  public static final class ScriptGroup.Input {
  }

  public abstract class ScriptIntrinsic extends android.renderscript.Script {
  }

  public final class ScriptIntrinsic3DLUT extends android.renderscript.ScriptIntrinsic {
    method public static android.renderscript.ScriptIntrinsic3DLUT create(android.renderscript.RenderScript, android.renderscript.Element);
    method public void forEach(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEach(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public android.renderscript.Script.KernelID getKernelID();
    method public void setLUT(android.renderscript.Allocation);
  }

  public final class ScriptIntrinsicBLAS extends android.renderscript.ScriptIntrinsic {
    method public void BNNM(android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation, int, int);
    method public void CGBMV(int, int, int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Allocation, int, android.renderscript.Float2, android.renderscript.Allocation, int);
    method public void CGEMM(int, int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Float2, android.renderscript.Allocation);
    method public void CGEMV(int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Allocation, int, android.renderscript.Float2, android.renderscript.Allocation, int);
    method public void CGERC(android.renderscript.Float2, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void CGERU(android.renderscript.Float2, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void CHBMV(int, int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Allocation, int, android.renderscript.Float2, android.renderscript.Allocation, int);
    method public void CHEMM(int, int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Float2, android.renderscript.Allocation);
    method public void CHEMV(int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Allocation, int, android.renderscript.Float2, android.renderscript.Allocation, int);
    method public void CHER(int, float, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void CHER2(int, android.renderscript.Float2, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void CHER2K(int, int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Allocation, float, android.renderscript.Allocation);
    method public void CHERK(int, int, float, android.renderscript.Allocation, float, android.renderscript.Allocation);
    method public void CHPMV(int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Allocation, int, android.renderscript.Float2, android.renderscript.Allocation, int);
    method public void CHPR(int, float, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void CHPR2(int, android.renderscript.Float2, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void CSYMM(int, int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Float2, android.renderscript.Allocation);
    method public void CSYR2K(int, int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Float2, android.renderscript.Allocation);
    method public void CSYRK(int, int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Float2, android.renderscript.Allocation);
    method public void CTBMV(int, int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void CTBSV(int, int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void CTPMV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void CTPSV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void CTRMM(int, int, int, int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Allocation);
    method public void CTRMV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void CTRSM(int, int, int, int, android.renderscript.Float2, android.renderscript.Allocation, android.renderscript.Allocation);
    method public void CTRSV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void DGBMV(int, int, int, double, android.renderscript.Allocation, android.renderscript.Allocation, int, double, android.renderscript.Allocation, int);
    method public void DGEMM(int, int, double, android.renderscript.Allocation, android.renderscript.Allocation, double, android.renderscript.Allocation);
    method public void DGEMV(int, double, android.renderscript.Allocation, android.renderscript.Allocation, int, double, android.renderscript.Allocation, int);
    method public void DGER(double, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void DSBMV(int, int, double, android.renderscript.Allocation, android.renderscript.Allocation, int, double, android.renderscript.Allocation, int);
    method public void DSPMV(int, double, android.renderscript.Allocation, android.renderscript.Allocation, int, double, android.renderscript.Allocation, int);
    method public void DSPR(int, double, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void DSPR2(int, double, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void DSYMM(int, int, double, android.renderscript.Allocation, android.renderscript.Allocation, double, android.renderscript.Allocation);
    method public void DSYMV(int, double, android.renderscript.Allocation, android.renderscript.Allocation, int, double, android.renderscript.Allocation, int);
    method public void DSYR(int, double, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void DSYR2(int, double, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void DSYR2K(int, int, double, android.renderscript.Allocation, android.renderscript.Allocation, double, android.renderscript.Allocation);
    method public void DSYRK(int, int, double, android.renderscript.Allocation, double, android.renderscript.Allocation);
    method public void DTBMV(int, int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void DTBSV(int, int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void DTPMV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void DTPSV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void DTRMM(int, int, int, int, double, android.renderscript.Allocation, android.renderscript.Allocation);
    method public void DTRMV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void DTRSM(int, int, int, int, double, android.renderscript.Allocation, android.renderscript.Allocation);
    method public void DTRSV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void SGBMV(int, int, int, float, android.renderscript.Allocation, android.renderscript.Allocation, int, float, android.renderscript.Allocation, int);
    method public void SGEMM(int, int, float, android.renderscript.Allocation, android.renderscript.Allocation, float, android.renderscript.Allocation);
    method public void SGEMV(int, float, android.renderscript.Allocation, android.renderscript.Allocation, int, float, android.renderscript.Allocation, int);
    method public void SGER(float, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void SSBMV(int, int, float, android.renderscript.Allocation, android.renderscript.Allocation, int, float, android.renderscript.Allocation, int);
    method public void SSPMV(int, float, android.renderscript.Allocation, android.renderscript.Allocation, int, float, android.renderscript.Allocation, int);
    method public void SSPR(int, float, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void SSPR2(int, float, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void SSYMM(int, int, float, android.renderscript.Allocation, android.renderscript.Allocation, float, android.renderscript.Allocation);
    method public void SSYMV(int, float, android.renderscript.Allocation, android.renderscript.Allocation, int, float, android.renderscript.Allocation, int);
    method public void SSYR(int, float, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void SSYR2(int, float, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void SSYR2K(int, int, float, android.renderscript.Allocation, android.renderscript.Allocation, float, android.renderscript.Allocation);
    method public void SSYRK(int, int, float, android.renderscript.Allocation, float, android.renderscript.Allocation);
    method public void STBMV(int, int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void STBSV(int, int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void STPMV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void STPSV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void STRMM(int, int, int, int, float, android.renderscript.Allocation, android.renderscript.Allocation);
    method public void STRMV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void STRSM(int, int, int, int, float, android.renderscript.Allocation, android.renderscript.Allocation);
    method public void STRSV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void ZGBMV(int, int, int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Allocation, int, android.renderscript.Double2, android.renderscript.Allocation, int);
    method public void ZGEMM(int, int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Double2, android.renderscript.Allocation);
    method public void ZGEMV(int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Allocation, int, android.renderscript.Double2, android.renderscript.Allocation, int);
    method public void ZGERC(android.renderscript.Double2, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void ZGERU(android.renderscript.Double2, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void ZHBMV(int, int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Allocation, int, android.renderscript.Double2, android.renderscript.Allocation, int);
    method public void ZHEMM(int, int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Double2, android.renderscript.Allocation);
    method public void ZHEMV(int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Allocation, int, android.renderscript.Double2, android.renderscript.Allocation, int);
    method public void ZHER(int, double, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void ZHER2(int, android.renderscript.Double2, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void ZHER2K(int, int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Allocation, double, android.renderscript.Allocation);
    method public void ZHERK(int, int, double, android.renderscript.Allocation, double, android.renderscript.Allocation);
    method public void ZHPMV(int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Allocation, int, android.renderscript.Double2, android.renderscript.Allocation, int);
    method public void ZHPR(int, double, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void ZHPR2(int, android.renderscript.Double2, android.renderscript.Allocation, int, android.renderscript.Allocation, int, android.renderscript.Allocation);
    method public void ZSYMM(int, int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Double2, android.renderscript.Allocation);
    method public void ZSYR2K(int, int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Double2, android.renderscript.Allocation);
    method public void ZSYRK(int, int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Double2, android.renderscript.Allocation);
    method public void ZTBMV(int, int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void ZTBSV(int, int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void ZTPMV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void ZTPSV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void ZTRMM(int, int, int, int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Allocation);
    method public void ZTRMV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public void ZTRSM(int, int, int, int, android.renderscript.Double2, android.renderscript.Allocation, android.renderscript.Allocation);
    method public void ZTRSV(int, int, int, android.renderscript.Allocation, android.renderscript.Allocation, int);
    method public static android.renderscript.ScriptIntrinsicBLAS create(android.renderscript.RenderScript);
    field public static final int CONJ_TRANSPOSE = 113; // 0x71
    field public static final int LEFT = 141; // 0x8d
    field public static final int LOWER = 122; // 0x7a
    field public static final int NON_UNIT = 131; // 0x83
    field public static final int NO_TRANSPOSE = 111; // 0x6f
    field public static final int RIGHT = 142; // 0x8e
    field public static final int TRANSPOSE = 112; // 0x70
    field public static final int UNIT = 132; // 0x84
    field public static final int UPPER = 121; // 0x79
  }

  public class ScriptIntrinsicBlend extends android.renderscript.ScriptIntrinsic {
    method public static android.renderscript.ScriptIntrinsicBlend create(android.renderscript.RenderScript, android.renderscript.Element);
    method public void forEachAdd(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachAdd(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachClear(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachClear(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachDst(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachDst(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachDstAtop(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachDstAtop(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachDstIn(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachDstIn(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachDstOut(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachDstOut(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachDstOver(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachDstOver(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachMultiply(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachMultiply(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachSrc(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachSrc(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachSrcAtop(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachSrcAtop(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachSrcIn(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachSrcIn(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachSrcOut(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachSrcOut(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachSrcOver(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachSrcOver(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachSubtract(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachSubtract(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEachXor(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEachXor(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public android.renderscript.Script.KernelID getKernelIDAdd();
    method public android.renderscript.Script.KernelID getKernelIDClear();
    method public android.renderscript.Script.KernelID getKernelIDDst();
    method public android.renderscript.Script.KernelID getKernelIDDstAtop();
    method public android.renderscript.Script.KernelID getKernelIDDstIn();
    method public android.renderscript.Script.KernelID getKernelIDDstOut();
    method public android.renderscript.Script.KernelID getKernelIDDstOver();
    method public android.renderscript.Script.KernelID getKernelIDMultiply();
    method public android.renderscript.Script.KernelID getKernelIDSrc();
    method public android.renderscript.Script.KernelID getKernelIDSrcAtop();
    method public android.renderscript.Script.KernelID getKernelIDSrcIn();
    method public android.renderscript.Script.KernelID getKernelIDSrcOut();
    method public android.renderscript.Script.KernelID getKernelIDSrcOver();
    method public android.renderscript.Script.KernelID getKernelIDSubtract();
    method public android.renderscript.Script.KernelID getKernelIDXor();
  }

  public final class ScriptIntrinsicBlur extends android.renderscript.ScriptIntrinsic {
    method public static android.renderscript.ScriptIntrinsicBlur create(android.renderscript.RenderScript, android.renderscript.Element);
    method public void forEach(android.renderscript.Allocation);
    method public void forEach(android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public android.renderscript.Script.FieldID getFieldID_Input();
    method public android.renderscript.Script.KernelID getKernelID();
    method public void setInput(android.renderscript.Allocation);
    method public void setRadius(float);
  }

  public final class ScriptIntrinsicColorMatrix extends android.renderscript.ScriptIntrinsic {
    method @Deprecated public static android.renderscript.ScriptIntrinsicColorMatrix create(android.renderscript.RenderScript, android.renderscript.Element);
    method public static android.renderscript.ScriptIntrinsicColorMatrix create(android.renderscript.RenderScript);
    method public void forEach(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEach(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public android.renderscript.Script.KernelID getKernelID();
    method public void setAdd(android.renderscript.Float4);
    method public void setAdd(float, float, float, float);
    method public void setColorMatrix(android.renderscript.Matrix4f);
    method public void setColorMatrix(android.renderscript.Matrix3f);
    method public void setGreyscale();
    method public void setRGBtoYUV();
    method public void setYUVtoRGB();
  }

  public final class ScriptIntrinsicConvolve3x3 extends android.renderscript.ScriptIntrinsic {
    method public static android.renderscript.ScriptIntrinsicConvolve3x3 create(android.renderscript.RenderScript, android.renderscript.Element);
    method public void forEach(android.renderscript.Allocation);
    method public void forEach(android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public android.renderscript.Script.FieldID getFieldID_Input();
    method public android.renderscript.Script.KernelID getKernelID();
    method public void setCoefficients(float[]);
    method public void setInput(android.renderscript.Allocation);
  }

  public final class ScriptIntrinsicConvolve5x5 extends android.renderscript.ScriptIntrinsic {
    method public static android.renderscript.ScriptIntrinsicConvolve5x5 create(android.renderscript.RenderScript, android.renderscript.Element);
    method public void forEach(android.renderscript.Allocation);
    method public void forEach(android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public android.renderscript.Script.FieldID getFieldID_Input();
    method public android.renderscript.Script.KernelID getKernelID();
    method public void setCoefficients(float[]);
    method public void setInput(android.renderscript.Allocation);
  }

  public final class ScriptIntrinsicHistogram extends android.renderscript.ScriptIntrinsic {
    method public static android.renderscript.ScriptIntrinsicHistogram create(android.renderscript.RenderScript, android.renderscript.Element);
    method public void forEach(android.renderscript.Allocation);
    method public void forEach(android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public void forEach_Dot(android.renderscript.Allocation);
    method public void forEach_Dot(android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public android.renderscript.Script.FieldID getFieldID_Input();
    method public android.renderscript.Script.KernelID getKernelID_Separate();
    method public void setDotCoefficients(float, float, float, float);
    method public void setOutput(android.renderscript.Allocation);
  }

  public final class ScriptIntrinsicLUT extends android.renderscript.ScriptIntrinsic {
    method public static android.renderscript.ScriptIntrinsicLUT create(android.renderscript.RenderScript, android.renderscript.Element);
    method public void forEach(android.renderscript.Allocation, android.renderscript.Allocation);
    method public void forEach(android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public android.renderscript.Script.KernelID getKernelID();
    method public void setAlpha(int, int);
    method public void setBlue(int, int);
    method public void setGreen(int, int);
    method public void setRed(int, int);
  }

  public final class ScriptIntrinsicResize extends android.renderscript.ScriptIntrinsic {
    method public static android.renderscript.ScriptIntrinsicResize create(android.renderscript.RenderScript);
    method public void forEach_bicubic(android.renderscript.Allocation);
    method public void forEach_bicubic(android.renderscript.Allocation, android.renderscript.Script.LaunchOptions);
    method public android.renderscript.Script.FieldID getFieldID_Input();
    method public android.renderscript.Script.KernelID getKernelID_bicubic();
    method public void setInput(android.renderscript.Allocation);
  }

  public final class ScriptIntrinsicYuvToRGB extends android.renderscript.ScriptIntrinsic {
    method public static android.renderscript.ScriptIntrinsicYuvToRGB create(android.renderscript.RenderScript, android.renderscript.Element);
    method public void forEach(android.renderscript.Allocation);
    method public android.renderscript.Script.FieldID getFieldID_Input();
    method public android.renderscript.Script.KernelID getKernelID();
    method public void setInput(android.renderscript.Allocation);
  }

  public class Short2 {
    ctor public Short2();
    ctor public Short2(short, short);
    field public short x;
    field public short y;
  }

  public class Short3 {
    ctor public Short3();
    ctor public Short3(short, short, short);
    field public short x;
    field public short y;
    field public short z;
  }

  public class Short4 {
    ctor public Short4();
    ctor public Short4(short, short, short, short);
    field public short w;
    field public short x;
    field public short y;
    field public short z;
  }

  public class Type extends android.renderscript.BaseObj {
    method public static android.renderscript.Type createX(android.renderscript.RenderScript, android.renderscript.Element, int);
    method public static android.renderscript.Type createXY(android.renderscript.RenderScript, android.renderscript.Element, int, int);
    method public static android.renderscript.Type createXYZ(android.renderscript.RenderScript, android.renderscript.Element, int, int, int);
    method public int getCount();
    method public android.renderscript.Element getElement();
    method public int getX();
    method public int getY();
    method public int getYuv();
    method public int getZ();
    method public boolean hasFaces();
    method public boolean hasMipmaps();
  }

  public static class Type.Builder {
    ctor public Type.Builder(android.renderscript.RenderScript, android.renderscript.Element);
    method public android.renderscript.Type create();
    method public android.renderscript.Type.Builder setFaces(boolean);
    method public android.renderscript.Type.Builder setMipmaps(boolean);
    method public android.renderscript.Type.Builder setX(int);
    method public android.renderscript.Type.Builder setY(int);
    method public android.renderscript.Type.Builder setYuvFormat(int);
    method public android.renderscript.Type.Builder setZ(int);
  }

  public enum Type.CubemapFace {
    enum_constant public static final android.renderscript.Type.CubemapFace NEGATIVE_X;
    enum_constant public static final android.renderscript.Type.CubemapFace NEGATIVE_Y;
    enum_constant public static final android.renderscript.Type.CubemapFace NEGATIVE_Z;
    enum_constant public static final android.renderscript.Type.CubemapFace POSITIVE_X;
    enum_constant public static final android.renderscript.Type.CubemapFace POSITIVE_Y;
    enum_constant public static final android.renderscript.Type.CubemapFace POSITIVE_Z;
    enum_constant @Deprecated public static final android.renderscript.Type.CubemapFace POSITVE_X;
    enum_constant @Deprecated public static final android.renderscript.Type.CubemapFace POSITVE_Y;
    enum_constant @Deprecated public static final android.renderscript.Type.CubemapFace POSITVE_Z;
  }

}

package android.sax {

  public class Element {
    method public android.sax.Element getChild(String);
    method public android.sax.Element getChild(String, String);
    method public android.sax.Element requireChild(String);
    method public android.sax.Element requireChild(String, String);
    method public void setElementListener(android.sax.ElementListener);
    method public void setEndElementListener(android.sax.EndElementListener);
    method public void setEndTextElementListener(android.sax.EndTextElementListener);
    method public void setStartElementListener(android.sax.StartElementListener);
    method public void setTextElementListener(android.sax.TextElementListener);
  }

  public interface ElementListener extends android.sax.StartElementListener android.sax.EndElementListener {
  }

  public interface EndElementListener {
    method public void end();
  }

  public interface EndTextElementListener {
    method public void end(String);
  }

  public class RootElement extends android.sax.Element {
    ctor public RootElement(String, String);
    ctor public RootElement(String);
    method public org.xml.sax.ContentHandler getContentHandler();
  }

  public interface StartElementListener {
    method public void start(org.xml.sax.Attributes);
  }

  public interface TextElementListener extends android.sax.StartElementListener android.sax.EndTextElementListener {
  }

}

package android.se.omapi {

  public final class Channel implements java.nio.channels.Channel {
    method public void close();
    method @Nullable public byte[] getSelectResponse();
    method @NonNull public android.se.omapi.Session getSession();
    method public boolean isBasicChannel();
    method public boolean isOpen();
    method public boolean selectNext() throws java.io.IOException;
    method @NonNull public byte[] transmit(@NonNull byte[]) throws java.io.IOException;
  }

  public final class Reader {
    method public void closeSessions();
    method @NonNull public String getName();
    method @NonNull public android.se.omapi.SEService getSEService();
    method public boolean isSecureElementPresent();
    method @NonNull public android.se.omapi.Session openSession() throws java.io.IOException;
  }

  public final class SEService {
    ctor public SEService(@NonNull android.content.Context, @NonNull java.util.concurrent.Executor, @NonNull android.se.omapi.SEService.OnConnectedListener);
    method @NonNull public android.se.omapi.Reader[] getReaders();
    method @NonNull public String getVersion();
    method public boolean isConnected();
    method public void shutdown();
  }

  public static interface SEService.OnConnectedListener {
    method public void onConnected();
  }

  public final class Session {
    method public void close();
    method public void closeChannels();
    method @Nullable public byte[] getATR();
    method @NonNull public android.se.omapi.Reader getReader();
    method public boolean isClosed();
    method @Nullable public android.se.omapi.Channel openBasicChannel(@Nullable byte[], @Nullable byte) throws java.io.IOException;
    method @Nullable public android.se.omapi.Channel openBasicChannel(@Nullable byte[]) throws java.io.IOException;
    method @Nullable public android.se.omapi.Channel openLogicalChannel(@Nullable byte[], @Nullable byte) throws java.io.IOException;
    method @Nullable public android.se.omapi.Channel openLogicalChannel(@Nullable byte[]) throws java.io.IOException;
  }

}

package android.security {

  public final class AttestedKeyPair {
    method public java.util.List<java.security.cert.Certificate> getAttestationRecord();
    method public java.security.KeyPair getKeyPair();
  }

  public class ConfirmationAlreadyPresentingException extends java.lang.Exception {
    ctor public ConfirmationAlreadyPresentingException();
    ctor public ConfirmationAlreadyPresentingException(String);
  }

  public abstract class ConfirmationCallback {
    ctor public ConfirmationCallback();
    method public void onCanceled();
    method public void onConfirmed(@NonNull byte[]);
    method public void onDismissed();
    method public void onError(Throwable);
  }

  public class ConfirmationNotAvailableException extends java.lang.Exception {
    ctor public ConfirmationNotAvailableException();
    ctor public ConfirmationNotAvailableException(String);
  }

  public class ConfirmationPrompt {
    method public void cancelPrompt();
    method public static boolean isSupported(android.content.Context);
    method public void presentPrompt(@NonNull java.util.concurrent.Executor, @NonNull android.security.ConfirmationCallback) throws android.security.ConfirmationAlreadyPresentingException, android.security.ConfirmationNotAvailableException;
  }

  public static final class ConfirmationPrompt.Builder {
    ctor public ConfirmationPrompt.Builder(android.content.Context);
    method public android.security.ConfirmationPrompt build();
    method public android.security.ConfirmationPrompt.Builder setExtraData(byte[]);
    method public android.security.ConfirmationPrompt.Builder setPromptText(CharSequence);
  }

  public final class KeyChain {
    ctor public KeyChain();
    method public static void choosePrivateKeyAlias(@NonNull android.app.Activity, @NonNull android.security.KeyChainAliasCallback, @Nullable String[], @Nullable java.security.Principal[], @Nullable String, int, @Nullable String);
    method public static void choosePrivateKeyAlias(@NonNull android.app.Activity, @NonNull android.security.KeyChainAliasCallback, @Nullable String[], @Nullable java.security.Principal[], @Nullable android.net.Uri, @Nullable String);
    method @NonNull public static android.content.Intent createInstallIntent();
    method @Nullable @WorkerThread public static java.security.cert.X509Certificate[] getCertificateChain(@NonNull android.content.Context, @NonNull String) throws java.lang.InterruptedException, android.security.KeyChainException;
    method @Nullable @WorkerThread public static java.security.PrivateKey getPrivateKey(@NonNull android.content.Context, @NonNull String) throws java.lang.InterruptedException, android.security.KeyChainException;
    method @Deprecated public static boolean isBoundKeyAlgorithm(@NonNull String);
    method public static boolean isKeyAlgorithmSupported(@NonNull String);
    field public static final String ACTION_KEYCHAIN_CHANGED = "android.security.action.KEYCHAIN_CHANGED";
    field public static final String ACTION_KEY_ACCESS_CHANGED = "android.security.action.KEY_ACCESS_CHANGED";
    field @Deprecated public static final String ACTION_STORAGE_CHANGED = "android.security.STORAGE_CHANGED";
    field public static final String ACTION_TRUST_STORE_CHANGED = "android.security.action.TRUST_STORE_CHANGED";
    field public static final String EXTRA_CERTIFICATE = "CERT";
    field public static final String EXTRA_KEY_ACCESSIBLE = "android.security.extra.KEY_ACCESSIBLE";
    field public static final String EXTRA_KEY_ALIAS = "android.security.extra.KEY_ALIAS";
    field public static final String EXTRA_NAME = "name";
    field public static final String EXTRA_PKCS12 = "PKCS12";
  }

  public interface KeyChainAliasCallback {
    method public void alias(@Nullable String);
  }

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

  @Deprecated public final class KeyPairGeneratorSpec implements java.security.spec.AlgorithmParameterSpec {
    method @Deprecated @NonNull public java.security.spec.AlgorithmParameterSpec getAlgorithmParameterSpec();
    method @Deprecated public android.content.Context getContext();
    method @Deprecated @NonNull public java.util.Date getEndDate();
    method @Deprecated public int getKeySize();
    method @Deprecated @Nullable public String getKeyType();
    method @Deprecated public String getKeystoreAlias();
    method @Deprecated @NonNull public java.math.BigInteger getSerialNumber();
    method @Deprecated @NonNull public java.util.Date getStartDate();
    method @Deprecated @NonNull public javax.security.auth.x500.X500Principal getSubjectDN();
    method @Deprecated public boolean isEncryptionRequired();
  }

  @Deprecated public static final class KeyPairGeneratorSpec.Builder {
    ctor @Deprecated public KeyPairGeneratorSpec.Builder(@NonNull android.content.Context);
    method @Deprecated @NonNull public android.security.KeyPairGeneratorSpec build();
    method @Deprecated public android.security.KeyPairGeneratorSpec.Builder setAlgorithmParameterSpec(@NonNull java.security.spec.AlgorithmParameterSpec);
    method @Deprecated @NonNull public android.security.KeyPairGeneratorSpec.Builder setAlias(@NonNull String);
    method @Deprecated @NonNull public android.security.KeyPairGeneratorSpec.Builder setEncryptionRequired();
    method @Deprecated @NonNull public android.security.KeyPairGeneratorSpec.Builder setEndDate(@NonNull java.util.Date);
    method @Deprecated @NonNull public android.security.KeyPairGeneratorSpec.Builder setKeySize(int);
    method @Deprecated @NonNull public android.security.KeyPairGeneratorSpec.Builder setKeyType(@NonNull String) throws java.security.NoSuchAlgorithmException;
    method @Deprecated @NonNull public android.security.KeyPairGeneratorSpec.Builder setSerialNumber(@NonNull java.math.BigInteger);
    method @Deprecated @NonNull public android.security.KeyPairGeneratorSpec.Builder setStartDate(@NonNull java.util.Date);
    method @Deprecated @NonNull public android.security.KeyPairGeneratorSpec.Builder setSubject(@NonNull javax.security.auth.x500.X500Principal);
  }

  @Deprecated public final class KeyStoreParameter implements java.security.KeyStore.ProtectionParameter {
    method @Deprecated public boolean isEncryptionRequired();
  }

  @Deprecated public static final class KeyStoreParameter.Builder {
    ctor @Deprecated public KeyStoreParameter.Builder(@NonNull android.content.Context);
    method @Deprecated @NonNull public android.security.KeyStoreParameter build();
    method @Deprecated @NonNull public android.security.KeyStoreParameter.Builder setEncryptionRequired(boolean);
  }

  public class NetworkSecurityPolicy {
    method public static android.security.NetworkSecurityPolicy getInstance();
    method public boolean isCleartextTrafficPermitted();
    method public boolean isCleartextTrafficPermitted(String);
  }

}

package android.security.keystore {

  public class KeyExpiredException extends java.security.InvalidKeyException {
    ctor public KeyExpiredException();
    ctor public KeyExpiredException(String);
    ctor public KeyExpiredException(String, Throwable);
  }

  public final class KeyGenParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    method @Nullable public java.security.spec.AlgorithmParameterSpec getAlgorithmParameterSpec();
    method public byte[] getAttestationChallenge();
    method @NonNull public String[] getBlockModes();
    method @NonNull public java.util.Date getCertificateNotAfter();
    method @NonNull public java.util.Date getCertificateNotBefore();
    method @NonNull public java.math.BigInteger getCertificateSerialNumber();
    method @NonNull public javax.security.auth.x500.X500Principal getCertificateSubject();
    method @NonNull public String[] getDigests();
    method @NonNull public String[] getEncryptionPaddings();
    method public int getKeySize();
    method @Nullable public java.util.Date getKeyValidityForConsumptionEnd();
    method @Nullable public java.util.Date getKeyValidityForOriginationEnd();
    method @Nullable public java.util.Date getKeyValidityStart();
    method @NonNull public String getKeystoreAlias();
    method public int getPurposes();
    method @NonNull public String[] getSignaturePaddings();
    method public int getUserAuthenticationValidityDurationSeconds();
    method @NonNull public boolean isDigestsSpecified();
    method public boolean isInvalidatedByBiometricEnrollment();
    method public boolean isRandomizedEncryptionRequired();
    method public boolean isStrongBoxBacked();
    method public boolean isUnlockedDeviceRequired();
    method public boolean isUserAuthenticationRequired();
    method public boolean isUserAuthenticationValidWhileOnBody();
    method public boolean isUserConfirmationRequired();
    method public boolean isUserPresenceRequired();
  }

  public static final class KeyGenParameterSpec.Builder {
    ctor public KeyGenParameterSpec.Builder(@NonNull String, int);
    method @NonNull public android.security.keystore.KeyGenParameterSpec build();
    method public android.security.keystore.KeyGenParameterSpec.Builder setAlgorithmParameterSpec(@NonNull java.security.spec.AlgorithmParameterSpec);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setAttestationChallenge(byte[]);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setBlockModes(java.lang.String...);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setCertificateNotAfter(@NonNull java.util.Date);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setCertificateNotBefore(@NonNull java.util.Date);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setCertificateSerialNumber(@NonNull java.math.BigInteger);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setCertificateSubject(@NonNull javax.security.auth.x500.X500Principal);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setDigests(java.lang.String...);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setEncryptionPaddings(java.lang.String...);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setInvalidatedByBiometricEnrollment(boolean);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setIsStrongBoxBacked(boolean);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setKeySize(int);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setKeyValidityEnd(java.util.Date);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setKeyValidityForConsumptionEnd(java.util.Date);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setKeyValidityForOriginationEnd(java.util.Date);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setKeyValidityStart(java.util.Date);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setRandomizedEncryptionRequired(boolean);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setSignaturePaddings(java.lang.String...);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setUnlockedDeviceRequired(boolean);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setUserAuthenticationRequired(boolean);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setUserAuthenticationValidWhileOnBody(boolean);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setUserAuthenticationValidityDurationSeconds(@IntRange(from=0xffffffff) int);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setUserConfirmationRequired(boolean);
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setUserPresenceRequired(boolean);
  }

  public class KeyInfo implements java.security.spec.KeySpec {
    method @NonNull public String[] getBlockModes();
    method @NonNull public String[] getDigests();
    method @NonNull public String[] getEncryptionPaddings();
    method public int getKeySize();
    method @Nullable public java.util.Date getKeyValidityForConsumptionEnd();
    method @Nullable public java.util.Date getKeyValidityForOriginationEnd();
    method @Nullable public java.util.Date getKeyValidityStart();
    method public String getKeystoreAlias();
    method public int getOrigin();
    method public int getPurposes();
    method @NonNull public String[] getSignaturePaddings();
    method public int getUserAuthenticationValidityDurationSeconds();
    method public boolean isInsideSecureHardware();
    method public boolean isInvalidatedByBiometricEnrollment();
    method public boolean isTrustedUserPresenceRequired();
    method public boolean isUserAuthenticationRequired();
    method public boolean isUserAuthenticationRequirementEnforcedBySecureHardware();
    method public boolean isUserAuthenticationValidWhileOnBody();
    method public boolean isUserConfirmationRequired();
  }

  public class KeyNotYetValidException extends java.security.InvalidKeyException {
    ctor public KeyNotYetValidException();
    ctor public KeyNotYetValidException(String);
    ctor public KeyNotYetValidException(String, Throwable);
  }

  public class KeyPermanentlyInvalidatedException extends java.security.InvalidKeyException {
    ctor public KeyPermanentlyInvalidatedException();
    ctor public KeyPermanentlyInvalidatedException(String);
    ctor public KeyPermanentlyInvalidatedException(String, Throwable);
  }

  public abstract class KeyProperties {
    field public static final String BLOCK_MODE_CBC = "CBC";
    field public static final String BLOCK_MODE_CTR = "CTR";
    field public static final String BLOCK_MODE_ECB = "ECB";
    field public static final String BLOCK_MODE_GCM = "GCM";
    field public static final String DIGEST_MD5 = "MD5";
    field public static final String DIGEST_NONE = "NONE";
    field public static final String DIGEST_SHA1 = "SHA-1";
    field public static final String DIGEST_SHA224 = "SHA-224";
    field public static final String DIGEST_SHA256 = "SHA-256";
    field public static final String DIGEST_SHA384 = "SHA-384";
    field public static final String DIGEST_SHA512 = "SHA-512";
    field public static final String ENCRYPTION_PADDING_NONE = "NoPadding";
    field public static final String ENCRYPTION_PADDING_PKCS7 = "PKCS7Padding";
    field public static final String ENCRYPTION_PADDING_RSA_OAEP = "OAEPPadding";
    field public static final String ENCRYPTION_PADDING_RSA_PKCS1 = "PKCS1Padding";
    field @Deprecated public static final String KEY_ALGORITHM_3DES = "DESede";
    field public static final String KEY_ALGORITHM_AES = "AES";
    field public static final String KEY_ALGORITHM_EC = "EC";
    field public static final String KEY_ALGORITHM_HMAC_SHA1 = "HmacSHA1";
    field public static final String KEY_ALGORITHM_HMAC_SHA224 = "HmacSHA224";
    field public static final String KEY_ALGORITHM_HMAC_SHA256 = "HmacSHA256";
    field public static final String KEY_ALGORITHM_HMAC_SHA384 = "HmacSHA384";
    field public static final String KEY_ALGORITHM_HMAC_SHA512 = "HmacSHA512";
    field public static final String KEY_ALGORITHM_RSA = "RSA";
    field public static final int ORIGIN_GENERATED = 1; // 0x1
    field public static final int ORIGIN_IMPORTED = 2; // 0x2
    field public static final int ORIGIN_SECURELY_IMPORTED = 8; // 0x8
    field public static final int ORIGIN_UNKNOWN = 4; // 0x4
    field public static final int PURPOSE_DECRYPT = 2; // 0x2
    field public static final int PURPOSE_ENCRYPT = 1; // 0x1
    field public static final int PURPOSE_SIGN = 4; // 0x4
    field public static final int PURPOSE_VERIFY = 8; // 0x8
    field public static final int PURPOSE_WRAP_KEY = 32; // 0x20
    field public static final String SIGNATURE_PADDING_RSA_PKCS1 = "PKCS1";
    field public static final String SIGNATURE_PADDING_RSA_PSS = "PSS";
  }

  public final class KeyProtection implements java.security.KeyStore.ProtectionParameter {
    method @NonNull public String[] getBlockModes();
    method @NonNull public String[] getDigests();
    method @NonNull public String[] getEncryptionPaddings();
    method @Nullable public java.util.Date getKeyValidityForConsumptionEnd();
    method @Nullable public java.util.Date getKeyValidityForOriginationEnd();
    method @Nullable public java.util.Date getKeyValidityStart();
    method public int getPurposes();
    method @NonNull public String[] getSignaturePaddings();
    method public int getUserAuthenticationValidityDurationSeconds();
    method public boolean isDigestsSpecified();
    method public boolean isInvalidatedByBiometricEnrollment();
    method public boolean isRandomizedEncryptionRequired();
    method public boolean isUnlockedDeviceRequired();
    method public boolean isUserAuthenticationRequired();
    method public boolean isUserAuthenticationValidWhileOnBody();
    method public boolean isUserConfirmationRequired();
    method public boolean isUserPresenceRequired();
  }

  public static final class KeyProtection.Builder {
    ctor public KeyProtection.Builder(int);
    method @NonNull public android.security.keystore.KeyProtection build();
    method @NonNull public android.security.keystore.KeyProtection.Builder setBlockModes(java.lang.String...);
    method @NonNull public android.security.keystore.KeyProtection.Builder setDigests(java.lang.String...);
    method @NonNull public android.security.keystore.KeyProtection.Builder setEncryptionPaddings(java.lang.String...);
    method @NonNull public android.security.keystore.KeyProtection.Builder setInvalidatedByBiometricEnrollment(boolean);
    method @NonNull public android.security.keystore.KeyProtection.Builder setKeyValidityEnd(java.util.Date);
    method @NonNull public android.security.keystore.KeyProtection.Builder setKeyValidityForConsumptionEnd(java.util.Date);
    method @NonNull public android.security.keystore.KeyProtection.Builder setKeyValidityForOriginationEnd(java.util.Date);
    method @NonNull public android.security.keystore.KeyProtection.Builder setKeyValidityStart(java.util.Date);
    method @NonNull public android.security.keystore.KeyProtection.Builder setRandomizedEncryptionRequired(boolean);
    method @NonNull public android.security.keystore.KeyProtection.Builder setSignaturePaddings(java.lang.String...);
    method @NonNull public android.security.keystore.KeyProtection.Builder setUnlockedDeviceRequired(boolean);
    method @NonNull public android.security.keystore.KeyProtection.Builder setUserAuthenticationRequired(boolean);
    method @NonNull public android.security.keystore.KeyProtection.Builder setUserAuthenticationValidWhileOnBody(boolean);
    method @NonNull public android.security.keystore.KeyProtection.Builder setUserAuthenticationValidityDurationSeconds(@IntRange(from=0xffffffff) int);
    method @NonNull public android.security.keystore.KeyProtection.Builder setUserConfirmationRequired(boolean);
    method @NonNull public android.security.keystore.KeyProtection.Builder setUserPresenceRequired(boolean);
  }

  public class SecureKeyImportUnavailableException extends java.security.ProviderException {
    ctor public SecureKeyImportUnavailableException();
    ctor public SecureKeyImportUnavailableException(String);
    ctor public SecureKeyImportUnavailableException(String, Throwable);
    ctor public SecureKeyImportUnavailableException(Throwable);
  }

  public class StrongBoxUnavailableException extends java.security.ProviderException {
    ctor public StrongBoxUnavailableException();
    ctor public StrongBoxUnavailableException(String);
    ctor public StrongBoxUnavailableException(String, Throwable);
    ctor public StrongBoxUnavailableException(Throwable);
  }

  public class UserNotAuthenticatedException extends java.security.InvalidKeyException {
    ctor public UserNotAuthenticatedException();
    ctor public UserNotAuthenticatedException(String);
    ctor public UserNotAuthenticatedException(String, Throwable);
  }

  public class UserPresenceUnavailableException extends java.security.InvalidKeyException {
    ctor public UserPresenceUnavailableException();
    ctor public UserPresenceUnavailableException(String);
    ctor public UserPresenceUnavailableException(String, Throwable);
  }

  public class WrappedKeyEntry implements java.security.KeyStore.Entry {
    ctor public WrappedKeyEntry(byte[], String, String, java.security.spec.AlgorithmParameterSpec);
    method public java.security.spec.AlgorithmParameterSpec getAlgorithmParameterSpec();
    method public String getTransformation();
    method public byte[] getWrappedKeyBytes();
    method public String getWrappingKeyAlias();
  }

}

package android.service.autofill {

  public abstract class AutofillService extends android.app.Service {
    ctor public AutofillService();
    method @Nullable public final android.service.autofill.FillEventHistory getFillEventHistory();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public void onConnected();
    method public void onDisconnected();
    method public abstract void onFillRequest(@NonNull android.service.autofill.FillRequest, @NonNull android.os.CancellationSignal, @NonNull android.service.autofill.FillCallback);
    method public abstract void onSaveRequest(@NonNull android.service.autofill.SaveRequest, @NonNull android.service.autofill.SaveCallback);
    field public static final String SERVICE_INTERFACE = "android.service.autofill.AutofillService";
    field public static final String SERVICE_META_DATA = "android.autofill";
  }

  public final class BatchUpdates implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.BatchUpdates> CREATOR;
  }

  public static class BatchUpdates.Builder {
    ctor public BatchUpdates.Builder();
    method public android.service.autofill.BatchUpdates build();
    method public android.service.autofill.BatchUpdates.Builder transformChild(int, @NonNull android.service.autofill.Transformation);
    method public android.service.autofill.BatchUpdates.Builder updateTemplate(@NonNull android.widget.RemoteViews);
  }

  public final class CharSequenceTransformation implements android.os.Parcelable android.service.autofill.Transformation {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.CharSequenceTransformation> CREATOR;
  }

  public static class CharSequenceTransformation.Builder {
    ctor public CharSequenceTransformation.Builder(@NonNull android.view.autofill.AutofillId, @NonNull java.util.regex.Pattern, @NonNull String);
    method public android.service.autofill.CharSequenceTransformation.Builder addField(@NonNull android.view.autofill.AutofillId, @NonNull java.util.regex.Pattern, @NonNull String);
    method public android.service.autofill.CharSequenceTransformation build();
  }

  public final class CustomDescription implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.CustomDescription> CREATOR;
  }

  public static class CustomDescription.Builder {
    ctor public CustomDescription.Builder(@NonNull android.widget.RemoteViews);
    method public android.service.autofill.CustomDescription.Builder addChild(int, @NonNull android.service.autofill.Transformation);
    method public android.service.autofill.CustomDescription.Builder batchUpdate(@NonNull android.service.autofill.Validator, @NonNull android.service.autofill.BatchUpdates);
    method public android.service.autofill.CustomDescription build();
  }

  public final class Dataset implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.Dataset> CREATOR;
  }

  public static final class Dataset.Builder {
    ctor public Dataset.Builder(@NonNull android.widget.RemoteViews);
    ctor public Dataset.Builder();
    method @NonNull public android.service.autofill.Dataset build();
    method @NonNull public android.service.autofill.Dataset.Builder setAuthentication(@Nullable android.content.IntentSender);
    method @NonNull public android.service.autofill.Dataset.Builder setId(@Nullable String);
    method @NonNull public android.service.autofill.Dataset.Builder setValue(@NonNull android.view.autofill.AutofillId, @Nullable android.view.autofill.AutofillValue);
    method @NonNull public android.service.autofill.Dataset.Builder setValue(@NonNull android.view.autofill.AutofillId, @Nullable android.view.autofill.AutofillValue, @NonNull android.widget.RemoteViews);
    method @NonNull public android.service.autofill.Dataset.Builder setValue(@NonNull android.view.autofill.AutofillId, @Nullable android.view.autofill.AutofillValue, @Nullable java.util.regex.Pattern);
    method @NonNull public android.service.autofill.Dataset.Builder setValue(@NonNull android.view.autofill.AutofillId, @Nullable android.view.autofill.AutofillValue, @Nullable java.util.regex.Pattern, @NonNull android.widget.RemoteViews);
  }

  public final class DateTransformation implements android.os.Parcelable android.service.autofill.Transformation {
    ctor public DateTransformation(@NonNull android.view.autofill.AutofillId, @NonNull android.icu.text.DateFormat);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.DateTransformation> CREATOR;
  }

  public final class DateValueSanitizer implements android.os.Parcelable android.service.autofill.Sanitizer {
    ctor public DateValueSanitizer(@NonNull android.icu.text.DateFormat);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.DateValueSanitizer> CREATOR;
  }

  public final class FieldClassification {
    method @NonNull public java.util.List<android.service.autofill.FieldClassification.Match> getMatches();
  }

  public static final class FieldClassification.Match {
    method @NonNull public String getCategoryId();
    method public float getScore();
  }

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

  public final class FillContext implements android.os.Parcelable {
    method public int describeContents();
    method public int getRequestId();
    method public android.app.assist.AssistStructure getStructure();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.FillContext> CREATOR;
  }

  public final class FillEventHistory implements android.os.Parcelable {
    method public int describeContents();
    method @Deprecated @Nullable public android.os.Bundle getClientState();
    method @Nullable public java.util.List<android.service.autofill.FillEventHistory.Event> getEvents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.FillEventHistory> CREATOR;
  }

  public static final class FillEventHistory.Event {
    method @NonNull public java.util.Map<android.view.autofill.AutofillId,java.lang.String> getChangedFields();
    method @Nullable public android.os.Bundle getClientState();
    method @Nullable public String getDatasetId();
    method @NonNull public java.util.Map<android.view.autofill.AutofillId,android.service.autofill.FieldClassification> getFieldsClassification();
    method @NonNull public java.util.Set<java.lang.String> getIgnoredDatasetIds();
    method @NonNull public java.util.Map<android.view.autofill.AutofillId,java.util.Set<java.lang.String>> getManuallyEnteredField();
    method @NonNull public java.util.Set<java.lang.String> getSelectedDatasetIds();
    method public int getType();
    field public static final int TYPE_AUTHENTICATION_SELECTED = 2; // 0x2
    field public static final int TYPE_CONTEXT_COMMITTED = 4; // 0x4
    field public static final int TYPE_DATASET_AUTHENTICATION_SELECTED = 1; // 0x1
    field public static final int TYPE_DATASET_SELECTED = 0; // 0x0
    field public static final int TYPE_SAVE_SHOWN = 3; // 0x3
  }

  public final class FillRequest implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.os.Bundle getClientState();
    method @NonNull public java.util.List<android.service.autofill.FillContext> getFillContexts();
    method public int getFlags();
    method public int getId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.FillRequest> CREATOR;
    field public static final int FLAG_MANUAL_REQUEST = 1; // 0x1
  }

  public final class FillResponse implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.FillResponse> CREATOR;
    field public static final int FLAG_DISABLE_ACTIVITY_ONLY = 2; // 0x2
    field public static final int FLAG_TRACK_CONTEXT_COMMITED = 1; // 0x1
  }

  public static final class FillResponse.Builder {
    ctor public FillResponse.Builder();
    method @NonNull public android.service.autofill.FillResponse.Builder addDataset(@Nullable android.service.autofill.Dataset);
    method public android.service.autofill.FillResponse build();
    method public android.service.autofill.FillResponse.Builder disableAutofill(long);
    method @NonNull public android.service.autofill.FillResponse.Builder setAuthentication(@NonNull android.view.autofill.AutofillId[], @Nullable android.content.IntentSender, @Nullable android.widget.RemoteViews);
    method public android.service.autofill.FillResponse.Builder setClientState(@Nullable android.os.Bundle);
    method public android.service.autofill.FillResponse.Builder setFieldClassificationIds(@NonNull android.view.autofill.AutofillId...);
    method public android.service.autofill.FillResponse.Builder setFlags(int);
    method public android.service.autofill.FillResponse.Builder setFooter(@NonNull android.widget.RemoteViews);
    method public android.service.autofill.FillResponse.Builder setHeader(@NonNull android.widget.RemoteViews);
    method public android.service.autofill.FillResponse.Builder setIgnoredIds(android.view.autofill.AutofillId...);
    method @NonNull public android.service.autofill.FillResponse.Builder setSaveInfo(@NonNull android.service.autofill.SaveInfo);
  }

  public final class ImageTransformation implements android.os.Parcelable android.service.autofill.Transformation {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.ImageTransformation> CREATOR;
  }

  public static class ImageTransformation.Builder {
    ctor @Deprecated public ImageTransformation.Builder(@NonNull android.view.autofill.AutofillId, @NonNull java.util.regex.Pattern, @DrawableRes int);
    ctor public ImageTransformation.Builder(@NonNull android.view.autofill.AutofillId, @NonNull java.util.regex.Pattern, @DrawableRes int, @NonNull CharSequence);
    method @Deprecated public android.service.autofill.ImageTransformation.Builder addOption(@NonNull java.util.regex.Pattern, @DrawableRes int);
    method public android.service.autofill.ImageTransformation.Builder addOption(@NonNull java.util.regex.Pattern, @DrawableRes int, @NonNull CharSequence);
    method public android.service.autofill.ImageTransformation build();
  }

  public final class LuhnChecksumValidator implements android.os.Parcelable android.service.autofill.Validator {
    ctor public LuhnChecksumValidator(@NonNull android.view.autofill.AutofillId...);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.LuhnChecksumValidator> CREATOR;
  }

  public final class RegexValidator implements android.os.Parcelable android.service.autofill.Validator {
    ctor public RegexValidator(@NonNull android.view.autofill.AutofillId, @NonNull java.util.regex.Pattern);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.RegexValidator> CREATOR;
  }

  public interface Sanitizer {
  }

  public final class SaveCallback {
    method public void onFailure(CharSequence);
    method public void onSuccess();
    method public void onSuccess(@NonNull android.content.IntentSender);
  }

  public final class SaveInfo implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.SaveInfo> CREATOR;
    field public static final int FLAG_DONT_SAVE_ON_FINISH = 2; // 0x2
    field public static final int FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE = 1; // 0x1
    field public static final int NEGATIVE_BUTTON_STYLE_CANCEL = 0; // 0x0
    field public static final int NEGATIVE_BUTTON_STYLE_REJECT = 1; // 0x1
    field public static final int SAVE_DATA_TYPE_ADDRESS = 2; // 0x2
    field public static final int SAVE_DATA_TYPE_CREDIT_CARD = 4; // 0x4
    field public static final int SAVE_DATA_TYPE_EMAIL_ADDRESS = 16; // 0x10
    field public static final int SAVE_DATA_TYPE_GENERIC = 0; // 0x0
    field public static final int SAVE_DATA_TYPE_PASSWORD = 1; // 0x1
    field public static final int SAVE_DATA_TYPE_USERNAME = 8; // 0x8
  }

  public static final class SaveInfo.Builder {
    ctor public SaveInfo.Builder(int, @NonNull android.view.autofill.AutofillId[]);
    ctor public SaveInfo.Builder(int);
    method @NonNull public android.service.autofill.SaveInfo.Builder addSanitizer(@NonNull android.service.autofill.Sanitizer, @NonNull android.view.autofill.AutofillId...);
    method public android.service.autofill.SaveInfo build();
    method @NonNull public android.service.autofill.SaveInfo.Builder setCustomDescription(@NonNull android.service.autofill.CustomDescription);
    method @NonNull public android.service.autofill.SaveInfo.Builder setDescription(@Nullable CharSequence);
    method @NonNull public android.service.autofill.SaveInfo.Builder setFlags(int);
    method @NonNull public android.service.autofill.SaveInfo.Builder setNegativeAction(int, @Nullable android.content.IntentSender);
    method @NonNull public android.service.autofill.SaveInfo.Builder setOptionalIds(@NonNull android.view.autofill.AutofillId[]);
    method @NonNull public android.service.autofill.SaveInfo.Builder setTriggerId(@NonNull android.view.autofill.AutofillId);
    method @NonNull public android.service.autofill.SaveInfo.Builder setValidator(@NonNull android.service.autofill.Validator);
  }

  public final class SaveRequest implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.os.Bundle getClientState();
    method @Nullable public java.util.List<java.lang.String> getDatasetIds();
    method @NonNull public java.util.List<android.service.autofill.FillContext> getFillContexts();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.SaveRequest> CREATOR;
  }

  public final class TextValueSanitizer implements android.os.Parcelable android.service.autofill.Sanitizer {
    ctor public TextValueSanitizer(@NonNull java.util.regex.Pattern, @NonNull String);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.TextValueSanitizer> CREATOR;
  }

  public interface Transformation {
  }

  public final class UserData implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getFieldClassificationAlgorithm();
    method public String getId();
    method public static int getMaxCategoryCount();
    method public static int getMaxFieldClassificationIdsSize();
    method public static int getMaxUserDataSize();
    method public static int getMaxValueLength();
    method public static int getMinValueLength();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.UserData> CREATOR;
  }

  public static final class UserData.Builder {
    ctor public UserData.Builder(@NonNull String, @NonNull String, @NonNull String);
    method public android.service.autofill.UserData.Builder add(@NonNull String, @NonNull String);
    method public android.service.autofill.UserData build();
    method public android.service.autofill.UserData.Builder setFieldClassificationAlgorithm(@Nullable String, @Nullable android.os.Bundle);
  }

  public interface Validator {
  }

  public final class Validators {
    method @NonNull public static android.service.autofill.Validator and(@NonNull android.service.autofill.Validator...);
    method @NonNull public static android.service.autofill.Validator not(@NonNull android.service.autofill.Validator);
    method @NonNull public static android.service.autofill.Validator or(@NonNull android.service.autofill.Validator...);
  }

}

package android.service.carrier {

  public class CarrierIdentifier implements android.os.Parcelable {
    ctor public CarrierIdentifier(String, String, @Nullable String, @Nullable String, @Nullable String, @Nullable String);
    ctor public CarrierIdentifier(String, String, @Nullable String, @Nullable String, @Nullable String, @Nullable String, int, int);
    ctor public CarrierIdentifier(byte[], @Nullable String, @Nullable String);
    method public int describeContents();
    method public int getCarrierId();
    method @Nullable public String getGid1();
    method @Nullable public String getGid2();
    method @Nullable public String getImsi();
    method public String getMcc();
    method public String getMnc();
    method public int getPreciseCarrierId();
    method @Nullable public String getSpn();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.carrier.CarrierIdentifier> CREATOR;
  }

  public abstract class CarrierMessagingService extends android.app.Service {
    ctor public CarrierMessagingService();
    method @Nullable public android.os.IBinder onBind(@NonNull android.content.Intent);
    method public void onDownloadMms(@NonNull android.net.Uri, int, @NonNull android.net.Uri, @NonNull android.service.carrier.CarrierMessagingService.ResultCallback<java.lang.Integer>);
    method @Deprecated public void onFilterSms(@NonNull android.service.carrier.MessagePdu, @NonNull String, int, int, @NonNull android.service.carrier.CarrierMessagingService.ResultCallback<java.lang.Boolean>);
    method public void onReceiveTextSms(@NonNull android.service.carrier.MessagePdu, @NonNull String, int, int, @NonNull android.service.carrier.CarrierMessagingService.ResultCallback<java.lang.Integer>);
    method @Deprecated public void onSendDataSms(@NonNull byte[], int, @NonNull String, int, @NonNull android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendSmsResult>);
    method public void onSendDataSms(@NonNull byte[], int, @NonNull String, int, int, @NonNull android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendSmsResult>);
    method public void onSendMms(@NonNull android.net.Uri, int, @Nullable android.net.Uri, @NonNull android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendMmsResult>);
    method @Deprecated public void onSendMultipartTextSms(@NonNull java.util.List<java.lang.String>, int, @NonNull String, @NonNull android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendMultipartSmsResult>);
    method public void onSendMultipartTextSms(@NonNull java.util.List<java.lang.String>, int, @NonNull String, int, @NonNull android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendMultipartSmsResult>);
    method @Deprecated public void onSendTextSms(@NonNull String, int, @NonNull String, @NonNull android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendSmsResult>);
    method public void onSendTextSms(@NonNull String, int, @NonNull String, int, @NonNull android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendSmsResult>);
    field public static final int DOWNLOAD_STATUS_ERROR = 2; // 0x2
    field public static final int DOWNLOAD_STATUS_OK = 0; // 0x0
    field public static final int DOWNLOAD_STATUS_RETRY_ON_CARRIER_NETWORK = 1; // 0x1
    field public static final int RECEIVE_OPTIONS_DEFAULT = 0; // 0x0
    field public static final int RECEIVE_OPTIONS_DROP = 1; // 0x1
    field public static final int RECEIVE_OPTIONS_SKIP_NOTIFY_WHEN_CREDENTIAL_PROTECTED_STORAGE_UNAVAILABLE = 2; // 0x2
    field public static final int SEND_FLAG_REQUEST_DELIVERY_STATUS = 1; // 0x1
    field public static final int SEND_STATUS_ERROR = 2; // 0x2
    field public static final int SEND_STATUS_OK = 0; // 0x0
    field public static final int SEND_STATUS_RETRY_ON_CARRIER_NETWORK = 1; // 0x1
    field public static final String SERVICE_INTERFACE = "android.service.carrier.CarrierMessagingService";
  }

  public static interface CarrierMessagingService.ResultCallback<T> {
    method public void onReceiveResult(@NonNull T) throws android.os.RemoteException;
  }

  public static final class CarrierMessagingService.SendMmsResult {
    ctor public CarrierMessagingService.SendMmsResult(int, @Nullable byte[]);
    method @Nullable public byte[] getSendConfPdu();
    method public int getSendStatus();
  }

  public static final class CarrierMessagingService.SendMultipartSmsResult {
    ctor public CarrierMessagingService.SendMultipartSmsResult(int, @Nullable int[]);
    method @Nullable public int[] getMessageRefs();
    method public int getSendStatus();
  }

  public static final class CarrierMessagingService.SendSmsResult {
    ctor public CarrierMessagingService.SendSmsResult(int, int);
    method public int getMessageRef();
    method public int getSendStatus();
  }

  public abstract class CarrierService extends android.app.Service {
    ctor public CarrierService();
    method public final void notifyCarrierNetworkChange(boolean);
    method @CallSuper public android.os.IBinder onBind(android.content.Intent);
    method public abstract android.os.PersistableBundle onLoadConfig(android.service.carrier.CarrierIdentifier);
    field public static final String CARRIER_SERVICE_INTERFACE = "android.service.carrier.CarrierService";
  }

  public final class MessagePdu implements android.os.Parcelable {
    ctor public MessagePdu(@NonNull java.util.List<byte[]>);
    method public int describeContents();
    method @NonNull public java.util.List<byte[]> getPdus();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.carrier.MessagePdu> CREATOR;
  }

}

package android.service.chooser {

  public final class ChooserTarget implements android.os.Parcelable {
    ctor public ChooserTarget(CharSequence, android.graphics.drawable.Icon, float, android.content.ComponentName, @Nullable android.os.Bundle);
    method public int describeContents();
    method public android.content.ComponentName getComponentName();
    method public android.graphics.drawable.Icon getIcon();
    method public android.os.Bundle getIntentExtras();
    method public float getScore();
    method public CharSequence getTitle();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.chooser.ChooserTarget> CREATOR;
  }

  public abstract class ChooserTargetService extends android.app.Service {
    ctor public ChooserTargetService();
    method public android.os.IBinder onBind(android.content.Intent);
    method public abstract java.util.List<android.service.chooser.ChooserTarget> onGetChooserTargets(android.content.ComponentName, android.content.IntentFilter);
    field public static final String BIND_PERMISSION = "android.permission.BIND_CHOOSER_TARGET_SERVICE";
    field public static final String META_DATA_NAME = "android.service.chooser.chooser_target_service";
    field public static final String SERVICE_INTERFACE = "android.service.chooser.ChooserTargetService";
  }

}

package android.service.dreams {

  public class DreamService extends android.app.Service implements android.view.Window.Callback {
    ctor public DreamService();
    method public void addContentView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public boolean dispatchGenericMotionEvent(android.view.MotionEvent);
    method public boolean dispatchKeyEvent(android.view.KeyEvent);
    method public boolean dispatchKeyShortcutEvent(android.view.KeyEvent);
    method public boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public boolean dispatchTouchEvent(android.view.MotionEvent);
    method public boolean dispatchTrackballEvent(android.view.MotionEvent);
    method public <T extends android.view.View> T findViewById(@IdRes int);
    method public final void finish();
    method public android.view.Window getWindow();
    method public android.view.WindowManager getWindowManager();
    method public boolean isFullscreen();
    method public boolean isInteractive();
    method public boolean isScreenBright();
    method public void onActionModeFinished(android.view.ActionMode);
    method public void onActionModeStarted(android.view.ActionMode);
    method public void onAttachedToWindow();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public void onContentChanged();
    method public boolean onCreatePanelMenu(int, android.view.Menu);
    method public android.view.View onCreatePanelView(int);
    method public void onDetachedFromWindow();
    method public void onDreamingStarted();
    method public void onDreamingStopped();
    method public boolean onMenuItemSelected(int, android.view.MenuItem);
    method public boolean onMenuOpened(int, android.view.Menu);
    method public void onPanelClosed(int, android.view.Menu);
    method public boolean onPreparePanel(int, android.view.View, android.view.Menu);
    method public boolean onSearchRequested(android.view.SearchEvent);
    method public boolean onSearchRequested();
    method public void onWakeUp();
    method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams);
    method public void onWindowFocusChanged(boolean);
    method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback);
    method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback, int);
    method @NonNull public final <T extends android.view.View> T requireViewById(@IdRes int);
    method public void setContentView(@LayoutRes int);
    method public void setContentView(android.view.View);
    method public void setContentView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public void setFullscreen(boolean);
    method public void setInteractive(boolean);
    method public void setScreenBright(boolean);
    method public final void wakeUp();
    field public static final String DREAM_META_DATA = "android.service.dream";
    field public static final String SERVICE_INTERFACE = "android.service.dreams.DreamService";
  }

}

package android.service.media {

  public abstract class CameraPrewarmService extends android.app.Service {
    ctor public CameraPrewarmService();
    method public android.os.IBinder onBind(android.content.Intent);
    method public abstract void onCooldown(boolean);
    method public abstract void onPrewarm();
  }

  public abstract class MediaBrowserService extends android.app.Service {
    ctor public MediaBrowserService();
    method public void dump(java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method public final android.os.Bundle getBrowserRootHints();
    method public final android.media.session.MediaSessionManager.RemoteUserInfo getCurrentBrowserInfo();
    method @Nullable public android.media.session.MediaSession.Token getSessionToken();
    method public void notifyChildrenChanged(@NonNull String);
    method public void notifyChildrenChanged(@NonNull String, @NonNull android.os.Bundle);
    method public android.os.IBinder onBind(android.content.Intent);
    method @Nullable public abstract android.service.media.MediaBrowserService.BrowserRoot onGetRoot(@NonNull String, int, @Nullable android.os.Bundle);
    method public abstract void onLoadChildren(@NonNull String, @NonNull android.service.media.MediaBrowserService.Result<java.util.List<android.media.browse.MediaBrowser.MediaItem>>);
    method public void onLoadChildren(@NonNull String, @NonNull android.service.media.MediaBrowserService.Result<java.util.List<android.media.browse.MediaBrowser.MediaItem>>, @NonNull android.os.Bundle);
    method public void onLoadItem(String, android.service.media.MediaBrowserService.Result<android.media.browse.MediaBrowser.MediaItem>);
    method public void setSessionToken(android.media.session.MediaSession.Token);
    field public static final String SERVICE_INTERFACE = "android.media.browse.MediaBrowserService";
  }

  public static final class MediaBrowserService.BrowserRoot {
    ctor public MediaBrowserService.BrowserRoot(@NonNull String, @Nullable android.os.Bundle);
    method public android.os.Bundle getExtras();
    method public String getRootId();
    field public static final String EXTRA_OFFLINE = "android.service.media.extra.OFFLINE";
    field public static final String EXTRA_RECENT = "android.service.media.extra.RECENT";
    field public static final String EXTRA_SUGGESTED = "android.service.media.extra.SUGGESTED";
  }

  public class MediaBrowserService.Result<T> {
    method public void detach();
    method public void sendResult(T);
  }

}

package android.service.notification {

  public final class Condition implements android.os.Parcelable {
    ctor public Condition(android.net.Uri, String, int);
    ctor public Condition(android.net.Uri, String, String, String, int, int, int);
    ctor public Condition(android.os.Parcel);
    method public android.service.notification.Condition copy();
    method public int describeContents();
    method public static boolean isValidId(android.net.Uri, String);
    method public static android.net.Uri.Builder newId(android.content.Context);
    method public static String relevanceToString(int);
    method public static String stateToString(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.notification.Condition> CREATOR;
    field public static final int FLAG_RELEVANT_ALWAYS = 2; // 0x2
    field public static final int FLAG_RELEVANT_NOW = 1; // 0x1
    field public static final String SCHEME = "condition";
    field public static final int STATE_ERROR = 3; // 0x3
    field public static final int STATE_FALSE = 0; // 0x0
    field public static final int STATE_TRUE = 1; // 0x1
    field public static final int STATE_UNKNOWN = 2; // 0x2
    field public final int flags;
    field public final int icon;
    field public final android.net.Uri id;
    field public final String line1;
    field public final String line2;
    field public final int state;
    field public final String summary;
  }

  public abstract class ConditionProviderService extends android.app.Service {
    ctor public ConditionProviderService();
    method public final void notifyCondition(android.service.notification.Condition);
    method public final void notifyConditions(android.service.notification.Condition...);
    method public android.os.IBinder onBind(android.content.Intent);
    method public abstract void onConnected();
    method public void onRequestConditions(int);
    method public abstract void onSubscribe(android.net.Uri);
    method public abstract void onUnsubscribe(android.net.Uri);
    method public static final void requestRebind(android.content.ComponentName);
    method public final void requestUnbind();
    field public static final String EXTRA_RULE_ID = "android.service.notification.extra.RULE_ID";
    field public static final String META_DATA_CONFIGURATION_ACTIVITY = "android.service.zen.automatic.configurationActivity";
    field public static final String META_DATA_RULE_INSTANCE_LIMIT = "android.service.zen.automatic.ruleInstanceLimit";
    field public static final String META_DATA_RULE_TYPE = "android.service.zen.automatic.ruleType";
    field public static final String SERVICE_INTERFACE = "android.service.notification.ConditionProviderService";
  }

  public abstract class NotificationListenerService extends android.app.Service {
    ctor public NotificationListenerService();
    method public final void cancelAllNotifications();
    method @Deprecated public final void cancelNotification(String, String, int);
    method public final void cancelNotification(String);
    method public final void cancelNotifications(String[]);
    method public android.service.notification.StatusBarNotification[] getActiveNotifications();
    method public android.service.notification.StatusBarNotification[] getActiveNotifications(String[]);
    method public final int getCurrentInterruptionFilter();
    method public final int getCurrentListenerHints();
    method public android.service.notification.NotificationListenerService.RankingMap getCurrentRanking();
    method public final java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(@NonNull String, @NonNull android.os.UserHandle);
    method public final java.util.List<android.app.NotificationChannel> getNotificationChannels(@NonNull String, @NonNull android.os.UserHandle);
    method public final android.service.notification.StatusBarNotification[] getSnoozedNotifications();
    method public android.os.IBinder onBind(android.content.Intent);
    method public void onInterruptionFilterChanged(int);
    method public void onListenerConnected();
    method public void onListenerDisconnected();
    method public void onListenerHintsChanged(int);
    method public void onNotificationChannelGroupModified(String, android.os.UserHandle, android.app.NotificationChannelGroup, int);
    method public void onNotificationChannelModified(String, android.os.UserHandle, android.app.NotificationChannel, int);
    method public void onNotificationPosted(android.service.notification.StatusBarNotification);
    method public void onNotificationPosted(android.service.notification.StatusBarNotification, android.service.notification.NotificationListenerService.RankingMap);
    method public void onNotificationRankingUpdate(android.service.notification.NotificationListenerService.RankingMap);
    method public void onNotificationRemoved(android.service.notification.StatusBarNotification);
    method public void onNotificationRemoved(android.service.notification.StatusBarNotification, android.service.notification.NotificationListenerService.RankingMap);
    method public void onNotificationRemoved(android.service.notification.StatusBarNotification, android.service.notification.NotificationListenerService.RankingMap, int);
    method public final void requestInterruptionFilter(int);
    method public final void requestListenerHints(int);
    method public static void requestRebind(android.content.ComponentName);
    method public final void requestUnbind();
    method public final void setNotificationsShown(String[]);
    method public final void snoozeNotification(String, long);
    method public final void updateNotificationChannel(@NonNull String, @NonNull android.os.UserHandle, @NonNull android.app.NotificationChannel);
    field public static final int HINT_HOST_DISABLE_CALL_EFFECTS = 4; // 0x4
    field public static final int HINT_HOST_DISABLE_EFFECTS = 1; // 0x1
    field public static final int HINT_HOST_DISABLE_NOTIFICATION_EFFECTS = 2; // 0x2
    field public static final int INTERRUPTION_FILTER_ALARMS = 4; // 0x4
    field public static final int INTERRUPTION_FILTER_ALL = 1; // 0x1
    field public static final int INTERRUPTION_FILTER_NONE = 3; // 0x3
    field public static final int INTERRUPTION_FILTER_PRIORITY = 2; // 0x2
    field public static final int INTERRUPTION_FILTER_UNKNOWN = 0; // 0x0
    field public static final int NOTIFICATION_CHANNEL_OR_GROUP_ADDED = 1; // 0x1
    field public static final int NOTIFICATION_CHANNEL_OR_GROUP_DELETED = 3; // 0x3
    field public static final int NOTIFICATION_CHANNEL_OR_GROUP_UPDATED = 2; // 0x2
    field public static final int REASON_APP_CANCEL = 8; // 0x8
    field public static final int REASON_APP_CANCEL_ALL = 9; // 0x9
    field public static final int REASON_CANCEL = 2; // 0x2
    field public static final int REASON_CANCEL_ALL = 3; // 0x3
    field public static final int REASON_CHANNEL_BANNED = 17; // 0x11
    field public static final int REASON_CLICK = 1; // 0x1
    field public static final int REASON_ERROR = 4; // 0x4
    field public static final int REASON_GROUP_OPTIMIZATION = 13; // 0xd
    field public static final int REASON_GROUP_SUMMARY_CANCELED = 12; // 0xc
    field public static final int REASON_LISTENER_CANCEL = 10; // 0xa
    field public static final int REASON_LISTENER_CANCEL_ALL = 11; // 0xb
    field public static final int REASON_PACKAGE_BANNED = 7; // 0x7
    field public static final int REASON_PACKAGE_CHANGED = 5; // 0x5
    field public static final int REASON_PACKAGE_SUSPENDED = 14; // 0xe
    field public static final int REASON_PROFILE_TURNED_OFF = 15; // 0xf
    field public static final int REASON_SNOOZED = 18; // 0x12
    field public static final int REASON_TIMEOUT = 19; // 0x13
    field public static final int REASON_UNAUTOBUNDLED = 16; // 0x10
    field public static final int REASON_USER_STOPPED = 6; // 0x6
    field public static final String SERVICE_INTERFACE = "android.service.notification.NotificationListenerService";
    field @Deprecated public static final int SUPPRESSED_EFFECT_SCREEN_OFF = 1; // 0x1
    field @Deprecated public static final int SUPPRESSED_EFFECT_SCREEN_ON = 2; // 0x2
  }

  public static class NotificationListenerService.Ranking {
    ctor public NotificationListenerService.Ranking();
    method public boolean canShowBadge();
    method public android.app.NotificationChannel getChannel();
    method public int getImportance();
    method public CharSequence getImportanceExplanation();
    method public String getKey();
    method public String getOverrideGroupKey();
    method public int getRank();
    method public int getSuppressedVisualEffects();
    method public int getUserSentiment();
    method public boolean isAmbient();
    method public boolean isSuspended();
    method public boolean matchesInterruptionFilter();
    field public static final int USER_SENTIMENT_NEGATIVE = -1; // 0xffffffff
    field public static final int USER_SENTIMENT_NEUTRAL = 0; // 0x0
    field public static final int USER_SENTIMENT_POSITIVE = 1; // 0x1
  }

  public static class NotificationListenerService.RankingMap implements android.os.Parcelable {
    method public int describeContents();
    method public String[] getOrderedKeys();
    method public boolean getRanking(String, android.service.notification.NotificationListenerService.Ranking);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.notification.NotificationListenerService.RankingMap> CREATOR;
  }

  public class StatusBarNotification implements android.os.Parcelable {
    ctor @Deprecated public StatusBarNotification(String, String, int, String, int, int, int, android.app.Notification, android.os.UserHandle, long);
    ctor public StatusBarNotification(android.os.Parcel);
    method public android.service.notification.StatusBarNotification clone();
    method public int describeContents();
    method public String getGroupKey();
    method public int getId();
    method public String getKey();
    method public android.app.Notification getNotification();
    method public String getOverrideGroupKey();
    method public String getPackageName();
    method public long getPostTime();
    method public String getTag();
    method public android.os.UserHandle getUser();
    method @Deprecated public int getUserId();
    method public boolean isClearable();
    method public boolean isGroup();
    method public boolean isOngoing();
    method public void setOverrideGroupKey(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.notification.StatusBarNotification> CREATOR;
  }

}

package android.service.quicksettings {

  public final class Tile implements android.os.Parcelable {
    method public int describeContents();
    method public CharSequence getContentDescription();
    method public android.graphics.drawable.Icon getIcon();
    method public CharSequence getLabel();
    method public int getState();
    method public void setContentDescription(CharSequence);
    method public void setIcon(android.graphics.drawable.Icon);
    method public void setLabel(CharSequence);
    method public void setState(int);
    method public void updateTile();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.quicksettings.Tile> CREATOR;
    field public static final int STATE_ACTIVE = 2; // 0x2
    field public static final int STATE_INACTIVE = 1; // 0x1
    field public static final int STATE_UNAVAILABLE = 0; // 0x0
  }

  public class TileService extends android.app.Service {
    ctor public TileService();
    method public final android.service.quicksettings.Tile getQsTile();
    method public final boolean isLocked();
    method public final boolean isSecure();
    method public android.os.IBinder onBind(android.content.Intent);
    method public void onClick();
    method public void onStartListening();
    method public void onStopListening();
    method public void onTileAdded();
    method public void onTileRemoved();
    method public static final void requestListeningState(android.content.Context, android.content.ComponentName);
    method public final void showDialog(android.app.Dialog);
    method public final void startActivityAndCollapse(android.content.Intent);
    method public final void unlockAndRun(Runnable);
    field public static final String ACTION_QS_TILE = "android.service.quicksettings.action.QS_TILE";
    field public static final String ACTION_QS_TILE_PREFERENCES = "android.service.quicksettings.action.QS_TILE_PREFERENCES";
    field public static final String META_DATA_ACTIVE_TILE = "android.service.quicksettings.ACTIVE_TILE";
  }

}

package android.service.restrictions {

  public abstract class RestrictionsReceiver extends android.content.BroadcastReceiver {
    ctor public RestrictionsReceiver();
    method public void onReceive(android.content.Context, android.content.Intent);
    method public abstract void onRequestPermission(android.content.Context, String, String, String, android.os.PersistableBundle);
  }

}

package android.service.textservice {

  public abstract class SpellCheckerService extends android.app.Service {
    ctor public SpellCheckerService();
    method public abstract android.service.textservice.SpellCheckerService.Session createSession();
    method public final android.os.IBinder onBind(android.content.Intent);
    field public static final String SERVICE_INTERFACE = "android.service.textservice.SpellCheckerService";
  }

  public abstract static class SpellCheckerService.Session {
    ctor public SpellCheckerService.Session();
    method public android.os.Bundle getBundle();
    method public String getLocale();
    method public void onCancel();
    method public void onClose();
    method public abstract void onCreate();
    method public android.view.textservice.SentenceSuggestionsInfo[] onGetSentenceSuggestionsMultiple(android.view.textservice.TextInfo[], int);
    method public abstract android.view.textservice.SuggestionsInfo onGetSuggestions(android.view.textservice.TextInfo, int);
    method public android.view.textservice.SuggestionsInfo[] onGetSuggestionsMultiple(android.view.textservice.TextInfo[], int, boolean);
  }

}

package android.service.voice {

  public class AlwaysOnHotwordDetector {
    method public android.content.Intent createEnrollIntent();
    method public android.content.Intent createReEnrollIntent();
    method public android.content.Intent createUnEnrollIntent();
    method public int getSupportedRecognitionModes();
    method public boolean startRecognition(int);
    method public boolean stopRecognition();
    field public static final int RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS = 2; // 0x2
    field public static final int RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO = 1; // 0x1
    field public static final int RECOGNITION_MODE_USER_IDENTIFICATION = 2; // 0x2
    field public static final int RECOGNITION_MODE_VOICE_TRIGGER = 1; // 0x1
    field public static final int STATE_HARDWARE_UNAVAILABLE = -2; // 0xfffffffe
    field public static final int STATE_KEYPHRASE_ENROLLED = 2; // 0x2
    field public static final int STATE_KEYPHRASE_UNENROLLED = 1; // 0x1
    field public static final int STATE_KEYPHRASE_UNSUPPORTED = -1; // 0xffffffff
  }

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

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

  public class VoiceInteractionService extends android.app.Service {
    ctor public VoiceInteractionService();
    method public final android.service.voice.AlwaysOnHotwordDetector createAlwaysOnHotwordDetector(String, java.util.Locale, android.service.voice.AlwaysOnHotwordDetector.Callback);
    method public int getDisabledShowContext();
    method public static boolean isActiveService(android.content.Context, android.content.ComponentName);
    method public android.os.IBinder onBind(android.content.Intent);
    method public void onLaunchVoiceAssistFromKeyguard();
    method public void onReady();
    method public void onShutdown();
    method public void setDisabledShowContext(int);
    method public void showSession(android.os.Bundle, int);
    field public static final String SERVICE_INTERFACE = "android.service.voice.VoiceInteractionService";
    field public static final String SERVICE_META_DATA = "android.voice_interaction";
  }

  public class VoiceInteractionSession implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback {
    ctor public VoiceInteractionSession(android.content.Context);
    ctor public VoiceInteractionSession(android.content.Context, android.os.Handler);
    method public void closeSystemDialogs();
    method public void dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method public void finish();
    method public android.content.Context getContext();
    method public int getDisabledShowContext();
    method public android.view.LayoutInflater getLayoutInflater();
    method public int getUserDisabledShowContext();
    method public android.app.Dialog getWindow();
    method public void hide();
    method public void onAssistStructureFailure(Throwable);
    method public void onBackPressed();
    method public void onCancelRequest(android.service.voice.VoiceInteractionSession.Request);
    method public void onCloseSystemDialogs();
    method public void onComputeInsets(android.service.voice.VoiceInteractionSession.Insets);
    method public void onConfigurationChanged(android.content.res.Configuration);
    method public void onCreate();
    method public android.view.View onCreateContentView();
    method public void onDestroy();
    method public boolean[] onGetSupportedCommands(String[]);
    method public void onHandleAssist(@Nullable android.os.Bundle, @Nullable android.app.assist.AssistStructure, @Nullable android.app.assist.AssistContent);
    method public void onHandleAssistSecondary(@Nullable android.os.Bundle, @Nullable android.app.assist.AssistStructure, @Nullable android.app.assist.AssistContent, int, int);
    method public void onHandleScreenshot(@Nullable android.graphics.Bitmap);
    method public void onHide();
    method public boolean onKeyDown(int, android.view.KeyEvent);
    method public boolean onKeyLongPress(int, android.view.KeyEvent);
    method public boolean onKeyMultiple(int, int, android.view.KeyEvent);
    method public boolean onKeyUp(int, android.view.KeyEvent);
    method public void onLockscreenShown();
    method public void onLowMemory();
    method public void onPrepareShow(android.os.Bundle, int);
    method public void onRequestAbortVoice(android.service.voice.VoiceInteractionSession.AbortVoiceRequest);
    method public void onRequestCommand(android.service.voice.VoiceInteractionSession.CommandRequest);
    method public void onRequestCompleteVoice(android.service.voice.VoiceInteractionSession.CompleteVoiceRequest);
    method public void onRequestConfirmation(android.service.voice.VoiceInteractionSession.ConfirmationRequest);
    method public void onRequestPickOption(android.service.voice.VoiceInteractionSession.PickOptionRequest);
    method public void onShow(android.os.Bundle, int);
    method public void onTaskFinished(android.content.Intent, int);
    method public void onTaskStarted(android.content.Intent, int);
    method public void onTrimMemory(int);
    method public void setContentView(android.view.View);
    method public void setDisabledShowContext(int);
    method public void setKeepAwake(boolean);
    method public void setTheme(int);
    method public void setUiEnabled(boolean);
    method public void show(android.os.Bundle, int);
    method public void startAssistantActivity(android.content.Intent);
    method public void startVoiceActivity(android.content.Intent);
    field public static final int SHOW_SOURCE_ACTIVITY = 16; // 0x10
    field public static final int SHOW_SOURCE_APPLICATION = 8; // 0x8
    field public static final int SHOW_SOURCE_ASSIST_GESTURE = 4; // 0x4
    field public static final int SHOW_WITH_ASSIST = 1; // 0x1
    field public static final int SHOW_WITH_SCREENSHOT = 2; // 0x2
  }

  public static final class VoiceInteractionSession.AbortVoiceRequest extends android.service.voice.VoiceInteractionSession.Request {
    method @Deprecated @Nullable public CharSequence getMessage();
    method @Nullable public android.app.VoiceInteractor.Prompt getVoicePrompt();
    method public void sendAbortResult(android.os.Bundle);
  }

  public static final class VoiceInteractionSession.CommandRequest extends android.service.voice.VoiceInteractionSession.Request {
    method public String getCommand();
    method public void sendIntermediateResult(android.os.Bundle);
    method public void sendResult(android.os.Bundle);
  }

  public static final class VoiceInteractionSession.CompleteVoiceRequest extends android.service.voice.VoiceInteractionSession.Request {
    method @Deprecated @Nullable public CharSequence getMessage();
    method @Nullable public android.app.VoiceInteractor.Prompt getVoicePrompt();
    method public void sendCompleteResult(android.os.Bundle);
  }

  public static final class VoiceInteractionSession.ConfirmationRequest extends android.service.voice.VoiceInteractionSession.Request {
    method @Deprecated @Nullable public CharSequence getPrompt();
    method @Nullable public android.app.VoiceInteractor.Prompt getVoicePrompt();
    method public void sendConfirmationResult(boolean, android.os.Bundle);
  }

  public static final class VoiceInteractionSession.Insets {
    ctor public VoiceInteractionSession.Insets();
    field public static final int TOUCHABLE_INSETS_CONTENT = 1; // 0x1
    field public static final int TOUCHABLE_INSETS_FRAME = 0; // 0x0
    field public static final int TOUCHABLE_INSETS_REGION = 3; // 0x3
    field public final android.graphics.Rect contentInsets;
    field public int touchableInsets;
    field public final android.graphics.Region touchableRegion;
  }

  public static final class VoiceInteractionSession.PickOptionRequest extends android.service.voice.VoiceInteractionSession.Request {
    method public android.app.VoiceInteractor.PickOptionRequest.Option[] getOptions();
    method @Deprecated @Nullable public CharSequence getPrompt();
    method @Nullable public android.app.VoiceInteractor.Prompt getVoicePrompt();
    method public void sendIntermediatePickOptionResult(android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
    method public void sendPickOptionResult(android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
  }

  public static class VoiceInteractionSession.Request {
    method public void cancel();
    method public String getCallingPackage();
    method public int getCallingUid();
    method public android.os.Bundle getExtras();
    method public boolean isActive();
  }

  public abstract class VoiceInteractionSessionService extends android.app.Service {
    ctor public VoiceInteractionSessionService();
    method public android.os.IBinder onBind(android.content.Intent);
    method public abstract android.service.voice.VoiceInteractionSession onNewSession(android.os.Bundle);
  }

}

package android.service.vr {

  public abstract class VrListenerService extends android.app.Service {
    ctor public VrListenerService();
    method public static final boolean isVrModePackageEnabled(@NonNull android.content.Context, @NonNull android.content.ComponentName);
    method public android.os.IBinder onBind(android.content.Intent);
    method public void onCurrentVrActivityChanged(android.content.ComponentName);
    field public static final String SERVICE_INTERFACE = "android.service.vr.VrListenerService";
  }

}

package android.service.wallpaper {

  public abstract class WallpaperService extends android.app.Service {
    ctor public WallpaperService();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract android.service.wallpaper.WallpaperService.Engine onCreateEngine();
    field public static final String SERVICE_INTERFACE = "android.service.wallpaper.WallpaperService";
    field public static final String SERVICE_META_DATA = "android.service.wallpaper";
  }

  public class WallpaperService.Engine {
    ctor public WallpaperService.Engine();
    method protected void dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method public int getDesiredMinimumHeight();
    method public int getDesiredMinimumWidth();
    method public android.view.SurfaceHolder getSurfaceHolder();
    method public boolean isPreview();
    method public boolean isVisible();
    method public void notifyColorsChanged();
    method public void onApplyWindowInsets(android.view.WindowInsets);
    method public android.os.Bundle onCommand(String, int, int, int, android.os.Bundle, boolean);
    method @Nullable public android.app.WallpaperColors onComputeColors();
    method public void onCreate(android.view.SurfaceHolder);
    method public void onDesiredSizeChanged(int, int);
    method public void onDestroy();
    method public void onOffsetsChanged(float, float, float, float, int, int);
    method public void onSurfaceChanged(android.view.SurfaceHolder, int, int, int);
    method public void onSurfaceCreated(android.view.SurfaceHolder);
    method public void onSurfaceDestroyed(android.view.SurfaceHolder);
    method public void onSurfaceRedrawNeeded(android.view.SurfaceHolder);
    method public void onTouchEvent(android.view.MotionEvent);
    method public void onVisibilityChanged(boolean);
    method public void setOffsetNotificationsEnabled(boolean);
    method public void setTouchEventsEnabled(boolean);
  }

}

package android.speech {

  public interface RecognitionListener {
    method public void onBeginningOfSpeech();
    method public void onBufferReceived(byte[]);
    method public void onEndOfSpeech();
    method public void onError(int);
    method public void onEvent(int, android.os.Bundle);
    method public void onPartialResults(android.os.Bundle);
    method public void onReadyForSpeech(android.os.Bundle);
    method public void onResults(android.os.Bundle);
    method public void onRmsChanged(float);
  }

  public abstract class RecognitionService extends android.app.Service {
    ctor public RecognitionService();
    method public final android.os.IBinder onBind(android.content.Intent);
    method protected abstract void onCancel(android.speech.RecognitionService.Callback);
    method protected abstract void onStartListening(android.content.Intent, android.speech.RecognitionService.Callback);
    method protected abstract void onStopListening(android.speech.RecognitionService.Callback);
    field public static final String SERVICE_INTERFACE = "android.speech.RecognitionService";
    field public static final String SERVICE_META_DATA = "android.speech";
  }

  public class RecognitionService.Callback {
    method public void beginningOfSpeech() throws android.os.RemoteException;
    method public void bufferReceived(byte[]) throws android.os.RemoteException;
    method public void endOfSpeech() throws android.os.RemoteException;
    method public void error(int) throws android.os.RemoteException;
    method public int getCallingUid();
    method public void partialResults(android.os.Bundle) throws android.os.RemoteException;
    method public void readyForSpeech(android.os.Bundle) throws android.os.RemoteException;
    method public void results(android.os.Bundle) throws android.os.RemoteException;
    method public void rmsChanged(float) throws android.os.RemoteException;
  }

  public class RecognizerIntent {
    method public static final android.content.Intent getVoiceDetailsIntent(android.content.Context);
    field public static final String ACTION_GET_LANGUAGE_DETAILS = "android.speech.action.GET_LANGUAGE_DETAILS";
    field public static final String ACTION_RECOGNIZE_SPEECH = "android.speech.action.RECOGNIZE_SPEECH";
    field public static final String ACTION_VOICE_SEARCH_HANDS_FREE = "android.speech.action.VOICE_SEARCH_HANDS_FREE";
    field public static final String ACTION_WEB_SEARCH = "android.speech.action.WEB_SEARCH";
    field public static final String DETAILS_META_DATA = "android.speech.DETAILS";
    field public static final String EXTRA_CALLING_PACKAGE = "calling_package";
    field public static final String EXTRA_CONFIDENCE_SCORES = "android.speech.extra.CONFIDENCE_SCORES";
    field public static final String EXTRA_LANGUAGE = "android.speech.extra.LANGUAGE";
    field public static final String EXTRA_LANGUAGE_MODEL = "android.speech.extra.LANGUAGE_MODEL";
    field public static final String EXTRA_LANGUAGE_PREFERENCE = "android.speech.extra.LANGUAGE_PREFERENCE";
    field public static final String EXTRA_MAX_RESULTS = "android.speech.extra.MAX_RESULTS";
    field public static final String EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE = "android.speech.extra.ONLY_RETURN_LANGUAGE_PREFERENCE";
    field public static final String EXTRA_ORIGIN = "android.speech.extra.ORIGIN";
    field public static final String EXTRA_PARTIAL_RESULTS = "android.speech.extra.PARTIAL_RESULTS";
    field public static final String EXTRA_PREFER_OFFLINE = "android.speech.extra.PREFER_OFFLINE";
    field public static final String EXTRA_PROMPT = "android.speech.extra.PROMPT";
    field public static final String EXTRA_RESULTS = "android.speech.extra.RESULTS";
    field public static final String EXTRA_RESULTS_PENDINGINTENT = "android.speech.extra.RESULTS_PENDINGINTENT";
    field public static final String EXTRA_RESULTS_PENDINGINTENT_BUNDLE = "android.speech.extra.RESULTS_PENDINGINTENT_BUNDLE";
    field public static final String EXTRA_SECURE = "android.speech.extras.EXTRA_SECURE";
    field public static final String EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS";
    field public static final String EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_MINIMUM_LENGTH_MILLIS";
    field public static final String EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS";
    field public static final String EXTRA_SUPPORTED_LANGUAGES = "android.speech.extra.SUPPORTED_LANGUAGES";
    field public static final String EXTRA_WEB_SEARCH_ONLY = "android.speech.extra.WEB_SEARCH_ONLY";
    field public static final String LANGUAGE_MODEL_FREE_FORM = "free_form";
    field public static final String LANGUAGE_MODEL_WEB_SEARCH = "web_search";
    field public static final int RESULT_AUDIO_ERROR = 5; // 0x5
    field public static final int RESULT_CLIENT_ERROR = 2; // 0x2
    field public static final int RESULT_NETWORK_ERROR = 4; // 0x4
    field public static final int RESULT_NO_MATCH = 1; // 0x1
    field public static final int RESULT_SERVER_ERROR = 3; // 0x3
  }

  public class RecognizerResultsIntent {
    field public static final String ACTION_VOICE_SEARCH_RESULTS = "android.speech.action.VOICE_SEARCH_RESULTS";
    field public static final String EXTRA_VOICE_SEARCH_RESULT_HTML = "android.speech.extras.VOICE_SEARCH_RESULT_HTML";
    field public static final String EXTRA_VOICE_SEARCH_RESULT_HTML_BASE_URLS = "android.speech.extras.VOICE_SEARCH_RESULT_HTML_BASE_URLS";
    field public static final String EXTRA_VOICE_SEARCH_RESULT_HTTP_HEADERS = "android.speech.extras.EXTRA_VOICE_SEARCH_RESULT_HTTP_HEADERS";
    field public static final String EXTRA_VOICE_SEARCH_RESULT_STRINGS = "android.speech.extras.VOICE_SEARCH_RESULT_STRINGS";
    field public static final String EXTRA_VOICE_SEARCH_RESULT_URLS = "android.speech.extras.VOICE_SEARCH_RESULT_URLS";
    field public static final String URI_SCHEME_INLINE = "inline";
  }

  public class SpeechRecognizer {
    method public void cancel();
    method public static android.speech.SpeechRecognizer createSpeechRecognizer(android.content.Context);
    method public static android.speech.SpeechRecognizer createSpeechRecognizer(android.content.Context, android.content.ComponentName);
    method public void destroy();
    method public static boolean isRecognitionAvailable(android.content.Context);
    method public void setRecognitionListener(android.speech.RecognitionListener);
    method public void startListening(android.content.Intent);
    method public void stopListening();
    field public static final String CONFIDENCE_SCORES = "confidence_scores";
    field public static final int ERROR_AUDIO = 3; // 0x3
    field public static final int ERROR_CLIENT = 5; // 0x5
    field public static final int ERROR_INSUFFICIENT_PERMISSIONS = 9; // 0x9
    field public static final int ERROR_NETWORK = 2; // 0x2
    field public static final int ERROR_NETWORK_TIMEOUT = 1; // 0x1
    field public static final int ERROR_NO_MATCH = 7; // 0x7
    field public static final int ERROR_RECOGNIZER_BUSY = 8; // 0x8
    field public static final int ERROR_SERVER = 4; // 0x4
    field public static final int ERROR_SPEECH_TIMEOUT = 6; // 0x6
    field public static final String RESULTS_RECOGNITION = "results_recognition";
  }

}

package android.speech.tts {

  public interface SynthesisCallback {
    method public int audioAvailable(byte[], int, int);
    method public int done();
    method public void error();
    method public void error(int);
    method public int getMaxBufferSize();
    method public boolean hasFinished();
    method public boolean hasStarted();
    method public default void rangeStart(int, int, int);
    method public int start(int, int, @IntRange(from=1, to=2) int);
  }

  public final class SynthesisRequest {
    ctor public SynthesisRequest(String, android.os.Bundle);
    ctor public SynthesisRequest(CharSequence, android.os.Bundle);
    method public int getCallerUid();
    method public CharSequence getCharSequenceText();
    method public String getCountry();
    method public String getLanguage();
    method public android.os.Bundle getParams();
    method public int getPitch();
    method public int getSpeechRate();
    method @Deprecated public String getText();
    method public String getVariant();
    method public String getVoiceName();
  }

  public class TextToSpeech {
    ctor public TextToSpeech(android.content.Context, android.speech.tts.TextToSpeech.OnInitListener);
    ctor public TextToSpeech(android.content.Context, android.speech.tts.TextToSpeech.OnInitListener, String);
    method public int addEarcon(String, String, @RawRes int);
    method @Deprecated public int addEarcon(String, String);
    method public int addEarcon(String, java.io.File);
    method public int addSpeech(String, String, @RawRes int);
    method public int addSpeech(CharSequence, String, @RawRes int);
    method public int addSpeech(String, String);
    method public int addSpeech(CharSequence, java.io.File);
    method @Deprecated public boolean areDefaultsEnforced();
    method public java.util.Set<java.util.Locale> getAvailableLanguages();
    method public String getDefaultEngine();
    method @Deprecated public java.util.Locale getDefaultLanguage();
    method public android.speech.tts.Voice getDefaultVoice();
    method public java.util.List<android.speech.tts.TextToSpeech.EngineInfo> getEngines();
    method @Deprecated public java.util.Set<java.lang.String> getFeatures(java.util.Locale);
    method @Deprecated public java.util.Locale getLanguage();
    method public static int getMaxSpeechInputLength();
    method public android.speech.tts.Voice getVoice();
    method public java.util.Set<android.speech.tts.Voice> getVoices();
    method public int isLanguageAvailable(java.util.Locale);
    method public boolean isSpeaking();
    method public int playEarcon(String, int, android.os.Bundle, String);
    method @Deprecated public int playEarcon(String, int, java.util.HashMap<java.lang.String,java.lang.String>);
    method @Deprecated public int playSilence(long, int, java.util.HashMap<java.lang.String,java.lang.String>);
    method public int playSilentUtterance(long, int, String);
    method public int setAudioAttributes(android.media.AudioAttributes);
    method @Deprecated public int setEngineByPackageName(String);
    method public int setLanguage(java.util.Locale);
    method @Deprecated public int setOnUtteranceCompletedListener(android.speech.tts.TextToSpeech.OnUtteranceCompletedListener);
    method public int setOnUtteranceProgressListener(android.speech.tts.UtteranceProgressListener);
    method public int setPitch(float);
    method public int setSpeechRate(float);
    method public int setVoice(android.speech.tts.Voice);
    method public void shutdown();
    method public int speak(CharSequence, int, android.os.Bundle, String);
    method @Deprecated public int speak(String, int, java.util.HashMap<java.lang.String,java.lang.String>);
    method public int stop();
    method public int synthesizeToFile(CharSequence, android.os.Bundle, java.io.File, String);
    method @Deprecated public int synthesizeToFile(String, java.util.HashMap<java.lang.String,java.lang.String>, String);
    field public static final String ACTION_TTS_QUEUE_PROCESSING_COMPLETED = "android.speech.tts.TTS_QUEUE_PROCESSING_COMPLETED";
    field public static final int ERROR = -1; // 0xffffffff
    field public static final int ERROR_INVALID_REQUEST = -8; // 0xfffffff8
    field public static final int ERROR_NETWORK = -6; // 0xfffffffa
    field public static final int ERROR_NETWORK_TIMEOUT = -7; // 0xfffffff9
    field public static final int ERROR_NOT_INSTALLED_YET = -9; // 0xfffffff7
    field public static final int ERROR_OUTPUT = -5; // 0xfffffffb
    field public static final int ERROR_SERVICE = -4; // 0xfffffffc
    field public static final int ERROR_SYNTHESIS = -3; // 0xfffffffd
    field public static final int LANG_AVAILABLE = 0; // 0x0
    field public static final int LANG_COUNTRY_AVAILABLE = 1; // 0x1
    field public static final int LANG_COUNTRY_VAR_AVAILABLE = 2; // 0x2
    field public static final int LANG_MISSING_DATA = -1; // 0xffffffff
    field public static final int LANG_NOT_SUPPORTED = -2; // 0xfffffffe
    field public static final int QUEUE_ADD = 1; // 0x1
    field public static final int QUEUE_FLUSH = 0; // 0x0
    field public static final int STOPPED = -2; // 0xfffffffe
    field public static final int SUCCESS = 0; // 0x0
  }

  public class TextToSpeech.Engine {
    ctor public TextToSpeech.Engine();
    field public static final String ACTION_CHECK_TTS_DATA = "android.speech.tts.engine.CHECK_TTS_DATA";
    field public static final String ACTION_GET_SAMPLE_TEXT = "android.speech.tts.engine.GET_SAMPLE_TEXT";
    field public static final String ACTION_INSTALL_TTS_DATA = "android.speech.tts.engine.INSTALL_TTS_DATA";
    field public static final String ACTION_TTS_DATA_INSTALLED = "android.speech.tts.engine.TTS_DATA_INSTALLED";
    field @Deprecated public static final int CHECK_VOICE_DATA_BAD_DATA = -1; // 0xffffffff
    field public static final int CHECK_VOICE_DATA_FAIL = 0; // 0x0
    field @Deprecated public static final int CHECK_VOICE_DATA_MISSING_DATA = -2; // 0xfffffffe
    field @Deprecated public static final int CHECK_VOICE_DATA_MISSING_VOLUME = -3; // 0xfffffffd
    field public static final int CHECK_VOICE_DATA_PASS = 1; // 0x1
    field public static final int DEFAULT_STREAM = 3; // 0x3
    field public static final String EXTRA_AVAILABLE_VOICES = "availableVoices";
    field @Deprecated public static final String EXTRA_CHECK_VOICE_DATA_FOR = "checkVoiceDataFor";
    field public static final String EXTRA_SAMPLE_TEXT = "sampleText";
    field @Deprecated public static final String EXTRA_TTS_DATA_INSTALLED = "dataInstalled";
    field public static final String EXTRA_UNAVAILABLE_VOICES = "unavailableVoices";
    field @Deprecated public static final String EXTRA_VOICE_DATA_FILES = "dataFiles";
    field @Deprecated public static final String EXTRA_VOICE_DATA_FILES_INFO = "dataFilesInfo";
    field @Deprecated public static final String EXTRA_VOICE_DATA_ROOT_DIRECTORY = "dataRoot";
    field public static final String INTENT_ACTION_TTS_SERVICE = "android.intent.action.TTS_SERVICE";
    field @Deprecated public static final String KEY_FEATURE_EMBEDDED_SYNTHESIS = "embeddedTts";
    field public static final String KEY_FEATURE_NETWORK_RETRIES_COUNT = "networkRetriesCount";
    field @Deprecated public static final String KEY_FEATURE_NETWORK_SYNTHESIS = "networkTts";
    field public static final String KEY_FEATURE_NETWORK_TIMEOUT_MS = "networkTimeoutMs";
    field public static final String KEY_FEATURE_NOT_INSTALLED = "notInstalled";
    field public static final String KEY_PARAM_PAN = "pan";
    field public static final String KEY_PARAM_SESSION_ID = "sessionId";
    field public static final String KEY_PARAM_STREAM = "streamType";
    field public static final String KEY_PARAM_UTTERANCE_ID = "utteranceId";
    field public static final String KEY_PARAM_VOLUME = "volume";
    field public static final String SERVICE_META_DATA = "android.speech.tts";
  }

  public static class TextToSpeech.EngineInfo {
    ctor public TextToSpeech.EngineInfo();
    field public int icon;
    field public String label;
    field public String name;
  }

  public static interface TextToSpeech.OnInitListener {
    method public void onInit(int);
  }

  @Deprecated public static interface TextToSpeech.OnUtteranceCompletedListener {
    method @Deprecated public void onUtteranceCompleted(String);
  }

  public abstract class TextToSpeechService extends android.app.Service {
    ctor public TextToSpeechService();
    method public android.os.IBinder onBind(android.content.Intent);
    method public String onGetDefaultVoiceNameFor(String, String, String);
    method protected java.util.Set<java.lang.String> onGetFeaturesForLanguage(String, String, String);
    method protected abstract String[] onGetLanguage();
    method public java.util.List<android.speech.tts.Voice> onGetVoices();
    method protected abstract int onIsLanguageAvailable(String, String, String);
    method public int onIsValidVoiceName(String);
    method protected abstract int onLoadLanguage(String, String, String);
    method public int onLoadVoice(String);
    method protected abstract void onStop();
    method protected abstract void onSynthesizeText(android.speech.tts.SynthesisRequest, android.speech.tts.SynthesisCallback);
  }

  public abstract class UtteranceProgressListener {
    ctor public UtteranceProgressListener();
    method public void onAudioAvailable(String, byte[]);
    method public void onBeginSynthesis(String, int, int, int);
    method public abstract void onDone(String);
    method @Deprecated public abstract void onError(String);
    method public void onError(String, int);
    method public void onRangeStart(String, int, int, int);
    method public abstract void onStart(String);
    method public void onStop(String, boolean);
  }

  public class Voice implements android.os.Parcelable {
    ctor public Voice(String, java.util.Locale, int, int, boolean, java.util.Set<java.lang.String>);
    method public int describeContents();
    method public java.util.Set<java.lang.String> getFeatures();
    method public int getLatency();
    method public java.util.Locale getLocale();
    method public String getName();
    method public int getQuality();
    method public boolean isNetworkConnectionRequired();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.speech.tts.Voice> CREATOR;
    field public static final int LATENCY_HIGH = 400; // 0x190
    field public static final int LATENCY_LOW = 200; // 0xc8
    field public static final int LATENCY_NORMAL = 300; // 0x12c
    field public static final int LATENCY_VERY_HIGH = 500; // 0x1f4
    field public static final int LATENCY_VERY_LOW = 100; // 0x64
    field public static final int QUALITY_HIGH = 400; // 0x190
    field public static final int QUALITY_LOW = 200; // 0xc8
    field public static final int QUALITY_NORMAL = 300; // 0x12c
    field public static final int QUALITY_VERY_HIGH = 500; // 0x1f4
    field public static final int QUALITY_VERY_LOW = 100; // 0x64
  }

}

package android.system {

  public final class ErrnoException extends java.lang.Exception {
    ctor public ErrnoException(String, int);
    ctor public ErrnoException(String, int, Throwable);
    field public final int errno;
  }

  public class Int64Ref {
    ctor public Int64Ref(long);
    field public long value;
  }

  public final class Os {
    method public static java.io.FileDescriptor accept(java.io.FileDescriptor, java.net.InetSocketAddress) throws android.system.ErrnoException, java.net.SocketException;
    method public static boolean access(String, int) throws android.system.ErrnoException;
    method public static void bind(java.io.FileDescriptor, java.net.InetAddress, int) throws android.system.ErrnoException, java.net.SocketException;
    method public static void chmod(String, int) throws android.system.ErrnoException;
    method public static void chown(String, int, int) throws android.system.ErrnoException;
    method public static void close(java.io.FileDescriptor) throws android.system.ErrnoException;
    method public static void connect(java.io.FileDescriptor, java.net.InetAddress, int) throws android.system.ErrnoException, java.net.SocketException;
    method public static java.io.FileDescriptor dup(java.io.FileDescriptor) throws android.system.ErrnoException;
    method public static java.io.FileDescriptor dup2(java.io.FileDescriptor, int) throws android.system.ErrnoException;
    method public static String[] environ();
    method public static void execv(String, String[]) throws android.system.ErrnoException;
    method public static void execve(String, String[], String[]) throws android.system.ErrnoException;
    method public static void fchmod(java.io.FileDescriptor, int) throws android.system.ErrnoException;
    method public static void fchown(java.io.FileDescriptor, int, int) throws android.system.ErrnoException;
    method public static void fdatasync(java.io.FileDescriptor) throws android.system.ErrnoException;
    method public static android.system.StructStat fstat(java.io.FileDescriptor) throws android.system.ErrnoException;
    method public static android.system.StructStatVfs fstatvfs(java.io.FileDescriptor) throws android.system.ErrnoException;
    method public static void fsync(java.io.FileDescriptor) throws android.system.ErrnoException;
    method public static void ftruncate(java.io.FileDescriptor, long) throws android.system.ErrnoException;
    method public static String gai_strerror(int);
    method public static int getegid();
    method public static String getenv(String);
    method public static int geteuid();
    method public static int getgid();
    method public static java.net.SocketAddress getpeername(java.io.FileDescriptor) throws android.system.ErrnoException;
    method public static int getpid();
    method public static int getppid();
    method public static java.net.SocketAddress getsockname(java.io.FileDescriptor) throws android.system.ErrnoException;
    method public static int gettid();
    method public static int getuid();
    method public static byte[] getxattr(String, String) throws android.system.ErrnoException;
    method public static String if_indextoname(int);
    method public static int if_nametoindex(String);
    method public static java.net.InetAddress inet_pton(int, String);
    method public static boolean isatty(java.io.FileDescriptor);
    method public static void kill(int, int) throws android.system.ErrnoException;
    method public static void lchown(String, int, int) throws android.system.ErrnoException;
    method public static void link(String, String) throws android.system.ErrnoException;
    method public static void listen(java.io.FileDescriptor, int) throws android.system.ErrnoException;
    method public static String[] listxattr(String) throws android.system.ErrnoException;
    method public static long lseek(java.io.FileDescriptor, long, int) throws android.system.ErrnoException;
    method public static android.system.StructStat lstat(String) throws android.system.ErrnoException;
    method public static void mincore(long, long, byte[]) throws android.system.ErrnoException;
    method public static void mkdir(String, int) throws android.system.ErrnoException;
    method public static void mkfifo(String, int) throws android.system.ErrnoException;
    method public static void mlock(long, long) throws android.system.ErrnoException;
    method public static long mmap(long, long, int, int, java.io.FileDescriptor, long) throws android.system.ErrnoException;
    method public static void msync(long, long, int) throws android.system.ErrnoException;
    method public static void munlock(long, long) throws android.system.ErrnoException;
    method public static void munmap(long, long) throws android.system.ErrnoException;
    method public static java.io.FileDescriptor open(String, int, int) throws android.system.ErrnoException;
    method public static java.io.FileDescriptor[] pipe() throws android.system.ErrnoException;
    method public static int poll(android.system.StructPollfd[], int) throws android.system.ErrnoException;
    method public static void posix_fallocate(java.io.FileDescriptor, long, long) throws android.system.ErrnoException;
    method public static int prctl(int, long, long, long, long) throws android.system.ErrnoException;
    method public static int pread(java.io.FileDescriptor, java.nio.ByteBuffer, long) throws android.system.ErrnoException, java.io.InterruptedIOException;
    method public static int pread(java.io.FileDescriptor, byte[], int, int, long) throws android.system.ErrnoException, java.io.InterruptedIOException;
    method public static int pwrite(java.io.FileDescriptor, java.nio.ByteBuffer, long) throws android.system.ErrnoException, java.io.InterruptedIOException;
    method public static int pwrite(java.io.FileDescriptor, byte[], int, int, long) throws android.system.ErrnoException, java.io.InterruptedIOException;
    method public static int read(java.io.FileDescriptor, java.nio.ByteBuffer) throws android.system.ErrnoException, java.io.InterruptedIOException;
    method public static int read(java.io.FileDescriptor, byte[], int, int) throws android.system.ErrnoException, java.io.InterruptedIOException;
    method public static String readlink(String) throws android.system.ErrnoException;
    method public static int readv(java.io.FileDescriptor, Object[], int[], int[]) throws android.system.ErrnoException, java.io.InterruptedIOException;
    method public static int recvfrom(java.io.FileDescriptor, java.nio.ByteBuffer, int, java.net.InetSocketAddress) throws android.system.ErrnoException, java.net.SocketException;
    method public static int recvfrom(java.io.FileDescriptor, byte[], int, int, int, java.net.InetSocketAddress) throws android.system.ErrnoException, java.net.SocketException;
    method public static void remove(String) throws android.system.ErrnoException;
    method public static void removexattr(String, String) throws android.system.ErrnoException;
    method public static void rename(String, String) throws android.system.ErrnoException;
    method public static long sendfile(java.io.FileDescriptor, java.io.FileDescriptor, android.system.Int64Ref, long) throws android.system.ErrnoException;
    method public static int sendto(java.io.FileDescriptor, java.nio.ByteBuffer, int, java.net.InetAddress, int) throws android.system.ErrnoException, java.net.SocketException;
    method public static int sendto(java.io.FileDescriptor, byte[], int, int, int, java.net.InetAddress, int) throws android.system.ErrnoException, java.net.SocketException;
    method @Deprecated public static void setegid(int) throws android.system.ErrnoException;
    method public static void setenv(String, String, boolean) throws android.system.ErrnoException;
    method @Deprecated public static void seteuid(int) throws android.system.ErrnoException;
    method @Deprecated public static void setgid(int) throws android.system.ErrnoException;
    method public static int setsid() throws android.system.ErrnoException;
    method public static void setsockoptInt(java.io.FileDescriptor, int, int, int) throws android.system.ErrnoException;
    method @Deprecated public static void setuid(int) throws android.system.ErrnoException;
    method public static void setxattr(String, String, byte[], int) throws android.system.ErrnoException;
    method public static void shutdown(java.io.FileDescriptor, int) throws android.system.ErrnoException;
    method public static java.io.FileDescriptor socket(int, int, int) throws android.system.ErrnoException;
    method public static void socketpair(int, int, int, java.io.FileDescriptor, java.io.FileDescriptor) throws android.system.ErrnoException;
    method public static android.system.StructStat stat(String) throws android.system.ErrnoException;
    method public static android.system.StructStatVfs statvfs(String) throws android.system.ErrnoException;
    method public static String strerror(int);
    method public static String strsignal(int);
    method public static void symlink(String, String) throws android.system.ErrnoException;
    method public static long sysconf(int);
    method public static void tcdrain(java.io.FileDescriptor) throws android.system.ErrnoException;
    method public static void tcsendbreak(java.io.FileDescriptor, int) throws android.system.ErrnoException;
    method public static int umask(int);
    method public static android.system.StructUtsname uname();
    method public static void unsetenv(String) throws android.system.ErrnoException;
    method public static int write(java.io.FileDescriptor, java.nio.ByteBuffer) throws android.system.ErrnoException, java.io.InterruptedIOException;
    method public static int write(java.io.FileDescriptor, byte[], int, int) throws android.system.ErrnoException, java.io.InterruptedIOException;
    method public static int writev(java.io.FileDescriptor, Object[], int[], int[]) throws android.system.ErrnoException, java.io.InterruptedIOException;
  }

  public final class OsConstants {
    method public static boolean S_ISBLK(int);
    method public static boolean S_ISCHR(int);
    method public static boolean S_ISDIR(int);
    method public static boolean S_ISFIFO(int);
    method public static boolean S_ISLNK(int);
    method public static boolean S_ISREG(int);
    method public static boolean S_ISSOCK(int);
    method public static boolean WCOREDUMP(int);
    method public static int WEXITSTATUS(int);
    method public static boolean WIFEXITED(int);
    method public static boolean WIFSIGNALED(int);
    method public static boolean WIFSTOPPED(int);
    method public static int WSTOPSIG(int);
    method public static int WTERMSIG(int);
    method public static String errnoName(int);
    method public static String gaiName(int);
    field public static final int AF_INET;
    field public static final int AF_INET6;
    field public static final int AF_NETLINK;
    field public static final int AF_PACKET;
    field public static final int AF_UNIX;
    field public static final int AF_UNSPEC;
    field public static final int AI_ADDRCONFIG;
    field public static final int AI_ALL;
    field public static final int AI_CANONNAME;
    field public static final int AI_NUMERICHOST;
    field public static final int AI_NUMERICSERV;
    field public static final int AI_PASSIVE;
    field public static final int AI_V4MAPPED;
    field public static final int ARPHRD_ETHER;
    field public static final int CAP_AUDIT_CONTROL;
    field public static final int CAP_AUDIT_WRITE;
    field public static final int CAP_BLOCK_SUSPEND;
    field public static final int CAP_CHOWN;
    field public static final int CAP_DAC_OVERRIDE;
    field public static final int CAP_DAC_READ_SEARCH;
    field public static final int CAP_FOWNER;
    field public static final int CAP_FSETID;
    field public static final int CAP_IPC_LOCK;
    field public static final int CAP_IPC_OWNER;
    field public static final int CAP_KILL;
    field public static final int CAP_LAST_CAP;
    field public static final int CAP_LEASE;
    field public static final int CAP_LINUX_IMMUTABLE;
    field public static final int CAP_MAC_ADMIN;
    field public static final int CAP_MAC_OVERRIDE;
    field public static final int CAP_MKNOD;
    field public static final int CAP_NET_ADMIN;
    field public static final int CAP_NET_BIND_SERVICE;
    field public static final int CAP_NET_BROADCAST;
    field public static final int CAP_NET_RAW;
    field public static final int CAP_SETFCAP;
    field public static final int CAP_SETGID;
    field public static final int CAP_SETPCAP;
    field public static final int CAP_SETUID;
    field public static final int CAP_SYSLOG;
    field public static final int CAP_SYS_ADMIN;
    field public static final int CAP_SYS_BOOT;
    field public static final int CAP_SYS_CHROOT;
    field public static final int CAP_SYS_MODULE;
    field public static final int CAP_SYS_NICE;
    field public static final int CAP_SYS_PACCT;
    field public static final int CAP_SYS_PTRACE;
    field public static final int CAP_SYS_RAWIO;
    field public static final int CAP_SYS_RESOURCE;
    field public static final int CAP_SYS_TIME;
    field public static final int CAP_SYS_TTY_CONFIG;
    field public static final int CAP_WAKE_ALARM;
    field public static final int E2BIG;
    field public static final int EACCES;
    field public static final int EADDRINUSE;
    field public static final int EADDRNOTAVAIL;
    field public static final int EAFNOSUPPORT;
    field public static final int EAGAIN;
    field public static final int EAI_AGAIN;
    field public static final int EAI_BADFLAGS;
    field public static final int EAI_FAIL;
    field public static final int EAI_FAMILY;
    field public static final int EAI_MEMORY;
    field public static final int EAI_NODATA;
    field public static final int EAI_NONAME;
    field public static final int EAI_OVERFLOW;
    field public static final int EAI_SERVICE;
    field public static final int EAI_SOCKTYPE;
    field public static final int EAI_SYSTEM;
    field public static final int EALREADY;
    field public static final int EBADF;
    field public static final int EBADMSG;
    field public static final int EBUSY;
    field public static final int ECANCELED;
    field public static final int ECHILD;
    field public static final int ECONNABORTED;
    field public static final int ECONNREFUSED;
    field public static final int ECONNRESET;
    field public static final int EDEADLK;
    field public static final int EDESTADDRREQ;
    field public static final int EDOM;
    field public static final int EDQUOT;
    field public static final int EEXIST;
    field public static final int EFAULT;
    field public static final int EFBIG;
    field public static final int EHOSTUNREACH;
    field public static final int EIDRM;
    field public static final int EILSEQ;
    field public static final int EINPROGRESS;
    field public static final int EINTR;
    field public static final int EINVAL;
    field public static final int EIO;
    field public static final int EISCONN;
    field public static final int EISDIR;
    field public static final int ELOOP;
    field public static final int EMFILE;
    field public static final int EMLINK;
    field public static final int EMSGSIZE;
    field public static final int EMULTIHOP;
    field public static final int ENAMETOOLONG;
    field public static final int ENETDOWN;
    field public static final int ENETRESET;
    field public static final int ENETUNREACH;
    field public static final int ENFILE;
    field public static final int ENOBUFS;
    field public static final int ENODATA;
    field public static final int ENODEV;
    field public static final int ENOENT;
    field public static final int ENOEXEC;
    field public static final int ENOLCK;
    field public static final int ENOLINK;
    field public static final int ENOMEM;
    field public static final int ENOMSG;
    field public static final int ENOPROTOOPT;
    field public static final int ENOSPC;
    field public static final int ENOSR;
    field public static final int ENOSTR;
    field public static final int ENOSYS;
    field public static final int ENOTCONN;
    field public static final int ENOTDIR;
    field public static final int ENOTEMPTY;
    field public static final int ENOTSOCK;
    field public static final int ENOTSUP;
    field public static final int ENOTTY;
    field public static final int ENXIO;
    field public static final int EOPNOTSUPP;
    field public static final int EOVERFLOW;
    field public static final int EPERM;
    field public static final int EPIPE;
    field public static final int EPROTO;
    field public static final int EPROTONOSUPPORT;
    field public static final int EPROTOTYPE;
    field public static final int ERANGE;
    field public static final int EROFS;
    field public static final int ESPIPE;
    field public static final int ESRCH;
    field public static final int ESTALE;
    field public static final int ETH_P_ALL;
    field public static final int ETH_P_ARP;
    field public static final int ETH_P_IP;
    field public static final int ETH_P_IPV6;
    field public static final int ETIME;
    field public static final int ETIMEDOUT;
    field public static final int ETXTBSY;
    field public static final int EXDEV;
    field public static final int EXIT_FAILURE;
    field public static final int EXIT_SUCCESS;
    field public static final int FD_CLOEXEC;
    field public static final int FIONREAD;
    field public static final int F_DUPFD;
    field public static final int F_DUPFD_CLOEXEC;
    field public static final int F_GETFD;
    field public static final int F_GETFL;
    field public static final int F_GETLK;
    field public static final int F_GETLK64;
    field public static final int F_GETOWN;
    field public static final int F_OK;
    field public static final int F_RDLCK;
    field public static final int F_SETFD;
    field public static final int F_SETFL;
    field public static final int F_SETLK;
    field public static final int F_SETLK64;
    field public static final int F_SETLKW;
    field public static final int F_SETLKW64;
    field public static final int F_SETOWN;
    field public static final int F_UNLCK;
    field public static final int F_WRLCK;
    field public static final int IFA_F_DADFAILED;
    field public static final int IFA_F_DEPRECATED;
    field public static final int IFA_F_HOMEADDRESS;
    field public static final int IFA_F_NODAD;
    field public static final int IFA_F_OPTIMISTIC;
    field public static final int IFA_F_PERMANENT;
    field public static final int IFA_F_SECONDARY;
    field public static final int IFA_F_TEMPORARY;
    field public static final int IFA_F_TENTATIVE;
    field public static final int IFF_ALLMULTI;
    field public static final int IFF_AUTOMEDIA;
    field public static final int IFF_BROADCAST;
    field public static final int IFF_DEBUG;
    field public static final int IFF_DYNAMIC;
    field public static final int IFF_LOOPBACK;
    field public static final int IFF_MASTER;
    field public static final int IFF_MULTICAST;
    field public static final int IFF_NOARP;
    field public static final int IFF_NOTRAILERS;
    field public static final int IFF_POINTOPOINT;
    field public static final int IFF_PORTSEL;
    field public static final int IFF_PROMISC;
    field public static final int IFF_RUNNING;
    field public static final int IFF_SLAVE;
    field public static final int IFF_UP;
    field public static final int IPPROTO_ICMP;
    field public static final int IPPROTO_ICMPV6;
    field public static final int IPPROTO_IP;
    field public static final int IPPROTO_IPV6;
    field public static final int IPPROTO_RAW;
    field public static final int IPPROTO_TCP;
    field public static final int IPPROTO_UDP;
    field public static final int IPV6_CHECKSUM;
    field public static final int IPV6_MULTICAST_HOPS;
    field public static final int IPV6_MULTICAST_IF;
    field public static final int IPV6_MULTICAST_LOOP;
    field public static final int IPV6_RECVDSTOPTS;
    field public static final int IPV6_RECVHOPLIMIT;
    field public static final int IPV6_RECVHOPOPTS;
    field public static final int IPV6_RECVPKTINFO;
    field public static final int IPV6_RECVRTHDR;
    field public static final int IPV6_RECVTCLASS;
    field public static final int IPV6_TCLASS;
    field public static final int IPV6_UNICAST_HOPS;
    field public static final int IPV6_V6ONLY;
    field public static final int IP_MULTICAST_IF;
    field public static final int IP_MULTICAST_LOOP;
    field public static final int IP_MULTICAST_TTL;
    field public static final int IP_TOS;
    field public static final int IP_TTL;
    field public static final int MAP_FIXED;
    field public static final int MAP_PRIVATE;
    field public static final int MAP_SHARED;
    field public static final int MCAST_BLOCK_SOURCE;
    field public static final int MCAST_JOIN_GROUP;
    field public static final int MCAST_JOIN_SOURCE_GROUP;
    field public static final int MCAST_LEAVE_GROUP;
    field public static final int MCAST_LEAVE_SOURCE_GROUP;
    field public static final int MCAST_UNBLOCK_SOURCE;
    field public static final int MCL_CURRENT;
    field public static final int MCL_FUTURE;
    field public static final int MSG_CTRUNC;
    field public static final int MSG_DONTROUTE;
    field public static final int MSG_EOR;
    field public static final int MSG_OOB;
    field public static final int MSG_PEEK;
    field public static final int MSG_TRUNC;
    field public static final int MSG_WAITALL;
    field public static final int MS_ASYNC;
    field public static final int MS_INVALIDATE;
    field public static final int MS_SYNC;
    field public static final int NETLINK_INET_DIAG;
    field public static final int NETLINK_ROUTE;
    field public static final int NI_DGRAM;
    field public static final int NI_NAMEREQD;
    field public static final int NI_NOFQDN;
    field public static final int NI_NUMERICHOST;
    field public static final int NI_NUMERICSERV;
    field public static final int O_ACCMODE;
    field public static final int O_APPEND;
    field public static final int O_CLOEXEC;
    field public static final int O_CREAT;
    field public static final int O_DSYNC;
    field public static final int O_EXCL;
    field public static final int O_NOCTTY;
    field public static final int O_NOFOLLOW;
    field public static final int O_NONBLOCK;
    field public static final int O_RDONLY;
    field public static final int O_RDWR;
    field public static final int O_SYNC;
    field public static final int O_TRUNC;
    field public static final int O_WRONLY;
    field public static final int POLLERR;
    field public static final int POLLHUP;
    field public static final int POLLIN;
    field public static final int POLLNVAL;
    field public static final int POLLOUT;
    field public static final int POLLPRI;
    field public static final int POLLRDBAND;
    field public static final int POLLRDNORM;
    field public static final int POLLWRBAND;
    field public static final int POLLWRNORM;
    field public static final int PROT_EXEC;
    field public static final int PROT_NONE;
    field public static final int PROT_READ;
    field public static final int PROT_WRITE;
    field public static final int PR_GET_DUMPABLE;
    field public static final int PR_SET_DUMPABLE;
    field public static final int PR_SET_NO_NEW_PRIVS;
    field public static final int RTMGRP_NEIGH;
    field public static final int RT_SCOPE_HOST;
    field public static final int RT_SCOPE_LINK;
    field public static final int RT_SCOPE_NOWHERE;
    field public static final int RT_SCOPE_SITE;
    field public static final int RT_SCOPE_UNIVERSE;
    field public static final int R_OK;
    field public static final int SEEK_CUR;
    field public static final int SEEK_END;
    field public static final int SEEK_SET;
    field public static final int SHUT_RD;
    field public static final int SHUT_RDWR;
    field public static final int SHUT_WR;
    field public static final int SIGABRT;
    field public static final int SIGALRM;
    field public static final int SIGBUS;
    field public static final int SIGCHLD;
    field public static final int SIGCONT;
    field public static final int SIGFPE;
    field public static final int SIGHUP;
    field public static final int SIGILL;
    field public static final int SIGINT;
    field public static final int SIGIO;
    field public static final int SIGKILL;
    field public static final int SIGPIPE;
    field public static final int SIGPROF;
    field public static final int SIGPWR;
    field public static final int SIGQUIT;
    field public static final int SIGRTMAX;
    field public static final int SIGRTMIN;
    field public static final int SIGSEGV;
    field public static final int SIGSTKFLT;
    field public static final int SIGSTOP;
    field public static final int SIGSYS;
    field public static final int SIGTERM;
    field public static final int SIGTRAP;
    field public static final int SIGTSTP;
    field public static final int SIGTTIN;
    field public static final int SIGTTOU;
    field public static final int SIGURG;
    field public static final int SIGUSR1;
    field public static final int SIGUSR2;
    field public static final int SIGVTALRM;
    field public static final int SIGWINCH;
    field public static final int SIGXCPU;
    field public static final int SIGXFSZ;
    field public static final int SIOCGIFADDR;
    field public static final int SIOCGIFBRDADDR;
    field public static final int SIOCGIFDSTADDR;
    field public static final int SIOCGIFNETMASK;
    field public static final int SOCK_CLOEXEC;
    field public static final int SOCK_DGRAM;
    field public static final int SOCK_NONBLOCK;
    field public static final int SOCK_RAW;
    field public static final int SOCK_SEQPACKET;
    field public static final int SOCK_STREAM;
    field public static final int SOL_SOCKET;
    field public static final int SO_BINDTODEVICE;
    field public static final int SO_BROADCAST;
    field public static final int SO_DEBUG;
    field public static final int SO_DONTROUTE;
    field public static final int SO_ERROR;
    field public static final int SO_KEEPALIVE;
    field public static final int SO_LINGER;
    field public static final int SO_OOBINLINE;
    field public static final int SO_PASSCRED;
    field public static final int SO_PEERCRED;
    field public static final int SO_RCVBUF;
    field public static final int SO_RCVLOWAT;
    field public static final int SO_RCVTIMEO;
    field public static final int SO_REUSEADDR;
    field public static final int SO_SNDBUF;
    field public static final int SO_SNDLOWAT;
    field public static final int SO_SNDTIMEO;
    field public static final int SO_TYPE;
    field public static final int STDERR_FILENO;
    field public static final int STDIN_FILENO;
    field public static final int STDOUT_FILENO;
    field public static final int ST_MANDLOCK;
    field public static final int ST_NOATIME;
    field public static final int ST_NODEV;
    field public static final int ST_NODIRATIME;
    field public static final int ST_NOEXEC;
    field public static final int ST_NOSUID;
    field public static final int ST_RDONLY;
    field public static final int ST_RELATIME;
    field public static final int ST_SYNCHRONOUS;
    field public static final int S_IFBLK;
    field public static final int S_IFCHR;
    field public static final int S_IFDIR;
    field public static final int S_IFIFO;
    field public static final int S_IFLNK;
    field public static final int S_IFMT;
    field public static final int S_IFREG;
    field public static final int S_IFSOCK;
    field public static final int S_IRGRP;
    field public static final int S_IROTH;
    field public static final int S_IRUSR;
    field public static final int S_IRWXG;
    field public static final int S_IRWXO;
    field public static final int S_IRWXU;
    field public static final int S_ISGID;
    field public static final int S_ISUID;
    field public static final int S_ISVTX;
    field public static final int S_IWGRP;
    field public static final int S_IWOTH;
    field public static final int S_IWUSR;
    field public static final int S_IXGRP;
    field public static final int S_IXOTH;
    field public static final int S_IXUSR;
    field public static final int TCP_NODELAY;
    field public static final int TCP_USER_TIMEOUT;
    field public static final int WCONTINUED;
    field public static final int WEXITED;
    field public static final int WNOHANG;
    field public static final int WNOWAIT;
    field public static final int WSTOPPED;
    field public static final int WUNTRACED;
    field public static final int W_OK;
    field public static final int X_OK;
    field public static final int _SC_2_CHAR_TERM;
    field public static final int _SC_2_C_BIND;
    field public static final int _SC_2_C_DEV;
    field public static final int _SC_2_C_VERSION;
    field public static final int _SC_2_FORT_DEV;
    field public static final int _SC_2_FORT_RUN;
    field public static final int _SC_2_LOCALEDEF;
    field public static final int _SC_2_SW_DEV;
    field public static final int _SC_2_UPE;
    field public static final int _SC_2_VERSION;
    field public static final int _SC_AIO_LISTIO_MAX;
    field public static final int _SC_AIO_MAX;
    field public static final int _SC_AIO_PRIO_DELTA_MAX;
    field public static final int _SC_ARG_MAX;
    field public static final int _SC_ASYNCHRONOUS_IO;
    field public static final int _SC_ATEXIT_MAX;
    field public static final int _SC_AVPHYS_PAGES;
    field public static final int _SC_BC_BASE_MAX;
    field public static final int _SC_BC_DIM_MAX;
    field public static final int _SC_BC_SCALE_MAX;
    field public static final int _SC_BC_STRING_MAX;
    field public static final int _SC_CHILD_MAX;
    field public static final int _SC_CLK_TCK;
    field public static final int _SC_COLL_WEIGHTS_MAX;
    field public static final int _SC_DELAYTIMER_MAX;
    field public static final int _SC_EXPR_NEST_MAX;
    field public static final int _SC_FSYNC;
    field public static final int _SC_GETGR_R_SIZE_MAX;
    field public static final int _SC_GETPW_R_SIZE_MAX;
    field public static final int _SC_IOV_MAX;
    field public static final int _SC_JOB_CONTROL;
    field public static final int _SC_LINE_MAX;
    field public static final int _SC_LOGIN_NAME_MAX;
    field public static final int _SC_MAPPED_FILES;
    field public static final int _SC_MEMLOCK;
    field public static final int _SC_MEMLOCK_RANGE;
    field public static final int _SC_MEMORY_PROTECTION;
    field public static final int _SC_MESSAGE_PASSING;
    field public static final int _SC_MQ_OPEN_MAX;
    field public static final int _SC_MQ_PRIO_MAX;
    field public static final int _SC_NGROUPS_MAX;
    field public static final int _SC_NPROCESSORS_CONF;
    field public static final int _SC_NPROCESSORS_ONLN;
    field public static final int _SC_OPEN_MAX;
    field public static final int _SC_PAGESIZE;
    field public static final int _SC_PAGE_SIZE;
    field public static final int _SC_PASS_MAX;
    field public static final int _SC_PHYS_PAGES;
    field public static final int _SC_PRIORITIZED_IO;
    field public static final int _SC_PRIORITY_SCHEDULING;
    field public static final int _SC_REALTIME_SIGNALS;
    field public static final int _SC_RE_DUP_MAX;
    field public static final int _SC_RTSIG_MAX;
    field public static final int _SC_SAVED_IDS;
    field public static final int _SC_SEMAPHORES;
    field public static final int _SC_SEM_NSEMS_MAX;
    field public static final int _SC_SEM_VALUE_MAX;
    field public static final int _SC_SHARED_MEMORY_OBJECTS;
    field public static final int _SC_SIGQUEUE_MAX;
    field public static final int _SC_STREAM_MAX;
    field public static final int _SC_SYNCHRONIZED_IO;
    field public static final int _SC_THREADS;
    field public static final int _SC_THREAD_ATTR_STACKADDR;
    field public static final int _SC_THREAD_ATTR_STACKSIZE;
    field public static final int _SC_THREAD_DESTRUCTOR_ITERATIONS;
    field public static final int _SC_THREAD_KEYS_MAX;
    field public static final int _SC_THREAD_PRIORITY_SCHEDULING;
    field public static final int _SC_THREAD_PRIO_INHERIT;
    field public static final int _SC_THREAD_PRIO_PROTECT;
    field public static final int _SC_THREAD_SAFE_FUNCTIONS;
    field public static final int _SC_THREAD_STACK_MIN;
    field public static final int _SC_THREAD_THREADS_MAX;
    field public static final int _SC_TIMERS;
    field public static final int _SC_TIMER_MAX;
    field public static final int _SC_TTY_NAME_MAX;
    field public static final int _SC_TZNAME_MAX;
    field public static final int _SC_VERSION;
    field public static final int _SC_XBS5_ILP32_OFF32;
    field public static final int _SC_XBS5_ILP32_OFFBIG;
    field public static final int _SC_XBS5_LP64_OFF64;
    field public static final int _SC_XBS5_LPBIG_OFFBIG;
    field public static final int _SC_XOPEN_CRYPT;
    field public static final int _SC_XOPEN_ENH_I18N;
    field public static final int _SC_XOPEN_LEGACY;
    field public static final int _SC_XOPEN_REALTIME;
    field public static final int _SC_XOPEN_REALTIME_THREADS;
    field public static final int _SC_XOPEN_SHM;
    field public static final int _SC_XOPEN_UNIX;
    field public static final int _SC_XOPEN_VERSION;
    field public static final int _SC_XOPEN_XCU_VERSION;
  }

  public final class StructPollfd {
    ctor public StructPollfd();
    field public short events;
    field public java.io.FileDescriptor fd;
    field public short revents;
    field public Object userData;
  }

  public final class StructStat {
    ctor public StructStat(long, long, int, long, int, int, long, long, long, long, long, long, long);
    ctor public StructStat(long, long, int, long, int, int, long, long, android.system.StructTimespec, android.system.StructTimespec, android.system.StructTimespec, long, long);
    field public final android.system.StructTimespec st_atim;
    field public final long st_atime;
    field public final long st_blksize;
    field public final long st_blocks;
    field public final android.system.StructTimespec st_ctim;
    field public final long st_ctime;
    field public final long st_dev;
    field public final int st_gid;
    field public final long st_ino;
    field public final int st_mode;
    field public final android.system.StructTimespec st_mtim;
    field public final long st_mtime;
    field public final long st_nlink;
    field public final long st_rdev;
    field public final long st_size;
    field public final int st_uid;
  }

  public final class StructStatVfs {
    ctor public StructStatVfs(long, long, long, long, long, long, long, long, long, long, long);
    field public final long f_bavail;
    field public final long f_bfree;
    field public final long f_blocks;
    field public final long f_bsize;
    field public final long f_favail;
    field public final long f_ffree;
    field public final long f_files;
    field public final long f_flag;
    field public final long f_frsize;
    field public final long f_fsid;
    field public final long f_namemax;
  }

  public final class StructTimespec implements java.lang.Comparable<android.system.StructTimespec> {
    ctor public StructTimespec(long, long);
    method public int compareTo(android.system.StructTimespec);
    field public final long tv_nsec;
    field public final long tv_sec;
  }

  public final class StructUtsname {
    ctor public StructUtsname(String, String, String, String, String);
    field public final String machine;
    field public final String nodename;
    field public final String release;
    field public final String sysname;
    field public final String version;
  }

}

package android.telecom {

  public final class Call {
    method public void answer(int);
    method public void conference(android.telecom.Call);
    method public void deflect(android.net.Uri);
    method public void disconnect();
    method public java.util.List<java.lang.String> getCannedTextResponses();
    method public java.util.List<android.telecom.Call> getChildren();
    method public java.util.List<android.telecom.Call> getConferenceableCalls();
    method public android.telecom.Call.Details getDetails();
    method public android.telecom.Call getParent();
    method public String getRemainingPostDialSequence();
    method @Nullable public android.telecom.Call.RttCall getRttCall();
    method public int getState();
    method public android.telecom.InCallService.VideoCall getVideoCall();
    method public void handoverTo(android.telecom.PhoneAccountHandle, int, android.os.Bundle);
    method public void hold();
    method public boolean isRttActive();
    method public void mergeConference();
    method public void phoneAccountSelected(android.telecom.PhoneAccountHandle, boolean);
    method public void playDtmfTone(char);
    method public void postDialContinue(boolean);
    method public void pullExternalCall();
    method public void putExtras(android.os.Bundle);
    method public void registerCallback(android.telecom.Call.Callback);
    method public void registerCallback(android.telecom.Call.Callback, android.os.Handler);
    method public void reject(boolean, String);
    method public void removeExtras(java.util.List<java.lang.String>);
    method public void removeExtras(java.lang.String...);
    method public void respondToRttRequest(int, boolean);
    method public void sendCallEvent(String, android.os.Bundle);
    method public void sendRttRequest();
    method public void splitFromConference();
    method public void stopDtmfTone();
    method public void stopRtt();
    method public void swapConference();
    method public void unhold();
    method public void unregisterCallback(android.telecom.Call.Callback);
    field @Deprecated public static final String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts";
    field public static final String EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS = "android.telecom.extra.LAST_EMERGENCY_CALLBACK_TIME_MILLIS";
    field public static final String EXTRA_SUGGESTED_PHONE_ACCOUNTS = "android.telecom.extra.SUGGESTED_PHONE_ACCOUNTS";
    field public static final int STATE_ACTIVE = 4; // 0x4
    field public static final int STATE_CONNECTING = 9; // 0x9
    field public static final int STATE_DIALING = 1; // 0x1
    field public static final int STATE_DISCONNECTED = 7; // 0x7
    field public static final int STATE_DISCONNECTING = 10; // 0xa
    field public static final int STATE_HOLDING = 3; // 0x3
    field public static final int STATE_NEW = 0; // 0x0
    field public static final int STATE_PULLING_CALL = 11; // 0xb
    field public static final int STATE_RINGING = 2; // 0x2
    field public static final int STATE_SELECT_PHONE_ACCOUNT = 8; // 0x8
  }

  public abstract static class Call.Callback {
    ctor public Call.Callback();
    method public void onCallDestroyed(android.telecom.Call);
    method public void onCannedTextResponsesLoaded(android.telecom.Call, java.util.List<java.lang.String>);
    method public void onChildrenChanged(android.telecom.Call, java.util.List<android.telecom.Call>);
    method public void onConferenceableCallsChanged(android.telecom.Call, java.util.List<android.telecom.Call>);
    method public void onConnectionEvent(android.telecom.Call, String, android.os.Bundle);
    method public void onDetailsChanged(android.telecom.Call, android.telecom.Call.Details);
    method public void onHandoverComplete(android.telecom.Call);
    method public void onHandoverFailed(android.telecom.Call, int);
    method public void onParentChanged(android.telecom.Call, android.telecom.Call);
    method public void onPostDialWait(android.telecom.Call, String);
    method public void onRttInitiationFailure(android.telecom.Call, int);
    method public void onRttModeChanged(android.telecom.Call, int);
    method public void onRttRequest(android.telecom.Call, int);
    method public void onRttStatusChanged(android.telecom.Call, boolean, android.telecom.Call.RttCall);
    method public void onStateChanged(android.telecom.Call, int);
    method public void onVideoCallChanged(android.telecom.Call, android.telecom.InCallService.VideoCall);
    field public static final int HANDOVER_FAILURE_DEST_APP_REJECTED = 1; // 0x1
    field public static final int HANDOVER_FAILURE_NOT_SUPPORTED = 2; // 0x2
    field public static final int HANDOVER_FAILURE_ONGOING_EMERGENCY_CALL = 4; // 0x4
    field public static final int HANDOVER_FAILURE_UNKNOWN = 5; // 0x5
    field public static final int HANDOVER_FAILURE_USER_REJECTED = 3; // 0x3
  }

  public static class Call.Details {
    method public static boolean can(int, int);
    method public boolean can(int);
    method public static String capabilitiesToString(int);
    method public android.telecom.PhoneAccountHandle getAccountHandle();
    method public int getCallCapabilities();
    method public int getCallDirection();
    method @Nullable public android.telecom.CallIdentification getCallIdentification();
    method public int getCallProperties();
    method public String getCallerDisplayName();
    method public int getCallerDisplayNamePresentation();
    method public final long getConnectTimeMillis();
    method public long getCreationTimeMillis();
    method public android.telecom.DisconnectCause getDisconnectCause();
    method public android.os.Bundle getExtras();
    method public android.telecom.GatewayInfo getGatewayInfo();
    method public android.net.Uri getHandle();
    method public int getHandlePresentation();
    method public android.os.Bundle getIntentExtras();
    method public android.telecom.StatusHints getStatusHints();
    method public int getVideoState();
    method public static boolean hasProperty(int, int);
    method public boolean hasProperty(int);
    method public static String propertiesToString(int);
    field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 4194304; // 0x400000
    field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000
    field public static final int CAPABILITY_CAN_PULL_CALL = 8388608; // 0x800000
    field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000
    field public static final int CAPABILITY_HOLD = 1; // 0x1
    field public static final int CAPABILITY_MANAGE_CONFERENCE = 128; // 0x80
    field public static final int CAPABILITY_MERGE_CONFERENCE = 4; // 0x4
    field public static final int CAPABILITY_MUTE = 64; // 0x40
    field public static final int CAPABILITY_RESPOND_VIA_TEXT = 32; // 0x20
    field public static final int CAPABILITY_SEPARATE_FROM_CONFERENCE = 4096; // 0x1000
    field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL = 768; // 0x300
    field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_RX = 256; // 0x100
    field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_TX = 512; // 0x200
    field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = 3072; // 0xc00
    field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 1024; // 0x400
    field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 2048; // 0x800
    field public static final int CAPABILITY_SUPPORT_DEFLECT = 16777216; // 0x1000000
    field public static final int CAPABILITY_SUPPORT_HOLD = 2; // 0x2
    field public static final int CAPABILITY_SWAP_CONFERENCE = 8; // 0x8
    field public static final int DIRECTION_INCOMING = 0; // 0x0
    field public static final int DIRECTION_OUTGOING = 1; // 0x1
    field public static final int DIRECTION_UNKNOWN = -1; // 0xffffffff
    field public static final int PROPERTY_CONFERENCE = 1; // 0x1
    field public static final int PROPERTY_EMERGENCY_CALLBACK_MODE = 4; // 0x4
    field public static final int PROPERTY_ENTERPRISE_CALL = 32; // 0x20
    field public static final int PROPERTY_GENERIC_CONFERENCE = 2; // 0x2
    field public static final int PROPERTY_HAS_CDMA_VOICE_PRIVACY = 128; // 0x80
    field public static final int PROPERTY_HIGH_DEF_AUDIO = 16; // 0x10
    field public static final int PROPERTY_IS_EXTERNAL_CALL = 64; // 0x40
    field public static final int PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL = 2048; // 0x800
    field public static final int PROPERTY_RTT = 1024; // 0x400
    field public static final int PROPERTY_SELF_MANAGED = 256; // 0x100
    field public static final int PROPERTY_VOIP_AUDIO_MODE = 4096; // 0x1000
    field public static final int PROPERTY_WIFI = 8; // 0x8
  }

  public static final class Call.RttCall {
    method public int getRttAudioMode();
    method public String read();
    method public String readImmediately() throws java.io.IOException;
    method public void setRttMode(int);
    method public void write(String) throws java.io.IOException;
    field public static final int RTT_MODE_FULL = 1; // 0x1
    field public static final int RTT_MODE_HCO = 2; // 0x2
    field public static final int RTT_MODE_VCO = 3; // 0x3
  }

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

  public final class CallIdentification implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public String getCallScreeningAppName();
    method @NonNull public String getCallScreeningPackageName();
    method @Nullable public String getDescription();
    method @Nullable public String getDetails();
    method @Nullable public String getName();
    method public int getNuisanceConfidence();
    method @Nullable public android.graphics.drawable.Icon getPhoto();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CONFIDENCE_LIKELY_NOT_NUISANCE = -1; // 0xffffffff
    field public static final int CONFIDENCE_LIKELY_NUISANCE = 1; // 0x1
    field public static final int CONFIDENCE_NOT_NUISANCE = -2; // 0xfffffffe
    field public static final int CONFIDENCE_NUISANCE = 2; // 0x2
    field public static final int CONFIDENCE_UNKNOWN = 0; // 0x0
    field public static final android.os.Parcelable.Creator<android.telecom.CallIdentification> CREATOR;
  }

  public static class CallIdentification.Builder {
    ctor public CallIdentification.Builder();
    method public android.telecom.CallIdentification build();
    method public android.telecom.CallIdentification.Builder setDescription(@Nullable String);
    method public android.telecom.CallIdentification.Builder setDetails(@Nullable String);
    method public android.telecom.CallIdentification.Builder setName(@Nullable String);
    method public android.telecom.CallIdentification.Builder setNuisanceConfidence(int);
    method public android.telecom.CallIdentification.Builder setPhoto(@Nullable android.graphics.drawable.Icon);
  }

  public abstract class CallRedirectionService extends android.app.Service {
    ctor public CallRedirectionService();
    method public final void cancelCall();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract void onPlaceCall(@NonNull android.net.Uri, @NonNull android.telecom.PhoneAccountHandle, boolean);
    method public final boolean onUnbind(android.content.Intent);
    method public final void placeCallUnmodified();
    method public final void redirectCall(@NonNull android.net.Uri, @NonNull android.telecom.PhoneAccountHandle, boolean);
    field public static final String SERVICE_INTERFACE = "android.telecom.CallRedirectionService";
  }

  public abstract class CallScreeningService extends android.app.Service {
    ctor public CallScreeningService();
    method public android.os.IBinder onBind(android.content.Intent);
    method public abstract void onScreenCall(@NonNull android.telecom.Call.Details);
    method public final void provideCallIdentification(@NonNull android.telecom.Call.Details, @NonNull android.telecom.CallIdentification);
    method public final void respondToCall(@NonNull android.telecom.Call.Details, @NonNull android.telecom.CallScreeningService.CallResponse);
    field public static final String SERVICE_INTERFACE = "android.telecom.CallScreeningService";
  }

  public static class CallScreeningService.CallResponse {
    method public boolean getDisallowCall();
    method public boolean getRejectCall();
    method public boolean getSkipCallLog();
    method public boolean getSkipNotification();
  }

  public static class CallScreeningService.CallResponse.Builder {
    ctor public CallScreeningService.CallResponse.Builder();
    method public android.telecom.CallScreeningService.CallResponse build();
    method public android.telecom.CallScreeningService.CallResponse.Builder setDisallowCall(boolean);
    method public android.telecom.CallScreeningService.CallResponse.Builder setRejectCall(boolean);
    method public android.telecom.CallScreeningService.CallResponse.Builder setSkipCallLog(boolean);
    method public android.telecom.CallScreeningService.CallResponse.Builder setSkipNotification(boolean);
  }

  public abstract class Conference extends android.telecom.Conferenceable {
    ctor public Conference(android.telecom.PhoneAccountHandle);
    method public final boolean addConnection(android.telecom.Connection);
    method public final void destroy();
    method public final android.telecom.CallAudioState getCallAudioState();
    method public final java.util.List<android.telecom.Connection> getConferenceableConnections();
    method public final int getConnectionCapabilities();
    method public final int getConnectionProperties();
    method public final long getConnectionTime();
    method public final java.util.List<android.telecom.Connection> getConnections();
    method public final android.telecom.DisconnectCause getDisconnectCause();
    method public final android.os.Bundle getExtras();
    method public final android.telecom.PhoneAccountHandle getPhoneAccountHandle();
    method public final int getState();
    method public final android.telecom.StatusHints getStatusHints();
    method public android.telecom.Connection.VideoProvider getVideoProvider();
    method public int getVideoState();
    method public void onCallAudioStateChanged(android.telecom.CallAudioState);
    method public void onConnectionAdded(android.telecom.Connection);
    method public void onDisconnect();
    method public void onExtrasChanged(android.os.Bundle);
    method public void onHold();
    method public void onMerge(android.telecom.Connection);
    method public void onMerge();
    method public void onPlayDtmfTone(char);
    method public void onSeparate(android.telecom.Connection);
    method public void onStopDtmfTone();
    method public void onSwap();
    method public void onUnhold();
    method public final void putExtras(@NonNull android.os.Bundle);
    method public final void removeConnection(android.telecom.Connection);
    method public final void removeExtras(java.util.List<java.lang.String>);
    method public final void removeExtras(java.lang.String...);
    method public final void setActive();
    method public final void setConferenceableConnections(java.util.List<android.telecom.Connection>);
    method public final void setConnectionCapabilities(int);
    method public final void setConnectionProperties(int);
    method public final void setConnectionStartElapsedRealTime(long);
    method public final void setConnectionTime(long);
    method public final void setDialing();
    method public final void setDisconnected(android.telecom.DisconnectCause);
    method public final void setExtras(@Nullable android.os.Bundle);
    method public final void setOnHold();
    method public final void setStatusHints(android.telecom.StatusHints);
    method public final void setVideoProvider(android.telecom.Connection, android.telecom.Connection.VideoProvider);
    method public final void setVideoState(android.telecom.Connection, int);
    field public static final long CONNECT_TIME_NOT_SPECIFIED = 0L; // 0x0L
  }

  public abstract class Conferenceable {
  }

  public abstract class Connection extends android.telecom.Conferenceable {
    ctor public Connection();
    method public static String capabilitiesToString(int);
    method public static android.telecom.Connection createCanceledConnection();
    method public static android.telecom.Connection createFailedConnection(android.telecom.DisconnectCause);
    method public final void destroy();
    method public final android.net.Uri getAddress();
    method public final int getAddressPresentation();
    method public final boolean getAudioModeIsVoip();
    method public final android.telecom.CallAudioState getCallAudioState();
    method public final String getCallerDisplayName();
    method public final int getCallerDisplayNamePresentation();
    method public final android.telecom.Conference getConference();
    method public final java.util.List<android.telecom.Conferenceable> getConferenceables();
    method public final int getConnectionCapabilities();
    method public final int getConnectionProperties();
    method public final android.telecom.DisconnectCause getDisconnectCause();
    method public final android.os.Bundle getExtras();
    method public final int getState();
    method public final android.telecom.StatusHints getStatusHints();
    method public final android.telecom.Connection.VideoProvider getVideoProvider();
    method public void handleRttUpgradeResponse(@Nullable android.telecom.Connection.RttTextStream);
    method public final boolean isRingbackRequested();
    method public void onAbort();
    method public void onAnswer(int);
    method public void onAnswer();
    method public void onCallAudioStateChanged(android.telecom.CallAudioState);
    method public void onCallEvent(String, android.os.Bundle);
    method public void onDeflect(android.net.Uri);
    method public void onDisconnect();
    method public void onExtrasChanged(android.os.Bundle);
    method public void onHandoverComplete();
    method public void onHold();
    method public void onPlayDtmfTone(char);
    method public void onPostDialContinue(boolean);
    method public void onPullExternalCall();
    method public void onReject();
    method public void onReject(String);
    method public void onSeparate();
    method public void onShowIncomingCallUi();
    method public void onSilence();
    method public void onStartRtt(@NonNull android.telecom.Connection.RttTextStream);
    method public void onStateChanged(int);
    method public void onStopDtmfTone();
    method public void onStopRtt();
    method public void onUnhold();
    method public static String propertiesToString(int);
    method public final void putExtras(@NonNull android.os.Bundle);
    method public final void removeExtras(java.util.List<java.lang.String>);
    method public final void removeExtras(java.lang.String...);
    method public void requestBluetoothAudio(@NonNull android.bluetooth.BluetoothDevice);
    method public void sendConnectionEvent(String, android.os.Bundle);
    method public final void sendRemoteRttRequest();
    method public final void sendRttInitiationFailure(int);
    method public final void sendRttInitiationSuccess();
    method public final void sendRttSessionRemotelyTerminated();
    method public final void setActive();
    method public final void setAddress(android.net.Uri, int);
    method public final void setAudioModeIsVoip(boolean);
    method public final void setAudioRoute(int);
    method public final void setCallerDisplayName(String, int);
    method public final void setConferenceableConnections(java.util.List<android.telecom.Connection>);
    method public final void setConferenceables(java.util.List<android.telecom.Conferenceable>);
    method public final void setConnectionCapabilities(int);
    method public final void setConnectionProperties(int);
    method public final void setDialing();
    method public final void setDisconnected(android.telecom.DisconnectCause);
    method public final void setExtras(@Nullable android.os.Bundle);
    method public final void setInitialized();
    method public final void setInitializing();
    method public final void setNextPostDialChar(char);
    method public final void setOnHold();
    method public final void setPostDialWait(String);
    method public final void setPulling();
    method public final void setRingbackRequested(boolean);
    method public final void setRinging();
    method public final void setStatusHints(android.telecom.StatusHints);
    method public final void setVideoProvider(android.telecom.Connection.VideoProvider);
    method public final void setVideoState(int);
    method public static String stateToString(int);
    field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 8388608; // 0x800000
    field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000
    field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000
    field public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 4194304; // 0x400000
    field @Deprecated public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000
    field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000
    field public static final int CAPABILITY_HOLD = 1; // 0x1
    field public static final int CAPABILITY_MANAGE_CONFERENCE = 128; // 0x80
    field public static final int CAPABILITY_MERGE_CONFERENCE = 4; // 0x4
    field public static final int CAPABILITY_MUTE = 64; // 0x40
    field public static final int CAPABILITY_RESPOND_VIA_TEXT = 32; // 0x20
    field public static final int CAPABILITY_SEPARATE_FROM_CONFERENCE = 4096; // 0x1000
    field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL = 768; // 0x300
    field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_RX = 256; // 0x100
    field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_TX = 512; // 0x200
    field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = 3072; // 0xc00
    field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 1024; // 0x400
    field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 2048; // 0x800
    field public static final int CAPABILITY_SUPPORT_DEFLECT = 33554432; // 0x2000000
    field public static final int CAPABILITY_SUPPORT_HOLD = 2; // 0x2
    field public static final int CAPABILITY_SWAP_CONFERENCE = 8; // 0x8
    field public static final String EVENT_CALL_MERGE_FAILED = "android.telecom.event.CALL_MERGE_FAILED";
    field public static final String EVENT_CALL_PULL_FAILED = "android.telecom.event.CALL_PULL_FAILED";
    field public static final String EVENT_RTT_AUDIO_INDICATION_CHANGED = "android.telecom.event.RTT_AUDIO_INDICATION_CHANGED";
    field public static final String EXTRA_ANSWERING_DROPS_FG_CALL = "android.telecom.extra.ANSWERING_DROPS_FG_CALL";
    field public static final String EXTRA_ANSWERING_DROPS_FG_CALL_APP_NAME = "android.telecom.extra.ANSWERING_DROPS_FG_CALL_APP_NAME";
    field public static final String EXTRA_CALL_SUBJECT = "android.telecom.extra.CALL_SUBJECT";
    field public static final String EXTRA_CHILD_ADDRESS = "android.telecom.extra.CHILD_ADDRESS";
    field public static final String EXTRA_IS_RTT_AUDIO_PRESENT = "android.telecom.extra.IS_RTT_AUDIO_PRESENT";
    field public static final String EXTRA_LAST_FORWARDED_NUMBER = "android.telecom.extra.LAST_FORWARDED_NUMBER";
    field public static final String EXTRA_SIP_INVITE = "android.telecom.extra.SIP_INVITE";
    field public static final int PROPERTY_HAS_CDMA_VOICE_PRIVACY = 32; // 0x20
    field public static final int PROPERTY_IS_EXTERNAL_CALL = 16; // 0x10
    field public static final int PROPERTY_IS_RTT = 256; // 0x100
    field public static final int PROPERTY_SELF_MANAGED = 128; // 0x80
    field public static final int STATE_ACTIVE = 4; // 0x4
    field public static final int STATE_DIALING = 3; // 0x3
    field public static final int STATE_DISCONNECTED = 6; // 0x6
    field public static final int STATE_HOLDING = 5; // 0x5
    field public static final int STATE_INITIALIZING = 0; // 0x0
    field public static final int STATE_NEW = 1; // 0x1
    field public static final int STATE_PULLING_CALL = 7; // 0x7
    field public static final int STATE_RINGING = 2; // 0x2
  }

  public static final class Connection.RttModifyStatus {
    field public static final int SESSION_MODIFY_REQUEST_FAIL = 2; // 0x2
    field public static final int SESSION_MODIFY_REQUEST_INVALID = 3; // 0x3
    field public static final int SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE = 5; // 0x5
    field public static final int SESSION_MODIFY_REQUEST_SUCCESS = 1; // 0x1
    field public static final int SESSION_MODIFY_REQUEST_TIMED_OUT = 4; // 0x4
  }

  public static final class Connection.RttTextStream {
    method public String read() throws java.io.IOException;
    method public String readImmediately() throws java.io.IOException;
    method public void write(String) throws java.io.IOException;
  }

  public abstract static class Connection.VideoProvider {
    ctor public Connection.VideoProvider();
    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 onRequestCameraCapabilities();
    method public abstract void onRequestConnectionDataUsage();
    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 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);
    method public void setCallDataUsage(long);
    field public static final int SESSION_EVENT_CAMERA_FAILURE = 5; // 0x5
    field public static final int SESSION_EVENT_CAMERA_PERMISSION_ERROR = 7; // 0x7
    field public static final int SESSION_EVENT_CAMERA_READY = 6; // 0x6
    field public static final int SESSION_EVENT_RX_PAUSE = 1; // 0x1
    field public static final int SESSION_EVENT_RX_RESUME = 2; // 0x2
    field public static final int SESSION_EVENT_TX_START = 3; // 0x3
    field public static final int SESSION_EVENT_TX_STOP = 4; // 0x4
    field public static final int SESSION_MODIFY_REQUEST_FAIL = 2; // 0x2
    field public static final int SESSION_MODIFY_REQUEST_INVALID = 3; // 0x3
    field public static final int SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE = 5; // 0x5
    field public static final int SESSION_MODIFY_REQUEST_SUCCESS = 1; // 0x1
    field public static final int SESSION_MODIFY_REQUEST_TIMED_OUT = 4; // 0x4
  }

  public final class ConnectionRequest implements android.os.Parcelable {
    ctor public ConnectionRequest(android.telecom.PhoneAccountHandle, android.net.Uri, android.os.Bundle);
    ctor public ConnectionRequest(android.telecom.PhoneAccountHandle, android.net.Uri, android.os.Bundle, int);
    method public int describeContents();
    method public android.telecom.PhoneAccountHandle getAccountHandle();
    method public android.net.Uri getAddress();
    method public android.os.Bundle getExtras();
    method public android.telecom.Connection.RttTextStream getRttTextStream();
    method public int getVideoState();
    method public boolean isRequestingRtt();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telecom.ConnectionRequest> CREATOR;
  }

  public abstract class ConnectionService extends android.app.Service {
    ctor public ConnectionService();
    method public final void addConference(android.telecom.Conference);
    method public final void addExistingConnection(android.telecom.PhoneAccountHandle, android.telecom.Connection);
    method public final void conferenceRemoteConnections(android.telecom.RemoteConnection, android.telecom.RemoteConnection);
    method public final void connectionServiceFocusReleased();
    method public final android.telecom.RemoteConnection createRemoteIncomingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public final android.telecom.RemoteConnection createRemoteOutgoingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public final java.util.Collection<android.telecom.Conference> getAllConferences();
    method public final java.util.Collection<android.telecom.Connection> getAllConnections();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public void onConference(android.telecom.Connection, android.telecom.Connection);
    method public void onConnectionServiceFocusGained();
    method public void onConnectionServiceFocusLost();
    method public android.telecom.Connection onCreateIncomingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public void onCreateIncomingConnectionFailed(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateIncomingHandoverConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateOutgoingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public void onCreateOutgoingConnectionFailed(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateOutgoingHandoverConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public void onHandoverFailed(android.telecom.ConnectionRequest, int);
    method public void onRemoteConferenceAdded(android.telecom.RemoteConference);
    method public void onRemoteExistingConnectionAdded(android.telecom.RemoteConnection);
    field public static final String SERVICE_INTERFACE = "android.telecom.ConnectionService";
  }

  public final class DisconnectCause implements android.os.Parcelable {
    ctor public DisconnectCause(int);
    ctor public DisconnectCause(int, String);
    ctor public DisconnectCause(int, CharSequence, CharSequence, String);
    ctor public DisconnectCause(int, CharSequence, CharSequence, String, int);
    method public int describeContents();
    method public int getCode();
    method public CharSequence getDescription();
    method public CharSequence getLabel();
    method public String getReason();
    method public int getTone();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ANSWERED_ELSEWHERE = 11; // 0xb
    field public static final int BUSY = 7; // 0x7
    field public static final int CALL_PULLED = 12; // 0xc
    field public static final int CANCELED = 4; // 0x4
    field public static final int CONNECTION_MANAGER_NOT_SUPPORTED = 10; // 0xa
    field public static final android.os.Parcelable.Creator<android.telecom.DisconnectCause> CREATOR;
    field public static final int ERROR = 1; // 0x1
    field public static final int LOCAL = 2; // 0x2
    field public static final int MISSED = 5; // 0x5
    field public static final int OTHER = 9; // 0x9
    field public static final int REJECTED = 6; // 0x6
    field public static final int REMOTE = 3; // 0x3
    field public static final int RESTRICTED = 8; // 0x8
    field public static final int UNKNOWN = 0; // 0x0
  }

  public class GatewayInfo implements android.os.Parcelable {
    ctor public GatewayInfo(String, android.net.Uri, android.net.Uri);
    method public int describeContents();
    method public android.net.Uri getGatewayAddress();
    method public String getGatewayProviderPackageName();
    method public android.net.Uri getOriginalAddress();
    method public boolean isEmpty();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telecom.GatewayInfo> CREATOR;
  }

  public abstract class InCallService extends android.app.Service {
    ctor public InCallService();
    method public final boolean canAddCall();
    method public final android.telecom.CallAudioState getCallAudioState();
    method public final java.util.List<android.telecom.Call> getCalls();
    method public android.os.IBinder onBind(android.content.Intent);
    method public void onBringToForeground(boolean);
    method public void onCallAdded(android.telecom.Call);
    method public void onCallAudioStateChanged(android.telecom.CallAudioState);
    method public void onCallRemoved(android.telecom.Call);
    method public void onCanAddCallChanged(boolean);
    method public void onConnectionEvent(android.telecom.Call, String, android.os.Bundle);
    method public void onSilenceRinger();
    method public final void requestBluetoothAudio(@NonNull android.bluetooth.BluetoothDevice);
    method public final void setAudioRoute(int);
    method public final void setMuted(boolean);
    field public static final String SERVICE_INTERFACE = "android.telecom.InCallService";
  }

  public abstract static class InCallService.VideoCall {
    ctor public InCallService.VideoCall();
    method public abstract void registerCallback(android.telecom.InCallService.VideoCall.Callback);
    method public abstract void registerCallback(android.telecom.InCallService.VideoCall.Callback, android.os.Handler);
    method public abstract void requestCallDataUsage();
    method public abstract void requestCameraCapabilities();
    method public abstract void sendSessionModifyRequest(android.telecom.VideoProfile);
    method public abstract void sendSessionModifyResponse(android.telecom.VideoProfile);
    method public abstract void setCamera(String);
    method public abstract void setDeviceOrientation(int);
    method public abstract void setDisplaySurface(android.view.Surface);
    method public abstract void setPauseImage(android.net.Uri);
    method public abstract void setPreviewSurface(android.view.Surface);
    method public abstract void setZoom(float);
    method public abstract void unregisterCallback(android.telecom.InCallService.VideoCall.Callback);
  }

  public abstract static class InCallService.VideoCall.Callback {
    ctor public InCallService.VideoCall.Callback();
    method public abstract void onCallDataUsageChanged(long);
    method public abstract void onCallSessionEvent(int);
    method public abstract void onCameraCapabilitiesChanged(android.telecom.VideoProfile.CameraCapabilities);
    method public abstract void onPeerDimensionsChanged(int, int);
    method public abstract void onSessionModifyRequestReceived(android.telecom.VideoProfile);
    method public abstract void onSessionModifyResponseReceived(int, android.telecom.VideoProfile, android.telecom.VideoProfile);
    method public abstract void onVideoQualityChanged(int);
  }

  public final class PhoneAccount implements android.os.Parcelable {
    method public static android.telecom.PhoneAccount.Builder builder(android.telecom.PhoneAccountHandle, CharSequence);
    method public int describeContents();
    method public android.telecom.PhoneAccountHandle getAccountHandle();
    method public android.net.Uri getAddress();
    method public int getCapabilities();
    method public android.os.Bundle getExtras();
    method public int getHighlightColor();
    method public android.graphics.drawable.Icon getIcon();
    method public CharSequence getLabel();
    method public CharSequence getShortDescription();
    method public android.net.Uri getSubscriptionAddress();
    method public java.util.List<java.lang.String> getSupportedUriSchemes();
    method public boolean hasCapabilities(int);
    method public boolean isEnabled();
    method public boolean supportsUriScheme(String);
    method public android.telecom.PhoneAccount.Builder toBuilder();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CAPABILITY_CALL_PROVIDER = 2; // 0x2
    field public static final int CAPABILITY_CALL_SUBJECT = 64; // 0x40
    field public static final int CAPABILITY_CONNECTION_MANAGER = 1; // 0x1
    field public static final int CAPABILITY_PLACE_EMERGENCY_CALLS = 16; // 0x10
    field public static final int CAPABILITY_RTT = 4096; // 0x1000
    field public static final int CAPABILITY_SELF_MANAGED = 2048; // 0x800
    field public static final int CAPABILITY_SIM_SUBSCRIPTION = 4; // 0x4
    field public static final int CAPABILITY_SUPPORTS_VIDEO_CALLING = 1024; // 0x400
    field public static final int CAPABILITY_VIDEO_CALLING = 8; // 0x8
    field public static final int CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE = 256; // 0x100
    field public static final android.os.Parcelable.Creator<android.telecom.PhoneAccount> CREATOR;
    field public static final String EXTRA_CALL_SUBJECT_CHARACTER_ENCODING = "android.telecom.extra.CALL_SUBJECT_CHARACTER_ENCODING";
    field public static final String EXTRA_CALL_SUBJECT_MAX_LENGTH = "android.telecom.extra.CALL_SUBJECT_MAX_LENGTH";
    field public static final String EXTRA_LOG_SELF_MANAGED_CALLS = "android.telecom.extra.LOG_SELF_MANAGED_CALLS";
    field public static final String EXTRA_SUPPORTS_HANDOVER_FROM = "android.telecom.extra.SUPPORTS_HANDOVER_FROM";
    field public static final String EXTRA_SUPPORTS_HANDOVER_TO = "android.telecom.extra.SUPPORTS_HANDOVER_TO";
    field public static final int NO_HIGHLIGHT_COLOR = 0; // 0x0
    field public static final int NO_RESOURCE_ID = -1; // 0xffffffff
    field public static final String SCHEME_SIP = "sip";
    field public static final String SCHEME_TEL = "tel";
    field public static final String SCHEME_VOICEMAIL = "voicemail";
  }

  public static class PhoneAccount.Builder {
    ctor public PhoneAccount.Builder(android.telecom.PhoneAccountHandle, CharSequence);
    ctor public PhoneAccount.Builder(android.telecom.PhoneAccount);
    method public android.telecom.PhoneAccount.Builder addSupportedUriScheme(String);
    method public android.telecom.PhoneAccount build();
    method public android.telecom.PhoneAccount.Builder setAddress(android.net.Uri);
    method public android.telecom.PhoneAccount.Builder setCapabilities(int);
    method public android.telecom.PhoneAccount.Builder setExtras(android.os.Bundle);
    method public android.telecom.PhoneAccount.Builder setHighlightColor(int);
    method public android.telecom.PhoneAccount.Builder setIcon(android.graphics.drawable.Icon);
    method public android.telecom.PhoneAccount.Builder setShortDescription(CharSequence);
    method public android.telecom.PhoneAccount.Builder setSubscriptionAddress(android.net.Uri);
    method public android.telecom.PhoneAccount.Builder setSupportedUriSchemes(java.util.List<java.lang.String>);
  }

  public final class PhoneAccountHandle implements android.os.Parcelable {
    ctor public PhoneAccountHandle(@NonNull android.content.ComponentName, @NonNull String);
    ctor public PhoneAccountHandle(@NonNull android.content.ComponentName, @NonNull String, @NonNull android.os.UserHandle);
    method public int describeContents();
    method public android.content.ComponentName getComponentName();
    method public String getId();
    method public android.os.UserHandle getUserHandle();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telecom.PhoneAccountHandle> CREATOR;
  }

  public final class PhoneAccountSuggestion implements android.os.Parcelable {
    method public int describeContents();
    method public android.telecom.PhoneAccountHandle getPhoneAccountHandle();
    method public int getReason();
    method public boolean shouldAutoSelect();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telecom.PhoneAccountSuggestion> CREATOR;
    field public static final int REASON_FREQUENT = 2; // 0x2
    field public static final int REASON_INTRA_CARRIER = 1; // 0x1
    field public static final int REASON_NONE = 0; // 0x0
    field public static final int REASON_OTHER = 4; // 0x4
    field public static final int REASON_USER_SET = 3; // 0x3
  }

  public final class RemoteConference {
    method public void disconnect();
    method public java.util.List<android.telecom.RemoteConnection> getConferenceableConnections();
    method public int getConnectionCapabilities();
    method public int getConnectionProperties();
    method public java.util.List<android.telecom.RemoteConnection> getConnections();
    method public android.telecom.DisconnectCause getDisconnectCause();
    method public android.os.Bundle getExtras();
    method public int getState();
    method public void hold();
    method public void merge();
    method public void playDtmfTone(char);
    method public void registerCallback(android.telecom.RemoteConference.Callback);
    method public void registerCallback(android.telecom.RemoteConference.Callback, android.os.Handler);
    method public void separate(android.telecom.RemoteConnection);
    method public void setCallAudioState(android.telecom.CallAudioState);
    method public void stopDtmfTone();
    method public void swap();
    method public void unhold();
    method public void unregisterCallback(android.telecom.RemoteConference.Callback);
  }

  public abstract static class RemoteConference.Callback {
    ctor public RemoteConference.Callback();
    method public void onConferenceableConnectionsChanged(android.telecom.RemoteConference, java.util.List<android.telecom.RemoteConnection>);
    method public void onConnectionAdded(android.telecom.RemoteConference, android.telecom.RemoteConnection);
    method public void onConnectionCapabilitiesChanged(android.telecom.RemoteConference, int);
    method public void onConnectionPropertiesChanged(android.telecom.RemoteConference, int);
    method public void onConnectionRemoved(android.telecom.RemoteConference, android.telecom.RemoteConnection);
    method public void onDestroyed(android.telecom.RemoteConference);
    method public void onDisconnected(android.telecom.RemoteConference, android.telecom.DisconnectCause);
    method public void onExtrasChanged(android.telecom.RemoteConference, @Nullable android.os.Bundle);
    method public void onStateChanged(android.telecom.RemoteConference, int, int);
  }

  public final class RemoteConnection {
    method public void abort();
    method public void answer();
    method public void disconnect();
    method public android.net.Uri getAddress();
    method public int getAddressPresentation();
    method public CharSequence getCallerDisplayName();
    method public int getCallerDisplayNamePresentation();
    method public android.telecom.RemoteConference getConference();
    method public java.util.List<android.telecom.RemoteConnection> getConferenceableConnections();
    method public int getConnectionCapabilities();
    method public int getConnectionProperties();
    method public android.telecom.DisconnectCause getDisconnectCause();
    method public android.os.Bundle getExtras();
    method public int getState();
    method public android.telecom.StatusHints getStatusHints();
    method public android.telecom.RemoteConnection.VideoProvider getVideoProvider();
    method public int getVideoState();
    method public void hold();
    method public boolean isRingbackRequested();
    method public boolean isVoipAudioMode();
    method public void playDtmfTone(char);
    method public void postDialContinue(boolean);
    method public void pullExternalCall();
    method public void registerCallback(android.telecom.RemoteConnection.Callback);
    method public void registerCallback(android.telecom.RemoteConnection.Callback, android.os.Handler);
    method public void reject();
    method public void setCallAudioState(android.telecom.CallAudioState);
    method public void stopDtmfTone();
    method public void unhold();
    method public void unregisterCallback(android.telecom.RemoteConnection.Callback);
  }

  public abstract static class RemoteConnection.Callback {
    ctor public RemoteConnection.Callback();
    method public void onAddressChanged(android.telecom.RemoteConnection, android.net.Uri, int);
    method public void onCallerDisplayNameChanged(android.telecom.RemoteConnection, String, int);
    method public void onConferenceChanged(android.telecom.RemoteConnection, android.telecom.RemoteConference);
    method public void onConferenceableConnectionsChanged(android.telecom.RemoteConnection, java.util.List<android.telecom.RemoteConnection>);
    method public void onConnectionCapabilitiesChanged(android.telecom.RemoteConnection, int);
    method public void onConnectionEvent(android.telecom.RemoteConnection, String, android.os.Bundle);
    method public void onConnectionPropertiesChanged(android.telecom.RemoteConnection, int);
    method public void onDestroyed(android.telecom.RemoteConnection);
    method public void onDisconnected(android.telecom.RemoteConnection, android.telecom.DisconnectCause);
    method public void onExtrasChanged(android.telecom.RemoteConnection, @Nullable android.os.Bundle);
    method public void onPostDialChar(android.telecom.RemoteConnection, char);
    method public void onPostDialWait(android.telecom.RemoteConnection, String);
    method public void onRingbackRequested(android.telecom.RemoteConnection, boolean);
    method public void onStateChanged(android.telecom.RemoteConnection, int);
    method public void onStatusHintsChanged(android.telecom.RemoteConnection, android.telecom.StatusHints);
    method public void onVideoProviderChanged(android.telecom.RemoteConnection, android.telecom.RemoteConnection.VideoProvider);
    method public void onVideoStateChanged(android.telecom.RemoteConnection, int);
    method public void onVoipAudioChanged(android.telecom.RemoteConnection, boolean);
  }

  public static class RemoteConnection.VideoProvider {
    method public void registerCallback(android.telecom.RemoteConnection.VideoProvider.Callback);
    method public void requestCallDataUsage();
    method public void requestCameraCapabilities();
    method public void sendSessionModifyRequest(android.telecom.VideoProfile, android.telecom.VideoProfile);
    method public void sendSessionModifyResponse(android.telecom.VideoProfile);
    method public void setCamera(String);
    method public void setDeviceOrientation(int);
    method public void setDisplaySurface(android.view.Surface);
    method public void setPauseImage(android.net.Uri);
    method public void setPreviewSurface(android.view.Surface);
    method public void setZoom(float);
    method public void unregisterCallback(android.telecom.RemoteConnection.VideoProvider.Callback);
  }

  public abstract static class RemoteConnection.VideoProvider.Callback {
    ctor public RemoteConnection.VideoProvider.Callback();
    method public void onCallDataUsageChanged(android.telecom.RemoteConnection.VideoProvider, long);
    method public void onCallSessionEvent(android.telecom.RemoteConnection.VideoProvider, int);
    method public void onCameraCapabilitiesChanged(android.telecom.RemoteConnection.VideoProvider, android.telecom.VideoProfile.CameraCapabilities);
    method public void onPeerDimensionsChanged(android.telecom.RemoteConnection.VideoProvider, int, int);
    method public void onSessionModifyRequestReceived(android.telecom.RemoteConnection.VideoProvider, android.telecom.VideoProfile);
    method public void onSessionModifyResponseReceived(android.telecom.RemoteConnection.VideoProvider, int, android.telecom.VideoProfile, android.telecom.VideoProfile);
    method public void onVideoQualityChanged(android.telecom.RemoteConnection.VideoProvider, int);
  }

  public final class StatusHints implements android.os.Parcelable {
    ctor public StatusHints(CharSequence, android.graphics.drawable.Icon, android.os.Bundle);
    method public int describeContents();
    method public android.os.Bundle getExtras();
    method public android.graphics.drawable.Icon getIcon();
    method public CharSequence getLabel();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telecom.StatusHints> CREATOR;
  }

  public class TelecomManager {
    method public void acceptHandover(android.net.Uri, int, android.telecom.PhoneAccountHandle);
    method @RequiresPermission(anyOf={android.Manifest.permission.ANSWER_PHONE_CALLS, android.Manifest.permission.MODIFY_PHONE_STATE}) public void acceptRingingCall();
    method @RequiresPermission(anyOf={android.Manifest.permission.ANSWER_PHONE_CALLS, android.Manifest.permission.MODIFY_PHONE_STATE}) public void acceptRingingCall(int);
    method public void addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void cancelMissedCallsNotification();
    method public android.content.Intent createManageBlockedNumbersIntent();
    method @RequiresPermission(android.Manifest.permission.ANSWER_PHONE_CALLS) public boolean endCall();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.net.Uri getAdnUriForPhoneAccount(android.telecom.PhoneAccountHandle);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<android.telecom.PhoneAccountHandle> getCallCapablePhoneAccounts();
    method public String getDefaultDialerPackage();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telecom.PhoneAccountHandle getDefaultOutgoingPhoneAccount(String);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getLine1Number(android.telecom.PhoneAccountHandle);
    method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<android.telecom.PhoneAccountHandle> getSelfManagedPhoneAccounts();
    method public android.telecom.PhoneAccountHandle getSimCallManager();
    method public String getSystemDialerPackage();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telecom.PhoneAccountHandle getUserSelectedOutgoingPhoneAccount();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailNumber(android.telecom.PhoneAccountHandle);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handleMmi(String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handleMmi(String, android.telecom.PhoneAccountHandle);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isInCall();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isInManagedCall();
    method public boolean isIncomingCallPermitted(android.telecom.PhoneAccountHandle);
    method public boolean isOutgoingCallPermitted(android.telecom.PhoneAccountHandle);
    method @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PHONE_STATE}) public boolean isTtySupported();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isVoiceMailNumber(android.telecom.PhoneAccountHandle, String);
    method @RequiresPermission(anyOf={android.Manifest.permission.CALL_PHONE, android.Manifest.permission.MANAGE_OWN_CALLS}) public void placeCall(android.net.Uri, android.os.Bundle);
    method public void registerPhoneAccount(android.telecom.PhoneAccount);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public void showInCallScreen(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void silenceRinger();
    method public void unregisterPhoneAccount(android.telecom.PhoneAccountHandle);
    field public static final String ACTION_CHANGE_DEFAULT_DIALER = "android.telecom.action.CHANGE_DEFAULT_DIALER";
    field public static final String ACTION_CHANGE_PHONE_ACCOUNTS = "android.telecom.action.CHANGE_PHONE_ACCOUNTS";
    field public static final String ACTION_CONFIGURE_PHONE_ACCOUNT = "android.telecom.action.CONFIGURE_PHONE_ACCOUNT";
    field public static final String ACTION_DEFAULT_CALL_SCREENING_APP_CHANGED = "android.telecom.action.DEFAULT_CALL_SCREENING_APP_CHANGED";
    field public static final String ACTION_DEFAULT_DIALER_CHANGED = "android.telecom.action.DEFAULT_DIALER_CHANGED";
    field @Deprecated public static final String ACTION_INCOMING_CALL = "android.telecom.action.INCOMING_CALL";
    field public static final String ACTION_PHONE_ACCOUNT_REGISTERED = "android.telecom.action.PHONE_ACCOUNT_REGISTERED";
    field public static final String ACTION_PHONE_ACCOUNT_UNREGISTERED = "android.telecom.action.PHONE_ACCOUNT_UNREGISTERED";
    field public static final String ACTION_SHOW_CALL_ACCESSIBILITY_SETTINGS = "android.telecom.action.SHOW_CALL_ACCESSIBILITY_SETTINGS";
    field public static final String ACTION_SHOW_CALL_SETTINGS = "android.telecom.action.SHOW_CALL_SETTINGS";
    field public static final String ACTION_SHOW_MISSED_CALLS_NOTIFICATION = "android.telecom.action.SHOW_MISSED_CALLS_NOTIFICATION";
    field public static final String ACTION_SHOW_RESPOND_VIA_SMS_SETTINGS = "android.telecom.action.SHOW_RESPOND_VIA_SMS_SETTINGS";
    field public static final char DTMF_CHARACTER_PAUSE = 44; // 0x002c ','
    field public static final char DTMF_CHARACTER_WAIT = 59; // 0x003b ';'
    field public static final String EXTRA_CALL_BACK_NUMBER = "android.telecom.extra.CALL_BACK_NUMBER";
    field public static final String EXTRA_CALL_DISCONNECT_CAUSE = "android.telecom.extra.CALL_DISCONNECT_CAUSE";
    field public static final String EXTRA_CALL_DISCONNECT_MESSAGE = "android.telecom.extra.CALL_DISCONNECT_MESSAGE";
    field public static final String EXTRA_CALL_NETWORK_TYPE = "android.telecom.extra.CALL_NETWORK_TYPE";
    field public static final String EXTRA_CALL_SUBJECT = "android.telecom.extra.CALL_SUBJECT";
    field public static final String EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME = "android.telecom.extra.CHANGE_DEFAULT_DIALER_PACKAGE_NAME";
    field public static final String EXTRA_DEFAULT_CALL_SCREENING_APP_COMPONENT_NAME = "android.telecom.extra.DEFAULT_CALL_SCREENING_APP_COMPONENT_NAME";
    field public static final String EXTRA_INCOMING_CALL_ADDRESS = "android.telecom.extra.INCOMING_CALL_ADDRESS";
    field public static final String EXTRA_INCOMING_CALL_EXTRAS = "android.telecom.extra.INCOMING_CALL_EXTRAS";
    field public static final String EXTRA_INCOMING_VIDEO_STATE = "android.telecom.extra.INCOMING_VIDEO_STATE";
    field public static final String EXTRA_IS_DEFAULT_CALL_SCREENING_APP = "android.telecom.extra.IS_DEFAULT_CALL_SCREENING_APP";
    field public static final String EXTRA_NOTIFICATION_COUNT = "android.telecom.extra.NOTIFICATION_COUNT";
    field public static final String EXTRA_NOTIFICATION_PHONE_NUMBER = "android.telecom.extra.NOTIFICATION_PHONE_NUMBER";
    field public static final String EXTRA_OUTGOING_CALL_EXTRAS = "android.telecom.extra.OUTGOING_CALL_EXTRAS";
    field public static final String EXTRA_PHONE_ACCOUNT_HANDLE = "android.telecom.extra.PHONE_ACCOUNT_HANDLE";
    field public static final String EXTRA_START_CALL_WITH_RTT = "android.telecom.extra.START_CALL_WITH_RTT";
    field public static final String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.telecom.extra.START_CALL_WITH_SPEAKERPHONE";
    field public static final String EXTRA_START_CALL_WITH_VIDEO_STATE = "android.telecom.extra.START_CALL_WITH_VIDEO_STATE";
    field public static final String GATEWAY_ORIGINAL_ADDRESS = "android.telecom.extra.GATEWAY_ORIGINAL_ADDRESS";
    field public static final String GATEWAY_PROVIDER_PACKAGE = "android.telecom.extra.GATEWAY_PROVIDER_PACKAGE";
    field public static final String METADATA_INCLUDE_EXTERNAL_CALLS = "android.telecom.INCLUDE_EXTERNAL_CALLS";
    field public static final String METADATA_INCLUDE_SELF_MANAGED_CALLS = "android.telecom.INCLUDE_SELF_MANAGED_CALLS";
    field public static final String METADATA_IN_CALL_SERVICE_RINGING = "android.telecom.IN_CALL_SERVICE_RINGING";
    field public static final String METADATA_IN_CALL_SERVICE_UI = "android.telecom.IN_CALL_SERVICE_UI";
    field public static final int PRESENTATION_ALLOWED = 1; // 0x1
    field public static final int PRESENTATION_PAYPHONE = 4; // 0x4
    field public static final int PRESENTATION_RESTRICTED = 2; // 0x2
    field public static final int PRESENTATION_UNKNOWN = 3; // 0x3
  }

  public class VideoProfile implements android.os.Parcelable {
    ctor public VideoProfile(int);
    ctor public VideoProfile(int, int);
    method public int describeContents();
    method public int getQuality();
    method public int getVideoState();
    method public static boolean isAudioOnly(int);
    method public static boolean isBidirectional(int);
    method public static boolean isPaused(int);
    method public static boolean isReceptionEnabled(int);
    method public static boolean isTransmissionEnabled(int);
    method public static boolean isVideo(int);
    method public static String videoStateToString(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telecom.VideoProfile> CREATOR;
    field public static final int QUALITY_DEFAULT = 4; // 0x4
    field public static final int QUALITY_HIGH = 1; // 0x1
    field public static final int QUALITY_LOW = 3; // 0x3
    field public static final int QUALITY_MEDIUM = 2; // 0x2
    field public static final int STATE_AUDIO_ONLY = 0; // 0x0
    field public static final int STATE_BIDIRECTIONAL = 3; // 0x3
    field public static final int STATE_PAUSED = 4; // 0x4
    field public static final int STATE_RX_ENABLED = 2; // 0x2
    field public static final int STATE_TX_ENABLED = 1; // 0x1
  }

  public static final class VideoProfile.CameraCapabilities implements android.os.Parcelable {
    ctor public VideoProfile.CameraCapabilities(@IntRange(from=0) int, @IntRange(from=0) int);
    ctor public VideoProfile.CameraCapabilities(@IntRange(from=0) int, @IntRange(from=0) int, boolean, @FloatRange(from=1.0f) float);
    method public int describeContents();
    method public int getHeight();
    method public float getMaxZoom();
    method public int getWidth();
    method public boolean isZoomSupported();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telecom.VideoProfile.CameraCapabilities> CREATOR;
  }

}

package android.telephony {

  public final class AccessNetworkConstants {
  }

  public static final class AccessNetworkConstants.AccessNetworkType {
    field public static final int CDMA2000 = 4; // 0x4
    field public static final int EUTRAN = 3; // 0x3
    field public static final int GERAN = 1; // 0x1
    field public static final int IWLAN = 5; // 0x5
    field public static final int UNKNOWN = 0; // 0x0
    field public static final int UTRAN = 2; // 0x2
  }

  public static final class AccessNetworkConstants.EutranBand {
    field public static final int BAND_1 = 1; // 0x1
    field public static final int BAND_10 = 10; // 0xa
    field public static final int BAND_11 = 11; // 0xb
    field public static final int BAND_12 = 12; // 0xc
    field public static final int BAND_13 = 13; // 0xd
    field public static final int BAND_14 = 14; // 0xe
    field public static final int BAND_17 = 17; // 0x11
    field public static final int BAND_18 = 18; // 0x12
    field public static final int BAND_19 = 19; // 0x13
    field public static final int BAND_2 = 2; // 0x2
    field public static final int BAND_20 = 20; // 0x14
    field public static final int BAND_21 = 21; // 0x15
    field public static final int BAND_22 = 22; // 0x16
    field public static final int BAND_23 = 23; // 0x17
    field public static final int BAND_24 = 24; // 0x18
    field public static final int BAND_25 = 25; // 0x19
    field public static final int BAND_26 = 26; // 0x1a
    field public static final int BAND_27 = 27; // 0x1b
    field public static final int BAND_28 = 28; // 0x1c
    field public static final int BAND_3 = 3; // 0x3
    field public static final int BAND_30 = 30; // 0x1e
    field public static final int BAND_31 = 31; // 0x1f
    field public static final int BAND_33 = 33; // 0x21
    field public static final int BAND_34 = 34; // 0x22
    field public static final int BAND_35 = 35; // 0x23
    field public static final int BAND_36 = 36; // 0x24
    field public static final int BAND_37 = 37; // 0x25
    field public static final int BAND_38 = 38; // 0x26
    field public static final int BAND_39 = 39; // 0x27
    field public static final int BAND_4 = 4; // 0x4
    field public static final int BAND_40 = 40; // 0x28
    field public static final int BAND_41 = 41; // 0x29
    field public static final int BAND_42 = 42; // 0x2a
    field public static final int BAND_43 = 43; // 0x2b
    field public static final int BAND_44 = 44; // 0x2c
    field public static final int BAND_45 = 45; // 0x2d
    field public static final int BAND_46 = 46; // 0x2e
    field public static final int BAND_47 = 47; // 0x2f
    field public static final int BAND_48 = 48; // 0x30
    field public static final int BAND_5 = 5; // 0x5
    field public static final int BAND_6 = 6; // 0x6
    field public static final int BAND_65 = 65; // 0x41
    field public static final int BAND_66 = 66; // 0x42
    field public static final int BAND_68 = 68; // 0x44
    field public static final int BAND_7 = 7; // 0x7
    field public static final int BAND_70 = 70; // 0x46
    field public static final int BAND_8 = 8; // 0x8
    field public static final int BAND_9 = 9; // 0x9
  }

  public static final class AccessNetworkConstants.GeranBand {
    field public static final int BAND_450 = 3; // 0x3
    field public static final int BAND_480 = 4; // 0x4
    field public static final int BAND_710 = 5; // 0x5
    field public static final int BAND_750 = 6; // 0x6
    field public static final int BAND_850 = 8; // 0x8
    field public static final int BAND_DCS1800 = 12; // 0xc
    field public static final int BAND_E900 = 10; // 0xa
    field public static final int BAND_ER900 = 14; // 0xe
    field public static final int BAND_P900 = 9; // 0x9
    field public static final int BAND_PCS1900 = 13; // 0xd
    field public static final int BAND_R900 = 11; // 0xb
    field public static final int BAND_T380 = 1; // 0x1
    field public static final int BAND_T410 = 2; // 0x2
    field public static final int BAND_T810 = 7; // 0x7
  }

  public static final class AccessNetworkConstants.UtranBand {
    field public static final int BAND_1 = 1; // 0x1
    field public static final int BAND_10 = 10; // 0xa
    field public static final int BAND_11 = 11; // 0xb
    field public static final int BAND_12 = 12; // 0xc
    field public static final int BAND_13 = 13; // 0xd
    field public static final int BAND_14 = 14; // 0xe
    field public static final int BAND_19 = 19; // 0x13
    field public static final int BAND_2 = 2; // 0x2
    field public static final int BAND_20 = 20; // 0x14
    field public static final int BAND_21 = 21; // 0x15
    field public static final int BAND_22 = 22; // 0x16
    field public static final int BAND_25 = 25; // 0x19
    field public static final int BAND_26 = 26; // 0x1a
    field public static final int BAND_3 = 3; // 0x3
    field public static final int BAND_4 = 4; // 0x4
    field public static final int BAND_5 = 5; // 0x5
    field public static final int BAND_6 = 6; // 0x6
    field public static final int BAND_7 = 7; // 0x7
    field public static final int BAND_8 = 8; // 0x8
    field public static final int BAND_9 = 9; // 0x9
  }

  public final class AvailableNetworkInfo implements android.os.Parcelable {
    ctor public AvailableNetworkInfo(int, int, java.util.ArrayList<java.lang.String>);
    method public int describeContents();
    method public java.util.List<java.lang.String> getMccMncs();
    method public int getPriority();
    method public int getSubId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.AvailableNetworkInfo> CREATOR;
    field public static final int PRIORITY_HIGH = 1; // 0x1
    field public static final int PRIORITY_LOW = 3; // 0x3
    field public static final int PRIORITY_MED = 2; // 0x2
  }

  public class CarrierConfigManager {
    method @Nullable public android.os.PersistableBundle getConfig();
    method @Nullable public android.os.PersistableBundle getConfigForSubId(int);
    method public static boolean isConfigForIdentifiedCarrier(android.os.PersistableBundle);
    method public void notifyConfigChangedForSubId(int);
    field public static final String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED";
    field public static final int DATA_CYCLE_THRESHOLD_DISABLED = -2; // 0xfffffffe
    field public static final String EXTRA_SLOT_INDEX = "android.telephony.extra.SLOT_INDEX";
    field public static final String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
    field public static final String KEY_ADDITIONAL_CALL_SETTING_BOOL = "additional_call_setting_bool";
    field public static final String KEY_ALLOW_ADDING_APNS_BOOL = "allow_adding_apns_bool";
    field public static final String KEY_ALLOW_ADD_CALL_DURING_VIDEO_CALL_BOOL = "allow_add_call_during_video_call";
    field public static final String KEY_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG_BOOL = "allow_emergency_numbers_in_call_log_bool";
    field public static final String KEY_ALLOW_EMERGENCY_VIDEO_CALLS_BOOL = "allow_emergency_video_calls_bool";
    field public static final String KEY_ALLOW_LOCAL_DTMF_TONES_BOOL = "allow_local_dtmf_tones_bool";
    field public static final String KEY_ALLOW_MERGE_WIFI_CALLS_WHEN_VOWIFI_OFF_BOOL = "allow_merge_wifi_calls_when_vowifi_off_bool";
    field public static final String KEY_ALLOW_NON_EMERGENCY_CALLS_IN_ECM_BOOL = "allow_non_emergency_calls_in_ecm_bool";
    field public static final String KEY_ALWAYS_SHOW_EMERGENCY_ALERT_ONOFF_BOOL = "always_show_emergency_alert_onoff_bool";
    field public static final String KEY_APN_EXPAND_BOOL = "apn_expand_bool";
    field public static final String KEY_AUTO_RETRY_ENABLED_BOOL = "auto_retry_enabled_bool";
    field public static final String KEY_CALL_BARRING_SUPPORTS_DEACTIVATE_ALL_BOOL = "call_barring_supports_deactivate_all_bool";
    field public static final String KEY_CALL_BARRING_SUPPORTS_PASSWORD_CHANGE_BOOL = "call_barring_supports_password_change_bool";
    field public static final String KEY_CALL_BARRING_VISIBILITY_BOOL = "call_barring_visibility_bool";
    field public static final String KEY_CALL_FORWARDING_BLOCKS_WHILE_ROAMING_STRING_ARRAY = "call_forwarding_blocks_while_roaming_string_array";
    field public static final String KEY_CARRIER_ALLOW_TURNOFF_IMS_BOOL = "carrier_allow_turnoff_ims_bool";
    field public static final String KEY_CARRIER_CALL_SCREENING_APP_STRING = "call_screening_app";
    field public static final String KEY_CARRIER_CONFIG_VERSION_STRING = "carrier_config_version_string";
    field public static final String KEY_CARRIER_DATA_CALL_PERMANENT_FAILURE_STRINGS = "carrier_data_call_permanent_failure_strings";
    field public static final String KEY_CARRIER_DEFAULT_WFC_IMS_MODE_INT = "carrier_default_wfc_ims_mode_int";
    field public static final String KEY_CARRIER_DEFAULT_WFC_IMS_ROAMING_MODE_INT = "carrier_default_wfc_ims_roaming_mode_int";
    field public static final String KEY_CARRIER_FORCE_DISABLE_ETWS_CMAS_TEST_BOOL = "carrier_force_disable_etws_cmas_test_bool";
    field public static final String KEY_CARRIER_IMS_GBA_REQUIRED_BOOL = "carrier_ims_gba_required_bool";
    field public static final String KEY_CARRIER_INSTANT_LETTERING_AVAILABLE_BOOL = "carrier_instant_lettering_available_bool";
    field public static final String KEY_CARRIER_INSTANT_LETTERING_ENCODING_STRING = "carrier_instant_lettering_encoding_string";
    field public static final String KEY_CARRIER_INSTANT_LETTERING_ESCAPED_CHARS_STRING = "carrier_instant_lettering_escaped_chars_string";
    field public static final String KEY_CARRIER_INSTANT_LETTERING_INVALID_CHARS_STRING = "carrier_instant_lettering_invalid_chars_string";
    field public static final String KEY_CARRIER_INSTANT_LETTERING_LENGTH_LIMIT_INT = "carrier_instant_lettering_length_limit_int";
    field public static final String KEY_CARRIER_NAME_OVERRIDE_BOOL = "carrier_name_override_bool";
    field public static final String KEY_CARRIER_NAME_STRING = "carrier_name_string";
    field public static final String KEY_CARRIER_SETTINGS_ENABLE_BOOL = "carrier_settings_enable_bool";
    field public static final String KEY_CARRIER_SUPPORTS_SS_OVER_UT_BOOL = "carrier_supports_ss_over_ut_bool";
    field public static final String KEY_CARRIER_USE_IMS_FIRST_FOR_EMERGENCY_BOOL = "carrier_use_ims_first_for_emergency_bool";
    field public static final String KEY_CARRIER_UT_PROVISIONING_REQUIRED_BOOL = "carrier_ut_provisioning_required_bool";
    field public static final String KEY_CARRIER_VOLTE_AVAILABLE_BOOL = "carrier_volte_available_bool";
    field public static final String KEY_CARRIER_VOLTE_PROVISIONED_BOOL = "carrier_volte_provisioned_bool";
    field public static final String KEY_CARRIER_VOLTE_PROVISIONING_REQUIRED_BOOL = "carrier_volte_provisioning_required_bool";
    field public static final String KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL = "carrier_volte_tty_supported_bool";
    field public static final String KEY_CARRIER_VT_AVAILABLE_BOOL = "carrier_vt_available_bool";
    field @Deprecated public static final String KEY_CARRIER_VVM_PACKAGE_NAME_STRING = "carrier_vvm_package_name_string";
    field public static final String KEY_CARRIER_VVM_PACKAGE_NAME_STRING_ARRAY = "carrier_vvm_package_name_string_array";
    field public static final String KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL = "carrier_wfc_ims_available_bool";
    field public static final String KEY_CARRIER_WFC_SUPPORTS_WIFI_ONLY_BOOL = "carrier_wfc_supports_wifi_only_bool";
    field public static final String KEY_CDMA_3WAYCALL_FLASH_DELAY_INT = "cdma_3waycall_flash_delay_int";
    field public static final String KEY_CDMA_DTMF_TONE_DELAY_INT = "cdma_dtmf_tone_delay_int";
    field public static final String KEY_CDMA_NONROAMING_NETWORKS_STRING_ARRAY = "cdma_nonroaming_networks_string_array";
    field public static final String KEY_CDMA_ROAMING_MODE_INT = "cdma_roaming_mode_int";
    field public static final String KEY_CDMA_ROAMING_NETWORKS_STRING_ARRAY = "cdma_roaming_networks_string_array";
    field public static final String KEY_CI_ACTION_ON_SYS_UPDATE_BOOL = "ci_action_on_sys_update_bool";
    field public static final String KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_STRING = "ci_action_on_sys_update_extra_string";
    field public static final String KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_VAL_STRING = "ci_action_on_sys_update_extra_val_string";
    field public static final String KEY_CI_ACTION_ON_SYS_UPDATE_INTENT_STRING = "ci_action_on_sys_update_intent_string";
    field public static final String KEY_CONFIG_IMS_PACKAGE_OVERRIDE_STRING = "config_ims_package_override_string";
    field public static final String KEY_CONFIG_PLANS_PACKAGE_OVERRIDE_STRING = "config_plans_package_override_string";
    field public static final String KEY_CONFIG_TELEPHONY_USE_OWN_NUMBER_FOR_VOICEMAIL_BOOL = "config_telephony_use_own_number_for_voicemail_bool";
    field public static final String KEY_CSP_ENABLED_BOOL = "csp_enabled_bool";
    field public static final String KEY_DATA_LIMIT_THRESHOLD_BYTES_LONG = "data_limit_threshold_bytes_long";
    field public static final String KEY_DATA_WARNING_THRESHOLD_BYTES_LONG = "data_warning_threshold_bytes_long";
    field public static final String KEY_DEFAULT_SIM_CALL_MANAGER_STRING = "default_sim_call_manager_string";
    field public static final String KEY_DEFAULT_VM_NUMBER_STRING = "default_vm_number_string";
    field public static final String KEY_DIAL_STRING_REPLACE_STRING_ARRAY = "dial_string_replace_string_array";
    field public static final String KEY_DISABLE_CDMA_ACTIVATION_CODE_BOOL = "disable_cdma_activation_code_bool";
    field public static final String KEY_DISPLAY_HD_AUDIO_PROPERTY_BOOL = "display_hd_audio_property_bool";
    field public static final String KEY_DROP_VIDEO_CALL_WHEN_ANSWERING_AUDIO_CALL_BOOL = "drop_video_call_when_answering_audio_call_bool";
    field public static final String KEY_DTMF_TYPE_ENABLED_BOOL = "dtmf_type_enabled_bool";
    field public static final String KEY_DURATION_BLOCKING_DISABLED_AFTER_EMERGENCY_INT = "duration_blocking_disabled_after_emergency_int";
    field public static final String KEY_EDITABLE_ENHANCED_4G_LTE_BOOL = "editable_enhanced_4g_lte_bool";
    field public static final String KEY_EDITABLE_VOICEMAIL_NUMBER_BOOL = "editable_voicemail_number_bool";
    field public static final String KEY_EDITABLE_VOICEMAIL_NUMBER_SETTING_BOOL = "editable_voicemail_number_setting_bool";
    field public static final String KEY_ENABLE_DIALER_KEY_VIBRATION_BOOL = "enable_dialer_key_vibration_bool";
    field public static final String KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL = "enhanced_4g_lte_on_by_default_bool";
    field public static final String KEY_FORCE_HOME_NETWORK_BOOL = "force_home_network_bool";
    field public static final String KEY_GSM_DTMF_TONE_DELAY_INT = "gsm_dtmf_tone_delay_int";
    field public static final String KEY_GSM_NONROAMING_NETWORKS_STRING_ARRAY = "gsm_nonroaming_networks_string_array";
    field public static final String KEY_GSM_ROAMING_NETWORKS_STRING_ARRAY = "gsm_roaming_networks_string_array";
    field public static final String KEY_HAS_IN_CALL_NOISE_SUPPRESSION_BOOL = "has_in_call_noise_suppression_bool";
    field public static final String KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL = "hide_carrier_network_settings_bool";
    field public static final String KEY_HIDE_ENHANCED_4G_LTE_BOOL = "hide_enhanced_4g_lte_bool";
    field public static final String KEY_HIDE_IMS_APN_BOOL = "hide_ims_apn_bool";
    field public static final String KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL = "hide_preferred_network_type_bool";
    field public static final String KEY_HIDE_PRESET_APN_DETAILS_BOOL = "hide_preset_apn_details_bool";
    field public static final String KEY_HIDE_SIM_LOCK_SETTINGS_BOOL = "hide_sim_lock_settings_bool";
    field public static final String KEY_IGNORE_SIM_NETWORK_LOCKED_EVENTS_BOOL = "ignore_sim_network_locked_events_bool";
    field public static final String KEY_IMS_CONFERENCE_SIZE_LIMIT_INT = "ims_conference_size_limit_int";
    field public static final String KEY_IMS_DTMF_TONE_DELAY_INT = "ims_dtmf_tone_delay_int";
    field public static final String KEY_IS_IMS_CONFERENCE_SIZE_ENFORCED_BOOL = "is_ims_conference_size_enforced_bool";
    field public static final String KEY_MDN_IS_ADDITIONAL_VOICEMAIL_NUMBER_BOOL = "mdn_is_additional_voicemail_number_bool";
    field public static final String KEY_MMS_ALIAS_ENABLED_BOOL = "aliasEnabled";
    field public static final String KEY_MMS_ALIAS_MAX_CHARS_INT = "aliasMaxChars";
    field public static final String KEY_MMS_ALIAS_MIN_CHARS_INT = "aliasMinChars";
    field public static final String KEY_MMS_ALLOW_ATTACH_AUDIO_BOOL = "allowAttachAudio";
    field public static final String KEY_MMS_APPEND_TRANSACTION_ID_BOOL = "enabledTransID";
    field public static final String KEY_MMS_EMAIL_GATEWAY_NUMBER_STRING = "emailGatewayNumber";
    field public static final String KEY_MMS_GROUP_MMS_ENABLED_BOOL = "enableGroupMms";
    field public static final String KEY_MMS_HTTP_PARAMS_STRING = "httpParams";
    field public static final String KEY_MMS_HTTP_SOCKET_TIMEOUT_INT = "httpSocketTimeout";
    field public static final String KEY_MMS_MAX_IMAGE_HEIGHT_INT = "maxImageHeight";
    field public static final String KEY_MMS_MAX_IMAGE_WIDTH_INT = "maxImageWidth";
    field public static final String KEY_MMS_MAX_MESSAGE_SIZE_INT = "maxMessageSize";
    field public static final String KEY_MMS_MESSAGE_TEXT_MAX_SIZE_INT = "maxMessageTextSize";
    field public static final String KEY_MMS_MMS_DELIVERY_REPORT_ENABLED_BOOL = "enableMMSDeliveryReports";
    field public static final String KEY_MMS_MMS_ENABLED_BOOL = "enabledMMS";
    field public static final String KEY_MMS_MMS_READ_REPORT_ENABLED_BOOL = "enableMMSReadReports";
    field public static final String KEY_MMS_MULTIPART_SMS_ENABLED_BOOL = "enableMultipartSMS";
    field public static final String KEY_MMS_NAI_SUFFIX_STRING = "naiSuffix";
    field public static final String KEY_MMS_NOTIFY_WAP_MMSC_ENABLED_BOOL = "enabledNotifyWapMMSC";
    field public static final String KEY_MMS_RECIPIENT_LIMIT_INT = "recipientLimit";
    field public static final String KEY_MMS_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES_BOOL = "sendMultipartSmsAsSeparateMessages";
    field public static final String KEY_MMS_SHOW_CELL_BROADCAST_APP_LINKS_BOOL = "config_cellBroadcastAppLinks";
    field public static final String KEY_MMS_SMS_DELIVERY_REPORT_ENABLED_BOOL = "enableSMSDeliveryReports";
    field public static final String KEY_MMS_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD_INT = "smsToMmsTextLengthThreshold";
    field public static final String KEY_MMS_SMS_TO_MMS_TEXT_THRESHOLD_INT = "smsToMmsTextThreshold";
    field public static final String KEY_MMS_SUBJECT_MAX_LENGTH_INT = "maxSubjectLength";
    field public static final String KEY_MMS_SUPPORT_HTTP_CHARSET_HEADER_BOOL = "supportHttpCharsetHeader";
    field public static final String KEY_MMS_SUPPORT_MMS_CONTENT_DISPOSITION_BOOL = "supportMmsContentDisposition";
    field public static final String KEY_MMS_UA_PROF_TAG_NAME_STRING = "uaProfTagName";
    field public static final String KEY_MMS_UA_PROF_URL_STRING = "uaProfUrl";
    field public static final String KEY_MMS_USER_AGENT_STRING = "userAgent";
    field public static final String KEY_MONTHLY_DATA_CYCLE_DAY_INT = "monthly_data_cycle_day_int";
    field public static final String KEY_ONLY_SINGLE_DC_ALLOWED_INT_ARRAY = "only_single_dc_allowed_int_array";
    field public static final String KEY_OPERATOR_SELECTION_EXPAND_BOOL = "operator_selection_expand_bool";
    field public static final String KEY_OPPORTUNISTIC_NETWORK_DATA_SWITCH_HYSTERESIS_TIME_LONG = "opportunistic_network_data_switch_hysteresis_time_long";
    field public static final String KEY_OPPORTUNISTIC_NETWORK_ENTRY_OR_EXIT_HYSTERESIS_TIME_LONG = "opportunistic_network_entry_or_exit_hysteresis_time_long";
    field public static final String KEY_OPPORTUNISTIC_NETWORK_ENTRY_THRESHOLD_BANDWIDTH_INT = "opportunistic_network_entry_threshold_bandwidth_int";
    field public static final String KEY_OPPORTUNISTIC_NETWORK_ENTRY_THRESHOLD_RSRP_INT = "opportunistic_network_entry_threshold_rsrp_int";
    field public static final String KEY_OPPORTUNISTIC_NETWORK_ENTRY_THRESHOLD_RSSNR_INT = "opportunistic_network_entry_threshold_rssnr_int";
    field public static final String KEY_OPPORTUNISTIC_NETWORK_EXIT_THRESHOLD_RSRP_INT = "opportunistic_network_exit_threshold_rsrp_int";
    field public static final String KEY_OPPORTUNISTIC_NETWORK_EXIT_THRESHOLD_RSSNR_INT = "opportunistic_network_exit_threshold_rssnr_int";
    field public static final String KEY_PREFER_2G_BOOL = "prefer_2g_bool";
    field public static final String KEY_RADIO_RESTART_FAILURE_CAUSES_INT_ARRAY = "radio_restart_failure_causes_int_array";
    field public static final String KEY_RCS_CONFIG_SERVER_URL_STRING = "rcs_config_server_url_string";
    field public static final String KEY_REQUIRE_ENTITLEMENT_CHECKS_BOOL = "require_entitlement_checks_bool";
    field @Deprecated public static final String KEY_RESTART_RADIO_ON_PDP_FAIL_REGULAR_DEACTIVATION_BOOL = "restart_radio_on_pdp_fail_regular_deactivation_bool";
    field public static final String KEY_RTT_SUPPORTED_BOOL = "rtt_supported_bool";
    field public static final String KEY_SHOW_APN_SETTING_CDMA_BOOL = "show_apn_setting_cdma_bool";
    field public static final String KEY_SHOW_CALL_BLOCKING_DISABLED_NOTIFICATION_ALWAYS_BOOL = "show_call_blocking_disabled_notification_always_bool";
    field public static final String KEY_SHOW_CDMA_CHOICES_BOOL = "show_cdma_choices_bool";
    field public static final String KEY_SHOW_ICCID_IN_SIM_STATUS_BOOL = "show_iccid_in_sim_status_bool";
    field public static final String KEY_SHOW_ONSCREEN_DIAL_BUTTON_BOOL = "show_onscreen_dial_button_bool";
    field public static final String KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL = "show_signal_strength_in_sim_status_bool";
    field public static final String KEY_SIMPLIFIED_NETWORK_SETTINGS_BOOL = "simplified_network_settings_bool";
    field public static final String KEY_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL = "sim_network_unlock_allow_dismiss_bool";
    field public static final String KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL = "sms_requires_destination_number_conversion_bool";
    field public static final String KEY_SUPPORT_3GPP_CALL_FORWARDING_WHILE_ROAMING_BOOL = "support_3gpp_call_forwarding_while_roaming_bool";
    field public static final String KEY_SUPPORT_CLIR_NETWORK_DEFAULT_BOOL = "support_clir_network_default_bool";
    field public static final String KEY_SUPPORT_CONFERENCE_CALL_BOOL = "support_conference_call_bool";
    field public static final String KEY_SUPPORT_EMERGENCY_SMS_OVER_IMS_BOOL = "support_emergency_sms_over_ims_bool";
    field public static final String KEY_SUPPORT_PAUSE_IMS_VIDEO_CALLS_BOOL = "support_pause_ims_video_calls_bool";
    field public static final String KEY_SUPPORT_SWAP_AFTER_MERGE_BOOL = "support_swap_after_merge_bool";
    field public static final String KEY_TREAT_DOWNGRADED_VIDEO_CALLS_AS_VIDEO_CALLS_BOOL = "treat_downgraded_video_calls_as_video_calls_bool";
    field public static final String KEY_USE_HFA_FOR_PROVISIONING_BOOL = "use_hfa_for_provisioning_bool";
    field public static final String KEY_USE_OTASP_FOR_PROVISIONING_BOOL = "use_otasp_for_provisioning_bool";
    field public static final String KEY_USE_RCS_PRESENCE_BOOL = "use_rcs_presence_bool";
    field public static final String KEY_VOICEMAIL_NOTIFICATION_PERSISTENT_BOOL = "voicemail_notification_persistent_bool";
    field public static final String KEY_VOICE_PRIVACY_DISABLE_UI_BOOL = "voice_privacy_disable_ui_bool";
    field public static final String KEY_VOLTE_REPLACEMENT_RAT_INT = "volte_replacement_rat_int";
    field public static final String KEY_VVM_CELLULAR_DATA_REQUIRED_BOOL = "vvm_cellular_data_required_bool";
    field public static final String KEY_VVM_CLIENT_PREFIX_STRING = "vvm_client_prefix_string";
    field public static final String KEY_VVM_DESTINATION_NUMBER_STRING = "vvm_destination_number_string";
    field public static final String KEY_VVM_DISABLED_CAPABILITIES_STRING_ARRAY = "vvm_disabled_capabilities_string_array";
    field public static final String KEY_VVM_LEGACY_MODE_ENABLED_BOOL = "vvm_legacy_mode_enabled_bool";
    field public static final String KEY_VVM_PORT_NUMBER_INT = "vvm_port_number_int";
    field public static final String KEY_VVM_PREFETCH_BOOL = "vvm_prefetch_bool";
    field public static final String KEY_VVM_SSL_ENABLED_BOOL = "vvm_ssl_enabled_bool";
    field public static final String KEY_VVM_TYPE_STRING = "vvm_type_string";
    field public static final String KEY_WORLD_PHONE_BOOL = "world_phone_bool";
  }

  public abstract class CellIdentity implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public CharSequence getOperatorAlphaLong();
    method @Nullable public CharSequence getOperatorAlphaShort();
    method @CallSuper public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellIdentity> CREATOR;
  }

  public final class CellIdentityCdma extends android.telephony.CellIdentity {
    method public int getBasestationId();
    method public int getLatitude();
    method public int getLongitude();
    method public int getNetworkId();
    method public int getSystemId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellIdentityCdma> CREATOR;
  }

  public final class CellIdentityGsm extends android.telephony.CellIdentity {
    method public int getArfcn();
    method public int getBsic();
    method public int getCid();
    method public int getLac();
    method @Deprecated public int getMcc();
    method public String getMccString();
    method @Deprecated public int getMnc();
    method public String getMncString();
    method @Nullable public String getMobileNetworkOperator();
    method @Deprecated public int getPsc();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellIdentityGsm> CREATOR;
  }

  public final class CellIdentityLte extends android.telephony.CellIdentity {
    method public int getBandwidth();
    method public int getCi();
    method public int getEarfcn();
    method @Deprecated public int getMcc();
    method public String getMccString();
    method @Deprecated public int getMnc();
    method public String getMncString();
    method @Nullable public String getMobileNetworkOperator();
    method public int getPci();
    method public int getTac();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellIdentityLte> CREATOR;
  }

  public final class CellIdentityNr extends android.telephony.CellIdentity {
    method public int getChannelNumber();
    method public String getMccString();
    method public String getMncString();
    method public int getPci();
    method public int getTac();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellIdentityNr> CREATOR;
  }

  public final class CellIdentityTdscdma extends android.telephony.CellIdentity {
    method public int getCid();
    method public int getCpid();
    method public int getLac();
    method public String getMccString();
    method public String getMncString();
    method @Nullable public String getMobileNetworkOperator();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellIdentityTdscdma> CREATOR;
  }

  public final class CellIdentityWcdma extends android.telephony.CellIdentity {
    method public int getCid();
    method public int getLac();
    method @Deprecated public int getMcc();
    method public String getMccString();
    method @Deprecated public int getMnc();
    method public String getMncString();
    method @Nullable public String getMobileNetworkOperator();
    method public int getPsc();
    method public int getUarfcn();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellIdentityWcdma> CREATOR;
  }

  public abstract class CellInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getCellConnectionStatus();
    method public long getTimeStamp();
    method public boolean isRegistered();
    field public static final int CONNECTION_NONE = 0; // 0x0
    field public static final int CONNECTION_PRIMARY_SERVING = 1; // 0x1
    field public static final int CONNECTION_SECONDARY_SERVING = 2; // 0x2
    field public static final int CONNECTION_UNKNOWN = 2147483647; // 0x7fffffff
    field public static final android.os.Parcelable.Creator<android.telephony.CellInfo> CREATOR;
    field public static final int UNAVAILABLE = 2147483647; // 0x7fffffff
  }

  public final class CellInfoCdma extends android.telephony.CellInfo implements android.os.Parcelable {
    method public android.telephony.CellIdentityCdma getCellIdentity();
    method public android.telephony.CellSignalStrengthCdma getCellSignalStrength();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellInfoCdma> CREATOR;
  }

  public final class CellInfoGsm extends android.telephony.CellInfo implements android.os.Parcelable {
    method public android.telephony.CellIdentityGsm getCellIdentity();
    method public android.telephony.CellSignalStrengthGsm getCellSignalStrength();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellInfoGsm> CREATOR;
  }

  public final class CellInfoLte extends android.telephony.CellInfo implements android.os.Parcelable {
    method public android.telephony.CellIdentityLte getCellIdentity();
    method public android.telephony.CellSignalStrengthLte getCellSignalStrength();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellInfoLte> CREATOR;
  }

  public final class CellInfoNr extends android.telephony.CellInfo {
    method public android.telephony.CellIdentity getCellIdentity();
    method public android.telephony.CellSignalStrength getCellSignalStrength();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellInfoNr> CREATOR;
  }

  public final class CellInfoWcdma extends android.telephony.CellInfo implements android.os.Parcelable {
    method public android.telephony.CellIdentityWcdma getCellIdentity();
    method public android.telephony.CellSignalStrengthWcdma getCellSignalStrength();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellInfoWcdma> CREATOR;
  }

  public abstract class CellLocation {
    ctor public CellLocation();
    method public static android.telephony.CellLocation getEmpty();
    method public static void requestLocationUpdate();
  }

  public abstract class CellSignalStrength {
    method public abstract boolean equals(Object);
    method public abstract int getAsuLevel();
    method public abstract int getDbm();
    method public abstract int getLevel();
    method public abstract int hashCode();
    field public static final int SIGNAL_STRENGTH_GOOD = 3; // 0x3
    field public static final int SIGNAL_STRENGTH_GREAT = 4; // 0x4
    field public static final int SIGNAL_STRENGTH_MODERATE = 2; // 0x2
    field public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN = 0; // 0x0
    field public static final int SIGNAL_STRENGTH_POOR = 1; // 0x1
  }

  public final class CellSignalStrengthCdma extends android.telephony.CellSignalStrength implements android.os.Parcelable {
    method public int describeContents();
    method public int getAsuLevel();
    method public int getCdmaDbm();
    method public int getCdmaEcio();
    method public int getCdmaLevel();
    method public int getDbm();
    method public int getEvdoDbm();
    method public int getEvdoEcio();
    method public int getEvdoLevel();
    method public int getEvdoSnr();
    method public int getLevel();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellSignalStrengthCdma> CREATOR;
  }

  public final class CellSignalStrengthGsm extends android.telephony.CellSignalStrength implements android.os.Parcelable {
    method public int describeContents();
    method public int getAsuLevel();
    method public int getBitErrorRate();
    method public int getDbm();
    method public int getLevel();
    method public int getTimingAdvance();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellSignalStrengthGsm> CREATOR;
  }

  public final class CellSignalStrengthLte extends android.telephony.CellSignalStrength implements android.os.Parcelable {
    method public int describeContents();
    method public int getAsuLevel();
    method public int getCqi();
    method public int getDbm();
    method public int getLevel();
    method public int getRsrp();
    method public int getRsrq();
    method public int getRssi();
    method public int getRssnr();
    method public int getTimingAdvance();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellSignalStrengthLte> CREATOR;
  }

  public final class CellSignalStrengthNr extends android.telephony.CellSignalStrength implements android.os.Parcelable {
    method public int describeContents();
    method public int getAsuLevel();
    method public int getCsiRsrp();
    method public int getCsiRsrq();
    method public int getCsiSinr();
    method public int getDbm();
    method public int getLevel();
    method public int getSsRsrp();
    method public int getSsRsrq();
    method public int getSsSinr();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellSignalStrengthNr> CREATOR;
  }

  public final class CellSignalStrengthWcdma extends android.telephony.CellSignalStrength implements android.os.Parcelable {
    method public int describeContents();
    method public int getAsuLevel();
    method public int getDbm();
    method public int getLevel();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CellSignalStrengthWcdma> CREATOR;
  }

  public class IccOpenLogicalChannelResponse implements android.os.Parcelable {
    method public int describeContents();
    method public int getChannel();
    method public byte[] getSelectResponse();
    method public int getStatus();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.IccOpenLogicalChannelResponse> CREATOR;
    field public static final int INVALID_CHANNEL = -1; // 0xffffffff
    field public static final int STATUS_MISSING_RESOURCE = 2; // 0x2
    field public static final int STATUS_NO_ERROR = 1; // 0x1
    field public static final int STATUS_NO_SUCH_ELEMENT = 3; // 0x3
    field public static final int STATUS_UNKNOWN_ERROR = 4; // 0x4
  }

  public class MbmsDownloadSession implements java.lang.AutoCloseable {
    method public void addProgressListener(@NonNull android.telephony.mbms.DownloadRequest, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.DownloadProgressListener);
    method public void addStatusListener(@NonNull android.telephony.mbms.DownloadRequest, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.DownloadStatusListener);
    method public void cancelDownload(@NonNull android.telephony.mbms.DownloadRequest);
    method public void close();
    method public static android.telephony.MbmsDownloadSession create(@NonNull android.content.Context, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.MbmsDownloadSessionCallback);
    method @Nullable public static android.telephony.MbmsDownloadSession create(@NonNull android.content.Context, @NonNull java.util.concurrent.Executor, int, @NonNull android.telephony.mbms.MbmsDownloadSessionCallback);
    method public void download(@NonNull android.telephony.mbms.DownloadRequest);
    method @Nullable public java.io.File getTempFileRootDirectory();
    method @NonNull public java.util.List<android.telephony.mbms.DownloadRequest> listPendingDownloads();
    method public void removeProgressListener(@NonNull android.telephony.mbms.DownloadRequest, @NonNull android.telephony.mbms.DownloadProgressListener);
    method public void removeStatusListener(@NonNull android.telephony.mbms.DownloadRequest, @NonNull android.telephony.mbms.DownloadStatusListener);
    method public void requestDownloadState(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo);
    method public void requestUpdateFileServices(@NonNull java.util.List<java.lang.String>);
    method public void resetDownloadKnowledge(android.telephony.mbms.DownloadRequest);
    method public void setTempFileRootDirectory(@NonNull java.io.File);
    field public static final String DEFAULT_TOP_LEVEL_TEMP_DIRECTORY = "androidMbmsTempFileRoot";
    field public static final String EXTRA_MBMS_COMPLETED_FILE_URI = "android.telephony.extra.MBMS_COMPLETED_FILE_URI";
    field public static final String EXTRA_MBMS_DOWNLOAD_REQUEST = "android.telephony.extra.MBMS_DOWNLOAD_REQUEST";
    field public static final String EXTRA_MBMS_DOWNLOAD_RESULT = "android.telephony.extra.MBMS_DOWNLOAD_RESULT";
    field public static final String EXTRA_MBMS_FILE_INFO = "android.telephony.extra.MBMS_FILE_INFO";
    field public static final int RESULT_CANCELLED = 2; // 0x2
    field public static final int RESULT_DOWNLOAD_FAILURE = 6; // 0x6
    field public static final int RESULT_EXPIRED = 3; // 0x3
    field public static final int RESULT_FILE_ROOT_UNREACHABLE = 8; // 0x8
    field public static final int RESULT_IO_ERROR = 4; // 0x4
    field public static final int RESULT_OUT_OF_STORAGE = 7; // 0x7
    field public static final int RESULT_SERVICE_ID_NOT_DEFINED = 5; // 0x5
    field public static final int RESULT_SUCCESSFUL = 1; // 0x1
    field public static final int STATUS_ACTIVELY_DOWNLOADING = 1; // 0x1
    field public static final int STATUS_PENDING_DOWNLOAD = 2; // 0x2
    field public static final int STATUS_PENDING_DOWNLOAD_WINDOW = 4; // 0x4
    field public static final int STATUS_PENDING_REPAIR = 3; // 0x3
    field public static final int STATUS_UNKNOWN = 0; // 0x0
  }

  public class MbmsGroupCallSession implements java.lang.AutoCloseable {
    method public void close();
    method @Nullable public static android.telephony.MbmsGroupCallSession create(@NonNull android.content.Context, int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.MbmsGroupCallSessionCallback);
    method public static android.telephony.MbmsGroupCallSession create(@NonNull android.content.Context, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.MbmsGroupCallSessionCallback);
    method @Nullable public android.telephony.mbms.GroupCall startGroupCall(long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.GroupCallCallback);
  }

  public class MbmsStreamingSession implements java.lang.AutoCloseable {
    method public void close();
    method @Nullable public static android.telephony.MbmsStreamingSession create(@NonNull android.content.Context, @NonNull java.util.concurrent.Executor, int, @NonNull android.telephony.mbms.MbmsStreamingSessionCallback);
    method public static android.telephony.MbmsStreamingSession create(@NonNull android.content.Context, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.MbmsStreamingSessionCallback);
    method public void requestUpdateStreamingServices(java.util.List<java.lang.String>);
    method @Nullable public android.telephony.mbms.StreamingService startStreaming(android.telephony.mbms.StreamingServiceInfo, @NonNull java.util.concurrent.Executor, android.telephony.mbms.StreamingServiceCallback);
  }

  @Deprecated public class NeighboringCellInfo implements android.os.Parcelable {
    ctor @Deprecated public NeighboringCellInfo();
    ctor @Deprecated public NeighboringCellInfo(int, int);
    ctor @Deprecated public NeighboringCellInfo(int, String, int);
    ctor @Deprecated public NeighboringCellInfo(android.os.Parcel);
    method @Deprecated public int describeContents();
    method @Deprecated public int getCid();
    method @Deprecated public int getLac();
    method @Deprecated public int getNetworkType();
    method @Deprecated public int getPsc();
    method @Deprecated public int getRssi();
    method @Deprecated public void setCid(int);
    method @Deprecated public void setRssi(int);
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public static final android.os.Parcelable.Creator<android.telephony.NeighboringCellInfo> CREATOR;
    field @Deprecated public static final int UNKNOWN_CID = -1; // 0xffffffff
    field @Deprecated public static final int UNKNOWN_RSSI = 99; // 0x63
  }

  public class NetworkScan {
    method public void stopScan();
    field public static final int ERROR_INTERRUPTED = 10002; // 0x2712
    field public static final int ERROR_INVALID_SCAN = 2; // 0x2
    field public static final int ERROR_INVALID_SCANID = 10001; // 0x2711
    field public static final int ERROR_MODEM_ERROR = 1; // 0x1
    field public static final int ERROR_MODEM_UNAVAILABLE = 3; // 0x3
    field public static final int ERROR_RADIO_INTERFACE_ERROR = 10000; // 0x2710
    field public static final int ERROR_UNSUPPORTED = 4; // 0x4
    field public static final int SUCCESS = 0; // 0x0
  }

  public final class NetworkScanRequest implements android.os.Parcelable {
    ctor public NetworkScanRequest(int, android.telephony.RadioAccessSpecifier[], int, int, boolean, int, java.util.ArrayList<java.lang.String>);
    method public int describeContents();
    method public boolean getIncrementalResults();
    method public int getIncrementalResultsPeriodicity();
    method public int getMaxSearchTime();
    method public java.util.ArrayList<java.lang.String> getPlmns();
    method public int getScanType();
    method public int getSearchPeriodicity();
    method public android.telephony.RadioAccessSpecifier[] getSpecifiers();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.NetworkScanRequest> CREATOR;
    field public static final int SCAN_TYPE_ONE_SHOT = 0; // 0x0
    field public static final int SCAN_TYPE_PERIODIC = 1; // 0x1
  }

  public class PhoneNumberFormattingTextWatcher implements android.text.TextWatcher {
    ctor public PhoneNumberFormattingTextWatcher();
    ctor public PhoneNumberFormattingTextWatcher(String);
    method public void afterTextChanged(android.text.Editable);
    method public void beforeTextChanged(CharSequence, int, int, int);
    method public void onTextChanged(CharSequence, int, int, int);
  }

  public class PhoneNumberUtils {
    ctor public PhoneNumberUtils();
    method public static void addTtsSpan(android.text.Spannable, int, int);
    method @Deprecated public static String calledPartyBCDFragmentToString(byte[], int, int);
    method public static String calledPartyBCDFragmentToString(byte[], int, int, int);
    method @Deprecated public static String calledPartyBCDToString(byte[], int, int);
    method public static String calledPartyBCDToString(byte[], int, int, int);
    method public static boolean compare(String, String);
    method public static boolean compare(android.content.Context, String, String);
    method public static String convertKeypadLettersToDigits(String);
    method public static android.text.style.TtsSpan createTtsSpan(String);
    method public static CharSequence createTtsSpannable(CharSequence);
    method public static String extractNetworkPortion(String);
    method public static String extractPostDialPortion(String);
    method @Deprecated public static void formatJapaneseNumber(android.text.Editable);
    method @Deprecated public static void formatNanpNumber(android.text.Editable);
    method @Deprecated public static String formatNumber(String);
    method @Deprecated public static void formatNumber(android.text.Editable, int);
    method public static String formatNumber(String, String);
    method public static String formatNumber(String, String, String);
    method public static String formatNumberToE164(String, String);
    method public static String formatNumberToRFC3966(String, String);
    method @Deprecated public static int getFormatTypeForLocale(java.util.Locale);
    method public static String getNumberFromIntent(android.content.Intent, android.content.Context);
    method public static String getStrippedReversed(String);
    method public static final boolean is12Key(char);
    method public static final boolean isDialable(char);
    method @Deprecated public static boolean isEmergencyNumber(String);
    method public static boolean isGlobalPhoneNumber(String);
    method public static boolean isISODigit(char);
    method @Deprecated public static boolean isLocalEmergencyNumber(android.content.Context, String);
    method public static final boolean isNonSeparator(char);
    method public static final boolean isReallyDialable(char);
    method public static final boolean isStartsPostDial(char);
    method public static boolean isVoiceMailNumber(String);
    method public static boolean isWellFormedSmsAddress(String);
    method public static byte[] networkPortionToCalledPartyBCD(String);
    method public static byte[] networkPortionToCalledPartyBCDWithLength(String);
    method public static String normalizeNumber(String);
    method @Deprecated public static byte[] numberToCalledPartyBCD(String);
    method public static byte[] numberToCalledPartyBCD(String, int);
    method public static String replaceUnicodeDigits(String);
    method public static String stringFromStringAndTOA(String, int);
    method public static String stripSeparators(String);
    method public static String toCallerIDMinMatch(String);
    method public static int toaFromString(String);
    field public static final int BCD_EXTENDED_TYPE_CALLED_PARTY = 2; // 0x2
    field public static final int BCD_EXTENDED_TYPE_EF_ADN = 1; // 0x1
    field public static final int FORMAT_JAPAN = 2; // 0x2
    field public static final int FORMAT_NANP = 1; // 0x1
    field public static final int FORMAT_UNKNOWN = 0; // 0x0
    field public static final char PAUSE = 44; // 0x002c ','
    field public static final int TOA_International = 145; // 0x91
    field public static final int TOA_Unknown = 129; // 0x81
    field public static final char WAIT = 59; // 0x003b ';'
    field public static final char WILD = 78; // 0x004e 'N'
  }

  public class PhoneStateListener {
    ctor public PhoneStateListener();
    ctor public PhoneStateListener(@NonNull java.util.concurrent.Executor);
    method public void onCallForwardingIndicatorChanged(boolean);
    method public void onCallStateChanged(int, String);
    method public void onCellInfoChanged(java.util.List<android.telephony.CellInfo>);
    method public void onCellLocationChanged(android.telephony.CellLocation);
    method public void onDataActivity(int);
    method public void onDataConnectionStateChanged(int);
    method public void onDataConnectionStateChanged(int, int);
    method public void onMessageWaitingIndicatorChanged(boolean);
    method public void onServiceStateChanged(android.telephony.ServiceState);
    method @Deprecated public void onSignalStrengthChanged(int);
    method public void onSignalStrengthsChanged(android.telephony.SignalStrength);
    method public void onUserMobileDataStateChanged(boolean);
    field public static final int LISTEN_CALL_FORWARDING_INDICATOR = 8; // 0x8
    field public static final int LISTEN_CALL_STATE = 32; // 0x20
    field public static final int LISTEN_CELL_INFO = 1024; // 0x400
    field public static final int LISTEN_CELL_LOCATION = 16; // 0x10
    field public static final int LISTEN_DATA_ACTIVITY = 128; // 0x80
    field public static final int LISTEN_DATA_CONNECTION_STATE = 64; // 0x40
    field public static final int LISTEN_EMERGENCY_NUMBER_LIST = 16777216; // 0x1000000
    field public static final int LISTEN_MESSAGE_WAITING_INDICATOR = 4; // 0x4
    field public static final int LISTEN_NONE = 0; // 0x0
    field public static final int LISTEN_SERVICE_STATE = 1; // 0x1
    field @Deprecated public static final int LISTEN_SIGNAL_STRENGTH = 2; // 0x2
    field public static final int LISTEN_SIGNAL_STRENGTHS = 256; // 0x100
    field public static final int LISTEN_USER_MOBILE_DATA_STATE = 524288; // 0x80000
  }

  public final class RadioAccessSpecifier implements android.os.Parcelable {
    ctor public RadioAccessSpecifier(int, int[], int[]);
    method public int describeContents();
    method public int[] getBands();
    method public int[] getChannels();
    method public int getRadioAccessNetwork();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.RadioAccessSpecifier> CREATOR;
  }

  public class ServiceState implements android.os.Parcelable {
    ctor public ServiceState();
    ctor public ServiceState(android.telephony.ServiceState);
    ctor public ServiceState(android.os.Parcel);
    method protected void copyFrom(android.telephony.ServiceState);
    method public int describeContents();
    method public int getCdmaNetworkId();
    method public int getCdmaSystemId();
    method public int[] getCellBandwidths();
    method public int getChannelNumber();
    method public int getDuplexMode();
    method public boolean getIsManualSelection();
    method public String getOperatorAlphaLong();
    method public String getOperatorAlphaShort();
    method public String getOperatorNumeric();
    method public boolean getRoaming();
    method public int getState();
    method public void setIsManualSelection(boolean);
    method public void setOperatorName(String, String, String);
    method public void setRoaming(boolean);
    method public void setState(int);
    method public void setStateOff();
    method public void setStateOutOfService();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.ServiceState> CREATOR;
    field public static final int DUPLEX_MODE_FDD = 1; // 0x1
    field public static final int DUPLEX_MODE_TDD = 2; // 0x2
    field public static final int DUPLEX_MODE_UNKNOWN = 0; // 0x0
    field public static final int STATE_EMERGENCY_ONLY = 2; // 0x2
    field public static final int STATE_IN_SERVICE = 0; // 0x0
    field public static final int STATE_OUT_OF_SERVICE = 1; // 0x1
    field public static final int STATE_POWER_OFF = 3; // 0x3
    field public static final int UNKNOWN_ID = -1; // 0xffffffff
  }

  public class SignalStrength implements android.os.Parcelable {
    method public int describeContents();
    method @Deprecated public int getCdmaDbm();
    method @Deprecated public int getCdmaEcio();
    method @NonNull public java.util.List<android.telephony.CellSignalStrength> getCellSignalStrengths();
    method @Deprecated public int getEvdoDbm();
    method @Deprecated public int getEvdoEcio();
    method @Deprecated public int getEvdoSnr();
    method @Deprecated public int getGsmBitErrorRate();
    method @Deprecated public int getGsmSignalStrength();
    method public int getLevel();
    method @Deprecated public boolean isGsm();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int INVALID = 2147483647; // 0x7fffffff
  }

  public final class SmsManager {
    method public String createAppSpecificSmsToken(android.app.PendingIntent);
    method public java.util.ArrayList<java.lang.String> divideMessage(String);
    method public void downloadMultimediaMessage(android.content.Context, String, android.net.Uri, android.os.Bundle, android.app.PendingIntent);
    method public android.os.Bundle getCarrierConfigValues();
    method public static android.telephony.SmsManager getDefault();
    method public static int getDefaultSmsSubscriptionId();
    method public static android.telephony.SmsManager getSmsManagerForSubscriptionId(int);
    method public int getSubscriptionId();
    method public void injectSmsPdu(byte[], String, android.app.PendingIntent);
    method public void sendDataMessage(String, String, short, byte[], android.app.PendingIntent, android.app.PendingIntent);
    method public void sendMultimediaMessage(android.content.Context, android.net.Uri, String, android.os.Bundle, android.app.PendingIntent);
    method public void sendMultipartTextMessage(String, String, java.util.ArrayList<java.lang.String>, java.util.ArrayList<android.app.PendingIntent>, java.util.ArrayList<android.app.PendingIntent>);
    method public void sendTextMessage(String, String, String, android.app.PendingIntent, android.app.PendingIntent);
    method @RequiresPermission(allOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.SEND_SMS}) public void sendTextMessageWithoutPersisting(String, String, String, android.app.PendingIntent, android.app.PendingIntent);
    field public static final String EXTRA_MMS_DATA = "android.telephony.extra.MMS_DATA";
    field public static final String EXTRA_MMS_HTTP_STATUS = "android.telephony.extra.MMS_HTTP_STATUS";
    field public static final String MMS_CONFIG_ALIAS_ENABLED = "aliasEnabled";
    field public static final String MMS_CONFIG_ALIAS_MAX_CHARS = "aliasMaxChars";
    field public static final String MMS_CONFIG_ALIAS_MIN_CHARS = "aliasMinChars";
    field public static final String MMS_CONFIG_ALLOW_ATTACH_AUDIO = "allowAttachAudio";
    field public static final String MMS_CONFIG_APPEND_TRANSACTION_ID = "enabledTransID";
    field public static final String MMS_CONFIG_EMAIL_GATEWAY_NUMBER = "emailGatewayNumber";
    field public static final String MMS_CONFIG_GROUP_MMS_ENABLED = "enableGroupMms";
    field public static final String MMS_CONFIG_HTTP_PARAMS = "httpParams";
    field public static final String MMS_CONFIG_HTTP_SOCKET_TIMEOUT = "httpSocketTimeout";
    field public static final String MMS_CONFIG_MAX_IMAGE_HEIGHT = "maxImageHeight";
    field public static final String MMS_CONFIG_MAX_IMAGE_WIDTH = "maxImageWidth";
    field public static final String MMS_CONFIG_MAX_MESSAGE_SIZE = "maxMessageSize";
    field public static final String MMS_CONFIG_MESSAGE_TEXT_MAX_SIZE = "maxMessageTextSize";
    field public static final String MMS_CONFIG_MMS_DELIVERY_REPORT_ENABLED = "enableMMSDeliveryReports";
    field public static final String MMS_CONFIG_MMS_ENABLED = "enabledMMS";
    field public static final String MMS_CONFIG_MMS_READ_REPORT_ENABLED = "enableMMSReadReports";
    field public static final String MMS_CONFIG_MULTIPART_SMS_ENABLED = "enableMultipartSMS";
    field public static final String MMS_CONFIG_NAI_SUFFIX = "naiSuffix";
    field public static final String MMS_CONFIG_NOTIFY_WAP_MMSC_ENABLED = "enabledNotifyWapMMSC";
    field public static final String MMS_CONFIG_RECIPIENT_LIMIT = "recipientLimit";
    field public static final String MMS_CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES = "sendMultipartSmsAsSeparateMessages";
    field public static final String MMS_CONFIG_SHOW_CELL_BROADCAST_APP_LINKS = "config_cellBroadcastAppLinks";
    field public static final String MMS_CONFIG_SMS_DELIVERY_REPORT_ENABLED = "enableSMSDeliveryReports";
    field public static final String MMS_CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD = "smsToMmsTextLengthThreshold";
    field public static final String MMS_CONFIG_SMS_TO_MMS_TEXT_THRESHOLD = "smsToMmsTextThreshold";
    field public static final String MMS_CONFIG_SUBJECT_MAX_LENGTH = "maxSubjectLength";
    field public static final String MMS_CONFIG_SUPPORT_HTTP_CHARSET_HEADER = "supportHttpCharsetHeader";
    field public static final String MMS_CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION = "supportMmsContentDisposition";
    field public static final String MMS_CONFIG_UA_PROF_TAG_NAME = "uaProfTagName";
    field public static final String MMS_CONFIG_UA_PROF_URL = "uaProfUrl";
    field public static final String MMS_CONFIG_USER_AGENT = "userAgent";
    field public static final int MMS_ERROR_CONFIGURATION_ERROR = 7; // 0x7
    field public static final int MMS_ERROR_HTTP_FAILURE = 4; // 0x4
    field public static final int MMS_ERROR_INVALID_APN = 2; // 0x2
    field public static final int MMS_ERROR_IO_ERROR = 5; // 0x5
    field public static final int MMS_ERROR_NO_DATA_NETWORK = 8; // 0x8
    field public static final int MMS_ERROR_RETRY = 6; // 0x6
    field public static final int MMS_ERROR_UNABLE_CONNECT_MMS = 3; // 0x3
    field public static final int MMS_ERROR_UNSPECIFIED = 1; // 0x1
    field public static final int RESULT_ERROR_GENERIC_FAILURE = 1; // 0x1
    field public static final int RESULT_ERROR_LIMIT_EXCEEDED = 5; // 0x5
    field public static final int RESULT_ERROR_NO_SERVICE = 4; // 0x4
    field public static final int RESULT_ERROR_NULL_PDU = 3; // 0x3
    field public static final int RESULT_ERROR_RADIO_OFF = 2; // 0x2
    field public static final int RESULT_ERROR_SHORT_CODE_NEVER_ALLOWED = 8; // 0x8
    field public static final int RESULT_ERROR_SHORT_CODE_NOT_ALLOWED = 7; // 0x7
    field public static final int STATUS_ON_ICC_FREE = 0; // 0x0
    field public static final int STATUS_ON_ICC_READ = 1; // 0x1
    field public static final int STATUS_ON_ICC_SENT = 5; // 0x5
    field public static final int STATUS_ON_ICC_UNREAD = 3; // 0x3
    field public static final int STATUS_ON_ICC_UNSENT = 7; // 0x7
  }

  public class SmsMessage {
    method public static int[] calculateLength(CharSequence, boolean);
    method public static int[] calculateLength(String, boolean);
    method @Deprecated public static android.telephony.SmsMessage createFromPdu(byte[]);
    method public static android.telephony.SmsMessage createFromPdu(byte[], String);
    method public String getDisplayMessageBody();
    method public String getDisplayOriginatingAddress();
    method public String getEmailBody();
    method public String getEmailFrom();
    method public int getIndexOnIcc();
    method @Deprecated public int getIndexOnSim();
    method public String getMessageBody();
    method public android.telephony.SmsMessage.MessageClass getMessageClass();
    method @Nullable public String getOriginatingAddress();
    method public byte[] getPdu();
    method public int getProtocolIdentifier();
    method public String getPseudoSubject();
    method public String getServiceCenterAddress();
    method public int getStatus();
    method public int getStatusOnIcc();
    method @Deprecated public int getStatusOnSim();
    method public static android.telephony.SmsMessage.SubmitPdu getSubmitPdu(String, String, String, boolean);
    method public static android.telephony.SmsMessage.SubmitPdu getSubmitPdu(String, String, short, byte[], boolean);
    method public static int getTPLayerLengthForPDU(String);
    method public long getTimestampMillis();
    method public byte[] getUserData();
    method public boolean isCphsMwiMessage();
    method public boolean isEmail();
    method public boolean isMWIClearMessage();
    method public boolean isMWISetMessage();
    method public boolean isMwiDontStore();
    method public boolean isReplace();
    method public boolean isReplyPathPresent();
    method public boolean isStatusReportMessage();
    field public static final int ENCODING_16BIT = 3; // 0x3
    field public static final int ENCODING_7BIT = 1; // 0x1
    field public static final int ENCODING_8BIT = 2; // 0x2
    field public static final int ENCODING_UNKNOWN = 0; // 0x0
    field public static final String FORMAT_3GPP = "3gpp";
    field public static final String FORMAT_3GPP2 = "3gpp2";
    field public static final int MAX_USER_DATA_BYTES = 140; // 0x8c
    field public static final int MAX_USER_DATA_BYTES_WITH_HEADER = 134; // 0x86
    field public static final int MAX_USER_DATA_SEPTETS = 160; // 0xa0
    field public static final int MAX_USER_DATA_SEPTETS_WITH_HEADER = 153; // 0x99
  }

  public enum SmsMessage.MessageClass {
    enum_constant public static final android.telephony.SmsMessage.MessageClass CLASS_0;
    enum_constant public static final android.telephony.SmsMessage.MessageClass CLASS_1;
    enum_constant public static final android.telephony.SmsMessage.MessageClass CLASS_2;
    enum_constant public static final android.telephony.SmsMessage.MessageClass CLASS_3;
    enum_constant public static final android.telephony.SmsMessage.MessageClass UNKNOWN;
  }

  public static class SmsMessage.SubmitPdu {
    field public byte[] encodedMessage;
    field public byte[] encodedScAddress;
  }

  public class SubscriptionInfo implements android.os.Parcelable {
    method public android.graphics.Bitmap createIconBitmap(android.content.Context);
    method public int describeContents();
    method public int getCardId();
    method public int getCarrierId();
    method public CharSequence getCarrierName();
    method public String getCountryIso();
    method public int getDataRoaming();
    method public CharSequence getDisplayName();
    method public String getGroupUuid();
    method public String getIccId();
    method public int getIconTint();
    method @Deprecated public int getMcc();
    method public String getMccString();
    method @Deprecated public int getMnc();
    method public String getMncString();
    method public String getNumber();
    method public int getSimSlotIndex();
    method public int getSubscriptionId();
    method public int getSubscriptionType();
    method public boolean isEmbedded();
    method public boolean isOpportunistic();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.SubscriptionInfo> CREATOR;
  }

  public class SubscriptionManager {
    method public void addOnOpportunisticSubscriptionsChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener);
    method public void addOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
    method public boolean canManageSubscription(android.telephony.SubscriptionInfo);
    method @Deprecated public static android.telephony.SubscriptionManager from(android.content.Context);
    method public java.util.List<android.telephony.SubscriptionInfo> getAccessibleSubscriptionInfoList();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfo(int);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getActiveSubscriptionInfoCount();
    method public int getActiveSubscriptionInfoCountMax();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<android.telephony.SubscriptionInfo> getActiveSubscriptionInfoList();
    method public static int getDefaultDataSubscriptionId();
    method public static int getDefaultSmsSubscriptionId();
    method public static int getDefaultSubscriptionId();
    method public static int getDefaultVoiceSubscriptionId();
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<android.telephony.SubscriptionInfo> getOpportunisticSubscriptions();
    method public static int getSlotIndex(int);
    method @Nullable public int[] getSubscriptionIds(int);
    method @NonNull public java.util.List<android.telephony.SubscriptionPlan> getSubscriptionPlans(int);
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<android.telephony.SubscriptionInfo> getSubscriptionsInGroup(int);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isActiveSubscriptionId(int);
    method public boolean isNetworkRoaming(int);
    method public static boolean isUsableSubscriptionId(int);
    method public static boolean isValidSubscriptionId(int);
    method public void removeOnOpportunisticSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener);
    method public void removeOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean removeSubscriptionsFromGroup(@NonNull int[]);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setMetered(boolean, int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setOpportunistic(boolean, int);
    method @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String setSubscriptionGroup(@NonNull int[]);
    method public void setSubscriptionOverrideCongested(int, boolean, long);
    method public void setSubscriptionOverrideUnmetered(int, boolean, long);
    method public void setSubscriptionPlans(int, @NonNull java.util.List<android.telephony.SubscriptionPlan>);
    method @RequiresPermission("android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS") public void switchToSubscription(int, android.app.PendingIntent);
    field public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED";
    field public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED";
    field public static final String ACTION_MANAGE_SUBSCRIPTION_PLANS = "android.telephony.action.MANAGE_SUBSCRIPTION_PLANS";
    field public static final String ACTION_REFRESH_SUBSCRIPTION_PLANS = "android.telephony.action.REFRESH_SUBSCRIPTION_PLANS";
    field public static final int DATA_ROAMING_DISABLE = 0; // 0x0
    field public static final int DATA_ROAMING_ENABLE = 1; // 0x1
    field public static final int DEFAULT_SUBSCRIPTION_ID = 2147483647; // 0x7fffffff
    field public static final String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
    field public static final int INVALID_SIM_SLOT_INDEX = -1; // 0xffffffff
    field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff
    field public static final int SUBSCRIPTION_TYPE_LOCAL_SIM = 0; // 0x0
    field public static final int SUBSCRIPTION_TYPE_REMOTE_SIM = 1; // 0x1
  }

  public static class SubscriptionManager.OnOpportunisticSubscriptionsChangedListener {
    ctor public SubscriptionManager.OnOpportunisticSubscriptionsChangedListener();
    method public void onOpportunisticSubscriptionsChanged();
  }

  public static class SubscriptionManager.OnSubscriptionsChangedListener {
    ctor public SubscriptionManager.OnSubscriptionsChangedListener();
    method public void onSubscriptionsChanged();
  }

  public final class SubscriptionPlan implements android.os.Parcelable {
    method public java.util.Iterator<android.util.Range<java.time.ZonedDateTime>> cycleIterator();
    method public int describeContents();
    method public int getDataLimitBehavior();
    method public long getDataLimitBytes();
    method public long getDataUsageBytes();
    method public long getDataUsageTime();
    method @Nullable public CharSequence getSummary();
    method @Nullable public CharSequence getTitle();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final long BYTES_UNKNOWN = -1L; // 0xffffffffffffffffL
    field public static final long BYTES_UNLIMITED = 9223372036854775807L; // 0x7fffffffffffffffL
    field public static final android.os.Parcelable.Creator<android.telephony.SubscriptionPlan> CREATOR;
    field public static final int LIMIT_BEHAVIOR_BILLED = 1; // 0x1
    field public static final int LIMIT_BEHAVIOR_DISABLED = 0; // 0x0
    field public static final int LIMIT_BEHAVIOR_THROTTLED = 2; // 0x2
    field public static final int LIMIT_BEHAVIOR_UNKNOWN = -1; // 0xffffffff
    field public static final long TIME_UNKNOWN = -1L; // 0xffffffffffffffffL
  }

  public static class SubscriptionPlan.Builder {
    method public android.telephony.SubscriptionPlan build();
    method public static android.telephony.SubscriptionPlan.Builder createNonrecurring(java.time.ZonedDateTime, java.time.ZonedDateTime);
    method public static android.telephony.SubscriptionPlan.Builder createRecurring(java.time.ZonedDateTime, java.time.Period);
    method public android.telephony.SubscriptionPlan.Builder setDataLimit(long, int);
    method public android.telephony.SubscriptionPlan.Builder setDataUsage(long, long);
    method public android.telephony.SubscriptionPlan.Builder setSummary(@Nullable CharSequence);
    method public android.telephony.SubscriptionPlan.Builder setTitle(@Nullable CharSequence);
  }

  public class TelephonyManager {
    method public boolean canChangeDtmfToneLength();
    method @Nullable public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle);
    method public android.telephony.TelephonyManager createForSubscriptionId(int);
    method @RequiresPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION) public java.util.List<android.telephony.CellInfo> getAllCellInfo();
    method public int getCallState();
    method public int getCardIdForDefaultEuicc();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @WorkerThread public android.os.PersistableBundle getCarrierConfig();
    method public int getCarrierIdFromSimMccMnc();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public android.telephony.CellLocation getCellLocation();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @Nullable public java.util.Map<java.lang.Integer,java.util.List<android.telephony.emergency.EmergencyNumber>> getCurrentEmergencyNumberList();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @Nullable public java.util.Map<java.lang.Integer,java.util.List<android.telephony.emergency.EmergencyNumber>> getCurrentEmergencyNumberList(int);
    method public int getDataActivity();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getDataNetworkType();
    method public int getDataState();
    method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getDeviceId();
    method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getDeviceId(int);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getDeviceSoftwareVersion();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String[] getForbiddenPlmns();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getGroupIdLevel1();
    method public String getIccAuthentication(int, int, String);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getImei();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getImei(int);
    method @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.READ_SMS, android.Manifest.permission.READ_PHONE_NUMBERS}) public String getLine1Number();
    method public String getManufacturerCode();
    method public String getManufacturerCode(int);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getMeid();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getMeid(int);
    method public String getMmsUAProfUrl();
    method public String getMmsUserAgent();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getNai();
    method public String getNetworkCountryIso();
    method public String getNetworkOperator();
    method public String getNetworkOperatorName();
    method public String getNetworkSpecifier();
    method public int getNetworkType();
    method public int getPhoneCount();
    method public int getPhoneType();
    method public int getPreferredOpportunisticDataSubscription();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telephony.ServiceState getServiceState();
    method @Nullable public android.telephony.SignalStrength getSignalStrength();
    method public int getSimCarrierId();
    method @Nullable public CharSequence getSimCarrierIdName();
    method public String getSimCountryIso();
    method public String getSimOperator();
    method public String getSimOperatorName();
    method public int getSimPreciseCarrierId();
    method @Nullable public CharSequence getSimPreciseCarrierIdName();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getSimSerialNumber();
    method public int getSimState();
    method public int getSimState(int);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getSubscriberId();
    method public String getTypeAllocationCode();
    method public String getTypeAllocationCode(int);
    method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public java.util.List<android.telephony.UiccCardInfo> getUiccCardsInfo();
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVisualVoicemailPackageName();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailAlphaTag();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailNumber();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getVoiceNetworkType();
    method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle);
    method public boolean hasCarrierPrivileges();
    method public boolean hasIccCard();
    method public boolean iccCloseLogicalChannel(int);
    method public byte[] iccExchangeSimIO(int, int, int, int, int, String);
    method @Deprecated public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(String);
    method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(String, int);
    method public String iccTransmitApduBasicChannel(int, int, int, int, int, String);
    method public String iccTransmitApduLogicalChannel(int, int, int, int, int, int, String);
    method public boolean isConcurrentVoiceAndDataSupported();
    method public boolean isCurrentEmergencyNumber(@NonNull String);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_NETWORK_STATE, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean isDataEnabled();
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_NETWORK_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isDataRoamingEnabled();
    method public boolean isHearingAidCompatibilitySupported();
    method public boolean isNetworkRoaming();
    method public boolean isSmsCapable();
    method @Deprecated public boolean isTtyModeSupported();
    method public boolean isVoiceCapable();
    method public boolean isVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle);
    method public boolean isWorldPhone();
    method public void listen(android.telephony.PhoneStateListener, int);
    method @RequiresPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION) public void requestCellInfoUpdate(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CellInfoCallback);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.NetworkScan requestNetworkScan(android.telephony.NetworkScanRequest, java.util.concurrent.Executor, android.telephony.TelephonyScanManager.NetworkScanCallback);
    method public void sendDialerSpecialCode(String);
    method public String sendEnvelopeWithStatus(String);
    method @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void sendUssdRequest(String, android.telephony.TelephonyManager.UssdResponseCallback, android.os.Handler);
    method public void sendVisualVoicemailSms(String, int, String, android.app.PendingIntent);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(boolean);
    method public boolean setLine1NumberForDisplay(String, String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setNetworkSelectionModeAutomatic();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setNetworkSelectionModeManual(String, boolean);
    method public boolean setOperatorBrandOverride(String);
    method public boolean setPreferredNetworkTypeToGlobal();
    method public boolean setPreferredOpportunisticDataSubscription(int);
    method public void setVisualVoicemailSmsFilterSettings(android.telephony.VisualVoicemailSmsFilterSettings);
    method public boolean setVoiceMailNumber(String, String);
    method @Deprecated public void setVoicemailRingtoneUri(android.telecom.PhoneAccountHandle, android.net.Uri);
    method @Deprecated public void setVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle, boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void switchMultiSimConfig(int);
    method public boolean updateAvailableNetworks(java.util.List<android.telephony.AvailableNetworkInfo>);
    field public static final String ACTION_CONFIGURE_VOICEMAIL = "android.telephony.action.CONFIGURE_VOICEMAIL";
    field public static final String ACTION_NETWORK_COUNTRY_CHANGED = "android.telephony.action.NETWORK_COUNTRY_CHANGED";
    field @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE";
    field public static final String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE";
    field public static final String ACTION_SECRET_CODE = "android.telephony.action.SECRET_CODE";
    field public static final String ACTION_SHOW_VOICEMAIL_NOTIFICATION = "android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION";
    field public static final String ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED = "android.telephony.action.SUBSCRIPTION_CARRIER_IDENTITY_CHANGED";
    field public static final String ACTION_SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED = "android.telephony.action.SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED";
    field public static final int APPTYPE_CSIM = 4; // 0x4
    field public static final int APPTYPE_ISIM = 5; // 0x5
    field public static final int APPTYPE_RUIM = 3; // 0x3
    field public static final int APPTYPE_SIM = 1; // 0x1
    field public static final int APPTYPE_USIM = 2; // 0x2
    field public static final int AUTHTYPE_EAP_AKA = 129; // 0x81
    field public static final int AUTHTYPE_EAP_SIM = 128; // 0x80
    field public static final int CALL_STATE_IDLE = 0; // 0x0
    field public static final int CALL_STATE_OFFHOOK = 2; // 0x2
    field public static final int CALL_STATE_RINGING = 1; // 0x1
    field public static final int CDMA_ROAMING_MODE_AFFILIATED = 1; // 0x1
    field public static final int CDMA_ROAMING_MODE_ANY = 2; // 0x2
    field public static final int CDMA_ROAMING_MODE_HOME = 0; // 0x0
    field public static final int CDMA_ROAMING_MODE_RADIO_DEFAULT = -1; // 0xffffffff
    field public static final int DATA_ACTIVITY_DORMANT = 4; // 0x4
    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
    field public static final int DATA_CONNECTED = 2; // 0x2
    field public static final int DATA_CONNECTING = 1; // 0x1
    field public static final int DATA_DISCONNECTED = 0; // 0x0
    field public static final int DATA_SUSPENDED = 3; // 0x3
    field public static final int DATA_UNKNOWN = -1; // 0xffffffff
    field public static final String EXTRA_CALL_VOICEMAIL_INTENT = "android.telephony.extra.CALL_VOICEMAIL_INTENT";
    field public static final String EXTRA_CARRIER_ID = "android.telephony.extra.CARRIER_ID";
    field public static final String EXTRA_CARRIER_NAME = "android.telephony.extra.CARRIER_NAME";
    field public static final String EXTRA_HIDE_PUBLIC_SETTINGS = "android.telephony.extra.HIDE_PUBLIC_SETTINGS";
    field public static final String EXTRA_INCOMING_NUMBER = "incoming_number";
    field public static final String EXTRA_IS_REFRESH = "android.telephony.extra.IS_REFRESH";
    field public static final String EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT = "android.telephony.extra.LAUNCH_VOICEMAIL_SETTINGS_INTENT";
    field public static final String EXTRA_NETWORK_COUNTRY = "android.telephony.extra.NETWORK_COUNTRY";
    field public static final String EXTRA_NOTIFICATION_COUNT = "android.telephony.extra.NOTIFICATION_COUNT";
    field public static final String EXTRA_PHONE_ACCOUNT_HANDLE = "android.telephony.extra.PHONE_ACCOUNT_HANDLE";
    field public static final String EXTRA_PRECISE_CARRIER_ID = "android.telephony.extra.PRECISE_CARRIER_ID";
    field public static final String EXTRA_PRECISE_CARRIER_NAME = "android.telephony.extra.PRECISE_CARRIER_NAME";
    field public static final String EXTRA_STATE = "state";
    field public static final String EXTRA_STATE_IDLE;
    field public static final String EXTRA_STATE_OFFHOOK;
    field public static final String EXTRA_STATE_RINGING;
    field public static final String EXTRA_SUBSCRIPTION_ID = "android.telephony.extra.SUBSCRIPTION_ID";
    field public static final String EXTRA_VOICEMAIL_NUMBER = "android.telephony.extra.VOICEMAIL_NUMBER";
    field public static final int INVALID_CARD_ID = -1; // 0xffffffff
    field public static final String METADATA_HIDE_VOICEMAIL_SETTINGS_MENU = "android.telephony.HIDE_VOICEMAIL_SETTINGS_MENU";
    field public static final int NETWORK_TYPE_1xRTT = 7; // 0x7
    field public static final int NETWORK_TYPE_CDMA = 4; // 0x4
    field public static final int NETWORK_TYPE_EDGE = 2; // 0x2
    field public static final int NETWORK_TYPE_EHRPD = 14; // 0xe
    field public static final int NETWORK_TYPE_EVDO_0 = 5; // 0x5
    field public static final int NETWORK_TYPE_EVDO_A = 6; // 0x6
    field public static final int NETWORK_TYPE_EVDO_B = 12; // 0xc
    field public static final int NETWORK_TYPE_GPRS = 1; // 0x1
    field public static final int NETWORK_TYPE_GSM = 16; // 0x10
    field public static final int NETWORK_TYPE_HSDPA = 8; // 0x8
    field public static final int NETWORK_TYPE_HSPA = 10; // 0xa
    field public static final int NETWORK_TYPE_HSPAP = 15; // 0xf
    field public static final int NETWORK_TYPE_HSUPA = 9; // 0x9
    field public static final int NETWORK_TYPE_IDEN = 11; // 0xb
    field public static final int NETWORK_TYPE_IWLAN = 18; // 0x12
    field public static final int NETWORK_TYPE_LTE = 13; // 0xd
    field public static final int NETWORK_TYPE_NR = 20; // 0x14
    field public static final int NETWORK_TYPE_TD_SCDMA = 17; // 0x11
    field public static final int NETWORK_TYPE_UMTS = 3; // 0x3
    field public static final int NETWORK_TYPE_UNKNOWN = 0; // 0x0
    field public static final int PHONE_TYPE_CDMA = 2; // 0x2
    field public static final int PHONE_TYPE_GSM = 1; // 0x1
    field public static final int PHONE_TYPE_NONE = 0; // 0x0
    field public static final int PHONE_TYPE_SIP = 3; // 0x3
    field public static final int SIM_STATE_ABSENT = 1; // 0x1
    field public static final int SIM_STATE_CARD_IO_ERROR = 8; // 0x8
    field public static final int SIM_STATE_CARD_RESTRICTED = 9; // 0x9
    field public static final int SIM_STATE_NETWORK_LOCKED = 4; // 0x4
    field public static final int SIM_STATE_NOT_READY = 6; // 0x6
    field public static final int SIM_STATE_PERM_DISABLED = 7; // 0x7
    field public static final int SIM_STATE_PIN_REQUIRED = 2; // 0x2
    field public static final int SIM_STATE_PUK_REQUIRED = 3; // 0x3
    field public static final int SIM_STATE_READY = 5; // 0x5
    field public static final int SIM_STATE_UNKNOWN = 0; // 0x0
    field public static final int UNKNOWN_CARRIER_ID = -1; // 0xffffffff
    field public static final int USSD_ERROR_SERVICE_UNAVAIL = -2; // 0xfffffffe
    field public static final int USSD_RETURN_FAILURE = -1; // 0xffffffff
    field public static final String VVM_TYPE_CVVM = "vvm_type_cvvm";
    field public static final String VVM_TYPE_OMTP = "vvm_type_omtp";
  }

  public abstract static class TelephonyManager.CellInfoCallback {
    ctor public TelephonyManager.CellInfoCallback();
    method public abstract void onCellInfo(@NonNull java.util.List<android.telephony.CellInfo>);
    method public void onError(int, @Nullable Throwable);
    field public static final int ERROR_MODEM_ERROR = 2; // 0x2
    field public static final int ERROR_TIMEOUT = 1; // 0x1
  }

  public abstract static class TelephonyManager.UssdResponseCallback {
    ctor public TelephonyManager.UssdResponseCallback();
    method public void onReceiveUssdResponse(android.telephony.TelephonyManager, String, CharSequence);
    method public void onReceiveUssdResponseFailed(android.telephony.TelephonyManager, String, int);
  }

  public final class TelephonyScanManager {
    ctor public TelephonyScanManager();
  }

  public abstract static class TelephonyScanManager.NetworkScanCallback {
    ctor public TelephonyScanManager.NetworkScanCallback();
    method public void onComplete();
    method public void onError(int);
    method public void onResults(java.util.List<android.telephony.CellInfo>);
  }

  public final class UiccCardInfo implements android.os.Parcelable {
    ctor public UiccCardInfo(boolean, int, String, String, int);
    method public int describeContents();
    method public int getCardId();
    method public String getEid();
    method public String getIccId();
    method public int getSlotIndex();
    method public boolean isEuicc();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.UiccCardInfo> CREATOR;
  }

  public abstract class VisualVoicemailService extends android.app.Service {
    ctor public VisualVoicemailService();
    method public android.os.IBinder onBind(android.content.Intent);
    method @MainThread public abstract void onCellServiceConnected(android.telephony.VisualVoicemailService.VisualVoicemailTask, android.telecom.PhoneAccountHandle);
    method @MainThread public abstract void onSimRemoved(android.telephony.VisualVoicemailService.VisualVoicemailTask, android.telecom.PhoneAccountHandle);
    method @MainThread public abstract void onSmsReceived(android.telephony.VisualVoicemailService.VisualVoicemailTask, android.telephony.VisualVoicemailSms);
    method @MainThread public abstract void onStopped(android.telephony.VisualVoicemailService.VisualVoicemailTask);
    field public static final String SERVICE_INTERFACE = "android.telephony.VisualVoicemailService";
  }

  public static class VisualVoicemailService.VisualVoicemailTask {
    method public final void finish();
  }

  public final class VisualVoicemailSms implements android.os.Parcelable {
    method public int describeContents();
    method public android.os.Bundle getFields();
    method public String getMessageBody();
    method public android.telecom.PhoneAccountHandle getPhoneAccountHandle();
    method public String getPrefix();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.VisualVoicemailSms> CREATOR;
  }

  public final class VisualVoicemailSmsFilterSettings implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.VisualVoicemailSmsFilterSettings> CREATOR;
    field public static final int DESTINATION_PORT_ANY = -1; // 0xffffffff
    field public static final int DESTINATION_PORT_DATA_SMS = -2; // 0xfffffffe
    field public final String clientPrefix;
    field public final int destinationPort;
    field public final java.util.List<java.lang.String> originatingNumbers;
  }

  public static class VisualVoicemailSmsFilterSettings.Builder {
    ctor public VisualVoicemailSmsFilterSettings.Builder();
    method public android.telephony.VisualVoicemailSmsFilterSettings build();
    method public android.telephony.VisualVoicemailSmsFilterSettings.Builder setClientPrefix(String);
    method public android.telephony.VisualVoicemailSmsFilterSettings.Builder setDestinationPort(int);
    method public android.telephony.VisualVoicemailSmsFilterSettings.Builder setOriginatingNumbers(java.util.List<java.lang.String>);
  }

}

package android.telephony.cdma {

  public class CdmaCellLocation extends android.telephony.CellLocation {
    ctor public CdmaCellLocation();
    ctor public CdmaCellLocation(android.os.Bundle);
    method public static double convertQuartSecToDecDegrees(int);
    method public void fillInNotifierBundle(android.os.Bundle);
    method public int getBaseStationId();
    method public int getBaseStationLatitude();
    method public int getBaseStationLongitude();
    method public int getNetworkId();
    method public int getSystemId();
    method public void setCellLocationData(int, int, int);
    method public void setCellLocationData(int, int, int, int, int);
    method public void setStateInvalid();
  }

}

package android.telephony.data {

  public class ApnSetting implements android.os.Parcelable {
    method public int describeContents();
    method public String getApnName();
    method public int getApnTypeBitmask();
    method public int getAuthType();
    method public int getCarrierId();
    method public String getEntryName();
    method public int getId();
    method @Deprecated public java.net.InetAddress getMmsProxyAddress();
    method public String getMmsProxyAddressAsString();
    method public int getMmsProxyPort();
    method public android.net.Uri getMmsc();
    method public int getMvnoType();
    method public int getNetworkTypeBitmask();
    method public String getOperatorNumeric();
    method public String getPassword();
    method public int getProtocol();
    method @Deprecated public java.net.InetAddress getProxyAddress();
    method public String getProxyAddressAsString();
    method public int getProxyPort();
    method public int getRoamingProtocol();
    method public String getUser();
    method public boolean isEnabled();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final int AUTH_TYPE_CHAP = 2; // 0x2
    field public static final int AUTH_TYPE_NONE = 0; // 0x0
    field public static final int AUTH_TYPE_PAP = 1; // 0x1
    field public static final int AUTH_TYPE_PAP_OR_CHAP = 3; // 0x3
    field public static final android.os.Parcelable.Creator<android.telephony.data.ApnSetting> CREATOR;
    field public static final int MVNO_TYPE_GID = 2; // 0x2
    field public static final int MVNO_TYPE_ICCID = 3; // 0x3
    field public static final int MVNO_TYPE_IMSI = 1; // 0x1
    field public static final int MVNO_TYPE_SPN = 0; // 0x0
    field public static final int PROTOCOL_IP = 0; // 0x0
    field public static final int PROTOCOL_IPV4V6 = 2; // 0x2
    field public static final int PROTOCOL_IPV6 = 1; // 0x1
    field public static final int PROTOCOL_NON_IP = 4; // 0x4
    field public static final int PROTOCOL_PPP = 3; // 0x3
    field public static final int PROTOCOL_UNSTRUCTURED = 5; // 0x5
    field public static final int TYPE_CBS = 128; // 0x80
    field public static final int TYPE_DEFAULT = 17; // 0x11
    field public static final int TYPE_DUN = 8; // 0x8
    field public static final int TYPE_EMERGENCY = 512; // 0x200
    field public static final int TYPE_FOTA = 32; // 0x20
    field public static final int TYPE_HIPRI = 16; // 0x10
    field public static final int TYPE_IA = 256; // 0x100
    field public static final int TYPE_IMS = 64; // 0x40
    field public static final int TYPE_MMS = 2; // 0x2
    field public static final int TYPE_SUPL = 4; // 0x4
  }

  public static class ApnSetting.Builder {
    ctor public ApnSetting.Builder();
    method public android.telephony.data.ApnSetting build();
    method public android.telephony.data.ApnSetting.Builder setApnName(String);
    method public android.telephony.data.ApnSetting.Builder setApnTypeBitmask(int);
    method public android.telephony.data.ApnSetting.Builder setAuthType(int);
    method public android.telephony.data.ApnSetting.Builder setCarrierEnabled(boolean);
    method public android.telephony.data.ApnSetting.Builder setCarrierId(int);
    method public android.telephony.data.ApnSetting.Builder setEntryName(String);
    method @Deprecated public android.telephony.data.ApnSetting.Builder setMmsProxyAddress(java.net.InetAddress);
    method public android.telephony.data.ApnSetting.Builder setMmsProxyAddress(String);
    method public android.telephony.data.ApnSetting.Builder setMmsProxyPort(int);
    method public android.telephony.data.ApnSetting.Builder setMmsc(android.net.Uri);
    method public android.telephony.data.ApnSetting.Builder setMvnoType(int);
    method public android.telephony.data.ApnSetting.Builder setNetworkTypeBitmask(int);
    method public android.telephony.data.ApnSetting.Builder setOperatorNumeric(String);
    method public android.telephony.data.ApnSetting.Builder setPassword(String);
    method public android.telephony.data.ApnSetting.Builder setProtocol(int);
    method @Deprecated public android.telephony.data.ApnSetting.Builder setProxyAddress(java.net.InetAddress);
    method public android.telephony.data.ApnSetting.Builder setProxyAddress(String);
    method public android.telephony.data.ApnSetting.Builder setProxyPort(int);
    method public android.telephony.data.ApnSetting.Builder setRoamingProtocol(int);
    method public android.telephony.data.ApnSetting.Builder setUser(String);
  }

}

package android.telephony.emergency {

  public final class EmergencyNumber implements java.lang.Comparable<android.telephony.emergency.EmergencyNumber> android.os.Parcelable {
    method public int compareTo(@NonNull android.telephony.emergency.EmergencyNumber);
    method public int describeContents();
    method public String getCountryIso();
    method public int getEmergencyCallRouting();
    method public int getEmergencyNumberSourceBitmask();
    method public java.util.List<java.lang.Integer> getEmergencyNumberSources();
    method public java.util.List<java.lang.Integer> getEmergencyServiceCategories();
    method public int getEmergencyServiceCategoryBitmask();
    method @NonNull public java.util.List<java.lang.String> getEmergencyUrns();
    method public String getMnc();
    method public String getNumber();
    method public boolean isFromSources(int);
    method public boolean isInEmergencyServiceCategories(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.emergency.EmergencyNumber> CREATOR;
    field public static final int EMERGENCY_CALL_ROUTING_EMERGENCY = 1; // 0x1
    field public static final int EMERGENCY_CALL_ROUTING_NORMAL = 2; // 0x2
    field public static final int EMERGENCY_CALL_ROUTING_UNKNOWN = 0; // 0x0
    field public static final int EMERGENCY_NUMBER_SOURCE_DATABASE = 16; // 0x10
    field public static final int EMERGENCY_NUMBER_SOURCE_DEFAULT = 8; // 0x8
    field public static final int EMERGENCY_NUMBER_SOURCE_MODEM_CONFIG = 4; // 0x4
    field public static final int EMERGENCY_NUMBER_SOURCE_NETWORK_SIGNALING = 1; // 0x1
    field public static final int EMERGENCY_NUMBER_SOURCE_SIM = 2; // 0x2
    field public static final int EMERGENCY_SERVICE_CATEGORY_AIEC = 64; // 0x40
    field public static final int EMERGENCY_SERVICE_CATEGORY_AMBULANCE = 2; // 0x2
    field public static final int EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE = 4; // 0x4
    field public static final int EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD = 8; // 0x8
    field public static final int EMERGENCY_SERVICE_CATEGORY_MIEC = 32; // 0x20
    field public static final int EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE = 16; // 0x10
    field public static final int EMERGENCY_SERVICE_CATEGORY_POLICE = 1; // 0x1
    field public static final int EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED = 0; // 0x0
  }

}

package android.telephony.euicc {

  public final class DownloadableSubscription implements android.os.Parcelable {
    method public int describeContents();
    method public static android.telephony.euicc.DownloadableSubscription forActivationCode(String);
    method @Nullable public String getConfirmationCode();
    method @Nullable public String getEncodedActivationCode();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.euicc.DownloadableSubscription> CREATOR;
  }

  public final class EuiccInfo implements android.os.Parcelable {
    ctor public EuiccInfo(@Nullable String);
    method public int describeContents();
    method @Nullable public String getOsVersion();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.euicc.EuiccInfo> CREATOR;
  }

  public class EuiccManager {
    method public android.telephony.euicc.EuiccManager createForCardId(int);
    method @RequiresPermission("android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS") public void deleteSubscription(int, android.app.PendingIntent);
    method @RequiresPermission("android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS") public void downloadSubscription(android.telephony.euicc.DownloadableSubscription, boolean, android.app.PendingIntent);
    method @Nullable public String getEid();
    method @Nullable public android.telephony.euicc.EuiccInfo getEuiccInfo();
    method public boolean isEnabled();
    method public void startResolutionActivity(android.app.Activity, int, android.content.Intent, android.app.PendingIntent) throws android.content.IntentSender.SendIntentException;
    method @RequiresPermission("android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS") public void switchToSubscription(int, android.app.PendingIntent);
    method @RequiresPermission("android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS") public void updateSubscriptionNickname(int, String, android.app.PendingIntent);
    field public static final String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS = "android.telephony.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS";
    field public static final String ACTION_NOTIFY_CARRIER_SETUP_INCOMPLETE = "android.telephony.euicc.action.NOTIFY_CARRIER_SETUP_INCOMPLETE";
    field public static final int EMBEDDED_SUBSCRIPTION_RESULT_ERROR = 2; // 0x2
    field public static final int EMBEDDED_SUBSCRIPTION_RESULT_OK = 0; // 0x0
    field public static final int EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR = 1; // 0x1
    field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DETAILED_CODE";
    field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION";
    field public static final String META_DATA_CARRIER_ICON = "android.telephony.euicc.carriericon";
  }

}

package android.telephony.gsm {

  public class GsmCellLocation extends android.telephony.CellLocation {
    ctor public GsmCellLocation();
    ctor public GsmCellLocation(android.os.Bundle);
    method public void fillInNotifierBundle(android.os.Bundle);
    method public int getCid();
    method public int getLac();
    method public int getPsc();
    method public void setLacAndCid(int, int);
    method public void setStateInvalid();
  }

  @Deprecated public final class SmsManager {
    method @Deprecated public java.util.ArrayList<java.lang.String> divideMessage(String);
    method @Deprecated public static android.telephony.gsm.SmsManager getDefault();
    method @Deprecated public void sendDataMessage(String, String, short, byte[], android.app.PendingIntent, android.app.PendingIntent);
    method @Deprecated public void sendMultipartTextMessage(String, String, java.util.ArrayList<java.lang.String>, java.util.ArrayList<android.app.PendingIntent>, java.util.ArrayList<android.app.PendingIntent>);
    method @Deprecated public void sendTextMessage(String, String, String, android.app.PendingIntent, android.app.PendingIntent);
    field @Deprecated public static final int RESULT_ERROR_GENERIC_FAILURE = 1; // 0x1
    field @Deprecated public static final int RESULT_ERROR_NO_SERVICE = 4; // 0x4
    field @Deprecated public static final int RESULT_ERROR_NULL_PDU = 3; // 0x3
    field @Deprecated public static final int RESULT_ERROR_RADIO_OFF = 2; // 0x2
    field @Deprecated public static final int STATUS_ON_SIM_FREE = 0; // 0x0
    field @Deprecated public static final int STATUS_ON_SIM_READ = 1; // 0x1
    field @Deprecated public static final int STATUS_ON_SIM_SENT = 5; // 0x5
    field @Deprecated public static final int STATUS_ON_SIM_UNREAD = 3; // 0x3
    field @Deprecated public static final int STATUS_ON_SIM_UNSENT = 7; // 0x7
  }

  @Deprecated public class SmsMessage {
    ctor @Deprecated public SmsMessage();
    method @Deprecated public static int[] calculateLength(CharSequence, boolean);
    method @Deprecated public static int[] calculateLength(String, boolean);
    method @Deprecated public static android.telephony.gsm.SmsMessage createFromPdu(byte[]);
    method @Deprecated public String getDisplayMessageBody();
    method @Deprecated public String getDisplayOriginatingAddress();
    method @Deprecated public String getEmailBody();
    method @Deprecated public String getEmailFrom();
    method @Deprecated public int getIndexOnSim();
    method @Deprecated public String getMessageBody();
    method @Deprecated public android.telephony.gsm.SmsMessage.MessageClass getMessageClass();
    method @Deprecated public String getOriginatingAddress();
    method @Deprecated public byte[] getPdu();
    method @Deprecated public int getProtocolIdentifier();
    method @Deprecated public String getPseudoSubject();
    method @Deprecated public String getServiceCenterAddress();
    method @Deprecated public int getStatus();
    method @Deprecated public int getStatusOnSim();
    method @Deprecated public static android.telephony.gsm.SmsMessage.SubmitPdu getSubmitPdu(String, String, String, boolean);
    method @Deprecated public static android.telephony.gsm.SmsMessage.SubmitPdu getSubmitPdu(String, String, short, byte[], boolean);
    method @Deprecated public static int getTPLayerLengthForPDU(String);
    method @Deprecated public long getTimestampMillis();
    method @Deprecated public byte[] getUserData();
    method @Deprecated public boolean isCphsMwiMessage();
    method @Deprecated public boolean isEmail();
    method @Deprecated public boolean isMWIClearMessage();
    method @Deprecated public boolean isMWISetMessage();
    method @Deprecated public boolean isMwiDontStore();
    method @Deprecated public boolean isReplace();
    method @Deprecated public boolean isReplyPathPresent();
    method @Deprecated public boolean isStatusReportMessage();
    field @Deprecated public static final int ENCODING_16BIT = 3; // 0x3
    field @Deprecated public static final int ENCODING_7BIT = 1; // 0x1
    field @Deprecated public static final int ENCODING_8BIT = 2; // 0x2
    field @Deprecated public static final int ENCODING_UNKNOWN = 0; // 0x0
    field @Deprecated public static final int MAX_USER_DATA_BYTES = 140; // 0x8c
    field @Deprecated public static final int MAX_USER_DATA_SEPTETS = 160; // 0xa0
    field @Deprecated public static final int MAX_USER_DATA_SEPTETS_WITH_HEADER = 153; // 0x99
  }

  @Deprecated public enum SmsMessage.MessageClass {
    enum_constant @Deprecated public static final android.telephony.gsm.SmsMessage.MessageClass CLASS_0;
    enum_constant @Deprecated public static final android.telephony.gsm.SmsMessage.MessageClass CLASS_1;
    enum_constant @Deprecated public static final android.telephony.gsm.SmsMessage.MessageClass CLASS_2;
    enum_constant @Deprecated public static final android.telephony.gsm.SmsMessage.MessageClass CLASS_3;
    enum_constant @Deprecated public static final android.telephony.gsm.SmsMessage.MessageClass UNKNOWN;
  }

  @Deprecated public static class SmsMessage.SubmitPdu {
    ctor @Deprecated public SmsMessage.SubmitPdu();
    field @Deprecated public byte[] encodedMessage;
    field @Deprecated public byte[] encodedScAddress;
  }

}

package android.telephony.mbms {

  public class DownloadProgressListener {
    ctor public DownloadProgressListener();
    method public void onProgressUpdated(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo, int, int, int, int);
  }

  public final class DownloadRequest implements android.os.Parcelable {
    method public int describeContents();
    method public android.net.Uri getDestinationUri();
    method public String getFileServiceId();
    method public static int getMaxAppIntentSize();
    method public static int getMaxDestinationUriSize();
    method public android.net.Uri getSourceUri();
    method public int getSubscriptionId();
    method public byte[] toByteArray();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.mbms.DownloadRequest> CREATOR;
  }

  public static class DownloadRequest.Builder {
    ctor public DownloadRequest.Builder(@NonNull android.net.Uri, @NonNull android.net.Uri);
    method public android.telephony.mbms.DownloadRequest build();
    method public static android.telephony.mbms.DownloadRequest.Builder fromDownloadRequest(android.telephony.mbms.DownloadRequest);
    method public static android.telephony.mbms.DownloadRequest.Builder fromSerializedRequest(byte[]);
    method public android.telephony.mbms.DownloadRequest.Builder setAppIntent(android.content.Intent);
    method public android.telephony.mbms.DownloadRequest.Builder setServiceInfo(android.telephony.mbms.FileServiceInfo);
    method public android.telephony.mbms.DownloadRequest.Builder setSubscriptionId(int);
  }

  public class DownloadStatusListener {
    ctor public DownloadStatusListener();
    method public void onStatusUpdated(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo, int);
  }

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

  public final class FileServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
    method public int describeContents();
    method public java.util.List<android.telephony.mbms.FileInfo> getFiles();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.mbms.FileServiceInfo> CREATOR;
  }

  public class GroupCall implements java.lang.AutoCloseable {
    method public void close();
    method public long getTmgi();
    method public void updateGroupCall(@NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>);
    field public static final int REASON_BY_USER_REQUEST = 1; // 0x1
    field public static final int REASON_FREQUENCY_CONFLICT = 3; // 0x3
    field public static final int REASON_LEFT_MBMS_BROADCAST_AREA = 6; // 0x6
    field public static final int REASON_NONE = 0; // 0x0
    field public static final int REASON_NOT_CONNECTED_TO_HOMECARRIER_LTE = 5; // 0x5
    field public static final int REASON_OUT_OF_MEMORY = 4; // 0x4
    field public static final int STATE_STALLED = 3; // 0x3
    field public static final int STATE_STARTED = 2; // 0x2
    field public static final int STATE_STOPPED = 1; // 0x1
  }

  public interface GroupCallCallback {
    method public void onBroadcastSignalStrengthUpdated(@IntRange(from=0xffffffff, to=4) int);
    method public void onError(int, @Nullable String);
    method public void onGroupCallStateChanged(int, int);
    field public static final int SIGNAL_STRENGTH_UNAVAILABLE = -1; // 0xffffffff
  }

  public class MbmsDownloadReceiver extends android.content.BroadcastReceiver {
    ctor public MbmsDownloadReceiver();
    method public void onReceive(android.content.Context, android.content.Intent);
  }

  public class MbmsDownloadSessionCallback {
    ctor public MbmsDownloadSessionCallback();
    method public void onError(int, String);
    method public void onFileServicesUpdated(java.util.List<android.telephony.mbms.FileServiceInfo>);
    method public void onMiddlewareReady();
  }

  public class MbmsErrors {
    field public static final int ERROR_MIDDLEWARE_LOST = 3; // 0x3
    field public static final int ERROR_MIDDLEWARE_NOT_BOUND = 2; // 0x2
    field public static final int ERROR_NO_UNIQUE_MIDDLEWARE = 1; // 0x1
    field public static final int SUCCESS = 0; // 0x0
    field public static final int UNKNOWN = -1; // 0xffffffff
  }

  public static class MbmsErrors.DownloadErrors {
    field public static final int ERROR_CANNOT_CHANGE_TEMP_FILE_ROOT = 401; // 0x191
    field public static final int ERROR_UNKNOWN_DOWNLOAD_REQUEST = 402; // 0x192
    field public static final int ERROR_UNKNOWN_FILE_INFO = 403; // 0x193
  }

  public static class MbmsErrors.GeneralErrors {
    field public static final int ERROR_CARRIER_CHANGE_NOT_ALLOWED = 207; // 0xcf
    field public static final int ERROR_IN_E911 = 204; // 0xcc
    field public static final int ERROR_MIDDLEWARE_NOT_YET_READY = 201; // 0xc9
    field public static final int ERROR_MIDDLEWARE_TEMPORARILY_UNAVAILABLE = 203; // 0xcb
    field public static final int ERROR_NOT_CONNECTED_TO_HOME_CARRIER_LTE = 205; // 0xcd
    field public static final int ERROR_OUT_OF_MEMORY = 202; // 0xca
    field public static final int ERROR_UNABLE_TO_READ_SIM = 206; // 0xce
  }

  public static class MbmsErrors.GroupCallErrors {
    field public static final int ERROR_DUPLICATE_START_GROUP_CALL = 502; // 0x1f6
    field public static final int ERROR_UNABLE_TO_START_SERVICE = 501; // 0x1f5
  }

  public static class MbmsErrors.InitializationErrors {
    field public static final int ERROR_APP_PERMISSIONS_NOT_GRANTED = 102; // 0x66
    field public static final int ERROR_DUPLICATE_INITIALIZE = 101; // 0x65
    field public static final int ERROR_UNABLE_TO_INITIALIZE = 103; // 0x67
  }

  public static class MbmsErrors.StreamingErrors {
    field public static final int ERROR_CONCURRENT_SERVICE_LIMIT_REACHED = 301; // 0x12d
    field public static final int ERROR_DUPLICATE_START_STREAM = 303; // 0x12f
    field public static final int ERROR_UNABLE_TO_START_SERVICE = 302; // 0x12e
  }

  public interface MbmsGroupCallSessionCallback {
    method public void onAvailableSaisUpdated(@NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.util.List<java.lang.Integer>>);
    method public void onError(int, @Nullable String);
    method public void onMiddlewareReady();
    method public void onServiceInterfaceAvailable(@NonNull String, int);
  }

  public class MbmsStreamingSessionCallback {
    ctor public MbmsStreamingSessionCallback();
    method public void onError(int, @Nullable String);
    method public void onMiddlewareReady();
    method public void onStreamingServicesUpdated(java.util.List<android.telephony.mbms.StreamingServiceInfo>);
  }

  public class ServiceInfo {
    method public java.util.List<java.util.Locale> getLocales();
    method @NonNull public CharSequence getNameForLocale(@NonNull java.util.Locale);
    method @NonNull public java.util.Set<java.util.Locale> getNamedContentLocales();
    method public String getServiceClassName();
    method public String getServiceId();
    method public java.util.Date getSessionEndTime();
    method public java.util.Date getSessionStartTime();
  }

  public class StreamingService implements java.lang.AutoCloseable {
    method public void close();
    method public android.telephony.mbms.StreamingServiceInfo getInfo();
    method @Nullable public android.net.Uri getPlaybackUri();
    field public static final int BROADCAST_METHOD = 1; // 0x1
    field public static final int REASON_BY_USER_REQUEST = 1; // 0x1
    field public static final int REASON_END_OF_SESSION = 2; // 0x2
    field public static final int REASON_FREQUENCY_CONFLICT = 3; // 0x3
    field public static final int REASON_LEFT_MBMS_BROADCAST_AREA = 6; // 0x6
    field public static final int REASON_NONE = 0; // 0x0
    field public static final int REASON_NOT_CONNECTED_TO_HOMECARRIER_LTE = 5; // 0x5
    field public static final int REASON_OUT_OF_MEMORY = 4; // 0x4
    field public static final int STATE_STALLED = 3; // 0x3
    field public static final int STATE_STARTED = 2; // 0x2
    field public static final int STATE_STOPPED = 1; // 0x1
    field public static final int UNICAST_METHOD = 2; // 0x2
  }

  public class StreamingServiceCallback {
    ctor public StreamingServiceCallback();
    method public void onBroadcastSignalStrengthUpdated(int);
    method public void onError(int, @Nullable String);
    method public void onMediaDescriptionUpdated();
    method public void onStreamMethodUpdated(int);
    method public void onStreamStateUpdated(int, int);
    field public static final int SIGNAL_STRENGTH_UNAVAILABLE = -1; // 0xffffffff
  }

  public final class StreamingServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.mbms.StreamingServiceInfo> CREATOR;
  }

}

package android.text {

  public class AlteredCharSequence implements java.lang.CharSequence android.text.GetChars {
    method public char charAt(int);
    method public void getChars(int, int, char[], int);
    method public int length();
    method public static android.text.AlteredCharSequence make(CharSequence, char[], int, int);
    method public CharSequence subSequence(int, int);
  }

  @Deprecated public class AndroidCharacter {
    ctor @Deprecated public AndroidCharacter();
    method @Deprecated public static void getDirectionalities(char[], byte[], int);
    method @Deprecated public static int getEastAsianWidth(char);
    method @Deprecated public static void getEastAsianWidths(char[], int, int, byte[]);
    method @Deprecated public static char getMirror(char);
    method @Deprecated public static boolean mirror(char[], int, int);
    field @Deprecated public static final int EAST_ASIAN_WIDTH_AMBIGUOUS = 1; // 0x1
    field @Deprecated public static final int EAST_ASIAN_WIDTH_FULL_WIDTH = 3; // 0x3
    field @Deprecated public static final int EAST_ASIAN_WIDTH_HALF_WIDTH = 2; // 0x2
    field @Deprecated public static final int EAST_ASIAN_WIDTH_NARROW = 4; // 0x4
    field @Deprecated public static final int EAST_ASIAN_WIDTH_NEUTRAL = 0; // 0x0
    field @Deprecated public static final int EAST_ASIAN_WIDTH_WIDE = 5; // 0x5
  }

  public class Annotation implements android.text.ParcelableSpan {
    ctor public Annotation(String, String);
    ctor public Annotation(android.os.Parcel);
    method public int describeContents();
    method public String getKey();
    method public int getSpanTypeId();
    method public String getValue();
    method public void writeToParcel(android.os.Parcel, int);
  }

  public class AutoText {
    method public static String get(CharSequence, int, int, android.view.View);
    method public static int getSize(android.view.View);
  }

  public final class BidiFormatter {
    method public static android.text.BidiFormatter getInstance();
    method public static android.text.BidiFormatter getInstance(boolean);
    method public static android.text.BidiFormatter getInstance(java.util.Locale);
    method public boolean getStereoReset();
    method public boolean isRtl(String);
    method public boolean isRtl(CharSequence);
    method public boolean isRtlContext();
    method @Nullable public String unicodeWrap(@Nullable String, android.text.TextDirectionHeuristic, boolean);
    method @Nullable public CharSequence unicodeWrap(@Nullable CharSequence, android.text.TextDirectionHeuristic, boolean);
    method public String unicodeWrap(String, android.text.TextDirectionHeuristic);
    method public CharSequence unicodeWrap(CharSequence, android.text.TextDirectionHeuristic);
    method public String unicodeWrap(String, boolean);
    method public CharSequence unicodeWrap(CharSequence, boolean);
    method public String unicodeWrap(String);
    method public CharSequence unicodeWrap(CharSequence);
  }

  public static final class BidiFormatter.Builder {
    ctor public BidiFormatter.Builder();
    ctor public BidiFormatter.Builder(boolean);
    ctor public BidiFormatter.Builder(java.util.Locale);
    method public android.text.BidiFormatter build();
    method public android.text.BidiFormatter.Builder setTextDirectionHeuristic(android.text.TextDirectionHeuristic);
    method public android.text.BidiFormatter.Builder stereoReset(boolean);
  }

  public class BoringLayout extends android.text.Layout implements android.text.TextUtils.EllipsizeCallback {
    ctor public BoringLayout(CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, android.text.BoringLayout.Metrics, boolean);
    ctor public BoringLayout(CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, android.text.BoringLayout.Metrics, boolean, android.text.TextUtils.TruncateAt, int);
    method public void ellipsized(int, int);
    method public int getBottomPadding();
    method public int getEllipsisCount(int);
    method public int getEllipsisStart(int);
    method public boolean getLineContainsTab(int);
    method public int getLineCount();
    method public int getLineDescent(int);
    method public final android.text.Layout.Directions getLineDirections(int);
    method public int getLineStart(int);
    method public int getLineTop(int);
    method public int getParagraphDirection(int);
    method public int getTopPadding();
    method public static android.text.BoringLayout.Metrics isBoring(CharSequence, android.text.TextPaint);
    method public static android.text.BoringLayout.Metrics isBoring(CharSequence, android.text.TextPaint, android.text.BoringLayout.Metrics);
    method public static android.text.BoringLayout make(CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, android.text.BoringLayout.Metrics, boolean);
    method public static android.text.BoringLayout make(CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, android.text.BoringLayout.Metrics, boolean, android.text.TextUtils.TruncateAt, int);
    method public android.text.BoringLayout replaceOrMake(CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, android.text.BoringLayout.Metrics, boolean);
    method public android.text.BoringLayout replaceOrMake(CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, android.text.BoringLayout.Metrics, boolean, android.text.TextUtils.TruncateAt, int);
  }

  public static class BoringLayout.Metrics extends android.graphics.Paint.FontMetricsInt {
    ctor public BoringLayout.Metrics();
    field public int width;
  }

  @Deprecated public abstract class ClipboardManager {
    ctor @Deprecated public ClipboardManager();
    method @Deprecated public abstract CharSequence getText();
    method @Deprecated public abstract boolean hasText();
    method @Deprecated public abstract void setText(CharSequence);
  }

  public class DynamicLayout extends android.text.Layout {
    ctor @Deprecated public DynamicLayout(@NonNull CharSequence, @NonNull android.text.TextPaint, @IntRange(from=0) int, @NonNull android.text.Layout.Alignment, @FloatRange(from=0.0) float, float, boolean);
    ctor @Deprecated public DynamicLayout(@NonNull CharSequence, @NonNull CharSequence, @NonNull android.text.TextPaint, @IntRange(from=0) int, @NonNull android.text.Layout.Alignment, @FloatRange(from=0.0) float, float, boolean);
    ctor @Deprecated public DynamicLayout(@NonNull CharSequence, @NonNull CharSequence, @NonNull android.text.TextPaint, @IntRange(from=0) int, @NonNull android.text.Layout.Alignment, @FloatRange(from=0.0) float, float, boolean, @Nullable android.text.TextUtils.TruncateAt, @IntRange(from=0) int);
    method public int getBottomPadding();
    method public int getEllipsisCount(int);
    method public int getEllipsisStart(int);
    method public boolean getLineContainsTab(int);
    method public int getLineCount();
    method public int getLineDescent(int);
    method public final android.text.Layout.Directions getLineDirections(int);
    method public int getLineStart(int);
    method public int getLineTop(int);
    method public int getParagraphDirection(int);
    method public int getTopPadding();
  }

  public static final class DynamicLayout.Builder {
    method @NonNull public android.text.DynamicLayout build();
    method @NonNull public static android.text.DynamicLayout.Builder obtain(@NonNull CharSequence, @NonNull android.text.TextPaint, @IntRange(from=0) int);
    method @NonNull public android.text.DynamicLayout.Builder setAlignment(@NonNull android.text.Layout.Alignment);
    method @NonNull public android.text.DynamicLayout.Builder setBreakStrategy(int);
    method @NonNull public android.text.DynamicLayout.Builder setDisplayText(@NonNull CharSequence);
    method public android.text.DynamicLayout.Builder setEllipsize(@Nullable android.text.TextUtils.TruncateAt);
    method @NonNull public android.text.DynamicLayout.Builder setEllipsizedWidth(@IntRange(from=0) int);
    method @NonNull public android.text.DynamicLayout.Builder setHyphenationFrequency(int);
    method @NonNull public android.text.DynamicLayout.Builder setIncludePad(boolean);
    method @NonNull public android.text.DynamicLayout.Builder setJustificationMode(int);
    method @NonNull public android.text.DynamicLayout.Builder setLineSpacing(float, @FloatRange(from=0.0) float);
    method @NonNull public android.text.DynamicLayout.Builder setTextDirection(@NonNull android.text.TextDirectionHeuristic);
    method @NonNull public android.text.DynamicLayout.Builder setUseLineSpacingFromFallbacks(boolean);
  }

  public interface Editable extends java.lang.CharSequence java.lang.Appendable android.text.GetChars android.text.Spannable {
    method public android.text.Editable append(CharSequence);
    method public android.text.Editable append(CharSequence, int, int);
    method public android.text.Editable append(char);
    method public void clear();
    method public void clearSpans();
    method public android.text.Editable delete(int, int);
    method public android.text.InputFilter[] getFilters();
    method public android.text.Editable insert(int, CharSequence, int, int);
    method public android.text.Editable insert(int, CharSequence);
    method public android.text.Editable replace(int, int, CharSequence, int, int);
    method public android.text.Editable replace(int, int, CharSequence);
    method public void setFilters(android.text.InputFilter[]);
  }

  public static class Editable.Factory {
    ctor public Editable.Factory();
    method public static android.text.Editable.Factory getInstance();
    method public android.text.Editable newEditable(CharSequence);
  }

  public interface GetChars extends java.lang.CharSequence {
    method public void getChars(int, int, char[], int);
  }

  public class Html {
    method public static String escapeHtml(CharSequence);
    method @Deprecated public static android.text.Spanned fromHtml(String);
    method public static android.text.Spanned fromHtml(String, int);
    method @Deprecated public static android.text.Spanned fromHtml(String, android.text.Html.ImageGetter, android.text.Html.TagHandler);
    method public static android.text.Spanned fromHtml(String, int, android.text.Html.ImageGetter, android.text.Html.TagHandler);
    method @Deprecated public static String toHtml(android.text.Spanned);
    method public static String toHtml(android.text.Spanned, int);
    field public static final int FROM_HTML_MODE_COMPACT = 63; // 0x3f
    field public static final int FROM_HTML_MODE_LEGACY = 0; // 0x0
    field public static final int FROM_HTML_OPTION_USE_CSS_COLORS = 256; // 0x100
    field public static final int FROM_HTML_SEPARATOR_LINE_BREAK_BLOCKQUOTE = 32; // 0x20
    field public static final int FROM_HTML_SEPARATOR_LINE_BREAK_DIV = 16; // 0x10
    field public static final int FROM_HTML_SEPARATOR_LINE_BREAK_HEADING = 2; // 0x2
    field public static final int FROM_HTML_SEPARATOR_LINE_BREAK_LIST = 8; // 0x8
    field public static final int FROM_HTML_SEPARATOR_LINE_BREAK_LIST_ITEM = 4; // 0x4
    field public static final int FROM_HTML_SEPARATOR_LINE_BREAK_PARAGRAPH = 1; // 0x1
    field public static final int TO_HTML_PARAGRAPH_LINES_CONSECUTIVE = 0; // 0x0
    field public static final int TO_HTML_PARAGRAPH_LINES_INDIVIDUAL = 1; // 0x1
  }

  public static interface Html.ImageGetter {
    method public android.graphics.drawable.Drawable getDrawable(String);
  }

  public static interface Html.TagHandler {
    method public void handleTag(boolean, String, android.text.Editable, org.xml.sax.XMLReader);
  }

  public interface InputFilter {
    method public CharSequence filter(CharSequence, int, int, android.text.Spanned, int, int);
  }

  public static class InputFilter.AllCaps implements android.text.InputFilter {
    ctor public InputFilter.AllCaps();
    ctor public InputFilter.AllCaps(@NonNull java.util.Locale);
    method public CharSequence filter(CharSequence, int, int, android.text.Spanned, int, int);
  }

  public static class InputFilter.LengthFilter implements android.text.InputFilter {
    ctor public InputFilter.LengthFilter(int);
    method public CharSequence filter(CharSequence, int, int, android.text.Spanned, int, int);
    method public int getMax();
  }

  public interface InputType {
    field public static final int TYPE_CLASS_DATETIME = 4; // 0x4
    field public static final int TYPE_CLASS_NUMBER = 2; // 0x2
    field public static final int TYPE_CLASS_PHONE = 3; // 0x3
    field public static final int TYPE_CLASS_TEXT = 1; // 0x1
    field public static final int TYPE_DATETIME_VARIATION_DATE = 16; // 0x10
    field public static final int TYPE_DATETIME_VARIATION_NORMAL = 0; // 0x0
    field public static final int TYPE_DATETIME_VARIATION_TIME = 32; // 0x20
    field public static final int TYPE_MASK_CLASS = 15; // 0xf
    field public static final int TYPE_MASK_FLAGS = 16773120; // 0xfff000
    field public static final int TYPE_MASK_VARIATION = 4080; // 0xff0
    field public static final int TYPE_NULL = 0; // 0x0
    field public static final int TYPE_NUMBER_FLAG_DECIMAL = 8192; // 0x2000
    field public static final int TYPE_NUMBER_FLAG_SIGNED = 4096; // 0x1000
    field public static final int TYPE_NUMBER_VARIATION_NORMAL = 0; // 0x0
    field public static final int TYPE_NUMBER_VARIATION_PASSWORD = 16; // 0x10
    field public static final int TYPE_TEXT_FLAG_AUTO_COMPLETE = 65536; // 0x10000
    field public static final int TYPE_TEXT_FLAG_AUTO_CORRECT = 32768; // 0x8000
    field public static final int TYPE_TEXT_FLAG_CAP_CHARACTERS = 4096; // 0x1000
    field public static final int TYPE_TEXT_FLAG_CAP_SENTENCES = 16384; // 0x4000
    field public static final int TYPE_TEXT_FLAG_CAP_WORDS = 8192; // 0x2000
    field public static final int TYPE_TEXT_FLAG_IME_MULTI_LINE = 262144; // 0x40000
    field public static final int TYPE_TEXT_FLAG_MULTI_LINE = 131072; // 0x20000
    field public static final int TYPE_TEXT_FLAG_NO_SUGGESTIONS = 524288; // 0x80000
    field public static final int TYPE_TEXT_VARIATION_EMAIL_ADDRESS = 32; // 0x20
    field public static final int TYPE_TEXT_VARIATION_EMAIL_SUBJECT = 48; // 0x30
    field public static final int TYPE_TEXT_VARIATION_FILTER = 176; // 0xb0
    field public static final int TYPE_TEXT_VARIATION_LONG_MESSAGE = 80; // 0x50
    field public static final int TYPE_TEXT_VARIATION_NORMAL = 0; // 0x0
    field public static final int TYPE_TEXT_VARIATION_PASSWORD = 128; // 0x80
    field public static final int TYPE_TEXT_VARIATION_PERSON_NAME = 96; // 0x60
    field public static final int TYPE_TEXT_VARIATION_PHONETIC = 192; // 0xc0
    field public static final int TYPE_TEXT_VARIATION_POSTAL_ADDRESS = 112; // 0x70
    field public static final int TYPE_TEXT_VARIATION_SHORT_MESSAGE = 64; // 0x40
    field public static final int TYPE_TEXT_VARIATION_URI = 16; // 0x10
    field public static final int TYPE_TEXT_VARIATION_VISIBLE_PASSWORD = 144; // 0x90
    field public static final int TYPE_TEXT_VARIATION_WEB_EDIT_TEXT = 160; // 0xa0
    field public static final int TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS = 208; // 0xd0
    field public static final int TYPE_TEXT_VARIATION_WEB_PASSWORD = 224; // 0xe0
  }

  public abstract class Layout {
    ctor protected Layout(CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float);
    method public void draw(android.graphics.Canvas);
    method public void draw(android.graphics.Canvas, android.graphics.Path, android.graphics.Paint, int);
    method public final android.text.Layout.Alignment getAlignment();
    method public abstract int getBottomPadding();
    method public void getCursorPath(int, android.graphics.Path, CharSequence);
    method public static float getDesiredWidth(CharSequence, android.text.TextPaint);
    method public static float getDesiredWidth(CharSequence, int, int, android.text.TextPaint);
    method public abstract int getEllipsisCount(int);
    method public abstract int getEllipsisStart(int);
    method public int getEllipsizedWidth();
    method public int getHeight();
    method public final int getLineAscent(int);
    method public final int getLineBaseline(int);
    method public final int getLineBottom(int);
    method public int getLineBounds(int, android.graphics.Rect);
    method public abstract boolean getLineContainsTab(int);
    method public abstract int getLineCount();
    method public abstract int getLineDescent(int);
    method public abstract android.text.Layout.Directions getLineDirections(int);
    method public final int getLineEnd(int);
    method public int getLineForOffset(int);
    method public int getLineForVertical(int);
    method public float getLineLeft(int);
    method public float getLineMax(int);
    method public float getLineRight(int);
    method public abstract int getLineStart(int);
    method public abstract int getLineTop(int);
    method public int getLineVisibleEnd(int);
    method public float getLineWidth(int);
    method public int getOffsetForHorizontal(int, float);
    method public int getOffsetToLeftOf(int);
    method public int getOffsetToRightOf(int);
    method public final android.text.TextPaint getPaint();
    method public final android.text.Layout.Alignment getParagraphAlignment(int);
    method public abstract int getParagraphDirection(int);
    method public final int getParagraphLeft(int);
    method public final int getParagraphRight(int);
    method public float getPrimaryHorizontal(int);
    method public float getSecondaryHorizontal(int);
    method public void getSelectionPath(int, int, android.graphics.Path);
    method public final float getSpacingAdd();
    method public final float getSpacingMultiplier();
    method public final CharSequence getText();
    method public abstract int getTopPadding();
    method public final int getWidth();
    method public final void increaseWidthTo(int);
    method public boolean isRtlCharAt(int);
    method protected final boolean isSpanned();
    field public static final int BREAK_STRATEGY_BALANCED = 2; // 0x2
    field public static final int BREAK_STRATEGY_HIGH_QUALITY = 1; // 0x1
    field public static final int BREAK_STRATEGY_SIMPLE = 0; // 0x0
    field public static final float DEFAULT_LINESPACING_ADDITION = 0.0f;
    field public static final float DEFAULT_LINESPACING_MULTIPLIER = 1.0f;
    field public static final int DIR_LEFT_TO_RIGHT = 1; // 0x1
    field public static final int DIR_RIGHT_TO_LEFT = -1; // 0xffffffff
    field public static final int HYPHENATION_FREQUENCY_FULL = 2; // 0x2
    field public static final int HYPHENATION_FREQUENCY_NONE = 0; // 0x0
    field public static final int HYPHENATION_FREQUENCY_NORMAL = 1; // 0x1
    field public static final int JUSTIFICATION_MODE_INTER_WORD = 1; // 0x1
    field public static final int JUSTIFICATION_MODE_NONE = 0; // 0x0
  }

  public enum Layout.Alignment {
    enum_constant public static final android.text.Layout.Alignment ALIGN_CENTER;
    enum_constant public static final android.text.Layout.Alignment ALIGN_NORMAL;
    enum_constant public static final android.text.Layout.Alignment ALIGN_OPPOSITE;
  }

  public static class Layout.Directions {
  }

  public abstract class LoginFilter implements android.text.InputFilter {
    method public CharSequence filter(CharSequence, int, int, android.text.Spanned, int, int);
    method public abstract boolean isAllowed(char);
    method public void onInvalidCharacter(char);
    method public void onStart();
    method public void onStop();
  }

  public static class LoginFilter.PasswordFilterGMail extends android.text.LoginFilter {
    ctor public LoginFilter.PasswordFilterGMail();
    ctor public LoginFilter.PasswordFilterGMail(boolean);
    method public boolean isAllowed(char);
  }

  public static class LoginFilter.UsernameFilterGMail extends android.text.LoginFilter {
    ctor public LoginFilter.UsernameFilterGMail();
    ctor public LoginFilter.UsernameFilterGMail(boolean);
    method public boolean isAllowed(char);
  }

  public static class LoginFilter.UsernameFilterGeneric extends android.text.LoginFilter {
    ctor public LoginFilter.UsernameFilterGeneric();
    ctor public LoginFilter.UsernameFilterGeneric(boolean);
    method public boolean isAllowed(char);
  }

  public interface NoCopySpan {
  }

  public static class NoCopySpan.Concrete implements android.text.NoCopySpan {
    ctor public NoCopySpan.Concrete();
  }

  public interface ParcelableSpan extends android.os.Parcelable {
    method public int getSpanTypeId();
  }

  public class PrecomputedText implements android.text.Spannable {
    method public char charAt(int);
    method public static android.text.PrecomputedText create(@NonNull CharSequence, @NonNull android.text.PrecomputedText.Params);
    method public void getBounds(@IntRange(from=0) int, @IntRange(from=0) int, @NonNull android.graphics.Rect);
    method @IntRange(from=0) public int getParagraphCount();
    method @IntRange(from=0) public int getParagraphEnd(@IntRange(from=0) int);
    method @IntRange(from=0) public int getParagraphStart(@IntRange(from=0) int);
    method @NonNull public android.text.PrecomputedText.Params getParams();
    method public int getSpanEnd(Object);
    method public int getSpanFlags(Object);
    method public int getSpanStart(Object);
    method public <T> T[] getSpans(int, int, Class<T>);
    method @FloatRange(from=0) public float getWidth(@IntRange(from=0) int, @IntRange(from=0) int);
    method public int length();
    method public int nextSpanTransition(int, int, Class);
    method public void removeSpan(Object);
    method public void setSpan(Object, int, int, int);
    method public CharSequence subSequence(int, int);
  }

  public static final class PrecomputedText.Params {
    method public int getBreakStrategy();
    method public int getHyphenationFrequency();
    method @NonNull public android.text.TextDirectionHeuristic getTextDirection();
    method @NonNull public android.text.TextPaint getTextPaint();
  }

  public static class PrecomputedText.Params.Builder {
    ctor public PrecomputedText.Params.Builder(@NonNull android.text.TextPaint);
    method @NonNull public android.text.PrecomputedText.Params build();
    method public android.text.PrecomputedText.Params.Builder setBreakStrategy(int);
    method public android.text.PrecomputedText.Params.Builder setHyphenationFrequency(int);
    method public android.text.PrecomputedText.Params.Builder setTextDirection(@NonNull android.text.TextDirectionHeuristic);
  }

  public class Selection {
    method public static boolean extendDown(android.text.Spannable, android.text.Layout);
    method public static boolean extendLeft(android.text.Spannable, android.text.Layout);
    method public static boolean extendRight(android.text.Spannable, android.text.Layout);
    method public static final void extendSelection(android.text.Spannable, int);
    method public static boolean extendToLeftEdge(android.text.Spannable, android.text.Layout);
    method public static boolean extendToRightEdge(android.text.Spannable, android.text.Layout);
    method public static boolean extendUp(android.text.Spannable, android.text.Layout);
    method public static final int getSelectionEnd(CharSequence);
    method public static final int getSelectionStart(CharSequence);
    method public static boolean moveDown(android.text.Spannable, android.text.Layout);
    method public static boolean moveLeft(android.text.Spannable, android.text.Layout);
    method public static boolean moveRight(android.text.Spannable, android.text.Layout);
    method public static boolean moveToLeftEdge(android.text.Spannable, android.text.Layout);
    method public static boolean moveToRightEdge(android.text.Spannable, android.text.Layout);
    method public static boolean moveUp(android.text.Spannable, android.text.Layout);
    method public static final void removeSelection(android.text.Spannable);
    method public static final void selectAll(android.text.Spannable);
    method public static void setSelection(android.text.Spannable, int, int);
    method public static final void setSelection(android.text.Spannable, int);
    field public static final Object SELECTION_END;
    field public static final Object SELECTION_START;
  }

  public interface SpanWatcher extends android.text.NoCopySpan {
    method public void onSpanAdded(android.text.Spannable, Object, int, int);
    method public void onSpanChanged(android.text.Spannable, Object, int, int, int, int);
    method public void onSpanRemoved(android.text.Spannable, Object, int, int);
  }

  public interface Spannable extends android.text.Spanned {
    method public void removeSpan(Object);
    method public void setSpan(Object, int, int, int);
  }

  public static class Spannable.Factory {
    ctor public Spannable.Factory();
    method public static android.text.Spannable.Factory getInstance();
    method public android.text.Spannable newSpannable(CharSequence);
  }

  public class SpannableString implements java.lang.CharSequence android.text.GetChars android.text.Spannable {
    ctor public SpannableString(CharSequence);
    method public final char charAt(int);
    method public final void getChars(int, int, char[], int);
    method public int getSpanEnd(Object);
    method public int getSpanFlags(Object);
    method public int getSpanStart(Object);
    method public <T> T[] getSpans(int, int, Class<T>);
    method public final int length();
    method public int nextSpanTransition(int, int, Class);
    method public void removeSpan(Object);
    method public void setSpan(Object, int, int, int);
    method public final CharSequence subSequence(int, int);
    method public final String toString();
    method public static android.text.SpannableString valueOf(CharSequence);
  }

  public class SpannableStringBuilder implements java.lang.Appendable java.lang.CharSequence android.text.Editable android.text.GetChars android.text.Spannable {
    ctor public SpannableStringBuilder();
    ctor public SpannableStringBuilder(CharSequence);
    ctor public SpannableStringBuilder(CharSequence, int, int);
    method public android.text.SpannableStringBuilder append(CharSequence);
    method public android.text.SpannableStringBuilder append(CharSequence, Object, int);
    method public android.text.SpannableStringBuilder append(CharSequence, int, int);
    method public android.text.SpannableStringBuilder append(char);
    method public char charAt(int);
    method public void clear();
    method public void clearSpans();
    method public android.text.SpannableStringBuilder delete(int, int);
    method public void getChars(int, int, char[], int);
    method public android.text.InputFilter[] getFilters();
    method public int getSpanEnd(Object);
    method public int getSpanFlags(Object);
    method public int getSpanStart(Object);
    method public <T> T[] getSpans(int, int, @Nullable Class<T>);
    method @Deprecated public int getTextRunCursor(int, int, int, int, int, android.graphics.Paint);
    method public int getTextWatcherDepth();
    method public android.text.SpannableStringBuilder insert(int, CharSequence, int, int);
    method public android.text.SpannableStringBuilder insert(int, CharSequence);
    method public int length();
    method public int nextSpanTransition(int, int, Class);
    method public void removeSpan(Object);
    method public android.text.SpannableStringBuilder replace(int, int, CharSequence);
    method public android.text.SpannableStringBuilder replace(int, int, CharSequence, int, int);
    method public void setFilters(android.text.InputFilter[]);
    method public void setSpan(Object, int, int, int);
    method public CharSequence subSequence(int, int);
    method public static android.text.SpannableStringBuilder valueOf(CharSequence);
  }

  public interface Spanned extends java.lang.CharSequence {
    method public int getSpanEnd(Object);
    method public int getSpanFlags(Object);
    method public int getSpanStart(Object);
    method public <T> T[] getSpans(int, int, Class<T>);
    method public int nextSpanTransition(int, int, Class);
    field public static final int SPAN_COMPOSING = 256; // 0x100
    field public static final int SPAN_EXCLUSIVE_EXCLUSIVE = 33; // 0x21
    field public static final int SPAN_EXCLUSIVE_INCLUSIVE = 34; // 0x22
    field public static final int SPAN_INCLUSIVE_EXCLUSIVE = 17; // 0x11
    field public static final int SPAN_INCLUSIVE_INCLUSIVE = 18; // 0x12
    field public static final int SPAN_INTERMEDIATE = 512; // 0x200
    field public static final int SPAN_MARK_MARK = 17; // 0x11
    field public static final int SPAN_MARK_POINT = 18; // 0x12
    field public static final int SPAN_PARAGRAPH = 51; // 0x33
    field public static final int SPAN_POINT_MARK = 33; // 0x21
    field public static final int SPAN_POINT_MARK_MASK = 51; // 0x33
    field public static final int SPAN_POINT_POINT = 34; // 0x22
    field public static final int SPAN_PRIORITY = 16711680; // 0xff0000
    field public static final int SPAN_PRIORITY_SHIFT = 16; // 0x10
    field public static final int SPAN_USER = -16777216; // 0xff000000
    field public static final int SPAN_USER_SHIFT = 24; // 0x18
  }

  public final class SpannedString implements java.lang.CharSequence android.text.GetChars android.text.Spanned {
    ctor public SpannedString(CharSequence);
    method public final char charAt(int);
    method public final void getChars(int, int, char[], int);
    method public int getSpanEnd(Object);
    method public int getSpanFlags(Object);
    method public int getSpanStart(Object);
    method public <T> T[] getSpans(int, int, Class<T>);
    method public final int length();
    method public int nextSpanTransition(int, int, Class);
    method public CharSequence subSequence(int, int);
    method public static android.text.SpannedString valueOf(CharSequence);
  }

  public class StaticLayout extends android.text.Layout {
    ctor @Deprecated public StaticLayout(CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, boolean);
    ctor @Deprecated public StaticLayout(CharSequence, int, int, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, boolean);
    ctor @Deprecated public StaticLayout(CharSequence, int, int, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, boolean, android.text.TextUtils.TruncateAt, int);
    method public int getBottomPadding();
    method public int getEllipsisCount(int);
    method public int getEllipsisStart(int);
    method public boolean getLineContainsTab(int);
    method public int getLineCount();
    method public int getLineDescent(int);
    method public final android.text.Layout.Directions getLineDirections(int);
    method public int getLineStart(int);
    method public int getLineTop(int);
    method public int getParagraphDirection(int);
    method public int getTopPadding();
  }

  public static final class StaticLayout.Builder {
    method @NonNull public android.text.StaticLayout build();
    method @NonNull public static android.text.StaticLayout.Builder obtain(@NonNull CharSequence, @IntRange(from=0) int, @IntRange(from=0) int, @NonNull android.text.TextPaint, @IntRange(from=0) int);
    method @NonNull public android.text.StaticLayout.Builder setAlignment(@NonNull android.text.Layout.Alignment);
    method @NonNull public android.text.StaticLayout.Builder setBreakStrategy(int);
    method @NonNull public android.text.StaticLayout.Builder setEllipsize(@Nullable android.text.TextUtils.TruncateAt);
    method @NonNull public android.text.StaticLayout.Builder setEllipsizedWidth(@IntRange(from=0) int);
    method @NonNull public android.text.StaticLayout.Builder setHyphenationFrequency(int);
    method @NonNull public android.text.StaticLayout.Builder setIncludePad(boolean);
    method @NonNull public android.text.StaticLayout.Builder setIndents(@Nullable int[], @Nullable int[]);
    method @NonNull public android.text.StaticLayout.Builder setJustificationMode(int);
    method @NonNull public android.text.StaticLayout.Builder setLineSpacing(float, @FloatRange(from=0.0) float);
    method @NonNull public android.text.StaticLayout.Builder setMaxLines(@IntRange(from=0) int);
    method public android.text.StaticLayout.Builder setText(CharSequence);
    method @NonNull public android.text.StaticLayout.Builder setTextDirection(@NonNull android.text.TextDirectionHeuristic);
    method @NonNull public android.text.StaticLayout.Builder setUseLineSpacingFromFallbacks(boolean);
  }

  public interface TextDirectionHeuristic {
    method public boolean isRtl(char[], int, int);
    method public boolean isRtl(CharSequence, int, int);
  }

  public class TextDirectionHeuristics {
    ctor public TextDirectionHeuristics();
    field public static final android.text.TextDirectionHeuristic ANYRTL_LTR;
    field public static final android.text.TextDirectionHeuristic FIRSTSTRONG_LTR;
    field public static final android.text.TextDirectionHeuristic FIRSTSTRONG_RTL;
    field public static final android.text.TextDirectionHeuristic LOCALE;
    field public static final android.text.TextDirectionHeuristic LTR;
    field public static final android.text.TextDirectionHeuristic RTL;
  }

  public class TextPaint extends android.graphics.Paint {
    ctor public TextPaint();
    ctor public TextPaint(int);
    ctor public TextPaint(android.graphics.Paint);
    method public void set(android.text.TextPaint);
    field public int baselineShift;
    field @ColorInt public int bgColor;
    field public float density;
    field public int[] drawableState;
    field @ColorInt public int linkColor;
  }

  public class TextUtils {
    method @Deprecated public static CharSequence commaEllipsize(CharSequence, android.text.TextPaint, float, String, String);
    method public static CharSequence concat(java.lang.CharSequence...);
    method public static void copySpansFrom(android.text.Spanned, int, int, Class, android.text.Spannable, int);
    method public static void dumpSpans(CharSequence, android.util.Printer, String);
    method public static CharSequence ellipsize(CharSequence, android.text.TextPaint, float, android.text.TextUtils.TruncateAt);
    method public static CharSequence ellipsize(CharSequence, android.text.TextPaint, float, android.text.TextUtils.TruncateAt, boolean, @Nullable android.text.TextUtils.EllipsizeCallback);
    method public static boolean equals(CharSequence, CharSequence);
    method public static CharSequence expandTemplate(CharSequence, java.lang.CharSequence...);
    method public static int getCapsMode(CharSequence, int, int);
    method public static void getChars(CharSequence, int, int, char[], int);
    method public static int getLayoutDirectionFromLocale(java.util.Locale);
    method public static int getOffsetAfter(CharSequence, int);
    method public static int getOffsetBefore(CharSequence, int);
    method @Deprecated public static CharSequence getReverse(CharSequence, int, int);
    method public static int getTrimmedLength(CharSequence);
    method public static String htmlEncode(String);
    method public static int indexOf(CharSequence, char);
    method public static int indexOf(CharSequence, char, int);
    method public static int indexOf(CharSequence, char, int, int);
    method public static int indexOf(CharSequence, CharSequence);
    method public static int indexOf(CharSequence, CharSequence, int);
    method public static int indexOf(CharSequence, CharSequence, int, int);
    method public static boolean isDigitsOnly(CharSequence);
    method public static boolean isEmpty(@Nullable CharSequence);
    method public static boolean isGraphic(CharSequence);
    method @Deprecated public static boolean isGraphic(char);
    method public static String join(@NonNull CharSequence, @NonNull Object[]);
    method public static String join(@NonNull CharSequence, @NonNull Iterable);
    method public static int lastIndexOf(CharSequence, char);
    method public static int lastIndexOf(CharSequence, char, int);
    method public static int lastIndexOf(CharSequence, char, int, int);
    method public static CharSequence listEllipsize(@Nullable android.content.Context, @Nullable java.util.List<java.lang.CharSequence>, @NonNull String, @NonNull android.text.TextPaint, @FloatRange(from=0.0, fromInclusive=false) float, @PluralsRes int);
    method public static boolean regionMatches(CharSequence, int, CharSequence, int, int);
    method public static CharSequence replace(CharSequence, String[], CharSequence[]);
    method public static String[] split(String, String);
    method public static String[] split(String, java.util.regex.Pattern);
    method public static CharSequence stringOrSpannedString(CharSequence);
    method public static String substring(CharSequence, int, int);
    method public static void writeToParcel(CharSequence, android.os.Parcel, int);
    field public static final int CAP_MODE_CHARACTERS = 4096; // 0x1000
    field public static final int CAP_MODE_SENTENCES = 16384; // 0x4000
    field public static final int CAP_MODE_WORDS = 8192; // 0x2000
    field public static final android.os.Parcelable.Creator<java.lang.CharSequence> CHAR_SEQUENCE_CREATOR;
  }

  public static interface TextUtils.EllipsizeCallback {
    method public void ellipsized(int, int);
  }

  public static class TextUtils.SimpleStringSplitter implements java.util.Iterator<java.lang.String> android.text.TextUtils.StringSplitter {
    ctor public TextUtils.SimpleStringSplitter(char);
    method public boolean hasNext();
    method public java.util.Iterator<java.lang.String> iterator();
    method public String next();
    method public void setString(String);
  }

  public static interface TextUtils.StringSplitter extends java.lang.Iterable<java.lang.String> {
    method public void setString(String);
  }

  public enum TextUtils.TruncateAt {
    enum_constant public static final android.text.TextUtils.TruncateAt END;
    enum_constant public static final android.text.TextUtils.TruncateAt MARQUEE;
    enum_constant public static final android.text.TextUtils.TruncateAt MIDDLE;
    enum_constant public static final android.text.TextUtils.TruncateAt START;
  }

  public interface TextWatcher extends android.text.NoCopySpan {
    method public void afterTextChanged(android.text.Editable);
    method public void beforeTextChanged(CharSequence, int, int, int);
    method public void onTextChanged(CharSequence, int, int, int);
  }

}

package android.text.format {

  public class DateFormat {
    ctor public DateFormat();
    method public static CharSequence format(CharSequence, long);
    method public static CharSequence format(CharSequence, java.util.Date);
    method public static CharSequence format(CharSequence, java.util.Calendar);
    method public static String getBestDateTimePattern(java.util.Locale, String);
    method public static java.text.DateFormat getDateFormat(android.content.Context);
    method public static char[] getDateFormatOrder(android.content.Context);
    method public static java.text.DateFormat getLongDateFormat(android.content.Context);
    method public static java.text.DateFormat getMediumDateFormat(android.content.Context);
    method public static java.text.DateFormat getTimeFormat(android.content.Context);
    method public static boolean is24HourFormat(android.content.Context);
  }

  public class DateUtils {
    ctor public DateUtils();
    method public static String formatDateRange(android.content.Context, long, long, int);
    method public static java.util.Formatter formatDateRange(android.content.Context, java.util.Formatter, long, long, int);
    method public static java.util.Formatter formatDateRange(android.content.Context, java.util.Formatter, long, long, int, String);
    method public static String formatDateTime(android.content.Context, long, int);
    method public static String formatElapsedTime(long);
    method public static String formatElapsedTime(StringBuilder, long);
    method public static final CharSequence formatSameDayTime(long, long, int, int);
    method @Deprecated public static String getAMPMString(int);
    method @Deprecated public static String getDayOfWeekString(int, int);
    method @Deprecated public static String getMonthString(int, int);
    method public static CharSequence getRelativeDateTimeString(android.content.Context, long, long, long, int);
    method public static CharSequence getRelativeTimeSpanString(long);
    method public static CharSequence getRelativeTimeSpanString(long, long, long);
    method public static CharSequence getRelativeTimeSpanString(long, long, long, int);
    method public static CharSequence getRelativeTimeSpanString(android.content.Context, long, boolean);
    method public static CharSequence getRelativeTimeSpanString(android.content.Context, long);
    method public static boolean isToday(long);
    field @Deprecated public static final String ABBREV_MONTH_FORMAT = "%b";
    field public static final String ABBREV_WEEKDAY_FORMAT = "%a";
    field public static final long DAY_IN_MILLIS = 86400000L; // 0x5265c00L
    field @Deprecated public static final int FORMAT_12HOUR = 64; // 0x40
    field @Deprecated public static final int FORMAT_24HOUR = 128; // 0x80
    field public static final int FORMAT_ABBREV_ALL = 524288; // 0x80000
    field public static final int FORMAT_ABBREV_MONTH = 65536; // 0x10000
    field public static final int FORMAT_ABBREV_RELATIVE = 262144; // 0x40000
    field public static final int FORMAT_ABBREV_TIME = 16384; // 0x4000
    field public static final int FORMAT_ABBREV_WEEKDAY = 32768; // 0x8000
    field @Deprecated public static final int FORMAT_CAP_AMPM = 256; // 0x100
    field @Deprecated public static final int FORMAT_CAP_MIDNIGHT = 4096; // 0x1000
    field @Deprecated public static final int FORMAT_CAP_NOON = 1024; // 0x400
    field @Deprecated public static final int FORMAT_CAP_NOON_MIDNIGHT = 5120; // 0x1400
    field public static final int FORMAT_NO_MIDNIGHT = 2048; // 0x800
    field public static final int FORMAT_NO_MONTH_DAY = 32; // 0x20
    field public static final int FORMAT_NO_NOON = 512; // 0x200
    field @Deprecated public static final int FORMAT_NO_NOON_MIDNIGHT = 2560; // 0xa00
    field public static final int FORMAT_NO_YEAR = 8; // 0x8
    field public static final int FORMAT_NUMERIC_DATE = 131072; // 0x20000
    field public static final int FORMAT_SHOW_DATE = 16; // 0x10
    field public static final int FORMAT_SHOW_TIME = 1; // 0x1
    field public static final int FORMAT_SHOW_WEEKDAY = 2; // 0x2
    field public static final int FORMAT_SHOW_YEAR = 4; // 0x4
    field @Deprecated public static final int FORMAT_UTC = 8192; // 0x2000
    field public static final long HOUR_IN_MILLIS = 3600000L; // 0x36ee80L
    field @Deprecated public static final String HOUR_MINUTE_24 = "%H:%M";
    field @Deprecated public static final int LENGTH_LONG = 10; // 0xa
    field @Deprecated public static final int LENGTH_MEDIUM = 20; // 0x14
    field @Deprecated public static final int LENGTH_SHORT = 30; // 0x1e
    field @Deprecated public static final int LENGTH_SHORTER = 40; // 0x28
    field @Deprecated public static final int LENGTH_SHORTEST = 50; // 0x32
    field public static final long MINUTE_IN_MILLIS = 60000L; // 0xea60L
    field public static final String MONTH_DAY_FORMAT = "%-d";
    field public static final String MONTH_FORMAT = "%B";
    field public static final String NUMERIC_MONTH_FORMAT = "%m";
    field public static final long SECOND_IN_MILLIS = 1000L; // 0x3e8L
    field public static final String WEEKDAY_FORMAT = "%A";
    field public static final long WEEK_IN_MILLIS = 604800000L; // 0x240c8400L
    field public static final String YEAR_FORMAT = "%Y";
    field public static final String YEAR_FORMAT_TWO_DIGITS = "%g";
    field public static final long YEAR_IN_MILLIS = 31449600000L; // 0x7528ad000L
    field @Deprecated public static final int[] sameMonthTable;
    field @Deprecated public static final int[] sameYearTable;
  }

  public final class Formatter {
    ctor public Formatter();
    method public static String formatFileSize(@Nullable android.content.Context, long);
    method @Deprecated public static String formatIpAddress(int);
    method public static String formatShortFileSize(@Nullable android.content.Context, long);
  }

  @Deprecated public class Time {
    ctor @Deprecated public Time(String);
    ctor @Deprecated public Time();
    ctor @Deprecated public Time(android.text.format.Time);
    method @Deprecated public boolean after(android.text.format.Time);
    method @Deprecated public boolean before(android.text.format.Time);
    method @Deprecated public void clear(String);
    method @Deprecated public static int compare(android.text.format.Time, android.text.format.Time);
    method @Deprecated public String format(String);
    method @Deprecated public String format2445();
    method @Deprecated public String format3339(boolean);
    method @Deprecated public int getActualMaximum(int);
    method @Deprecated public static String getCurrentTimezone();
    method @Deprecated public static int getJulianDay(long, long);
    method @Deprecated public static int getJulianMondayFromWeeksSinceEpoch(int);
    method @Deprecated public int getWeekNumber();
    method @Deprecated public static int getWeeksSinceEpochFromJulianDay(int, int);
    method @Deprecated public static boolean isEpoch(android.text.format.Time);
    method @Deprecated public long normalize(boolean);
    method @Deprecated public boolean parse(String);
    method @Deprecated public boolean parse3339(String);
    method @Deprecated public void set(long);
    method @Deprecated public void set(android.text.format.Time);
    method @Deprecated public void set(int, int, int, int, int, int);
    method @Deprecated public void set(int, int, int);
    method @Deprecated public long setJulianDay(int);
    method @Deprecated public void setToNow();
    method @Deprecated public void switchTimezone(String);
    method @Deprecated public long toMillis(boolean);
    field @Deprecated public static final int EPOCH_JULIAN_DAY = 2440588; // 0x253d8c
    field @Deprecated public static final int FRIDAY = 5; // 0x5
    field @Deprecated public static final int HOUR = 3; // 0x3
    field @Deprecated public static final int MINUTE = 2; // 0x2
    field @Deprecated public static final int MONDAY = 1; // 0x1
    field @Deprecated public static final int MONDAY_BEFORE_JULIAN_EPOCH = 2440585; // 0x253d89
    field @Deprecated public static final int MONTH = 5; // 0x5
    field @Deprecated public static final int MONTH_DAY = 4; // 0x4
    field @Deprecated public static final int SATURDAY = 6; // 0x6
    field @Deprecated public static final int SECOND = 1; // 0x1
    field @Deprecated public static final int SUNDAY = 0; // 0x0
    field @Deprecated public static final int THURSDAY = 4; // 0x4
    field @Deprecated public static final String TIMEZONE_UTC = "UTC";
    field @Deprecated public static final int TUESDAY = 2; // 0x2
    field @Deprecated public static final int WEDNESDAY = 3; // 0x3
    field @Deprecated public static final int WEEK_DAY = 7; // 0x7
    field @Deprecated public static final int WEEK_NUM = 9; // 0x9
    field @Deprecated public static final int YEAR = 6; // 0x6
    field @Deprecated public static final int YEAR_DAY = 8; // 0x8
    field @Deprecated public boolean allDay;
    field @Deprecated public long gmtoff;
    field @Deprecated public int hour;
    field @Deprecated public int isDst;
    field @Deprecated public int minute;
    field @Deprecated public int month;
    field @Deprecated public int monthDay;
    field @Deprecated public int second;
    field @Deprecated public String timezone;
    field @Deprecated public int weekDay;
    field @Deprecated public int year;
    field @Deprecated public int yearDay;
  }

}

package android.text.method {

  public class ArrowKeyMovementMethod extends android.text.method.BaseMovementMethod implements android.text.method.MovementMethod {
    ctor public ArrowKeyMovementMethod();
    method public static android.text.method.MovementMethod getInstance();
  }

  public abstract class BaseKeyListener extends android.text.method.MetaKeyKeyListener implements android.text.method.KeyListener {
    ctor public BaseKeyListener();
    method public boolean backspace(android.view.View, android.text.Editable, int, android.view.KeyEvent);
    method public boolean forwardDelete(android.view.View, android.text.Editable, int, android.view.KeyEvent);
    method public boolean onKeyOther(android.view.View, android.text.Editable, android.view.KeyEvent);
  }

  public class BaseMovementMethod implements android.text.method.MovementMethod {
    ctor public BaseMovementMethod();
    method protected boolean bottom(android.widget.TextView, android.text.Spannable);
    method public boolean canSelectArbitrarily();
    method protected boolean down(android.widget.TextView, android.text.Spannable);
    method protected boolean end(android.widget.TextView, android.text.Spannable);
    method protected int getMovementMetaState(android.text.Spannable, android.view.KeyEvent);
    method protected boolean handleMovementKey(android.widget.TextView, android.text.Spannable, int, int, android.view.KeyEvent);
    method protected boolean home(android.widget.TextView, android.text.Spannable);
    method public void initialize(android.widget.TextView, android.text.Spannable);
    method protected boolean left(android.widget.TextView, android.text.Spannable);
    method protected boolean lineEnd(android.widget.TextView, android.text.Spannable);
    method protected boolean lineStart(android.widget.TextView, android.text.Spannable);
    method public boolean onGenericMotionEvent(android.widget.TextView, android.text.Spannable, android.view.MotionEvent);
    method public boolean onKeyDown(android.widget.TextView, android.text.Spannable, int, android.view.KeyEvent);
    method public boolean onKeyOther(android.widget.TextView, android.text.Spannable, android.view.KeyEvent);
    method public boolean onKeyUp(android.widget.TextView, android.text.Spannable, int, android.view.KeyEvent);
    method public void onTakeFocus(android.widget.TextView, android.text.Spannable, int);
    method public boolean onTouchEvent(android.widget.TextView, android.text.Spannable, android.view.MotionEvent);
    method public boolean onTrackballEvent(android.widget.TextView, android.text.Spannable, android.view.MotionEvent);
    method protected boolean pageDown(android.widget.TextView, android.text.Spannable);
    method protected boolean pageUp(android.widget.TextView, android.text.Spannable);
    method protected boolean right(android.widget.TextView, android.text.Spannable);
    method protected boolean top(android.widget.TextView, android.text.Spannable);
    method protected boolean up(android.widget.TextView, android.text.Spannable);
  }

  public class CharacterPickerDialog extends android.app.Dialog implements android.widget.AdapterView.OnItemClickListener android.view.View.OnClickListener {
    ctor public CharacterPickerDialog(android.content.Context, android.view.View, android.text.Editable, String, boolean);
    method public void onClick(android.view.View);
    method public void onItemClick(android.widget.AdapterView, android.view.View, int, long);
  }

  public class DateKeyListener extends android.text.method.NumberKeyListener {
    ctor @Deprecated public DateKeyListener();
    ctor public DateKeyListener(@Nullable java.util.Locale);
    method @NonNull protected char[] getAcceptedChars();
    method public int getInputType();
    method @Deprecated @NonNull public static android.text.method.DateKeyListener getInstance();
    method @NonNull public static android.text.method.DateKeyListener getInstance(@Nullable java.util.Locale);
    field @Deprecated public static final char[] CHARACTERS;
  }

  public class DateTimeKeyListener extends android.text.method.NumberKeyListener {
    ctor @Deprecated public DateTimeKeyListener();
    ctor public DateTimeKeyListener(@Nullable java.util.Locale);
    method @NonNull protected char[] getAcceptedChars();
    method public int getInputType();
    method @Deprecated @NonNull public static android.text.method.DateTimeKeyListener getInstance();
    method @NonNull public static android.text.method.DateTimeKeyListener getInstance(@Nullable java.util.Locale);
    field @Deprecated public static final char[] CHARACTERS;
  }

  public class DialerKeyListener extends android.text.method.NumberKeyListener {
    ctor public DialerKeyListener();
    method protected char[] getAcceptedChars();
    method public int getInputType();
    method public static android.text.method.DialerKeyListener getInstance();
    field public static final char[] CHARACTERS;
  }

  public class DigitsKeyListener extends android.text.method.NumberKeyListener {
    ctor @Deprecated public DigitsKeyListener();
    ctor @Deprecated public DigitsKeyListener(boolean, boolean);
    ctor public DigitsKeyListener(@Nullable java.util.Locale);
    ctor public DigitsKeyListener(@Nullable java.util.Locale, boolean, boolean);
    method protected char[] getAcceptedChars();
    method public int getInputType();
    method @Deprecated @NonNull public static android.text.method.DigitsKeyListener getInstance();
    method @Deprecated @NonNull public static android.text.method.DigitsKeyListener getInstance(boolean, boolean);
    method @NonNull public static android.text.method.DigitsKeyListener getInstance(@Nullable java.util.Locale);
    method @NonNull public static android.text.method.DigitsKeyListener getInstance(@Nullable java.util.Locale, boolean, boolean);
    method @NonNull public static android.text.method.DigitsKeyListener getInstance(@NonNull String);
  }

  public class HideReturnsTransformationMethod extends android.text.method.ReplacementTransformationMethod {
    ctor public HideReturnsTransformationMethod();
    method public static android.text.method.HideReturnsTransformationMethod getInstance();
    method protected char[] getOriginal();
    method protected char[] getReplacement();
  }

  public interface KeyListener {
    method public void clearMetaKeyState(android.view.View, android.text.Editable, int);
    method public int getInputType();
    method public boolean onKeyDown(android.view.View, android.text.Editable, int, android.view.KeyEvent);
    method public boolean onKeyOther(android.view.View, android.text.Editable, android.view.KeyEvent);
    method public boolean onKeyUp(android.view.View, android.text.Editable, int, android.view.KeyEvent);
  }

  public class LinkMovementMethod extends android.text.method.ScrollingMovementMethod {
    ctor public LinkMovementMethod();
    method public static android.text.method.MovementMethod getInstance();
  }

  public abstract class MetaKeyKeyListener {
    ctor public MetaKeyKeyListener();
    method public static void adjustMetaAfterKeypress(android.text.Spannable);
    method public static long adjustMetaAfterKeypress(long);
    method public void clearMetaKeyState(android.view.View, android.text.Editable, int);
    method public static void clearMetaKeyState(android.text.Editable, int);
    method public long clearMetaKeyState(long, int);
    method public static final int getMetaState(CharSequence);
    method public static final int getMetaState(CharSequence, android.view.KeyEvent);
    method public static final int getMetaState(CharSequence, int);
    method public static final int getMetaState(CharSequence, int, android.view.KeyEvent);
    method public static final int getMetaState(long);
    method public static final int getMetaState(long, int);
    method public static long handleKeyDown(long, int, android.view.KeyEvent);
    method public static long handleKeyUp(long, int, android.view.KeyEvent);
    method public static boolean isMetaTracker(CharSequence, Object);
    method public static boolean isSelectingMetaTracker(CharSequence, Object);
    method public boolean onKeyDown(android.view.View, android.text.Editable, int, android.view.KeyEvent);
    method public boolean onKeyUp(android.view.View, android.text.Editable, int, android.view.KeyEvent);
    method protected static void resetLockedMeta(android.text.Spannable);
    method public static long resetLockedMeta(long);
    method public static void resetMetaState(android.text.Spannable);
    field public static final int META_ALT_LOCKED = 512; // 0x200
    field public static final int META_ALT_ON = 2; // 0x2
    field public static final int META_CAP_LOCKED = 256; // 0x100
    field public static final int META_SHIFT_ON = 1; // 0x1
    field public static final int META_SYM_LOCKED = 1024; // 0x400
    field public static final int META_SYM_ON = 4; // 0x4
  }

  public interface MovementMethod {
    method public boolean canSelectArbitrarily();
    method public void initialize(android.widget.TextView, android.text.Spannable);
    method public boolean onGenericMotionEvent(android.widget.TextView, android.text.Spannable, android.view.MotionEvent);
    method public boolean onKeyDown(android.widget.TextView, android.text.Spannable, int, android.view.KeyEvent);
    method public boolean onKeyOther(android.widget.TextView, android.text.Spannable, android.view.KeyEvent);
    method public boolean onKeyUp(android.widget.TextView, android.text.Spannable, int, android.view.KeyEvent);
    method public void onTakeFocus(android.widget.TextView, android.text.Spannable, int);
    method public boolean onTouchEvent(android.widget.TextView, android.text.Spannable, android.view.MotionEvent);
    method public boolean onTrackballEvent(android.widget.TextView, android.text.Spannable, android.view.MotionEvent);
  }

  public class MultiTapKeyListener extends android.text.method.BaseKeyListener implements android.text.SpanWatcher {
    ctor public MultiTapKeyListener(android.text.method.TextKeyListener.Capitalize, boolean);
    method public int getInputType();
    method public static android.text.method.MultiTapKeyListener getInstance(boolean, android.text.method.TextKeyListener.Capitalize);
    method public void onSpanAdded(android.text.Spannable, Object, int, int);
    method public void onSpanChanged(android.text.Spannable, Object, int, int, int, int);
    method public void onSpanRemoved(android.text.Spannable, Object, int, int);
  }

  public abstract class NumberKeyListener extends android.text.method.BaseKeyListener implements android.text.InputFilter {
    ctor public NumberKeyListener();
    method public CharSequence filter(CharSequence, int, int, android.text.Spanned, int, int);
    method @NonNull protected abstract char[] getAcceptedChars();
    method protected int lookup(android.view.KeyEvent, android.text.Spannable);
    method protected static boolean ok(char[], char);
  }

  public class PasswordTransformationMethod implements android.text.TextWatcher android.text.method.TransformationMethod {
    ctor public PasswordTransformationMethod();
    method public void afterTextChanged(android.text.Editable);
    method public void beforeTextChanged(CharSequence, int, int, int);
    method public static android.text.method.PasswordTransformationMethod getInstance();
    method public CharSequence getTransformation(CharSequence, android.view.View);
    method public void onFocusChanged(android.view.View, CharSequence, boolean, int, android.graphics.Rect);
    method public void onTextChanged(CharSequence, int, int, int);
  }

  public class QwertyKeyListener extends android.text.method.BaseKeyListener {
    ctor public QwertyKeyListener(android.text.method.TextKeyListener.Capitalize, boolean);
    method public int getInputType();
    method public static android.text.method.QwertyKeyListener getInstance(boolean, android.text.method.TextKeyListener.Capitalize);
    method public static android.text.method.QwertyKeyListener getInstanceForFullKeyboard();
    method public static void markAsReplaced(android.text.Spannable, int, int, String);
  }

  public abstract class ReplacementTransformationMethod implements android.text.method.TransformationMethod {
    ctor public ReplacementTransformationMethod();
    method protected abstract char[] getOriginal();
    method protected abstract char[] getReplacement();
    method public CharSequence getTransformation(CharSequence, android.view.View);
    method public void onFocusChanged(android.view.View, CharSequence, boolean, int, android.graphics.Rect);
  }

  public class ScrollingMovementMethod extends android.text.method.BaseMovementMethod implements android.text.method.MovementMethod {
    ctor public ScrollingMovementMethod();
    method public static android.text.method.MovementMethod getInstance();
  }

  public class SingleLineTransformationMethod extends android.text.method.ReplacementTransformationMethod {
    ctor public SingleLineTransformationMethod();
    method public static android.text.method.SingleLineTransformationMethod getInstance();
    method protected char[] getOriginal();
    method protected char[] getReplacement();
  }

  public class TextKeyListener extends android.text.method.BaseKeyListener implements android.text.SpanWatcher {
    ctor public TextKeyListener(android.text.method.TextKeyListener.Capitalize, boolean);
    method public static void clear(android.text.Editable);
    method public int getInputType();
    method public static android.text.method.TextKeyListener getInstance(boolean, android.text.method.TextKeyListener.Capitalize);
    method public static android.text.method.TextKeyListener getInstance();
    method public void onSpanAdded(android.text.Spannable, Object, int, int);
    method public void onSpanChanged(android.text.Spannable, Object, int, int, int, int);
    method public void onSpanRemoved(android.text.Spannable, Object, int, int);
    method public void release();
    method public static boolean shouldCap(android.text.method.TextKeyListener.Capitalize, CharSequence, int);
  }

  public enum TextKeyListener.Capitalize {
    enum_constant public static final android.text.method.TextKeyListener.Capitalize CHARACTERS;
    enum_constant public static final android.text.method.TextKeyListener.Capitalize NONE;
    enum_constant public static final android.text.method.TextKeyListener.Capitalize SENTENCES;
    enum_constant public static final android.text.method.TextKeyListener.Capitalize WORDS;
  }

  public class TimeKeyListener extends android.text.method.NumberKeyListener {
    ctor @Deprecated public TimeKeyListener();
    ctor public TimeKeyListener(@Nullable java.util.Locale);
    method @NonNull protected char[] getAcceptedChars();
    method public int getInputType();
    method @Deprecated @NonNull public static android.text.method.TimeKeyListener getInstance();
    method @NonNull public static android.text.method.TimeKeyListener getInstance(@Nullable java.util.Locale);
    field @Deprecated public static final char[] CHARACTERS;
  }

  public class Touch {
    method public static int getInitialScrollX(android.widget.TextView, android.text.Spannable);
    method public static int getInitialScrollY(android.widget.TextView, android.text.Spannable);
    method public static boolean onTouchEvent(android.widget.TextView, android.text.Spannable, android.view.MotionEvent);
    method public static void scrollTo(android.widget.TextView, android.text.Layout, int, int);
  }

  public interface TransformationMethod {
    method public CharSequence getTransformation(CharSequence, android.view.View);
    method public void onFocusChanged(android.view.View, CharSequence, boolean, int, android.graphics.Rect);
  }

}

package android.text.style {

  public class AbsoluteSizeSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
    ctor public AbsoluteSizeSpan(int);
    ctor public AbsoluteSizeSpan(int, boolean);
    ctor public AbsoluteSizeSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method public boolean getDip();
    method public int getSize();
    method public int getSpanTypeId();
    method public void updateDrawState(@NonNull android.text.TextPaint);
    method public void updateMeasureState(@NonNull android.text.TextPaint);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
  }

  public interface AlignmentSpan extends android.text.style.ParagraphStyle {
    method public android.text.Layout.Alignment getAlignment();
  }

  public static class AlignmentSpan.Standard implements android.text.style.AlignmentSpan android.text.ParcelableSpan {
    ctor public AlignmentSpan.Standard(@NonNull android.text.Layout.Alignment);
    ctor public AlignmentSpan.Standard(@NonNull android.os.Parcel);
    method public int describeContents();
    method public android.text.Layout.Alignment getAlignment();
    method public int getSpanTypeId();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
  }

  public class BackgroundColorSpan extends android.text.style.CharacterStyle implements android.text.ParcelableSpan android.text.style.UpdateAppearance {
    ctor public BackgroundColorSpan(@ColorInt int);
    ctor public BackgroundColorSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method @ColorInt public int getBackgroundColor();
    method public int getSpanTypeId();
    method public void updateDrawState(@NonNull android.text.TextPaint);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
  }

  public class BulletSpan implements android.text.style.LeadingMarginSpan android.text.ParcelableSpan {
    ctor public BulletSpan();
    ctor public BulletSpan(int);
    ctor public BulletSpan(int, @ColorInt int);
    ctor public BulletSpan(int, @ColorInt int, @IntRange(from=0) int);
    ctor public BulletSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method public void drawLeadingMargin(@NonNull android.graphics.Canvas, @NonNull android.graphics.Paint, int, int, int, int, int, @NonNull CharSequence, int, int, boolean, @Nullable android.text.Layout);
    method public int getBulletRadius();
    method public int getColor();
    method public int getGapWidth();
    method public int getLeadingMargin(boolean);
    method public int getSpanTypeId();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final int STANDARD_GAP_WIDTH = 2; // 0x2
  }

  public abstract class CharacterStyle {
    ctor public CharacterStyle();
    method public android.text.style.CharacterStyle getUnderlying();
    method public abstract void updateDrawState(android.text.TextPaint);
    method public static android.text.style.CharacterStyle wrap(android.text.style.CharacterStyle);
  }

  public abstract class ClickableSpan extends android.text.style.CharacterStyle implements android.text.style.UpdateAppearance {
    ctor public ClickableSpan();
    method public abstract void onClick(@NonNull android.view.View);
    method public void updateDrawState(@NonNull android.text.TextPaint);
  }

  public class DrawableMarginSpan implements android.text.style.LeadingMarginSpan android.text.style.LineHeightSpan {
    ctor public DrawableMarginSpan(@NonNull android.graphics.drawable.Drawable);
    ctor public DrawableMarginSpan(@NonNull android.graphics.drawable.Drawable, int);
    method public void chooseHeight(@NonNull CharSequence, int, int, int, int, @NonNull android.graphics.Paint.FontMetricsInt);
    method public void drawLeadingMargin(@NonNull android.graphics.Canvas, @NonNull android.graphics.Paint, int, int, int, int, int, @NonNull CharSequence, int, int, boolean, @NonNull android.text.Layout);
    method public int getLeadingMargin(boolean);
  }

  public abstract class DynamicDrawableSpan extends android.text.style.ReplacementSpan {
    ctor public DynamicDrawableSpan();
    ctor protected DynamicDrawableSpan(int);
    method public void draw(@NonNull android.graphics.Canvas, CharSequence, @IntRange(from=0) int, @IntRange(from=0) int, float, int, int, int, @NonNull android.graphics.Paint);
    method public abstract android.graphics.drawable.Drawable getDrawable();
    method public int getSize(@NonNull android.graphics.Paint, CharSequence, @IntRange(from=0) int, @IntRange(from=0) int, @Nullable android.graphics.Paint.FontMetricsInt);
    method public int getVerticalAlignment();
    field public static final int ALIGN_BASELINE = 1; // 0x1
    field public static final int ALIGN_BOTTOM = 0; // 0x0
    field protected final int mVerticalAlignment;
  }

  public class EasyEditSpan implements android.text.ParcelableSpan {
    ctor public EasyEditSpan();
    ctor public EasyEditSpan(android.app.PendingIntent);
    ctor public EasyEditSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method public int getSpanTypeId();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final String EXTRA_TEXT_CHANGED_TYPE = "android.text.style.EXTRA_TEXT_CHANGED_TYPE";
    field public static final int TEXT_DELETED = 1; // 0x1
    field public static final int TEXT_MODIFIED = 2; // 0x2
  }

  public class ForegroundColorSpan extends android.text.style.CharacterStyle implements android.text.ParcelableSpan android.text.style.UpdateAppearance {
    ctor public ForegroundColorSpan(@ColorInt int);
    ctor public ForegroundColorSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method @ColorInt public int getForegroundColor();
    method public int getSpanTypeId();
    method public void updateDrawState(@NonNull android.text.TextPaint);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
  }

  public class IconMarginSpan implements android.text.style.LeadingMarginSpan android.text.style.LineHeightSpan {
    ctor public IconMarginSpan(@NonNull android.graphics.Bitmap);
    ctor public IconMarginSpan(@NonNull android.graphics.Bitmap, @IntRange(from=0) int);
    method public void chooseHeight(CharSequence, int, int, int, int, android.graphics.Paint.FontMetricsInt);
    method public void drawLeadingMargin(android.graphics.Canvas, android.graphics.Paint, int, int, int, int, int, CharSequence, int, int, boolean, android.text.Layout);
    method public int getLeadingMargin(boolean);
  }

  public class ImageSpan extends android.text.style.DynamicDrawableSpan {
    ctor @Deprecated public ImageSpan(@NonNull android.graphics.Bitmap);
    ctor @Deprecated public ImageSpan(@NonNull android.graphics.Bitmap, int);
    ctor public ImageSpan(@NonNull android.content.Context, @NonNull android.graphics.Bitmap);
    ctor public ImageSpan(@NonNull android.content.Context, @NonNull android.graphics.Bitmap, int);
    ctor public ImageSpan(@NonNull android.graphics.drawable.Drawable);
    ctor public ImageSpan(@NonNull android.graphics.drawable.Drawable, int);
    ctor public ImageSpan(@NonNull android.graphics.drawable.Drawable, @NonNull String);
    ctor public ImageSpan(@NonNull android.graphics.drawable.Drawable, @NonNull String, int);
    ctor public ImageSpan(@NonNull android.content.Context, @NonNull android.net.Uri);
    ctor public ImageSpan(@NonNull android.content.Context, @NonNull android.net.Uri, int);
    ctor public ImageSpan(@NonNull android.content.Context, @DrawableRes int);
    ctor public ImageSpan(@NonNull android.content.Context, @DrawableRes int, int);
    method public android.graphics.drawable.Drawable getDrawable();
    method @Nullable public String getSource();
  }

  public interface LeadingMarginSpan extends android.text.style.ParagraphStyle {
    method public void drawLeadingMargin(android.graphics.Canvas, android.graphics.Paint, int, int, int, int, int, CharSequence, int, int, boolean, android.text.Layout);
    method public int getLeadingMargin(boolean);
  }

  public static interface LeadingMarginSpan.LeadingMarginSpan2 extends android.text.style.LeadingMarginSpan android.text.style.WrapTogetherSpan {
    method public int getLeadingMarginLineCount();
  }

  public static class LeadingMarginSpan.Standard implements android.text.style.LeadingMarginSpan android.text.ParcelableSpan {
    ctor public LeadingMarginSpan.Standard(int, int);
    ctor public LeadingMarginSpan.Standard(int);
    ctor public LeadingMarginSpan.Standard(android.os.Parcel);
    method public int describeContents();
    method public void drawLeadingMargin(android.graphics.Canvas, android.graphics.Paint, int, int, int, int, int, CharSequence, int, int, boolean, android.text.Layout);
    method public int getLeadingMargin(boolean);
    method public int getSpanTypeId();
    method public void writeToParcel(android.os.Parcel, int);
  }

  public interface LineBackgroundSpan extends android.text.style.ParagraphStyle {
    method public void drawBackground(android.graphics.Canvas, android.graphics.Paint, int, int, int, int, int, CharSequence, int, int, int);
  }

  public interface LineHeightSpan extends android.text.style.ParagraphStyle android.text.style.WrapTogetherSpan {
    method public void chooseHeight(CharSequence, int, int, int, int, android.graphics.Paint.FontMetricsInt);
  }

  public static interface LineHeightSpan.WithDensity extends android.text.style.LineHeightSpan {
    method public void chooseHeight(CharSequence, int, int, int, int, android.graphics.Paint.FontMetricsInt, android.text.TextPaint);
  }

  public class LocaleSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
    ctor public LocaleSpan(@Nullable java.util.Locale);
    ctor public LocaleSpan(@NonNull android.os.LocaleList);
    ctor public LocaleSpan(android.os.Parcel);
    method public int describeContents();
    method @Nullable public java.util.Locale getLocale();
    method @NonNull public android.os.LocaleList getLocales();
    method public int getSpanTypeId();
    method public void updateDrawState(android.text.TextPaint);
    method public void updateMeasureState(android.text.TextPaint);
    method public void writeToParcel(android.os.Parcel, int);
  }

  public class MaskFilterSpan extends android.text.style.CharacterStyle implements android.text.style.UpdateAppearance {
    ctor public MaskFilterSpan(android.graphics.MaskFilter);
    method public android.graphics.MaskFilter getMaskFilter();
    method public void updateDrawState(android.text.TextPaint);
  }

  public abstract class MetricAffectingSpan extends android.text.style.CharacterStyle implements android.text.style.UpdateLayout {
    ctor public MetricAffectingSpan();
    method public android.text.style.MetricAffectingSpan getUnderlying();
    method public abstract void updateMeasureState(@NonNull android.text.TextPaint);
  }

  public interface ParagraphStyle {
  }

  public class QuoteSpan implements android.text.style.LeadingMarginSpan android.text.ParcelableSpan {
    ctor public QuoteSpan();
    ctor public QuoteSpan(@ColorInt int);
    ctor public QuoteSpan(@ColorInt int, @IntRange(from=0) int, @IntRange(from=0) int);
    ctor public QuoteSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method public void drawLeadingMargin(@NonNull android.graphics.Canvas, @NonNull android.graphics.Paint, int, int, int, int, int, @NonNull CharSequence, int, int, boolean, @NonNull android.text.Layout);
    method @ColorInt public int getColor();
    method public int getGapWidth();
    method public int getLeadingMargin(boolean);
    method public int getSpanTypeId();
    method public int getStripeWidth();
    method public void writeToParcel(android.os.Parcel, int);
    field @ColorInt public static final int STANDARD_COLOR = -16776961; // 0xff0000ff
    field public static final int STANDARD_GAP_WIDTH_PX = 2; // 0x2
    field public static final int STANDARD_STRIPE_WIDTH_PX = 2; // 0x2
  }

  public class RelativeSizeSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
    ctor public RelativeSizeSpan(@FloatRange(from=0) float);
    ctor public RelativeSizeSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method public float getSizeChange();
    method public int getSpanTypeId();
    method public void updateDrawState(@NonNull android.text.TextPaint);
    method public void updateMeasureState(@NonNull android.text.TextPaint);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
  }

  public abstract class ReplacementSpan extends android.text.style.MetricAffectingSpan {
    ctor public ReplacementSpan();
    method public abstract void draw(@NonNull android.graphics.Canvas, CharSequence, @IntRange(from=0) int, @IntRange(from=0) int, float, int, int, int, @NonNull android.graphics.Paint);
    method public abstract int getSize(@NonNull android.graphics.Paint, CharSequence, @IntRange(from=0) int, @IntRange(from=0) int, @Nullable android.graphics.Paint.FontMetricsInt);
    method public void updateDrawState(android.text.TextPaint);
    method public void updateMeasureState(android.text.TextPaint);
  }

  public class ScaleXSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
    ctor public ScaleXSpan(@FloatRange(from=0) float);
    ctor public ScaleXSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method public float getScaleX();
    method public int getSpanTypeId();
    method public void updateDrawState(android.text.TextPaint);
    method public void updateMeasureState(android.text.TextPaint);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
  }

  public class StrikethroughSpan extends android.text.style.CharacterStyle implements android.text.ParcelableSpan android.text.style.UpdateAppearance {
    ctor public StrikethroughSpan();
    ctor public StrikethroughSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method public int getSpanTypeId();
    method public void updateDrawState(@NonNull android.text.TextPaint);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
  }

  public class StyleSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
    ctor public StyleSpan(int);
    ctor public StyleSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method public int getSpanTypeId();
    method public int getStyle();
    method public void updateDrawState(android.text.TextPaint);
    method public void updateMeasureState(android.text.TextPaint);
    method public void writeToParcel(android.os.Parcel, int);
  }

  public class SubscriptSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
    ctor public SubscriptSpan();
    ctor public SubscriptSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method public int getSpanTypeId();
    method public void updateDrawState(@NonNull android.text.TextPaint);
    method public void updateMeasureState(@NonNull android.text.TextPaint);
    method public void writeToParcel(android.os.Parcel, int);
  }

  public class SuggestionSpan extends android.text.style.CharacterStyle implements android.text.ParcelableSpan {
    ctor public SuggestionSpan(android.content.Context, String[], int);
    ctor public SuggestionSpan(java.util.Locale, String[], int);
    ctor public SuggestionSpan(android.content.Context, java.util.Locale, String[], int, Class<?>);
    ctor public SuggestionSpan(android.os.Parcel);
    method public int describeContents();
    method public int getFlags();
    method @Deprecated @NonNull public String getLocale();
    method @Nullable public java.util.Locale getLocaleObject();
    method public int getSpanTypeId();
    method public String[] getSuggestions();
    method public void setFlags(int);
    method public void updateDrawState(android.text.TextPaint);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final String ACTION_SUGGESTION_PICKED = "android.text.style.SUGGESTION_PICKED";
    field public static final android.os.Parcelable.Creator<android.text.style.SuggestionSpan> CREATOR;
    field public static final int FLAG_AUTO_CORRECTION = 4; // 0x4
    field public static final int FLAG_EASY_CORRECT = 1; // 0x1
    field public static final int FLAG_MISSPELLED = 2; // 0x2
    field public static final int SUGGESTIONS_MAX_SIZE = 5; // 0x5
    field public static final String SUGGESTION_SPAN_PICKED_AFTER = "after";
    field public static final String SUGGESTION_SPAN_PICKED_BEFORE = "before";
    field public static final String SUGGESTION_SPAN_PICKED_HASHCODE = "hashcode";
  }

  public class SuperscriptSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
    ctor public SuperscriptSpan();
    ctor public SuperscriptSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method public int getSpanTypeId();
    method public void updateDrawState(@NonNull android.text.TextPaint);
    method public void updateMeasureState(@NonNull android.text.TextPaint);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
  }

  public interface TabStopSpan extends android.text.style.ParagraphStyle {
    method public int getTabStop();
  }

  public static class TabStopSpan.Standard implements android.text.style.TabStopSpan {
    ctor public TabStopSpan.Standard(@IntRange(from=0) int);
    method public int getTabStop();
  }

  public class TextAppearanceSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
    ctor public TextAppearanceSpan(android.content.Context, int);
    ctor public TextAppearanceSpan(android.content.Context, int, int);
    ctor public TextAppearanceSpan(String, int, int, android.content.res.ColorStateList, android.content.res.ColorStateList);
    ctor public TextAppearanceSpan(android.os.Parcel);
    method public int describeContents();
    method public String getFamily();
    method public android.content.res.ColorStateList getLinkTextColor();
    method public int getSpanTypeId();
    method public android.content.res.ColorStateList getTextColor();
    method public int getTextSize();
    method public int getTextStyle();
    method public void updateDrawState(android.text.TextPaint);
    method public void updateMeasureState(android.text.TextPaint);
    method public void writeToParcel(android.os.Parcel, int);
  }

  public class TtsSpan implements android.text.ParcelableSpan {
    ctor public TtsSpan(String, android.os.PersistableBundle);
    ctor public TtsSpan(android.os.Parcel);
    method public int describeContents();
    method public android.os.PersistableBundle getArgs();
    method public int getSpanTypeId();
    method public String getType();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final String ANIMACY_ANIMATE = "android.animate";
    field public static final String ANIMACY_INANIMATE = "android.inanimate";
    field public static final String ARG_ANIMACY = "android.arg.animacy";
    field public static final String ARG_CASE = "android.arg.case";
    field public static final String ARG_COUNTRY_CODE = "android.arg.country_code";
    field public static final String ARG_CURRENCY = "android.arg.money";
    field public static final String ARG_DAY = "android.arg.day";
    field public static final String ARG_DENOMINATOR = "android.arg.denominator";
    field public static final String ARG_DIGITS = "android.arg.digits";
    field public static final String ARG_DOMAIN = "android.arg.domain";
    field public static final String ARG_EXTENSION = "android.arg.extension";
    field public static final String ARG_FRACTIONAL_PART = "android.arg.fractional_part";
    field public static final String ARG_FRAGMENT_ID = "android.arg.fragment_id";
    field public static final String ARG_GENDER = "android.arg.gender";
    field public static final String ARG_HOURS = "android.arg.hours";
    field public static final String ARG_INTEGER_PART = "android.arg.integer_part";
    field public static final String ARG_MINUTES = "android.arg.minutes";
    field public static final String ARG_MONTH = "android.arg.month";
    field public static final String ARG_MULTIPLICITY = "android.arg.multiplicity";
    field public static final String ARG_NUMBER = "android.arg.number";
    field public static final String ARG_NUMBER_PARTS = "android.arg.number_parts";
    field public static final String ARG_NUMERATOR = "android.arg.numerator";
    field public static final String ARG_PASSWORD = "android.arg.password";
    field public static final String ARG_PATH = "android.arg.path";
    field public static final String ARG_PORT = "android.arg.port";
    field public static final String ARG_PROTOCOL = "android.arg.protocol";
    field public static final String ARG_QUANTITY = "android.arg.quantity";
    field public static final String ARG_QUERY_STRING = "android.arg.query_string";
    field public static final String ARG_TEXT = "android.arg.text";
    field public static final String ARG_UNIT = "android.arg.unit";
    field public static final String ARG_USERNAME = "android.arg.username";
    field public static final String ARG_VERBATIM = "android.arg.verbatim";
    field public static final String ARG_WEEKDAY = "android.arg.weekday";
    field public static final String ARG_YEAR = "android.arg.year";
    field public static final String CASE_ABLATIVE = "android.ablative";
    field public static final String CASE_ACCUSATIVE = "android.accusative";
    field public static final String CASE_DATIVE = "android.dative";
    field public static final String CASE_GENITIVE = "android.genitive";
    field public static final String CASE_INSTRUMENTAL = "android.instrumental";
    field public static final String CASE_LOCATIVE = "android.locative";
    field public static final String CASE_NOMINATIVE = "android.nominative";
    field public static final String CASE_VOCATIVE = "android.vocative";
    field public static final String GENDER_FEMALE = "android.female";
    field public static final String GENDER_MALE = "android.male";
    field public static final String GENDER_NEUTRAL = "android.neutral";
    field public static final int MONTH_APRIL = 3; // 0x3
    field public static final int MONTH_AUGUST = 7; // 0x7
    field public static final int MONTH_DECEMBER = 11; // 0xb
    field public static final int MONTH_FEBRUARY = 1; // 0x1
    field public static final int MONTH_JANUARY = 0; // 0x0
    field public static final int MONTH_JULY = 6; // 0x6
    field public static final int MONTH_JUNE = 5; // 0x5
    field public static final int MONTH_MARCH = 2; // 0x2
    field public static final int MONTH_MAY = 4; // 0x4
    field public static final int MONTH_NOVEMBER = 10; // 0xa
    field public static final int MONTH_OCTOBER = 9; // 0x9
    field public static final int MONTH_SEPTEMBER = 8; // 0x8
    field public static final String MULTIPLICITY_DUAL = "android.dual";
    field public static final String MULTIPLICITY_PLURAL = "android.plural";
    field public static final String MULTIPLICITY_SINGLE = "android.single";
    field public static final String TYPE_CARDINAL = "android.type.cardinal";
    field public static final String TYPE_DATE = "android.type.date";
    field public static final String TYPE_DECIMAL = "android.type.decimal";
    field public static final String TYPE_DIGITS = "android.type.digits";
    field public static final String TYPE_ELECTRONIC = "android.type.electronic";
    field public static final String TYPE_FRACTION = "android.type.fraction";
    field public static final String TYPE_MEASURE = "android.type.measure";
    field public static final String TYPE_MONEY = "android.type.money";
    field public static final String TYPE_ORDINAL = "android.type.ordinal";
    field public static final String TYPE_TELEPHONE = "android.type.telephone";
    field public static final String TYPE_TEXT = "android.type.text";
    field public static final String TYPE_TIME = "android.type.time";
    field public static final String TYPE_VERBATIM = "android.type.verbatim";
    field public static final int WEEKDAY_FRIDAY = 6; // 0x6
    field public static final int WEEKDAY_MONDAY = 2; // 0x2
    field public static final int WEEKDAY_SATURDAY = 7; // 0x7
    field public static final int WEEKDAY_SUNDAY = 1; // 0x1
    field public static final int WEEKDAY_THURSDAY = 5; // 0x5
    field public static final int WEEKDAY_TUESDAY = 3; // 0x3
    field public static final int WEEKDAY_WEDNESDAY = 4; // 0x4
  }

  public static class TtsSpan.Builder<C extends android.text.style.TtsSpan.Builder<?>> {
    ctor public TtsSpan.Builder(String);
    method public android.text.style.TtsSpan build();
    method public C setIntArgument(String, int);
    method public C setLongArgument(String, long);
    method public C setStringArgument(String, String);
  }

  public static class TtsSpan.CardinalBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.CardinalBuilder> {
    ctor public TtsSpan.CardinalBuilder();
    ctor public TtsSpan.CardinalBuilder(long);
    ctor public TtsSpan.CardinalBuilder(String);
    method public android.text.style.TtsSpan.CardinalBuilder setNumber(long);
    method public android.text.style.TtsSpan.CardinalBuilder setNumber(String);
  }

  public static class TtsSpan.DateBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.DateBuilder> {
    ctor public TtsSpan.DateBuilder();
    ctor public TtsSpan.DateBuilder(Integer, Integer, Integer, Integer);
    method public android.text.style.TtsSpan.DateBuilder setDay(int);
    method public android.text.style.TtsSpan.DateBuilder setMonth(int);
    method public android.text.style.TtsSpan.DateBuilder setWeekday(int);
    method public android.text.style.TtsSpan.DateBuilder setYear(int);
  }

  public static class TtsSpan.DecimalBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.DecimalBuilder> {
    ctor public TtsSpan.DecimalBuilder();
    ctor public TtsSpan.DecimalBuilder(double, int, int);
    ctor public TtsSpan.DecimalBuilder(String, String);
    method public android.text.style.TtsSpan.DecimalBuilder setArgumentsFromDouble(double, int, int);
    method public android.text.style.TtsSpan.DecimalBuilder setFractionalPart(String);
    method public android.text.style.TtsSpan.DecimalBuilder setIntegerPart(long);
    method public android.text.style.TtsSpan.DecimalBuilder setIntegerPart(String);
  }

  public static class TtsSpan.DigitsBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.DigitsBuilder> {
    ctor public TtsSpan.DigitsBuilder();
    ctor public TtsSpan.DigitsBuilder(String);
    method public android.text.style.TtsSpan.DigitsBuilder setDigits(String);
  }

  public static class TtsSpan.ElectronicBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.ElectronicBuilder> {
    ctor public TtsSpan.ElectronicBuilder();
    method public android.text.style.TtsSpan.ElectronicBuilder setDomain(String);
    method public android.text.style.TtsSpan.ElectronicBuilder setEmailArguments(String, String);
    method public android.text.style.TtsSpan.ElectronicBuilder setFragmentId(String);
    method public android.text.style.TtsSpan.ElectronicBuilder setPassword(String);
    method public android.text.style.TtsSpan.ElectronicBuilder setPath(String);
    method public android.text.style.TtsSpan.ElectronicBuilder setPort(int);
    method public android.text.style.TtsSpan.ElectronicBuilder setProtocol(String);
    method public android.text.style.TtsSpan.ElectronicBuilder setQueryString(String);
    method public android.text.style.TtsSpan.ElectronicBuilder setUsername(String);
  }

  public static class TtsSpan.FractionBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.FractionBuilder> {
    ctor public TtsSpan.FractionBuilder();
    ctor public TtsSpan.FractionBuilder(long, long, long);
    method public android.text.style.TtsSpan.FractionBuilder setDenominator(long);
    method public android.text.style.TtsSpan.FractionBuilder setDenominator(String);
    method public android.text.style.TtsSpan.FractionBuilder setIntegerPart(long);
    method public android.text.style.TtsSpan.FractionBuilder setIntegerPart(String);
    method public android.text.style.TtsSpan.FractionBuilder setNumerator(long);
    method public android.text.style.TtsSpan.FractionBuilder setNumerator(String);
  }

  public static class TtsSpan.MeasureBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.MeasureBuilder> {
    ctor public TtsSpan.MeasureBuilder();
    method public android.text.style.TtsSpan.MeasureBuilder setDenominator(long);
    method public android.text.style.TtsSpan.MeasureBuilder setDenominator(String);
    method public android.text.style.TtsSpan.MeasureBuilder setFractionalPart(String);
    method public android.text.style.TtsSpan.MeasureBuilder setIntegerPart(long);
    method public android.text.style.TtsSpan.MeasureBuilder setIntegerPart(String);
    method public android.text.style.TtsSpan.MeasureBuilder setNumber(long);
    method public android.text.style.TtsSpan.MeasureBuilder setNumber(String);
    method public android.text.style.TtsSpan.MeasureBuilder setNumerator(long);
    method public android.text.style.TtsSpan.MeasureBuilder setNumerator(String);
    method public android.text.style.TtsSpan.MeasureBuilder setUnit(String);
  }

  public static class TtsSpan.MoneyBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.MoneyBuilder> {
    ctor public TtsSpan.MoneyBuilder();
    method public android.text.style.TtsSpan.MoneyBuilder setCurrency(String);
    method public android.text.style.TtsSpan.MoneyBuilder setFractionalPart(String);
    method public android.text.style.TtsSpan.MoneyBuilder setIntegerPart(long);
    method public android.text.style.TtsSpan.MoneyBuilder setIntegerPart(String);
    method public android.text.style.TtsSpan.MoneyBuilder setQuantity(String);
  }

  public static class TtsSpan.OrdinalBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.OrdinalBuilder> {
    ctor public TtsSpan.OrdinalBuilder();
    ctor public TtsSpan.OrdinalBuilder(long);
    ctor public TtsSpan.OrdinalBuilder(String);
    method public android.text.style.TtsSpan.OrdinalBuilder setNumber(long);
    method public android.text.style.TtsSpan.OrdinalBuilder setNumber(String);
  }

  public static class TtsSpan.SemioticClassBuilder<C extends android.text.style.TtsSpan.SemioticClassBuilder<?>> extends android.text.style.TtsSpan.Builder<C> {
    ctor public TtsSpan.SemioticClassBuilder(String);
    method public C setAnimacy(String);
    method public C setCase(String);
    method public C setGender(String);
    method public C setMultiplicity(String);
  }

  public static class TtsSpan.TelephoneBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.TelephoneBuilder> {
    ctor public TtsSpan.TelephoneBuilder();
    ctor public TtsSpan.TelephoneBuilder(String);
    method public android.text.style.TtsSpan.TelephoneBuilder setCountryCode(String);
    method public android.text.style.TtsSpan.TelephoneBuilder setExtension(String);
    method public android.text.style.TtsSpan.TelephoneBuilder setNumberParts(String);
  }

  public static class TtsSpan.TextBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.TextBuilder> {
    ctor public TtsSpan.TextBuilder();
    ctor public TtsSpan.TextBuilder(String);
    method public android.text.style.TtsSpan.TextBuilder setText(String);
  }

  public static class TtsSpan.TimeBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.TimeBuilder> {
    ctor public TtsSpan.TimeBuilder();
    ctor public TtsSpan.TimeBuilder(int, int);
    method public android.text.style.TtsSpan.TimeBuilder setHours(int);
    method public android.text.style.TtsSpan.TimeBuilder setMinutes(int);
  }

  public static class TtsSpan.VerbatimBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.VerbatimBuilder> {
    ctor public TtsSpan.VerbatimBuilder();
    ctor public TtsSpan.VerbatimBuilder(String);
    method public android.text.style.TtsSpan.VerbatimBuilder setVerbatim(String);
  }

  public class TypefaceSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
    ctor public TypefaceSpan(@Nullable String);
    ctor public TypefaceSpan(@NonNull android.graphics.Typeface);
    ctor public TypefaceSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method @Nullable public String getFamily();
    method public int getSpanTypeId();
    method @Nullable public android.graphics.Typeface getTypeface();
    method public void updateDrawState(@NonNull android.text.TextPaint);
    method public void updateMeasureState(@NonNull android.text.TextPaint);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
  }

  public class URLSpan extends android.text.style.ClickableSpan implements android.text.ParcelableSpan {
    ctor public URLSpan(String);
    ctor public URLSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method public int getSpanTypeId();
    method public String getURL();
    method public void onClick(android.view.View);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
  }

  public class UnderlineSpan extends android.text.style.CharacterStyle implements android.text.ParcelableSpan android.text.style.UpdateAppearance {
    ctor public UnderlineSpan();
    ctor public UnderlineSpan(@NonNull android.os.Parcel);
    method public int describeContents();
    method public int getSpanTypeId();
    method public void updateDrawState(@NonNull android.text.TextPaint);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
  }

  public interface UpdateAppearance {
  }

  public interface UpdateLayout extends android.text.style.UpdateAppearance {
  }

  public interface WrapTogetherSpan extends android.text.style.ParagraphStyle {
  }

}

package android.text.util {

  public class Linkify {
    ctor public Linkify();
    method public static final boolean addLinks(@NonNull android.text.Spannable, int);
    method public static final boolean addLinks(@NonNull android.widget.TextView, int);
    method public static final void addLinks(@NonNull android.widget.TextView, @NonNull java.util.regex.Pattern, @Nullable String);
    method public static final void addLinks(@NonNull android.widget.TextView, @NonNull java.util.regex.Pattern, @Nullable String, @Nullable android.text.util.Linkify.MatchFilter, @Nullable android.text.util.Linkify.TransformFilter);
    method public static final void addLinks(@NonNull android.widget.TextView, @NonNull java.util.regex.Pattern, @Nullable String, @Nullable String[], @Nullable android.text.util.Linkify.MatchFilter, @Nullable android.text.util.Linkify.TransformFilter);
    method public static final boolean addLinks(@NonNull android.text.Spannable, @NonNull java.util.regex.Pattern, @Nullable String);
    method public static final boolean addLinks(@NonNull android.text.Spannable, @NonNull java.util.regex.Pattern, @Nullable String, @Nullable android.text.util.Linkify.MatchFilter, @Nullable android.text.util.Linkify.TransformFilter);
    method public static final boolean addLinks(@NonNull android.text.Spannable, @NonNull java.util.regex.Pattern, @Nullable String, @Nullable String[], @Nullable android.text.util.Linkify.MatchFilter, @Nullable android.text.util.Linkify.TransformFilter);
    field public static final int ALL = 15; // 0xf
    field public static final int EMAIL_ADDRESSES = 2; // 0x2
    field @Deprecated public static final int MAP_ADDRESSES = 8; // 0x8
    field public static final int PHONE_NUMBERS = 4; // 0x4
    field public static final int WEB_URLS = 1; // 0x1
    field public static final android.text.util.Linkify.MatchFilter sPhoneNumberMatchFilter;
    field public static final android.text.util.Linkify.TransformFilter sPhoneNumberTransformFilter;
    field public static final android.text.util.Linkify.MatchFilter sUrlMatchFilter;
  }

  public static interface Linkify.MatchFilter {
    method public boolean acceptMatch(CharSequence, int, int);
  }

  public static interface Linkify.TransformFilter {
    method public String transformUrl(java.util.regex.Matcher, String);
  }

  public class Rfc822Token {
    ctor public Rfc822Token(@Nullable String, @Nullable String, @Nullable String);
    method @Nullable public String getAddress();
    method @Nullable public String getComment();
    method @Nullable public String getName();
    method public static String quoteComment(String);
    method public static String quoteName(String);
    method public static String quoteNameIfNecessary(String);
    method public void setAddress(@Nullable String);
    method public void setComment(@Nullable String);
    method public void setName(@Nullable String);
  }

  public class Rfc822Tokenizer implements android.widget.MultiAutoCompleteTextView.Tokenizer {
    ctor public Rfc822Tokenizer();
    method public int findTokenEnd(CharSequence, int);
    method public int findTokenStart(CharSequence, int);
    method public CharSequence terminateToken(CharSequence);
    method public static void tokenize(CharSequence, java.util.Collection<android.text.util.Rfc822Token>);
    method public static android.text.util.Rfc822Token[] tokenize(CharSequence);
  }

}

package android.transition {

  public class ArcMotion extends android.transition.PathMotion {
    ctor public ArcMotion();
    ctor public ArcMotion(android.content.Context, android.util.AttributeSet);
    method public float getMaximumAngle();
    method public float getMinimumHorizontalAngle();
    method public float getMinimumVerticalAngle();
    method public android.graphics.Path getPath(float, float, float, float);
    method public void setMaximumAngle(float);
    method public void setMinimumHorizontalAngle(float);
    method public void setMinimumVerticalAngle(float);
  }

  public class AutoTransition extends android.transition.TransitionSet {
    ctor public AutoTransition();
    ctor public AutoTransition(android.content.Context, android.util.AttributeSet);
  }

  public class ChangeBounds extends android.transition.Transition {
    ctor public ChangeBounds();
    ctor public ChangeBounds(android.content.Context, android.util.AttributeSet);
    method public void captureEndValues(android.transition.TransitionValues);
    method public void captureStartValues(android.transition.TransitionValues);
    method public boolean getResizeClip();
    method @Deprecated public void setReparent(boolean);
    method public void setResizeClip(boolean);
  }

  public class ChangeClipBounds extends android.transition.Transition {
    ctor public ChangeClipBounds();
    ctor public ChangeClipBounds(android.content.Context, android.util.AttributeSet);
    method public void captureEndValues(android.transition.TransitionValues);
    method public void captureStartValues(android.transition.TransitionValues);
  }

  public class ChangeImageTransform extends android.transition.Transition {
    ctor public ChangeImageTransform();
    ctor public ChangeImageTransform(android.content.Context, android.util.AttributeSet);
    method public void captureEndValues(android.transition.TransitionValues);
    method public void captureStartValues(android.transition.TransitionValues);
  }

  public class ChangeScroll extends android.transition.Transition {
    ctor public ChangeScroll();
    ctor public ChangeScroll(android.content.Context, android.util.AttributeSet);
    method public void captureEndValues(android.transition.TransitionValues);
    method public void captureStartValues(android.transition.TransitionValues);
  }

  public class ChangeTransform extends android.transition.Transition {
    ctor public ChangeTransform();
    ctor public ChangeTransform(android.content.Context, android.util.AttributeSet);
    method public void captureEndValues(android.transition.TransitionValues);
    method public void captureStartValues(android.transition.TransitionValues);
    method public boolean getReparent();
    method public boolean getReparentWithOverlay();
    method public void setReparent(boolean);
    method public void setReparentWithOverlay(boolean);
  }

  public class CircularPropagation extends android.transition.VisibilityPropagation {
    ctor public CircularPropagation();
    method public long getStartDelay(android.view.ViewGroup, android.transition.Transition, android.transition.TransitionValues, android.transition.TransitionValues);
    method public void setPropagationSpeed(float);
  }

  public class Explode extends android.transition.Visibility {
    ctor public Explode();
    ctor public Explode(android.content.Context, android.util.AttributeSet);
  }

  public class Fade extends android.transition.Visibility {
    ctor public Fade();
    ctor public Fade(int);
    ctor public Fade(android.content.Context, android.util.AttributeSet);
    field public static final int IN = 1; // 0x1
    field public static final int OUT = 2; // 0x2
  }

  public abstract class PathMotion {
    ctor public PathMotion();
    ctor public PathMotion(android.content.Context, android.util.AttributeSet);
    method public abstract android.graphics.Path getPath(float, float, float, float);
  }

  public class PatternPathMotion extends android.transition.PathMotion {
    ctor public PatternPathMotion();
    ctor public PatternPathMotion(android.content.Context, android.util.AttributeSet);
    ctor public PatternPathMotion(android.graphics.Path);
    method public android.graphics.Path getPath(float, float, float, float);
    method public android.graphics.Path getPatternPath();
    method public void setPatternPath(android.graphics.Path);
  }

  public final class Scene {
    ctor public Scene(android.view.ViewGroup);
    ctor public Scene(android.view.ViewGroup, android.view.View);
    ctor @Deprecated public Scene(android.view.ViewGroup, android.view.ViewGroup);
    method public void enter();
    method public void exit();
    method public static android.transition.Scene getSceneForLayout(android.view.ViewGroup, int, android.content.Context);
    method public android.view.ViewGroup getSceneRoot();
    method public void setEnterAction(Runnable);
    method public void setExitAction(Runnable);
  }

  public class SidePropagation extends android.transition.VisibilityPropagation {
    ctor public SidePropagation();
    method public long getStartDelay(android.view.ViewGroup, android.transition.Transition, android.transition.TransitionValues, android.transition.TransitionValues);
    method public void setPropagationSpeed(float);
    method public void setSide(int);
  }

  public class Slide extends android.transition.Visibility {
    ctor public Slide();
    ctor public Slide(int);
    ctor public Slide(android.content.Context, android.util.AttributeSet);
    method public int getSlideEdge();
    method public void setSlideEdge(int);
  }

  public abstract class Transition implements java.lang.Cloneable {
    ctor public Transition();
    ctor public Transition(android.content.Context, android.util.AttributeSet);
    method public android.transition.Transition addListener(android.transition.Transition.TransitionListener);
    method public android.transition.Transition addTarget(int);
    method public android.transition.Transition addTarget(String);
    method public android.transition.Transition addTarget(Class);
    method public android.transition.Transition addTarget(android.view.View);
    method public boolean canRemoveViews();
    method public abstract void captureEndValues(android.transition.TransitionValues);
    method public abstract void captureStartValues(android.transition.TransitionValues);
    method public android.transition.Transition clone();
    method public android.animation.Animator createAnimator(android.view.ViewGroup, android.transition.TransitionValues, android.transition.TransitionValues);
    method public android.transition.Transition excludeChildren(int, boolean);
    method public android.transition.Transition excludeChildren(android.view.View, boolean);
    method public android.transition.Transition excludeChildren(Class, boolean);
    method public android.transition.Transition excludeTarget(int, boolean);
    method public android.transition.Transition excludeTarget(String, boolean);
    method public android.transition.Transition excludeTarget(android.view.View, boolean);
    method public android.transition.Transition excludeTarget(Class, boolean);
    method public long getDuration();
    method public android.graphics.Rect getEpicenter();
    method public android.transition.Transition.EpicenterCallback getEpicenterCallback();
    method public android.animation.TimeInterpolator getInterpolator();
    method public String getName();
    method public android.transition.PathMotion getPathMotion();
    method public android.transition.TransitionPropagation getPropagation();
    method public long getStartDelay();
    method public java.util.List<java.lang.Integer> getTargetIds();
    method public java.util.List<java.lang.String> getTargetNames();
    method public java.util.List<java.lang.Class> getTargetTypes();
    method public java.util.List<android.view.View> getTargets();
    method public String[] getTransitionProperties();
    method public android.transition.TransitionValues getTransitionValues(android.view.View, boolean);
    method public boolean isTransitionRequired(@Nullable android.transition.TransitionValues, @Nullable android.transition.TransitionValues);
    method public android.transition.Transition removeListener(android.transition.Transition.TransitionListener);
    method public android.transition.Transition removeTarget(int);
    method public android.transition.Transition removeTarget(String);
    method public android.transition.Transition removeTarget(android.view.View);
    method public android.transition.Transition removeTarget(Class);
    method public android.transition.Transition setDuration(long);
    method public void setEpicenterCallback(android.transition.Transition.EpicenterCallback);
    method public android.transition.Transition setInterpolator(android.animation.TimeInterpolator);
    method public void setMatchOrder(int...);
    method public void setPathMotion(android.transition.PathMotion);
    method public void setPropagation(android.transition.TransitionPropagation);
    method public android.transition.Transition setStartDelay(long);
    field public static final int MATCH_ID = 3; // 0x3
    field public static final int MATCH_INSTANCE = 1; // 0x1
    field public static final int MATCH_ITEM_ID = 4; // 0x4
    field public static final int MATCH_NAME = 2; // 0x2
  }

  public abstract static class Transition.EpicenterCallback {
    ctor public Transition.EpicenterCallback();
    method public abstract android.graphics.Rect onGetEpicenter(android.transition.Transition);
  }

  public static interface Transition.TransitionListener {
    method public void onTransitionCancel(android.transition.Transition);
    method public void onTransitionEnd(android.transition.Transition);
    method public void onTransitionPause(android.transition.Transition);
    method public void onTransitionResume(android.transition.Transition);
    method public void onTransitionStart(android.transition.Transition);
  }

  public class TransitionInflater {
    method public static android.transition.TransitionInflater from(android.content.Context);
    method public android.transition.Transition inflateTransition(@TransitionRes int);
    method public android.transition.TransitionManager inflateTransitionManager(@TransitionRes int, android.view.ViewGroup);
  }

  public abstract class TransitionListenerAdapter implements android.transition.Transition.TransitionListener {
    ctor public TransitionListenerAdapter();
    method public void onTransitionCancel(android.transition.Transition);
    method public void onTransitionEnd(android.transition.Transition);
    method public void onTransitionPause(android.transition.Transition);
    method public void onTransitionResume(android.transition.Transition);
    method public void onTransitionStart(android.transition.Transition);
  }

  public class TransitionManager {
    ctor public TransitionManager();
    method public static void beginDelayedTransition(android.view.ViewGroup);
    method public static void beginDelayedTransition(android.view.ViewGroup, android.transition.Transition);
    method public static void endTransitions(android.view.ViewGroup);
    method public static void go(android.transition.Scene);
    method public static void go(android.transition.Scene, android.transition.Transition);
    method public void setTransition(android.transition.Scene, android.transition.Transition);
    method public void setTransition(android.transition.Scene, android.transition.Scene, android.transition.Transition);
    method public void transitionTo(android.transition.Scene);
  }

  public abstract class TransitionPropagation {
    ctor public TransitionPropagation();
    method public abstract void captureValues(android.transition.TransitionValues);
    method public abstract String[] getPropagationProperties();
    method public abstract long getStartDelay(android.view.ViewGroup, android.transition.Transition, android.transition.TransitionValues, android.transition.TransitionValues);
  }

  public class TransitionSet extends android.transition.Transition {
    ctor public TransitionSet();
    ctor public TransitionSet(android.content.Context, android.util.AttributeSet);
    method public android.transition.TransitionSet addListener(android.transition.Transition.TransitionListener);
    method public android.transition.TransitionSet addTarget(android.view.View);
    method public android.transition.TransitionSet addTarget(int);
    method public android.transition.TransitionSet addTarget(String);
    method public android.transition.TransitionSet addTarget(Class);
    method public android.transition.TransitionSet addTransition(android.transition.Transition);
    method public void captureEndValues(android.transition.TransitionValues);
    method public void captureStartValues(android.transition.TransitionValues);
    method public android.transition.TransitionSet clone();
    method public int getOrdering();
    method public android.transition.Transition getTransitionAt(int);
    method public int getTransitionCount();
    method public android.transition.TransitionSet removeListener(android.transition.Transition.TransitionListener);
    method public android.transition.TransitionSet removeTarget(int);
    method public android.transition.TransitionSet removeTarget(android.view.View);
    method public android.transition.TransitionSet removeTarget(Class);
    method public android.transition.TransitionSet removeTarget(String);
    method public android.transition.TransitionSet removeTransition(android.transition.Transition);
    method public android.transition.TransitionSet setDuration(long);
    method public android.transition.TransitionSet setInterpolator(android.animation.TimeInterpolator);
    method public android.transition.TransitionSet setOrdering(int);
    method public android.transition.TransitionSet setStartDelay(long);
    field public static final int ORDERING_SEQUENTIAL = 1; // 0x1
    field public static final int ORDERING_TOGETHER = 0; // 0x0
  }

  public class TransitionValues {
    ctor public TransitionValues();
    field public final java.util.Map<java.lang.String,java.lang.Object> values;
    field public android.view.View view;
  }

  public abstract class Visibility extends android.transition.Transition {
    ctor public Visibility();
    ctor public Visibility(android.content.Context, android.util.AttributeSet);
    method public void captureEndValues(android.transition.TransitionValues);
    method public void captureStartValues(android.transition.TransitionValues);
    method public int getMode();
    method public boolean isVisible(android.transition.TransitionValues);
    method public android.animation.Animator onAppear(android.view.ViewGroup, android.transition.TransitionValues, int, android.transition.TransitionValues, int);
    method public android.animation.Animator onAppear(android.view.ViewGroup, android.view.View, android.transition.TransitionValues, android.transition.TransitionValues);
    method public android.animation.Animator onDisappear(android.view.ViewGroup, android.transition.TransitionValues, int, android.transition.TransitionValues, int);
    method public android.animation.Animator onDisappear(android.view.ViewGroup, android.view.View, android.transition.TransitionValues, android.transition.TransitionValues);
    method public void setMode(int);
    field public static final int MODE_IN = 1; // 0x1
    field public static final int MODE_OUT = 2; // 0x2
  }

  public abstract class VisibilityPropagation extends android.transition.TransitionPropagation {
    ctor public VisibilityPropagation();
    method public void captureValues(android.transition.TransitionValues);
    method public String[] getPropagationProperties();
    method public int getViewVisibility(android.transition.TransitionValues);
    method public int getViewX(android.transition.TransitionValues);
    method public int getViewY(android.transition.TransitionValues);
  }

}

package android.util {

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

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

  public final class ArrayMap<K, V> implements java.util.Map<K,V> {
    ctor public ArrayMap();
    ctor public ArrayMap(int);
    ctor public ArrayMap(android.util.ArrayMap<K,V>);
    method public void clear();
    method public boolean containsAll(java.util.Collection<?>);
    method public boolean containsKey(Object);
    method public boolean containsValue(Object);
    method public void ensureCapacity(int);
    method public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
    method public V get(Object);
    method public int indexOfKey(Object);
    method public boolean isEmpty();
    method public K keyAt(int);
    method public java.util.Set<K> keySet();
    method public V put(K, V);
    method public void putAll(android.util.ArrayMap<? extends K,? extends V>);
    method public void putAll(java.util.Map<? extends K,? extends V>);
    method public V remove(Object);
    method public boolean removeAll(java.util.Collection<?>);
    method public V removeAt(int);
    method public boolean retainAll(java.util.Collection<?>);
    method public V setValueAt(int, V);
    method public int size();
    method public V valueAt(int);
    method public java.util.Collection<V> values();
  }

  public final class ArraySet<E> implements java.util.Collection<E> java.util.Set<E> {
    ctor public ArraySet();
    ctor public ArraySet(int);
    ctor public ArraySet(android.util.ArraySet<E>);
    method public boolean add(E);
    method public void addAll(android.util.ArraySet<? extends E>);
    method public boolean addAll(java.util.Collection<? extends E>);
    method public void clear();
    method public boolean contains(Object);
    method public boolean containsAll(java.util.Collection<?>);
    method public void ensureCapacity(int);
    method public int indexOf(Object);
    method public boolean isEmpty();
    method public java.util.Iterator<E> iterator();
    method public boolean remove(Object);
    method public boolean removeAll(android.util.ArraySet<? extends E>);
    method public boolean removeAll(java.util.Collection<?>);
    method public E removeAt(int);
    method public boolean retainAll(java.util.Collection<?>);
    method public int size();
    method public Object[] toArray();
    method public <T> T[] toArray(T[]);
    method public E valueAt(int);
  }

  public class AtomicFile {
    ctor public AtomicFile(java.io.File);
    method public void delete();
    method public void failWrite(java.io.FileOutputStream);
    method public void finishWrite(java.io.FileOutputStream);
    method public java.io.File getBaseFile();
    method public java.io.FileInputStream openRead() throws java.io.FileNotFoundException;
    method public byte[] readFully() throws java.io.IOException;
    method public java.io.FileOutputStream startWrite() throws java.io.IOException;
  }

  public interface AttributeSet {
    method public boolean getAttributeBooleanValue(String, String, boolean);
    method public boolean getAttributeBooleanValue(int, boolean);
    method public int getAttributeCount();
    method public float getAttributeFloatValue(String, String, float);
    method public float getAttributeFloatValue(int, float);
    method public int getAttributeIntValue(String, String, int);
    method public int getAttributeIntValue(int, int);
    method public int getAttributeListValue(String, String, String[], int);
    method public int getAttributeListValue(int, String[], int);
    method public String getAttributeName(int);
    method public int getAttributeNameResource(int);
    method public default String getAttributeNamespace(int);
    method public int getAttributeResourceValue(String, String, int);
    method public int getAttributeResourceValue(int, int);
    method public int getAttributeUnsignedIntValue(String, String, int);
    method public int getAttributeUnsignedIntValue(int, int);
    method public String getAttributeValue(int);
    method public String getAttributeValue(String, String);
    method public String getClassAttribute();
    method public String getIdAttribute();
    method public int getIdAttributeResourceValue(int);
    method public String getPositionDescription();
    method public int getStyleAttribute();
  }

  public class Base64 {
    method public static byte[] decode(String, int);
    method public static byte[] decode(byte[], int);
    method public static byte[] decode(byte[], int, int, int);
    method public static byte[] encode(byte[], int);
    method public static byte[] encode(byte[], int, int, int);
    method public static String encodeToString(byte[], int);
    method public static String encodeToString(byte[], int, int, int);
    field public static final int CRLF = 4; // 0x4
    field public static final int DEFAULT = 0; // 0x0
    field public static final int NO_CLOSE = 16; // 0x10
    field public static final int NO_PADDING = 1; // 0x1
    field public static final int NO_WRAP = 2; // 0x2
    field public static final int URL_SAFE = 8; // 0x8
  }

  public class Base64DataException extends java.io.IOException {
    ctor public Base64DataException(String);
  }

  public class Base64InputStream extends java.io.FilterInputStream {
    ctor public Base64InputStream(java.io.InputStream, int);
    method public int available();
    method public void reset();
  }

  public class Base64OutputStream extends java.io.FilterOutputStream {
    ctor public Base64OutputStream(java.io.OutputStream, int);
  }

  @Deprecated public final class Config {
    field @Deprecated public static final boolean DEBUG = false;
    field @Deprecated public static final boolean LOGD = true;
    field @Deprecated public static final boolean LOGV = false;
    field @Deprecated public static final boolean PROFILE = false;
    field @Deprecated public static final boolean RELEASE = true;
  }

  public class DebugUtils {
    method public static boolean isObjectSelected(Object);
  }

  public class DisplayMetrics {
    ctor public DisplayMetrics();
    method public boolean equals(android.util.DisplayMetrics);
    method public void setTo(android.util.DisplayMetrics);
    method public void setToDefaults();
    field public static final int DENSITY_260 = 260; // 0x104
    field public static final int DENSITY_280 = 280; // 0x118
    field public static final int DENSITY_300 = 300; // 0x12c
    field public static final int DENSITY_340 = 340; // 0x154
    field public static final int DENSITY_360 = 360; // 0x168
    field public static final int DENSITY_400 = 400; // 0x190
    field public static final int DENSITY_420 = 420; // 0x1a4
    field public static final int DENSITY_440 = 440; // 0x1b8
    field public static final int DENSITY_560 = 560; // 0x230
    field public static final int DENSITY_600 = 600; // 0x258
    field public static final int DENSITY_DEFAULT = 160; // 0xa0
    field public static final int DENSITY_DEVICE_STABLE;
    field public static final int DENSITY_HIGH = 240; // 0xf0
    field public static final int DENSITY_LOW = 120; // 0x78
    field public static final int DENSITY_MEDIUM = 160; // 0xa0
    field public static final int DENSITY_TV = 213; // 0xd5
    field public static final int DENSITY_XHIGH = 320; // 0x140
    field public static final int DENSITY_XXHIGH = 480; // 0x1e0
    field public static final int DENSITY_XXXHIGH = 640; // 0x280
    field public float density;
    field public int densityDpi;
    field public int heightPixels;
    field public float scaledDensity;
    field public int widthPixels;
    field public float xdpi;
    field public float ydpi;
  }

  public class EventLog {
    method public static int getTagCode(String);
    method public static String getTagName(int);
    method public static void readEvents(int[], java.util.Collection<android.util.EventLog.Event>) throws java.io.IOException;
    method public static int writeEvent(int, int);
    method public static int writeEvent(int, long);
    method public static int writeEvent(int, float);
    method public static int writeEvent(int, String);
    method public static int writeEvent(int, java.lang.Object...);
  }

  public static final class EventLog.Event {
    method public Object getData();
    method public int getProcessId();
    method public int getTag();
    method public int getThreadId();
    method public long getTimeNanos();
  }

  @Deprecated public class EventLogTags {
    ctor @Deprecated public EventLogTags() throws java.io.IOException;
    ctor @Deprecated public EventLogTags(java.io.BufferedReader) throws java.io.IOException;
    method @Deprecated public android.util.EventLogTags.Description get(String);
    method @Deprecated public android.util.EventLogTags.Description get(int);
  }

  @Deprecated public static class EventLogTags.Description {
    field @Deprecated public final String mName;
    field @Deprecated public final int mTag;
  }

  @Deprecated public class FloatMath {
  }

  public abstract class FloatProperty<T> extends android.util.Property<T,java.lang.Float> {
    ctor public FloatProperty(String);
    method public final void set(T, Float);
    method public abstract void setValue(T, float);
  }

  public final class Half extends java.lang.Number implements java.lang.Comparable<android.util.Half> {
    ctor public Half(@HalfFloat short);
    ctor public Half(float);
    ctor public Half(double);
    ctor public Half(@NonNull String) throws java.lang.NumberFormatException;
    method @HalfFloat public static short abs(@HalfFloat short);
    method @HalfFloat public static short ceil(@HalfFloat short);
    method public static int compare(@HalfFloat short, @HalfFloat short);
    method public int compareTo(@NonNull android.util.Half);
    method @HalfFloat public static short copySign(@HalfFloat short, @HalfFloat short);
    method public double doubleValue();
    method public static boolean equals(@HalfFloat short, @HalfFloat short);
    method public float floatValue();
    method @HalfFloat public static short floor(@HalfFloat short);
    method public static int getExponent(@HalfFloat short);
    method public static int getSign(@HalfFloat short);
    method public static int getSignificand(@HalfFloat short);
    method public static boolean greater(@HalfFloat short, @HalfFloat short);
    method public static boolean greaterEquals(@HalfFloat short, @HalfFloat short);
    method public static int halfToIntBits(@HalfFloat short);
    method public static int halfToRawIntBits(@HalfFloat short);
    method @HalfFloat public static short halfToShortBits(@HalfFloat short);
    method @HalfFloat public short halfValue();
    method public static int hashCode(@HalfFloat short);
    method @HalfFloat public static short intBitsToHalf(int);
    method public int intValue();
    method public static boolean isInfinite(@HalfFloat short);
    method public boolean isNaN();
    method public static boolean isNaN(@HalfFloat short);
    method public static boolean isNormalized(@HalfFloat short);
    method public static boolean less(@HalfFloat short, @HalfFloat short);
    method public static boolean lessEquals(@HalfFloat short, @HalfFloat short);
    method public long longValue();
    method @HalfFloat public static short max(@HalfFloat short, @HalfFloat short);
    method @HalfFloat public static short min(@HalfFloat short, @HalfFloat short);
    method @HalfFloat public static short parseHalf(@NonNull String) throws java.lang.NumberFormatException;
    method @HalfFloat public static short round(@HalfFloat short);
    method public static float toFloat(@HalfFloat short);
    method @HalfFloat public static short toHalf(float);
    method @NonNull public static String toHexString(@HalfFloat short);
    method @NonNull public static String toString(@HalfFloat short);
    method @HalfFloat public static short trunc(@HalfFloat short);
    method @NonNull public static android.util.Half valueOf(@HalfFloat short);
    method @NonNull public static android.util.Half valueOf(float);
    method @NonNull public static android.util.Half valueOf(@NonNull String);
    field @HalfFloat public static final short EPSILON = 5120; // 0x1400
    field @HalfFloat public static final short LOWEST_VALUE = -1025; // 0xfffffbff
    field public static final int MAX_EXPONENT = 15; // 0xf
    field @HalfFloat public static final short MAX_VALUE = 31743; // 0x7bff
    field public static final int MIN_EXPONENT = -14; // 0xfffffff2
    field @HalfFloat public static final short MIN_NORMAL = 1024; // 0x400
    field @HalfFloat public static final short MIN_VALUE = 1; // 0x1
    field @HalfFloat public static final short NEGATIVE_INFINITY = -1024; // 0xfffffc00
    field @HalfFloat public static final short NEGATIVE_ZERO = -32768; // 0xffff8000
    field @HalfFloat public static final short NaN = 32256; // 0x7e00
    field @HalfFloat public static final short POSITIVE_INFINITY = 31744; // 0x7c00
    field @HalfFloat public static final short POSITIVE_ZERO = 0; // 0x0
    field public static final int SIZE = 16; // 0x10
  }

  public abstract class IntProperty<T> extends android.util.Property<T,java.lang.Integer> {
    ctor public IntProperty(String);
    method public final void set(T, Integer);
    method public abstract void setValue(T, int);
  }

  public final class JsonReader implements java.io.Closeable {
    ctor public JsonReader(java.io.Reader);
    method public void beginArray() throws java.io.IOException;
    method public void beginObject() throws java.io.IOException;
    method public void close() throws java.io.IOException;
    method public void endArray() throws java.io.IOException;
    method public void endObject() throws java.io.IOException;
    method public boolean hasNext() throws java.io.IOException;
    method public boolean isLenient();
    method public boolean nextBoolean() throws java.io.IOException;
    method public double nextDouble() throws java.io.IOException;
    method public int nextInt() throws java.io.IOException;
    method public long nextLong() throws java.io.IOException;
    method public String nextName() throws java.io.IOException;
    method public void nextNull() throws java.io.IOException;
    method public String nextString() throws java.io.IOException;
    method public android.util.JsonToken peek() throws java.io.IOException;
    method public void setLenient(boolean);
    method public void skipValue() throws java.io.IOException;
  }

  public enum JsonToken {
    enum_constant public static final android.util.JsonToken BEGIN_ARRAY;
    enum_constant public static final android.util.JsonToken BEGIN_OBJECT;
    enum_constant public static final android.util.JsonToken BOOLEAN;
    enum_constant public static final android.util.JsonToken END_ARRAY;
    enum_constant public static final android.util.JsonToken END_DOCUMENT;
    enum_constant public static final android.util.JsonToken END_OBJECT;
    enum_constant public static final android.util.JsonToken NAME;
    enum_constant public static final android.util.JsonToken NULL;
    enum_constant public static final android.util.JsonToken NUMBER;
    enum_constant public static final android.util.JsonToken STRING;
  }

  public final class JsonWriter implements java.io.Closeable {
    ctor public JsonWriter(java.io.Writer);
    method public android.util.JsonWriter beginArray() throws java.io.IOException;
    method public android.util.JsonWriter beginObject() throws java.io.IOException;
    method public void close() throws java.io.IOException;
    method public android.util.JsonWriter endArray() throws java.io.IOException;
    method public android.util.JsonWriter endObject() throws java.io.IOException;
    method public void flush() throws java.io.IOException;
    method public boolean isLenient();
    method public android.util.JsonWriter name(String) throws java.io.IOException;
    method public android.util.JsonWriter nullValue() throws java.io.IOException;
    method public void setIndent(String);
    method public void setLenient(boolean);
    method public android.util.JsonWriter value(String) throws java.io.IOException;
    method public android.util.JsonWriter value(boolean) throws java.io.IOException;
    method public android.util.JsonWriter value(double) throws java.io.IOException;
    method public android.util.JsonWriter value(long) throws java.io.IOException;
    method public android.util.JsonWriter value(Number) throws java.io.IOException;
  }

  public final class LayoutDirection {
    field public static final int INHERIT = 2; // 0x2
    field public static final int LOCALE = 3; // 0x3
    field public static final int LTR = 0; // 0x0
    field public static final int RTL = 1; // 0x1
  }

  public final class Log {
    method public static int d(String, String);
    method public static int d(String, String, Throwable);
    method public static int e(String, String);
    method public static int e(String, String, Throwable);
    method @NonNull public static String getStackTraceString(@Nullable Throwable);
    method public static int i(String, String);
    method public static int i(String, String, Throwable);
    method public static boolean isLoggable(@Size(max=23, apis="..23") String, int);
    method public static int println(int, String, String);
    method public static int v(String, String);
    method public static int v(String, String, Throwable);
    method public static int w(String, String);
    method public static int w(String, String, Throwable);
    method public static int w(String, Throwable);
    method public static int wtf(String, String);
    method public static int wtf(String, Throwable);
    method public static int wtf(String, String, Throwable);
    field public static final int ASSERT = 7; // 0x7
    field public static final int DEBUG = 3; // 0x3
    field public static final int ERROR = 6; // 0x6
    field public static final int INFO = 4; // 0x4
    field public static final int VERBOSE = 2; // 0x2
    field public static final int WARN = 5; // 0x5
  }

  public class LogPrinter implements android.util.Printer {
    ctor public LogPrinter(int, String);
    method public void println(String);
  }

  public class LongSparseArray<E> implements java.lang.Cloneable {
    ctor public LongSparseArray();
    ctor public LongSparseArray(int);
    method public void append(long, E);
    method public void clear();
    method public android.util.LongSparseArray<E> clone();
    method public void delete(long);
    method public E get(long);
    method public E get(long, E);
    method public int indexOfKey(long);
    method public int indexOfValue(E);
    method public long keyAt(int);
    method public void put(long, E);
    method public void remove(long);
    method public void removeAt(int);
    method public void setValueAt(int, E);
    method public int size();
    method public E valueAt(int);
  }

  public class LruCache<K, V> {
    ctor public LruCache(int);
    method protected V create(K);
    method public final int createCount();
    method protected void entryRemoved(boolean, K, V, V);
    method public final void evictAll();
    method public final int evictionCount();
    method public final V get(K);
    method public final int hitCount();
    method public final int maxSize();
    method public final int missCount();
    method public final V put(K, V);
    method public final int putCount();
    method public final V remove(K);
    method public void resize(int);
    method public final int size();
    method protected int sizeOf(K, V);
    method public final java.util.Map<K,V> snapshot();
    method public final String toString();
    method public void trimToSize(int);
  }

  public final class MalformedJsonException extends java.io.IOException {
    ctor public MalformedJsonException(String);
  }

  public class MonthDisplayHelper {
    ctor public MonthDisplayHelper(int, int, int);
    ctor public MonthDisplayHelper(int, int);
    method public int getColumnOf(int);
    method public int getDayAt(int, int);
    method public int[] getDigitsForRow(int);
    method public int getFirstDayOfMonth();
    method public int getMonth();
    method public int getNumberOfDaysInMonth();
    method public int getOffset();
    method public int getRowOf(int);
    method public int getWeekStartDay();
    method public int getYear();
    method public boolean isWithinCurrentMonth(int, int);
    method public void nextMonth();
    method public void previousMonth();
  }

  @Deprecated public final class MutableBoolean {
    ctor @Deprecated public MutableBoolean(boolean);
    field @Deprecated public boolean value;
  }

  @Deprecated public final class MutableByte {
    ctor @Deprecated public MutableByte(byte);
    field @Deprecated public byte value;
  }

  @Deprecated public final class MutableChar {
    ctor @Deprecated public MutableChar(char);
    field @Deprecated public char value;
  }

  @Deprecated public final class MutableDouble {
    ctor @Deprecated public MutableDouble(double);
    field @Deprecated public double value;
  }

  @Deprecated public final class MutableFloat {
    ctor @Deprecated public MutableFloat(float);
    field @Deprecated public float value;
  }

  @Deprecated public final class MutableInt {
    ctor @Deprecated public MutableInt(int);
    field @Deprecated public int value;
  }

  @Deprecated public final class MutableLong {
    ctor @Deprecated public MutableLong(long);
    field @Deprecated public long value;
  }

  @Deprecated public final class MutableShort {
    ctor @Deprecated public MutableShort(short);
    field @Deprecated public short value;
  }

  public class NoSuchPropertyException extends java.lang.RuntimeException {
    ctor public NoSuchPropertyException(String);
  }

  public class Pair<F, S> {
    ctor public Pair(F, S);
    method public static <A, B> android.util.Pair<A,B> create(A, B);
    field public final F first;
    field public final S second;
  }

  public class Patterns {
    method public static final String concatGroups(java.util.regex.Matcher);
    method public static final String digitsAndPlusOnly(java.util.regex.Matcher);
    field public static final java.util.regex.Pattern DOMAIN_NAME;
    field public static final java.util.regex.Pattern EMAIL_ADDRESS;
    field @Deprecated public static final String GOOD_IRI_CHAR = "a-zA-Z0-9\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef";
    field public static final java.util.regex.Pattern IP_ADDRESS;
    field public static final java.util.regex.Pattern PHONE;
    field @Deprecated public static final java.util.regex.Pattern TOP_LEVEL_DOMAIN;
    field @Deprecated public static final String TOP_LEVEL_DOMAIN_STR = "((aero|arpa|asia|a[cdefgilmnoqrstuwxz])|(biz|b[abdefghijmnorstvwyz])|(cat|com|coop|c[acdfghiklmnoruvxyz])|d[ejkmoz]|(edu|e[cegrstu])|f[ijkmor]|(gov|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(info|int|i[delmnoqrst])|(jobs|j[emop])|k[eghimnprwyz]|l[abcikrstuvy]|(mil|mobi|museum|m[acdeghklmnopqrstuvwxyz])|(name|net|n[acefgilopruz])|(org|om)|(pro|p[aefghklmnrstwy])|qa|r[eosuw]|s[abcdeghijklmnortuvyz]|(tel|travel|t[cdfghjklmnoprtvwz])|u[agksyz]|v[aceginu]|w[fs]|(\u03b4\u03bf\u03ba\u03b9\u03bc\u03ae|\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435|\u0440\u0444|\u0441\u0440\u0431|\u05d8\u05e2\u05e1\u05d8|\u0622\u0632\u0645\u0627\u06cc\u0634\u06cc|\u0625\u062e\u062a\u0628\u0627\u0631|\u0627\u0644\u0627\u0631\u062f\u0646|\u0627\u0644\u062c\u0632\u0627\u0626\u0631|\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629|\u0627\u0644\u0645\u063a\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062a|\u0628\u06be\u0627\u0631\u062a|\u062a\u0648\u0646\u0633|\u0633\u0648\u0631\u064a\u0629|\u0641\u0644\u0633\u0637\u064a\u0646|\u0642\u0637\u0631|\u0645\u0635\u0631|\u092a\u0930\u0940\u0915\u094d\u0937\u093e|\u092d\u093e\u0930\u0924|\u09ad\u09be\u09b0\u09a4|\u0a2d\u0a3e\u0a30\u0a24|\u0aad\u0abe\u0ab0\u0aa4|\u0b87\u0ba8\u0bcd\u0ba4\u0bbf\u0baf\u0bbe|\u0b87\u0bb2\u0b99\u0bcd\u0b95\u0bc8|\u0b9a\u0bbf\u0b99\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0bc2\u0bb0\u0bcd|\u0baa\u0bb0\u0bbf\u0b9f\u0bcd\u0b9a\u0bc8|\u0c2d\u0c3e\u0c30\u0c24\u0c4d|\u0dbd\u0d82\u0d9a\u0dcf|\u0e44\u0e17\u0e22|\u30c6\u30b9\u30c8|\u4e2d\u56fd|\u4e2d\u570b|\u53f0\u6e7e|\u53f0\u7063|\u65b0\u52a0\u5761|\u6d4b\u8bd5|\u6e2c\u8a66|\u9999\u6e2f|\ud14c\uc2a4\ud2b8|\ud55c\uad6d|xn\\-\\-0zwm56d|xn\\-\\-11b5bs3a9aj6g|xn\\-\\-3e0b707e|xn\\-\\-45brj9c|xn\\-\\-80akhbyknj4f|xn\\-\\-90a3ac|xn\\-\\-9t4b11yi5a|xn\\-\\-clchc0ea0b2g2a9gcd|xn\\-\\-deba0ad|xn\\-\\-fiqs8s|xn\\-\\-fiqz9s|xn\\-\\-fpcrj9c3d|xn\\-\\-fzc2c9e2c|xn\\-\\-g6w251d|xn\\-\\-gecrj9c|xn\\-\\-h2brj9c|xn\\-\\-hgbk6aj7f53bba|xn\\-\\-hlcj6aya9esc7a|xn\\-\\-j6w193g|xn\\-\\-jxalpdlp|xn\\-\\-kgbechtv|xn\\-\\-kprw13d|xn\\-\\-kpry57d|xn\\-\\-lgbbat1ad8j|xn\\-\\-mgbaam7a8h|xn\\-\\-mgbayh7gpa|xn\\-\\-mgbbh1a71e|xn\\-\\-mgbc0a9azcg|xn\\-\\-mgberp4a5d4ar|xn\\-\\-o3cw4h|xn\\-\\-ogbpf8fl|xn\\-\\-p1ai|xn\\-\\-pgbs0dh|xn\\-\\-s9brj9c|xn\\-\\-wgbh1c|xn\\-\\-wgbl6a|xn\\-\\-xkc2al3hye2a|xn\\-\\-xkc2dl3a5ee0h|xn\\-\\-yfro4i67o|xn\\-\\-ygbi2ammx|xn\\-\\-zckzah|xxx)|y[et]|z[amw])";
    field @Deprecated public static final String TOP_LEVEL_DOMAIN_STR_FOR_WEB_URL = "(?:(?:aero|arpa|asia|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|com|coop|c[acdfghiklmnoruvxyz])|d[ejkmoz]|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnprwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdeghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om)|(?:pro|p[aefghklmnrstwy])|qa|r[eosuw]|s[abcdeghijklmnortuvyz]|(?:tel|travel|t[cdfghjklmnoprtvwz])|u[agksyz]|v[aceginu]|w[fs]|(?:\u03b4\u03bf\u03ba\u03b9\u03bc\u03ae|\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435|\u0440\u0444|\u0441\u0440\u0431|\u05d8\u05e2\u05e1\u05d8|\u0622\u0632\u0645\u0627\u06cc\u0634\u06cc|\u0625\u062e\u062a\u0628\u0627\u0631|\u0627\u0644\u0627\u0631\u062f\u0646|\u0627\u0644\u062c\u0632\u0627\u0626\u0631|\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629|\u0627\u0644\u0645\u063a\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062a|\u0628\u06be\u0627\u0631\u062a|\u062a\u0648\u0646\u0633|\u0633\u0648\u0631\u064a\u0629|\u0641\u0644\u0633\u0637\u064a\u0646|\u0642\u0637\u0631|\u0645\u0635\u0631|\u092a\u0930\u0940\u0915\u094d\u0937\u093e|\u092d\u093e\u0930\u0924|\u09ad\u09be\u09b0\u09a4|\u0a2d\u0a3e\u0a30\u0a24|\u0aad\u0abe\u0ab0\u0aa4|\u0b87\u0ba8\u0bcd\u0ba4\u0bbf\u0baf\u0bbe|\u0b87\u0bb2\u0b99\u0bcd\u0b95\u0bc8|\u0b9a\u0bbf\u0b99\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0bc2\u0bb0\u0bcd|\u0baa\u0bb0\u0bbf\u0b9f\u0bcd\u0b9a\u0bc8|\u0c2d\u0c3e\u0c30\u0c24\u0c4d|\u0dbd\u0d82\u0d9a\u0dcf|\u0e44\u0e17\u0e22|\u30c6\u30b9\u30c8|\u4e2d\u56fd|\u4e2d\u570b|\u53f0\u6e7e|\u53f0\u7063|\u65b0\u52a0\u5761|\u6d4b\u8bd5|\u6e2c\u8a66|\u9999\u6e2f|\ud14c\uc2a4\ud2b8|\ud55c\uad6d|xn\\-\\-0zwm56d|xn\\-\\-11b5bs3a9aj6g|xn\\-\\-3e0b707e|xn\\-\\-45brj9c|xn\\-\\-80akhbyknj4f|xn\\-\\-90a3ac|xn\\-\\-9t4b11yi5a|xn\\-\\-clchc0ea0b2g2a9gcd|xn\\-\\-deba0ad|xn\\-\\-fiqs8s|xn\\-\\-fiqz9s|xn\\-\\-fpcrj9c3d|xn\\-\\-fzc2c9e2c|xn\\-\\-g6w251d|xn\\-\\-gecrj9c|xn\\-\\-h2brj9c|xn\\-\\-hgbk6aj7f53bba|xn\\-\\-hlcj6aya9esc7a|xn\\-\\-j6w193g|xn\\-\\-jxalpdlp|xn\\-\\-kgbechtv|xn\\-\\-kprw13d|xn\\-\\-kpry57d|xn\\-\\-lgbbat1ad8j|xn\\-\\-mgbaam7a8h|xn\\-\\-mgbayh7gpa|xn\\-\\-mgbbh1a71e|xn\\-\\-mgbc0a9azcg|xn\\-\\-mgberp4a5d4ar|xn\\-\\-o3cw4h|xn\\-\\-ogbpf8fl|xn\\-\\-p1ai|xn\\-\\-pgbs0dh|xn\\-\\-s9brj9c|xn\\-\\-wgbh1c|xn\\-\\-wgbl6a|xn\\-\\-xkc2al3hye2a|xn\\-\\-xkc2dl3a5ee0h|xn\\-\\-yfro4i67o|xn\\-\\-ygbi2ammx|xn\\-\\-zckzah|xxx)|y[et]|z[amw]))";
    field public static final java.util.regex.Pattern WEB_URL;
  }

  public class PrintStreamPrinter implements android.util.Printer {
    ctor public PrintStreamPrinter(java.io.PrintStream);
    method public void println(String);
  }

  public class PrintWriterPrinter implements android.util.Printer {
    ctor public PrintWriterPrinter(java.io.PrintWriter);
    method public void println(String);
  }

  public interface Printer {
    method public void println(String);
  }

  public abstract class Property<T, V> {
    ctor public Property(Class<V>, String);
    method public abstract V get(T);
    method public String getName();
    method public Class<V> getType();
    method public boolean isReadOnly();
    method public static <T, V> android.util.Property<T,V> of(Class<T>, Class<V>, String);
    method public void set(T, V);
  }

  public final class Range<T extends java.lang.Comparable<? super T>> {
    ctor public Range(T, T);
    method public T clamp(T);
    method public boolean contains(T);
    method public boolean contains(android.util.Range<T>);
    method public static <T extends java.lang.Comparable<? super T>> android.util.Range<T> create(T, T);
    method public android.util.Range<T> extend(android.util.Range<T>);
    method public android.util.Range<T> extend(T, T);
    method public android.util.Range<T> extend(T);
    method public T getLower();
    method public T getUpper();
    method public android.util.Range<T> intersect(android.util.Range<T>);
    method public android.util.Range<T> intersect(T, T);
  }

  public final class Rational extends java.lang.Number implements java.lang.Comparable<android.util.Rational> {
    ctor public Rational(int, int);
    method public int compareTo(android.util.Rational);
    method public double doubleValue();
    method public float floatValue();
    method public int getDenominator();
    method public int getNumerator();
    method public int intValue();
    method public boolean isFinite();
    method public boolean isInfinite();
    method public boolean isNaN();
    method public boolean isZero();
    method public long longValue();
    method public static android.util.Rational parseRational(String) throws java.lang.NumberFormatException;
    field public static final android.util.Rational NEGATIVE_INFINITY;
    field public static final android.util.Rational NaN;
    field public static final android.util.Rational POSITIVE_INFINITY;
    field public static final android.util.Rational ZERO;
  }

  public final class Size {
    ctor public Size(int, int);
    method public int getHeight();
    method public int getWidth();
    method public static android.util.Size parseSize(String) throws java.lang.NumberFormatException;
  }

  public final class SizeF {
    ctor public SizeF(float, float);
    method public float getHeight();
    method public float getWidth();
    method public static android.util.SizeF parseSizeF(String) throws java.lang.NumberFormatException;
  }

  public class SparseArray<E> implements java.lang.Cloneable {
    ctor public SparseArray();
    ctor public SparseArray(int);
    method public void append(int, E);
    method public void clear();
    method public android.util.SparseArray<E> clone();
    method public void delete(int);
    method public E get(int);
    method public E get(int, E);
    method public int indexOfKey(int);
    method public int indexOfValue(E);
    method public int keyAt(int);
    method public void put(int, E);
    method public void remove(int);
    method public void removeAt(int);
    method public void removeAtRange(int, int);
    method public void setValueAt(int, E);
    method public int size();
    method public E valueAt(int);
  }

  public class SparseBooleanArray implements java.lang.Cloneable {
    ctor public SparseBooleanArray();
    ctor public SparseBooleanArray(int);
    method public void append(int, boolean);
    method public void clear();
    method public android.util.SparseBooleanArray clone();
    method public void delete(int);
    method public boolean get(int);
    method public boolean get(int, boolean);
    method public int indexOfKey(int);
    method public int indexOfValue(boolean);
    method public int keyAt(int);
    method public void put(int, boolean);
    method public void removeAt(int);
    method public int size();
    method public boolean valueAt(int);
  }

  public class SparseIntArray implements java.lang.Cloneable {
    ctor public SparseIntArray();
    ctor public SparseIntArray(int);
    method public void append(int, int);
    method public void clear();
    method public android.util.SparseIntArray clone();
    method public void delete(int);
    method public int get(int);
    method public int get(int, int);
    method public int indexOfKey(int);
    method public int indexOfValue(int);
    method public int keyAt(int);
    method public void put(int, int);
    method public void removeAt(int);
    method public int size();
    method public int valueAt(int);
  }

  public class SparseLongArray implements java.lang.Cloneable {
    ctor public SparseLongArray();
    ctor public SparseLongArray(int);
    method public void append(int, long);
    method public void clear();
    method public android.util.SparseLongArray clone();
    method public void delete(int);
    method public long get(int);
    method public long get(int, long);
    method public int indexOfKey(int);
    method public int indexOfValue(long);
    method public int keyAt(int);
    method public void put(int, long);
    method public void removeAt(int);
    method public int size();
    method public long valueAt(int);
  }

  public class StateSet {
    method public static String dump(int[]);
    method public static boolean isWildCard(int[]);
    method public static boolean stateSetMatches(int[], int[]);
    method public static boolean stateSetMatches(int[], int);
    method public static int[] trimStateSet(int[], int);
    field public static final int[] NOTHING;
    field public static final int[] WILD_CARD;
  }

  public final class StatsLog {
    method public static boolean logEvent(int);
    method public static boolean logStart(int);
    method public static boolean logStop(int);
  }

  public class StringBuilderPrinter implements android.util.Printer {
    ctor public StringBuilderPrinter(StringBuilder);
    method public void println(String);
  }

  public class TimeFormatException extends java.lang.RuntimeException {
  }

  public class TimeUtils {
    method public static java.util.TimeZone getTimeZone(int, boolean, long, String);
    method public static String getTimeZoneDatabaseVersion();
    method @Nullable public static java.util.List<java.lang.String> getTimeZoneIdsForCountryCode(@NonNull String);
  }

  public class TimingLogger {
    ctor public TimingLogger(String, String);
    method public void addSplit(String);
    method public void dumpToLog();
    method public void reset(String, String);
    method public void reset();
  }

  public class TypedValue {
    ctor public TypedValue();
    method public static float applyDimension(int, float, android.util.DisplayMetrics);
    method public final CharSequence coerceToString();
    method public static final String coerceToString(int, int);
    method public static float complexToDimension(int, android.util.DisplayMetrics);
    method public static int complexToDimensionPixelOffset(int, android.util.DisplayMetrics);
    method public static int complexToDimensionPixelSize(int, android.util.DisplayMetrics);
    method public static float complexToFloat(int);
    method public static float complexToFraction(int, float, float);
    method public int getComplexUnit();
    method public float getDimension(android.util.DisplayMetrics);
    method public final float getFloat();
    method public float getFraction(float, float);
    method public void setTo(android.util.TypedValue);
    field public static final int COMPLEX_MANTISSA_MASK = 16777215; // 0xffffff
    field public static final int COMPLEX_MANTISSA_SHIFT = 8; // 0x8
    field public static final int COMPLEX_RADIX_0p23 = 3; // 0x3
    field public static final int COMPLEX_RADIX_16p7 = 1; // 0x1
    field public static final int COMPLEX_RADIX_23p0 = 0; // 0x0
    field public static final int COMPLEX_RADIX_8p15 = 2; // 0x2
    field public static final int COMPLEX_RADIX_MASK = 3; // 0x3
    field public static final int COMPLEX_RADIX_SHIFT = 4; // 0x4
    field public static final int COMPLEX_UNIT_DIP = 1; // 0x1
    field public static final int COMPLEX_UNIT_FRACTION = 0; // 0x0
    field public static final int COMPLEX_UNIT_FRACTION_PARENT = 1; // 0x1
    field public static final int COMPLEX_UNIT_IN = 4; // 0x4
    field public static final int COMPLEX_UNIT_MASK = 15; // 0xf
    field public static final int COMPLEX_UNIT_MM = 5; // 0x5
    field public static final int COMPLEX_UNIT_PT = 3; // 0x3
    field public static final int COMPLEX_UNIT_PX = 0; // 0x0
    field public static final int COMPLEX_UNIT_SHIFT = 0; // 0x0
    field public static final int COMPLEX_UNIT_SP = 2; // 0x2
    field public static final int DATA_NULL_EMPTY = 1; // 0x1
    field public static final int DATA_NULL_UNDEFINED = 0; // 0x0
    field public static final int DENSITY_DEFAULT = 0; // 0x0
    field public static final int DENSITY_NONE = 65535; // 0xffff
    field public static final int TYPE_ATTRIBUTE = 2; // 0x2
    field public static final int TYPE_DIMENSION = 5; // 0x5
    field public static final int TYPE_FIRST_COLOR_INT = 28; // 0x1c
    field public static final int TYPE_FIRST_INT = 16; // 0x10
    field public static final int TYPE_FLOAT = 4; // 0x4
    field public static final int TYPE_FRACTION = 6; // 0x6
    field public static final int TYPE_INT_BOOLEAN = 18; // 0x12
    field public static final int TYPE_INT_COLOR_ARGB4 = 30; // 0x1e
    field public static final int TYPE_INT_COLOR_ARGB8 = 28; // 0x1c
    field public static final int TYPE_INT_COLOR_RGB4 = 31; // 0x1f
    field public static final int TYPE_INT_COLOR_RGB8 = 29; // 0x1d
    field public static final int TYPE_INT_DEC = 16; // 0x10
    field public static final int TYPE_INT_HEX = 17; // 0x11
    field public static final int TYPE_LAST_COLOR_INT = 31; // 0x1f
    field public static final int TYPE_LAST_INT = 31; // 0x1f
    field public static final int TYPE_NULL = 0; // 0x0
    field public static final int TYPE_REFERENCE = 1; // 0x1
    field public static final int TYPE_STRING = 3; // 0x3
    field public int assetCookie;
    field public int changingConfigurations;
    field public int data;
    field public int density;
    field @AnyRes public int resourceId;
    field public CharSequence string;
    field public int type;
  }

  public class Xml {
    method public static android.util.AttributeSet asAttributeSet(org.xmlpull.v1.XmlPullParser);
    method public static android.util.Xml.Encoding findEncodingByName(String) throws java.io.UnsupportedEncodingException;
    method public static org.xmlpull.v1.XmlPullParser newPullParser();
    method public static org.xmlpull.v1.XmlSerializer newSerializer();
    method public static void parse(String, org.xml.sax.ContentHandler) throws org.xml.sax.SAXException;
    method public static void parse(java.io.Reader, org.xml.sax.ContentHandler) throws java.io.IOException, org.xml.sax.SAXException;
    method public static void parse(java.io.InputStream, android.util.Xml.Encoding, org.xml.sax.ContentHandler) throws java.io.IOException, org.xml.sax.SAXException;
    field public static String FEATURE_RELAXED;
  }

  public enum Xml.Encoding {
    enum_constant public static final android.util.Xml.Encoding ISO_8859_1;
    enum_constant public static final android.util.Xml.Encoding US_ASCII;
    enum_constant public static final android.util.Xml.Encoding UTF_16;
    enum_constant public static final android.util.Xml.Encoding UTF_8;
  }

}

package android.view {

  public abstract class AbsSavedState implements android.os.Parcelable {
    ctor protected AbsSavedState(android.os.Parcelable);
    ctor protected AbsSavedState(android.os.Parcel);
    ctor protected AbsSavedState(android.os.Parcel, ClassLoader);
    method public int describeContents();
    method public final android.os.Parcelable getSuperState();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.AbsSavedState> CREATOR;
    field public static final android.view.AbsSavedState EMPTY_STATE;
  }

  public abstract class ActionMode {
    ctor public ActionMode();
    method public abstract void finish();
    method public abstract android.view.View getCustomView();
    method public abstract android.view.Menu getMenu();
    method public abstract android.view.MenuInflater getMenuInflater();
    method public abstract CharSequence getSubtitle();
    method public Object getTag();
    method public abstract CharSequence getTitle();
    method public boolean getTitleOptionalHint();
    method public int getType();
    method public void hide(long);
    method public abstract void invalidate();
    method public void invalidateContentRect();
    method public boolean isTitleOptional();
    method public void onWindowFocusChanged(boolean);
    method public abstract void setCustomView(android.view.View);
    method public abstract void setSubtitle(CharSequence);
    method public abstract void setSubtitle(@StringRes int);
    method public void setTag(Object);
    method public abstract void setTitle(CharSequence);
    method public abstract void setTitle(@StringRes int);
    method public void setTitleOptionalHint(boolean);
    method public void setType(int);
    field public static final int DEFAULT_HIDE_DURATION = -1; // 0xffffffff
    field public static final int TYPE_FLOATING = 1; // 0x1
    field public static final int TYPE_PRIMARY = 0; // 0x0
  }

  public static interface ActionMode.Callback {
    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 abstract static class ActionMode.Callback2 implements android.view.ActionMode.Callback {
    ctor public ActionMode.Callback2();
    method public void onGetContentRect(android.view.ActionMode, android.view.View, android.graphics.Rect);
  }

  public abstract class ActionProvider {
    ctor public ActionProvider(android.content.Context);
    method public boolean hasSubMenu();
    method public boolean isVisible();
    method @Deprecated public abstract android.view.View onCreateActionView();
    method public android.view.View onCreateActionView(android.view.MenuItem);
    method public boolean onPerformDefaultAction();
    method public void onPrepareSubMenu(android.view.SubMenu);
    method public boolean overridesItemVisibility();
    method public void refreshVisibility();
    method public void setVisibilityListener(android.view.ActionProvider.VisibilityListener);
  }

  public static interface ActionProvider.VisibilityListener {
    method public void onActionProviderVisibilityChanged(boolean);
  }

  public final class Choreographer {
    method public static android.view.Choreographer getInstance();
    method public void postFrameCallback(android.view.Choreographer.FrameCallback);
    method public void postFrameCallbackDelayed(android.view.Choreographer.FrameCallback, long);
    method public void removeFrameCallback(android.view.Choreographer.FrameCallback);
  }

  public static interface Choreographer.FrameCallback {
    method public void doFrame(long);
  }

  public interface CollapsibleActionView {
    method public void onActionViewCollapsed();
    method public void onActionViewExpanded();
  }

  public interface ContextMenu extends android.view.Menu {
    method public void clearHeader();
    method public android.view.ContextMenu setHeaderIcon(@DrawableRes int);
    method public android.view.ContextMenu setHeaderIcon(android.graphics.drawable.Drawable);
    method public android.view.ContextMenu setHeaderTitle(@StringRes int);
    method public android.view.ContextMenu setHeaderTitle(CharSequence);
    method public android.view.ContextMenu setHeaderView(android.view.View);
  }

  public static interface ContextMenu.ContextMenuInfo {
  }

  public class ContextThemeWrapper extends android.content.ContextWrapper {
    ctor public ContextThemeWrapper();
    ctor public ContextThemeWrapper(android.content.Context, @StyleRes int);
    ctor public ContextThemeWrapper(android.content.Context, android.content.res.Resources.Theme);
    method public void applyOverrideConfiguration(android.content.res.Configuration);
    method protected void onApplyThemeResource(android.content.res.Resources.Theme, int, boolean);
  }

  public final class Display {
    method public long getAppVsyncOffsetNanos();
    method public void getCurrentSizeRange(android.graphics.Point, android.graphics.Point);
    method public int getDisplayId();
    method public int getFlags();
    method public android.view.Display.HdrCapabilities getHdrCapabilities();
    method @Deprecated public int getHeight();
    method public void getMetrics(android.util.DisplayMetrics);
    method public android.view.Display.Mode getMode();
    method public String getName();
    method @Deprecated public int getOrientation();
    method @Deprecated public int getPixelFormat();
    method public long getPresentationDeadlineNanos();
    method public void getRealMetrics(android.util.DisplayMetrics);
    method public void getRealSize(android.graphics.Point);
    method public void getRectSize(android.graphics.Rect);
    method public float getRefreshRate();
    method public int getRotation();
    method public void getSize(android.graphics.Point);
    method public int getState();
    method public android.view.Display.Mode[] getSupportedModes();
    method @Deprecated public float[] getSupportedRefreshRates();
    method @Deprecated public int getWidth();
    method public boolean isHdr();
    method public boolean isValid();
    method public boolean isWideColorGamut();
    field public static final int DEFAULT_DISPLAY = 0; // 0x0
    field public static final int FLAG_PRESENTATION = 8; // 0x8
    field public static final int FLAG_PRIVATE = 4; // 0x4
    field public static final int FLAG_ROUND = 16; // 0x10
    field public static final int FLAG_SECURE = 2; // 0x2
    field public static final int FLAG_SUPPORTS_PROTECTED_BUFFERS = 1; // 0x1
    field public static final int INVALID_DISPLAY = -1; // 0xffffffff
    field public static final int STATE_DOZE = 3; // 0x3
    field public static final int STATE_DOZE_SUSPEND = 4; // 0x4
    field public static final int STATE_OFF = 1; // 0x1
    field public static final int STATE_ON = 2; // 0x2
    field public static final int STATE_ON_SUSPEND = 6; // 0x6
    field public static final int STATE_UNKNOWN = 0; // 0x0
    field public static final int STATE_VR = 5; // 0x5
  }

  public static final class Display.HdrCapabilities implements android.os.Parcelable {
    method public int describeContents();
    method public float getDesiredMaxAverageLuminance();
    method public float getDesiredMaxLuminance();
    method public float getDesiredMinLuminance();
    method public int[] getSupportedHdrTypes();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.Display.HdrCapabilities> CREATOR;
    field public static final int HDR_TYPE_DOLBY_VISION = 1; // 0x1
    field public static final int HDR_TYPE_HDR10 = 2; // 0x2
    field public static final int HDR_TYPE_HLG = 3; // 0x3
    field public static final float INVALID_LUMINANCE = -1.0f;
  }

  public static final class Display.Mode implements android.os.Parcelable {
    method public int describeContents();
    method public int getModeId();
    method public int getPhysicalHeight();
    method public int getPhysicalWidth();
    method public float getRefreshRate();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.Display.Mode> CREATOR;
  }

  public final class DisplayCutout {
    ctor public DisplayCutout(android.graphics.Rect, java.util.List<android.graphics.Rect>);
    method public java.util.List<android.graphics.Rect> getBoundingRects();
    method public int getSafeInsetBottom();
    method public int getSafeInsetLeft();
    method public int getSafeInsetRight();
    method public int getSafeInsetTop();
  }

  public final class DragAndDropPermissions implements android.os.Parcelable {
    method public int describeContents();
    method public void release();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.DragAndDropPermissions> CREATOR;
  }

  public class DragEvent implements android.os.Parcelable {
    method public int describeContents();
    method public int getAction();
    method public android.content.ClipData getClipData();
    method public android.content.ClipDescription getClipDescription();
    method public Object getLocalState();
    method public boolean getResult();
    method public float getX();
    method public float getY();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ACTION_DRAG_ENDED = 4; // 0x4
    field public static final int ACTION_DRAG_ENTERED = 5; // 0x5
    field public static final int ACTION_DRAG_EXITED = 6; // 0x6
    field public static final int ACTION_DRAG_LOCATION = 2; // 0x2
    field public static final int ACTION_DRAG_STARTED = 1; // 0x1
    field public static final int ACTION_DROP = 3; // 0x3
    field public static final android.os.Parcelable.Creator<android.view.DragEvent> CREATOR;
  }

  public class FocusFinder {
    method public android.view.View findNearestTouchable(android.view.ViewGroup, int, int, int, int[]);
    method public final android.view.View findNextFocus(android.view.ViewGroup, android.view.View, int);
    method public android.view.View findNextFocusFromRect(android.view.ViewGroup, android.graphics.Rect, int);
    method public android.view.View findNextKeyboardNavigationCluster(@NonNull android.view.View, @Nullable android.view.View, int);
    method public static android.view.FocusFinder getInstance();
  }

  public final class FrameMetrics {
    ctor public FrameMetrics(android.view.FrameMetrics);
    method public long getMetric(int);
    field public static final int ANIMATION_DURATION = 2; // 0x2
    field public static final int COMMAND_ISSUE_DURATION = 6; // 0x6
    field public static final int DRAW_DURATION = 4; // 0x4
    field public static final int FIRST_DRAW_FRAME = 9; // 0x9
    field public static final int INPUT_HANDLING_DURATION = 1; // 0x1
    field public static final int INTENDED_VSYNC_TIMESTAMP = 10; // 0xa
    field public static final int LAYOUT_MEASURE_DURATION = 3; // 0x3
    field public static final int SWAP_BUFFERS_DURATION = 7; // 0x7
    field public static final int SYNC_DURATION = 5; // 0x5
    field public static final int TOTAL_DURATION = 8; // 0x8
    field public static final int UNKNOWN_DELAY_DURATION = 0; // 0x0
    field public static final int VSYNC_TIMESTAMP = 11; // 0xb
  }

  public abstract class FrameStats {
    ctor public FrameStats();
    method public final long getEndTimeNano();
    method public final int getFrameCount();
    method public final long getFramePresentedTimeNano(int);
    method public final long getRefreshPeriodNano();
    method public final long getStartTimeNano();
    field public static final long UNDEFINED_TIME_NANO = -1L; // 0xffffffffffffffffL
  }

  public class GestureDetector {
    ctor @Deprecated public GestureDetector(android.view.GestureDetector.OnGestureListener, android.os.Handler);
    ctor @Deprecated public GestureDetector(android.view.GestureDetector.OnGestureListener);
    ctor public GestureDetector(android.content.Context, android.view.GestureDetector.OnGestureListener);
    ctor public GestureDetector(android.content.Context, android.view.GestureDetector.OnGestureListener, android.os.Handler);
    ctor public GestureDetector(android.content.Context, android.view.GestureDetector.OnGestureListener, android.os.Handler, boolean);
    method public boolean isLongpressEnabled();
    method public boolean onGenericMotionEvent(android.view.MotionEvent);
    method public boolean onTouchEvent(android.view.MotionEvent);
    method public void setContextClickListener(android.view.GestureDetector.OnContextClickListener);
    method public void setIsLongpressEnabled(boolean);
    method public void setOnDoubleTapListener(android.view.GestureDetector.OnDoubleTapListener);
  }

  public static interface GestureDetector.OnContextClickListener {
    method public boolean onContextClick(android.view.MotionEvent);
  }

  public static interface GestureDetector.OnDoubleTapListener {
    method public boolean onDoubleTap(android.view.MotionEvent);
    method public boolean onDoubleTapEvent(android.view.MotionEvent);
    method public boolean onSingleTapConfirmed(android.view.MotionEvent);
  }

  public static interface GestureDetector.OnGestureListener {
    method public boolean onDown(android.view.MotionEvent);
    method public boolean onFling(android.view.MotionEvent, android.view.MotionEvent, float, float);
    method public void onLongPress(android.view.MotionEvent);
    method public boolean onScroll(android.view.MotionEvent, android.view.MotionEvent, float, float);
    method public void onShowPress(android.view.MotionEvent);
    method public boolean onSingleTapUp(android.view.MotionEvent);
  }

  public static class GestureDetector.SimpleOnGestureListener implements android.view.GestureDetector.OnContextClickListener android.view.GestureDetector.OnDoubleTapListener android.view.GestureDetector.OnGestureListener {
    ctor public GestureDetector.SimpleOnGestureListener();
    method public boolean onContextClick(android.view.MotionEvent);
    method public boolean onDoubleTap(android.view.MotionEvent);
    method public boolean onDoubleTapEvent(android.view.MotionEvent);
    method public boolean onDown(android.view.MotionEvent);
    method public boolean onFling(android.view.MotionEvent, android.view.MotionEvent, float, float);
    method public void onLongPress(android.view.MotionEvent);
    method public boolean onScroll(android.view.MotionEvent, android.view.MotionEvent, float, float);
    method public void onShowPress(android.view.MotionEvent);
    method public boolean onSingleTapConfirmed(android.view.MotionEvent);
    method public boolean onSingleTapUp(android.view.MotionEvent);
  }

  public class Gravity {
    ctor public Gravity();
    method public static void apply(int, int, int, android.graphics.Rect, android.graphics.Rect);
    method public static void apply(int, int, int, android.graphics.Rect, android.graphics.Rect, int);
    method public static void apply(int, int, int, android.graphics.Rect, int, int, android.graphics.Rect);
    method public static void apply(int, int, int, android.graphics.Rect, int, int, android.graphics.Rect, int);
    method public static void applyDisplay(int, android.graphics.Rect, android.graphics.Rect);
    method public static void applyDisplay(int, android.graphics.Rect, android.graphics.Rect, int);
    method public static int getAbsoluteGravity(int, int);
    method public static boolean isHorizontal(int);
    method public static boolean isVertical(int);
    field public static final int AXIS_CLIP = 8; // 0x8
    field public static final int AXIS_PULL_AFTER = 4; // 0x4
    field public static final int AXIS_PULL_BEFORE = 2; // 0x2
    field public static final int AXIS_SPECIFIED = 1; // 0x1
    field public static final int AXIS_X_SHIFT = 0; // 0x0
    field public static final int AXIS_Y_SHIFT = 4; // 0x4
    field public static final int BOTTOM = 80; // 0x50
    field public static final int CENTER = 17; // 0x11
    field public static final int CENTER_HORIZONTAL = 1; // 0x1
    field public static final int CENTER_VERTICAL = 16; // 0x10
    field public static final int CLIP_HORIZONTAL = 8; // 0x8
    field public static final int CLIP_VERTICAL = 128; // 0x80
    field public static final int DISPLAY_CLIP_HORIZONTAL = 16777216; // 0x1000000
    field public static final int DISPLAY_CLIP_VERTICAL = 268435456; // 0x10000000
    field public static final int END = 8388613; // 0x800005
    field public static final int FILL = 119; // 0x77
    field public static final int FILL_HORIZONTAL = 7; // 0x7
    field public static final int FILL_VERTICAL = 112; // 0x70
    field public static final int HORIZONTAL_GRAVITY_MASK = 7; // 0x7
    field public static final int LEFT = 3; // 0x3
    field public static final int NO_GRAVITY = 0; // 0x0
    field public static final int RELATIVE_HORIZONTAL_GRAVITY_MASK = 8388615; // 0x800007
    field public static final int RELATIVE_LAYOUT_DIRECTION = 8388608; // 0x800000
    field public static final int RIGHT = 5; // 0x5
    field public static final int START = 8388611; // 0x800003
    field public static final int TOP = 48; // 0x30
    field public static final int VERTICAL_GRAVITY_MASK = 112; // 0x70
  }

  public class HapticFeedbackConstants {
    field public static final int CLOCK_TICK = 4; // 0x4
    field public static final int CONTEXT_CLICK = 6; // 0x6
    field public static final int FLAG_IGNORE_GLOBAL_SETTING = 2; // 0x2
    field public static final int FLAG_IGNORE_VIEW_SETTING = 1; // 0x1
    field public static final int KEYBOARD_PRESS = 3; // 0x3
    field public static final int KEYBOARD_RELEASE = 7; // 0x7
    field public static final int KEYBOARD_TAP = 3; // 0x3
    field public static final int LONG_PRESS = 0; // 0x0
    field public static final int TEXT_HANDLE_MOVE = 9; // 0x9
    field public static final int VIRTUAL_KEY = 1; // 0x1
    field public static final int VIRTUAL_KEY_RELEASE = 8; // 0x8
  }

  public class InflateException extends java.lang.RuntimeException {
    ctor public InflateException();
    ctor public InflateException(String, Throwable);
    ctor public InflateException(String);
    ctor public InflateException(Throwable);
  }

  public final class InputDevice implements android.os.Parcelable {
    method public int describeContents();
    method public int getControllerNumber();
    method public String getDescriptor();
    method public static android.view.InputDevice getDevice(int);
    method public static int[] getDeviceIds();
    method public int getId();
    method public android.view.KeyCharacterMap getKeyCharacterMap();
    method public int getKeyboardType();
    method public android.view.InputDevice.MotionRange getMotionRange(int);
    method public android.view.InputDevice.MotionRange getMotionRange(int, int);
    method public java.util.List<android.view.InputDevice.MotionRange> getMotionRanges();
    method public String getName();
    method public int getProductId();
    method public int getSources();
    method public int getVendorId();
    method public android.os.Vibrator getVibrator();
    method public boolean[] hasKeys(int...);
    method public boolean hasMicrophone();
    method public boolean isEnabled();
    method public boolean isVirtual();
    method public boolean supportsSource(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.InputDevice> CREATOR;
    field public static final int KEYBOARD_TYPE_ALPHABETIC = 2; // 0x2
    field public static final int KEYBOARD_TYPE_NONE = 0; // 0x0
    field public static final int KEYBOARD_TYPE_NON_ALPHABETIC = 1; // 0x1
    field @Deprecated public static final int MOTION_RANGE_ORIENTATION = 8; // 0x8
    field @Deprecated public static final int MOTION_RANGE_PRESSURE = 2; // 0x2
    field @Deprecated public static final int MOTION_RANGE_SIZE = 3; // 0x3
    field @Deprecated public static final int MOTION_RANGE_TOOL_MAJOR = 6; // 0x6
    field @Deprecated public static final int MOTION_RANGE_TOOL_MINOR = 7; // 0x7
    field @Deprecated public static final int MOTION_RANGE_TOUCH_MAJOR = 4; // 0x4
    field @Deprecated public static final int MOTION_RANGE_TOUCH_MINOR = 5; // 0x5
    field @Deprecated public static final int MOTION_RANGE_X = 0; // 0x0
    field @Deprecated public static final int MOTION_RANGE_Y = 1; // 0x1
    field public static final int SOURCE_ANY = -256; // 0xffffff00
    field public static final int SOURCE_BLUETOOTH_STYLUS = 49154; // 0xc002
    field public static final int SOURCE_CLASS_BUTTON = 1; // 0x1
    field public static final int SOURCE_CLASS_JOYSTICK = 16; // 0x10
    field public static final int SOURCE_CLASS_MASK = 255; // 0xff
    field public static final int SOURCE_CLASS_NONE = 0; // 0x0
    field public static final int SOURCE_CLASS_POINTER = 2; // 0x2
    field public static final int SOURCE_CLASS_POSITION = 8; // 0x8
    field public static final int SOURCE_CLASS_TRACKBALL = 4; // 0x4
    field public static final int SOURCE_DPAD = 513; // 0x201
    field public static final int SOURCE_GAMEPAD = 1025; // 0x401
    field public static final int SOURCE_HDMI = 33554433; // 0x2000001
    field public static final int SOURCE_JOYSTICK = 16777232; // 0x1000010
    field public static final int SOURCE_KEYBOARD = 257; // 0x101
    field public static final int SOURCE_MOUSE = 8194; // 0x2002
    field public static final int SOURCE_MOUSE_RELATIVE = 131076; // 0x20004
    field public static final int SOURCE_ROTARY_ENCODER = 4194304; // 0x400000
    field public static final int SOURCE_STYLUS = 16386; // 0x4002
    field public static final int SOURCE_TOUCHPAD = 1048584; // 0x100008
    field public static final int SOURCE_TOUCHSCREEN = 4098; // 0x1002
    field public static final int SOURCE_TOUCH_NAVIGATION = 2097152; // 0x200000
    field public static final int SOURCE_TRACKBALL = 65540; // 0x10004
    field public static final int SOURCE_UNKNOWN = 0; // 0x0
  }

  public static final class InputDevice.MotionRange {
    method public int getAxis();
    method public float getFlat();
    method public float getFuzz();
    method public float getMax();
    method public float getMin();
    method public float getRange();
    method public float getResolution();
    method public int getSource();
    method public boolean isFromSource(int);
  }

  public abstract class InputEvent implements android.os.Parcelable {
    method public int describeContents();
    method public final android.view.InputDevice getDevice();
    method public abstract int getDeviceId();
    method public abstract long getEventTime();
    method public abstract int getSource();
    method public boolean isFromSource(int);
    field public static final android.os.Parcelable.Creator<android.view.InputEvent> CREATOR;
  }

  public final class InputQueue {
  }

  public static interface InputQueue.Callback {
    method public void onInputQueueCreated(android.view.InputQueue);
    method public void onInputQueueDestroyed(android.view.InputQueue);
  }

  public class KeyCharacterMap implements android.os.Parcelable {
    method public int describeContents();
    method public static boolean deviceHasKey(int);
    method public static boolean[] deviceHasKeys(int[]);
    method public int get(int, int);
    method public static int getDeadChar(int, int);
    method public char getDisplayLabel(int);
    method public android.view.KeyEvent[] getEvents(char[]);
    method @Deprecated public boolean getKeyData(int, android.view.KeyCharacterMap.KeyData);
    method public int getKeyboardType();
    method public char getMatch(int, char[]);
    method public char getMatch(int, char[], int);
    method public int getModifierBehavior();
    method public char getNumber(int);
    method public boolean isPrintingKey(int);
    method public static android.view.KeyCharacterMap load(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ALPHA = 3; // 0x3
    field @Deprecated public static final int BUILT_IN_KEYBOARD = 0; // 0x0
    field public static final int COMBINING_ACCENT = -2147483648; // 0x80000000
    field public static final int COMBINING_ACCENT_MASK = 2147483647; // 0x7fffffff
    field public static final android.os.Parcelable.Creator<android.view.KeyCharacterMap> CREATOR;
    field public static final int FULL = 4; // 0x4
    field public static final char HEX_INPUT = 61184; // 0xef00 '\uef00'
    field public static final int MODIFIER_BEHAVIOR_CHORDED = 0; // 0x0
    field public static final int MODIFIER_BEHAVIOR_CHORDED_OR_TOGGLED = 1; // 0x1
    field public static final int NUMERIC = 1; // 0x1
    field public static final char PICKER_DIALOG_INPUT = 61185; // 0xef01 '\uef01'
    field public static final int PREDICTIVE = 2; // 0x2
    field public static final int SPECIAL_FUNCTION = 5; // 0x5
    field public static final int VIRTUAL_KEYBOARD = -1; // 0xffffffff
  }

  @Deprecated public static class KeyCharacterMap.KeyData {
    ctor @Deprecated public KeyCharacterMap.KeyData();
    field @Deprecated public static final int META_LENGTH = 4; // 0x4
    field @Deprecated public char displayLabel;
    field @Deprecated public char[] meta;
    field @Deprecated public char number;
  }

  public static class KeyCharacterMap.UnavailableException extends android.util.AndroidRuntimeException {
    ctor public KeyCharacterMap.UnavailableException(String);
  }

  public class KeyEvent extends android.view.InputEvent implements android.os.Parcelable {
    ctor public KeyEvent(int, int);
    ctor public KeyEvent(long, long, int, int, int);
    ctor public KeyEvent(long, long, int, int, int, int);
    ctor public KeyEvent(long, long, int, int, int, int, int, int);
    ctor public KeyEvent(long, long, int, int, int, int, int, int, int);
    ctor public KeyEvent(long, long, int, int, int, int, int, int, int, int);
    ctor public KeyEvent(long, String, int, int);
    ctor public KeyEvent(android.view.KeyEvent);
    ctor @Deprecated public KeyEvent(android.view.KeyEvent, long, int);
    method public static android.view.KeyEvent changeAction(android.view.KeyEvent, int);
    method public static android.view.KeyEvent changeFlags(android.view.KeyEvent, int);
    method public static android.view.KeyEvent changeTimeRepeat(android.view.KeyEvent, long, int);
    method public static android.view.KeyEvent changeTimeRepeat(android.view.KeyEvent, long, int, int);
    method @Deprecated public final boolean dispatch(android.view.KeyEvent.Callback);
    method public final boolean dispatch(android.view.KeyEvent.Callback, android.view.KeyEvent.DispatcherState, Object);
    method public final int getAction();
    method public final String getCharacters();
    method public static int getDeadChar(int, int);
    method public final int getDeviceId();
    method public char getDisplayLabel();
    method public final long getDownTime();
    method public final long getEventTime();
    method public final int getFlags();
    method public final android.view.KeyCharacterMap getKeyCharacterMap();
    method public final int getKeyCode();
    method @Deprecated public boolean getKeyData(android.view.KeyCharacterMap.KeyData);
    method public char getMatch(char[]);
    method public char getMatch(char[], int);
    method public static int getMaxKeyCode();
    method public final int getMetaState();
    method public static int getModifierMetaStateMask();
    method public final int getModifiers();
    method public char getNumber();
    method public final int getRepeatCount();
    method public final int getScanCode();
    method public final int getSource();
    method public int getUnicodeChar();
    method public int getUnicodeChar(int);
    method public final boolean hasModifiers(int);
    method public final boolean hasNoModifiers();
    method public final boolean isAltPressed();
    method public final boolean isCanceled();
    method public final boolean isCapsLockOn();
    method public final boolean isCtrlPressed();
    method public final boolean isFunctionPressed();
    method public static final boolean isGamepadButton(int);
    method public final boolean isLongPress();
    method public final boolean isMetaPressed();
    method public static boolean isModifierKey(int);
    method public final boolean isNumLockOn();
    method public boolean isPrintingKey();
    method public final boolean isScrollLockOn();
    method public final boolean isShiftPressed();
    method public final boolean isSymPressed();
    method public final boolean isSystem();
    method public final boolean isTracking();
    method public static int keyCodeFromString(String);
    method public static String keyCodeToString(int);
    method public static boolean metaStateHasModifiers(int, int);
    method public static boolean metaStateHasNoModifiers(int);
    method public static int normalizeMetaState(int);
    method public final void setSource(int);
    method public final void startTracking();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ACTION_DOWN = 0; // 0x0
    field public static final int ACTION_MULTIPLE = 2; // 0x2
    field public static final int ACTION_UP = 1; // 0x1
    field public static final android.os.Parcelable.Creator<android.view.KeyEvent> CREATOR;
    field public static final int FLAG_CANCELED = 32; // 0x20
    field public static final int FLAG_CANCELED_LONG_PRESS = 256; // 0x100
    field public static final int FLAG_EDITOR_ACTION = 16; // 0x10
    field public static final int FLAG_FALLBACK = 1024; // 0x400
    field public static final int FLAG_FROM_SYSTEM = 8; // 0x8
    field public static final int FLAG_KEEP_TOUCH_MODE = 4; // 0x4
    field public static final int FLAG_LONG_PRESS = 128; // 0x80
    field public static final int FLAG_SOFT_KEYBOARD = 2; // 0x2
    field public static final int FLAG_TRACKING = 512; // 0x200
    field public static final int FLAG_VIRTUAL_HARD_KEY = 64; // 0x40
    field @Deprecated public static final int FLAG_WOKE_HERE = 1; // 0x1
    field public static final int KEYCODE_0 = 7; // 0x7
    field public static final int KEYCODE_1 = 8; // 0x8
    field public static final int KEYCODE_11 = 227; // 0xe3
    field public static final int KEYCODE_12 = 228; // 0xe4
    field public static final int KEYCODE_2 = 9; // 0x9
    field public static final int KEYCODE_3 = 10; // 0xa
    field public static final int KEYCODE_3D_MODE = 206; // 0xce
    field public static final int KEYCODE_4 = 11; // 0xb
    field public static final int KEYCODE_5 = 12; // 0xc
    field public static final int KEYCODE_6 = 13; // 0xd
    field public static final int KEYCODE_7 = 14; // 0xe
    field public static final int KEYCODE_8 = 15; // 0xf
    field public static final int KEYCODE_9 = 16; // 0x10
    field public static final int KEYCODE_A = 29; // 0x1d
    field public static final int KEYCODE_ALL_APPS = 284; // 0x11c
    field public static final int KEYCODE_ALT_LEFT = 57; // 0x39
    field public static final int KEYCODE_ALT_RIGHT = 58; // 0x3a
    field public static final int KEYCODE_APOSTROPHE = 75; // 0x4b
    field public static final int KEYCODE_APP_SWITCH = 187; // 0xbb
    field public static final int KEYCODE_ASSIST = 219; // 0xdb
    field public static final int KEYCODE_AT = 77; // 0x4d
    field public static final int KEYCODE_AVR_INPUT = 182; // 0xb6
    field public static final int KEYCODE_AVR_POWER = 181; // 0xb5
    field public static final int KEYCODE_B = 30; // 0x1e
    field public static final int KEYCODE_BACK = 4; // 0x4
    field public static final int KEYCODE_BACKSLASH = 73; // 0x49
    field public static final int KEYCODE_BOOKMARK = 174; // 0xae
    field public static final int KEYCODE_BREAK = 121; // 0x79
    field public static final int KEYCODE_BRIGHTNESS_DOWN = 220; // 0xdc
    field public static final int KEYCODE_BRIGHTNESS_UP = 221; // 0xdd
    field public static final int KEYCODE_BUTTON_1 = 188; // 0xbc
    field public static final int KEYCODE_BUTTON_10 = 197; // 0xc5
    field public static final int KEYCODE_BUTTON_11 = 198; // 0xc6
    field public static final int KEYCODE_BUTTON_12 = 199; // 0xc7
    field public static final int KEYCODE_BUTTON_13 = 200; // 0xc8
    field public static final int KEYCODE_BUTTON_14 = 201; // 0xc9
    field public static final int KEYCODE_BUTTON_15 = 202; // 0xca
    field public static final int KEYCODE_BUTTON_16 = 203; // 0xcb
    field public static final int KEYCODE_BUTTON_2 = 189; // 0xbd
    field public static final int KEYCODE_BUTTON_3 = 190; // 0xbe
    field public static final int KEYCODE_BUTTON_4 = 191; // 0xbf
    field public static final int KEYCODE_BUTTON_5 = 192; // 0xc0
    field public static final int KEYCODE_BUTTON_6 = 193; // 0xc1
    field public static final int KEYCODE_BUTTON_7 = 194; // 0xc2
    field public static final int KEYCODE_BUTTON_8 = 195; // 0xc3
    field public static final int KEYCODE_BUTTON_9 = 196; // 0xc4
    field public static final int KEYCODE_BUTTON_A = 96; // 0x60
    field public static final int KEYCODE_BUTTON_B = 97; // 0x61
    field public static final int KEYCODE_BUTTON_C = 98; // 0x62
    field public static final int KEYCODE_BUTTON_L1 = 102; // 0x66
    field public static final int KEYCODE_BUTTON_L2 = 104; // 0x68
    field public static final int KEYCODE_BUTTON_MODE = 110; // 0x6e
    field public static final int KEYCODE_BUTTON_R1 = 103; // 0x67
    field public static final int KEYCODE_BUTTON_R2 = 105; // 0x69
    field public static final int KEYCODE_BUTTON_SELECT = 109; // 0x6d
    field public static final int KEYCODE_BUTTON_START = 108; // 0x6c
    field public static final int KEYCODE_BUTTON_THUMBL = 106; // 0x6a
    field public static final int KEYCODE_BUTTON_THUMBR = 107; // 0x6b
    field public static final int KEYCODE_BUTTON_X = 99; // 0x63
    field public static final int KEYCODE_BUTTON_Y = 100; // 0x64
    field public static final int KEYCODE_BUTTON_Z = 101; // 0x65
    field public static final int KEYCODE_C = 31; // 0x1f
    field public static final int KEYCODE_CALCULATOR = 210; // 0xd2
    field public static final int KEYCODE_CALENDAR = 208; // 0xd0
    field public static final int KEYCODE_CALL = 5; // 0x5
    field public static final int KEYCODE_CAMERA = 27; // 0x1b
    field public static final int KEYCODE_CAPS_LOCK = 115; // 0x73
    field public static final int KEYCODE_CAPTIONS = 175; // 0xaf
    field public static final int KEYCODE_CHANNEL_DOWN = 167; // 0xa7
    field public static final int KEYCODE_CHANNEL_UP = 166; // 0xa6
    field public static final int KEYCODE_CLEAR = 28; // 0x1c
    field public static final int KEYCODE_COMMA = 55; // 0x37
    field public static final int KEYCODE_CONTACTS = 207; // 0xcf
    field public static final int KEYCODE_COPY = 278; // 0x116
    field public static final int KEYCODE_CTRL_LEFT = 113; // 0x71
    field public static final int KEYCODE_CTRL_RIGHT = 114; // 0x72
    field public static final int KEYCODE_CUT = 277; // 0x115
    field public static final int KEYCODE_D = 32; // 0x20
    field public static final int KEYCODE_DEL = 67; // 0x43
    field public static final int KEYCODE_DPAD_CENTER = 23; // 0x17
    field public static final int KEYCODE_DPAD_DOWN = 20; // 0x14
    field public static final int KEYCODE_DPAD_DOWN_LEFT = 269; // 0x10d
    field public static final int KEYCODE_DPAD_DOWN_RIGHT = 271; // 0x10f
    field public static final int KEYCODE_DPAD_LEFT = 21; // 0x15
    field public static final int KEYCODE_DPAD_RIGHT = 22; // 0x16
    field public static final int KEYCODE_DPAD_UP = 19; // 0x13
    field public static final int KEYCODE_DPAD_UP_LEFT = 268; // 0x10c
    field public static final int KEYCODE_DPAD_UP_RIGHT = 270; // 0x10e
    field public static final int KEYCODE_DVR = 173; // 0xad
    field public static final int KEYCODE_E = 33; // 0x21
    field public static final int KEYCODE_EISU = 212; // 0xd4
    field public static final int KEYCODE_ENDCALL = 6; // 0x6
    field public static final int KEYCODE_ENTER = 66; // 0x42
    field public static final int KEYCODE_ENVELOPE = 65; // 0x41
    field public static final int KEYCODE_EQUALS = 70; // 0x46
    field public static final int KEYCODE_ESCAPE = 111; // 0x6f
    field public static final int KEYCODE_EXPLORER = 64; // 0x40
    field public static final int KEYCODE_F = 34; // 0x22
    field public static final int KEYCODE_F1 = 131; // 0x83
    field public static final int KEYCODE_F10 = 140; // 0x8c
    field public static final int KEYCODE_F11 = 141; // 0x8d
    field public static final int KEYCODE_F12 = 142; // 0x8e
    field public static final int KEYCODE_F2 = 132; // 0x84
    field public static final int KEYCODE_F3 = 133; // 0x85
    field public static final int KEYCODE_F4 = 134; // 0x86
    field public static final int KEYCODE_F5 = 135; // 0x87
    field public static final int KEYCODE_F6 = 136; // 0x88
    field public static final int KEYCODE_F7 = 137; // 0x89
    field public static final int KEYCODE_F8 = 138; // 0x8a
    field public static final int KEYCODE_F9 = 139; // 0x8b
    field public static final int KEYCODE_FOCUS = 80; // 0x50
    field public static final int KEYCODE_FORWARD = 125; // 0x7d
    field public static final int KEYCODE_FORWARD_DEL = 112; // 0x70
    field public static final int KEYCODE_FUNCTION = 119; // 0x77
    field public static final int KEYCODE_G = 35; // 0x23
    field public static final int KEYCODE_GRAVE = 68; // 0x44
    field public static final int KEYCODE_GUIDE = 172; // 0xac
    field public static final int KEYCODE_H = 36; // 0x24
    field public static final int KEYCODE_HEADSETHOOK = 79; // 0x4f
    field public static final int KEYCODE_HELP = 259; // 0x103
    field public static final int KEYCODE_HENKAN = 214; // 0xd6
    field public static final int KEYCODE_HOME = 3; // 0x3
    field public static final int KEYCODE_I = 37; // 0x25
    field public static final int KEYCODE_INFO = 165; // 0xa5
    field public static final int KEYCODE_INSERT = 124; // 0x7c
    field public static final int KEYCODE_J = 38; // 0x26
    field public static final int KEYCODE_K = 39; // 0x27
    field public static final int KEYCODE_KANA = 218; // 0xda
    field public static final int KEYCODE_KATAKANA_HIRAGANA = 215; // 0xd7
    field public static final int KEYCODE_L = 40; // 0x28
    field public static final int KEYCODE_LANGUAGE_SWITCH = 204; // 0xcc
    field public static final int KEYCODE_LAST_CHANNEL = 229; // 0xe5
    field public static final int KEYCODE_LEFT_BRACKET = 71; // 0x47
    field public static final int KEYCODE_M = 41; // 0x29
    field public static final int KEYCODE_MANNER_MODE = 205; // 0xcd
    field public static final int KEYCODE_MEDIA_AUDIO_TRACK = 222; // 0xde
    field public static final int KEYCODE_MEDIA_CLOSE = 128; // 0x80
    field public static final int KEYCODE_MEDIA_EJECT = 129; // 0x81
    field public static final int KEYCODE_MEDIA_FAST_FORWARD = 90; // 0x5a
    field public static final int KEYCODE_MEDIA_NEXT = 87; // 0x57
    field public static final int KEYCODE_MEDIA_PAUSE = 127; // 0x7f
    field public static final int KEYCODE_MEDIA_PLAY = 126; // 0x7e
    field public static final int KEYCODE_MEDIA_PLAY_PAUSE = 85; // 0x55
    field public static final int KEYCODE_MEDIA_PREVIOUS = 88; // 0x58
    field public static final int KEYCODE_MEDIA_RECORD = 130; // 0x82
    field public static final int KEYCODE_MEDIA_REWIND = 89; // 0x59
    field public static final int KEYCODE_MEDIA_SKIP_BACKWARD = 273; // 0x111
    field public static final int KEYCODE_MEDIA_SKIP_FORWARD = 272; // 0x110
    field public static final int KEYCODE_MEDIA_STEP_BACKWARD = 275; // 0x113
    field public static final int KEYCODE_MEDIA_STEP_FORWARD = 274; // 0x112
    field public static final int KEYCODE_MEDIA_STOP = 86; // 0x56
    field public static final int KEYCODE_MEDIA_TOP_MENU = 226; // 0xe2
    field public static final int KEYCODE_MENU = 82; // 0x52
    field public static final int KEYCODE_META_LEFT = 117; // 0x75
    field public static final int KEYCODE_META_RIGHT = 118; // 0x76
    field public static final int KEYCODE_MINUS = 69; // 0x45
    field public static final int KEYCODE_MOVE_END = 123; // 0x7b
    field public static final int KEYCODE_MOVE_HOME = 122; // 0x7a
    field public static final int KEYCODE_MUHENKAN = 213; // 0xd5
    field public static final int KEYCODE_MUSIC = 209; // 0xd1
    field public static final int KEYCODE_MUTE = 91; // 0x5b
    field public static final int KEYCODE_N = 42; // 0x2a
    field public static final int KEYCODE_NAVIGATE_IN = 262; // 0x106
    field public static final int KEYCODE_NAVIGATE_NEXT = 261; // 0x105
    field public static final int KEYCODE_NAVIGATE_OUT = 263; // 0x107
    field public static final int KEYCODE_NAVIGATE_PREVIOUS = 260; // 0x104
    field public static final int KEYCODE_NOTIFICATION = 83; // 0x53
    field public static final int KEYCODE_NUM = 78; // 0x4e
    field public static final int KEYCODE_NUMPAD_0 = 144; // 0x90
    field public static final int KEYCODE_NUMPAD_1 = 145; // 0x91
    field public static final int KEYCODE_NUMPAD_2 = 146; // 0x92
    field public static final int KEYCODE_NUMPAD_3 = 147; // 0x93
    field public static final int KEYCODE_NUMPAD_4 = 148; // 0x94
    field public static final int KEYCODE_NUMPAD_5 = 149; // 0x95
    field public static final int KEYCODE_NUMPAD_6 = 150; // 0x96
    field public static final int KEYCODE_NUMPAD_7 = 151; // 0x97
    field public static final int KEYCODE_NUMPAD_8 = 152; // 0x98
    field public static final int KEYCODE_NUMPAD_9 = 153; // 0x99
    field public static final int KEYCODE_NUMPAD_ADD = 157; // 0x9d
    field public static final int KEYCODE_NUMPAD_COMMA = 159; // 0x9f
    field public static final int KEYCODE_NUMPAD_DIVIDE = 154; // 0x9a
    field public static final int KEYCODE_NUMPAD_DOT = 158; // 0x9e
    field public static final int KEYCODE_NUMPAD_ENTER = 160; // 0xa0
    field public static final int KEYCODE_NUMPAD_EQUALS = 161; // 0xa1
    field public static final int KEYCODE_NUMPAD_LEFT_PAREN = 162; // 0xa2
    field public static final int KEYCODE_NUMPAD_MULTIPLY = 155; // 0x9b
    field public static final int KEYCODE_NUMPAD_RIGHT_PAREN = 163; // 0xa3
    field public static final int KEYCODE_NUMPAD_SUBTRACT = 156; // 0x9c
    field public static final int KEYCODE_NUM_LOCK = 143; // 0x8f
    field public static final int KEYCODE_O = 43; // 0x2b
    field public static final int KEYCODE_P = 44; // 0x2c
    field public static final int KEYCODE_PAGE_DOWN = 93; // 0x5d
    field public static final int KEYCODE_PAGE_UP = 92; // 0x5c
    field public static final int KEYCODE_PAIRING = 225; // 0xe1
    field public static final int KEYCODE_PASTE = 279; // 0x117
    field public static final int KEYCODE_PERIOD = 56; // 0x38
    field public static final int KEYCODE_PICTSYMBOLS = 94; // 0x5e
    field public static final int KEYCODE_PLUS = 81; // 0x51
    field public static final int KEYCODE_POUND = 18; // 0x12
    field public static final int KEYCODE_POWER = 26; // 0x1a
    field public static final int KEYCODE_PROG_BLUE = 186; // 0xba
    field public static final int KEYCODE_PROG_GREEN = 184; // 0xb8
    field public static final int KEYCODE_PROG_RED = 183; // 0xb7
    field public static final int KEYCODE_PROG_YELLOW = 185; // 0xb9
    field public static final int KEYCODE_Q = 45; // 0x2d
    field public static final int KEYCODE_R = 46; // 0x2e
    field public static final int KEYCODE_REFRESH = 285; // 0x11d
    field public static final int KEYCODE_RIGHT_BRACKET = 72; // 0x48
    field public static final int KEYCODE_RO = 217; // 0xd9
    field public static final int KEYCODE_S = 47; // 0x2f
    field public static final int KEYCODE_SCROLL_LOCK = 116; // 0x74
    field public static final int KEYCODE_SEARCH = 84; // 0x54
    field public static final int KEYCODE_SEMICOLON = 74; // 0x4a
    field public static final int KEYCODE_SETTINGS = 176; // 0xb0
    field public static final int KEYCODE_SHIFT_LEFT = 59; // 0x3b
    field public static final int KEYCODE_SHIFT_RIGHT = 60; // 0x3c
    field public static final int KEYCODE_SLASH = 76; // 0x4c
    field public static final int KEYCODE_SLEEP = 223; // 0xdf
    field public static final int KEYCODE_SOFT_LEFT = 1; // 0x1
    field public static final int KEYCODE_SOFT_RIGHT = 2; // 0x2
    field public static final int KEYCODE_SOFT_SLEEP = 276; // 0x114
    field public static final int KEYCODE_SPACE = 62; // 0x3e
    field public static final int KEYCODE_STAR = 17; // 0x11
    field public static final int KEYCODE_STB_INPUT = 180; // 0xb4
    field public static final int KEYCODE_STB_POWER = 179; // 0xb3
    field public static final int KEYCODE_STEM_1 = 265; // 0x109
    field public static final int KEYCODE_STEM_2 = 266; // 0x10a
    field public static final int KEYCODE_STEM_3 = 267; // 0x10b
    field public static final int KEYCODE_STEM_PRIMARY = 264; // 0x108
    field public static final int KEYCODE_SWITCH_CHARSET = 95; // 0x5f
    field public static final int KEYCODE_SYM = 63; // 0x3f
    field public static final int KEYCODE_SYSRQ = 120; // 0x78
    field public static final int KEYCODE_SYSTEM_NAVIGATION_DOWN = 281; // 0x119
    field public static final int KEYCODE_SYSTEM_NAVIGATION_LEFT = 282; // 0x11a
    field public static final int KEYCODE_SYSTEM_NAVIGATION_RIGHT = 283; // 0x11b
    field public static final int KEYCODE_SYSTEM_NAVIGATION_UP = 280; // 0x118
    field public static final int KEYCODE_T = 48; // 0x30
    field public static final int KEYCODE_TAB = 61; // 0x3d
    field public static final int KEYCODE_TV = 170; // 0xaa
    field public static final int KEYCODE_TV_ANTENNA_CABLE = 242; // 0xf2
    field public static final int KEYCODE_TV_AUDIO_DESCRIPTION = 252; // 0xfc
    field public static final int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN = 254; // 0xfe
    field public static final int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP = 253; // 0xfd
    field public static final int KEYCODE_TV_CONTENTS_MENU = 256; // 0x100
    field public static final int KEYCODE_TV_DATA_SERVICE = 230; // 0xe6
    field public static final int KEYCODE_TV_INPUT = 178; // 0xb2
    field public static final int KEYCODE_TV_INPUT_COMPONENT_1 = 249; // 0xf9
    field public static final int KEYCODE_TV_INPUT_COMPONENT_2 = 250; // 0xfa
    field public static final int KEYCODE_TV_INPUT_COMPOSITE_1 = 247; // 0xf7
    field public static final int KEYCODE_TV_INPUT_COMPOSITE_2 = 248; // 0xf8
    field public static final int KEYCODE_TV_INPUT_HDMI_1 = 243; // 0xf3
    field public static final int KEYCODE_TV_INPUT_HDMI_2 = 244; // 0xf4
    field public static final int KEYCODE_TV_INPUT_HDMI_3 = 245; // 0xf5
    field public static final int KEYCODE_TV_INPUT_HDMI_4 = 246; // 0xf6
    field public static final int KEYCODE_TV_INPUT_VGA_1 = 251; // 0xfb
    field public static final int KEYCODE_TV_MEDIA_CONTEXT_MENU = 257; // 0x101
    field public static final int KEYCODE_TV_NETWORK = 241; // 0xf1
    field public static final int KEYCODE_TV_NUMBER_ENTRY = 234; // 0xea
    field public static final int KEYCODE_TV_POWER = 177; // 0xb1
    field public static final int KEYCODE_TV_RADIO_SERVICE = 232; // 0xe8
    field public static final int KEYCODE_TV_SATELLITE = 237; // 0xed
    field public static final int KEYCODE_TV_SATELLITE_BS = 238; // 0xee
    field public static final int KEYCODE_TV_SATELLITE_CS = 239; // 0xef
    field public static final int KEYCODE_TV_SATELLITE_SERVICE = 240; // 0xf0
    field public static final int KEYCODE_TV_TELETEXT = 233; // 0xe9
    field public static final int KEYCODE_TV_TERRESTRIAL_ANALOG = 235; // 0xeb
    field public static final int KEYCODE_TV_TERRESTRIAL_DIGITAL = 236; // 0xec
    field public static final int KEYCODE_TV_TIMER_PROGRAMMING = 258; // 0x102
    field public static final int KEYCODE_TV_ZOOM_MODE = 255; // 0xff
    field public static final int KEYCODE_U = 49; // 0x31
    field public static final int KEYCODE_UNKNOWN = 0; // 0x0
    field public static final int KEYCODE_V = 50; // 0x32
    field public static final int KEYCODE_VOICE_ASSIST = 231; // 0xe7
    field public static final int KEYCODE_VOLUME_DOWN = 25; // 0x19
    field public static final int KEYCODE_VOLUME_MUTE = 164; // 0xa4
    field public static final int KEYCODE_VOLUME_UP = 24; // 0x18
    field public static final int KEYCODE_W = 51; // 0x33
    field public static final int KEYCODE_WAKEUP = 224; // 0xe0
    field public static final int KEYCODE_WINDOW = 171; // 0xab
    field public static final int KEYCODE_X = 52; // 0x34
    field public static final int KEYCODE_Y = 53; // 0x35
    field public static final int KEYCODE_YEN = 216; // 0xd8
    field public static final int KEYCODE_Z = 54; // 0x36
    field public static final int KEYCODE_ZENKAKU_HANKAKU = 211; // 0xd3
    field public static final int KEYCODE_ZOOM_IN = 168; // 0xa8
    field public static final int KEYCODE_ZOOM_OUT = 169; // 0xa9
    field @Deprecated public static final int MAX_KEYCODE = 84; // 0x54
    field public static final int META_ALT_LEFT_ON = 16; // 0x10
    field public static final int META_ALT_MASK = 50; // 0x32
    field public static final int META_ALT_ON = 2; // 0x2
    field public static final int META_ALT_RIGHT_ON = 32; // 0x20
    field public static final int META_CAPS_LOCK_ON = 1048576; // 0x100000
    field public static final int META_CTRL_LEFT_ON = 8192; // 0x2000
    field public static final int META_CTRL_MASK = 28672; // 0x7000
    field public static final int META_CTRL_ON = 4096; // 0x1000
    field public static final int META_CTRL_RIGHT_ON = 16384; // 0x4000
    field public static final int META_FUNCTION_ON = 8; // 0x8
    field public static final int META_META_LEFT_ON = 131072; // 0x20000
    field public static final int META_META_MASK = 458752; // 0x70000
    field public static final int META_META_ON = 65536; // 0x10000
    field public static final int META_META_RIGHT_ON = 262144; // 0x40000
    field public static final int META_NUM_LOCK_ON = 2097152; // 0x200000
    field public static final int META_SCROLL_LOCK_ON = 4194304; // 0x400000
    field public static final int META_SHIFT_LEFT_ON = 64; // 0x40
    field public static final int META_SHIFT_MASK = 193; // 0xc1
    field public static final int META_SHIFT_ON = 1; // 0x1
    field public static final int META_SHIFT_RIGHT_ON = 128; // 0x80
    field public static final int META_SYM_ON = 4; // 0x4
  }

  public static interface KeyEvent.Callback {
    method public boolean onKeyDown(int, android.view.KeyEvent);
    method public boolean onKeyLongPress(int, android.view.KeyEvent);
    method public boolean onKeyMultiple(int, int, android.view.KeyEvent);
    method public boolean onKeyUp(int, android.view.KeyEvent);
  }

  public static class KeyEvent.DispatcherState {
    ctor public KeyEvent.DispatcherState();
    method public void handleUpEvent(android.view.KeyEvent);
    method public boolean isTracking(android.view.KeyEvent);
    method public void performedLongPress(android.view.KeyEvent);
    method public void reset();
    method public void reset(Object);
    method public void startTracking(android.view.KeyEvent, Object);
  }

  public final class KeyboardShortcutGroup implements android.os.Parcelable {
    ctor public KeyboardShortcutGroup(@Nullable CharSequence, @NonNull java.util.List<android.view.KeyboardShortcutInfo>);
    ctor public KeyboardShortcutGroup(@Nullable CharSequence);
    method public void addItem(android.view.KeyboardShortcutInfo);
    method public int describeContents();
    method public java.util.List<android.view.KeyboardShortcutInfo> getItems();
    method public CharSequence getLabel();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.KeyboardShortcutGroup> CREATOR;
  }

  public final class KeyboardShortcutInfo implements android.os.Parcelable {
    ctor public KeyboardShortcutInfo(CharSequence, int, int);
    ctor public KeyboardShortcutInfo(CharSequence, char, int);
    method public int describeContents();
    method public char getBaseCharacter();
    method public int getKeycode();
    method @Nullable public CharSequence getLabel();
    method public int getModifiers();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.KeyboardShortcutInfo> CREATOR;
  }

  public abstract class LayoutInflater {
    ctor protected LayoutInflater(android.content.Context);
    ctor protected LayoutInflater(android.view.LayoutInflater, android.content.Context);
    method public abstract android.view.LayoutInflater cloneInContext(android.content.Context);
    method public final android.view.View createView(String, String, android.util.AttributeSet) throws java.lang.ClassNotFoundException, android.view.InflateException;
    method public static android.view.LayoutInflater from(android.content.Context);
    method public android.content.Context getContext();
    method public final android.view.LayoutInflater.Factory getFactory();
    method public final android.view.LayoutInflater.Factory2 getFactory2();
    method public android.view.LayoutInflater.Filter getFilter();
    method public android.view.View inflate(@LayoutRes int, @Nullable android.view.ViewGroup);
    method public android.view.View inflate(org.xmlpull.v1.XmlPullParser, @Nullable android.view.ViewGroup);
    method public android.view.View inflate(@LayoutRes int, @Nullable android.view.ViewGroup, boolean);
    method public android.view.View inflate(org.xmlpull.v1.XmlPullParser, @Nullable android.view.ViewGroup, boolean);
    method protected android.view.View onCreateView(String, android.util.AttributeSet) throws java.lang.ClassNotFoundException;
    method protected android.view.View onCreateView(android.view.View, String, android.util.AttributeSet) throws java.lang.ClassNotFoundException;
    method public void setFactory(android.view.LayoutInflater.Factory);
    method public void setFactory2(android.view.LayoutInflater.Factory2);
    method public void setFilter(android.view.LayoutInflater.Filter);
  }

  public static interface LayoutInflater.Factory {
    method public android.view.View onCreateView(String, android.content.Context, android.util.AttributeSet);
  }

  public static interface LayoutInflater.Factory2 extends android.view.LayoutInflater.Factory {
    method public android.view.View onCreateView(android.view.View, String, android.content.Context, android.util.AttributeSet);
  }

  public static interface LayoutInflater.Filter {
    method public boolean onLoadClass(Class);
  }

  public interface Menu {
    method public android.view.MenuItem add(CharSequence);
    method public android.view.MenuItem add(@StringRes int);
    method public android.view.MenuItem add(int, int, int, CharSequence);
    method public android.view.MenuItem add(int, int, int, @StringRes int);
    method public int addIntentOptions(int, int, int, android.content.ComponentName, android.content.Intent[], android.content.Intent, int, android.view.MenuItem[]);
    method public android.view.SubMenu addSubMenu(CharSequence);
    method public android.view.SubMenu addSubMenu(@StringRes int);
    method public android.view.SubMenu addSubMenu(int, int, int, CharSequence);
    method public android.view.SubMenu addSubMenu(int, int, int, @StringRes int);
    method public void clear();
    method public void close();
    method public android.view.MenuItem findItem(int);
    method public android.view.MenuItem getItem(int);
    method public boolean hasVisibleItems();
    method public boolean isShortcutKey(int, android.view.KeyEvent);
    method public boolean performIdentifierAction(int, int);
    method public boolean performShortcut(int, android.view.KeyEvent, int);
    method public void removeGroup(int);
    method public void removeItem(int);
    method public void setGroupCheckable(int, boolean, boolean);
    method public default void setGroupDividerEnabled(boolean);
    method public void setGroupEnabled(int, boolean);
    method public void setGroupVisible(int, boolean);
    method public void setQwertyMode(boolean);
    method public int size();
    field public static final int CATEGORY_ALTERNATIVE = 262144; // 0x40000
    field public static final int CATEGORY_CONTAINER = 65536; // 0x10000
    field public static final int CATEGORY_SECONDARY = 196608; // 0x30000
    field public static final int CATEGORY_SYSTEM = 131072; // 0x20000
    field public static final int FIRST = 1; // 0x1
    field public static final int FLAG_ALWAYS_PERFORM_CLOSE = 2; // 0x2
    field public static final int FLAG_APPEND_TO_GROUP = 1; // 0x1
    field public static final int FLAG_PERFORM_NO_CLOSE = 1; // 0x1
    field public static final int NONE = 0; // 0x0
    field public static final int SUPPORTED_MODIFIERS_MASK = 69647; // 0x1100f
  }

  public class MenuInflater {
    ctor public MenuInflater(android.content.Context);
    method public void inflate(@MenuRes int, android.view.Menu);
  }

  public interface MenuItem {
    method public boolean collapseActionView();
    method public boolean expandActionView();
    method public android.view.ActionProvider getActionProvider();
    method public android.view.View getActionView();
    method public default int getAlphabeticModifiers();
    method public char getAlphabeticShortcut();
    method public default CharSequence getContentDescription();
    method public int getGroupId();
    method public android.graphics.drawable.Drawable getIcon();
    method @Nullable public default android.content.res.ColorStateList getIconTintList();
    method @Nullable public default android.graphics.PorterDuff.Mode getIconTintMode();
    method public android.content.Intent getIntent();
    method public int getItemId();
    method public android.view.ContextMenu.ContextMenuInfo getMenuInfo();
    method public default int getNumericModifiers();
    method public char getNumericShortcut();
    method public int getOrder();
    method public android.view.SubMenu getSubMenu();
    method public CharSequence getTitle();
    method public CharSequence getTitleCondensed();
    method public default CharSequence getTooltipText();
    method public boolean hasSubMenu();
    method public boolean isActionViewExpanded();
    method public boolean isCheckable();
    method public boolean isChecked();
    method public boolean isEnabled();
    method public boolean isVisible();
    method public android.view.MenuItem setActionProvider(android.view.ActionProvider);
    method public android.view.MenuItem setActionView(android.view.View);
    method public android.view.MenuItem setActionView(@LayoutRes int);
    method public android.view.MenuItem setAlphabeticShortcut(char);
    method public default android.view.MenuItem setAlphabeticShortcut(char, int);
    method public android.view.MenuItem setCheckable(boolean);
    method public android.view.MenuItem setChecked(boolean);
    method public default android.view.MenuItem setContentDescription(CharSequence);
    method public android.view.MenuItem setEnabled(boolean);
    method public android.view.MenuItem setIcon(android.graphics.drawable.Drawable);
    method public android.view.MenuItem setIcon(@DrawableRes int);
    method public default android.view.MenuItem setIconTintList(@Nullable android.content.res.ColorStateList);
    method public default android.view.MenuItem setIconTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public android.view.MenuItem setIntent(android.content.Intent);
    method public android.view.MenuItem setNumericShortcut(char);
    method public default android.view.MenuItem setNumericShortcut(char, int);
    method public android.view.MenuItem setOnActionExpandListener(android.view.MenuItem.OnActionExpandListener);
    method public android.view.MenuItem setOnMenuItemClickListener(android.view.MenuItem.OnMenuItemClickListener);
    method public android.view.MenuItem setShortcut(char, char);
    method public default android.view.MenuItem setShortcut(char, char, int, int);
    method public void setShowAsAction(int);
    method public android.view.MenuItem setShowAsActionFlags(int);
    method public android.view.MenuItem setTitle(CharSequence);
    method public android.view.MenuItem setTitle(@StringRes int);
    method public android.view.MenuItem setTitleCondensed(CharSequence);
    method public default android.view.MenuItem setTooltipText(CharSequence);
    method public android.view.MenuItem setVisible(boolean);
    field public static final int SHOW_AS_ACTION_ALWAYS = 2; // 0x2
    field public static final int SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW = 8; // 0x8
    field public static final int SHOW_AS_ACTION_IF_ROOM = 1; // 0x1
    field public static final int SHOW_AS_ACTION_NEVER = 0; // 0x0
    field public static final int SHOW_AS_ACTION_WITH_TEXT = 4; // 0x4
  }

  public static interface MenuItem.OnActionExpandListener {
    method public boolean onMenuItemActionCollapse(android.view.MenuItem);
    method public boolean onMenuItemActionExpand(android.view.MenuItem);
  }

  public static interface MenuItem.OnMenuItemClickListener {
    method public boolean onMenuItemClick(android.view.MenuItem);
  }

  public final class MotionEvent extends android.view.InputEvent implements android.os.Parcelable {
    method public static String actionToString(int);
    method public void addBatch(long, float, float, float, float, int);
    method public void addBatch(long, android.view.MotionEvent.PointerCoords[], int);
    method public static int axisFromString(String);
    method public static String axisToString(int);
    method public int findPointerIndex(int);
    method public int getAction();
    method public int getActionButton();
    method public int getActionIndex();
    method public int getActionMasked();
    method public float getAxisValue(int);
    method public float getAxisValue(int, int);
    method public int getButtonState();
    method public int getDeviceId();
    method public long getDownTime();
    method public int getEdgeFlags();
    method public long getEventTime();
    method public int getFlags();
    method public float getHistoricalAxisValue(int, int);
    method public float getHistoricalAxisValue(int, int, int);
    method public long getHistoricalEventTime(int);
    method public float getHistoricalOrientation(int);
    method public float getHistoricalOrientation(int, int);
    method public void getHistoricalPointerCoords(int, int, android.view.MotionEvent.PointerCoords);
    method public float getHistoricalPressure(int);
    method public float getHistoricalPressure(int, int);
    method public float getHistoricalSize(int);
    method public float getHistoricalSize(int, int);
    method public float getHistoricalToolMajor(int);
    method public float getHistoricalToolMajor(int, int);
    method public float getHistoricalToolMinor(int);
    method public float getHistoricalToolMinor(int, int);
    method public float getHistoricalTouchMajor(int);
    method public float getHistoricalTouchMajor(int, int);
    method public float getHistoricalTouchMinor(int);
    method public float getHistoricalTouchMinor(int, int);
    method public float getHistoricalX(int);
    method public float getHistoricalX(int, int);
    method public float getHistoricalY(int);
    method public float getHistoricalY(int, int);
    method public int getHistorySize();
    method public int getMetaState();
    method public float getOrientation();
    method public float getOrientation(int);
    method public void getPointerCoords(int, android.view.MotionEvent.PointerCoords);
    method public int getPointerCount();
    method public int getPointerId(int);
    method public void getPointerProperties(int, android.view.MotionEvent.PointerProperties);
    method public float getPressure();
    method public float getPressure(int);
    method public float getRawX();
    method public float getRawY();
    method public float getSize();
    method public float getSize(int);
    method public int getSource();
    method public float getToolMajor();
    method public float getToolMajor(int);
    method public float getToolMinor();
    method public float getToolMinor(int);
    method public int getToolType(int);
    method public float getTouchMajor();
    method public float getTouchMajor(int);
    method public float getTouchMinor();
    method public float getTouchMinor(int);
    method public float getX();
    method public float getX(int);
    method public float getXPrecision();
    method public float getY();
    method public float getY(int);
    method public float getYPrecision();
    method public boolean isButtonPressed(int);
    method public static android.view.MotionEvent obtain(long, long, int, int, android.view.MotionEvent.PointerProperties[], android.view.MotionEvent.PointerCoords[], int, int, float, float, int, int, int, int);
    method @Deprecated public static android.view.MotionEvent obtain(long, long, int, int, int[], android.view.MotionEvent.PointerCoords[], int, float, float, int, int, int, int);
    method public static android.view.MotionEvent obtain(long, long, int, float, float, float, float, int, float, float, int, int);
    method @Deprecated public static android.view.MotionEvent obtain(long, long, int, int, float, float, float, float, int, float, float, int, int);
    method public static android.view.MotionEvent obtain(long, long, int, float, float, int);
    method public static android.view.MotionEvent obtain(android.view.MotionEvent);
    method public static android.view.MotionEvent obtainNoHistory(android.view.MotionEvent);
    method public void offsetLocation(float, float);
    method public void recycle();
    method public void setAction(int);
    method public void setEdgeFlags(int);
    method public void setLocation(float, float);
    method public void setSource(int);
    method public void transform(android.graphics.Matrix);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ACTION_BUTTON_PRESS = 11; // 0xb
    field public static final int ACTION_BUTTON_RELEASE = 12; // 0xc
    field public static final int ACTION_CANCEL = 3; // 0x3
    field public static final int ACTION_DOWN = 0; // 0x0
    field public static final int ACTION_HOVER_ENTER = 9; // 0x9
    field public static final int ACTION_HOVER_EXIT = 10; // 0xa
    field public static final int ACTION_HOVER_MOVE = 7; // 0x7
    field public static final int ACTION_MASK = 255; // 0xff
    field public static final int ACTION_MOVE = 2; // 0x2
    field public static final int ACTION_OUTSIDE = 4; // 0x4
    field @Deprecated public static final int ACTION_POINTER_1_DOWN = 5; // 0x5
    field @Deprecated public static final int ACTION_POINTER_1_UP = 6; // 0x6
    field @Deprecated public static final int ACTION_POINTER_2_DOWN = 261; // 0x105
    field @Deprecated public static final int ACTION_POINTER_2_UP = 262; // 0x106
    field @Deprecated public static final int ACTION_POINTER_3_DOWN = 517; // 0x205
    field @Deprecated public static final int ACTION_POINTER_3_UP = 518; // 0x206
    field public static final int ACTION_POINTER_DOWN = 5; // 0x5
    field @Deprecated public static final int ACTION_POINTER_ID_MASK = 65280; // 0xff00
    field @Deprecated public static final int ACTION_POINTER_ID_SHIFT = 8; // 0x8
    field public static final int ACTION_POINTER_INDEX_MASK = 65280; // 0xff00
    field public static final int ACTION_POINTER_INDEX_SHIFT = 8; // 0x8
    field public static final int ACTION_POINTER_UP = 6; // 0x6
    field public static final int ACTION_SCROLL = 8; // 0x8
    field public static final int ACTION_UP = 1; // 0x1
    field public static final int AXIS_BRAKE = 23; // 0x17
    field public static final int AXIS_DISTANCE = 24; // 0x18
    field public static final int AXIS_GAS = 22; // 0x16
    field public static final int AXIS_GENERIC_1 = 32; // 0x20
    field public static final int AXIS_GENERIC_10 = 41; // 0x29
    field public static final int AXIS_GENERIC_11 = 42; // 0x2a
    field public static final int AXIS_GENERIC_12 = 43; // 0x2b
    field public static final int AXIS_GENERIC_13 = 44; // 0x2c
    field public static final int AXIS_GENERIC_14 = 45; // 0x2d
    field public static final int AXIS_GENERIC_15 = 46; // 0x2e
    field public static final int AXIS_GENERIC_16 = 47; // 0x2f
    field public static final int AXIS_GENERIC_2 = 33; // 0x21
    field public static final int AXIS_GENERIC_3 = 34; // 0x22
    field public static final int AXIS_GENERIC_4 = 35; // 0x23
    field public static final int AXIS_GENERIC_5 = 36; // 0x24
    field public static final int AXIS_GENERIC_6 = 37; // 0x25
    field public static final int AXIS_GENERIC_7 = 38; // 0x26
    field public static final int AXIS_GENERIC_8 = 39; // 0x27
    field public static final int AXIS_GENERIC_9 = 40; // 0x28
    field public static final int AXIS_HAT_X = 15; // 0xf
    field public static final int AXIS_HAT_Y = 16; // 0x10
    field public static final int AXIS_HSCROLL = 10; // 0xa
    field public static final int AXIS_LTRIGGER = 17; // 0x11
    field public static final int AXIS_ORIENTATION = 8; // 0x8
    field public static final int AXIS_PRESSURE = 2; // 0x2
    field public static final int AXIS_RELATIVE_X = 27; // 0x1b
    field public static final int AXIS_RELATIVE_Y = 28; // 0x1c
    field public static final int AXIS_RTRIGGER = 18; // 0x12
    field public static final int AXIS_RUDDER = 20; // 0x14
    field public static final int AXIS_RX = 12; // 0xc
    field public static final int AXIS_RY = 13; // 0xd
    field public static final int AXIS_RZ = 14; // 0xe
    field public static final int AXIS_SCROLL = 26; // 0x1a
    field public static final int AXIS_SIZE = 3; // 0x3
    field public static final int AXIS_THROTTLE = 19; // 0x13
    field public static final int AXIS_TILT = 25; // 0x19
    field public static final int AXIS_TOOL_MAJOR = 6; // 0x6
    field public static final int AXIS_TOOL_MINOR = 7; // 0x7
    field public static final int AXIS_TOUCH_MAJOR = 4; // 0x4
    field public static final int AXIS_TOUCH_MINOR = 5; // 0x5
    field public static final int AXIS_VSCROLL = 9; // 0x9
    field public static final int AXIS_WHEEL = 21; // 0x15
    field public static final int AXIS_X = 0; // 0x0
    field public static final int AXIS_Y = 1; // 0x1
    field public static final int AXIS_Z = 11; // 0xb
    field public static final int BUTTON_BACK = 8; // 0x8
    field public static final int BUTTON_FORWARD = 16; // 0x10
    field public static final int BUTTON_PRIMARY = 1; // 0x1
    field public static final int BUTTON_SECONDARY = 2; // 0x2
    field public static final int BUTTON_STYLUS_PRIMARY = 32; // 0x20
    field public static final int BUTTON_STYLUS_SECONDARY = 64; // 0x40
    field public static final int BUTTON_TERTIARY = 4; // 0x4
    field public static final android.os.Parcelable.Creator<android.view.MotionEvent> CREATOR;
    field public static final int EDGE_BOTTOM = 2; // 0x2
    field public static final int EDGE_LEFT = 4; // 0x4
    field public static final int EDGE_RIGHT = 8; // 0x8
    field public static final int EDGE_TOP = 1; // 0x1
    field public static final int FLAG_WINDOW_IS_OBSCURED = 1; // 0x1
    field public static final int INVALID_POINTER_ID = -1; // 0xffffffff
    field public static final int TOOL_TYPE_ERASER = 4; // 0x4
    field public static final int TOOL_TYPE_FINGER = 1; // 0x1
    field public static final int TOOL_TYPE_MOUSE = 3; // 0x3
    field public static final int TOOL_TYPE_STYLUS = 2; // 0x2
    field public static final int TOOL_TYPE_UNKNOWN = 0; // 0x0
  }

  public static final class MotionEvent.PointerCoords {
    ctor public MotionEvent.PointerCoords();
    ctor public MotionEvent.PointerCoords(android.view.MotionEvent.PointerCoords);
    method public void clear();
    method public void copyFrom(android.view.MotionEvent.PointerCoords);
    method public float getAxisValue(int);
    method public void setAxisValue(int, float);
    field public float orientation;
    field public float pressure;
    field public float size;
    field public float toolMajor;
    field public float toolMinor;
    field public float touchMajor;
    field public float touchMinor;
    field public float x;
    field public float y;
  }

  public static final class MotionEvent.PointerProperties {
    ctor public MotionEvent.PointerProperties();
    ctor public MotionEvent.PointerProperties(android.view.MotionEvent.PointerProperties);
    method public void clear();
    method public void copyFrom(android.view.MotionEvent.PointerProperties);
    field public int id;
    field public int toolType;
  }

  public abstract class OrientationEventListener {
    ctor public OrientationEventListener(android.content.Context);
    ctor public OrientationEventListener(android.content.Context, int);
    method public boolean canDetectOrientation();
    method public void disable();
    method public void enable();
    method public abstract void onOrientationChanged(int);
    field public static final int ORIENTATION_UNKNOWN = -1; // 0xffffffff
  }

  @Deprecated public abstract class OrientationListener implements android.hardware.SensorListener {
    ctor @Deprecated public OrientationListener(android.content.Context);
    ctor @Deprecated public OrientationListener(android.content.Context, int);
    method @Deprecated public void disable();
    method @Deprecated public void enable();
    method @Deprecated public void onAccuracyChanged(int, int);
    method @Deprecated public abstract void onOrientationChanged(int);
    method @Deprecated public void onSensorChanged(int, float[]);
    field @Deprecated public static final int ORIENTATION_UNKNOWN = -1; // 0xffffffff
  }

  public final class PixelCopy {
    method public static void request(@NonNull android.view.SurfaceView, @NonNull android.graphics.Bitmap, @NonNull android.view.PixelCopy.OnPixelCopyFinishedListener, @NonNull android.os.Handler);
    method public static void request(@NonNull android.view.SurfaceView, @Nullable android.graphics.Rect, @NonNull android.graphics.Bitmap, @NonNull android.view.PixelCopy.OnPixelCopyFinishedListener, @NonNull android.os.Handler);
    method public static void request(@NonNull android.view.Surface, @NonNull android.graphics.Bitmap, @NonNull android.view.PixelCopy.OnPixelCopyFinishedListener, @NonNull android.os.Handler);
    method public static void request(@NonNull android.view.Surface, @Nullable android.graphics.Rect, @NonNull android.graphics.Bitmap, @NonNull android.view.PixelCopy.OnPixelCopyFinishedListener, @NonNull android.os.Handler);
    method public static void request(@NonNull android.view.Window, @NonNull android.graphics.Bitmap, @NonNull android.view.PixelCopy.OnPixelCopyFinishedListener, @NonNull android.os.Handler);
    method public static void request(@NonNull android.view.Window, @Nullable android.graphics.Rect, @NonNull android.graphics.Bitmap, @NonNull android.view.PixelCopy.OnPixelCopyFinishedListener, @NonNull android.os.Handler);
    field public static final int ERROR_DESTINATION_INVALID = 5; // 0x5
    field public static final int ERROR_SOURCE_INVALID = 4; // 0x4
    field public static final int ERROR_SOURCE_NO_DATA = 3; // 0x3
    field public static final int ERROR_TIMEOUT = 2; // 0x2
    field public static final int ERROR_UNKNOWN = 1; // 0x1
    field public static final int SUCCESS = 0; // 0x0
  }

  public static interface PixelCopy.OnPixelCopyFinishedListener {
    method public void onPixelCopyFinished(int);
  }

  public final class PointerIcon implements android.os.Parcelable {
    method public static android.view.PointerIcon create(@NonNull android.graphics.Bitmap, float, float);
    method public int describeContents();
    method public static android.view.PointerIcon getSystemIcon(@NonNull android.content.Context, int);
    method public static android.view.PointerIcon load(@NonNull android.content.res.Resources, @XmlRes int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.PointerIcon> CREATOR;
    field public static final int TYPE_ALIAS = 1010; // 0x3f2
    field public static final int TYPE_ALL_SCROLL = 1013; // 0x3f5
    field public static final int TYPE_ARROW = 1000; // 0x3e8
    field public static final int TYPE_CELL = 1006; // 0x3ee
    field public static final int TYPE_CONTEXT_MENU = 1001; // 0x3e9
    field public static final int TYPE_COPY = 1011; // 0x3f3
    field public static final int TYPE_CROSSHAIR = 1007; // 0x3ef
    field public static final int TYPE_DEFAULT = 1000; // 0x3e8
    field public static final int TYPE_GRAB = 1020; // 0x3fc
    field public static final int TYPE_GRABBING = 1021; // 0x3fd
    field public static final int TYPE_HAND = 1002; // 0x3ea
    field public static final int TYPE_HELP = 1003; // 0x3eb
    field public static final int TYPE_HORIZONTAL_DOUBLE_ARROW = 1014; // 0x3f6
    field public static final int TYPE_NO_DROP = 1012; // 0x3f4
    field public static final int TYPE_NULL = 0; // 0x0
    field public static final int TYPE_TEXT = 1008; // 0x3f0
    field public static final int TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW = 1017; // 0x3f9
    field public static final int TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW = 1016; // 0x3f8
    field public static final int TYPE_VERTICAL_DOUBLE_ARROW = 1015; // 0x3f7
    field public static final int TYPE_VERTICAL_TEXT = 1009; // 0x3f1
    field public static final int TYPE_WAIT = 1004; // 0x3ec
    field public static final int TYPE_ZOOM_IN = 1018; // 0x3fa
    field public static final int TYPE_ZOOM_OUT = 1019; // 0x3fb
  }

  public class ScaleGestureDetector {
    ctor public ScaleGestureDetector(android.content.Context, android.view.ScaleGestureDetector.OnScaleGestureListener);
    ctor public ScaleGestureDetector(android.content.Context, android.view.ScaleGestureDetector.OnScaleGestureListener, android.os.Handler);
    method public float getCurrentSpan();
    method public float getCurrentSpanX();
    method public float getCurrentSpanY();
    method public long getEventTime();
    method public float getFocusX();
    method public float getFocusY();
    method public float getPreviousSpan();
    method public float getPreviousSpanX();
    method public float getPreviousSpanY();
    method public float getScaleFactor();
    method public long getTimeDelta();
    method public boolean isInProgress();
    method public boolean isQuickScaleEnabled();
    method public boolean isStylusScaleEnabled();
    method public boolean onTouchEvent(android.view.MotionEvent);
    method public void setQuickScaleEnabled(boolean);
    method public void setStylusScaleEnabled(boolean);
  }

  public static interface ScaleGestureDetector.OnScaleGestureListener {
    method public boolean onScale(android.view.ScaleGestureDetector);
    method public boolean onScaleBegin(android.view.ScaleGestureDetector);
    method public void onScaleEnd(android.view.ScaleGestureDetector);
  }

  public static class ScaleGestureDetector.SimpleOnScaleGestureListener implements android.view.ScaleGestureDetector.OnScaleGestureListener {
    ctor public ScaleGestureDetector.SimpleOnScaleGestureListener();
    method public boolean onScale(android.view.ScaleGestureDetector);
    method public boolean onScaleBegin(android.view.ScaleGestureDetector);
    method public void onScaleEnd(android.view.ScaleGestureDetector);
  }

  public class SearchEvent {
    ctor public SearchEvent(android.view.InputDevice);
    method public android.view.InputDevice getInputDevice();
  }

  public class SoundEffectConstants {
    method public static int getContantForFocusDirection(int);
    field public static final int CLICK = 0; // 0x0
    field public static final int NAVIGATION_DOWN = 4; // 0x4
    field public static final int NAVIGATION_LEFT = 1; // 0x1
    field public static final int NAVIGATION_RIGHT = 3; // 0x3
    field public static final int NAVIGATION_UP = 2; // 0x2
  }

  public interface SubMenu extends android.view.Menu {
    method public void clearHeader();
    method public android.view.MenuItem getItem();
    method public android.view.SubMenu setHeaderIcon(@DrawableRes int);
    method public android.view.SubMenu setHeaderIcon(android.graphics.drawable.Drawable);
    method public android.view.SubMenu setHeaderTitle(@StringRes int);
    method public android.view.SubMenu setHeaderTitle(CharSequence);
    method public android.view.SubMenu setHeaderView(android.view.View);
    method public android.view.SubMenu setIcon(@DrawableRes int);
    method public android.view.SubMenu setIcon(android.graphics.drawable.Drawable);
  }

  public class Surface implements android.os.Parcelable {
    ctor public Surface(android.graphics.SurfaceTexture);
    method public int describeContents();
    method public boolean isValid();
    method public android.graphics.Canvas lockCanvas(android.graphics.Rect) throws java.lang.IllegalArgumentException, android.view.Surface.OutOfResourcesException;
    method public android.graphics.Canvas lockHardwareCanvas();
    method public void readFromParcel(android.os.Parcel);
    method public void release();
    method @Deprecated public void unlockCanvas(android.graphics.Canvas);
    method public void unlockCanvasAndPost(android.graphics.Canvas);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.Surface> CREATOR;
    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
  }

  public static class Surface.OutOfResourcesException extends java.lang.RuntimeException {
    ctor public Surface.OutOfResourcesException();
    ctor public Surface.OutOfResourcesException(String);
  }

  public interface SurfaceHolder {
    method public void addCallback(android.view.SurfaceHolder.Callback);
    method public android.view.Surface getSurface();
    method public android.graphics.Rect getSurfaceFrame();
    method public boolean isCreating();
    method public android.graphics.Canvas lockCanvas();
    method public android.graphics.Canvas lockCanvas(android.graphics.Rect);
    method public default android.graphics.Canvas lockHardwareCanvas();
    method public void removeCallback(android.view.SurfaceHolder.Callback);
    method public void setFixedSize(int, int);
    method public void setFormat(int);
    method public void setKeepScreenOn(boolean);
    method public void setSizeFromLayout();
    method @Deprecated public void setType(int);
    method public void unlockCanvasAndPost(android.graphics.Canvas);
    field @Deprecated public static final int SURFACE_TYPE_GPU = 2; // 0x2
    field @Deprecated public static final int SURFACE_TYPE_HARDWARE = 1; // 0x1
    field @Deprecated public static final int SURFACE_TYPE_NORMAL = 0; // 0x0
    field @Deprecated public static final int SURFACE_TYPE_PUSH_BUFFERS = 3; // 0x3
  }

  public static class SurfaceHolder.BadSurfaceTypeException extends java.lang.RuntimeException {
    ctor public SurfaceHolder.BadSurfaceTypeException();
    ctor public SurfaceHolder.BadSurfaceTypeException(String);
  }

  public static interface SurfaceHolder.Callback {
    method public void surfaceChanged(android.view.SurfaceHolder, int, int, int);
    method public void surfaceCreated(android.view.SurfaceHolder);
    method public void surfaceDestroyed(android.view.SurfaceHolder);
  }

  public static interface SurfaceHolder.Callback2 extends android.view.SurfaceHolder.Callback {
    method public void surfaceRedrawNeeded(android.view.SurfaceHolder);
    method public default void surfaceRedrawNeededAsync(android.view.SurfaceHolder, Runnable);
  }

  public class SurfaceView extends android.view.View {
    ctor public SurfaceView(android.content.Context);
    ctor public SurfaceView(android.content.Context, android.util.AttributeSet);
    ctor public SurfaceView(android.content.Context, android.util.AttributeSet, int);
    ctor public SurfaceView(android.content.Context, android.util.AttributeSet, int, int);
    method public boolean gatherTransparentRegion(android.graphics.Region);
    method public android.view.SurfaceHolder getHolder();
    method public void setSecure(boolean);
    method public void setZOrderMediaOverlay(boolean);
    method public void setZOrderOnTop(boolean);
  }

  public class TextureView extends android.view.View {
    ctor public TextureView(android.content.Context);
    ctor public TextureView(android.content.Context, android.util.AttributeSet);
    ctor public TextureView(android.content.Context, android.util.AttributeSet, int);
    ctor public TextureView(android.content.Context, android.util.AttributeSet, int, int);
    method public final void draw(android.graphics.Canvas);
    method public android.graphics.Bitmap getBitmap();
    method public android.graphics.Bitmap getBitmap(int, int);
    method public android.graphics.Bitmap getBitmap(android.graphics.Bitmap);
    method public android.graphics.SurfaceTexture getSurfaceTexture();
    method public android.view.TextureView.SurfaceTextureListener getSurfaceTextureListener();
    method public android.graphics.Matrix getTransform(android.graphics.Matrix);
    method public boolean isAvailable();
    method public android.graphics.Canvas lockCanvas();
    method public android.graphics.Canvas lockCanvas(android.graphics.Rect);
    method protected final void onDraw(android.graphics.Canvas);
    method public void setBackgroundDrawable(android.graphics.drawable.Drawable);
    method public void setOpaque(boolean);
    method public void setSurfaceTexture(android.graphics.SurfaceTexture);
    method public void setSurfaceTextureListener(android.view.TextureView.SurfaceTextureListener);
    method public void setTransform(android.graphics.Matrix);
    method public void unlockCanvasAndPost(android.graphics.Canvas);
  }

  public static interface TextureView.SurfaceTextureListener {
    method public void onSurfaceTextureAvailable(android.graphics.SurfaceTexture, int, int);
    method public boolean onSurfaceTextureDestroyed(android.graphics.SurfaceTexture);
    method public void onSurfaceTextureSizeChanged(android.graphics.SurfaceTexture, int, int);
    method public void onSurfaceTextureUpdated(android.graphics.SurfaceTexture);
  }

  public class TouchDelegate {
    ctor public TouchDelegate(android.graphics.Rect, android.view.View);
    method public boolean onTouchEvent(android.view.MotionEvent);
    field public static final int ABOVE = 1; // 0x1
    field public static final int BELOW = 2; // 0x2
    field public static final int TO_LEFT = 4; // 0x4
    field public static final int TO_RIGHT = 8; // 0x8
  }

  public final class VelocityTracker {
    method public void addMovement(android.view.MotionEvent);
    method public void clear();
    method public void computeCurrentVelocity(int);
    method public void computeCurrentVelocity(int, float);
    method public float getXVelocity();
    method public float getXVelocity(int);
    method public float getYVelocity();
    method public float getYVelocity(int);
    method public static android.view.VelocityTracker obtain();
    method public void recycle();
  }

  @UiThread public class View implements android.view.accessibility.AccessibilityEventSource android.graphics.drawable.Drawable.Callback android.view.KeyEvent.Callback {
    ctor public View(android.content.Context);
    ctor public View(android.content.Context, @Nullable android.util.AttributeSet);
    ctor public View(android.content.Context, @Nullable android.util.AttributeSet, int);
    ctor public View(android.content.Context, @Nullable android.util.AttributeSet, int, int);
    method public void addChildrenForAccessibility(java.util.ArrayList<android.view.View>);
    method public void addExtraDataToAccessibilityNodeInfo(@NonNull android.view.accessibility.AccessibilityNodeInfo, @NonNull String, @Nullable android.os.Bundle);
    method public void addFocusables(java.util.ArrayList<android.view.View>, int);
    method public void addFocusables(java.util.ArrayList<android.view.View>, int, int);
    method public void addKeyboardNavigationClusters(@NonNull java.util.Collection<android.view.View>, int);
    method public void addOnAttachStateChangeListener(android.view.View.OnAttachStateChangeListener);
    method public void addOnLayoutChangeListener(android.view.View.OnLayoutChangeListener);
    method public void addOnUnhandledKeyEventListener(android.view.View.OnUnhandledKeyEventListener);
    method public void addTouchables(java.util.ArrayList<android.view.View>);
    method public android.view.ViewPropertyAnimator animate();
    method public void announceForAccessibility(CharSequence);
    method public void autofill(android.view.autofill.AutofillValue);
    method public void autofill(@NonNull android.util.SparseArray<android.view.autofill.AutofillValue>);
    method protected boolean awakenScrollBars();
    method protected boolean awakenScrollBars(int);
    method protected boolean awakenScrollBars(int, boolean);
    method public void bringToFront();
    method @Deprecated public void buildDrawingCache();
    method @Deprecated public void buildDrawingCache(boolean);
    method public void buildLayer();
    method public boolean callOnClick();
    method public boolean canResolveLayoutDirection();
    method public boolean canResolveTextAlignment();
    method public boolean canResolveTextDirection();
    method public boolean canScrollHorizontally(int);
    method public boolean canScrollVertically(int);
    method public final void cancelDragAndDrop();
    method public void cancelLongPress();
    method public final void cancelPendingInputEvents();
    method public boolean checkInputConnectionProxy(android.view.View);
    method public void clearAnimation();
    method public void clearFocus();
    method public static int combineMeasuredStates(int, int);
    method protected int computeHorizontalScrollExtent();
    method protected int computeHorizontalScrollOffset();
    method protected int computeHorizontalScrollRange();
    method public void computeScroll();
    method public android.view.WindowInsets computeSystemWindowInsets(android.view.WindowInsets, android.graphics.Rect);
    method protected int computeVerticalScrollExtent();
    method protected int computeVerticalScrollOffset();
    method protected int computeVerticalScrollRange();
    method public android.view.accessibility.AccessibilityNodeInfo createAccessibilityNodeInfo();
    method public void createContextMenu(android.view.ContextMenu);
    method @Deprecated public void destroyDrawingCache();
    method public android.view.WindowInsets dispatchApplyWindowInsets(android.view.WindowInsets);
    method public boolean dispatchCapturedPointerEvent(android.view.MotionEvent);
    method public void dispatchConfigurationChanged(android.content.res.Configuration);
    method public void dispatchDisplayHint(int);
    method public boolean dispatchDragEvent(android.view.DragEvent);
    method protected void dispatchDraw(android.graphics.Canvas);
    method public void dispatchDrawableHotspotChanged(float, float);
    method @CallSuper public void dispatchFinishTemporaryDetach();
    method protected boolean dispatchGenericFocusedEvent(android.view.MotionEvent);
    method public boolean dispatchGenericMotionEvent(android.view.MotionEvent);
    method protected boolean dispatchGenericPointerEvent(android.view.MotionEvent);
    method protected boolean dispatchHoverEvent(android.view.MotionEvent);
    method public boolean dispatchKeyEvent(android.view.KeyEvent);
    method public boolean dispatchKeyEventPreIme(android.view.KeyEvent);
    method public boolean dispatchKeyShortcutEvent(android.view.KeyEvent);
    method public boolean dispatchNestedFling(float, float, boolean);
    method public boolean dispatchNestedPreFling(float, float);
    method public boolean dispatchNestedPrePerformAccessibilityAction(int, android.os.Bundle);
    method public boolean dispatchNestedPreScroll(int, int, @Nullable @Size(2) int[], @Nullable @Size(2) int[]);
    method public boolean dispatchNestedScroll(int, int, int, int, @Nullable @Size(2) int[]);
    method public void dispatchPointerCaptureChanged(boolean);
    method public boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public void dispatchProvideAutofillStructure(@NonNull android.view.ViewStructure, int);
    method public void dispatchProvideStructure(android.view.ViewStructure);
    method protected void dispatchRestoreInstanceState(android.util.SparseArray<android.os.Parcelable>);
    method protected void dispatchSaveInstanceState(android.util.SparseArray<android.os.Parcelable>);
    method protected void dispatchSetActivated(boolean);
    method protected void dispatchSetPressed(boolean);
    method protected void dispatchSetSelected(boolean);
    method @CallSuper public void dispatchStartTemporaryDetach();
    method public void dispatchSystemUiVisibilityChanged(int);
    method public boolean dispatchTouchEvent(android.view.MotionEvent);
    method public boolean dispatchTrackballEvent(android.view.MotionEvent);
    method public boolean dispatchUnhandledMove(android.view.View, int);
    method protected void dispatchVisibilityChanged(@NonNull android.view.View, int);
    method public void dispatchWindowFocusChanged(boolean);
    method public void dispatchWindowSystemUiVisiblityChanged(int);
    method public void dispatchWindowVisibilityChanged(int);
    method @CallSuper public void draw(android.graphics.Canvas);
    method @CallSuper public void drawableHotspotChanged(float, float);
    method @CallSuper protected void drawableStateChanged();
    method public android.view.View findFocus();
    method public final <T extends android.view.View> T findViewById(@IdRes int);
    method public final <T extends android.view.View> T findViewWithTag(Object);
    method public void findViewsWithText(java.util.ArrayList<android.view.View>, CharSequence, int);
    method @Deprecated protected boolean fitSystemWindows(android.graphics.Rect);
    method public android.view.View focusSearch(int);
    method public void forceHasOverlappingRendering(boolean);
    method public void forceLayout();
    method public static int generateViewId();
    method public CharSequence getAccessibilityClassName();
    method public int getAccessibilityLiveRegion();
    method public android.view.accessibility.AccessibilityNodeProvider getAccessibilityNodeProvider();
    method @Nullable public CharSequence getAccessibilityPaneTitle();
    method public int getAccessibilityTraversalAfter();
    method public int getAccessibilityTraversalBefore();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getAlpha();
    method public android.view.animation.Animation getAnimation();
    method public android.os.IBinder getApplicationWindowToken();
    method @android.view.ViewDebug.ExportedProperty @Nullable public String[] getAutofillHints();
    method public final android.view.autofill.AutofillId getAutofillId();
    method public int getAutofillType();
    method @Nullable public android.view.autofill.AutofillValue getAutofillValue();
    method public android.graphics.drawable.Drawable getBackground();
    method @Nullable public android.content.res.ColorStateList getBackgroundTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getBackgroundTintMode();
    method @android.view.ViewDebug.ExportedProperty(category="layout") public int getBaseline();
    method @android.view.ViewDebug.CapturedViewProperty public final int getBottom();
    method protected float getBottomFadingEdgeStrength();
    method protected int getBottomPaddingOffset();
    method public float getCameraDistance();
    method public android.graphics.Rect getClipBounds();
    method public boolean getClipBounds(android.graphics.Rect);
    method public final boolean getClipToOutline();
    method @android.view.ViewDebug.ExportedProperty(category="accessibility") public CharSequence getContentDescription();
    method @android.view.ViewDebug.CapturedViewProperty public final android.content.Context getContext();
    method protected android.view.ContextMenu.ContextMenuInfo getContextMenuInfo();
    method @android.view.ViewDebug.ExportedProperty(category="focus") public final boolean getDefaultFocusHighlightEnabled();
    method public static int getDefaultSize(int, int);
    method public android.view.Display getDisplay();
    method public final int[] getDrawableState();
    method @Deprecated public android.graphics.Bitmap getDrawingCache();
    method @Deprecated public android.graphics.Bitmap getDrawingCache(boolean);
    method @Deprecated @ColorInt public int getDrawingCacheBackgroundColor();
    method @Deprecated public int getDrawingCacheQuality();
    method public void getDrawingRect(android.graphics.Rect);
    method public long getDrawingTime();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getElevation();
    method @android.view.ViewDebug.ExportedProperty public boolean getFilterTouchesWhenObscured();
    method @android.view.ViewDebug.ExportedProperty public boolean getFitsSystemWindows();
    method @android.view.ViewDebug.ExportedProperty(mapping={@android.view.ViewDebug.IntToString(from=android.view.View.NOT_FOCUSABLE, to="NOT_FOCUSABLE"), @android.view.ViewDebug.IntToString(from=android.view.View.FOCUSABLE, to="FOCUSABLE"), @android.view.ViewDebug.IntToString(from=android.view.View.FOCUSABLE_AUTO, to="FOCUSABLE_AUTO")}, category="focus") public int getFocusable();
    method public java.util.ArrayList<android.view.View> getFocusables(int);
    method public void getFocusedRect(android.graphics.Rect);
    method public android.graphics.drawable.Drawable getForeground();
    method public int getForegroundGravity();
    method @Nullable public android.content.res.ColorStateList getForegroundTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getForegroundTintMode();
    method public boolean getGlobalVisibleRect(android.graphics.Rect, android.graphics.Point);
    method public final boolean getGlobalVisibleRect(android.graphics.Rect);
    method public android.os.Handler getHandler();
    method public final boolean getHasOverlappingRendering();
    method @android.view.ViewDebug.ExportedProperty(category="layout") public final int getHeight();
    method public void getHitRect(android.graphics.Rect);
    method public int getHorizontalFadingEdgeLength();
    method protected int getHorizontalScrollbarHeight();
    method @IdRes @android.view.ViewDebug.CapturedViewProperty public int getId();
    method @android.view.ViewDebug.ExportedProperty(category="accessibility", mapping={@android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_ACCESSIBILITY_AUTO, to="auto"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES, to="yes"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO, to="no"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, to="noHideDescendants")}) public int getImportantForAccessibility();
    method @android.view.ViewDebug.ExportedProperty(mapping={@android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_AUTOFILL_AUTO, to="auto"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_AUTOFILL_YES, to="yes"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_AUTOFILL_NO, to="no"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, to="yesExcludeDescendants"), @android.view.ViewDebug.IntToString(from=android.view.View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, to="noExcludeDescendants")}) public int getImportantForAutofill();
    method public boolean getKeepScreenOn();
    method public android.view.KeyEvent.DispatcherState getKeyDispatcherState();
    method @android.view.ViewDebug.ExportedProperty(category="accessibility") public int getLabelFor();
    method public int getLayerType();
    method @android.view.ViewDebug.ExportedProperty(category="layout", mapping={@android.view.ViewDebug.IntToString(from=android.view.View.LAYOUT_DIRECTION_LTR, to="RESOLVED_DIRECTION_LTR"), @android.view.ViewDebug.IntToString(from=android.view.View.LAYOUT_DIRECTION_RTL, to="RESOLVED_DIRECTION_RTL")}) public int getLayoutDirection();
    method @android.view.ViewDebug.ExportedProperty(deepExport=true, prefix="layout_") public android.view.ViewGroup.LayoutParams getLayoutParams();
    method @android.view.ViewDebug.CapturedViewProperty public final int getLeft();
    method protected float getLeftFadingEdgeStrength();
    method protected int getLeftPaddingOffset();
    method public final boolean getLocalVisibleRect(android.graphics.Rect);
    method public void getLocationInWindow(@Size(2) int[]);
    method public void getLocationOnScreen(@Size(2) int[]);
    method public android.graphics.Matrix getMatrix();
    method public final int getMeasuredHeight();
    method @android.view.ViewDebug.ExportedProperty(category="measurement", flagMapping={@android.view.ViewDebug.FlagToString(mask=android.view.View.MEASURED_STATE_MASK, equals=android.view.View.MEASURED_STATE_TOO_SMALL, name="MEASURED_STATE_TOO_SMALL")}) public final int getMeasuredHeightAndState();
    method public final int getMeasuredState();
    method public final int getMeasuredWidth();
    method @android.view.ViewDebug.ExportedProperty(category="measurement", flagMapping={@android.view.ViewDebug.FlagToString(mask=android.view.View.MEASURED_STATE_MASK, equals=android.view.View.MEASURED_STATE_TOO_SMALL, name="MEASURED_STATE_TOO_SMALL")}) public final int getMeasuredWidthAndState();
    method public int getMinimumHeight();
    method public int getMinimumWidth();
    method public int getNextClusterForwardId();
    method public int getNextFocusDownId();
    method public int getNextFocusForwardId();
    method public int getNextFocusLeftId();
    method public int getNextFocusRightId();
    method public int getNextFocusUpId();
    method public android.view.View.OnFocusChangeListener getOnFocusChangeListener();
    method @ColorInt public int getOutlineAmbientShadowColor();
    method public android.view.ViewOutlineProvider getOutlineProvider();
    method @ColorInt public int getOutlineSpotShadowColor();
    method public int getOverScrollMode();
    method public android.view.ViewOverlay getOverlay();
    method public int getPaddingBottom();
    method public int getPaddingEnd();
    method public int getPaddingLeft();
    method public int getPaddingRight();
    method public int getPaddingStart();
    method public int getPaddingTop();
    method public final android.view.ViewParent getParent();
    method public android.view.ViewParent getParentForAccessibility();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getPivotX();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getPivotY();
    method public android.view.PointerIcon getPointerIcon();
    method public android.content.res.Resources getResources();
    method public final boolean getRevealOnFocusHint();
    method @android.view.ViewDebug.CapturedViewProperty public final int getRight();
    method protected float getRightFadingEdgeStrength();
    method protected int getRightPaddingOffset();
    method public android.view.View getRootView();
    method public android.view.WindowInsets getRootWindowInsets();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getRotation();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getRotationX();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getRotationY();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getScaleX();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getScaleY();
    method public int getScrollBarDefaultDelayBeforeFade();
    method public int getScrollBarFadeDuration();
    method public int getScrollBarSize();
    method @android.view.ViewDebug.ExportedProperty(mapping={@android.view.ViewDebug.IntToString(from=android.view.View.SCROLLBARS_INSIDE_OVERLAY, to="INSIDE_OVERLAY"), @android.view.ViewDebug.IntToString(from=android.view.View.SCROLLBARS_INSIDE_INSET, to="INSIDE_INSET"), @android.view.ViewDebug.IntToString(from=android.view.View.SCROLLBARS_OUTSIDE_OVERLAY, to="OUTSIDE_OVERLAY"), @android.view.ViewDebug.IntToString(from=android.view.View.SCROLLBARS_OUTSIDE_INSET, to="OUTSIDE_INSET")}) public int getScrollBarStyle();
    method public int getScrollIndicators();
    method public final int getScrollX();
    method public final int getScrollY();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") @ColorInt public int getSolidColor();
    method public android.animation.StateListAnimator getStateListAnimator();
    method protected int getSuggestedMinimumHeight();
    method protected int getSuggestedMinimumWidth();
    method public int getSystemUiVisibility();
    method @android.view.ViewDebug.ExportedProperty public Object getTag();
    method public Object getTag(int);
    method @android.view.ViewDebug.ExportedProperty(category="text", mapping={@android.view.ViewDebug.IntToString(from=android.view.View.TEXT_ALIGNMENT_INHERIT, to="INHERIT"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_ALIGNMENT_GRAVITY, to="GRAVITY"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_ALIGNMENT_TEXT_START, to="TEXT_START"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_ALIGNMENT_TEXT_END, to="TEXT_END"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_ALIGNMENT_CENTER, to="CENTER"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_ALIGNMENT_VIEW_START, to="VIEW_START"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_ALIGNMENT_VIEW_END, to="VIEW_END")}) public int getTextAlignment();
    method @android.view.ViewDebug.ExportedProperty(category="text", mapping={@android.view.ViewDebug.IntToString(from=android.view.View.TEXT_DIRECTION_INHERIT, to="INHERIT"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_DIRECTION_FIRST_STRONG, to="FIRST_STRONG"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_DIRECTION_ANY_RTL, to="ANY_RTL"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_DIRECTION_LTR, to="LTR"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_DIRECTION_RTL, to="RTL"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_DIRECTION_LOCALE, to="LOCALE"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_DIRECTION_FIRST_STRONG_LTR, to="FIRST_STRONG_LTR"), @android.view.ViewDebug.IntToString(from=android.view.View.TEXT_DIRECTION_FIRST_STRONG_RTL, to="FIRST_STRONG_RTL")}) public int getTextDirection();
    method @Nullable public CharSequence getTooltipText();
    method @android.view.ViewDebug.CapturedViewProperty public final int getTop();
    method protected float getTopFadingEdgeStrength();
    method protected int getTopPaddingOffset();
    method public android.view.TouchDelegate getTouchDelegate();
    method public java.util.ArrayList<android.view.View> getTouchables();
    method @android.view.ViewDebug.ExportedProperty public String getTransitionName();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getTranslationX();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getTranslationY();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getTranslationZ();
    method public int getVerticalFadingEdgeLength();
    method public int getVerticalScrollbarPosition();
    method public int getVerticalScrollbarWidth();
    method public android.view.ViewTreeObserver getViewTreeObserver();
    method @android.view.ViewDebug.ExportedProperty(mapping={@android.view.ViewDebug.IntToString(from=android.view.View.VISIBLE, to="VISIBLE"), @android.view.ViewDebug.IntToString(from=android.view.View.INVISIBLE, to="INVISIBLE"), @android.view.ViewDebug.IntToString(from=android.view.View.GONE, to="GONE")}) public int getVisibility();
    method @android.view.ViewDebug.ExportedProperty(category="layout") public final int getWidth();
    method protected int getWindowAttachCount();
    method public android.view.WindowId getWindowId();
    method public int getWindowSystemUiVisibility();
    method public android.os.IBinder getWindowToken();
    method public int getWindowVisibility();
    method public void getWindowVisibleDisplayFrame(android.graphics.Rect);
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getX();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getY();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public float getZ();
    method public boolean hasExplicitFocusable();
    method @android.view.ViewDebug.ExportedProperty(category="focus") public boolean hasFocus();
    method public boolean hasFocusable();
    method public boolean hasNestedScrollingParent();
    method public boolean hasOnClickListeners();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public boolean hasOverlappingRendering();
    method public boolean hasPointerCapture();
    method @android.view.ViewDebug.ExportedProperty(category="layout") public boolean hasTransientState();
    method public boolean hasWindowFocus();
    method public static android.view.View inflate(android.content.Context, @LayoutRes int, android.view.ViewGroup);
    method @Deprecated public void invalidate(android.graphics.Rect);
    method @Deprecated public void invalidate(int, int, int, int);
    method public void invalidate();
    method public void invalidateDrawable(@NonNull android.graphics.drawable.Drawable);
    method public void invalidateOutline();
    method public boolean isAccessibilityFocused();
    method public boolean isAccessibilityHeading();
    method @android.view.ViewDebug.ExportedProperty public boolean isActivated();
    method public boolean isAttachedToWindow();
    method @android.view.ViewDebug.ExportedProperty public boolean isClickable();
    method public boolean isContextClickable();
    method public boolean isDirty();
    method @Deprecated @android.view.ViewDebug.ExportedProperty(category="drawing") public boolean isDrawingCacheEnabled();
    method public boolean isDuplicateParentStateEnabled();
    method @android.view.ViewDebug.ExportedProperty public boolean isEnabled();
    method @android.view.ViewDebug.ExportedProperty(category="focus") public final boolean isFocusable();
    method @android.view.ViewDebug.ExportedProperty(category="focus") public final boolean isFocusableInTouchMode();
    method @android.view.ViewDebug.ExportedProperty(category="focus") public boolean isFocused();
    method @android.view.ViewDebug.ExportedProperty(category="focus") public final boolean isFocusedByDefault();
    method @android.view.ViewDebug.ExportedProperty public boolean isHapticFeedbackEnabled();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public boolean isHardwareAccelerated();
    method public boolean isHorizontalFadingEdgeEnabled();
    method public boolean isHorizontalScrollBarEnabled();
    method @android.view.ViewDebug.ExportedProperty public boolean isHovered();
    method public boolean isImportantForAccessibility();
    method public final boolean isImportantForAutofill();
    method public boolean isInEditMode();
    method public boolean isInLayout();
    method @android.view.ViewDebug.ExportedProperty public boolean isInTouchMode();
    method @android.view.ViewDebug.ExportedProperty(category="focus") public final boolean isKeyboardNavigationCluster();
    method public boolean isLaidOut();
    method public boolean isLayoutDirectionResolved();
    method public boolean isLayoutRequested();
    method public boolean isLongClickable();
    method public boolean isNestedScrollingEnabled();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public boolean isOpaque();
    method protected boolean isPaddingOffsetRequired();
    method public boolean isPaddingRelative();
    method public boolean isPivotSet();
    method @android.view.ViewDebug.ExportedProperty public boolean isPressed();
    method public boolean isSaveEnabled();
    method public boolean isSaveFromParentEnabled();
    method public boolean isScreenReaderFocusable();
    method public boolean isScrollContainer();
    method public boolean isScrollbarFadingEnabled();
    method @android.view.ViewDebug.ExportedProperty public boolean isSelected();
    method public boolean isShown();
    method @android.view.ViewDebug.ExportedProperty public boolean isSoundEffectsEnabled();
    method public final boolean isTemporarilyDetached();
    method public boolean isTextAlignmentResolved();
    method public boolean isTextDirectionResolved();
    method public boolean isVerticalFadingEdgeEnabled();
    method public boolean isVerticalScrollBarEnabled();
    method public boolean isVisibleToUserForAutofill(int);
    method @CallSuper public void jumpDrawablesToCurrentState();
    method public android.view.View keyboardNavigationClusterSearch(android.view.View, int);
    method public void layout(int, int, int, int);
    method public final void measure(int, int);
    method protected static int[] mergeDrawableStates(int[], int[]);
    method public void offsetLeftAndRight(int);
    method public void offsetTopAndBottom(int);
    method @CallSuper protected void onAnimationEnd();
    method @CallSuper protected void onAnimationStart();
    method public android.view.WindowInsets onApplyWindowInsets(android.view.WindowInsets);
    method @CallSuper protected void onAttachedToWindow();
    method public void onCancelPendingInputEvents();
    method public boolean onCapturedPointerEvent(android.view.MotionEvent);
    method public boolean onCheckIsTextEditor();
    method protected void onConfigurationChanged(android.content.res.Configuration);
    method protected void onCreateContextMenu(android.view.ContextMenu);
    method protected int[] onCreateDrawableState(int);
    method public android.view.inputmethod.InputConnection onCreateInputConnection(android.view.inputmethod.EditorInfo);
    method @CallSuper protected void onDetachedFromWindow();
    method protected void onDisplayHint(int);
    method public boolean onDragEvent(android.view.DragEvent);
    method protected void onDraw(android.graphics.Canvas);
    method public void onDrawForeground(android.graphics.Canvas);
    method protected final void onDrawScrollBars(android.graphics.Canvas);
    method public boolean onFilterTouchEventForSecurity(android.view.MotionEvent);
    method @CallSuper protected void onFinishInflate();
    method public void onFinishTemporaryDetach();
    method @CallSuper protected void onFocusChanged(boolean, int, @Nullable android.graphics.Rect);
    method public boolean onGenericMotionEvent(android.view.MotionEvent);
    method public void onHoverChanged(boolean);
    method public boolean onHoverEvent(android.view.MotionEvent);
    method @CallSuper public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method @CallSuper public void onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo);
    method public boolean onKeyDown(int, android.view.KeyEvent);
    method public boolean onKeyLongPress(int, android.view.KeyEvent);
    method public boolean onKeyMultiple(int, int, android.view.KeyEvent);
    method public boolean onKeyPreIme(int, android.view.KeyEvent);
    method public boolean onKeyShortcut(int, android.view.KeyEvent);
    method public boolean onKeyUp(int, android.view.KeyEvent);
    method protected void onLayout(boolean, int, int, int, int);
    method protected void onMeasure(int, int);
    method protected void onOverScrolled(int, int, boolean, boolean);
    method @CallSuper public void onPointerCaptureChange(boolean);
    method @CallSuper public void onPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public void onProvideAutofillStructure(android.view.ViewStructure, int);
    method public void onProvideAutofillVirtualStructure(android.view.ViewStructure, int);
    method public void onProvideStructure(android.view.ViewStructure);
    method public void onProvideVirtualStructure(android.view.ViewStructure);
    method public android.view.PointerIcon onResolvePointerIcon(android.view.MotionEvent, int);
    method @CallSuper protected void onRestoreInstanceState(android.os.Parcelable);
    method public void onRtlPropertiesChanged(int);
    method @CallSuper @Nullable protected android.os.Parcelable onSaveInstanceState();
    method public void onScreenStateChanged(int);
    method protected void onScrollChanged(int, int, int, int);
    method protected boolean onSetAlpha(int);
    method protected 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 @CallSuper public void onVisibilityAggregated(boolean);
    method protected void onVisibilityChanged(@NonNull android.view.View, int);
    method public void onWindowFocusChanged(boolean);
    method public void onWindowSystemUiVisibilityChanged(int);
    method protected void onWindowVisibilityChanged(int);
    method protected boolean overScrollBy(int, int, int, int, int, int, int, int, boolean);
    method public boolean performAccessibilityAction(int, android.os.Bundle);
    method public boolean performClick();
    method public boolean performContextClick(float, float);
    method public boolean performContextClick();
    method public boolean performHapticFeedback(int);
    method public boolean performHapticFeedback(int, int);
    method public boolean performLongClick();
    method public boolean performLongClick(float, float);
    method public void playSoundEffect(int);
    method public boolean post(Runnable);
    method public boolean postDelayed(Runnable, long);
    method public void postInvalidate();
    method public void postInvalidate(int, int, int, int);
    method public void postInvalidateDelayed(long);
    method public void postInvalidateDelayed(long, int, int, int, int);
    method public void postInvalidateOnAnimation();
    method public void postInvalidateOnAnimation(int, int, int, int);
    method public void postOnAnimation(Runnable);
    method public void postOnAnimationDelayed(Runnable, long);
    method public void refreshDrawableState();
    method public void releasePointerCapture();
    method public boolean removeCallbacks(Runnable);
    method public void removeOnAttachStateChangeListener(android.view.View.OnAttachStateChangeListener);
    method public void removeOnLayoutChangeListener(android.view.View.OnLayoutChangeListener);
    method public void removeOnUnhandledKeyEventListener(android.view.View.OnUnhandledKeyEventListener);
    method public void requestApplyInsets();
    method @Deprecated public void requestFitSystemWindows();
    method public final boolean requestFocus();
    method public final boolean requestFocus(int);
    method public boolean requestFocus(int, android.graphics.Rect);
    method public final boolean requestFocusFromTouch();
    method @CallSuper public void requestLayout();
    method public void requestPointerCapture();
    method public boolean requestRectangleOnScreen(android.graphics.Rect);
    method public boolean requestRectangleOnScreen(android.graphics.Rect, boolean);
    method public final void requestUnbufferedDispatch(android.view.MotionEvent);
    method @NonNull public final <T extends android.view.View> T requireViewById(@IdRes int);
    method public void resetPivot();
    method public static int resolveSize(int, int);
    method public static int resolveSizeAndState(int, int, int);
    method public boolean restoreDefaultFocus();
    method public void restoreHierarchyState(android.util.SparseArray<android.os.Parcelable>);
    method public void saveHierarchyState(android.util.SparseArray<android.os.Parcelable>);
    method public void scheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable, long);
    method public void scrollBy(int, int);
    method public void scrollTo(int, int);
    method public void sendAccessibilityEvent(int);
    method public void sendAccessibilityEventUnchecked(android.view.accessibility.AccessibilityEvent);
    method public void setAccessibilityDelegate(@Nullable android.view.View.AccessibilityDelegate);
    method public void setAccessibilityHeading(boolean);
    method public void setAccessibilityLiveRegion(int);
    method public void setAccessibilityPaneTitle(@Nullable CharSequence);
    method public void setAccessibilityTraversalAfter(int);
    method public void setAccessibilityTraversalBefore(int);
    method public void setActivated(boolean);
    method public void setAlpha(@FloatRange(from=0.0, to=1.0) float);
    method public void setAnimation(android.view.animation.Animation);
    method public void setAutofillHints(@Nullable java.lang.String...);
    method public void setAutofillId(@Nullable android.view.autofill.AutofillId);
    method public void setBackground(android.graphics.drawable.Drawable);
    method public void setBackgroundColor(@ColorInt int);
    method @Deprecated public void setBackgroundDrawable(android.graphics.drawable.Drawable);
    method public void setBackgroundResource(@DrawableRes int);
    method public void setBackgroundTintList(@Nullable android.content.res.ColorStateList);
    method public void setBackgroundTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public final void setBottom(int);
    method public void setCameraDistance(float);
    method public void setClickable(boolean);
    method public void setClipBounds(android.graphics.Rect);
    method public void setClipToOutline(boolean);
    method public void setContentDescription(CharSequence);
    method public void setContextClickable(boolean);
    method public void setDefaultFocusHighlightEnabled(boolean);
    method @Deprecated public void setDrawingCacheBackgroundColor(@ColorInt int);
    method @Deprecated public void setDrawingCacheEnabled(boolean);
    method @Deprecated public void setDrawingCacheQuality(int);
    method public void setDuplicateParentStateEnabled(boolean);
    method public void setElevation(float);
    method public void setEnabled(boolean);
    method public void setFadingEdgeLength(int);
    method public void setFilterTouchesWhenObscured(boolean);
    method public void setFitsSystemWindows(boolean);
    method public void setFocusable(boolean);
    method public void setFocusable(int);
    method public void setFocusableInTouchMode(boolean);
    method public void setFocusedByDefault(boolean);
    method public void setForeground(android.graphics.drawable.Drawable);
    method public void setForegroundGravity(int);
    method public void setForegroundTintList(@Nullable android.content.res.ColorStateList);
    method public void setForegroundTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public void setHapticFeedbackEnabled(boolean);
    method public void setHasTransientState(boolean);
    method public void setHorizontalFadingEdgeEnabled(boolean);
    method public void setHorizontalScrollBarEnabled(boolean);
    method public void setHovered(boolean);
    method public void setId(@IdRes int);
    method public void setImportantForAccessibility(int);
    method public void setImportantForAutofill(int);
    method public void setKeepScreenOn(boolean);
    method public void setKeyboardNavigationCluster(boolean);
    method public void setLabelFor(@IdRes int);
    method public void setLayerPaint(@Nullable android.graphics.Paint);
    method public void setLayerType(int, @Nullable android.graphics.Paint);
    method public void setLayoutDirection(int);
    method public void setLayoutParams(android.view.ViewGroup.LayoutParams);
    method public final void setLeft(int);
    method public void setLongClickable(boolean);
    method protected final void setMeasuredDimension(int, int);
    method public void setMinimumHeight(int);
    method public void setMinimumWidth(int);
    method public void setNestedScrollingEnabled(boolean);
    method public void setNextClusterForwardId(int);
    method public void setNextFocusDownId(int);
    method public void setNextFocusForwardId(int);
    method public void setNextFocusLeftId(int);
    method public void setNextFocusRightId(int);
    method public void setNextFocusUpId(int);
    method public void setOnApplyWindowInsetsListener(android.view.View.OnApplyWindowInsetsListener);
    method public void setOnCapturedPointerListener(android.view.View.OnCapturedPointerListener);
    method public void setOnClickListener(@Nullable android.view.View.OnClickListener);
    method public void setOnContextClickListener(@Nullable android.view.View.OnContextClickListener);
    method public void setOnCreateContextMenuListener(android.view.View.OnCreateContextMenuListener);
    method public void setOnDragListener(android.view.View.OnDragListener);
    method public void setOnFocusChangeListener(android.view.View.OnFocusChangeListener);
    method public void setOnGenericMotionListener(android.view.View.OnGenericMotionListener);
    method public void setOnHoverListener(android.view.View.OnHoverListener);
    method public void setOnKeyListener(android.view.View.OnKeyListener);
    method public void setOnLongClickListener(@Nullable android.view.View.OnLongClickListener);
    method public void setOnScrollChangeListener(android.view.View.OnScrollChangeListener);
    method public void setOnSystemUiVisibilityChangeListener(android.view.View.OnSystemUiVisibilityChangeListener);
    method public void setOnTouchListener(android.view.View.OnTouchListener);
    method public void setOutlineAmbientShadowColor(@ColorInt int);
    method public void setOutlineProvider(android.view.ViewOutlineProvider);
    method public void setOutlineSpotShadowColor(@ColorInt int);
    method public void setOverScrollMode(int);
    method public void setPadding(int, int, int, int);
    method public void setPaddingRelative(int, int, int, int);
    method public void setPivotX(float);
    method public void setPivotY(float);
    method public void setPointerIcon(android.view.PointerIcon);
    method public void setPressed(boolean);
    method public final void setRevealOnFocusHint(boolean);
    method public final void setRight(int);
    method public void setRotation(float);
    method public void setRotationX(float);
    method public void setRotationY(float);
    method public void setSaveEnabled(boolean);
    method public void setSaveFromParentEnabled(boolean);
    method public void setScaleX(float);
    method public void setScaleY(float);
    method public void setScreenReaderFocusable(boolean);
    method public void setScrollBarDefaultDelayBeforeFade(int);
    method public void setScrollBarFadeDuration(int);
    method public void setScrollBarSize(int);
    method public void setScrollBarStyle(int);
    method public void setScrollContainer(boolean);
    method public void setScrollIndicators(int);
    method public void setScrollIndicators(int, int);
    method public void setScrollX(int);
    method public void setScrollY(int);
    method public void setScrollbarFadingEnabled(boolean);
    method public void setSelected(boolean);
    method public void setSoundEffectsEnabled(boolean);
    method public void setStateListAnimator(android.animation.StateListAnimator);
    method public void setSystemUiVisibility(int);
    method public void setTag(Object);
    method public void setTag(int, Object);
    method public void setTextAlignment(int);
    method public void setTextDirection(int);
    method public void setTooltipText(@Nullable CharSequence);
    method public final void setTop(int);
    method public void setTouchDelegate(android.view.TouchDelegate);
    method public final void setTransitionName(String);
    method public void setTranslationX(float);
    method public void setTranslationY(float);
    method public void setTranslationZ(float);
    method public void setVerticalFadingEdgeEnabled(boolean);
    method public void setVerticalScrollBarEnabled(boolean);
    method public void setVerticalScrollbarPosition(int);
    method public void setVisibility(int);
    method @Deprecated public void setWillNotCacheDrawing(boolean);
    method public void setWillNotDraw(boolean);
    method public void setX(float);
    method public void setY(float);
    method public void setZ(float);
    method public boolean showContextMenu();
    method public boolean showContextMenu(float, float);
    method public android.view.ActionMode startActionMode(android.view.ActionMode.Callback);
    method public android.view.ActionMode startActionMode(android.view.ActionMode.Callback, int);
    method public void startAnimation(android.view.animation.Animation);
    method @Deprecated public final boolean startDrag(android.content.ClipData, android.view.View.DragShadowBuilder, Object, int);
    method public final boolean startDragAndDrop(android.content.ClipData, android.view.View.DragShadowBuilder, Object, int);
    method public boolean startNestedScroll(int);
    method public void stopNestedScroll();
    method public void unscheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable);
    method public void unscheduleDrawable(android.graphics.drawable.Drawable);
    method public final void updateDragShadow(android.view.View.DragShadowBuilder);
    method @CallSuper protected boolean verifyDrawable(@NonNull android.graphics.drawable.Drawable);
    method @Deprecated @android.view.ViewDebug.ExportedProperty(category="drawing") public boolean willNotCacheDrawing();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public boolean willNotDraw();
    field public static final int ACCESSIBILITY_LIVE_REGION_ASSERTIVE = 2; // 0x2
    field public static final int ACCESSIBILITY_LIVE_REGION_NONE = 0; // 0x0
    field public static final int ACCESSIBILITY_LIVE_REGION_POLITE = 1; // 0x1
    field public static final android.util.Property<android.view.View,java.lang.Float> ALPHA;
    field public static final int AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 1; // 0x1
    field public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = "creditCardExpirationDate";
    field public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay";
    field public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = "creditCardExpirationMonth";
    field public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = "creditCardExpirationYear";
    field public static final String AUTOFILL_HINT_CREDIT_CARD_NUMBER = "creditCardNumber";
    field public static final String AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = "creditCardSecurityCode";
    field public static final String AUTOFILL_HINT_EMAIL_ADDRESS = "emailAddress";
    field public static final String AUTOFILL_HINT_NAME = "name";
    field public static final String AUTOFILL_HINT_PASSWORD = "password";
    field public static final String AUTOFILL_HINT_PHONE = "phone";
    field public static final String AUTOFILL_HINT_POSTAL_ADDRESS = "postalAddress";
    field public static final String AUTOFILL_HINT_POSTAL_CODE = "postalCode";
    field public static final String AUTOFILL_HINT_USERNAME = "username";
    field public static final int AUTOFILL_TYPE_DATE = 4; // 0x4
    field public static final int AUTOFILL_TYPE_LIST = 3; // 0x3
    field public static final int AUTOFILL_TYPE_NONE = 0; // 0x0
    field public static final int AUTOFILL_TYPE_TEXT = 1; // 0x1
    field public static final int AUTOFILL_TYPE_TOGGLE = 2; // 0x2
    field public static final int DRAG_FLAG_GLOBAL = 256; // 0x100
    field public static final int DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION = 64; // 0x40
    field public static final int DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION = 128; // 0x80
    field public static final int DRAG_FLAG_GLOBAL_URI_READ = 1; // 0x1
    field public static final int DRAG_FLAG_GLOBAL_URI_WRITE = 2; // 0x2
    field public static final int DRAG_FLAG_OPAQUE = 512; // 0x200
    field @Deprecated public static final int DRAWING_CACHE_QUALITY_AUTO = 0; // 0x0
    field @Deprecated public static final int DRAWING_CACHE_QUALITY_HIGH = 1048576; // 0x100000
    field @Deprecated public static final int DRAWING_CACHE_QUALITY_LOW = 524288; // 0x80000
    field protected static final int[] EMPTY_STATE_SET;
    field protected static final int[] ENABLED_FOCUSED_SELECTED_STATE_SET;
    field protected static final int[] ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] ENABLED_FOCUSED_STATE_SET;
    field protected static final int[] ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] ENABLED_SELECTED_STATE_SET;
    field protected static final int[] ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] ENABLED_STATE_SET;
    field protected static final int[] ENABLED_WINDOW_FOCUSED_STATE_SET;
    field public static final int FIND_VIEWS_WITH_CONTENT_DESCRIPTION = 2; // 0x2
    field public static final int FIND_VIEWS_WITH_TEXT = 1; // 0x1
    field public static final int FOCUSABLE = 1; // 0x1
    field public static final int FOCUSABLES_ALL = 0; // 0x0
    field public static final int FOCUSABLES_TOUCH_MODE = 1; // 0x1
    field public static final int FOCUSABLE_AUTO = 16; // 0x10
    field protected static final int[] FOCUSED_SELECTED_STATE_SET;
    field protected static final int[] FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] FOCUSED_STATE_SET;
    field protected static final int[] FOCUSED_WINDOW_FOCUSED_STATE_SET;
    field public static final int FOCUS_BACKWARD = 1; // 0x1
    field public static final int FOCUS_DOWN = 130; // 0x82
    field public static final int FOCUS_FORWARD = 2; // 0x2
    field public static final int FOCUS_LEFT = 17; // 0x11
    field public static final int FOCUS_RIGHT = 66; // 0x42
    field public static final int FOCUS_UP = 33; // 0x21
    field public static final int GONE = 8; // 0x8
    field public static final int HAPTIC_FEEDBACK_ENABLED = 268435456; // 0x10000000
    field public static final int IMPORTANT_FOR_ACCESSIBILITY_AUTO = 0; // 0x0
    field public static final int IMPORTANT_FOR_ACCESSIBILITY_NO = 2; // 0x2
    field public static final int IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS = 4; // 0x4
    field public static final int IMPORTANT_FOR_ACCESSIBILITY_YES = 1; // 0x1
    field public static final int IMPORTANT_FOR_AUTOFILL_AUTO = 0; // 0x0
    field public static final int IMPORTANT_FOR_AUTOFILL_NO = 2; // 0x2
    field public static final int IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS = 8; // 0x8
    field public static final int IMPORTANT_FOR_AUTOFILL_YES = 1; // 0x1
    field public static final int IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS = 4; // 0x4
    field public static final int INVISIBLE = 4; // 0x4
    field public static final int KEEP_SCREEN_ON = 67108864; // 0x4000000
    field public static final int LAYER_TYPE_HARDWARE = 2; // 0x2
    field public static final int LAYER_TYPE_NONE = 0; // 0x0
    field public static final int LAYER_TYPE_SOFTWARE = 1; // 0x1
    field public static final int LAYOUT_DIRECTION_INHERIT = 2; // 0x2
    field public static final int LAYOUT_DIRECTION_LOCALE = 3; // 0x3
    field public static final int LAYOUT_DIRECTION_LTR = 0; // 0x0
    field public static final int LAYOUT_DIRECTION_RTL = 1; // 0x1
    field public static final int MEASURED_HEIGHT_STATE_SHIFT = 16; // 0x10
    field public static final int MEASURED_SIZE_MASK = 16777215; // 0xffffff
    field public static final int MEASURED_STATE_MASK = -16777216; // 0xff000000
    field public static final int MEASURED_STATE_TOO_SMALL = 16777216; // 0x1000000
    field public static final int NOT_FOCUSABLE = 0; // 0x0
    field public static final int NO_ID = -1; // 0xffffffff
    field public static final int OVER_SCROLL_ALWAYS = 0; // 0x0
    field public static final int OVER_SCROLL_IF_CONTENT_SCROLLS = 1; // 0x1
    field public static final int OVER_SCROLL_NEVER = 2; // 0x2
    field protected static final int[] PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET;
    field protected static final int[] PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] PRESSED_ENABLED_FOCUSED_STATE_SET;
    field protected static final int[] PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] PRESSED_ENABLED_SELECTED_STATE_SET;
    field protected static final int[] PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] PRESSED_ENABLED_STATE_SET;
    field protected static final int[] PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] PRESSED_FOCUSED_SELECTED_STATE_SET;
    field protected static final int[] PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] PRESSED_FOCUSED_STATE_SET;
    field protected static final int[] PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] PRESSED_SELECTED_STATE_SET;
    field protected static final int[] PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] PRESSED_STATE_SET;
    field protected static final int[] PRESSED_WINDOW_FOCUSED_STATE_SET;
    field public static final android.util.Property<android.view.View,java.lang.Float> ROTATION;
    field public static final android.util.Property<android.view.View,java.lang.Float> ROTATION_X;
    field public static final android.util.Property<android.view.View,java.lang.Float> ROTATION_Y;
    field public static final android.util.Property<android.view.View,java.lang.Float> SCALE_X;
    field public static final android.util.Property<android.view.View,java.lang.Float> SCALE_Y;
    field public static final int SCREEN_STATE_OFF = 0; // 0x0
    field public static final int SCREEN_STATE_ON = 1; // 0x1
    field public static final int SCROLLBARS_INSIDE_INSET = 16777216; // 0x1000000
    field public static final int SCROLLBARS_INSIDE_OVERLAY = 0; // 0x0
    field public static final int SCROLLBARS_OUTSIDE_INSET = 50331648; // 0x3000000
    field public static final int SCROLLBARS_OUTSIDE_OVERLAY = 33554432; // 0x2000000
    field public static final int SCROLLBAR_POSITION_DEFAULT = 0; // 0x0
    field public static final int SCROLLBAR_POSITION_LEFT = 1; // 0x1
    field public static final int SCROLLBAR_POSITION_RIGHT = 2; // 0x2
    field public static final int SCROLL_AXIS_HORIZONTAL = 1; // 0x1
    field public static final int SCROLL_AXIS_NONE = 0; // 0x0
    field public static final int SCROLL_AXIS_VERTICAL = 2; // 0x2
    field public static final int SCROLL_INDICATOR_BOTTOM = 2; // 0x2
    field public static final int SCROLL_INDICATOR_END = 32; // 0x20
    field public static final int SCROLL_INDICATOR_LEFT = 4; // 0x4
    field public static final int SCROLL_INDICATOR_RIGHT = 8; // 0x8
    field public static final int SCROLL_INDICATOR_START = 16; // 0x10
    field public static final int SCROLL_INDICATOR_TOP = 1; // 0x1
    field protected static final int[] SELECTED_STATE_SET;
    field protected static final int[] SELECTED_WINDOW_FOCUSED_STATE_SET;
    field public static final int SOUND_EFFECTS_ENABLED = 134217728; // 0x8000000
    field @Deprecated public static final int STATUS_BAR_HIDDEN = 1; // 0x1
    field @Deprecated public static final int STATUS_BAR_VISIBLE = 0; // 0x0
    field public static final int SYSTEM_UI_FLAG_FULLSCREEN = 4; // 0x4
    field public static final int SYSTEM_UI_FLAG_HIDE_NAVIGATION = 2; // 0x2
    field public static final int SYSTEM_UI_FLAG_IMMERSIVE = 2048; // 0x800
    field public static final int SYSTEM_UI_FLAG_IMMERSIVE_STICKY = 4096; // 0x1000
    field public static final int SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN = 1024; // 0x400
    field public static final int SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION = 512; // 0x200
    field public static final int SYSTEM_UI_FLAG_LAYOUT_STABLE = 256; // 0x100
    field public static final int SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR = 16; // 0x10
    field public static final int SYSTEM_UI_FLAG_LIGHT_STATUS_BAR = 8192; // 0x2000
    field public static final int SYSTEM_UI_FLAG_LOW_PROFILE = 1; // 0x1
    field public static final int SYSTEM_UI_FLAG_VISIBLE = 0; // 0x0
    field public static final int SYSTEM_UI_LAYOUT_FLAGS = 1536; // 0x600
    field public static final int TEXT_ALIGNMENT_CENTER = 4; // 0x4
    field public static final int TEXT_ALIGNMENT_GRAVITY = 1; // 0x1
    field public static final int TEXT_ALIGNMENT_INHERIT = 0; // 0x0
    field public static final int TEXT_ALIGNMENT_TEXT_END = 3; // 0x3
    field public static final int TEXT_ALIGNMENT_TEXT_START = 2; // 0x2
    field public static final int TEXT_ALIGNMENT_VIEW_END = 6; // 0x6
    field public static final int TEXT_ALIGNMENT_VIEW_START = 5; // 0x5
    field public static final int TEXT_DIRECTION_ANY_RTL = 2; // 0x2
    field public static final int TEXT_DIRECTION_FIRST_STRONG = 1; // 0x1
    field public static final int TEXT_DIRECTION_FIRST_STRONG_LTR = 6; // 0x6
    field public static final int TEXT_DIRECTION_FIRST_STRONG_RTL = 7; // 0x7
    field public static final int TEXT_DIRECTION_INHERIT = 0; // 0x0
    field public static final int TEXT_DIRECTION_LOCALE = 5; // 0x5
    field public static final int TEXT_DIRECTION_LTR = 3; // 0x3
    field public static final int TEXT_DIRECTION_RTL = 4; // 0x4
    field public static final android.util.Property<android.view.View,java.lang.Float> TRANSLATION_X;
    field public static final android.util.Property<android.view.View,java.lang.Float> TRANSLATION_Y;
    field public static final android.util.Property<android.view.View,java.lang.Float> TRANSLATION_Z;
    field protected static final String VIEW_LOG_TAG = "View";
    field public static final int VISIBLE = 0; // 0x0
    field protected static final int[] WINDOW_FOCUSED_STATE_SET;
    field public static final android.util.Property<android.view.View,java.lang.Float> X;
    field public static final android.util.Property<android.view.View,java.lang.Float> Y;
    field public static final android.util.Property<android.view.View,java.lang.Float> Z;
  }

  public static class View.AccessibilityDelegate {
    ctor public View.AccessibilityDelegate();
    method public void addExtraDataToAccessibilityNodeInfo(@NonNull android.view.View, @NonNull android.view.accessibility.AccessibilityNodeInfo, @NonNull String, @Nullable android.os.Bundle);
    method public boolean dispatchPopulateAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public android.view.accessibility.AccessibilityNodeProvider getAccessibilityNodeProvider(android.view.View);
    method public void onInitializeAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public void onInitializeAccessibilityNodeInfo(android.view.View, android.view.accessibility.AccessibilityNodeInfo);
    method public void onPopulateAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public boolean onRequestSendAccessibilityEvent(android.view.ViewGroup, android.view.View, android.view.accessibility.AccessibilityEvent);
    method public boolean performAccessibilityAction(android.view.View, int, android.os.Bundle);
    method public void sendAccessibilityEvent(android.view.View, int);
    method public void sendAccessibilityEventUnchecked(android.view.View, android.view.accessibility.AccessibilityEvent);
  }

  public static class View.BaseSavedState extends android.view.AbsSavedState {
    ctor public View.BaseSavedState(android.os.Parcel);
    ctor public View.BaseSavedState(android.os.Parcel, ClassLoader);
    ctor public View.BaseSavedState(android.os.Parcelable);
    field public static final android.os.Parcelable.Creator<android.view.View.BaseSavedState> CREATOR;
  }

  public static class View.DragShadowBuilder {
    ctor public View.DragShadowBuilder(android.view.View);
    ctor public View.DragShadowBuilder();
    method public final android.view.View getView();
    method public void onDrawShadow(android.graphics.Canvas);
    method public void onProvideShadowMetrics(android.graphics.Point, android.graphics.Point);
  }

  public static class View.MeasureSpec {
    ctor public View.MeasureSpec();
    method public static int getMode(int);
    method public static int getSize(int);
    method public static int makeMeasureSpec(@IntRange(from=0, to=0x40000000 - 1) int, int);
    method public static String toString(int);
    field public static final int AT_MOST = -2147483648; // 0x80000000
    field public static final int EXACTLY = 1073741824; // 0x40000000
    field public static final int UNSPECIFIED = 0; // 0x0
  }

  public static interface View.OnApplyWindowInsetsListener {
    method public android.view.WindowInsets onApplyWindowInsets(android.view.View, android.view.WindowInsets);
  }

  public static interface View.OnAttachStateChangeListener {
    method public void onViewAttachedToWindow(android.view.View);
    method public void onViewDetachedFromWindow(android.view.View);
  }

  public static interface View.OnCapturedPointerListener {
    method public boolean onCapturedPointer(android.view.View, android.view.MotionEvent);
  }

  public static interface View.OnClickListener {
    method public void onClick(android.view.View);
  }

  public static interface View.OnContextClickListener {
    method public boolean onContextClick(android.view.View);
  }

  public static interface View.OnCreateContextMenuListener {
    method public void onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo);
  }

  public static interface View.OnDragListener {
    method public boolean onDrag(android.view.View, android.view.DragEvent);
  }

  public static interface View.OnFocusChangeListener {
    method public void onFocusChange(android.view.View, boolean);
  }

  public static interface View.OnGenericMotionListener {
    method public boolean onGenericMotion(android.view.View, android.view.MotionEvent);
  }

  public static interface View.OnHoverListener {
    method public boolean onHover(android.view.View, android.view.MotionEvent);
  }

  public static interface View.OnKeyListener {
    method public boolean onKey(android.view.View, int, android.view.KeyEvent);
  }

  public static interface View.OnLayoutChangeListener {
    method public void onLayoutChange(android.view.View, int, int, int, int, int, int, int, int);
  }

  public static interface View.OnLongClickListener {
    method public boolean onLongClick(android.view.View);
  }

  public static interface View.OnScrollChangeListener {
    method public void onScrollChange(android.view.View, int, int, int, int);
  }

  public static interface View.OnSystemUiVisibilityChangeListener {
    method public void onSystemUiVisibilityChange(int);
  }

  public static interface View.OnTouchListener {
    method public boolean onTouch(android.view.View, android.view.MotionEvent);
  }

  public static interface View.OnUnhandledKeyEventListener {
    method public boolean onUnhandledKeyEvent(android.view.View, android.view.KeyEvent);
  }

  public final class ViewAnimationUtils {
    method public static android.animation.Animator createCircularReveal(android.view.View, int, int, float, float);
  }

  public class ViewConfiguration {
    ctor @Deprecated public ViewConfiguration();
    method public static android.view.ViewConfiguration get(android.content.Context);
    method public static long getDefaultActionModeHideDuration();
    method public static int getDoubleTapTimeout();
    method @Deprecated public static int getEdgeSlop();
    method @Deprecated public static int getFadingEdgeLength();
    method @Deprecated public static long getGlobalActionKeyTimeout();
    method public static int getJumpTapTimeout();
    method public static int getKeyRepeatDelay();
    method public static int getKeyRepeatTimeout();
    method public static int getLongPressTimeout();
    method @Deprecated public static int getMaximumDrawingCacheSize();
    method @Deprecated public static int getMaximumFlingVelocity();
    method @Deprecated public static int getMinimumFlingVelocity();
    method public static int getPressedStateDuration();
    method public int getScaledDoubleTapSlop();
    method public int getScaledEdgeSlop();
    method public int getScaledFadingEdgeLength();
    method public float getScaledHorizontalScrollFactor();
    method public int getScaledHoverSlop();
    method public int getScaledMaximumDrawingCacheSize();
    method public int getScaledMaximumFlingVelocity();
    method public int getScaledMinimumFlingVelocity();
    method public int getScaledOverflingDistance();
    method public int getScaledOverscrollDistance();
    method public int getScaledPagingTouchSlop();
    method public int getScaledScrollBarSize();
    method public int getScaledTouchSlop();
    method public float getScaledVerticalScrollFactor();
    method public int getScaledWindowTouchSlop();
    method public static int getScrollBarFadeDuration();
    method @Deprecated public static int getScrollBarSize();
    method public static int getScrollDefaultDelay();
    method public static float getScrollFriction();
    method public static int getTapTimeout();
    method @Deprecated public static int getTouchSlop();
    method @Deprecated public static int getWindowTouchSlop();
    method public static long getZoomControlsTimeout();
    method public boolean hasPermanentMenuKey();
    method public boolean shouldShowMenuShortcutsWhenKeyboardPresent();
  }

  public class ViewDebug {
    ctor public ViewDebug();
    method public static void dumpCapturedView(String, Object);
    method @Deprecated public static void startHierarchyTracing(String, android.view.View);
    method @Deprecated public static void startRecyclerTracing(String, android.view.View);
    method @Deprecated public static void stopHierarchyTracing();
    method @Deprecated public static void stopRecyclerTracing();
    method @Deprecated public static void trace(android.view.View, android.view.ViewDebug.RecyclerTraceType, int...);
    method @Deprecated public static void trace(android.view.View, android.view.ViewDebug.HierarchyTraceType);
    field @Deprecated public static final boolean TRACE_HIERARCHY = false;
    field @Deprecated public static final boolean TRACE_RECYCLER = false;
  }

  @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public static @interface ViewDebug.CapturedViewProperty {
    method public abstract boolean retrieveReturn() default false;
  }

  @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public static @interface ViewDebug.ExportedProperty {
    method public abstract String category() default "";
    method public abstract boolean deepExport() default false;
    method public abstract android.view.ViewDebug.FlagToString[] flagMapping() default {};
    method public abstract boolean formatToHexString() default false;
    method public abstract boolean hasAdjacentMapping() default false;
    method public abstract android.view.ViewDebug.IntToString[] indexMapping() default {};
    method public abstract android.view.ViewDebug.IntToString[] mapping() default {};
    method public abstract String prefix() default "";
    method public abstract boolean resolveId() default false;
  }

  @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public static @interface ViewDebug.FlagToString {
    method public abstract int equals();
    method public abstract int mask();
    method public abstract String name();
    method public abstract boolean outputIf() default true;
  }

  @Deprecated public enum ViewDebug.HierarchyTraceType {
    enum_constant @Deprecated public static final android.view.ViewDebug.HierarchyTraceType BUILD_CACHE;
    enum_constant @Deprecated public static final android.view.ViewDebug.HierarchyTraceType DRAW;
    enum_constant @Deprecated public static final android.view.ViewDebug.HierarchyTraceType INVALIDATE;
    enum_constant @Deprecated public static final android.view.ViewDebug.HierarchyTraceType INVALIDATE_CHILD;
    enum_constant @Deprecated public static final android.view.ViewDebug.HierarchyTraceType INVALIDATE_CHILD_IN_PARENT;
    enum_constant @Deprecated public static final android.view.ViewDebug.HierarchyTraceType ON_LAYOUT;
    enum_constant @Deprecated public static final android.view.ViewDebug.HierarchyTraceType ON_MEASURE;
    enum_constant @Deprecated public static final android.view.ViewDebug.HierarchyTraceType REQUEST_LAYOUT;
  }

  @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public static @interface ViewDebug.IntToString {
    method public abstract int from();
    method public abstract String to();
  }

  @Deprecated public enum ViewDebug.RecyclerTraceType {
    enum_constant @Deprecated public static final android.view.ViewDebug.RecyclerTraceType BIND_VIEW;
    enum_constant @Deprecated public static final android.view.ViewDebug.RecyclerTraceType MOVE_FROM_ACTIVE_TO_SCRAP_HEAP;
    enum_constant @Deprecated public static final android.view.ViewDebug.RecyclerTraceType MOVE_TO_SCRAP_HEAP;
    enum_constant @Deprecated public static final android.view.ViewDebug.RecyclerTraceType NEW_VIEW;
    enum_constant @Deprecated public static final android.view.ViewDebug.RecyclerTraceType RECYCLE_FROM_ACTIVE_HEAP;
    enum_constant @Deprecated public static final android.view.ViewDebug.RecyclerTraceType RECYCLE_FROM_SCRAP_HEAP;
  }

  @UiThread public abstract class ViewGroup extends android.view.View implements android.view.ViewManager android.view.ViewParent {
    ctor public ViewGroup(android.content.Context);
    ctor public ViewGroup(android.content.Context, android.util.AttributeSet);
    ctor public ViewGroup(android.content.Context, android.util.AttributeSet, int);
    ctor public ViewGroup(android.content.Context, android.util.AttributeSet, int, int);
    method public boolean addStatesFromChildren();
    method public void addView(android.view.View);
    method public void addView(android.view.View, int);
    method public void addView(android.view.View, int, int);
    method public void addView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public void addView(android.view.View, int, android.view.ViewGroup.LayoutParams);
    method protected boolean addViewInLayout(android.view.View, int, android.view.ViewGroup.LayoutParams);
    method protected boolean addViewInLayout(android.view.View, int, android.view.ViewGroup.LayoutParams, boolean);
    method protected void attachLayoutAnimationParameters(android.view.View, android.view.ViewGroup.LayoutParams, int, int);
    method protected void attachViewToParent(android.view.View, int, android.view.ViewGroup.LayoutParams);
    method public void bringChildToFront(android.view.View);
    method protected boolean canAnimate();
    method protected boolean checkLayoutParams(android.view.ViewGroup.LayoutParams);
    method public void childDrawableStateChanged(android.view.View);
    method public void childHasTransientStateChanged(android.view.View, boolean);
    method protected void cleanupLayoutState(android.view.View);
    method public void clearChildFocus(android.view.View);
    method public void clearDisappearingChildren();
    method protected void debug(int);
    method protected void detachAllViewsFromParent();
    method protected void detachViewFromParent(android.view.View);
    method protected void detachViewFromParent(int);
    method protected void detachViewsFromParent(int, int);
    method protected void dispatchFreezeSelfOnly(android.util.SparseArray<android.os.Parcelable>);
    method public void dispatchSetActivated(boolean);
    method public void dispatchSetSelected(boolean);
    method protected void dispatchThawSelfOnly(android.util.SparseArray<android.os.Parcelable>);
    method protected boolean drawChild(android.graphics.Canvas, android.view.View, long);
    method public void endViewTransition(android.view.View);
    method public android.view.View focusSearch(android.view.View, int);
    method public void focusableViewAvailable(android.view.View);
    method public boolean gatherTransparentRegion(android.graphics.Region);
    method protected android.view.ViewGroup.LayoutParams generateDefaultLayoutParams();
    method public android.view.ViewGroup.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method protected android.view.ViewGroup.LayoutParams generateLayoutParams(android.view.ViewGroup.LayoutParams);
    method public android.view.View getChildAt(int);
    method public int getChildCount();
    method protected int getChildDrawingOrder(int, int);
    method public static int getChildMeasureSpec(int, int, int);
    method protected boolean getChildStaticTransformation(android.view.View, android.view.animation.Transformation);
    method public boolean getChildVisibleRect(android.view.View, android.graphics.Rect, android.graphics.Point);
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public boolean getClipChildren();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") public boolean getClipToPadding();
    method @android.view.ViewDebug.ExportedProperty(category="focus", mapping={@android.view.ViewDebug.IntToString(from=android.view.ViewGroup.FOCUS_BEFORE_DESCENDANTS, to="FOCUS_BEFORE_DESCENDANTS"), @android.view.ViewDebug.IntToString(from=android.view.ViewGroup.FOCUS_AFTER_DESCENDANTS, to="FOCUS_AFTER_DESCENDANTS"), @android.view.ViewDebug.IntToString(from=android.view.ViewGroup.FOCUS_BLOCK_DESCENDANTS, to="FOCUS_BLOCK_DESCENDANTS")}) public int getDescendantFocusability();
    method public android.view.View getFocusedChild();
    method public android.view.animation.LayoutAnimationController getLayoutAnimation();
    method public android.view.animation.Animation.AnimationListener getLayoutAnimationListener();
    method public int getLayoutMode();
    method public android.animation.LayoutTransition getLayoutTransition();
    method public int getNestedScrollAxes();
    method public android.view.ViewGroupOverlay getOverlay();
    method @Deprecated @android.view.ViewDebug.ExportedProperty(category="drawing", mapping={@android.view.ViewDebug.IntToString(from=android.view.ViewGroup.PERSISTENT_NO_CACHE, to="NONE"), @android.view.ViewDebug.IntToString(from=android.view.ViewGroup.PERSISTENT_ANIMATION_CACHE, to="ANIMATION"), @android.view.ViewDebug.IntToString(from=android.view.ViewGroup.PERSISTENT_SCROLLING_CACHE, to="SCROLLING"), @android.view.ViewDebug.IntToString(from=android.view.ViewGroup.PERSISTENT_ALL_CACHES, to="ALL")}) public int getPersistentDrawingCache();
    method @android.view.ViewDebug.ExportedProperty(category="focus") public boolean getTouchscreenBlocksFocus();
    method public int indexOfChild(android.view.View);
    method @Deprecated public final void invalidateChild(android.view.View, android.graphics.Rect);
    method @Deprecated public android.view.ViewParent invalidateChildInParent(int[], android.graphics.Rect);
    method @Deprecated public boolean isAlwaysDrawnWithCacheEnabled();
    method @Deprecated public boolean isAnimationCacheEnabled();
    method @android.view.ViewDebug.ExportedProperty(category="drawing") protected boolean isChildrenDrawingOrderEnabled();
    method @Deprecated protected boolean isChildrenDrawnWithCacheEnabled();
    method public boolean isMotionEventSplittingEnabled();
    method public boolean isTransitionGroup();
    method public final void layout(int, int, int, int);
    method protected void measureChild(android.view.View, int, int);
    method protected void measureChildWithMargins(android.view.View, int, int, int, int);
    method protected void measureChildren(int, int);
    method public void notifySubtreeAccessibilityStateChanged(android.view.View, android.view.View, int);
    method public final void offsetDescendantRectToMyCoords(android.view.View, android.graphics.Rect);
    method public final void offsetRectIntoDescendantCoords(android.view.View, android.graphics.Rect);
    method public boolean onInterceptHoverEvent(android.view.MotionEvent);
    method public boolean onInterceptTouchEvent(android.view.MotionEvent);
    method protected abstract void onLayout(boolean, int, int, int, int);
    method public boolean onNestedFling(android.view.View, float, float, boolean);
    method public boolean onNestedPreFling(android.view.View, float, float);
    method public boolean onNestedPrePerformAccessibilityAction(android.view.View, int, android.os.Bundle);
    method public void onNestedPreScroll(android.view.View, int, int, int[]);
    method public void onNestedScroll(android.view.View, int, int, int, int);
    method public void onNestedScrollAccepted(android.view.View, android.view.View, int);
    method protected boolean onRequestFocusInDescendants(int, android.graphics.Rect);
    method public boolean onRequestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public boolean onStartNestedScroll(android.view.View, android.view.View, int);
    method public void onStopNestedScroll(android.view.View);
    method public void onViewAdded(android.view.View);
    method public void onViewRemoved(android.view.View);
    method public void recomputeViewAttributes(android.view.View);
    method public void removeAllViews();
    method public void removeAllViewsInLayout();
    method protected void removeDetachedView(android.view.View, boolean);
    method public void removeView(android.view.View);
    method public void removeViewAt(int);
    method public void removeViewInLayout(android.view.View);
    method public void removeViews(int, int);
    method public void removeViewsInLayout(int, int);
    method public void requestChildFocus(android.view.View, android.view.View);
    method public boolean requestChildRectangleOnScreen(android.view.View, android.graphics.Rect, boolean);
    method public void requestDisallowInterceptTouchEvent(boolean);
    method public boolean requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public void requestTransparentRegion(android.view.View);
    method public void scheduleLayoutAnimation();
    method public void setAddStatesFromChildren(boolean);
    method @Deprecated public void setAlwaysDrawnWithCacheEnabled(boolean);
    method @Deprecated public void setAnimationCacheEnabled(boolean);
    method @Deprecated protected void setChildrenDrawingCacheEnabled(boolean);
    method protected void setChildrenDrawingOrderEnabled(boolean);
    method @Deprecated protected void setChildrenDrawnWithCacheEnabled(boolean);
    method public void setClipChildren(boolean);
    method public void setClipToPadding(boolean);
    method public void setDescendantFocusability(int);
    method public void setLayoutAnimation(android.view.animation.LayoutAnimationController);
    method public void setLayoutAnimationListener(android.view.animation.Animation.AnimationListener);
    method public void setLayoutMode(int);
    method public void setLayoutTransition(android.animation.LayoutTransition);
    method public void setMotionEventSplittingEnabled(boolean);
    method public void setOnHierarchyChangeListener(android.view.ViewGroup.OnHierarchyChangeListener);
    method @Deprecated public void setPersistentDrawingCache(int);
    method protected void setStaticTransformationsEnabled(boolean);
    method public void setTouchscreenBlocksFocus(boolean);
    method public void setTransitionGroup(boolean);
    method public boolean shouldDelayChildPressedState();
    method public boolean showContextMenuForChild(android.view.View);
    method public boolean showContextMenuForChild(android.view.View, float, float);
    method public android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback);
    method public android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback, int);
    method public void startLayoutAnimation();
    method public void startViewTransition(android.view.View);
    method public void updateViewLayout(android.view.View, android.view.ViewGroup.LayoutParams);
    field protected static final int CLIP_TO_PADDING_MASK = 34; // 0x22
    field public static final int FOCUS_AFTER_DESCENDANTS = 262144; // 0x40000
    field public static final int FOCUS_BEFORE_DESCENDANTS = 131072; // 0x20000
    field public static final int FOCUS_BLOCK_DESCENDANTS = 393216; // 0x60000
    field public static final int LAYOUT_MODE_CLIP_BOUNDS = 0; // 0x0
    field public static final int LAYOUT_MODE_OPTICAL_BOUNDS = 1; // 0x1
    field @Deprecated public static final int PERSISTENT_ALL_CACHES = 3; // 0x3
    field @Deprecated public static final int PERSISTENT_ANIMATION_CACHE = 1; // 0x1
    field @Deprecated public static final int PERSISTENT_NO_CACHE = 0; // 0x0
    field @Deprecated public static final int PERSISTENT_SCROLLING_CACHE = 2; // 0x2
  }

  public static class ViewGroup.LayoutParams {
    ctor public ViewGroup.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public ViewGroup.LayoutParams(int, int);
    ctor public ViewGroup.LayoutParams(android.view.ViewGroup.LayoutParams);
    method public void resolveLayoutDirection(int);
    method protected void setBaseAttributes(android.content.res.TypedArray, int, int);
    field @Deprecated public static final int FILL_PARENT = -1; // 0xffffffff
    field public static final int MATCH_PARENT = -1; // 0xffffffff
    field public static final int WRAP_CONTENT = -2; // 0xfffffffe
    field @android.view.ViewDebug.ExportedProperty(category="layout", mapping={@android.view.ViewDebug.IntToString(from=android.view.ViewGroup.LayoutParams.MATCH_PARENT, to="MATCH_PARENT"), @android.view.ViewDebug.IntToString(from=android.view.ViewGroup.LayoutParams.WRAP_CONTENT, to="WRAP_CONTENT")}) public int height;
    field public android.view.animation.LayoutAnimationController.AnimationParameters layoutAnimationParameters;
    field @android.view.ViewDebug.ExportedProperty(category="layout", mapping={@android.view.ViewDebug.IntToString(from=android.view.ViewGroup.LayoutParams.MATCH_PARENT, to="MATCH_PARENT"), @android.view.ViewDebug.IntToString(from=android.view.ViewGroup.LayoutParams.WRAP_CONTENT, to="WRAP_CONTENT")}) public int width;
  }

  public static class ViewGroup.MarginLayoutParams extends android.view.ViewGroup.LayoutParams {
    ctor public ViewGroup.MarginLayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public ViewGroup.MarginLayoutParams(int, int);
    ctor public ViewGroup.MarginLayoutParams(android.view.ViewGroup.MarginLayoutParams);
    ctor public ViewGroup.MarginLayoutParams(android.view.ViewGroup.LayoutParams);
    method public int getLayoutDirection();
    method public int getMarginEnd();
    method public int getMarginStart();
    method public boolean isMarginRelative();
    method public void setLayoutDirection(int);
    method public void setMarginEnd(int);
    method public void setMarginStart(int);
    method public void setMargins(int, int, int, int);
    field @android.view.ViewDebug.ExportedProperty(category="layout") public int bottomMargin;
    field @android.view.ViewDebug.ExportedProperty(category="layout") public int leftMargin;
    field @android.view.ViewDebug.ExportedProperty(category="layout") public int rightMargin;
    field @android.view.ViewDebug.ExportedProperty(category="layout") public int topMargin;
  }

  public static interface ViewGroup.OnHierarchyChangeListener {
    method public void onChildViewAdded(android.view.View, android.view.View);
    method public void onChildViewRemoved(android.view.View, android.view.View);
  }

  public class ViewGroupOverlay extends android.view.ViewOverlay {
    method public void add(@NonNull android.view.View);
    method public void remove(@NonNull android.view.View);
  }

  public interface ViewManager {
    method public void addView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public void removeView(android.view.View);
    method public void updateViewLayout(android.view.View, android.view.ViewGroup.LayoutParams);
  }

  public abstract class ViewOutlineProvider {
    ctor public ViewOutlineProvider();
    method public abstract void getOutline(android.view.View, android.graphics.Outline);
    field public static final android.view.ViewOutlineProvider BACKGROUND;
    field public static final android.view.ViewOutlineProvider BOUNDS;
    field public static final android.view.ViewOutlineProvider PADDED_BOUNDS;
  }

  public class ViewOverlay {
    method public void add(@NonNull android.graphics.drawable.Drawable);
    method public void clear();
    method public void remove(@NonNull android.graphics.drawable.Drawable);
  }

  public interface ViewParent {
    method public void bringChildToFront(android.view.View);
    method public boolean canResolveLayoutDirection();
    method public boolean canResolveTextAlignment();
    method public boolean canResolveTextDirection();
    method public void childDrawableStateChanged(android.view.View);
    method public void childHasTransientStateChanged(android.view.View, boolean);
    method public void clearChildFocus(android.view.View);
    method public void createContextMenu(android.view.ContextMenu);
    method public android.view.View focusSearch(android.view.View, int);
    method public void focusableViewAvailable(android.view.View);
    method public boolean getChildVisibleRect(android.view.View, android.graphics.Rect, android.graphics.Point);
    method public int getLayoutDirection();
    method public android.view.ViewParent getParent();
    method public android.view.ViewParent getParentForAccessibility();
    method public int getTextAlignment();
    method public int getTextDirection();
    method @Deprecated public void invalidateChild(android.view.View, android.graphics.Rect);
    method @Deprecated public android.view.ViewParent invalidateChildInParent(int[], android.graphics.Rect);
    method public boolean isLayoutDirectionResolved();
    method public boolean isLayoutRequested();
    method public boolean isTextAlignmentResolved();
    method public boolean isTextDirectionResolved();
    method public android.view.View keyboardNavigationClusterSearch(android.view.View, int);
    method public void notifySubtreeAccessibilityStateChanged(android.view.View, @NonNull android.view.View, int);
    method public default void onDescendantInvalidated(@NonNull android.view.View, @NonNull android.view.View);
    method public boolean onNestedFling(android.view.View, float, float, boolean);
    method public boolean onNestedPreFling(android.view.View, float, float);
    method public boolean onNestedPrePerformAccessibilityAction(android.view.View, int, android.os.Bundle);
    method public void onNestedPreScroll(android.view.View, int, int, int[]);
    method public void onNestedScroll(android.view.View, int, int, int, int);
    method public void onNestedScrollAccepted(android.view.View, android.view.View, int);
    method public boolean onStartNestedScroll(android.view.View, android.view.View, int);
    method public void onStopNestedScroll(android.view.View);
    method public void recomputeViewAttributes(android.view.View);
    method public void requestChildFocus(android.view.View, android.view.View);
    method public boolean requestChildRectangleOnScreen(android.view.View, android.graphics.Rect, boolean);
    method public void requestDisallowInterceptTouchEvent(boolean);
    method public void requestFitSystemWindows();
    method public void requestLayout();
    method public boolean requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public void requestTransparentRegion(android.view.View);
    method public boolean showContextMenuForChild(android.view.View);
    method public boolean showContextMenuForChild(android.view.View, float, float);
    method public android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback);
    method public android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback, int);
  }

  public class ViewPropertyAnimator {
    method public android.view.ViewPropertyAnimator alpha(float);
    method public android.view.ViewPropertyAnimator alphaBy(float);
    method public void cancel();
    method public long getDuration();
    method public android.animation.TimeInterpolator getInterpolator();
    method public long getStartDelay();
    method public android.view.ViewPropertyAnimator rotation(float);
    method public android.view.ViewPropertyAnimator rotationBy(float);
    method public android.view.ViewPropertyAnimator rotationX(float);
    method public android.view.ViewPropertyAnimator rotationXBy(float);
    method public android.view.ViewPropertyAnimator rotationY(float);
    method public android.view.ViewPropertyAnimator rotationYBy(float);
    method public android.view.ViewPropertyAnimator scaleX(float);
    method public android.view.ViewPropertyAnimator scaleXBy(float);
    method public android.view.ViewPropertyAnimator scaleY(float);
    method public android.view.ViewPropertyAnimator scaleYBy(float);
    method public android.view.ViewPropertyAnimator setDuration(long);
    method public android.view.ViewPropertyAnimator setInterpolator(android.animation.TimeInterpolator);
    method public android.view.ViewPropertyAnimator setListener(android.animation.Animator.AnimatorListener);
    method public android.view.ViewPropertyAnimator setStartDelay(long);
    method public android.view.ViewPropertyAnimator setUpdateListener(android.animation.ValueAnimator.AnimatorUpdateListener);
    method public void start();
    method public android.view.ViewPropertyAnimator translationX(float);
    method public android.view.ViewPropertyAnimator translationXBy(float);
    method public android.view.ViewPropertyAnimator translationY(float);
    method public android.view.ViewPropertyAnimator translationYBy(float);
    method public android.view.ViewPropertyAnimator translationZ(float);
    method public android.view.ViewPropertyAnimator translationZBy(float);
    method public android.view.ViewPropertyAnimator withEndAction(Runnable);
    method public android.view.ViewPropertyAnimator withLayer();
    method public android.view.ViewPropertyAnimator withStartAction(Runnable);
    method public android.view.ViewPropertyAnimator x(float);
    method public android.view.ViewPropertyAnimator xBy(float);
    method public android.view.ViewPropertyAnimator y(float);
    method public android.view.ViewPropertyAnimator yBy(float);
    method public android.view.ViewPropertyAnimator z(float);
    method public android.view.ViewPropertyAnimator zBy(float);
  }

  public abstract class ViewStructure {
    ctor public ViewStructure();
    method public abstract int addChildCount(int);
    method public abstract void asyncCommit();
    method public abstract android.view.ViewStructure asyncNewChild(int);
    method @Nullable public abstract android.view.autofill.AutofillId getAutofillId();
    method public abstract int getChildCount();
    method public abstract android.os.Bundle getExtras();
    method public abstract CharSequence getHint();
    method public abstract CharSequence getText();
    method public abstract int getTextSelectionEnd();
    method public abstract int getTextSelectionStart();
    method public abstract boolean hasExtras();
    method public abstract android.view.ViewStructure newChild(int);
    method public abstract android.view.ViewStructure.HtmlInfo.Builder newHtmlInfoBuilder(@NonNull String);
    method public abstract void setAccessibilityFocused(boolean);
    method public abstract void setActivated(boolean);
    method public abstract void setAlpha(float);
    method public abstract void setAutofillHints(@Nullable String[]);
    method public abstract void setAutofillId(@NonNull android.view.autofill.AutofillId);
    method public abstract void setAutofillId(@NonNull android.view.autofill.AutofillId, int);
    method public abstract void setAutofillOptions(CharSequence[]);
    method public abstract void setAutofillType(int);
    method public abstract void setAutofillValue(android.view.autofill.AutofillValue);
    method public abstract void setCheckable(boolean);
    method public abstract void setChecked(boolean);
    method public abstract void setChildCount(int);
    method public abstract void setClassName(String);
    method public abstract void setClickable(boolean);
    method public abstract void setContentDescription(CharSequence);
    method public abstract void setContextClickable(boolean);
    method public abstract void setDataIsSensitive(boolean);
    method public abstract void setDimens(int, int, int, int, int, int);
    method public abstract void setElevation(float);
    method public abstract void setEnabled(boolean);
    method public abstract void setFocusable(boolean);
    method public abstract void setFocused(boolean);
    method public abstract void setHint(CharSequence);
    method public abstract void setHtmlInfo(@NonNull android.view.ViewStructure.HtmlInfo);
    method public abstract void setId(int, String, String, String);
    method public void setImportantForAutofill(int);
    method public abstract void setInputType(int);
    method public abstract void setLocaleList(android.os.LocaleList);
    method public abstract void setLongClickable(boolean);
    method public void setMaxTextEms(int);
    method public void setMaxTextLength(int);
    method public void setMinTextEms(int);
    method public abstract void setOpaque(boolean);
    method public abstract void setSelected(boolean);
    method public abstract void setText(CharSequence);
    method public abstract void setText(CharSequence, int, int);
    method public void setTextIdEntry(@NonNull String);
    method public abstract void setTextLines(int[], int[]);
    method public abstract void setTextStyle(float, int, int, int);
    method public abstract void setTransformation(android.graphics.Matrix);
    method public abstract void setVisibility(int);
    method public abstract void setWebDomain(@Nullable String);
  }

  public abstract static class ViewStructure.HtmlInfo {
    ctor public ViewStructure.HtmlInfo();
    method @Nullable public abstract java.util.List<android.util.Pair<java.lang.String,java.lang.String>> getAttributes();
    method @NonNull public abstract String getTag();
  }

  public abstract static class ViewStructure.HtmlInfo.Builder {
    ctor public ViewStructure.HtmlInfo.Builder();
    method public abstract android.view.ViewStructure.HtmlInfo.Builder addAttribute(@NonNull String, @NonNull String);
    method public abstract android.view.ViewStructure.HtmlInfo build();
  }

  @android.widget.RemoteViews.RemoteView public final class ViewStub extends android.view.View {
    ctor public ViewStub(android.content.Context);
    ctor public ViewStub(android.content.Context, @LayoutRes int);
    ctor public ViewStub(android.content.Context, android.util.AttributeSet);
    ctor public ViewStub(android.content.Context, android.util.AttributeSet, int);
    ctor public ViewStub(android.content.Context, android.util.AttributeSet, int, int);
    method @IdRes public int getInflatedId();
    method public android.view.LayoutInflater getLayoutInflater();
    method @LayoutRes public int getLayoutResource();
    method public android.view.View inflate();
    method public void setInflatedId(@IdRes int);
    method public void setLayoutInflater(android.view.LayoutInflater);
    method public void setLayoutResource(@LayoutRes int);
    method public void setOnInflateListener(android.view.ViewStub.OnInflateListener);
  }

  public static interface ViewStub.OnInflateListener {
    method public void onInflate(android.view.ViewStub, android.view.View);
  }

  public final class ViewTreeObserver {
    method public void addOnDrawListener(android.view.ViewTreeObserver.OnDrawListener);
    method public void addOnGlobalFocusChangeListener(android.view.ViewTreeObserver.OnGlobalFocusChangeListener);
    method public void addOnGlobalLayoutListener(android.view.ViewTreeObserver.OnGlobalLayoutListener);
    method public void addOnPreDrawListener(android.view.ViewTreeObserver.OnPreDrawListener);
    method public void addOnScrollChangedListener(android.view.ViewTreeObserver.OnScrollChangedListener);
    method public void addOnTouchModeChangeListener(android.view.ViewTreeObserver.OnTouchModeChangeListener);
    method public void addOnWindowAttachListener(android.view.ViewTreeObserver.OnWindowAttachListener);
    method public void addOnWindowFocusChangeListener(android.view.ViewTreeObserver.OnWindowFocusChangeListener);
    method public void dispatchOnDraw();
    method public void dispatchOnGlobalLayout();
    method public boolean dispatchOnPreDraw();
    method public boolean isAlive();
    method @Deprecated public void removeGlobalOnLayoutListener(android.view.ViewTreeObserver.OnGlobalLayoutListener);
    method public void removeOnDrawListener(android.view.ViewTreeObserver.OnDrawListener);
    method public void removeOnGlobalFocusChangeListener(android.view.ViewTreeObserver.OnGlobalFocusChangeListener);
    method public void removeOnGlobalLayoutListener(android.view.ViewTreeObserver.OnGlobalLayoutListener);
    method public void removeOnPreDrawListener(android.view.ViewTreeObserver.OnPreDrawListener);
    method public void removeOnScrollChangedListener(android.view.ViewTreeObserver.OnScrollChangedListener);
    method public void removeOnTouchModeChangeListener(android.view.ViewTreeObserver.OnTouchModeChangeListener);
    method public void removeOnWindowAttachListener(android.view.ViewTreeObserver.OnWindowAttachListener);
    method public void removeOnWindowFocusChangeListener(android.view.ViewTreeObserver.OnWindowFocusChangeListener);
  }

  public static interface ViewTreeObserver.OnDrawListener {
    method public void onDraw();
  }

  public static interface ViewTreeObserver.OnGlobalFocusChangeListener {
    method public void onGlobalFocusChanged(android.view.View, android.view.View);
  }

  public static interface ViewTreeObserver.OnGlobalLayoutListener {
    method public void onGlobalLayout();
  }

  public static interface ViewTreeObserver.OnPreDrawListener {
    method public boolean onPreDraw();
  }

  public static interface ViewTreeObserver.OnScrollChangedListener {
    method public void onScrollChanged();
  }

  public static interface ViewTreeObserver.OnTouchModeChangeListener {
    method public void onTouchModeChanged(boolean);
  }

  public static interface ViewTreeObserver.OnWindowAttachListener {
    method public void onWindowAttached();
    method public void onWindowDetached();
  }

  public static interface ViewTreeObserver.OnWindowFocusChangeListener {
    method public void onWindowFocusChanged(boolean);
  }

  public abstract class Window {
    ctor public Window(android.content.Context);
    method public abstract void addContentView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public void addFlags(int);
    method public final void addOnFrameMetricsAvailableListener(@NonNull android.view.Window.OnFrameMetricsAvailableListener, android.os.Handler);
    method public void clearFlags(int);
    method public abstract void closeAllPanels();
    method public abstract void closePanel(int);
    method public <T extends android.view.View> T findViewById(@IdRes int);
    method public boolean getAllowEnterTransitionOverlap();
    method public boolean getAllowReturnTransitionOverlap();
    method public final android.view.WindowManager.LayoutParams getAttributes();
    method public final android.view.Window.Callback getCallback();
    method public int getColorMode();
    method public final android.view.Window getContainer();
    method public android.transition.Scene getContentScene();
    method public final android.content.Context getContext();
    method @Nullable public abstract android.view.View getCurrentFocus();
    method @NonNull public abstract android.view.View getDecorView();
    method public static int getDefaultFeatures(android.content.Context);
    method public android.transition.Transition getEnterTransition();
    method public android.transition.Transition getExitTransition();
    method protected final int getFeatures();
    method protected final int getForcedWindowFlags();
    method @NonNull public abstract android.view.LayoutInflater getLayoutInflater();
    method protected final int getLocalFeatures();
    method public android.media.session.MediaController getMediaController();
    method @ColorInt public abstract int getNavigationBarColor();
    method @ColorInt public int getNavigationBarDividerColor();
    method public android.transition.Transition getReenterTransition();
    method public android.transition.Transition getReturnTransition();
    method public android.transition.Transition getSharedElementEnterTransition();
    method public android.transition.Transition getSharedElementExitTransition();
    method public android.transition.Transition getSharedElementReenterTransition();
    method public android.transition.Transition getSharedElementReturnTransition();
    method public boolean getSharedElementsUseOverlay();
    method @ColorInt public abstract int getStatusBarColor();
    method public long getTransitionBackgroundFadeDuration();
    method public android.transition.TransitionManager getTransitionManager();
    method public abstract int getVolumeControlStream();
    method public android.view.WindowManager getWindowManager();
    method public final android.content.res.TypedArray getWindowStyle();
    method public final boolean hasChildren();
    method public boolean hasFeature(int);
    method protected final boolean hasSoftInputMode();
    method public void injectInputEvent(android.view.InputEvent);
    method public abstract void invalidatePanelMenu(int);
    method public final boolean isActive();
    method public abstract boolean isFloating();
    method public abstract boolean isShortcutKey(int, android.view.KeyEvent);
    method public boolean isWideColorGamut();
    method public final void makeActive();
    method protected abstract void onActive();
    method public abstract void onConfigurationChanged(android.content.res.Configuration);
    method public abstract void openPanel(int, android.view.KeyEvent);
    method public abstract android.view.View peekDecorView();
    method public abstract boolean performContextMenuIdentifierAction(int, int);
    method public abstract boolean performPanelIdentifierAction(int, int, int);
    method public abstract boolean performPanelShortcut(int, int, android.view.KeyEvent, int);
    method public final void removeOnFrameMetricsAvailableListener(android.view.Window.OnFrameMetricsAvailableListener);
    method public boolean requestFeature(int);
    method @NonNull public final <T extends android.view.View> T requireViewById(@IdRes int);
    method public abstract void restoreHierarchyState(android.os.Bundle);
    method public abstract android.os.Bundle saveHierarchyState();
    method public void setAllowEnterTransitionOverlap(boolean);
    method public void setAllowReturnTransitionOverlap(boolean);
    method public void setAttributes(android.view.WindowManager.LayoutParams);
    method public abstract void setBackgroundDrawable(android.graphics.drawable.Drawable);
    method public void setBackgroundDrawableResource(@DrawableRes int);
    method public void setCallback(android.view.Window.Callback);
    method public abstract void setChildDrawable(int, android.graphics.drawable.Drawable);
    method public abstract void setChildInt(int, int);
    method public void setClipToOutline(boolean);
    method public void setColorMode(int);
    method public void setContainer(android.view.Window);
    method public abstract void setContentView(@LayoutRes int);
    method public abstract void setContentView(android.view.View);
    method public abstract void setContentView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public abstract void setDecorCaptionShade(int);
    method protected void setDefaultWindowFormat(int);
    method public void setDimAmount(float);
    method public void setElevation(float);
    method public void setEnterTransition(android.transition.Transition);
    method public void setExitTransition(android.transition.Transition);
    method public abstract void setFeatureDrawable(int, android.graphics.drawable.Drawable);
    method public abstract void setFeatureDrawableAlpha(int, int);
    method public abstract void setFeatureDrawableResource(int, @DrawableRes int);
    method public abstract void setFeatureDrawableUri(int, android.net.Uri);
    method public abstract void setFeatureInt(int, int);
    method public void setFlags(int, int);
    method public void setFormat(int);
    method public void setGravity(int);
    method public void setIcon(@DrawableRes int);
    method public void setLayout(int, int);
    method public void setLocalFocus(boolean, boolean);
    method public void setLogo(@DrawableRes int);
    method public void setMediaController(android.media.session.MediaController);
    method public abstract void setNavigationBarColor(@ColorInt int);
    method public void setNavigationBarDividerColor(@ColorInt int);
    method public void setReenterTransition(android.transition.Transition);
    method public abstract void setResizingCaptionDrawable(android.graphics.drawable.Drawable);
    method public final void setRestrictedCaptionAreaListener(android.view.Window.OnRestrictedCaptionAreaChangedListener);
    method public void setReturnTransition(android.transition.Transition);
    method public void setSharedElementEnterTransition(android.transition.Transition);
    method public void setSharedElementExitTransition(android.transition.Transition);
    method public void setSharedElementReenterTransition(android.transition.Transition);
    method public void setSharedElementReturnTransition(android.transition.Transition);
    method public void setSharedElementsUseOverlay(boolean);
    method public void setSoftInputMode(int);
    method public abstract void setStatusBarColor(@ColorInt int);
    method public void setSustainedPerformanceMode(boolean);
    method public abstract void setTitle(CharSequence);
    method @Deprecated public abstract void setTitleColor(@ColorInt int);
    method public void setTransitionBackgroundFadeDuration(long);
    method public void setTransitionManager(android.transition.TransitionManager);
    method public void setType(int);
    method public void setUiOptions(int);
    method public void setUiOptions(int, int);
    method public abstract void setVolumeControlStream(int);
    method public void setWindowAnimations(@StyleRes int);
    method public void setWindowManager(android.view.WindowManager, android.os.IBinder, String);
    method public void setWindowManager(android.view.WindowManager, android.os.IBinder, String, boolean);
    method public abstract boolean superDispatchGenericMotionEvent(android.view.MotionEvent);
    method public abstract boolean superDispatchKeyEvent(android.view.KeyEvent);
    method public abstract boolean superDispatchKeyShortcutEvent(android.view.KeyEvent);
    method public abstract boolean superDispatchTouchEvent(android.view.MotionEvent);
    method public abstract boolean superDispatchTrackballEvent(android.view.MotionEvent);
    method public abstract void takeInputQueue(android.view.InputQueue.Callback);
    method public abstract void takeKeyEvents(boolean);
    method public abstract void takeSurface(android.view.SurfaceHolder.Callback2);
    method public abstract void togglePanel(int, android.view.KeyEvent);
    field public static final int DECOR_CAPTION_SHADE_AUTO = 0; // 0x0
    field public static final int DECOR_CAPTION_SHADE_DARK = 2; // 0x2
    field public static final int DECOR_CAPTION_SHADE_LIGHT = 1; // 0x1
    field @Deprecated protected static final int DEFAULT_FEATURES = 65; // 0x41
    field public static final int FEATURE_ACTION_BAR = 8; // 0x8
    field public static final int FEATURE_ACTION_BAR_OVERLAY = 9; // 0x9
    field public static final int FEATURE_ACTION_MODE_OVERLAY = 10; // 0xa
    field public static final int FEATURE_ACTIVITY_TRANSITIONS = 13; // 0xd
    field public static final int FEATURE_CONTENT_TRANSITIONS = 12; // 0xc
    field public static final int FEATURE_CONTEXT_MENU = 6; // 0x6
    field public static final int FEATURE_CUSTOM_TITLE = 7; // 0x7
    field @Deprecated public static final int FEATURE_INDETERMINATE_PROGRESS = 5; // 0x5
    field public static final int FEATURE_LEFT_ICON = 3; // 0x3
    field public static final int FEATURE_NO_TITLE = 1; // 0x1
    field public static final int FEATURE_OPTIONS_PANEL = 0; // 0x0
    field @Deprecated public static final int FEATURE_PROGRESS = 2; // 0x2
    field public static final int FEATURE_RIGHT_ICON = 4; // 0x4
    field public static final int FEATURE_SWIPE_TO_DISMISS = 11; // 0xb
    field public static final int ID_ANDROID_CONTENT = 16908290; // 0x1020002
    field public static final String NAVIGATION_BAR_BACKGROUND_TRANSITION_NAME = "android:navigation:background";
    field @Deprecated public static final int PROGRESS_END = 10000; // 0x2710
    field @Deprecated public static final int PROGRESS_INDETERMINATE_OFF = -4; // 0xfffffffc
    field @Deprecated public static final int PROGRESS_INDETERMINATE_ON = -3; // 0xfffffffd
    field @Deprecated public static final int PROGRESS_SECONDARY_END = 30000; // 0x7530
    field @Deprecated public static final int PROGRESS_SECONDARY_START = 20000; // 0x4e20
    field @Deprecated public static final int PROGRESS_START = 0; // 0x0
    field @Deprecated public static final int PROGRESS_VISIBILITY_OFF = -2; // 0xfffffffe
    field @Deprecated public static final int PROGRESS_VISIBILITY_ON = -1; // 0xffffffff
    field public static final String STATUS_BAR_BACKGROUND_TRANSITION_NAME = "android:status:background";
  }

  public static interface Window.Callback {
    method public boolean dispatchGenericMotionEvent(android.view.MotionEvent);
    method public boolean dispatchKeyEvent(android.view.KeyEvent);
    method public boolean dispatchKeyShortcutEvent(android.view.KeyEvent);
    method public boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public boolean dispatchTouchEvent(android.view.MotionEvent);
    method public boolean dispatchTrackballEvent(android.view.MotionEvent);
    method public void onActionModeFinished(android.view.ActionMode);
    method public void onActionModeStarted(android.view.ActionMode);
    method public void onAttachedToWindow();
    method public void onContentChanged();
    method public boolean onCreatePanelMenu(int, android.view.Menu);
    method @Nullable public android.view.View onCreatePanelView(int);
    method public void onDetachedFromWindow();
    method public boolean onMenuItemSelected(int, android.view.MenuItem);
    method public boolean onMenuOpened(int, android.view.Menu);
    method public void onPanelClosed(int, android.view.Menu);
    method public default void onPointerCaptureChanged(boolean);
    method public boolean onPreparePanel(int, android.view.View, android.view.Menu);
    method public default void onProvideKeyboardShortcuts(java.util.List<android.view.KeyboardShortcutGroup>, @Nullable android.view.Menu, int);
    method public boolean onSearchRequested();
    method public boolean onSearchRequested(android.view.SearchEvent);
    method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams);
    method public void onWindowFocusChanged(boolean);
    method @Nullable public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback);
    method @Nullable public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback, int);
  }

  public static interface Window.OnFrameMetricsAvailableListener {
    method public void onFrameMetricsAvailable(android.view.Window, android.view.FrameMetrics, int);
  }

  public static interface Window.OnRestrictedCaptionAreaChangedListener {
    method public void onRestrictedCaptionAreaChanged(android.graphics.Rect);
  }

  public final class WindowAnimationFrameStats extends android.view.FrameStats implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.WindowAnimationFrameStats> CREATOR;
  }

  public final class WindowContentFrameStats extends android.view.FrameStats implements android.os.Parcelable {
    method public int describeContents();
    method public long getFramePostedTimeNano(int);
    method public long getFrameReadyTimeNano(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.WindowContentFrameStats> CREATOR;
  }

  public class WindowId implements android.os.Parcelable {
    method public int describeContents();
    method public boolean isFocused();
    method public void registerFocusObserver(android.view.WindowId.FocusObserver);
    method public void unregisterFocusObserver(android.view.WindowId.FocusObserver);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.WindowId> CREATOR;
  }

  public abstract static class WindowId.FocusObserver {
    ctor public WindowId.FocusObserver();
    method public abstract void onFocusGained(android.view.WindowId);
    method public abstract void onFocusLost(android.view.WindowId);
  }

  public final class WindowInsets {
    ctor public WindowInsets(android.view.WindowInsets);
    method public android.view.WindowInsets consumeDisplayCutout();
    method public android.view.WindowInsets consumeStableInsets();
    method public android.view.WindowInsets consumeSystemWindowInsets();
    method @Nullable public android.view.DisplayCutout getDisplayCutout();
    method public int getStableInsetBottom();
    method public int getStableInsetLeft();
    method public int getStableInsetRight();
    method public int getStableInsetTop();
    method public int getSystemWindowInsetBottom();
    method public int getSystemWindowInsetLeft();
    method public int getSystemWindowInsetRight();
    method public int getSystemWindowInsetTop();
    method public boolean hasInsets();
    method public boolean hasStableInsets();
    method public boolean hasSystemWindowInsets();
    method public boolean isConsumed();
    method public boolean isRound();
    method public android.view.WindowInsets replaceSystemWindowInsets(int, int, int, int);
    method public android.view.WindowInsets replaceSystemWindowInsets(android.graphics.Rect);
  }

  public interface WindowManager extends android.view.ViewManager {
    method public android.view.Display getDefaultDisplay();
    method public void removeViewImmediate(android.view.View);
  }

  public static class WindowManager.BadTokenException extends java.lang.RuntimeException {
    ctor public WindowManager.BadTokenException();
    ctor public WindowManager.BadTokenException(String);
  }

  public static class WindowManager.InvalidDisplayException extends java.lang.RuntimeException {
    ctor public WindowManager.InvalidDisplayException();
    ctor public WindowManager.InvalidDisplayException(String);
  }

  public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable {
    ctor public WindowManager.LayoutParams();
    ctor public WindowManager.LayoutParams(int);
    ctor public WindowManager.LayoutParams(int, int);
    ctor public WindowManager.LayoutParams(int, int, int);
    ctor public WindowManager.LayoutParams(int, int, int, int, int);
    ctor public WindowManager.LayoutParams(int, int, int, int, int, int, int);
    ctor public WindowManager.LayoutParams(android.os.Parcel);
    method public final int copyFrom(android.view.WindowManager.LayoutParams);
    method public String debug(String);
    method public int describeContents();
    method public int getColorMode();
    method public final CharSequence getTitle();
    method public static boolean mayUseInputMethod(int);
    method public void setColorMode(int);
    method public final void setTitle(CharSequence);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ALPHA_CHANGED = 128; // 0x80
    field public static final int ANIMATION_CHANGED = 16; // 0x10
    field public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f;
    field public static final float BRIGHTNESS_OVERRIDE_NONE = -1.0f;
    field public static final float BRIGHTNESS_OVERRIDE_OFF = 0.0f;
    field public static final android.os.Parcelable.Creator<android.view.WindowManager.LayoutParams> CREATOR;
    field public static final int DIM_AMOUNT_CHANGED = 32; // 0x20
    field public static final int FIRST_APPLICATION_WINDOW = 1; // 0x1
    field public static final int FIRST_SUB_WINDOW = 1000; // 0x3e8
    field public static final int FIRST_SYSTEM_WINDOW = 2000; // 0x7d0
    field public static final int FLAGS_CHANGED = 4; // 0x4
    field public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 1; // 0x1
    field public static final int FLAG_ALT_FOCUSABLE_IM = 131072; // 0x20000
    field @Deprecated public static final int FLAG_BLUR_BEHIND = 4; // 0x4
    field public static final int FLAG_DIM_BEHIND = 2; // 0x2
    field @Deprecated public static final int FLAG_DISMISS_KEYGUARD = 4194304; // 0x400000
    field @Deprecated public static final int FLAG_DITHER = 4096; // 0x1000
    field public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = -2147483648; // 0x80000000
    field public static final int FLAG_FORCE_NOT_FULLSCREEN = 2048; // 0x800
    field public static final int FLAG_FULLSCREEN = 1024; // 0x400
    field public static final int FLAG_HARDWARE_ACCELERATED = 16777216; // 0x1000000
    field public static final int FLAG_IGNORE_CHEEK_PRESSES = 32768; // 0x8000
    field public static final int FLAG_KEEP_SCREEN_ON = 128; // 0x80
    field public static final int FLAG_LAYOUT_ATTACHED_IN_DECOR = 1073741824; // 0x40000000
    field public static final int FLAG_LAYOUT_INSET_DECOR = 65536; // 0x10000
    field public static final int FLAG_LAYOUT_IN_OVERSCAN = 33554432; // 0x2000000
    field public static final int FLAG_LAYOUT_IN_SCREEN = 256; // 0x100
    field public static final int FLAG_LAYOUT_NO_LIMITS = 512; // 0x200
    field public static final int FLAG_LOCAL_FOCUS_MODE = 268435456; // 0x10000000
    field public static final int FLAG_NOT_FOCUSABLE = 8; // 0x8
    field public static final int FLAG_NOT_TOUCHABLE = 16; // 0x10
    field public static final int FLAG_NOT_TOUCH_MODAL = 32; // 0x20
    field public static final int FLAG_SCALED = 16384; // 0x4000
    field public static final int FLAG_SECURE = 8192; // 0x2000
    field public static final int FLAG_SHOW_WALLPAPER = 1048576; // 0x100000
    field @Deprecated public static final int FLAG_SHOW_WHEN_LOCKED = 524288; // 0x80000
    field public static final int FLAG_SPLIT_TOUCH = 8388608; // 0x800000
    field @Deprecated public static final int FLAG_TOUCHABLE_WHEN_WAKING = 64; // 0x40
    field public static final int FLAG_TRANSLUCENT_NAVIGATION = 134217728; // 0x8000000
    field public static final int FLAG_TRANSLUCENT_STATUS = 67108864; // 0x4000000
    field @Deprecated public static final int FLAG_TURN_SCREEN_ON = 2097152; // 0x200000
    field public static final int FLAG_WATCH_OUTSIDE_TOUCH = 262144; // 0x40000
    field public static final int FORMAT_CHANGED = 8; // 0x8
    field public static final int LAST_APPLICATION_WINDOW = 99; // 0x63
    field public static final int LAST_SUB_WINDOW = 1999; // 0x7cf
    field public static final int LAST_SYSTEM_WINDOW = 2999; // 0xbb7
    field public static final int LAYOUT_CHANGED = 1; // 0x1
    field public static final int LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT = 0; // 0x0
    field public static final int LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER = 2; // 0x2
    field public static final int LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES = 1; // 0x1
    field public static final int MEMORY_TYPE_CHANGED = 256; // 0x100
    field @Deprecated public static final int MEMORY_TYPE_GPU = 2; // 0x2
    field @Deprecated public static final int MEMORY_TYPE_HARDWARE = 1; // 0x1
    field @Deprecated public static final int MEMORY_TYPE_NORMAL = 0; // 0x0
    field @Deprecated public static final int MEMORY_TYPE_PUSH_BUFFERS = 3; // 0x3
    field public static final int ROTATION_ANIMATION_CHANGED = 4096; // 0x1000
    field public static final int ROTATION_ANIMATION_CROSSFADE = 1; // 0x1
    field public static final int ROTATION_ANIMATION_JUMPCUT = 2; // 0x2
    field public static final int ROTATION_ANIMATION_ROTATE = 0; // 0x0
    field public static final int ROTATION_ANIMATION_SEAMLESS = 3; // 0x3
    field public static final int SCREEN_BRIGHTNESS_CHANGED = 2048; // 0x800
    field public static final int SCREEN_ORIENTATION_CHANGED = 1024; // 0x400
    field public static final int SOFT_INPUT_ADJUST_NOTHING = 48; // 0x30
    field public static final int SOFT_INPUT_ADJUST_PAN = 32; // 0x20
    field public static final int SOFT_INPUT_ADJUST_RESIZE = 16; // 0x10
    field public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0; // 0x0
    field public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION = 256; // 0x100
    field public static final int SOFT_INPUT_MASK_ADJUST = 240; // 0xf0
    field public static final int SOFT_INPUT_MASK_STATE = 15; // 0xf
    field public static final int SOFT_INPUT_MODE_CHANGED = 512; // 0x200
    field public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3; // 0x3
    field public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5; // 0x5
    field public static final int SOFT_INPUT_STATE_HIDDEN = 2; // 0x2
    field public static final int SOFT_INPUT_STATE_UNCHANGED = 1; // 0x1
    field public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0; // 0x0
    field public static final int SOFT_INPUT_STATE_VISIBLE = 4; // 0x4
    field public static final int TITLE_CHANGED = 64; // 0x40
    field public static final int TYPE_ACCESSIBILITY_OVERLAY = 2032; // 0x7f0
    field public static final int TYPE_APPLICATION = 2; // 0x2
    field public static final int TYPE_APPLICATION_ATTACHED_DIALOG = 1003; // 0x3eb
    field public static final int TYPE_APPLICATION_MEDIA = 1001; // 0x3e9
    field public static final int TYPE_APPLICATION_OVERLAY = 2038; // 0x7f6
    field public static final int TYPE_APPLICATION_PANEL = 1000; // 0x3e8
    field public static final int TYPE_APPLICATION_STARTING = 3; // 0x3
    field public static final int TYPE_APPLICATION_SUB_PANEL = 1002; // 0x3ea
    field public static final int TYPE_BASE_APPLICATION = 1; // 0x1
    field public static final int TYPE_CHANGED = 2; // 0x2
    field public static final int TYPE_DRAWN_APPLICATION = 4; // 0x4
    field public static final int TYPE_INPUT_METHOD = 2011; // 0x7db
    field public static final int TYPE_INPUT_METHOD_DIALOG = 2012; // 0x7dc
    field public static final int TYPE_KEYGUARD_DIALOG = 2009; // 0x7d9
    field @Deprecated public static final int TYPE_PHONE = 2002; // 0x7d2
    field @Deprecated public static final int TYPE_PRIORITY_PHONE = 2007; // 0x7d7
    field public static final int TYPE_PRIVATE_PRESENTATION = 2030; // 0x7ee
    field public static final int TYPE_SEARCH_BAR = 2001; // 0x7d1
    field public static final int TYPE_STATUS_BAR = 2000; // 0x7d0
    field public static final int TYPE_STATUS_BAR_PANEL = 2014; // 0x7de
    field @Deprecated public static final int TYPE_SYSTEM_ALERT = 2003; // 0x7d3
    field public static final int TYPE_SYSTEM_DIALOG = 2008; // 0x7d8
    field @Deprecated public static final int TYPE_SYSTEM_ERROR = 2010; // 0x7da
    field @Deprecated public static final int TYPE_SYSTEM_OVERLAY = 2006; // 0x7d6
    field @Deprecated public static final int TYPE_TOAST = 2005; // 0x7d5
    field public static final int TYPE_WALLPAPER = 2013; // 0x7dd
    field public float alpha;
    field public float buttonBrightness;
    field public float dimAmount;
    field @android.view.ViewDebug.ExportedProperty(flagMapping={@android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, equals=android.view.WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, name="ALLOW_LOCK_WHILE_SCREEN_ON"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND, equals=android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND, name="DIM_BEHIND"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_BLUR_BEHIND, equals=android.view.WindowManager.LayoutParams.FLAG_BLUR_BEHIND, name="BLUR_BEHIND"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, equals=android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, name="NOT_FOCUSABLE"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE, equals=android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE, name="NOT_TOUCHABLE"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL, equals=android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL, name="NOT_TOUCH_MODAL"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING, equals=android.view.WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING, name="TOUCHABLE_WHEN_WAKING"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, equals=android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, name="KEEP_SCREEN_ON"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN, equals=android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN, name="LAYOUT_IN_SCREEN"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, equals=android.view.WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, name="LAYOUT_NO_LIMITS"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN, equals=android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN, name="FULLSCREEN"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, equals=android.view.WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, name="FORCE_NOT_FULLSCREEN"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_DITHER, equals=android.view.WindowManager.LayoutParams.FLAG_DITHER, name="DITHER"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_SECURE, equals=android.view.WindowManager.LayoutParams.FLAG_SECURE, name="SECURE"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_SCALED, equals=android.view.WindowManager.LayoutParams.FLAG_SCALED, name="SCALED"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES, equals=android.view.WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES, name="IGNORE_CHEEK_PRESSES"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR, equals=android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR, name="LAYOUT_INSET_DECOR"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, equals=android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, name="ALT_FOCUSABLE_IM"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH, equals=android.view.WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH, name="WATCH_OUTSIDE_TOUCH"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED, equals=android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED, name="SHOW_WHEN_LOCKED"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER, equals=android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER, name="SHOW_WALLPAPER"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON, equals=android.view.WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON, name="TURN_SCREEN_ON"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD, equals=android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD, name="DISMISS_KEYGUARD"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_SPLIT_TOUCH, equals=android.view.WindowManager.LayoutParams.FLAG_SPLIT_TOUCH, name="SPLIT_TOUCH"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, equals=android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, name="HARDWARE_ACCELERATED"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN, equals=android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN, name="LOCAL_FOCUS_MODE"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, equals=android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, name="TRANSLUCENT_STATUS"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, equals=android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, name="TRANSLUCENT_NAVIGATION"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE, equals=android.view.WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE, name="LOCAL_FOCUS_MODE"), @android.view.ViewDebug.FlagToString(mask=0x20000000, equals=0x20000000, name="FLAG_SLIPPERY"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_LAYOUT_ATTACHED_IN_DECOR, equals=android.view.WindowManager.LayoutParams.FLAG_LAYOUT_ATTACHED_IN_DECOR, name="FLAG_LAYOUT_ATTACHED_IN_DECOR"), @android.view.ViewDebug.FlagToString(mask=android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, equals=android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, name="DRAWS_SYSTEM_BAR_BACKGROUNDS")}, formatToHexString=true) public int flags;
    field public int format;
    field public int gravity;
    field public float horizontalMargin;
    field @android.view.ViewDebug.ExportedProperty public float horizontalWeight;
    field public int layoutInDisplayCutoutMode;
    field @Deprecated public int memoryType;
    field public String packageName;
    field public int preferredDisplayModeId;
    field @Deprecated public float preferredRefreshRate;
    field public int rotationAnimation;
    field public float screenBrightness;
    field public int screenOrientation;
    field public int softInputMode;
    field public int systemUiVisibility;
    field public android.os.IBinder token;
    field @android.view.ViewDebug.ExportedProperty(mapping={@android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION, to="BASE_APPLICATION"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_APPLICATION, to="APPLICATION"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING, to="APPLICATION_STARTING"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_DRAWN_APPLICATION, to="DRAWN_APPLICATION"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_APPLICATION_PANEL, to="APPLICATION_PANEL"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA, to="APPLICATION_MEDIA"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL, to="APPLICATION_SUB_PANEL"), @android.view.ViewDebug.IntToString(from=0x3ed, to="APPLICATION_ABOVE_SUB_PANEL"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG, to="APPLICATION_ATTACHED_DIALOG"), @android.view.ViewDebug.IntToString(from=0x3ec, to="APPLICATION_MEDIA_OVERLAY"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR, to="STATUS_BAR"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_SEARCH_BAR, to="SEARCH_BAR"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_PHONE, to="PHONE"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, to="SYSTEM_ALERT"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_TOAST, to="TOAST"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY, to="SYSTEM_OVERLAY"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_PRIORITY_PHONE, to="PRIORITY_PHONE"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG, to="SYSTEM_DIALOG"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG, to="KEYGUARD_DIALOG"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ERROR, to="SYSTEM_ERROR"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD, to="INPUT_METHOD"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG, to="INPUT_METHOD_DIALOG"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_WALLPAPER, to="WALLPAPER"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, to="STATUS_BAR_PANEL"), @android.view.ViewDebug.IntToString(from=0x7df, to="SECURE_SYSTEM_OVERLAY"), @android.view.ViewDebug.IntToString(from=0x7e0, to="DRAG"), @android.view.ViewDebug.IntToString(from=0x7e1, to="STATUS_BAR_SUB_PANEL"), @android.view.ViewDebug.IntToString(from=0x7e2, to="POINTER"), @android.view.ViewDebug.IntToString(from=0x7e3, to="NAVIGATION_BAR"), @android.view.ViewDebug.IntToString(from=0x7e4, to="VOLUME_OVERLAY"), @android.view.ViewDebug.IntToString(from=0x7e5, to="BOOT_PROGRESS"), @android.view.ViewDebug.IntToString(from=0x7e6, to="INPUT_CONSUMER"), @android.view.ViewDebug.IntToString(from=0x7e7, to="DREAM"), @android.view.ViewDebug.IntToString(from=0x7e8, to="NAVIGATION_BAR_PANEL"), @android.view.ViewDebug.IntToString(from=0x7ea, to="DISPLAY_OVERLAY"), @android.view.ViewDebug.IntToString(from=0x7eb, to="MAGNIFICATION_OVERLAY"), @android.view.ViewDebug.IntToString(from=0x7f5, to="PRESENTATION"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION, to="PRIVATE_PRESENTATION"), @android.view.ViewDebug.IntToString(from=0x7ef, to="VOICE_INTERACTION"), @android.view.ViewDebug.IntToString(from=0x7f1, to="VOICE_INTERACTION_STARTING"), @android.view.ViewDebug.IntToString(from=0x7f2, to="DOCK_DIVIDER"), @android.view.ViewDebug.IntToString(from=0x7f3, to="QS_DIALOG"), @android.view.ViewDebug.IntToString(from=0x7f4, to="SCREENSHOT"), @android.view.ViewDebug.IntToString(from=android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, to="APPLICATION_OVERLAY")}) public int type;
    field public float verticalMargin;
    field @android.view.ViewDebug.ExportedProperty public float verticalWeight;
    field public int windowAnimations;
    field @android.view.ViewDebug.ExportedProperty public int x;
    field @android.view.ViewDebug.ExportedProperty public int y;
  }

}

package android.view.accessibility {

  public final class AccessibilityEvent extends android.view.accessibility.AccessibilityRecord implements android.os.Parcelable {
    method public void appendRecord(android.view.accessibility.AccessibilityRecord);
    method public int describeContents();
    method public static String eventTypeToString(int);
    method public int getAction();
    method public int getContentChangeTypes();
    method public long getEventTime();
    method public int getEventType();
    method public int getMovementGranularity();
    method public CharSequence getPackageName();
    method public android.view.accessibility.AccessibilityRecord getRecord(int);
    method public int getRecordCount();
    method public int getWindowChanges();
    method public void initFromParcel(android.os.Parcel);
    method public static android.view.accessibility.AccessibilityEvent obtain(int);
    method public static android.view.accessibility.AccessibilityEvent obtain(android.view.accessibility.AccessibilityEvent);
    method public static android.view.accessibility.AccessibilityEvent obtain();
    method public void setAction(int);
    method public void setContentChangeTypes(int);
    method public void setEventTime(long);
    method public void setEventType(int);
    method public void setMovementGranularity(int);
    method public void setPackageName(CharSequence);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION = 4; // 0x4
    field public static final int CONTENT_CHANGE_TYPE_PANE_APPEARED = 16; // 0x10
    field public static final int CONTENT_CHANGE_TYPE_PANE_DISAPPEARED = 32; // 0x20
    field public static final int CONTENT_CHANGE_TYPE_PANE_TITLE = 8; // 0x8
    field public static final int CONTENT_CHANGE_TYPE_SUBTREE = 1; // 0x1
    field public static final int CONTENT_CHANGE_TYPE_TEXT = 2; // 0x2
    field public static final int CONTENT_CHANGE_TYPE_UNDEFINED = 0; // 0x0
    field public static final android.os.Parcelable.Creator<android.view.accessibility.AccessibilityEvent> CREATOR;
    field public static final int INVALID_POSITION = -1; // 0xffffffff
    field @Deprecated public static final int MAX_TEXT_LENGTH = 500; // 0x1f4
    field public static final int TYPES_ALL_MASK = -1; // 0xffffffff
    field public static final int TYPE_ANNOUNCEMENT = 16384; // 0x4000
    field public static final int TYPE_ASSIST_READING_CONTEXT = 16777216; // 0x1000000
    field public static final int TYPE_GESTURE_DETECTION_END = 524288; // 0x80000
    field public static final int TYPE_GESTURE_DETECTION_START = 262144; // 0x40000
    field public static final int TYPE_NOTIFICATION_STATE_CHANGED = 64; // 0x40
    field public static final int TYPE_TOUCH_EXPLORATION_GESTURE_END = 1024; // 0x400
    field public static final int TYPE_TOUCH_EXPLORATION_GESTURE_START = 512; // 0x200
    field public static final int TYPE_TOUCH_INTERACTION_END = 2097152; // 0x200000
    field public static final int TYPE_TOUCH_INTERACTION_START = 1048576; // 0x100000
    field public static final int TYPE_VIEW_ACCESSIBILITY_FOCUSED = 32768; // 0x8000
    field public static final int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED = 65536; // 0x10000
    field public static final int TYPE_VIEW_CLICKED = 1; // 0x1
    field public static final int TYPE_VIEW_CONTEXT_CLICKED = 8388608; // 0x800000
    field public static final int TYPE_VIEW_FOCUSED = 8; // 0x8
    field public static final int TYPE_VIEW_HOVER_ENTER = 128; // 0x80
    field public static final int TYPE_VIEW_HOVER_EXIT = 256; // 0x100
    field public static final int TYPE_VIEW_LONG_CLICKED = 2; // 0x2
    field public static final int TYPE_VIEW_SCROLLED = 4096; // 0x1000
    field public static final int TYPE_VIEW_SELECTED = 4; // 0x4
    field public static final int TYPE_VIEW_TEXT_CHANGED = 16; // 0x10
    field public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 8192; // 0x2000
    field public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY = 131072; // 0x20000
    field public static final int TYPE_WINDOWS_CHANGED = 4194304; // 0x400000
    field public static final int TYPE_WINDOW_CONTENT_CHANGED = 2048; // 0x800
    field public static final int TYPE_WINDOW_STATE_CHANGED = 32; // 0x20
    field public static final int WINDOWS_CHANGE_ACCESSIBILITY_FOCUSED = 128; // 0x80
    field public static final int WINDOWS_CHANGE_ACTIVE = 32; // 0x20
    field public static final int WINDOWS_CHANGE_ADDED = 1; // 0x1
    field public static final int WINDOWS_CHANGE_BOUNDS = 8; // 0x8
    field public static final int WINDOWS_CHANGE_CHILDREN = 512; // 0x200
    field public static final int WINDOWS_CHANGE_FOCUSED = 64; // 0x40
    field public static final int WINDOWS_CHANGE_LAYER = 16; // 0x10
    field public static final int WINDOWS_CHANGE_PARENT = 256; // 0x100
    field public static final int WINDOWS_CHANGE_PIP = 1024; // 0x400
    field public static final int WINDOWS_CHANGE_REMOVED = 2; // 0x2
    field public static final int WINDOWS_CHANGE_TITLE = 4; // 0x4
  }

  public interface AccessibilityEventSource {
    method public void sendAccessibilityEvent(int);
    method public void sendAccessibilityEventUnchecked(android.view.accessibility.AccessibilityEvent);
  }

  public final class AccessibilityManager {
    method public void addAccessibilityRequestPreparer(android.view.accessibility.AccessibilityRequestPreparer);
    method public boolean addAccessibilityStateChangeListener(@NonNull android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener);
    method public void addAccessibilityStateChangeListener(@NonNull android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener, @Nullable android.os.Handler);
    method public boolean addTouchExplorationStateChangeListener(@NonNull android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener);
    method public void addTouchExplorationStateChangeListener(@NonNull android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener, @Nullable android.os.Handler);
    method @Deprecated public java.util.List<android.content.pm.ServiceInfo> getAccessibilityServiceList();
    method public java.util.List<android.accessibilityservice.AccessibilityServiceInfo> getEnabledAccessibilityServiceList(int);
    method public java.util.List<android.accessibilityservice.AccessibilityServiceInfo> getInstalledAccessibilityServiceList();
    method public void interrupt();
    method public static boolean isAccessibilityButtonSupported();
    method public boolean isEnabled();
    method public boolean isTouchExplorationEnabled();
    method public void removeAccessibilityRequestPreparer(android.view.accessibility.AccessibilityRequestPreparer);
    method public boolean removeAccessibilityStateChangeListener(@NonNull android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener);
    method public boolean removeTouchExplorationStateChangeListener(@NonNull android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener);
    method public void sendAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
  }

  public static interface AccessibilityManager.AccessibilityStateChangeListener {
    method public void onAccessibilityStateChanged(boolean);
  }

  public static interface AccessibilityManager.TouchExplorationStateChangeListener {
    method public void onTouchExplorationStateChanged(boolean);
  }

  public class AccessibilityNodeInfo implements android.os.Parcelable {
    method public void addAction(android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction);
    method @Deprecated public void addAction(int);
    method public void addChild(android.view.View);
    method public void addChild(android.view.View, int);
    method public boolean canOpenPopup();
    method public int describeContents();
    method public java.util.List<android.view.accessibility.AccessibilityNodeInfo> findAccessibilityNodeInfosByText(String);
    method public java.util.List<android.view.accessibility.AccessibilityNodeInfo> findAccessibilityNodeInfosByViewId(String);
    method public android.view.accessibility.AccessibilityNodeInfo findFocus(int);
    method public android.view.accessibility.AccessibilityNodeInfo focusSearch(int);
    method public java.util.List<android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction> getActionList();
    method @Deprecated public int getActions();
    method public java.util.List<java.lang.String> getAvailableExtraData();
    method public void getBoundsInParent(android.graphics.Rect);
    method public void getBoundsInScreen(android.graphics.Rect);
    method public android.view.accessibility.AccessibilityNodeInfo getChild(int);
    method public int getChildCount();
    method public CharSequence getClassName();
    method public android.view.accessibility.AccessibilityNodeInfo.CollectionInfo getCollectionInfo();
    method public android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo getCollectionItemInfo();
    method public CharSequence getContentDescription();
    method public int getDrawingOrder();
    method public CharSequence getError();
    method public android.os.Bundle getExtras();
    method public CharSequence getHintText();
    method public int getInputType();
    method public android.view.accessibility.AccessibilityNodeInfo getLabelFor();
    method public android.view.accessibility.AccessibilityNodeInfo getLabeledBy();
    method public int getLiveRegion();
    method public int getMaxTextLength();
    method public int getMovementGranularities();
    method public CharSequence getPackageName();
    method @Nullable public CharSequence getPaneTitle();
    method public android.view.accessibility.AccessibilityNodeInfo getParent();
    method public android.view.accessibility.AccessibilityNodeInfo.RangeInfo getRangeInfo();
    method public CharSequence getText();
    method public int getTextSelectionEnd();
    method public int getTextSelectionStart();
    method @Nullable public CharSequence getTooltipText();
    method public android.view.accessibility.AccessibilityNodeInfo getTraversalAfter();
    method public android.view.accessibility.AccessibilityNodeInfo getTraversalBefore();
    method public String getViewIdResourceName();
    method public android.view.accessibility.AccessibilityWindowInfo getWindow();
    method public int getWindowId();
    method public boolean isAccessibilityFocused();
    method public boolean isCheckable();
    method public boolean isChecked();
    method public boolean isClickable();
    method public boolean isContentInvalid();
    method public boolean isContextClickable();
    method public boolean isDismissable();
    method public boolean isEditable();
    method public boolean isEnabled();
    method public boolean isFocusable();
    method public boolean isFocused();
    method public boolean isHeading();
    method public boolean isImportantForAccessibility();
    method public boolean isLongClickable();
    method public boolean isMultiLine();
    method public boolean isPassword();
    method public boolean isScreenReaderFocusable();
    method public boolean isScrollable();
    method public boolean isSelected();
    method public boolean isShowingHintText();
    method public boolean isVisibleToUser();
    method public static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.View);
    method public static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.View, int);
    method public static android.view.accessibility.AccessibilityNodeInfo obtain();
    method public static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.accessibility.AccessibilityNodeInfo);
    method public boolean performAction(int);
    method public boolean performAction(int, android.os.Bundle);
    method public void recycle();
    method public boolean refresh();
    method public boolean refreshWithExtraData(String, android.os.Bundle);
    method @Deprecated public void removeAction(int);
    method public boolean removeAction(android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction);
    method public boolean removeChild(android.view.View);
    method public boolean removeChild(android.view.View, int);
    method public void setAccessibilityFocused(boolean);
    method public void setAvailableExtraData(java.util.List<java.lang.String>);
    method public void setBoundsInParent(android.graphics.Rect);
    method public void setBoundsInScreen(android.graphics.Rect);
    method public void setCanOpenPopup(boolean);
    method public void setCheckable(boolean);
    method public void setChecked(boolean);
    method public void setClassName(CharSequence);
    method public void setClickable(boolean);
    method public void setCollectionInfo(android.view.accessibility.AccessibilityNodeInfo.CollectionInfo);
    method public void setCollectionItemInfo(android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo);
    method public void setContentDescription(CharSequence);
    method public void setContentInvalid(boolean);
    method public void setContextClickable(boolean);
    method public void setDismissable(boolean);
    method public void setDrawingOrder(int);
    method public void setEditable(boolean);
    method public void setEnabled(boolean);
    method public void setError(CharSequence);
    method public void setFocusable(boolean);
    method public void setFocused(boolean);
    method public void setHeading(boolean);
    method public void setHintText(CharSequence);
    method public void setImportantForAccessibility(boolean);
    method public void setInputType(int);
    method public void setLabelFor(android.view.View);
    method public void setLabelFor(android.view.View, int);
    method public void setLabeledBy(android.view.View);
    method public void setLabeledBy(android.view.View, int);
    method public void setLiveRegion(int);
    method public void setLongClickable(boolean);
    method public void setMaxTextLength(int);
    method public void setMovementGranularities(int);
    method public void setMultiLine(boolean);
    method public void setPackageName(CharSequence);
    method public void setPaneTitle(@Nullable CharSequence);
    method public void setParent(android.view.View);
    method public void setParent(android.view.View, int);
    method public void setPassword(boolean);
    method public void setRangeInfo(android.view.accessibility.AccessibilityNodeInfo.RangeInfo);
    method public void setScreenReaderFocusable(boolean);
    method public void setScrollable(boolean);
    method public void setSelected(boolean);
    method public void setShowingHintText(boolean);
    method public void setSource(android.view.View);
    method public void setSource(android.view.View, int);
    method public void setText(CharSequence);
    method public void setTextSelection(int, int);
    method public void setTooltipText(@Nullable CharSequence);
    method public void setTraversalAfter(android.view.View);
    method public void setTraversalAfter(android.view.View, int);
    method public void setTraversalBefore(android.view.View);
    method public void setTraversalBefore(android.view.View, int);
    method public void setViewIdResourceName(String);
    method public void setVisibleToUser(boolean);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ACTION_ACCESSIBILITY_FOCUS = 64; // 0x40
    field public static final String ACTION_ARGUMENT_COLUMN_INT = "android.view.accessibility.action.ARGUMENT_COLUMN_INT";
    field public static final String ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN = "ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN";
    field public static final String ACTION_ARGUMENT_HTML_ELEMENT_STRING = "ACTION_ARGUMENT_HTML_ELEMENT_STRING";
    field public static final String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT = "ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT";
    field public static final String ACTION_ARGUMENT_MOVE_WINDOW_X = "ACTION_ARGUMENT_MOVE_WINDOW_X";
    field public static final String ACTION_ARGUMENT_MOVE_WINDOW_Y = "ACTION_ARGUMENT_MOVE_WINDOW_Y";
    field public static final String ACTION_ARGUMENT_PROGRESS_VALUE = "android.view.accessibility.action.ARGUMENT_PROGRESS_VALUE";
    field public static final String ACTION_ARGUMENT_ROW_INT = "android.view.accessibility.action.ARGUMENT_ROW_INT";
    field public static final String ACTION_ARGUMENT_SELECTION_END_INT = "ACTION_ARGUMENT_SELECTION_END_INT";
    field public static final String ACTION_ARGUMENT_SELECTION_START_INT = "ACTION_ARGUMENT_SELECTION_START_INT";
    field public static final String ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE = "ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE";
    field public static final int ACTION_CLEAR_ACCESSIBILITY_FOCUS = 128; // 0x80
    field public static final int ACTION_CLEAR_FOCUS = 2; // 0x2
    field public static final int ACTION_CLEAR_SELECTION = 8; // 0x8
    field public static final int ACTION_CLICK = 16; // 0x10
    field public static final int ACTION_COLLAPSE = 524288; // 0x80000
    field public static final int ACTION_COPY = 16384; // 0x4000
    field public static final int ACTION_CUT = 65536; // 0x10000
    field public static final int ACTION_DISMISS = 1048576; // 0x100000
    field public static final int ACTION_EXPAND = 262144; // 0x40000
    field public static final int ACTION_FOCUS = 1; // 0x1
    field public static final int ACTION_LONG_CLICK = 32; // 0x20
    field public static final int ACTION_NEXT_AT_MOVEMENT_GRANULARITY = 256; // 0x100
    field public static final int ACTION_NEXT_HTML_ELEMENT = 1024; // 0x400
    field public static final int ACTION_PASTE = 32768; // 0x8000
    field public static final int ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY = 512; // 0x200
    field public static final int ACTION_PREVIOUS_HTML_ELEMENT = 2048; // 0x800
    field public static final int ACTION_SCROLL_BACKWARD = 8192; // 0x2000
    field public static final int ACTION_SCROLL_FORWARD = 4096; // 0x1000
    field public static final int ACTION_SELECT = 4; // 0x4
    field public static final int ACTION_SET_SELECTION = 131072; // 0x20000
    field public static final int ACTION_SET_TEXT = 2097152; // 0x200000
    field public static final android.os.Parcelable.Creator<android.view.accessibility.AccessibilityNodeInfo> CREATOR;
    field public static final String EXTRA_DATA_TEXT_CHARACTER_LOCATION_ARG_LENGTH = "android.view.accessibility.extra.DATA_TEXT_CHARACTER_LOCATION_ARG_LENGTH";
    field public static final String EXTRA_DATA_TEXT_CHARACTER_LOCATION_ARG_START_INDEX = "android.view.accessibility.extra.DATA_TEXT_CHARACTER_LOCATION_ARG_START_INDEX";
    field public static final String EXTRA_DATA_TEXT_CHARACTER_LOCATION_KEY = "android.view.accessibility.extra.DATA_TEXT_CHARACTER_LOCATION_KEY";
    field public static final int FOCUS_ACCESSIBILITY = 2; // 0x2
    field public static final int FOCUS_INPUT = 1; // 0x1
    field public static final int MOVEMENT_GRANULARITY_CHARACTER = 1; // 0x1
    field public static final int MOVEMENT_GRANULARITY_LINE = 4; // 0x4
    field public static final int MOVEMENT_GRANULARITY_PAGE = 16; // 0x10
    field public static final int MOVEMENT_GRANULARITY_PARAGRAPH = 8; // 0x8
    field public static final int MOVEMENT_GRANULARITY_WORD = 2; // 0x2
  }

  public static final class AccessibilityNodeInfo.AccessibilityAction {
    ctor public AccessibilityNodeInfo.AccessibilityAction(int, @Nullable CharSequence);
    method public int getId();
    method public CharSequence getLabel();
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_ACCESSIBILITY_FOCUS;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CLEAR_ACCESSIBILITY_FOCUS;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CLEAR_FOCUS;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CLEAR_SELECTION;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CLICK;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_COLLAPSE;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CONTEXT_CLICK;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_COPY;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CUT;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_DISMISS;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_EXPAND;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_FOCUS;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_HIDE_TOOLTIP;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_LONG_CLICK;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_MOVE_WINDOW;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_NEXT_AT_MOVEMENT_GRANULARITY;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_NEXT_HTML_ELEMENT;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_PASTE;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_PREVIOUS_HTML_ELEMENT;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SCROLL_BACKWARD;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SCROLL_DOWN;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SCROLL_FORWARD;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SCROLL_LEFT;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SCROLL_RIGHT;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SCROLL_TO_POSITION;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SCROLL_UP;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SELECT;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SET_PROGRESS;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SET_SELECTION;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SET_TEXT;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SHOW_ON_SCREEN;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SHOW_TOOLTIP;
  }

  public static final class AccessibilityNodeInfo.CollectionInfo {
    method public int getColumnCount();
    method public int getRowCount();
    method public int getSelectionMode();
    method public boolean isHierarchical();
    method public static android.view.accessibility.AccessibilityNodeInfo.CollectionInfo obtain(int, int, boolean);
    method public static android.view.accessibility.AccessibilityNodeInfo.CollectionInfo obtain(int, int, boolean, int);
    field public static final int SELECTION_MODE_MULTIPLE = 2; // 0x2
    field public static final int SELECTION_MODE_NONE = 0; // 0x0
    field public static final int SELECTION_MODE_SINGLE = 1; // 0x1
  }

  public static final class AccessibilityNodeInfo.CollectionItemInfo {
    method public int getColumnIndex();
    method public int getColumnSpan();
    method public int getRowIndex();
    method public int getRowSpan();
    method @Deprecated public boolean isHeading();
    method public boolean isSelected();
    method public static android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo obtain(int, int, int, int, boolean);
    method public static android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo obtain(int, int, int, int, boolean, boolean);
  }

  public static final class AccessibilityNodeInfo.RangeInfo {
    method public float getCurrent();
    method public float getMax();
    method public float getMin();
    method public int getType();
    method public static android.view.accessibility.AccessibilityNodeInfo.RangeInfo obtain(int, float, float, float);
    field public static final int RANGE_TYPE_FLOAT = 1; // 0x1
    field public static final int RANGE_TYPE_INT = 0; // 0x0
    field public static final int RANGE_TYPE_PERCENT = 2; // 0x2
  }

  public abstract class AccessibilityNodeProvider {
    ctor public AccessibilityNodeProvider();
    method public void addExtraDataToAccessibilityNodeInfo(int, android.view.accessibility.AccessibilityNodeInfo, String, android.os.Bundle);
    method public android.view.accessibility.AccessibilityNodeInfo createAccessibilityNodeInfo(int);
    method public java.util.List<android.view.accessibility.AccessibilityNodeInfo> findAccessibilityNodeInfosByText(String, int);
    method public android.view.accessibility.AccessibilityNodeInfo findFocus(int);
    method public boolean performAction(int, int, android.os.Bundle);
    field public static final int HOST_VIEW_ID = -1; // 0xffffffff
  }

  public class AccessibilityRecord {
    method public int getAddedCount();
    method public CharSequence getBeforeText();
    method public CharSequence getClassName();
    method public CharSequence getContentDescription();
    method public int getCurrentItemIndex();
    method public int getFromIndex();
    method public int getItemCount();
    method public int getMaxScrollX();
    method public int getMaxScrollY();
    method public android.os.Parcelable getParcelableData();
    method public int getRemovedCount();
    method public int getScrollDeltaX();
    method public int getScrollDeltaY();
    method public int getScrollX();
    method public int getScrollY();
    method public android.view.accessibility.AccessibilityNodeInfo getSource();
    method public java.util.List<java.lang.CharSequence> getText();
    method public int getToIndex();
    method public int getWindowId();
    method public boolean isChecked();
    method public boolean isEnabled();
    method public boolean isFullScreen();
    method public boolean isPassword();
    method public boolean isScrollable();
    method public static android.view.accessibility.AccessibilityRecord obtain(android.view.accessibility.AccessibilityRecord);
    method public static android.view.accessibility.AccessibilityRecord obtain();
    method public void recycle();
    method public void setAddedCount(int);
    method public void setBeforeText(CharSequence);
    method public void setChecked(boolean);
    method public void setClassName(CharSequence);
    method public void setContentDescription(CharSequence);
    method public void setCurrentItemIndex(int);
    method public void setEnabled(boolean);
    method public void setFromIndex(int);
    method public void setFullScreen(boolean);
    method public void setItemCount(int);
    method public void setMaxScrollX(int);
    method public void setMaxScrollY(int);
    method public void setParcelableData(android.os.Parcelable);
    method public void setPassword(boolean);
    method public void setRemovedCount(int);
    method public void setScrollDeltaX(int);
    method public void setScrollDeltaY(int);
    method public void setScrollX(int);
    method public void setScrollY(int);
    method public void setScrollable(boolean);
    method public void setSource(android.view.View);
    method public void setSource(@Nullable android.view.View, int);
    method public void setToIndex(int);
  }

  public abstract class AccessibilityRequestPreparer {
    ctor public AccessibilityRequestPreparer(android.view.View, int);
    method @Nullable public android.view.View getView();
    method public abstract void onPrepareExtraData(int, String, android.os.Bundle, android.os.Message);
    field public static final int REQUEST_TYPE_EXTRA_DATA = 1; // 0x1
  }

  public final class AccessibilityWindowInfo implements android.os.Parcelable {
    method public int describeContents();
    method public android.view.accessibility.AccessibilityNodeInfo getAnchor();
    method public void getBoundsInScreen(android.graphics.Rect);
    method public android.view.accessibility.AccessibilityWindowInfo getChild(int);
    method public int getChildCount();
    method public int getId();
    method public int getLayer();
    method public android.view.accessibility.AccessibilityWindowInfo getParent();
    method public android.view.accessibility.AccessibilityNodeInfo getRoot();
    method @Nullable public CharSequence getTitle();
    method public int getType();
    method public boolean isAccessibilityFocused();
    method public boolean isActive();
    method public boolean isFocused();
    method public boolean isInPictureInPictureMode();
    method public static android.view.accessibility.AccessibilityWindowInfo obtain();
    method public static android.view.accessibility.AccessibilityWindowInfo obtain(android.view.accessibility.AccessibilityWindowInfo);
    method public void recycle();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.accessibility.AccessibilityWindowInfo> CREATOR;
    field public static final int TYPE_ACCESSIBILITY_OVERLAY = 4; // 0x4
    field public static final int TYPE_APPLICATION = 1; // 0x1
    field public static final int TYPE_INPUT_METHOD = 2; // 0x2
    field public static final int TYPE_SPLIT_SCREEN_DIVIDER = 5; // 0x5
    field public static final int TYPE_SYSTEM = 3; // 0x3
  }

  public class CaptioningManager {
    method public void addCaptioningChangeListener(@NonNull android.view.accessibility.CaptioningManager.CaptioningChangeListener);
    method public final float getFontScale();
    method @Nullable public final java.util.Locale getLocale();
    method @NonNull public android.view.accessibility.CaptioningManager.CaptionStyle getUserStyle();
    method public final boolean isEnabled();
    method public void removeCaptioningChangeListener(@NonNull android.view.accessibility.CaptioningManager.CaptioningChangeListener);
  }

  public static final class CaptioningManager.CaptionStyle {
    method @Nullable public android.graphics.Typeface getTypeface();
    method public boolean hasBackgroundColor();
    method public boolean hasEdgeColor();
    method public boolean hasEdgeType();
    method public boolean hasForegroundColor();
    method public boolean hasWindowColor();
    field public static final int EDGE_TYPE_DEPRESSED = 4; // 0x4
    field public static final int EDGE_TYPE_DROP_SHADOW = 2; // 0x2
    field public static final int EDGE_TYPE_NONE = 0; // 0x0
    field public static final int EDGE_TYPE_OUTLINE = 1; // 0x1
    field public static final int EDGE_TYPE_RAISED = 3; // 0x3
    field public static final int EDGE_TYPE_UNSPECIFIED = -1; // 0xffffffff
    field public final int backgroundColor;
    field public final int edgeColor;
    field public final int edgeType;
    field public final int foregroundColor;
    field public final int windowColor;
  }

  public abstract static class CaptioningManager.CaptioningChangeListener {
    ctor public CaptioningManager.CaptioningChangeListener();
    method public void onEnabledChanged(boolean);
    method public void onFontScaleChanged(float);
    method public void onLocaleChanged(@Nullable java.util.Locale);
    method public void onUserStyleChanged(@NonNull android.view.accessibility.CaptioningManager.CaptionStyle);
  }

}

package android.view.animation {

  public class AccelerateDecelerateInterpolator extends android.view.animation.BaseInterpolator {
    ctor public AccelerateDecelerateInterpolator();
    ctor public AccelerateDecelerateInterpolator(android.content.Context, android.util.AttributeSet);
    method public float getInterpolation(float);
  }

  public class AccelerateInterpolator extends android.view.animation.BaseInterpolator {
    ctor public AccelerateInterpolator();
    ctor public AccelerateInterpolator(float);
    ctor public AccelerateInterpolator(android.content.Context, android.util.AttributeSet);
    method public float getInterpolation(float);
  }

  public class AlphaAnimation extends android.view.animation.Animation {
    ctor public AlphaAnimation(android.content.Context, android.util.AttributeSet);
    ctor public AlphaAnimation(float, float);
  }

  public abstract class Animation implements java.lang.Cloneable {
    ctor public Animation();
    ctor public Animation(android.content.Context, android.util.AttributeSet);
    method protected void applyTransformation(float, android.view.animation.Transformation);
    method public void cancel();
    method protected android.view.animation.Animation clone() throws java.lang.CloneNotSupportedException;
    method public long computeDurationHint();
    method protected void ensureInterpolator();
    method @ColorInt public int getBackgroundColor();
    method public boolean getDetachWallpaper();
    method public long getDuration();
    method public boolean getFillAfter();
    method public boolean getFillBefore();
    method public android.view.animation.Interpolator getInterpolator();
    method public int getRepeatCount();
    method public int getRepeatMode();
    method protected float getScaleFactor();
    method public long getStartOffset();
    method public long getStartTime();
    method public boolean getTransformation(long, android.view.animation.Transformation);
    method public boolean getTransformation(long, android.view.animation.Transformation, float);
    method public int getZAdjustment();
    method public boolean hasEnded();
    method public boolean hasStarted();
    method public void initialize(int, int, int, int);
    method public boolean isFillEnabled();
    method public boolean isInitialized();
    method public void reset();
    method protected float resolveSize(int, float, int, int);
    method public void restrictDuration(long);
    method public void scaleCurrentDuration(float);
    method public void setAnimationListener(android.view.animation.Animation.AnimationListener);
    method public void setBackgroundColor(@ColorInt int);
    method public void setDetachWallpaper(boolean);
    method public void setDuration(long);
    method public void setFillAfter(boolean);
    method public void setFillBefore(boolean);
    method public void setFillEnabled(boolean);
    method public void setInterpolator(android.content.Context, @AnimRes @InterpolatorRes int);
    method public void setInterpolator(android.view.animation.Interpolator);
    method public void setRepeatCount(int);
    method public void setRepeatMode(int);
    method public void setStartOffset(long);
    method public void setStartTime(long);
    method public void setZAdjustment(int);
    method public void start();
    method public void startNow();
    method public boolean willChangeBounds();
    method public boolean willChangeTransformationMatrix();
    field public static final int ABSOLUTE = 0; // 0x0
    field public static final int INFINITE = -1; // 0xffffffff
    field public static final int RELATIVE_TO_PARENT = 2; // 0x2
    field public static final int RELATIVE_TO_SELF = 1; // 0x1
    field public static final int RESTART = 1; // 0x1
    field public static final int REVERSE = 2; // 0x2
    field public static final int START_ON_FIRST_FRAME = -1; // 0xffffffff
    field public static final int ZORDER_BOTTOM = -1; // 0xffffffff
    field public static final int ZORDER_NORMAL = 0; // 0x0
    field public static final int ZORDER_TOP = 1; // 0x1
  }

  public static interface Animation.AnimationListener {
    method public void onAnimationEnd(android.view.animation.Animation);
    method public void onAnimationRepeat(android.view.animation.Animation);
    method public void onAnimationStart(android.view.animation.Animation);
  }

  protected static class Animation.Description {
    ctor protected Animation.Description();
    field public int type;
    field public float value;
  }

  public class AnimationSet extends android.view.animation.Animation {
    ctor public AnimationSet(android.content.Context, android.util.AttributeSet);
    ctor public AnimationSet(boolean);
    method public void addAnimation(android.view.animation.Animation);
    method protected android.view.animation.AnimationSet clone() throws java.lang.CloneNotSupportedException;
    method public java.util.List<android.view.animation.Animation> getAnimations();
  }

  public class AnimationUtils {
    ctor public AnimationUtils();
    method public static long currentAnimationTimeMillis();
    method public static android.view.animation.Animation loadAnimation(android.content.Context, @AnimRes int) throws android.content.res.Resources.NotFoundException;
    method public static android.view.animation.Interpolator loadInterpolator(android.content.Context, @AnimRes @InterpolatorRes int) throws android.content.res.Resources.NotFoundException;
    method public static android.view.animation.LayoutAnimationController loadLayoutAnimation(android.content.Context, @AnimRes int) throws android.content.res.Resources.NotFoundException;
    method public static android.view.animation.Animation makeInAnimation(android.content.Context, boolean);
    method public static android.view.animation.Animation makeInChildBottomAnimation(android.content.Context);
    method public static android.view.animation.Animation makeOutAnimation(android.content.Context, boolean);
  }

  public class AnticipateInterpolator extends android.view.animation.BaseInterpolator {
    ctor public AnticipateInterpolator();
    ctor public AnticipateInterpolator(float);
    ctor public AnticipateInterpolator(android.content.Context, android.util.AttributeSet);
    method public float getInterpolation(float);
  }

  public class AnticipateOvershootInterpolator extends android.view.animation.BaseInterpolator {
    ctor public AnticipateOvershootInterpolator();
    ctor public AnticipateOvershootInterpolator(float);
    ctor public AnticipateOvershootInterpolator(float, float);
    ctor public AnticipateOvershootInterpolator(android.content.Context, android.util.AttributeSet);
    method public float getInterpolation(float);
  }

  public abstract class BaseInterpolator implements android.view.animation.Interpolator {
    ctor public BaseInterpolator();
  }

  public class BounceInterpolator extends android.view.animation.BaseInterpolator {
    ctor public BounceInterpolator();
    ctor public BounceInterpolator(android.content.Context, android.util.AttributeSet);
    method public float getInterpolation(float);
  }

  public class CycleInterpolator extends android.view.animation.BaseInterpolator {
    ctor public CycleInterpolator(float);
    ctor public CycleInterpolator(android.content.Context, android.util.AttributeSet);
    method public float getInterpolation(float);
  }

  public class DecelerateInterpolator extends android.view.animation.BaseInterpolator {
    ctor public DecelerateInterpolator();
    ctor public DecelerateInterpolator(float);
    ctor public DecelerateInterpolator(android.content.Context, android.util.AttributeSet);
    method public float getInterpolation(float);
  }

  public class GridLayoutAnimationController extends android.view.animation.LayoutAnimationController {
    ctor public GridLayoutAnimationController(android.content.Context, android.util.AttributeSet);
    ctor public GridLayoutAnimationController(android.view.animation.Animation);
    ctor public GridLayoutAnimationController(android.view.animation.Animation, float, float);
    method public float getColumnDelay();
    method public int getDirection();
    method public int getDirectionPriority();
    method public float getRowDelay();
    method public void setColumnDelay(float);
    method public void setDirection(int);
    method public void setDirectionPriority(int);
    method public void setRowDelay(float);
    field public static final int DIRECTION_BOTTOM_TO_TOP = 2; // 0x2
    field public static final int DIRECTION_HORIZONTAL_MASK = 1; // 0x1
    field public static final int DIRECTION_LEFT_TO_RIGHT = 0; // 0x0
    field public static final int DIRECTION_RIGHT_TO_LEFT = 1; // 0x1
    field public static final int DIRECTION_TOP_TO_BOTTOM = 0; // 0x0
    field public static final int DIRECTION_VERTICAL_MASK = 2; // 0x2
    field public static final int PRIORITY_COLUMN = 1; // 0x1
    field public static final int PRIORITY_NONE = 0; // 0x0
    field public static final int PRIORITY_ROW = 2; // 0x2
  }

  public static class GridLayoutAnimationController.AnimationParameters extends android.view.animation.LayoutAnimationController.AnimationParameters {
    ctor public GridLayoutAnimationController.AnimationParameters();
    field public int column;
    field public int columnsCount;
    field public int row;
    field public int rowsCount;
  }

  public interface Interpolator extends android.animation.TimeInterpolator {
  }

  public class LayoutAnimationController {
    ctor public LayoutAnimationController(android.content.Context, android.util.AttributeSet);
    ctor public LayoutAnimationController(android.view.animation.Animation);
    ctor public LayoutAnimationController(android.view.animation.Animation, float);
    method public android.view.animation.Animation getAnimation();
    method public final android.view.animation.Animation getAnimationForView(android.view.View);
    method public float getDelay();
    method protected long getDelayForView(android.view.View);
    method public android.view.animation.Interpolator getInterpolator();
    method public int getOrder();
    method protected int getTransformedIndex(android.view.animation.LayoutAnimationController.AnimationParameters);
    method public boolean isDone();
    method public void setAnimation(android.content.Context, @AnimRes int);
    method public void setAnimation(android.view.animation.Animation);
    method public void setDelay(float);
    method public void setInterpolator(android.content.Context, @InterpolatorRes int);
    method public void setInterpolator(android.view.animation.Interpolator);
    method public void setOrder(int);
    method public void start();
    method public boolean willOverlap();
    field public static final int ORDER_NORMAL = 0; // 0x0
    field public static final int ORDER_RANDOM = 2; // 0x2
    field public static final int ORDER_REVERSE = 1; // 0x1
    field protected android.view.animation.Animation mAnimation;
    field protected android.view.animation.Interpolator mInterpolator;
    field protected java.util.Random mRandomizer;
  }

  public static class LayoutAnimationController.AnimationParameters {
    ctor public LayoutAnimationController.AnimationParameters();
    field public int count;
    field public int index;
  }

  public class LinearInterpolator extends android.view.animation.BaseInterpolator {
    ctor public LinearInterpolator();
    ctor public LinearInterpolator(android.content.Context, android.util.AttributeSet);
    method public float getInterpolation(float);
  }

  public class OvershootInterpolator extends android.view.animation.BaseInterpolator {
    ctor public OvershootInterpolator();
    ctor public OvershootInterpolator(float);
    ctor public OvershootInterpolator(android.content.Context, android.util.AttributeSet);
    method public float getInterpolation(float);
  }

  public class PathInterpolator extends android.view.animation.BaseInterpolator {
    ctor public PathInterpolator(android.graphics.Path);
    ctor public PathInterpolator(float, float);
    ctor public PathInterpolator(float, float, float, float);
    ctor public PathInterpolator(android.content.Context, android.util.AttributeSet);
    method public float getInterpolation(float);
  }

  public class RotateAnimation extends android.view.animation.Animation {
    ctor public RotateAnimation(android.content.Context, android.util.AttributeSet);
    ctor public RotateAnimation(float, float);
    ctor public RotateAnimation(float, float, float, float);
    ctor public RotateAnimation(float, float, int, float, int, float);
  }

  public class ScaleAnimation extends android.view.animation.Animation {
    ctor public ScaleAnimation(android.content.Context, android.util.AttributeSet);
    ctor public ScaleAnimation(float, float, float, float);
    ctor public ScaleAnimation(float, float, float, float, float, float);
    ctor public ScaleAnimation(float, float, float, float, int, float, int, float);
  }

  public class Transformation {
    ctor public Transformation();
    method public void clear();
    method public void compose(android.view.animation.Transformation);
    method public float getAlpha();
    method public android.graphics.Matrix getMatrix();
    method public int getTransformationType();
    method public void set(android.view.animation.Transformation);
    method public void setAlpha(@FloatRange(from=0.0, to=1.0) float);
    method public void setTransformationType(int);
    method public String toShortString();
    field public static final int TYPE_ALPHA = 1; // 0x1
    field public static final int TYPE_BOTH = 3; // 0x3
    field public static final int TYPE_IDENTITY = 0; // 0x0
    field public static final int TYPE_MATRIX = 2; // 0x2
    field protected float mAlpha;
    field protected android.graphics.Matrix mMatrix;
    field protected int mTransformationType;
  }

  public class TranslateAnimation extends android.view.animation.Animation {
    ctor public TranslateAnimation(android.content.Context, android.util.AttributeSet);
    ctor public TranslateAnimation(float, float, float, float);
    ctor public TranslateAnimation(int, float, int, float, int, float, int, float);
  }

}

package android.view.autofill {

  public final class AutofillId implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.autofill.AutofillId> CREATOR;
  }

  public final class AutofillManager {
    method public void cancel();
    method public void commit();
    method public void disableAutofillServices();
    method @Nullable public android.content.ComponentName getAutofillServiceComponentName();
    method @NonNull public java.util.List<java.lang.String> getAvailableFieldClassificationAlgorithms();
    method @Nullable public String getDefaultFieldClassificationAlgorithm();
    method @Nullable public android.view.autofill.AutofillId getNextAutofillId();
    method @Nullable public android.service.autofill.UserData getUserData();
    method @Nullable public String getUserDataId();
    method public boolean hasEnabledAutofillServices();
    method public boolean isAutofillSupported();
    method public boolean isEnabled();
    method public boolean isFieldClassificationEnabled();
    method public void notifyValueChanged(android.view.View);
    method public void notifyValueChanged(android.view.View, int, android.view.autofill.AutofillValue);
    method public void notifyViewClicked(@NonNull android.view.View);
    method public void notifyViewClicked(@NonNull android.view.View, int);
    method public void notifyViewEntered(@NonNull android.view.View);
    method public void notifyViewEntered(@NonNull android.view.View, int, @NonNull android.graphics.Rect);
    method public void notifyViewExited(@NonNull android.view.View);
    method public void notifyViewExited(@NonNull android.view.View, int);
    method public void notifyViewVisibilityChanged(@NonNull android.view.View, boolean);
    method public void notifyViewVisibilityChanged(@NonNull android.view.View, int, boolean);
    method public void registerCallback(@Nullable android.view.autofill.AutofillManager.AutofillCallback);
    method public void requestAutofill(@NonNull android.view.View);
    method public void requestAutofill(@NonNull android.view.View, int, @NonNull android.graphics.Rect);
    method public void setUserData(@Nullable android.service.autofill.UserData);
    method public void unregisterCallback(@Nullable android.view.autofill.AutofillManager.AutofillCallback);
    field public static final String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE";
    field public static final String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT";
    field public static final String EXTRA_CLIENT_STATE = "android.view.autofill.extra.CLIENT_STATE";
  }

  public abstract static class AutofillManager.AutofillCallback {
    ctor public AutofillManager.AutofillCallback();
    method public void onAutofillEvent(@NonNull android.view.View, int);
    method public void onAutofillEvent(@NonNull android.view.View, int, int);
    field public static final int EVENT_INPUT_HIDDEN = 2; // 0x2
    field public static final int EVENT_INPUT_SHOWN = 1; // 0x1
    field public static final int EVENT_INPUT_UNAVAILABLE = 3; // 0x3
  }

  public final class AutofillValue implements android.os.Parcelable {
    method public int describeContents();
    method public static android.view.autofill.AutofillValue forDate(long);
    method public static android.view.autofill.AutofillValue forList(int);
    method public static android.view.autofill.AutofillValue forText(@Nullable CharSequence);
    method public static android.view.autofill.AutofillValue forToggle(boolean);
    method public long getDateValue();
    method public int getListValue();
    method @NonNull public CharSequence getTextValue();
    method public boolean getToggleValue();
    method public boolean isDate();
    method public boolean isList();
    method public boolean isText();
    method public boolean isToggle();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.autofill.AutofillValue> CREATOR;
  }

}

package android.view.inputmethod {

  public class BaseInputConnection implements android.view.inputmethod.InputConnection {
    ctor public BaseInputConnection(android.view.View, boolean);
    method public boolean beginBatchEdit();
    method public boolean clearMetaKeyStates(int);
    method @CallSuper public void closeConnection();
    method public boolean commitCompletion(android.view.inputmethod.CompletionInfo);
    method public boolean commitContent(android.view.inputmethod.InputContentInfo, int, android.os.Bundle);
    method public boolean commitCorrection(android.view.inputmethod.CorrectionInfo);
    method public boolean commitText(CharSequence, int);
    method public boolean deleteSurroundingText(int, int);
    method public boolean deleteSurroundingTextInCodePoints(int, int);
    method public boolean endBatchEdit();
    method public boolean finishComposingText();
    method public static int getComposingSpanEnd(android.text.Spannable);
    method public static int getComposingSpanStart(android.text.Spannable);
    method public int getCursorCapsMode(int);
    method public android.text.Editable getEditable();
    method public android.view.inputmethod.ExtractedText getExtractedText(android.view.inputmethod.ExtractedTextRequest, int);
    method public android.os.Handler getHandler();
    method public CharSequence getSelectedText(int);
    method public CharSequence getTextAfterCursor(int, int);
    method public CharSequence getTextBeforeCursor(int, int);
    method public boolean performContextMenuAction(int);
    method public boolean performEditorAction(int);
    method public boolean performPrivateCommand(String, android.os.Bundle);
    method public static final void removeComposingSpans(android.text.Spannable);
    method public boolean reportFullscreenMode(boolean);
    method public boolean requestCursorUpdates(int);
    method public boolean sendKeyEvent(android.view.KeyEvent);
    method public boolean setComposingRegion(int, int);
    method public static void setComposingSpans(android.text.Spannable);
    method public boolean setComposingText(CharSequence, int);
    method public boolean setSelection(int, int);
  }

  public final class CompletionInfo implements android.os.Parcelable {
    ctor public CompletionInfo(long, int, CharSequence);
    ctor public CompletionInfo(long, int, CharSequence, CharSequence);
    method public int describeContents();
    method public long getId();
    method public CharSequence getLabel();
    method public int getPosition();
    method public CharSequence getText();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.CompletionInfo> CREATOR;
  }

  public final class CorrectionInfo implements android.os.Parcelable {
    ctor public CorrectionInfo(int, CharSequence, CharSequence);
    method public int describeContents();
    method public CharSequence getNewText();
    method public int getOffset();
    method public CharSequence getOldText();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.CorrectionInfo> CREATOR;
  }

  public final class CursorAnchorInfo implements android.os.Parcelable {
    ctor public CursorAnchorInfo(android.os.Parcel);
    method public int describeContents();
    method public android.graphics.RectF getCharacterBounds(int);
    method public int getCharacterBoundsFlags(int);
    method public CharSequence getComposingText();
    method public int getComposingTextStart();
    method public float getInsertionMarkerBaseline();
    method public float getInsertionMarkerBottom();
    method public int getInsertionMarkerFlags();
    method public float getInsertionMarkerHorizontal();
    method public float getInsertionMarkerTop();
    method public android.graphics.Matrix getMatrix();
    method public int getSelectionEnd();
    method public int getSelectionStart();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.CursorAnchorInfo> CREATOR;
    field public static final int FLAG_HAS_INVISIBLE_REGION = 2; // 0x2
    field public static final int FLAG_HAS_VISIBLE_REGION = 1; // 0x1
    field public static final int FLAG_IS_RTL = 4; // 0x4
  }

  public static final class CursorAnchorInfo.Builder {
    ctor public CursorAnchorInfo.Builder();
    method public android.view.inputmethod.CursorAnchorInfo.Builder addCharacterBounds(int, float, float, float, float, int);
    method public android.view.inputmethod.CursorAnchorInfo build();
    method public void reset();
    method public android.view.inputmethod.CursorAnchorInfo.Builder setComposingText(int, CharSequence);
    method public android.view.inputmethod.CursorAnchorInfo.Builder setInsertionMarkerLocation(float, float, float, float, int);
    method public android.view.inputmethod.CursorAnchorInfo.Builder setMatrix(android.graphics.Matrix);
    method public android.view.inputmethod.CursorAnchorInfo.Builder setSelectionRange(int, int);
  }

  public class EditorInfo implements android.text.InputType android.os.Parcelable {
    ctor public EditorInfo();
    method public int describeContents();
    method public void dump(android.util.Printer, String);
    method public final void makeCompatible(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.EditorInfo> CREATOR;
    field public static final int IME_ACTION_DONE = 6; // 0x6
    field public static final int IME_ACTION_GO = 2; // 0x2
    field public static final int IME_ACTION_NEXT = 5; // 0x5
    field public static final int IME_ACTION_NONE = 1; // 0x1
    field public static final int IME_ACTION_PREVIOUS = 7; // 0x7
    field public static final int IME_ACTION_SEARCH = 3; // 0x3
    field public static final int IME_ACTION_SEND = 4; // 0x4
    field public static final int IME_ACTION_UNSPECIFIED = 0; // 0x0
    field public static final int IME_FLAG_FORCE_ASCII = -2147483648; // 0x80000000
    field public static final int IME_FLAG_NAVIGATE_NEXT = 134217728; // 0x8000000
    field public static final int IME_FLAG_NAVIGATE_PREVIOUS = 67108864; // 0x4000000
    field public static final int IME_FLAG_NO_ACCESSORY_ACTION = 536870912; // 0x20000000
    field public static final int IME_FLAG_NO_ENTER_ACTION = 1073741824; // 0x40000000
    field public static final int IME_FLAG_NO_EXTRACT_UI = 268435456; // 0x10000000
    field public static final int IME_FLAG_NO_FULLSCREEN = 33554432; // 0x2000000
    field public static final int IME_FLAG_NO_PERSONALIZED_LEARNING = 16777216; // 0x1000000
    field public static final int IME_MASK_ACTION = 255; // 0xff
    field public static final int IME_NULL = 0; // 0x0
    field public int actionId;
    field public CharSequence actionLabel;
    field @Nullable public String[] contentMimeTypes;
    field public android.os.Bundle extras;
    field public int fieldId;
    field public String fieldName;
    field @Nullable public android.os.LocaleList hintLocales;
    field public CharSequence hintText;
    field public int imeOptions;
    field public int initialCapsMode;
    field public int initialSelEnd;
    field public int initialSelStart;
    field public int inputType;
    field public CharSequence label;
    field public String packageName;
    field public String privateImeOptions;
  }

  public class ExtractedText implements android.os.Parcelable {
    ctor public ExtractedText();
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.ExtractedText> CREATOR;
    field public static final int FLAG_SELECTING = 2; // 0x2
    field public static final int FLAG_SINGLE_LINE = 1; // 0x1
    field public int flags;
    field public CharSequence hint;
    field public int partialEndOffset;
    field public int partialStartOffset;
    field public int selectionEnd;
    field public int selectionStart;
    field public int startOffset;
    field public CharSequence text;
  }

  public class ExtractedTextRequest implements android.os.Parcelable {
    ctor public ExtractedTextRequest();
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.ExtractedTextRequest> CREATOR;
    field public int flags;
    field public int hintMaxChars;
    field public int hintMaxLines;
    field public int token;
  }

  public final class InputBinding implements android.os.Parcelable {
    ctor public InputBinding(android.view.inputmethod.InputConnection, android.os.IBinder, int, int);
    ctor public InputBinding(android.view.inputmethod.InputConnection, android.view.inputmethod.InputBinding);
    method public int describeContents();
    method public android.view.inputmethod.InputConnection getConnection();
    method public android.os.IBinder getConnectionToken();
    method public int getPid();
    method public int getUid();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.InputBinding> CREATOR;
  }

  public interface InputConnection {
    method public boolean beginBatchEdit();
    method public boolean clearMetaKeyStates(int);
    method public void closeConnection();
    method public boolean commitCompletion(android.view.inputmethod.CompletionInfo);
    method public boolean commitContent(@NonNull android.view.inputmethod.InputContentInfo, int, @Nullable android.os.Bundle);
    method public boolean commitCorrection(android.view.inputmethod.CorrectionInfo);
    method public boolean commitText(CharSequence, int);
    method public boolean deleteSurroundingText(int, int);
    method public boolean deleteSurroundingTextInCodePoints(int, int);
    method public boolean endBatchEdit();
    method public boolean finishComposingText();
    method public int getCursorCapsMode(int);
    method public android.view.inputmethod.ExtractedText getExtractedText(android.view.inputmethod.ExtractedTextRequest, int);
    method public android.os.Handler getHandler();
    method public CharSequence getSelectedText(int);
    method public CharSequence getTextAfterCursor(int, int);
    method public CharSequence getTextBeforeCursor(int, int);
    method public boolean performContextMenuAction(int);
    method public boolean performEditorAction(int);
    method public boolean performPrivateCommand(String, android.os.Bundle);
    method public boolean reportFullscreenMode(boolean);
    method public boolean requestCursorUpdates(int);
    method public boolean sendKeyEvent(android.view.KeyEvent);
    method public boolean setComposingRegion(int, int);
    method public boolean setComposingText(CharSequence, int);
    method public boolean setSelection(int, int);
    field public static final int CURSOR_UPDATE_IMMEDIATE = 1; // 0x1
    field public static final int CURSOR_UPDATE_MONITOR = 2; // 0x2
    field public static final int GET_EXTRACTED_TEXT_MONITOR = 1; // 0x1
    field public static final int GET_TEXT_WITH_STYLES = 1; // 0x1
    field public static final int INPUT_CONTENT_GRANT_READ_URI_PERMISSION = 1; // 0x1
  }

  public class InputConnectionWrapper implements android.view.inputmethod.InputConnection {
    ctor public InputConnectionWrapper(android.view.inputmethod.InputConnection, boolean);
    method public boolean beginBatchEdit();
    method public boolean clearMetaKeyStates(int);
    method public void closeConnection();
    method public boolean commitCompletion(android.view.inputmethod.CompletionInfo);
    method public boolean commitContent(android.view.inputmethod.InputContentInfo, int, android.os.Bundle);
    method public boolean commitCorrection(android.view.inputmethod.CorrectionInfo);
    method public boolean commitText(CharSequence, int);
    method public boolean deleteSurroundingText(int, int);
    method public boolean deleteSurroundingTextInCodePoints(int, int);
    method public boolean endBatchEdit();
    method public boolean finishComposingText();
    method public int getCursorCapsMode(int);
    method public android.view.inputmethod.ExtractedText getExtractedText(android.view.inputmethod.ExtractedTextRequest, int);
    method public android.os.Handler getHandler();
    method public CharSequence getSelectedText(int);
    method public CharSequence getTextAfterCursor(int, int);
    method public CharSequence getTextBeforeCursor(int, int);
    method public boolean performContextMenuAction(int);
    method public boolean performEditorAction(int);
    method public boolean performPrivateCommand(String, android.os.Bundle);
    method public boolean reportFullscreenMode(boolean);
    method public boolean requestCursorUpdates(int);
    method public boolean sendKeyEvent(android.view.KeyEvent);
    method public boolean setComposingRegion(int, int);
    method public boolean setComposingText(CharSequence, int);
    method public boolean setSelection(int, int);
    method public void setTarget(android.view.inputmethod.InputConnection);
  }

  public final class InputContentInfo implements android.os.Parcelable {
    ctor public InputContentInfo(@NonNull android.net.Uri, @NonNull android.content.ClipDescription);
    ctor public InputContentInfo(@NonNull android.net.Uri, @NonNull android.content.ClipDescription, @Nullable android.net.Uri);
    method public int describeContents();
    method @NonNull public android.net.Uri getContentUri();
    method @NonNull public android.content.ClipDescription getDescription();
    method @Nullable public android.net.Uri getLinkUri();
    method public void releasePermission();
    method public void requestPermission();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.InputContentInfo> CREATOR;
  }

  public interface InputMethod {
    method @MainThread public void attachToken(android.os.IBinder);
    method @MainThread public void bindInput(android.view.inputmethod.InputBinding);
    method @MainThread public void changeInputMethodSubtype(android.view.inputmethod.InputMethodSubtype);
    method @MainThread public void createSession(android.view.inputmethod.InputMethod.SessionCallback);
    method @MainThread public void hideSoftInput(int, android.os.ResultReceiver);
    method @MainThread public void restartInput(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo);
    method @MainThread public void revokeSession(android.view.inputmethod.InputMethodSession);
    method @MainThread public void setSessionEnabled(android.view.inputmethod.InputMethodSession, boolean);
    method @MainThread public void showSoftInput(int, android.os.ResultReceiver);
    method @MainThread public void startInput(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo);
    method @MainThread public void unbindInput();
    field public static final String SERVICE_INTERFACE = "android.view.InputMethod";
    field public static final String SERVICE_META_DATA = "android.view.im";
    field public static final int SHOW_EXPLICIT = 1; // 0x1
    field public static final int SHOW_FORCED = 2; // 0x2
  }

  public static interface InputMethod.SessionCallback {
    method public void sessionCreated(android.view.inputmethod.InputMethodSession);
  }

  public final class InputMethodInfo implements android.os.Parcelable {
    ctor public InputMethodInfo(android.content.Context, android.content.pm.ResolveInfo) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    ctor public InputMethodInfo(String, String, CharSequence, String);
    method public int describeContents();
    method public void dump(android.util.Printer, String);
    method public android.content.ComponentName getComponent();
    method public String getId();
    method public int getIsDefaultResourceId();
    method public String getPackageName();
    method public android.content.pm.ServiceInfo getServiceInfo();
    method public String getServiceName();
    method public String getSettingsActivity();
    method public android.view.inputmethod.InputMethodSubtype getSubtypeAt(int);
    method public int getSubtypeCount();
    method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager);
    method public CharSequence loadLabel(android.content.pm.PackageManager);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.InputMethodInfo> CREATOR;
  }

  public final class InputMethodManager {
    method public void dispatchKeyEventFromInputMethod(@Nullable android.view.View, @NonNull android.view.KeyEvent);
    method public void displayCompletions(android.view.View, android.view.inputmethod.CompletionInfo[]);
    method public android.view.inputmethod.InputMethodSubtype getCurrentInputMethodSubtype();
    method public java.util.List<android.view.inputmethod.InputMethodInfo> getEnabledInputMethodList();
    method public java.util.List<android.view.inputmethod.InputMethodSubtype> getEnabledInputMethodSubtypeList(android.view.inputmethod.InputMethodInfo, boolean);
    method public java.util.List<android.view.inputmethod.InputMethodInfo> getInputMethodList();
    method public android.view.inputmethod.InputMethodSubtype getLastInputMethodSubtype();
    method public java.util.Map<android.view.inputmethod.InputMethodInfo,java.util.List<android.view.inputmethod.InputMethodSubtype>> getShortcutInputMethodsAndSubtypes();
    method @Deprecated public void hideSoftInputFromInputMethod(android.os.IBinder, int);
    method public boolean hideSoftInputFromWindow(android.os.IBinder, int);
    method public boolean hideSoftInputFromWindow(android.os.IBinder, int, android.os.ResultReceiver);
    method @Deprecated public void hideStatusIcon(android.os.IBinder);
    method public boolean isAcceptingText();
    method public boolean isActive(android.view.View);
    method public boolean isActive();
    method public boolean isFullscreenMode();
    method @Deprecated public boolean isWatchingCursor(android.view.View);
    method public void restartInput(android.view.View);
    method public void sendAppPrivateCommand(android.view.View, String, android.os.Bundle);
    method public void setAdditionalInputMethodSubtypes(String, android.view.inputmethod.InputMethodSubtype[]);
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean setCurrentInputMethodSubtype(android.view.inputmethod.InputMethodSubtype);
    method @Deprecated public void setInputMethod(android.os.IBinder, String);
    method @Deprecated public void setInputMethodAndSubtype(android.os.IBinder, String, android.view.inputmethod.InputMethodSubtype);
    method @Deprecated public boolean shouldOfferSwitchingToNextInputMethod(android.os.IBinder);
    method public void showInputMethodAndSubtypeEnabler(String);
    method public void showInputMethodPicker();
    method public boolean showSoftInput(android.view.View, int);
    method public boolean showSoftInput(android.view.View, int, android.os.ResultReceiver);
    method @Deprecated public void showSoftInputFromInputMethod(android.os.IBinder, int);
    method @Deprecated public void showStatusIcon(android.os.IBinder, String, int);
    method @Deprecated public boolean switchToLastInputMethod(android.os.IBinder);
    method @Deprecated public boolean switchToNextInputMethod(android.os.IBinder, boolean);
    method public void toggleSoftInput(int, int);
    method public void toggleSoftInputFromWindow(android.os.IBinder, int, int);
    method @Deprecated public void updateCursor(android.view.View, int, int, int, int);
    method public void updateCursorAnchorInfo(android.view.View, android.view.inputmethod.CursorAnchorInfo);
    method public void updateExtractedText(android.view.View, int, android.view.inputmethod.ExtractedText);
    method public void updateSelection(android.view.View, int, int, int, int);
    method public void viewClicked(android.view.View);
    field public static final int HIDE_IMPLICIT_ONLY = 1; // 0x1
    field public static final int HIDE_NOT_ALWAYS = 2; // 0x2
    field public static final int RESULT_HIDDEN = 3; // 0x3
    field public static final int RESULT_SHOWN = 2; // 0x2
    field public static final int RESULT_UNCHANGED_HIDDEN = 1; // 0x1
    field public static final int RESULT_UNCHANGED_SHOWN = 0; // 0x0
    field public static final int SHOW_FORCED = 2; // 0x2
    field public static final int SHOW_IMPLICIT = 1; // 0x1
  }

  public interface InputMethodSession {
    method public void appPrivateCommand(String, android.os.Bundle);
    method public void dispatchGenericMotionEvent(int, android.view.MotionEvent, android.view.inputmethod.InputMethodSession.EventCallback);
    method public void dispatchKeyEvent(int, android.view.KeyEvent, android.view.inputmethod.InputMethodSession.EventCallback);
    method public void dispatchTrackballEvent(int, android.view.MotionEvent, android.view.inputmethod.InputMethodSession.EventCallback);
    method public void displayCompletions(android.view.inputmethod.CompletionInfo[]);
    method public void finishInput();
    method public void toggleSoftInput(int, int);
    method public void updateCursor(android.graphics.Rect);
    method public void updateCursorAnchorInfo(android.view.inputmethod.CursorAnchorInfo);
    method public void updateExtractedText(int, android.view.inputmethod.ExtractedText);
    method public void updateSelection(int, int, int, int, int, int);
    method public void viewClicked(boolean);
  }

  public static interface InputMethodSession.EventCallback {
    method public void finishedEvent(int, boolean);
  }

  public final class InputMethodSubtype implements android.os.Parcelable {
    ctor @Deprecated public InputMethodSubtype(int, int, String, String, String, boolean, boolean);
    ctor @Deprecated public InputMethodSubtype(int, int, String, String, String, boolean, boolean, int);
    method public boolean containsExtraValueKey(String);
    method public int describeContents();
    method @NonNull public CharSequence getDisplayName(android.content.Context, String, android.content.pm.ApplicationInfo);
    method public String getExtraValue();
    method public String getExtraValueOf(String);
    method public int getIconResId();
    method @NonNull public String getLanguageTag();
    method @Deprecated @NonNull public String getLocale();
    method public String getMode();
    method public int getNameResId();
    method public boolean isAsciiCapable();
    method public boolean isAuxiliary();
    method public boolean overridesImplicitlyEnabledSubtype();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.InputMethodSubtype> CREATOR;
  }

  public static class InputMethodSubtype.InputMethodSubtypeBuilder {
    ctor public InputMethodSubtype.InputMethodSubtypeBuilder();
    method public android.view.inputmethod.InputMethodSubtype build();
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setIsAsciiCapable(boolean);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setIsAuxiliary(boolean);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setLanguageTag(String);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setOverridesImplicitlyEnabledSubtype(boolean);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setSubtypeExtraValue(String);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setSubtypeIconResId(int);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setSubtypeId(int);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setSubtypeLocale(String);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setSubtypeMode(String);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setSubtypeNameResId(int);
  }

}

package android.view.textclassifier {

  public final class SelectionEvent implements android.os.Parcelable {
    method @NonNull public static android.view.textclassifier.SelectionEvent createSelectionActionEvent(int, int, int);
    method @NonNull public static android.view.textclassifier.SelectionEvent createSelectionActionEvent(int, int, int, @NonNull android.view.textclassifier.TextClassification);
    method @NonNull public static android.view.textclassifier.SelectionEvent createSelectionModifiedEvent(int, int);
    method @NonNull public static android.view.textclassifier.SelectionEvent createSelectionModifiedEvent(int, int, @NonNull android.view.textclassifier.TextClassification);
    method @NonNull public static android.view.textclassifier.SelectionEvent createSelectionModifiedEvent(int, int, @NonNull android.view.textclassifier.TextSelection);
    method @NonNull public static android.view.textclassifier.SelectionEvent createSelectionStartedEvent(int, int);
    method public int describeContents();
    method public long getDurationSincePreviousEvent();
    method public long getDurationSinceSessionStart();
    method public int getEnd();
    method @NonNull public String getEntityType();
    method public int getEventIndex();
    method public long getEventTime();
    method public int getEventType();
    method public int getInvocationMethod();
    method @NonNull public String getPackageName();
    method @Nullable public String getResultId();
    method @Nullable public android.view.textclassifier.TextClassificationSessionId getSessionId();
    method public int getSmartEnd();
    method public int getSmartStart();
    method public int getStart();
    method @NonNull public String getWidgetType();
    method @Nullable public String getWidgetVersion();
    method public static boolean isTerminal(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ACTION_ABANDON = 107; // 0x6b
    field public static final int ACTION_COPY = 101; // 0x65
    field public static final int ACTION_CUT = 103; // 0x67
    field public static final int ACTION_DRAG = 106; // 0x6a
    field public static final int ACTION_OTHER = 108; // 0x6c
    field public static final int ACTION_OVERTYPE = 100; // 0x64
    field public static final int ACTION_PASTE = 102; // 0x66
    field public static final int ACTION_RESET = 201; // 0xc9
    field public static final int ACTION_SELECT_ALL = 200; // 0xc8
    field public static final int ACTION_SHARE = 104; // 0x68
    field public static final int ACTION_SMART_SHARE = 105; // 0x69
    field public static final android.os.Parcelable.Creator<android.view.textclassifier.SelectionEvent> CREATOR;
    field public static final int EVENT_AUTO_SELECTION = 5; // 0x5
    field public static final int EVENT_SELECTION_MODIFIED = 2; // 0x2
    field public static final int EVENT_SELECTION_STARTED = 1; // 0x1
    field public static final int EVENT_SMART_SELECTION_MULTI = 4; // 0x4
    field public static final int EVENT_SMART_SELECTION_SINGLE = 3; // 0x3
    field public static final int INVOCATION_LINK = 2; // 0x2
    field public static final int INVOCATION_MANUAL = 1; // 0x1
    field public static final int INVOCATION_UNKNOWN = 0; // 0x0
  }

  public final class TextClassification implements android.os.Parcelable {
    method public int describeContents();
    method public java.util.List<android.app.RemoteAction> getActions();
    method @FloatRange(from=0.0, to=1.0) public float getConfidenceScore(String);
    method @NonNull public String getEntity(int);
    method @IntRange(from=0) public int getEntityCount();
    method @Deprecated @Nullable public android.graphics.drawable.Drawable getIcon();
    method @Nullable public String getId();
    method @Deprecated @Nullable public android.content.Intent getIntent();
    method @Deprecated @Nullable public CharSequence getLabel();
    method @Deprecated @Nullable public android.view.View.OnClickListener getOnClickListener();
    method @Nullable public String getText();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textclassifier.TextClassification> CREATOR;
  }

  public static final class TextClassification.Builder {
    ctor public TextClassification.Builder();
    method @NonNull public android.view.textclassifier.TextClassification.Builder addAction(@NonNull android.app.RemoteAction);
    method @NonNull public android.view.textclassifier.TextClassification build();
    method @NonNull public android.view.textclassifier.TextClassification.Builder setEntityType(@NonNull String, @FloatRange(from=0.0, to=1.0) float);
    method @Deprecated @NonNull public android.view.textclassifier.TextClassification.Builder setIcon(@Nullable android.graphics.drawable.Drawable);
    method @NonNull public android.view.textclassifier.TextClassification.Builder setId(@Nullable String);
    method @Deprecated @NonNull public android.view.textclassifier.TextClassification.Builder setIntent(@Nullable android.content.Intent);
    method @Deprecated @NonNull public android.view.textclassifier.TextClassification.Builder setLabel(@Nullable String);
    method @Deprecated @NonNull public android.view.textclassifier.TextClassification.Builder setOnClickListener(@Nullable android.view.View.OnClickListener);
    method @NonNull public android.view.textclassifier.TextClassification.Builder setText(@Nullable String);
  }

  public static final class TextClassification.Request implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.os.LocaleList getDefaultLocales();
    method @IntRange(from=0) public int getEndIndex();
    method @Nullable public java.time.ZonedDateTime getReferenceTime();
    method @IntRange(from=0) public int getStartIndex();
    method @NonNull public CharSequence getText();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textclassifier.TextClassification.Request> CREATOR;
  }

  public static final class TextClassification.Request.Builder {
    ctor public TextClassification.Request.Builder(@NonNull CharSequence, @IntRange(from=0) int, @IntRange(from=0) int);
    method @NonNull public android.view.textclassifier.TextClassification.Request build();
    method @NonNull public android.view.textclassifier.TextClassification.Request.Builder setDefaultLocales(@Nullable android.os.LocaleList);
    method @NonNull public android.view.textclassifier.TextClassification.Request.Builder setReferenceTime(@Nullable java.time.ZonedDateTime);
  }

  public final class TextClassificationContext implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public String getPackageName();
    method @NonNull public String getWidgetType();
    method @Nullable public String getWidgetVersion();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textclassifier.TextClassificationContext> CREATOR;
  }

  public static final class TextClassificationContext.Builder {
    ctor public TextClassificationContext.Builder(@NonNull String, @NonNull String);
    method @NonNull public android.view.textclassifier.TextClassificationContext build();
    method public android.view.textclassifier.TextClassificationContext.Builder setWidgetVersion(@Nullable String);
  }

  public final class TextClassificationManager {
    method @NonNull public android.view.textclassifier.TextClassifier createTextClassificationSession(@NonNull android.view.textclassifier.TextClassificationContext);
    method @NonNull public android.view.textclassifier.TextClassifier getTextClassifier();
    method public void setTextClassificationSessionFactory(@Nullable android.view.textclassifier.TextClassificationSessionFactory);
    method public void setTextClassifier(@Nullable android.view.textclassifier.TextClassifier);
  }

  public interface TextClassificationSessionFactory {
    method @NonNull public android.view.textclassifier.TextClassifier createTextClassificationSession(@NonNull android.view.textclassifier.TextClassificationContext);
  }

  public final class TextClassificationSessionId implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textclassifier.TextClassificationSessionId> CREATOR;
  }

  public interface TextClassifier {
    method @WorkerThread @NonNull public default android.view.textclassifier.TextClassification classifyText(@NonNull android.view.textclassifier.TextClassification.Request);
    method @WorkerThread @NonNull public default android.view.textclassifier.TextClassification classifyText(@NonNull CharSequence, @IntRange(from=0) int, @IntRange(from=0) int, @Nullable android.os.LocaleList);
    method public default void destroy();
    method @WorkerThread @NonNull public default android.view.textclassifier.TextLinks generateLinks(@NonNull android.view.textclassifier.TextLinks.Request);
    method @WorkerThread public default int getMaxGenerateLinksTextLength();
    method public default boolean isDestroyed();
    method public default void onSelectionEvent(@NonNull android.view.textclassifier.SelectionEvent);
    method @WorkerThread @NonNull public default android.view.textclassifier.TextSelection suggestSelection(@NonNull android.view.textclassifier.TextSelection.Request);
    method @WorkerThread @NonNull public default android.view.textclassifier.TextSelection suggestSelection(@NonNull CharSequence, @IntRange(from=0) int, @IntRange(from=0) int, @Nullable android.os.LocaleList);
    field public static final String HINT_TEXT_IS_EDITABLE = "android.text_is_editable";
    field public static final String HINT_TEXT_IS_NOT_EDITABLE = "android.text_is_not_editable";
    field public static final android.view.textclassifier.TextClassifier NO_OP;
    field public static final String TYPE_ADDRESS = "address";
    field public static final String TYPE_DATE = "date";
    field public static final String TYPE_DATE_TIME = "datetime";
    field public static final String TYPE_EMAIL = "email";
    field public static final String TYPE_FLIGHT_NUMBER = "flight";
    field public static final String TYPE_OTHER = "other";
    field public static final String TYPE_PHONE = "phone";
    field public static final String TYPE_UNKNOWN = "";
    field public static final String TYPE_URL = "url";
    field public static final String WIDGET_TYPE_CUSTOM_EDITTEXT = "customedit";
    field public static final String WIDGET_TYPE_CUSTOM_TEXTVIEW = "customview";
    field public static final String WIDGET_TYPE_CUSTOM_UNSELECTABLE_TEXTVIEW = "nosel-customview";
    field public static final String WIDGET_TYPE_EDITTEXT = "edittext";
    field public static final String WIDGET_TYPE_EDIT_WEBVIEW = "edit-webview";
    field public static final String WIDGET_TYPE_TEXTVIEW = "textview";
    field public static final String WIDGET_TYPE_UNKNOWN = "unknown";
    field public static final String WIDGET_TYPE_UNSELECTABLE_TEXTVIEW = "nosel-textview";
    field public static final String WIDGET_TYPE_WEBVIEW = "webview";
  }

  public static final class TextClassifier.EntityConfig implements android.os.Parcelable {
    method public static android.view.textclassifier.TextClassifier.EntityConfig create(@Nullable java.util.Collection<java.lang.String>, @Nullable java.util.Collection<java.lang.String>, @Nullable java.util.Collection<java.lang.String>);
    method public static android.view.textclassifier.TextClassifier.EntityConfig createWithExplicitEntityList(@Nullable java.util.Collection<java.lang.String>);
    method public static android.view.textclassifier.TextClassifier.EntityConfig createWithHints(@Nullable java.util.Collection<java.lang.String>);
    method public int describeContents();
    method public java.util.Collection<java.lang.String> getHints();
    method public java.util.Collection<java.lang.String> resolveEntityListModifications(@NonNull java.util.Collection<java.lang.String>);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textclassifier.TextClassifier.EntityConfig> CREATOR;
  }

  public final class TextLinks implements android.os.Parcelable {
    method public int apply(@NonNull android.text.Spannable, int, @Nullable java.util.function.Function<android.view.textclassifier.TextLinks.TextLink,android.view.textclassifier.TextLinks.TextLinkSpan>);
    method public int describeContents();
    method @NonNull public java.util.Collection<android.view.textclassifier.TextLinks.TextLink> getLinks();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int APPLY_STRATEGY_IGNORE = 0; // 0x0
    field public static final int APPLY_STRATEGY_REPLACE = 1; // 0x1
    field public static final android.os.Parcelable.Creator<android.view.textclassifier.TextLinks> CREATOR;
    field public static final int STATUS_DIFFERENT_TEXT = 3; // 0x3
    field public static final int STATUS_LINKS_APPLIED = 0; // 0x0
    field public static final int STATUS_NO_LINKS_APPLIED = 2; // 0x2
    field public static final int STATUS_NO_LINKS_FOUND = 1; // 0x1
  }

  public static final class TextLinks.Builder {
    ctor public TextLinks.Builder(@NonNull String);
    method @NonNull public android.view.textclassifier.TextLinks.Builder addLink(int, int, java.util.Map<java.lang.String,java.lang.Float>);
    method @NonNull public android.view.textclassifier.TextLinks build();
    method @NonNull public android.view.textclassifier.TextLinks.Builder clearTextLinks();
  }

  public static final class TextLinks.Request implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.os.LocaleList getDefaultLocales();
    method @Nullable public android.view.textclassifier.TextClassifier.EntityConfig getEntityConfig();
    method @NonNull public CharSequence getText();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textclassifier.TextLinks.Request> CREATOR;
  }

  public static final class TextLinks.Request.Builder {
    ctor public TextLinks.Request.Builder(@NonNull CharSequence);
    method @NonNull public android.view.textclassifier.TextLinks.Request build();
    method @NonNull public android.view.textclassifier.TextLinks.Request.Builder setDefaultLocales(@Nullable android.os.LocaleList);
    method @NonNull public android.view.textclassifier.TextLinks.Request.Builder setEntityConfig(@Nullable android.view.textclassifier.TextClassifier.EntityConfig);
  }

  public static final class TextLinks.TextLink implements android.os.Parcelable {
    method public int describeContents();
    method @FloatRange(from=0.0, to=1.0) public float getConfidenceScore(String);
    method public int getEnd();
    method @NonNull public String getEntity(int);
    method public int getEntityCount();
    method public int getStart();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textclassifier.TextLinks.TextLink> CREATOR;
  }

  public static class TextLinks.TextLinkSpan extends android.text.style.ClickableSpan {
    ctor public TextLinks.TextLinkSpan(@NonNull android.view.textclassifier.TextLinks.TextLink);
    method public final android.view.textclassifier.TextLinks.TextLink getTextLink();
    method public void onClick(android.view.View);
  }

  public final class TextSelection implements android.os.Parcelable {
    method public int describeContents();
    method @FloatRange(from=0.0, to=1.0) public float getConfidenceScore(String);
    method @NonNull public String getEntity(int);
    method @IntRange(from=0) public int getEntityCount();
    method @Nullable public String getId();
    method public int getSelectionEndIndex();
    method public int getSelectionStartIndex();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textclassifier.TextSelection> CREATOR;
  }

  public static final class TextSelection.Builder {
    ctor public TextSelection.Builder(@IntRange(from=0) int, @IntRange(from=0) int);
    method @NonNull public android.view.textclassifier.TextSelection build();
    method @NonNull public android.view.textclassifier.TextSelection.Builder setEntityType(@NonNull String, @FloatRange(from=0.0, to=1.0) float);
    method @NonNull public android.view.textclassifier.TextSelection.Builder setId(@Nullable String);
  }

  public static final class TextSelection.Request implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.os.LocaleList getDefaultLocales();
    method @IntRange(from=0) public int getEndIndex();
    method @IntRange(from=0) public int getStartIndex();
    method @NonNull public CharSequence getText();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textclassifier.TextSelection.Request> CREATOR;
  }

  public static final class TextSelection.Request.Builder {
    ctor public TextSelection.Request.Builder(@NonNull CharSequence, @IntRange(from=0) int, @IntRange(from=0) int);
    method @NonNull public android.view.textclassifier.TextSelection.Request build();
    method @NonNull public android.view.textclassifier.TextSelection.Request.Builder setDefaultLocales(@Nullable android.os.LocaleList);
  }

}

package android.view.textservice {

  public final class SentenceSuggestionsInfo implements android.os.Parcelable {
    ctor public SentenceSuggestionsInfo(android.view.textservice.SuggestionsInfo[], int[], int[]);
    ctor public SentenceSuggestionsInfo(android.os.Parcel);
    method public int describeContents();
    method public int getLengthAt(int);
    method public int getOffsetAt(int);
    method public int getSuggestionsCount();
    method public android.view.textservice.SuggestionsInfo getSuggestionsInfoAt(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textservice.SentenceSuggestionsInfo> CREATOR;
  }

  public final class SpellCheckerInfo implements android.os.Parcelable {
    method public int describeContents();
    method public android.content.ComponentName getComponent();
    method public String getId();
    method public String getPackageName();
    method public android.content.pm.ServiceInfo getServiceInfo();
    method public String getSettingsActivity();
    method public android.view.textservice.SpellCheckerSubtype getSubtypeAt(int);
    method public int getSubtypeCount();
    method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager);
    method public CharSequence loadLabel(android.content.pm.PackageManager);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textservice.SpellCheckerInfo> CREATOR;
  }

  public class SpellCheckerSession {
    method public void cancel();
    method public void close();
    method public void getSentenceSuggestions(android.view.textservice.TextInfo[], int);
    method public android.view.textservice.SpellCheckerInfo getSpellChecker();
    method @Deprecated public void getSuggestions(android.view.textservice.TextInfo, int);
    method @Deprecated public void getSuggestions(android.view.textservice.TextInfo[], int, boolean);
    method public boolean isSessionDisconnected();
    field public static final String SERVICE_META_DATA = "android.view.textservice.scs";
  }

  public static interface SpellCheckerSession.SpellCheckerSessionListener {
    method public void onGetSentenceSuggestions(android.view.textservice.SentenceSuggestionsInfo[]);
    method public void onGetSuggestions(android.view.textservice.SuggestionsInfo[]);
  }

  public final class SpellCheckerSubtype implements android.os.Parcelable {
    ctor @Deprecated public SpellCheckerSubtype(int, String, String);
    method public boolean containsExtraValueKey(String);
    method public int describeContents();
    method public CharSequence getDisplayName(android.content.Context, String, android.content.pm.ApplicationInfo);
    method public String getExtraValue();
    method public String getExtraValueOf(String);
    method @NonNull public String getLanguageTag();
    method @Deprecated @NonNull public String getLocale();
    method public int getNameResId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textservice.SpellCheckerSubtype> CREATOR;
  }

  public final class SuggestionsInfo implements android.os.Parcelable {
    ctor public SuggestionsInfo(int, String[]);
    ctor public SuggestionsInfo(int, String[], int, int);
    ctor public SuggestionsInfo(android.os.Parcel);
    method public int describeContents();
    method public int getCookie();
    method public int getSequence();
    method public String getSuggestionAt(int);
    method public int getSuggestionsAttributes();
    method public int getSuggestionsCount();
    method public void setCookieAndSequence(int, int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textservice.SuggestionsInfo> CREATOR;
    field public static final int RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS = 4; // 0x4
    field public static final int RESULT_ATTR_IN_THE_DICTIONARY = 1; // 0x1
    field public static final int RESULT_ATTR_LOOKS_LIKE_TYPO = 2; // 0x2
  }

  public final class TextInfo implements android.os.Parcelable {
    ctor public TextInfo(String);
    ctor public TextInfo(String, int, int);
    ctor public TextInfo(CharSequence, int, int, int, int);
    ctor public TextInfo(android.os.Parcel);
    method public int describeContents();
    method public CharSequence getCharSequence();
    method public int getCookie();
    method public int getSequence();
    method public String getText();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.textservice.TextInfo> CREATOR;
  }

  public final class TextServicesManager {
    method public android.view.textservice.SpellCheckerSession newSpellCheckerSession(android.os.Bundle, java.util.Locale, android.view.textservice.SpellCheckerSession.SpellCheckerSessionListener, boolean);
  }

}

package android.webkit {

  public abstract class ClientCertRequest {
    ctor public ClientCertRequest();
    method public abstract void cancel();
    method public abstract String getHost();
    method @Nullable public abstract String[] getKeyTypes();
    method public abstract int getPort();
    method @Nullable public abstract java.security.Principal[] getPrincipals();
    method public abstract void ignore();
    method public abstract void proceed(java.security.PrivateKey, java.security.cert.X509Certificate[]);
  }

  public class ConsoleMessage {
    ctor public ConsoleMessage(String, String, int, android.webkit.ConsoleMessage.MessageLevel);
    method public int lineNumber();
    method public String message();
    method public android.webkit.ConsoleMessage.MessageLevel messageLevel();
    method public String sourceId();
  }

  public enum ConsoleMessage.MessageLevel {
    enum_constant public static final android.webkit.ConsoleMessage.MessageLevel DEBUG;
    enum_constant public static final android.webkit.ConsoleMessage.MessageLevel ERROR;
    enum_constant public static final android.webkit.ConsoleMessage.MessageLevel LOG;
    enum_constant public static final android.webkit.ConsoleMessage.MessageLevel TIP;
    enum_constant public static final android.webkit.ConsoleMessage.MessageLevel WARNING;
  }

  public abstract class CookieManager {
    ctor public CookieManager();
    method public abstract boolean acceptCookie();
    method public abstract boolean acceptThirdPartyCookies(android.webkit.WebView);
    method public static boolean allowFileSchemeCookies();
    method public abstract void flush();
    method public abstract String getCookie(String);
    method public static android.webkit.CookieManager getInstance();
    method public abstract boolean hasCookies();
    method @Deprecated public abstract void removeAllCookie();
    method public abstract void removeAllCookies(@Nullable android.webkit.ValueCallback<java.lang.Boolean>);
    method @Deprecated public abstract void removeExpiredCookie();
    method @Deprecated public abstract void removeSessionCookie();
    method public abstract void removeSessionCookies(@Nullable android.webkit.ValueCallback<java.lang.Boolean>);
    method public abstract void setAcceptCookie(boolean);
    method public static void setAcceptFileSchemeCookies(boolean);
    method public abstract void setAcceptThirdPartyCookies(android.webkit.WebView, boolean);
    method public abstract void setCookie(String, String);
    method public abstract void setCookie(String, String, @Nullable android.webkit.ValueCallback<java.lang.Boolean>);
  }

  @Deprecated public final class CookieSyncManager implements java.lang.Runnable {
    method @Deprecated public static android.webkit.CookieSyncManager createInstance(android.content.Context);
    method @Deprecated public static android.webkit.CookieSyncManager getInstance();
    method @Deprecated public void resetSync();
    method @Deprecated public void run();
    method @Deprecated public void startSync();
    method @Deprecated public void stopSync();
    method @Deprecated public void sync();
    method @Deprecated protected void syncFromRamToFlash();
  }

  public class DateSorter {
    ctor public DateSorter(android.content.Context);
    method public long getBoundary(int);
    method public int getIndex(long);
    method public String getLabel(int);
    field public static final int DAY_COUNT = 5; // 0x5
  }

  public interface DownloadListener {
    method public void onDownloadStart(String, String, String, String, long);
  }

  public class GeolocationPermissions {
    method public void allow(String);
    method public void clear(String);
    method public void clearAll();
    method public void getAllowed(String, android.webkit.ValueCallback<java.lang.Boolean>);
    method public static android.webkit.GeolocationPermissions getInstance();
    method public void getOrigins(android.webkit.ValueCallback<java.util.Set<java.lang.String>>);
  }

  public static interface GeolocationPermissions.Callback {
    method public void invoke(String, boolean, boolean);
  }

  public class HttpAuthHandler extends android.os.Handler {
    method public void cancel();
    method public void proceed(String, String);
    method public boolean useHttpAuthUsernamePassword();
  }

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface JavascriptInterface {
  }

  public class JsPromptResult extends android.webkit.JsResult {
    method public void confirm(String);
  }

  public class JsResult {
    method public final void cancel();
    method public final void confirm();
  }

  public class MimeTypeMap {
    method @Nullable public String getExtensionFromMimeType(String);
    method public static String getFileExtensionFromUrl(String);
    method @Nullable public String getMimeTypeFromExtension(String);
    method public static android.webkit.MimeTypeMap getSingleton();
    method public boolean hasExtension(String);
    method public boolean hasMimeType(String);
  }

  public abstract class PermissionRequest {
    ctor public PermissionRequest();
    method public abstract void deny();
    method public abstract android.net.Uri getOrigin();
    method public abstract String[] getResources();
    method public abstract void grant(String[]);
    field public static final String RESOURCE_AUDIO_CAPTURE = "android.webkit.resource.AUDIO_CAPTURE";
    field public static final String RESOURCE_MIDI_SYSEX = "android.webkit.resource.MIDI_SYSEX";
    field public static final String RESOURCE_PROTECTED_MEDIA_ID = "android.webkit.resource.PROTECTED_MEDIA_ID";
    field public static final String RESOURCE_VIDEO_CAPTURE = "android.webkit.resource.VIDEO_CAPTURE";
  }

  public interface PluginStub {
    method public android.view.View getEmbeddedView(int, android.content.Context);
    method public android.view.View getFullScreenView(int, android.content.Context);
  }

  public abstract class RenderProcessGoneDetail {
    ctor public RenderProcessGoneDetail();
    method public abstract boolean didCrash();
    method public abstract int rendererPriorityAtExit();
  }

  public abstract class SafeBrowsingResponse {
    ctor public SafeBrowsingResponse();
    method public abstract void backToSafety(boolean);
    method public abstract void proceed(boolean);
    method public abstract void showInterstitial(boolean);
  }

  public class ServiceWorkerClient {
    ctor public ServiceWorkerClient();
    method @Nullable public android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebResourceRequest);
  }

  public abstract class ServiceWorkerController {
    ctor public ServiceWorkerController();
    method @NonNull public static android.webkit.ServiceWorkerController getInstance();
    method @NonNull public abstract android.webkit.ServiceWorkerWebSettings getServiceWorkerWebSettings();
    method public abstract void setServiceWorkerClient(@Nullable android.webkit.ServiceWorkerClient);
  }

  public abstract class ServiceWorkerWebSettings {
    ctor public ServiceWorkerWebSettings();
    method public abstract boolean getAllowContentAccess();
    method public abstract boolean getAllowFileAccess();
    method public abstract boolean getBlockNetworkLoads();
    method public abstract int getCacheMode();
    method public abstract void setAllowContentAccess(boolean);
    method public abstract void setAllowFileAccess(boolean);
    method public abstract void setBlockNetworkLoads(boolean);
    method public abstract void setCacheMode(int);
  }

  public class SslErrorHandler extends android.os.Handler {
    method public void cancel();
    method public void proceed();
  }

  public class TracingConfig {
    method @NonNull public java.util.List<java.lang.String> getCustomIncludedCategories();
    method public int getPredefinedCategories();
    method public int getTracingMode();
    field public static final int CATEGORIES_ALL = 1; // 0x1
    field public static final int CATEGORIES_ANDROID_WEBVIEW = 2; // 0x2
    field public static final int CATEGORIES_FRAME_VIEWER = 64; // 0x40
    field public static final int CATEGORIES_INPUT_LATENCY = 8; // 0x8
    field public static final int CATEGORIES_JAVASCRIPT_AND_RENDERING = 32; // 0x20
    field public static final int CATEGORIES_NONE = 0; // 0x0
    field public static final int CATEGORIES_RENDERING = 16; // 0x10
    field public static final int CATEGORIES_WEB_DEVELOPER = 4; // 0x4
    field public static final int RECORD_CONTINUOUSLY = 1; // 0x1
    field public static final int RECORD_UNTIL_FULL = 0; // 0x0
  }

  public static class TracingConfig.Builder {
    ctor public TracingConfig.Builder();
    method public android.webkit.TracingConfig.Builder addCategories(int...);
    method public android.webkit.TracingConfig.Builder addCategories(java.lang.String...);
    method public android.webkit.TracingConfig.Builder addCategories(java.util.Collection<java.lang.String>);
    method public android.webkit.TracingConfig build();
    method public android.webkit.TracingConfig.Builder setTracingMode(int);
  }

  public abstract class TracingController {
    ctor public TracingController();
    method @NonNull public static android.webkit.TracingController getInstance();
    method public abstract boolean isTracing();
    method public abstract void start(@NonNull android.webkit.TracingConfig);
    method public abstract boolean stop(@Nullable java.io.OutputStream, @NonNull java.util.concurrent.Executor);
  }

  public final class URLUtil {
    ctor public URLUtil();
    method public static String composeSearchUrl(String, String, String);
    method public static byte[] decode(byte[]) throws java.lang.IllegalArgumentException;
    method public static String guessFileName(String, @Nullable String, @Nullable String);
    method public static String guessUrl(String);
    method public static boolean isAboutUrl(String);
    method public static boolean isAssetUrl(String);
    method public static boolean isContentUrl(String);
    method @Deprecated public static boolean isCookielessProxyUrl(String);
    method public static boolean isDataUrl(String);
    method public static boolean isFileUrl(String);
    method public static boolean isHttpUrl(String);
    method public static boolean isHttpsUrl(String);
    method public static boolean isJavaScriptUrl(String);
    method public static boolean isNetworkUrl(String);
    method public static boolean isValidUrl(String);
    method public static String stripAnchor(String);
  }

  public interface ValueCallback<T> {
    method public void onReceiveValue(T);
  }

  public abstract class WebBackForwardList implements java.lang.Cloneable java.io.Serializable {
    ctor public WebBackForwardList();
    method protected abstract android.webkit.WebBackForwardList clone();
    method public abstract int getCurrentIndex();
    method @Nullable public abstract android.webkit.WebHistoryItem getCurrentItem();
    method public abstract android.webkit.WebHistoryItem getItemAtIndex(int);
    method public abstract int getSize();
  }

  public class WebChromeClient {
    ctor public WebChromeClient();
    method @Nullable public android.graphics.Bitmap getDefaultVideoPoster();
    method @Nullable public android.view.View getVideoLoadingProgressView();
    method public void getVisitedHistory(android.webkit.ValueCallback<java.lang.String[]>);
    method public void onCloseWindow(android.webkit.WebView);
    method @Deprecated public void onConsoleMessage(String, int, String);
    method public boolean onConsoleMessage(android.webkit.ConsoleMessage);
    method public boolean onCreateWindow(android.webkit.WebView, boolean, boolean, android.os.Message);
    method @Deprecated public void onExceededDatabaseQuota(String, String, long, long, long, android.webkit.WebStorage.QuotaUpdater);
    method public void onGeolocationPermissionsHidePrompt();
    method public void onGeolocationPermissionsShowPrompt(String, android.webkit.GeolocationPermissions.Callback);
    method public void onHideCustomView();
    method public boolean onJsAlert(android.webkit.WebView, String, String, android.webkit.JsResult);
    method public boolean onJsBeforeUnload(android.webkit.WebView, String, String, android.webkit.JsResult);
    method public boolean onJsConfirm(android.webkit.WebView, String, String, android.webkit.JsResult);
    method public boolean onJsPrompt(android.webkit.WebView, String, String, String, android.webkit.JsPromptResult);
    method @Deprecated public boolean onJsTimeout();
    method public void onPermissionRequest(android.webkit.PermissionRequest);
    method public void onPermissionRequestCanceled(android.webkit.PermissionRequest);
    method public void onProgressChanged(android.webkit.WebView, int);
    method @Deprecated public void onReachedMaxAppCacheSize(long, long, android.webkit.WebStorage.QuotaUpdater);
    method public void onReceivedIcon(android.webkit.WebView, android.graphics.Bitmap);
    method public void onReceivedTitle(android.webkit.WebView, String);
    method public void onReceivedTouchIconUrl(android.webkit.WebView, String, boolean);
    method public void onRequestFocus(android.webkit.WebView);
    method public void onShowCustomView(android.view.View, android.webkit.WebChromeClient.CustomViewCallback);
    method @Deprecated public void onShowCustomView(android.view.View, int, android.webkit.WebChromeClient.CustomViewCallback);
    method public boolean onShowFileChooser(android.webkit.WebView, android.webkit.ValueCallback<android.net.Uri[]>, android.webkit.WebChromeClient.FileChooserParams);
  }

  public static interface WebChromeClient.CustomViewCallback {
    method public void onCustomViewHidden();
  }

  public abstract static class WebChromeClient.FileChooserParams {
    ctor public WebChromeClient.FileChooserParams();
    method public abstract android.content.Intent createIntent();
    method public abstract String[] getAcceptTypes();
    method @Nullable public abstract String getFilenameHint();
    method public abstract int getMode();
    method @Nullable public abstract CharSequence getTitle();
    method public abstract boolean isCaptureEnabled();
    method @Nullable public static android.net.Uri[] parseResult(int, android.content.Intent);
    field public static final int MODE_OPEN = 0; // 0x0
    field public static final int MODE_OPEN_MULTIPLE = 1; // 0x1
    field public static final int MODE_SAVE = 3; // 0x3
  }

  public abstract class WebHistoryItem implements java.lang.Cloneable {
    ctor public WebHistoryItem();
    method protected abstract android.webkit.WebHistoryItem clone();
    method @Nullable public abstract android.graphics.Bitmap getFavicon();
    method public abstract String getOriginalUrl();
    method public abstract String getTitle();
    method public abstract String getUrl();
  }

  @Deprecated public abstract class WebIconDatabase {
    ctor @Deprecated public WebIconDatabase();
    method @Deprecated public abstract void close();
    method @Deprecated public static android.webkit.WebIconDatabase getInstance();
    method @Deprecated public abstract void open(String);
    method @Deprecated public abstract void releaseIconForPageUrl(String);
    method @Deprecated public abstract void removeAllIcons();
    method @Deprecated public abstract void requestIconForPageUrl(String, android.webkit.WebIconDatabase.IconListener);
    method @Deprecated public abstract void retainIconForPageUrl(String);
  }

  @Deprecated public static interface WebIconDatabase.IconListener {
    method @Deprecated public void onReceivedIcon(String, android.graphics.Bitmap);
  }

  public class WebMessage {
    ctor public WebMessage(String);
    ctor public WebMessage(String, android.webkit.WebMessagePort[]);
    method public String getData();
    method @Nullable public android.webkit.WebMessagePort[] getPorts();
  }

  public abstract class WebMessagePort {
    method public abstract void close();
    method public abstract void postMessage(android.webkit.WebMessage);
    method public abstract void setWebMessageCallback(android.webkit.WebMessagePort.WebMessageCallback);
    method public abstract void setWebMessageCallback(android.webkit.WebMessagePort.WebMessageCallback, android.os.Handler);
  }

  public abstract static class WebMessagePort.WebMessageCallback {
    ctor public WebMessagePort.WebMessageCallback();
    method public void onMessage(android.webkit.WebMessagePort, android.webkit.WebMessage);
  }

  public abstract class WebResourceError {
    method public abstract CharSequence getDescription();
    method public abstract int getErrorCode();
  }

  public interface WebResourceRequest {
    method public String getMethod();
    method public java.util.Map<java.lang.String,java.lang.String> getRequestHeaders();
    method public android.net.Uri getUrl();
    method public boolean hasGesture();
    method public boolean isForMainFrame();
    method public boolean isRedirect();
  }

  public class WebResourceResponse {
    ctor public WebResourceResponse(String, String, java.io.InputStream);
    ctor public WebResourceResponse(String, String, int, @NonNull String, java.util.Map<java.lang.String,java.lang.String>, java.io.InputStream);
    method public java.io.InputStream getData();
    method public String getEncoding();
    method public String getMimeType();
    method public String getReasonPhrase();
    method public java.util.Map<java.lang.String,java.lang.String> getResponseHeaders();
    method public int getStatusCode();
    method public void setData(java.io.InputStream);
    method public void setEncoding(String);
    method public void setMimeType(String);
    method public void setResponseHeaders(java.util.Map<java.lang.String,java.lang.String>);
    method public void setStatusCodeAndReasonPhrase(int, @NonNull String);
  }

  public abstract class WebSettings {
    ctor public WebSettings();
    method @Deprecated public abstract boolean enableSmoothTransition();
    method public abstract boolean getAllowContentAccess();
    method public abstract boolean getAllowFileAccess();
    method public abstract boolean getAllowFileAccessFromFileURLs();
    method public abstract boolean getAllowUniversalAccessFromFileURLs();
    method public abstract boolean getBlockNetworkImage();
    method public abstract boolean getBlockNetworkLoads();
    method public abstract boolean getBuiltInZoomControls();
    method public abstract int getCacheMode();
    method public abstract String getCursiveFontFamily();
    method public abstract boolean getDatabaseEnabled();
    method @Deprecated public abstract String getDatabasePath();
    method public abstract int getDefaultFixedFontSize();
    method public abstract int getDefaultFontSize();
    method public abstract String getDefaultTextEncodingName();
    method public static String getDefaultUserAgent(android.content.Context);
    method @Deprecated public abstract android.webkit.WebSettings.ZoomDensity getDefaultZoom();
    method public abstract int getDisabledActionModeMenuItems();
    method public abstract boolean getDisplayZoomControls();
    method public abstract boolean getDomStorageEnabled();
    method public abstract String getFantasyFontFamily();
    method public abstract String getFixedFontFamily();
    method public abstract boolean getJavaScriptCanOpenWindowsAutomatically();
    method public abstract boolean getJavaScriptEnabled();
    method public abstract android.webkit.WebSettings.LayoutAlgorithm getLayoutAlgorithm();
    method @Deprecated public abstract boolean getLightTouchEnabled();
    method public abstract boolean getLoadWithOverviewMode();
    method public abstract boolean getLoadsImagesAutomatically();
    method public abstract boolean getMediaPlaybackRequiresUserGesture();
    method public abstract int getMinimumFontSize();
    method public abstract int getMinimumLogicalFontSize();
    method public abstract int getMixedContentMode();
    method public abstract boolean getOffscreenPreRaster();
    method @Deprecated public abstract android.webkit.WebSettings.PluginState getPluginState();
    method public abstract boolean getSafeBrowsingEnabled();
    method public abstract String getSansSerifFontFamily();
    method @Deprecated public abstract boolean getSaveFormData();
    method @Deprecated public abstract boolean getSavePassword();
    method public abstract String getSerifFontFamily();
    method public abstract String getStandardFontFamily();
    method @Deprecated public android.webkit.WebSettings.TextSize getTextSize();
    method public abstract int getTextZoom();
    method public abstract boolean getUseWideViewPort();
    method public abstract String getUserAgentString();
    method public abstract void setAllowContentAccess(boolean);
    method public abstract void setAllowFileAccess(boolean);
    method public abstract void setAllowFileAccessFromFileURLs(boolean);
    method public abstract void setAllowUniversalAccessFromFileURLs(boolean);
    method public abstract void setAppCacheEnabled(boolean);
    method @Deprecated public abstract void setAppCacheMaxSize(long);
    method public abstract void setAppCachePath(String);
    method public abstract void setBlockNetworkImage(boolean);
    method public abstract void setBlockNetworkLoads(boolean);
    method public abstract void setBuiltInZoomControls(boolean);
    method public abstract void setCacheMode(int);
    method public abstract void setCursiveFontFamily(String);
    method public abstract void setDatabaseEnabled(boolean);
    method @Deprecated public abstract void setDatabasePath(String);
    method public abstract void setDefaultFixedFontSize(int);
    method public abstract void setDefaultFontSize(int);
    method public abstract void setDefaultTextEncodingName(String);
    method @Deprecated public abstract void setDefaultZoom(android.webkit.WebSettings.ZoomDensity);
    method public abstract void setDisabledActionModeMenuItems(int);
    method public abstract void setDisplayZoomControls(boolean);
    method public abstract void setDomStorageEnabled(boolean);
    method @Deprecated public abstract void setEnableSmoothTransition(boolean);
    method public abstract void setFantasyFontFamily(String);
    method public abstract void setFixedFontFamily(String);
    method @Deprecated public abstract void setGeolocationDatabasePath(String);
    method public abstract void setGeolocationEnabled(boolean);
    method public abstract void setJavaScriptCanOpenWindowsAutomatically(boolean);
    method public abstract void setJavaScriptEnabled(boolean);
    method public abstract void setLayoutAlgorithm(android.webkit.WebSettings.LayoutAlgorithm);
    method @Deprecated public abstract void setLightTouchEnabled(boolean);
    method public abstract void setLoadWithOverviewMode(boolean);
    method public abstract void setLoadsImagesAutomatically(boolean);
    method public abstract void setMediaPlaybackRequiresUserGesture(boolean);
    method public abstract void setMinimumFontSize(int);
    method public abstract void setMinimumLogicalFontSize(int);
    method public abstract void setMixedContentMode(int);
    method public abstract void setNeedInitialFocus(boolean);
    method public abstract void setOffscreenPreRaster(boolean);
    method @Deprecated public abstract void setPluginState(android.webkit.WebSettings.PluginState);
    method @Deprecated public abstract void setRenderPriority(android.webkit.WebSettings.RenderPriority);
    method public abstract void setSafeBrowsingEnabled(boolean);
    method public abstract void setSansSerifFontFamily(String);
    method @Deprecated public abstract void setSaveFormData(boolean);
    method @Deprecated public abstract void setSavePassword(boolean);
    method public abstract void setSerifFontFamily(String);
    method public abstract void setStandardFontFamily(String);
    method public abstract void setSupportMultipleWindows(boolean);
    method public abstract void setSupportZoom(boolean);
    method @Deprecated public void setTextSize(android.webkit.WebSettings.TextSize);
    method public abstract void setTextZoom(int);
    method public abstract void setUseWideViewPort(boolean);
    method public abstract void setUserAgentString(@Nullable String);
    method public abstract boolean supportMultipleWindows();
    method public abstract boolean supportZoom();
    field public static final int LOAD_CACHE_ELSE_NETWORK = 1; // 0x1
    field public static final int LOAD_CACHE_ONLY = 3; // 0x3
    field public static final int LOAD_DEFAULT = -1; // 0xffffffff
    field @Deprecated public static final int LOAD_NORMAL = 0; // 0x0
    field public static final int LOAD_NO_CACHE = 2; // 0x2
    field public static final int MENU_ITEM_NONE = 0; // 0x0
    field public static final int MENU_ITEM_PROCESS_TEXT = 4; // 0x4
    field public static final int MENU_ITEM_SHARE = 1; // 0x1
    field public static final int MENU_ITEM_WEB_SEARCH = 2; // 0x2
    field public static final int MIXED_CONTENT_ALWAYS_ALLOW = 0; // 0x0
    field public static final int MIXED_CONTENT_COMPATIBILITY_MODE = 2; // 0x2
    field public static final int MIXED_CONTENT_NEVER_ALLOW = 1; // 0x1
  }

  public enum WebSettings.LayoutAlgorithm {
    enum_constant @Deprecated public static final android.webkit.WebSettings.LayoutAlgorithm NARROW_COLUMNS;
    enum_constant public static final android.webkit.WebSettings.LayoutAlgorithm NORMAL;
    enum_constant @Deprecated public static final android.webkit.WebSettings.LayoutAlgorithm SINGLE_COLUMN;
    enum_constant public static final android.webkit.WebSettings.LayoutAlgorithm TEXT_AUTOSIZING;
  }

  public enum WebSettings.PluginState {
    enum_constant public static final android.webkit.WebSettings.PluginState OFF;
    enum_constant public static final android.webkit.WebSettings.PluginState ON;
    enum_constant public static final android.webkit.WebSettings.PluginState ON_DEMAND;
  }

  public enum WebSettings.RenderPriority {
    enum_constant public static final android.webkit.WebSettings.RenderPriority HIGH;
    enum_constant public static final android.webkit.WebSettings.RenderPriority LOW;
    enum_constant public static final android.webkit.WebSettings.RenderPriority NORMAL;
  }

  @Deprecated public enum WebSettings.TextSize {
    enum_constant @Deprecated public static final android.webkit.WebSettings.TextSize LARGER;
    enum_constant @Deprecated public static final android.webkit.WebSettings.TextSize LARGEST;
    enum_constant @Deprecated public static final android.webkit.WebSettings.TextSize NORMAL;
    enum_constant @Deprecated public static final android.webkit.WebSettings.TextSize SMALLER;
    enum_constant @Deprecated public static final android.webkit.WebSettings.TextSize SMALLEST;
  }

  public enum WebSettings.ZoomDensity {
    enum_constant public static final android.webkit.WebSettings.ZoomDensity CLOSE;
    enum_constant public static final android.webkit.WebSettings.ZoomDensity FAR;
    enum_constant public static final android.webkit.WebSettings.ZoomDensity MEDIUM;
  }

  public class WebStorage {
    method public void deleteAllData();
    method public void deleteOrigin(String);
    method public static android.webkit.WebStorage getInstance();
    method public void getOrigins(android.webkit.ValueCallback<java.util.Map>);
    method public void getQuotaForOrigin(String, android.webkit.ValueCallback<java.lang.Long>);
    method public void getUsageForOrigin(String, android.webkit.ValueCallback<java.lang.Long>);
    method @Deprecated public void setQuotaForOrigin(String, long);
  }

  public static class WebStorage.Origin {
    method public String getOrigin();
    method public long getQuota();
    method public long getUsage();
  }

  @Deprecated public static interface WebStorage.QuotaUpdater {
    method @Deprecated public void updateQuota(long);
  }

  public class WebView extends android.widget.AbsoluteLayout implements android.view.ViewGroup.OnHierarchyChangeListener android.view.ViewTreeObserver.OnGlobalFocusChangeListener {
    ctor public WebView(android.content.Context);
    ctor public WebView(android.content.Context, android.util.AttributeSet);
    ctor public WebView(android.content.Context, android.util.AttributeSet, int);
    ctor public WebView(android.content.Context, android.util.AttributeSet, int, int);
    ctor @Deprecated public WebView(android.content.Context, android.util.AttributeSet, int, boolean);
    method public void addJavascriptInterface(Object, String);
    method public boolean canGoBack();
    method public boolean canGoBackOrForward(int);
    method public boolean canGoForward();
    method @Deprecated public boolean canZoomIn();
    method @Deprecated public boolean canZoomOut();
    method @Deprecated public android.graphics.Picture capturePicture();
    method public void clearCache(boolean);
    method public static void clearClientCertPreferences(@Nullable Runnable);
    method public void clearFormData();
    method public void clearHistory();
    method public void clearMatches();
    method public void clearSslPreferences();
    method @Deprecated public void clearView();
    method public android.webkit.WebBackForwardList copyBackForwardList();
    method @Deprecated public android.print.PrintDocumentAdapter createPrintDocumentAdapter();
    method public android.print.PrintDocumentAdapter createPrintDocumentAdapter(String);
    method public android.webkit.WebMessagePort[] createWebMessageChannel();
    method public void destroy();
    method public static void disableWebView();
    method public void documentHasImages(android.os.Message);
    method public static void enableSlowWholeDocumentDraw();
    method public void evaluateJavascript(String, @Nullable android.webkit.ValueCallback<java.lang.String>);
    method @Deprecated @Nullable public static String findAddress(String);
    method @Deprecated public int findAll(String);
    method public void findAllAsync(String);
    method public void findNext(boolean);
    method public void flingScroll(int, int);
    method @Deprecated public void freeMemory();
    method @Nullable public android.net.http.SslCertificate getCertificate();
    method @android.view.ViewDebug.ExportedProperty(category="webview") public int getContentHeight();
    method @Nullable public static android.content.pm.PackageInfo getCurrentWebViewPackage();
    method public android.graphics.Bitmap getFavicon();
    method public android.webkit.WebView.HitTestResult getHitTestResult();
    method @Deprecated @Nullable public String[] getHttpAuthUsernamePassword(String, String);
    method @android.view.ViewDebug.ExportedProperty(category="webview") public String getOriginalUrl();
    method public int getProgress();
    method public boolean getRendererPriorityWaivedWhenNotVisible();
    method public int getRendererRequestedPriority();
    method @NonNull public static android.net.Uri getSafeBrowsingPrivacyPolicyUrl();
    method @Deprecated @android.view.ViewDebug.ExportedProperty(category="webview") public float getScale();
    method public android.webkit.WebSettings getSettings();
    method @NonNull public android.view.textclassifier.TextClassifier getTextClassifier();
    method @android.view.ViewDebug.ExportedProperty(category="webview") public String getTitle();
    method @android.view.ViewDebug.ExportedProperty(category="webview") public String getUrl();
    method @Nullable public android.webkit.WebChromeClient getWebChromeClient();
    method @NonNull public static ClassLoader getWebViewClassLoader();
    method public android.webkit.WebViewClient getWebViewClient();
    method @NonNull public android.os.Looper getWebViewLooper();
    method public void goBack();
    method public void goBackOrForward(int);
    method public void goForward();
    method public void invokeZoomPicker();
    method public boolean isPrivateBrowsingEnabled();
    method public void loadData(String, @Nullable String, @Nullable String);
    method public void loadDataWithBaseURL(@Nullable String, String, @Nullable String, @Nullable String, @Nullable String);
    method public void loadUrl(String, java.util.Map<java.lang.String,java.lang.String>);
    method public void loadUrl(String);
    method @Deprecated public void onChildViewAdded(android.view.View, android.view.View);
    method @Deprecated public void onChildViewRemoved(android.view.View, android.view.View);
    method @Deprecated public void onGlobalFocusChanged(android.view.View, android.view.View);
    method public void onPause();
    method public void onResume();
    method @Deprecated public boolean overlayHorizontalScrollbar();
    method @Deprecated public boolean overlayVerticalScrollbar();
    method public boolean pageDown(boolean);
    method public boolean pageUp(boolean);
    method public void pauseTimers();
    method public void postUrl(String, byte[]);
    method public void postVisualStateCallback(long, android.webkit.WebView.VisualStateCallback);
    method public void postWebMessage(android.webkit.WebMessage, android.net.Uri);
    method public void reload();
    method public void removeJavascriptInterface(@NonNull String);
    method public void requestFocusNodeHref(@Nullable android.os.Message);
    method public void requestImageRef(android.os.Message);
    method @Nullable public android.webkit.WebBackForwardList restoreState(android.os.Bundle);
    method public void resumeTimers();
    method @Deprecated public void savePassword(String, String, String);
    method @Nullable public android.webkit.WebBackForwardList saveState(android.os.Bundle);
    method public void saveWebArchive(String);
    method public void saveWebArchive(String, boolean, @Nullable android.webkit.ValueCallback<java.lang.String>);
    method @Deprecated public void setCertificate(android.net.http.SslCertificate);
    method public static void setDataDirectorySuffix(String);
    method public void setDownloadListener(android.webkit.DownloadListener);
    method public void setFindListener(android.webkit.WebView.FindListener);
    method @Deprecated public void setHorizontalScrollbarOverlay(boolean);
    method @Deprecated public void setHttpAuthUsernamePassword(String, String, String, String);
    method public void setInitialScale(int);
    method @Deprecated public void setMapTrackballToArrowKeys(boolean);
    method public void setNetworkAvailable(boolean);
    method @Deprecated public void setPictureListener(android.webkit.WebView.PictureListener);
    method public void setRendererPriorityPolicy(int, boolean);
    method public static void setSafeBrowsingWhitelist(@NonNull java.util.List<java.lang.String>, @Nullable android.webkit.ValueCallback<java.lang.Boolean>);
    method public void setTextClassifier(@Nullable android.view.textclassifier.TextClassifier);
    method @Deprecated public void setVerticalScrollbarOverlay(boolean);
    method public void setWebChromeClient(android.webkit.WebChromeClient);
    method public static void setWebContentsDebuggingEnabled(boolean);
    method public void setWebViewClient(android.webkit.WebViewClient);
    method @Deprecated public boolean shouldDelayChildPressedState();
    method @Deprecated public boolean showFindDialog(@Nullable String, boolean);
    method public static void startSafeBrowsing(@NonNull android.content.Context, @Nullable android.webkit.ValueCallback<java.lang.Boolean>);
    method public void stopLoading();
    method public void zoomBy(float);
    method public boolean zoomIn();
    method public boolean zoomOut();
    field public static final int RENDERER_PRIORITY_BOUND = 1; // 0x1
    field public static final int RENDERER_PRIORITY_IMPORTANT = 2; // 0x2
    field public static final int RENDERER_PRIORITY_WAIVED = 0; // 0x0
    field public static final String SCHEME_GEO = "geo:0,0?q=";
    field public static final String SCHEME_MAILTO = "mailto:";
    field public static final String SCHEME_TEL = "tel:";
  }

  public static interface WebView.FindListener {
    method public void onFindResultReceived(int, int, boolean);
  }

  public static class WebView.HitTestResult {
    method @Nullable public String getExtra();
    method public int getType();
    field @Deprecated public static final int ANCHOR_TYPE = 1; // 0x1
    field public static final int EDIT_TEXT_TYPE = 9; // 0x9
    field public static final int EMAIL_TYPE = 4; // 0x4
    field public static final int GEO_TYPE = 3; // 0x3
    field @Deprecated public static final int IMAGE_ANCHOR_TYPE = 6; // 0x6
    field public static final int IMAGE_TYPE = 5; // 0x5
    field public static final int PHONE_TYPE = 2; // 0x2
    field public static final int SRC_ANCHOR_TYPE = 7; // 0x7
    field public static final int SRC_IMAGE_ANCHOR_TYPE = 8; // 0x8
    field public static final int UNKNOWN_TYPE = 0; // 0x0
  }

  @Deprecated public static interface WebView.PictureListener {
    method @Deprecated public void onNewPicture(android.webkit.WebView, @Nullable android.graphics.Picture);
  }

  public abstract static class WebView.VisualStateCallback {
    ctor public WebView.VisualStateCallback();
    method public abstract void onComplete(long);
  }

  public class WebView.WebViewTransport {
    ctor public WebView.WebViewTransport();
    method public android.webkit.WebView getWebView();
    method public void setWebView(android.webkit.WebView);
  }

  public class WebViewClient {
    ctor public WebViewClient();
    method public void doUpdateVisitedHistory(android.webkit.WebView, String, boolean);
    method public void onFormResubmission(android.webkit.WebView, android.os.Message, android.os.Message);
    method public void onLoadResource(android.webkit.WebView, String);
    method public void onPageCommitVisible(android.webkit.WebView, String);
    method public void onPageFinished(android.webkit.WebView, String);
    method public void onPageStarted(android.webkit.WebView, String, android.graphics.Bitmap);
    method public void onReceivedClientCertRequest(android.webkit.WebView, android.webkit.ClientCertRequest);
    method @Deprecated public void onReceivedError(android.webkit.WebView, int, String, String);
    method public void onReceivedError(android.webkit.WebView, android.webkit.WebResourceRequest, android.webkit.WebResourceError);
    method public void onReceivedHttpAuthRequest(android.webkit.WebView, android.webkit.HttpAuthHandler, String, String);
    method public void onReceivedHttpError(android.webkit.WebView, android.webkit.WebResourceRequest, android.webkit.WebResourceResponse);
    method public void onReceivedLoginRequest(android.webkit.WebView, String, @Nullable String, String);
    method public void onReceivedSslError(android.webkit.WebView, android.webkit.SslErrorHandler, android.net.http.SslError);
    method public boolean onRenderProcessGone(android.webkit.WebView, android.webkit.RenderProcessGoneDetail);
    method public void onSafeBrowsingHit(android.webkit.WebView, android.webkit.WebResourceRequest, int, android.webkit.SafeBrowsingResponse);
    method public void onScaleChanged(android.webkit.WebView, float, float);
    method @Deprecated public void onTooManyRedirects(android.webkit.WebView, android.os.Message, android.os.Message);
    method public void onUnhandledKeyEvent(android.webkit.WebView, android.view.KeyEvent);
    method @Deprecated @Nullable public android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebView, String);
    method @Nullable public android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebView, android.webkit.WebResourceRequest);
    method public boolean shouldOverrideKeyEvent(android.webkit.WebView, android.view.KeyEvent);
    method @Deprecated public boolean shouldOverrideUrlLoading(android.webkit.WebView, String);
    method public boolean shouldOverrideUrlLoading(android.webkit.WebView, android.webkit.WebResourceRequest);
    field public static final int ERROR_AUTHENTICATION = -4; // 0xfffffffc
    field public static final int ERROR_BAD_URL = -12; // 0xfffffff4
    field public static final int ERROR_CONNECT = -6; // 0xfffffffa
    field public static final int ERROR_FAILED_SSL_HANDSHAKE = -11; // 0xfffffff5
    field public static final int ERROR_FILE = -13; // 0xfffffff3
    field public static final int ERROR_FILE_NOT_FOUND = -14; // 0xfffffff2
    field public static final int ERROR_HOST_LOOKUP = -2; // 0xfffffffe
    field public static final int ERROR_IO = -7; // 0xfffffff9
    field public static final int ERROR_PROXY_AUTHENTICATION = -5; // 0xfffffffb
    field public static final int ERROR_REDIRECT_LOOP = -9; // 0xfffffff7
    field public static final int ERROR_TIMEOUT = -8; // 0xfffffff8
    field public static final int ERROR_TOO_MANY_REQUESTS = -15; // 0xfffffff1
    field public static final int ERROR_UNKNOWN = -1; // 0xffffffff
    field public static final int ERROR_UNSAFE_RESOURCE = -16; // 0xfffffff0
    field public static final int ERROR_UNSUPPORTED_AUTH_SCHEME = -3; // 0xfffffffd
    field public static final int ERROR_UNSUPPORTED_SCHEME = -10; // 0xfffffff6
    field public static final int SAFE_BROWSING_THREAT_MALWARE = 1; // 0x1
    field public static final int SAFE_BROWSING_THREAT_PHISHING = 2; // 0x2
    field public static final int SAFE_BROWSING_THREAT_UNKNOWN = 0; // 0x0
    field public static final int SAFE_BROWSING_THREAT_UNWANTED_SOFTWARE = 3; // 0x3
  }

  public abstract class WebViewDatabase {
    ctor public WebViewDatabase();
    method @Deprecated public abstract void clearFormData();
    method public abstract void clearHttpAuthUsernamePassword();
    method @Deprecated public abstract void clearUsernamePassword();
    method @Nullable public abstract String[] getHttpAuthUsernamePassword(String, String);
    method public static android.webkit.WebViewDatabase getInstance(android.content.Context);
    method @Deprecated public abstract boolean hasFormData();
    method public abstract boolean hasHttpAuthUsernamePassword();
    method @Deprecated public abstract boolean hasUsernamePassword();
    method public abstract void setHttpAuthUsernamePassword(String, String, String, String);
  }

  @Deprecated public class WebViewFragment extends android.app.Fragment {
    ctor @Deprecated public WebViewFragment();
    method @Deprecated public android.webkit.WebView getWebView();
  }

}

package android.widget {

  public abstract class AbsListView extends android.widget.AdapterView<android.widget.ListAdapter> implements android.widget.Filter.FilterListener android.text.TextWatcher android.view.ViewTreeObserver.OnGlobalLayoutListener android.view.ViewTreeObserver.OnTouchModeChangeListener {
    ctor public AbsListView(android.content.Context);
    ctor public AbsListView(android.content.Context, android.util.AttributeSet);
    ctor public AbsListView(android.content.Context, android.util.AttributeSet, int);
    ctor public AbsListView(android.content.Context, android.util.AttributeSet, int, int);
    method public void afterTextChanged(android.text.Editable);
    method public void beforeTextChanged(CharSequence, int, int, int);
    method public boolean canScrollList(int);
    method public void clearChoices();
    method public void clearTextFilter();
    method public void deferNotifyDataSetChanged();
    method public void fling(int);
    method public android.widget.AbsListView.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method @android.view.ViewDebug.ExportedProperty(category="drawing") @ColorInt public int getCacheColorHint();
    method public int getCheckedItemCount();
    method public long[] getCheckedItemIds();
    method public int getCheckedItemPosition();
    method public android.util.SparseBooleanArray getCheckedItemPositions();
    method public int getChoiceMode();
    method public int getListPaddingBottom();
    method public int getListPaddingLeft();
    method public int getListPaddingRight();
    method public int getListPaddingTop();
    method @android.view.ViewDebug.ExportedProperty public android.view.View getSelectedView();
    method public android.graphics.drawable.Drawable getSelector();
    method public CharSequence getTextFilter();
    method public int getTranscriptMode();
    method protected void handleDataChanged();
    method public boolean hasTextFilter();
    method public void invalidateViews();
    method public boolean isFastScrollAlwaysVisible();
    method @android.view.ViewDebug.ExportedProperty public boolean isFastScrollEnabled();
    method protected boolean isInFilterMode();
    method public boolean isItemChecked(int);
    method @android.view.ViewDebug.ExportedProperty public boolean isScrollingCacheEnabled();
    method @android.view.ViewDebug.ExportedProperty public boolean isSmoothScrollbarEnabled();
    method @android.view.ViewDebug.ExportedProperty public boolean isStackFromBottom();
    method @android.view.ViewDebug.ExportedProperty public boolean isTextFilterEnabled();
    method protected void layoutChildren();
    method public void onFilterComplete(int);
    method public void onGlobalLayout();
    method public void onInitializeAccessibilityNodeInfoForItem(android.view.View, int, android.view.accessibility.AccessibilityNodeInfo);
    method public boolean onRemoteAdapterConnected();
    method public void onRemoteAdapterDisconnected();
    method public void onRestoreInstanceState(android.os.Parcelable);
    method public android.os.Parcelable onSaveInstanceState();
    method public void onTextChanged(CharSequence, int, int, int);
    method public void onTouchModeChanged(boolean);
    method public int pointToPosition(int, int);
    method public long pointToRowId(int, int);
    method public void reclaimViews(java.util.List<android.view.View>);
    method public void scrollListBy(int);
    method public void setAdapter(android.widget.ListAdapter);
    method public void setCacheColorHint(@ColorInt int);
    method public void setChoiceMode(int);
    method public void setDrawSelectorOnTop(boolean);
    method public void setFastScrollAlwaysVisible(boolean);
    method public void setFastScrollEnabled(boolean);
    method public void setFastScrollStyle(int);
    method public void setFilterText(String);
    method public void setFriction(float);
    method public void setItemChecked(int, boolean);
    method public void setMultiChoiceModeListener(android.widget.AbsListView.MultiChoiceModeListener);
    method public void setOnScrollListener(android.widget.AbsListView.OnScrollListener);
    method public void setRecyclerListener(android.widget.AbsListView.RecyclerListener);
    method public void setRemoteViewsAdapter(android.content.Intent);
    method public void setScrollIndicators(android.view.View, android.view.View);
    method public void setScrollingCacheEnabled(boolean);
    method public void setSelectionFromTop(int, int);
    method public void setSelector(@DrawableRes int);
    method public void setSelector(android.graphics.drawable.Drawable);
    method public void setSmoothScrollbarEnabled(boolean);
    method public void setStackFromBottom(boolean);
    method public void setTextFilterEnabled(boolean);
    method public void setTranscriptMode(int);
    method public void setVelocityScale(float);
    method public void smoothScrollBy(int, int);
    method public void smoothScrollToPosition(int);
    method public void smoothScrollToPosition(int, int);
    method public void smoothScrollToPositionFromTop(int, int, int);
    method public void smoothScrollToPositionFromTop(int, int);
    method public boolean verifyDrawable(@NonNull android.graphics.drawable.Drawable);
    field public static final int CHOICE_MODE_MULTIPLE = 2; // 0x2
    field public static final int CHOICE_MODE_MULTIPLE_MODAL = 3; // 0x3
    field public static final int CHOICE_MODE_NONE = 0; // 0x0
    field public static final int CHOICE_MODE_SINGLE = 1; // 0x1
    field public static final int TRANSCRIPT_MODE_ALWAYS_SCROLL = 2; // 0x2
    field public static final int TRANSCRIPT_MODE_DISABLED = 0; // 0x0
    field public static final int TRANSCRIPT_MODE_NORMAL = 1; // 0x1
  }

  public static class AbsListView.LayoutParams extends android.view.ViewGroup.LayoutParams {
    ctor public AbsListView.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public AbsListView.LayoutParams(int, int);
    ctor public AbsListView.LayoutParams(int, int, int);
    ctor public AbsListView.LayoutParams(android.view.ViewGroup.LayoutParams);
  }

  public static interface AbsListView.MultiChoiceModeListener extends android.view.ActionMode.Callback {
    method public void onItemCheckedStateChanged(android.view.ActionMode, int, long, boolean);
  }

  public static interface AbsListView.OnScrollListener {
    method public void onScroll(android.widget.AbsListView, int, int, int);
    method public void onScrollStateChanged(android.widget.AbsListView, int);
    field public static final int SCROLL_STATE_FLING = 2; // 0x2
    field public static final int SCROLL_STATE_IDLE = 0; // 0x0
    field public static final int SCROLL_STATE_TOUCH_SCROLL = 1; // 0x1
  }

  public static interface AbsListView.RecyclerListener {
    method public void onMovedToScrapHeap(android.view.View);
  }

  public static interface AbsListView.SelectionBoundsAdjuster {
    method public void adjustListItemSelectionBounds(android.graphics.Rect);
  }

  public abstract class AbsSeekBar extends android.widget.ProgressBar {
    ctor public AbsSeekBar(android.content.Context);
    ctor public AbsSeekBar(android.content.Context, android.util.AttributeSet);
    ctor public AbsSeekBar(android.content.Context, android.util.AttributeSet, int);
    ctor public AbsSeekBar(android.content.Context, android.util.AttributeSet, int, int);
    method public int getKeyProgressIncrement();
    method public boolean getSplitTrack();
    method public android.graphics.drawable.Drawable getThumb();
    method public int getThumbOffset();
    method @Nullable public android.content.res.ColorStateList getThumbTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getThumbTintMode();
    method public android.graphics.drawable.Drawable getTickMark();
    method @Nullable public android.content.res.ColorStateList getTickMarkTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getTickMarkTintMode();
    method public void setKeyProgressIncrement(int);
    method public void setSplitTrack(boolean);
    method public void setThumb(android.graphics.drawable.Drawable);
    method public void setThumbOffset(int);
    method public void setThumbTintList(@Nullable android.content.res.ColorStateList);
    method public void setThumbTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public void setTickMark(android.graphics.drawable.Drawable);
    method public void setTickMarkTintList(@Nullable android.content.res.ColorStateList);
    method public void setTickMarkTintMode(@Nullable android.graphics.PorterDuff.Mode);
  }

  public abstract class AbsSpinner extends android.widget.AdapterView<android.widget.SpinnerAdapter> {
    ctor public AbsSpinner(android.content.Context);
    ctor public AbsSpinner(android.content.Context, android.util.AttributeSet);
    ctor public AbsSpinner(android.content.Context, android.util.AttributeSet, int);
    ctor public AbsSpinner(android.content.Context, android.util.AttributeSet, int, int);
    method public android.widget.SpinnerAdapter getAdapter();
    method public android.view.View getSelectedView();
    method public void onRestoreInstanceState(android.os.Parcelable);
    method public android.os.Parcelable onSaveInstanceState();
    method public int pointToPosition(int, int);
    method public void setAdapter(android.widget.SpinnerAdapter);
    method public void setSelection(int, boolean);
    method public void setSelection(int);
  }

  @Deprecated @android.widget.RemoteViews.RemoteView public class AbsoluteLayout extends android.view.ViewGroup {
    ctor @Deprecated public AbsoluteLayout(android.content.Context);
    ctor @Deprecated public AbsoluteLayout(android.content.Context, android.util.AttributeSet);
    ctor @Deprecated public AbsoluteLayout(android.content.Context, android.util.AttributeSet, int);
    ctor @Deprecated public AbsoluteLayout(android.content.Context, android.util.AttributeSet, int, int);
  }

  @Deprecated public static class AbsoluteLayout.LayoutParams extends android.view.ViewGroup.LayoutParams {
    ctor @Deprecated public AbsoluteLayout.LayoutParams(int, int, int, int);
    ctor @Deprecated public AbsoluteLayout.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor @Deprecated public AbsoluteLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
    method @Deprecated public String debug(String);
    field @Deprecated public int x;
    field @Deprecated public int y;
  }

  public class ActionMenuView extends android.widget.LinearLayout {
    ctor public ActionMenuView(android.content.Context);
    ctor public ActionMenuView(android.content.Context, android.util.AttributeSet);
    method public void dismissPopupMenus();
    method protected android.widget.ActionMenuView.LayoutParams generateDefaultLayoutParams();
    method public android.widget.ActionMenuView.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method protected android.widget.ActionMenuView.LayoutParams generateLayoutParams(android.view.ViewGroup.LayoutParams);
    method public android.view.Menu getMenu();
    method @Nullable public android.graphics.drawable.Drawable getOverflowIcon();
    method public int getPopupTheme();
    method public boolean hideOverflowMenu();
    method public boolean isOverflowMenuShowing();
    method public void onConfigurationChanged(android.content.res.Configuration);
    method public void onDetachedFromWindow();
    method public void setOnMenuItemClickListener(android.widget.ActionMenuView.OnMenuItemClickListener);
    method public void setOverflowIcon(@Nullable android.graphics.drawable.Drawable);
    method public void setPopupTheme(@StyleRes int);
    method public boolean showOverflowMenu();
  }

  public static class ActionMenuView.LayoutParams extends android.widget.LinearLayout.LayoutParams {
    ctor public ActionMenuView.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public ActionMenuView.LayoutParams(android.view.ViewGroup.LayoutParams);
    ctor public ActionMenuView.LayoutParams(android.widget.ActionMenuView.LayoutParams);
    ctor public ActionMenuView.LayoutParams(int, int);
  }

  public static interface ActionMenuView.OnMenuItemClickListener {
    method public boolean onMenuItemClick(android.view.MenuItem);
  }

  public interface Adapter {
    method @Nullable public default CharSequence[] getAutofillOptions();
    method public int getCount();
    method public Object getItem(int);
    method public long getItemId(int);
    method public int getItemViewType(int);
    method public android.view.View getView(int, android.view.View, android.view.ViewGroup);
    method public int getViewTypeCount();
    method public boolean hasStableIds();
    method public boolean isEmpty();
    method public void registerDataSetObserver(android.database.DataSetObserver);
    method public void unregisterDataSetObserver(android.database.DataSetObserver);
    field public static final int IGNORE_ITEM_VIEW_TYPE = -1; // 0xffffffff
    field public static final int NO_SELECTION = -2147483648; // 0x80000000
  }

  public abstract class AdapterView<T extends android.widget.Adapter> extends android.view.ViewGroup {
    ctor public AdapterView(android.content.Context);
    ctor public AdapterView(android.content.Context, android.util.AttributeSet);
    ctor public AdapterView(android.content.Context, android.util.AttributeSet, int);
    ctor public AdapterView(android.content.Context, android.util.AttributeSet, int, int);
    method public abstract T getAdapter();
    method @android.view.ViewDebug.CapturedViewProperty public int getCount();
    method public android.view.View getEmptyView();
    method public int getFirstVisiblePosition();
    method public Object getItemAtPosition(int);
    method public long getItemIdAtPosition(int);
    method public int getLastVisiblePosition();
    method @Nullable public final android.widget.AdapterView.OnItemClickListener getOnItemClickListener();
    method public final android.widget.AdapterView.OnItemLongClickListener getOnItemLongClickListener();
    method @Nullable public final android.widget.AdapterView.OnItemSelectedListener getOnItemSelectedListener();
    method public int getPositionForView(android.view.View);
    method public Object getSelectedItem();
    method @android.view.ViewDebug.CapturedViewProperty public long getSelectedItemId();
    method @android.view.ViewDebug.CapturedViewProperty public int getSelectedItemPosition();
    method public abstract android.view.View getSelectedView();
    method public boolean performItemClick(android.view.View, int, long);
    method public abstract void setAdapter(T);
    method public void setEmptyView(android.view.View);
    method public void setOnItemClickListener(@Nullable android.widget.AdapterView.OnItemClickListener);
    method public void setOnItemLongClickListener(android.widget.AdapterView.OnItemLongClickListener);
    method public void setOnItemSelectedListener(@Nullable android.widget.AdapterView.OnItemSelectedListener);
    method public abstract void setSelection(int);
    field public static final int INVALID_POSITION = -1; // 0xffffffff
    field public static final long INVALID_ROW_ID = -9223372036854775808L; // 0x8000000000000000L
    field public static final int ITEM_VIEW_TYPE_HEADER_OR_FOOTER = -2; // 0xfffffffe
    field public static final int ITEM_VIEW_TYPE_IGNORE = -1; // 0xffffffff
  }

  public static class AdapterView.AdapterContextMenuInfo implements android.view.ContextMenu.ContextMenuInfo {
    ctor public AdapterView.AdapterContextMenuInfo(android.view.View, int, long);
    field public long id;
    field public int position;
    field public android.view.View targetView;
  }

  public static interface AdapterView.OnItemClickListener {
    method public void onItemClick(android.widget.AdapterView<?>, android.view.View, int, long);
  }

  public static interface AdapterView.OnItemLongClickListener {
    method public boolean onItemLongClick(android.widget.AdapterView<?>, android.view.View, int, long);
  }

  public static interface AdapterView.OnItemSelectedListener {
    method public void onItemSelected(android.widget.AdapterView<?>, android.view.View, int, long);
    method public void onNothingSelected(android.widget.AdapterView<?>);
  }

  public abstract class AdapterViewAnimator extends android.widget.AdapterView<android.widget.Adapter> implements android.widget.Advanceable {
    ctor public AdapterViewAnimator(android.content.Context);
    ctor public AdapterViewAnimator(android.content.Context, android.util.AttributeSet);
    ctor public AdapterViewAnimator(android.content.Context, android.util.AttributeSet, int);
    ctor public AdapterViewAnimator(android.content.Context, android.util.AttributeSet, int, int);
    method public void advance();
    method public void deferNotifyDataSetChanged();
    method public void fyiWillBeAdvancedByHostKThx();
    method public android.widget.Adapter getAdapter();
    method public android.view.View getCurrentView();
    method public int getDisplayedChild();
    method public android.animation.ObjectAnimator getInAnimation();
    method public android.animation.ObjectAnimator getOutAnimation();
    method public android.view.View getSelectedView();
    method public boolean onRemoteAdapterConnected();
    method public void onRemoteAdapterDisconnected();
    method public void onRestoreInstanceState(android.os.Parcelable);
    method public android.os.Parcelable onSaveInstanceState();
    method public void setAdapter(android.widget.Adapter);
    method public void setAnimateFirstView(boolean);
    method public void setDisplayedChild(int);
    method public void setInAnimation(android.animation.ObjectAnimator);
    method public void setInAnimation(android.content.Context, int);
    method public void setOutAnimation(android.animation.ObjectAnimator);
    method public void setOutAnimation(android.content.Context, int);
    method public void setRemoteViewsAdapter(android.content.Intent);
    method public void setSelection(int);
    method public void showNext();
    method public void showPrevious();
  }

  @android.widget.RemoteViews.RemoteView public class AdapterViewFlipper extends android.widget.AdapterViewAnimator {
    ctor public AdapterViewFlipper(android.content.Context);
    ctor public AdapterViewFlipper(android.content.Context, android.util.AttributeSet);
    ctor public AdapterViewFlipper(android.content.Context, android.util.AttributeSet, int);
    ctor public AdapterViewFlipper(android.content.Context, android.util.AttributeSet, int, int);
    method public int getFlipInterval();
    method public boolean isAutoStart();
    method public boolean isFlipping();
    method public void setAutoStart(boolean);
    method public void setFlipInterval(int);
    method public void startFlipping();
    method public void stopFlipping();
  }

  public interface Advanceable {
    method public void advance();
    method public void fyiWillBeAdvancedByHostKThx();
  }

  public class AlphabetIndexer extends android.database.DataSetObserver implements android.widget.SectionIndexer {
    ctor public AlphabetIndexer(android.database.Cursor, int, CharSequence);
    method protected int compare(String, String);
    method public int getPositionForSection(int);
    method public int getSectionForPosition(int);
    method public Object[] getSections();
    method public void setCursor(android.database.Cursor);
    field protected CharSequence mAlphabet;
    field protected int mColumnIndex;
    field protected android.database.Cursor mDataCursor;
  }

  @Deprecated @android.widget.RemoteViews.RemoteView public class AnalogClock extends android.view.View {
    ctor @Deprecated public AnalogClock(android.content.Context);
    ctor @Deprecated public AnalogClock(android.content.Context, android.util.AttributeSet);
    ctor @Deprecated public AnalogClock(android.content.Context, android.util.AttributeSet, int);
    ctor @Deprecated public AnalogClock(android.content.Context, android.util.AttributeSet, int, int);
  }

  public class ArrayAdapter<T> extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.ThemedSpinnerAdapter {
    ctor public ArrayAdapter(@NonNull android.content.Context, @LayoutRes int);
    ctor public ArrayAdapter(@NonNull android.content.Context, @LayoutRes int, @IdRes int);
    ctor public ArrayAdapter(@NonNull android.content.Context, @LayoutRes int, @NonNull T[]);
    ctor public ArrayAdapter(@NonNull android.content.Context, @LayoutRes int, @IdRes int, @NonNull T[]);
    ctor public ArrayAdapter(@NonNull android.content.Context, @LayoutRes int, @NonNull java.util.List<T>);
    ctor public ArrayAdapter(@NonNull android.content.Context, @LayoutRes int, @IdRes int, @NonNull java.util.List<T>);
    method public void add(@Nullable T);
    method public void addAll(@NonNull java.util.Collection<? extends T>);
    method public void addAll(T...);
    method public void clear();
    method @NonNull public static android.widget.ArrayAdapter<java.lang.CharSequence> createFromResource(@NonNull android.content.Context, @ArrayRes int, @LayoutRes int);
    method @NonNull public android.content.Context getContext();
    method public int getCount();
    method @Nullable public android.content.res.Resources.Theme getDropDownViewTheme();
    method @NonNull public android.widget.Filter getFilter();
    method @Nullable public T getItem(int);
    method public long getItemId(int);
    method public int getPosition(@Nullable T);
    method @NonNull public android.view.View getView(int, @Nullable android.view.View, @NonNull android.view.ViewGroup);
    method public void insert(@Nullable T, int);
    method public void remove(@Nullable T);
    method public void setDropDownViewResource(@LayoutRes int);
    method public void setDropDownViewTheme(@Nullable android.content.res.Resources.Theme);
    method public void setNotifyOnChange(boolean);
    method public void sort(@NonNull java.util.Comparator<? super T>);
  }

  public class AutoCompleteTextView extends android.widget.EditText implements android.widget.Filter.FilterListener {
    ctor public AutoCompleteTextView(android.content.Context);
    ctor public AutoCompleteTextView(android.content.Context, android.util.AttributeSet);
    ctor public AutoCompleteTextView(android.content.Context, android.util.AttributeSet, int);
    ctor public AutoCompleteTextView(android.content.Context, android.util.AttributeSet, int, int);
    ctor public AutoCompleteTextView(android.content.Context, android.util.AttributeSet, int, int, android.content.res.Resources.Theme);
    method public void clearListSelection();
    method protected CharSequence convertSelectionToString(Object);
    method public void dismissDropDown();
    method public boolean enoughToFilter();
    method public android.widget.ListAdapter getAdapter();
    method public CharSequence getCompletionHint();
    method public int getDropDownAnchor();
    method public android.graphics.drawable.Drawable getDropDownBackground();
    method public int getDropDownHeight();
    method public int getDropDownHorizontalOffset();
    method public int getDropDownVerticalOffset();
    method public int getDropDownWidth();
    method protected android.widget.Filter getFilter();
    method @Deprecated public android.widget.AdapterView.OnItemClickListener getItemClickListener();
    method @Deprecated public android.widget.AdapterView.OnItemSelectedListener getItemSelectedListener();
    method public int getListSelection();
    method public android.widget.AdapterView.OnItemClickListener getOnItemClickListener();
    method public android.widget.AdapterView.OnItemSelectedListener getOnItemSelectedListener();
    method public int getThreshold();
    method public android.widget.AutoCompleteTextView.Validator getValidator();
    method public boolean isPerformingCompletion();
    method public boolean isPopupShowing();
    method public void onFilterComplete(int);
    method public void performCompletion();
    method protected void performFiltering(CharSequence, int);
    method public void performValidation();
    method protected void replaceText(CharSequence);
    method public <T extends android.widget.ListAdapter & android.widget.Filterable> void setAdapter(T);
    method public void setCompletionHint(CharSequence);
    method public void setDropDownAnchor(int);
    method public void setDropDownBackgroundDrawable(android.graphics.drawable.Drawable);
    method public void setDropDownBackgroundResource(@DrawableRes int);
    method public void setDropDownHeight(int);
    method public void setDropDownHorizontalOffset(int);
    method public void setDropDownVerticalOffset(int);
    method public void setDropDownWidth(int);
    method public void setListSelection(int);
    method public void setOnDismissListener(android.widget.AutoCompleteTextView.OnDismissListener);
    method public void setOnItemClickListener(android.widget.AdapterView.OnItemClickListener);
    method public void setOnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener);
    method public void setText(CharSequence, boolean);
    method public void setThreshold(int);
    method public void setValidator(android.widget.AutoCompleteTextView.Validator);
    method public void showDropDown();
  }

  public static interface AutoCompleteTextView.OnDismissListener {
    method public void onDismiss();
  }

  public static interface AutoCompleteTextView.Validator {
    method public CharSequence fixText(CharSequence);
    method public boolean isValid(CharSequence);
  }

  public abstract class BaseAdapter implements android.widget.ListAdapter android.widget.SpinnerAdapter {
    ctor public BaseAdapter();
    method public boolean areAllItemsEnabled();
    method public android.view.View getDropDownView(int, android.view.View, android.view.ViewGroup);
    method public int getItemViewType(int);
    method public int getViewTypeCount();
    method public boolean hasStableIds();
    method public boolean isEmpty();
    method public boolean isEnabled(int);
    method public void notifyDataSetChanged();
    method public void notifyDataSetInvalidated();
    method public void registerDataSetObserver(android.database.DataSetObserver);
    method public void setAutofillOptions(@Nullable java.lang.CharSequence...);
    method public void unregisterDataSetObserver(android.database.DataSetObserver);
  }

  public abstract class BaseExpandableListAdapter implements android.widget.ExpandableListAdapter android.widget.HeterogeneousExpandableList {
    ctor public BaseExpandableListAdapter();
    method public boolean areAllItemsEnabled();
    method public int getChildType(int, int);
    method public int getChildTypeCount();
    method public long getCombinedChildId(long, long);
    method public long getCombinedGroupId(long);
    method public int getGroupType(int);
    method public int getGroupTypeCount();
    method public boolean isEmpty();
    method public void notifyDataSetChanged();
    method public void notifyDataSetInvalidated();
    method public void onGroupCollapsed(int);
    method public void onGroupExpanded(int);
    method public void registerDataSetObserver(android.database.DataSetObserver);
    method public void unregisterDataSetObserver(android.database.DataSetObserver);
  }

  @android.widget.RemoteViews.RemoteView public class Button extends android.widget.TextView {
    ctor public Button(android.content.Context);
    ctor public Button(android.content.Context, android.util.AttributeSet);
    ctor public Button(android.content.Context, android.util.AttributeSet, int);
    ctor public Button(android.content.Context, android.util.AttributeSet, int, int);
  }

  public class CalendarView extends android.widget.FrameLayout {
    ctor public CalendarView(@NonNull android.content.Context);
    ctor public CalendarView(@NonNull android.content.Context, @Nullable android.util.AttributeSet);
    ctor public CalendarView(@NonNull android.content.Context, @Nullable android.util.AttributeSet, @AttrRes int);
    ctor public CalendarView(@NonNull android.content.Context, @Nullable android.util.AttributeSet, @AttrRes int, @StyleRes int);
    method public long getDate();
    method @StyleRes public int getDateTextAppearance();
    method public int getFirstDayOfWeek();
    method @Deprecated @ColorInt public int getFocusedMonthDateColor();
    method public long getMaxDate();
    method public long getMinDate();
    method @Deprecated public android.graphics.drawable.Drawable getSelectedDateVerticalBar();
    method @Deprecated @ColorInt public int getSelectedWeekBackgroundColor();
    method @Deprecated public boolean getShowWeekNumber();
    method @Deprecated public int getShownWeekCount();
    method @Deprecated @ColorInt public int getUnfocusedMonthDateColor();
    method @StyleRes public int getWeekDayTextAppearance();
    method @Deprecated @ColorInt public int getWeekNumberColor();
    method @Deprecated @ColorInt public int getWeekSeparatorLineColor();
    method public void setDate(long);
    method public void setDate(long, boolean, boolean);
    method public void setDateTextAppearance(@StyleRes int);
    method public void setFirstDayOfWeek(int);
    method @Deprecated public void setFocusedMonthDateColor(@ColorInt int);
    method public void setMaxDate(long);
    method public void setMinDate(long);
    method public void setOnDateChangeListener(android.widget.CalendarView.OnDateChangeListener);
    method @Deprecated public void setSelectedDateVerticalBar(@DrawableRes int);
    method @Deprecated public void setSelectedDateVerticalBar(android.graphics.drawable.Drawable);
    method @Deprecated public void setSelectedWeekBackgroundColor(@ColorInt int);
    method @Deprecated public void setShowWeekNumber(boolean);
    method @Deprecated public void setShownWeekCount(int);
    method @Deprecated public void setUnfocusedMonthDateColor(@ColorInt int);
    method public void setWeekDayTextAppearance(@StyleRes int);
    method @Deprecated public void setWeekNumberColor(@ColorInt int);
    method @Deprecated public void setWeekSeparatorLineColor(@ColorInt int);
  }

  public static interface CalendarView.OnDateChangeListener {
    method public void onSelectedDayChange(@NonNull android.widget.CalendarView, int, int, int);
  }

  public class CheckBox extends android.widget.CompoundButton {
    ctor public CheckBox(android.content.Context);
    ctor public CheckBox(android.content.Context, android.util.AttributeSet);
    ctor public CheckBox(android.content.Context, android.util.AttributeSet, int);
    ctor public CheckBox(android.content.Context, android.util.AttributeSet, int, int);
  }

  public interface Checkable {
    method public boolean isChecked();
    method public void setChecked(boolean);
    method public void toggle();
  }

  public class CheckedTextView extends android.widget.TextView implements android.widget.Checkable {
    ctor public CheckedTextView(android.content.Context);
    ctor public CheckedTextView(android.content.Context, android.util.AttributeSet);
    ctor public CheckedTextView(android.content.Context, android.util.AttributeSet, int);
    ctor public CheckedTextView(android.content.Context, android.util.AttributeSet, int, int);
    method public android.graphics.drawable.Drawable getCheckMarkDrawable();
    method @Nullable public android.content.res.ColorStateList getCheckMarkTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getCheckMarkTintMode();
    method @android.view.ViewDebug.ExportedProperty public boolean isChecked();
    method public void setCheckMarkDrawable(@DrawableRes int);
    method public void setCheckMarkDrawable(@Nullable android.graphics.drawable.Drawable);
    method public void setCheckMarkTintList(@Nullable android.content.res.ColorStateList);
    method public void setCheckMarkTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public void setChecked(boolean);
    method public void toggle();
  }

  @android.widget.RemoteViews.RemoteView public class Chronometer extends android.widget.TextView {
    ctor public Chronometer(android.content.Context);
    ctor public Chronometer(android.content.Context, android.util.AttributeSet);
    ctor public Chronometer(android.content.Context, android.util.AttributeSet, int);
    ctor public Chronometer(android.content.Context, android.util.AttributeSet, int, int);
    method public long getBase();
    method public String getFormat();
    method public android.widget.Chronometer.OnChronometerTickListener getOnChronometerTickListener();
    method public boolean isCountDown();
    method public boolean isTheFinalCountDown();
    method public void setBase(long);
    method public void setCountDown(boolean);
    method public void setFormat(String);
    method public void setOnChronometerTickListener(android.widget.Chronometer.OnChronometerTickListener);
    method public void start();
    method public void stop();
  }

  public static interface Chronometer.OnChronometerTickListener {
    method public void onChronometerTick(android.widget.Chronometer);
  }

  public abstract class CompoundButton extends android.widget.Button implements android.widget.Checkable {
    ctor public CompoundButton(android.content.Context);
    ctor public CompoundButton(android.content.Context, android.util.AttributeSet);
    ctor public CompoundButton(android.content.Context, android.util.AttributeSet, int);
    ctor public CompoundButton(android.content.Context, android.util.AttributeSet, int, int);
    method @Nullable public android.graphics.drawable.Drawable getButtonDrawable();
    method @Nullable public android.content.res.ColorStateList getButtonTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getButtonTintMode();
    method @android.view.ViewDebug.ExportedProperty public boolean isChecked();
    method public void setButtonDrawable(@DrawableRes int);
    method public void setButtonDrawable(@Nullable android.graphics.drawable.Drawable);
    method public void setButtonTintList(@Nullable android.content.res.ColorStateList);
    method public void setButtonTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public void setChecked(boolean);
    method public void setOnCheckedChangeListener(@Nullable android.widget.CompoundButton.OnCheckedChangeListener);
    method public void toggle();
  }

  public static interface CompoundButton.OnCheckedChangeListener {
    method public void onCheckedChanged(android.widget.CompoundButton, boolean);
  }

  public abstract class CursorAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.ThemedSpinnerAdapter {
    ctor @Deprecated public CursorAdapter(android.content.Context, android.database.Cursor);
    ctor public CursorAdapter(android.content.Context, android.database.Cursor, boolean);
    ctor public CursorAdapter(android.content.Context, android.database.Cursor, int);
    method public abstract void bindView(android.view.View, android.content.Context, android.database.Cursor);
    method public void changeCursor(android.database.Cursor);
    method public CharSequence convertToString(android.database.Cursor);
    method public int getCount();
    method public android.database.Cursor getCursor();
    method public android.content.res.Resources.Theme getDropDownViewTheme();
    method public android.widget.Filter getFilter();
    method public android.widget.FilterQueryProvider getFilterQueryProvider();
    method public Object getItem(int);
    method public long getItemId(int);
    method public android.view.View getView(int, android.view.View, android.view.ViewGroup);
    method @Deprecated protected void init(android.content.Context, android.database.Cursor, boolean);
    method public android.view.View newDropDownView(android.content.Context, android.database.Cursor, android.view.ViewGroup);
    method public abstract android.view.View newView(android.content.Context, android.database.Cursor, android.view.ViewGroup);
    method protected void onContentChanged();
    method @WorkerThread public android.database.Cursor runQueryOnBackgroundThread(CharSequence);
    method public void setDropDownViewTheme(android.content.res.Resources.Theme);
    method public void setFilterQueryProvider(android.widget.FilterQueryProvider);
    method public android.database.Cursor swapCursor(android.database.Cursor);
    field @Deprecated public static final int FLAG_AUTO_REQUERY = 1; // 0x1
    field public static final int FLAG_REGISTER_CONTENT_OBSERVER = 2; // 0x2
  }

  public abstract class CursorTreeAdapter extends android.widget.BaseExpandableListAdapter implements android.widget.Filterable {
    ctor public CursorTreeAdapter(android.database.Cursor, android.content.Context);
    ctor public CursorTreeAdapter(android.database.Cursor, android.content.Context, boolean);
    method protected abstract void bindChildView(android.view.View, android.content.Context, android.database.Cursor, boolean);
    method protected abstract void bindGroupView(android.view.View, android.content.Context, android.database.Cursor, boolean);
    method public void changeCursor(android.database.Cursor);
    method public String convertToString(android.database.Cursor);
    method public android.database.Cursor getChild(int, int);
    method public long getChildId(int, int);
    method public android.view.View getChildView(int, int, boolean, android.view.View, android.view.ViewGroup);
    method public int getChildrenCount(int);
    method protected abstract android.database.Cursor getChildrenCursor(android.database.Cursor);
    method public android.database.Cursor getCursor();
    method public android.widget.Filter getFilter();
    method public android.widget.FilterQueryProvider getFilterQueryProvider();
    method public android.database.Cursor getGroup(int);
    method public int getGroupCount();
    method public long getGroupId(int);
    method public android.view.View getGroupView(int, boolean, android.view.View, android.view.ViewGroup);
    method public boolean hasStableIds();
    method public boolean isChildSelectable(int, int);
    method protected abstract android.view.View newChildView(android.content.Context, android.database.Cursor, boolean, android.view.ViewGroup);
    method protected abstract android.view.View newGroupView(android.content.Context, android.database.Cursor, boolean, android.view.ViewGroup);
    method public void notifyDataSetChanged(boolean);
    method public android.database.Cursor runQueryOnBackgroundThread(CharSequence);
    method public void setChildrenCursor(int, android.database.Cursor);
    method public void setFilterQueryProvider(android.widget.FilterQueryProvider);
    method public void setGroupCursor(android.database.Cursor);
  }

  public class DatePicker extends android.widget.FrameLayout {
    ctor public DatePicker(android.content.Context);
    ctor public DatePicker(android.content.Context, android.util.AttributeSet);
    ctor public DatePicker(android.content.Context, android.util.AttributeSet, int);
    ctor public DatePicker(android.content.Context, android.util.AttributeSet, int, int);
    method @Deprecated public android.widget.CalendarView getCalendarView();
    method @Deprecated public boolean getCalendarViewShown();
    method public int getDayOfMonth();
    method public int getFirstDayOfWeek();
    method public long getMaxDate();
    method public long getMinDate();
    method public int getMonth();
    method @Deprecated public boolean getSpinnersShown();
    method public int getYear();
    method public void init(int, int, int, android.widget.DatePicker.OnDateChangedListener);
    method @Deprecated public void setCalendarViewShown(boolean);
    method public void setFirstDayOfWeek(int);
    method public void setMaxDate(long);
    method public void setMinDate(long);
    method public void setOnDateChangedListener(android.widget.DatePicker.OnDateChangedListener);
    method @Deprecated public void setSpinnersShown(boolean);
    method public void updateDate(int, int, int);
  }

  public static interface DatePicker.OnDateChangedListener {
    method public void onDateChanged(android.widget.DatePicker, int, int, int);
  }

  @Deprecated public class DialerFilter extends android.widget.RelativeLayout {
    ctor @Deprecated public DialerFilter(android.content.Context);
    ctor @Deprecated public DialerFilter(android.content.Context, android.util.AttributeSet);
    method @Deprecated public void append(String);
    method @Deprecated public void clearText();
    method @Deprecated public CharSequence getDigits();
    method @Deprecated public CharSequence getFilterText();
    method @Deprecated public CharSequence getLetters();
    method @Deprecated public int getMode();
    method @Deprecated public boolean isQwertyKeyboard();
    method @Deprecated protected void onModeChange(int, int);
    method @Deprecated public void removeFilterWatcher(android.text.TextWatcher);
    method @Deprecated public void setDigitsWatcher(android.text.TextWatcher);
    method @Deprecated public void setFilterWatcher(android.text.TextWatcher);
    method @Deprecated public void setLettersWatcher(android.text.TextWatcher);
    method @Deprecated public void setMode(int);
    field @Deprecated public static final int DIGITS_AND_LETTERS = 1; // 0x1
    field @Deprecated public static final int DIGITS_AND_LETTERS_NO_DIGITS = 2; // 0x2
    field @Deprecated public static final int DIGITS_AND_LETTERS_NO_LETTERS = 3; // 0x3
    field @Deprecated public static final int DIGITS_ONLY = 4; // 0x4
    field @Deprecated public static final int LETTERS_ONLY = 5; // 0x5
  }

  @Deprecated public class DigitalClock extends android.widget.TextView {
    ctor @Deprecated public DigitalClock(android.content.Context);
    ctor @Deprecated public DigitalClock(android.content.Context, android.util.AttributeSet);
  }

  public class EdgeEffect {
    ctor public EdgeEffect(android.content.Context);
    method public boolean draw(android.graphics.Canvas);
    method public void finish();
    method @ColorInt public int getColor();
    method public int getMaxHeight();
    method public boolean isFinished();
    method public void onAbsorb(int);
    method public void onPull(float);
    method public void onPull(float, float);
    method public void onRelease();
    method public void setColor(@ColorInt int);
    method public void setSize(int, int);
  }

  public class EditText extends android.widget.TextView {
    ctor public EditText(android.content.Context);
    ctor public EditText(android.content.Context, android.util.AttributeSet);
    ctor public EditText(android.content.Context, android.util.AttributeSet, int);
    ctor public EditText(android.content.Context, android.util.AttributeSet, int, int);
    method public void extendSelection(int);
    method public android.text.Editable getText();
    method public void selectAll();
    method public void setSelection(int, int);
    method public void setSelection(int);
  }

  public interface ExpandableListAdapter {
    method public boolean areAllItemsEnabled();
    method public Object getChild(int, int);
    method public long getChildId(int, int);
    method public android.view.View getChildView(int, int, boolean, android.view.View, android.view.ViewGroup);
    method public int getChildrenCount(int);
    method public long getCombinedChildId(long, long);
    method public long getCombinedGroupId(long);
    method public Object getGroup(int);
    method public int getGroupCount();
    method public long getGroupId(int);
    method public android.view.View getGroupView(int, boolean, android.view.View, android.view.ViewGroup);
    method public boolean hasStableIds();
    method public boolean isChildSelectable(int, int);
    method public boolean isEmpty();
    method public void onGroupCollapsed(int);
    method public void onGroupExpanded(int);
    method public void registerDataSetObserver(android.database.DataSetObserver);
    method public void unregisterDataSetObserver(android.database.DataSetObserver);
  }

  public class ExpandableListView extends android.widget.ListView {
    ctor public ExpandableListView(android.content.Context);
    ctor public ExpandableListView(android.content.Context, android.util.AttributeSet);
    ctor public ExpandableListView(android.content.Context, android.util.AttributeSet, int);
    ctor public ExpandableListView(android.content.Context, android.util.AttributeSet, int, int);
    method public boolean collapseGroup(int);
    method public boolean expandGroup(int);
    method public boolean expandGroup(int, boolean);
    method public android.widget.ExpandableListAdapter getExpandableListAdapter();
    method public long getExpandableListPosition(int);
    method public int getFlatListPosition(long);
    method public static int getPackedPositionChild(long);
    method public static long getPackedPositionForChild(int, int);
    method public static long getPackedPositionForGroup(int);
    method public static int getPackedPositionGroup(long);
    method public static int getPackedPositionType(long);
    method public long getSelectedId();
    method public long getSelectedPosition();
    method public boolean isGroupExpanded(int);
    method public void setAdapter(android.widget.ExpandableListAdapter);
    method public void setChildDivider(android.graphics.drawable.Drawable);
    method public void setChildIndicator(android.graphics.drawable.Drawable);
    method public void setChildIndicatorBounds(int, int);
    method public void setChildIndicatorBoundsRelative(int, int);
    method public void setGroupIndicator(android.graphics.drawable.Drawable);
    method public void setIndicatorBounds(int, int);
    method public void setIndicatorBoundsRelative(int, int);
    method public void setOnChildClickListener(android.widget.ExpandableListView.OnChildClickListener);
    method public void setOnGroupClickListener(android.widget.ExpandableListView.OnGroupClickListener);
    method public void setOnGroupCollapseListener(android.widget.ExpandableListView.OnGroupCollapseListener);
    method public void setOnGroupExpandListener(android.widget.ExpandableListView.OnGroupExpandListener);
    method public boolean setSelectedChild(int, int, boolean);
    method public void setSelectedGroup(int);
    field public static final int CHILD_INDICATOR_INHERIT = -1; // 0xffffffff
    field public static final int PACKED_POSITION_TYPE_CHILD = 1; // 0x1
    field public static final int PACKED_POSITION_TYPE_GROUP = 0; // 0x0
    field public static final int PACKED_POSITION_TYPE_NULL = 2; // 0x2
    field public static final long PACKED_POSITION_VALUE_NULL = 4294967295L; // 0xffffffffL
  }

  public static class ExpandableListView.ExpandableListContextMenuInfo implements android.view.ContextMenu.ContextMenuInfo {
    ctor public ExpandableListView.ExpandableListContextMenuInfo(android.view.View, long, long);
    field public long id;
    field public long packedPosition;
    field public android.view.View targetView;
  }

  public static interface ExpandableListView.OnChildClickListener {
    method public boolean onChildClick(android.widget.ExpandableListView, android.view.View, int, int, long);
  }

  public static interface ExpandableListView.OnGroupClickListener {
    method public boolean onGroupClick(android.widget.ExpandableListView, android.view.View, int, long);
  }

  public static interface ExpandableListView.OnGroupCollapseListener {
    method public void onGroupCollapse(int);
  }

  public static interface ExpandableListView.OnGroupExpandListener {
    method public void onGroupExpand(int);
  }

  public abstract class Filter {
    ctor public Filter();
    method public CharSequence convertResultToString(Object);
    method public final void filter(CharSequence);
    method public final void filter(CharSequence, android.widget.Filter.FilterListener);
    method protected abstract android.widget.Filter.FilterResults performFiltering(CharSequence);
    method protected abstract void publishResults(CharSequence, android.widget.Filter.FilterResults);
  }

  public static interface Filter.FilterListener {
    method public void onFilterComplete(int);
  }

  protected static class Filter.FilterResults {
    ctor public Filter.FilterResults();
    field public int count;
    field public Object values;
  }

  public interface FilterQueryProvider {
    method public android.database.Cursor runQuery(CharSequence);
  }

  public interface Filterable {
    method public android.widget.Filter getFilter();
  }

  @android.widget.RemoteViews.RemoteView public class FrameLayout extends android.view.ViewGroup {
    ctor public FrameLayout(@NonNull android.content.Context);
    ctor public FrameLayout(@NonNull android.content.Context, @Nullable android.util.AttributeSet);
    ctor public FrameLayout(@NonNull android.content.Context, @Nullable android.util.AttributeSet, @AttrRes int);
    ctor public FrameLayout(@NonNull android.content.Context, @Nullable android.util.AttributeSet, @AttrRes int, @StyleRes int);
    method protected android.widget.FrameLayout.LayoutParams generateDefaultLayoutParams();
    method public android.widget.FrameLayout.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method @Deprecated public boolean getConsiderGoneChildrenWhenMeasuring();
    method public boolean getMeasureAllChildren();
    method public void setMeasureAllChildren(boolean);
  }

  public static class FrameLayout.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
    ctor public FrameLayout.LayoutParams(@NonNull android.content.Context, @Nullable android.util.AttributeSet);
    ctor public FrameLayout.LayoutParams(int, int);
    ctor public FrameLayout.LayoutParams(int, int, int);
    ctor public FrameLayout.LayoutParams(@NonNull android.view.ViewGroup.LayoutParams);
    ctor public FrameLayout.LayoutParams(@NonNull android.view.ViewGroup.MarginLayoutParams);
    ctor public FrameLayout.LayoutParams(@NonNull android.widget.FrameLayout.LayoutParams);
    field public static final int UNSPECIFIED_GRAVITY = -1; // 0xffffffff
    field public int gravity;
  }

  @Deprecated public class Gallery extends android.widget.AbsSpinner implements android.view.GestureDetector.OnGestureListener {
    ctor @Deprecated public Gallery(android.content.Context);
    ctor @Deprecated public Gallery(android.content.Context, android.util.AttributeSet);
    ctor @Deprecated public Gallery(android.content.Context, android.util.AttributeSet, int);
    ctor @Deprecated public Gallery(android.content.Context, android.util.AttributeSet, int, int);
    method @Deprecated public boolean onDown(android.view.MotionEvent);
    method @Deprecated public boolean onFling(android.view.MotionEvent, android.view.MotionEvent, float, float);
    method @Deprecated public void onLongPress(@NonNull android.view.MotionEvent);
    method @Deprecated public boolean onScroll(android.view.MotionEvent, android.view.MotionEvent, float, float);
    method @Deprecated public void onShowPress(android.view.MotionEvent);
    method @Deprecated public boolean onSingleTapUp(android.view.MotionEvent);
    method @Deprecated public void setAnimationDuration(int);
    method @Deprecated public void setCallbackDuringFling(boolean);
    method @Deprecated public void setGravity(int);
    method @Deprecated public void setSpacing(int);
    method @Deprecated public void setUnselectedAlpha(float);
  }

  @Deprecated public static class Gallery.LayoutParams extends android.view.ViewGroup.LayoutParams {
    ctor @Deprecated public Gallery.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor @Deprecated public Gallery.LayoutParams(int, int);
    ctor @Deprecated public Gallery.LayoutParams(android.view.ViewGroup.LayoutParams);
  }

  @android.widget.RemoteViews.RemoteView public class GridLayout extends android.view.ViewGroup {
    ctor public GridLayout(android.content.Context);
    ctor public GridLayout(android.content.Context, android.util.AttributeSet);
    ctor public GridLayout(android.content.Context, android.util.AttributeSet, int);
    ctor public GridLayout(android.content.Context, android.util.AttributeSet, int, int);
    method protected android.widget.GridLayout.LayoutParams generateDefaultLayoutParams();
    method public android.widget.GridLayout.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method protected android.widget.GridLayout.LayoutParams generateLayoutParams(android.view.ViewGroup.LayoutParams);
    method public int getAlignmentMode();
    method public int getColumnCount();
    method public int getOrientation();
    method public int getRowCount();
    method public boolean getUseDefaultMargins();
    method public boolean isColumnOrderPreserved();
    method public boolean isRowOrderPreserved();
    method public void setAlignmentMode(int);
    method public void setColumnCount(int);
    method public void setColumnOrderPreserved(boolean);
    method public void setOrientation(int);
    method public void setRowCount(int);
    method public void setRowOrderPreserved(boolean);
    method public void setUseDefaultMargins(boolean);
    method public static android.widget.GridLayout.Spec spec(int, int, android.widget.GridLayout.Alignment, float);
    method public static android.widget.GridLayout.Spec spec(int, android.widget.GridLayout.Alignment, float);
    method public static android.widget.GridLayout.Spec spec(int, int, float);
    method public static android.widget.GridLayout.Spec spec(int, float);
    method public static android.widget.GridLayout.Spec spec(int, int, android.widget.GridLayout.Alignment);
    method public static android.widget.GridLayout.Spec spec(int, android.widget.GridLayout.Alignment);
    method public static android.widget.GridLayout.Spec spec(int, int);
    method public static android.widget.GridLayout.Spec spec(int);
    field public static final int ALIGN_BOUNDS = 0; // 0x0
    field public static final int ALIGN_MARGINS = 1; // 0x1
    field public static final android.widget.GridLayout.Alignment BASELINE;
    field public static final android.widget.GridLayout.Alignment BOTTOM;
    field public static final android.widget.GridLayout.Alignment CENTER;
    field public static final android.widget.GridLayout.Alignment END;
    field public static final android.widget.GridLayout.Alignment FILL;
    field public static final int HORIZONTAL = 0; // 0x0
    field public static final android.widget.GridLayout.Alignment LEFT;
    field public static final android.widget.GridLayout.Alignment RIGHT;
    field public static final android.widget.GridLayout.Alignment START;
    field public static final android.widget.GridLayout.Alignment TOP;
    field public static final int UNDEFINED = -2147483648; // 0x80000000
    field public static final int VERTICAL = 1; // 0x1
  }

  public abstract static class GridLayout.Alignment {
  }

  public static class GridLayout.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
    ctor public GridLayout.LayoutParams(android.widget.GridLayout.Spec, android.widget.GridLayout.Spec);
    ctor public GridLayout.LayoutParams();
    ctor public GridLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
    ctor public GridLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
    ctor public GridLayout.LayoutParams(android.widget.GridLayout.LayoutParams);
    ctor public GridLayout.LayoutParams(android.content.Context, android.util.AttributeSet);
    method public void setGravity(int);
    field public android.widget.GridLayout.Spec columnSpec;
    field public android.widget.GridLayout.Spec rowSpec;
  }

  public static class GridLayout.Spec {
  }

  @android.widget.RemoteViews.RemoteView public class GridView extends android.widget.AbsListView {
    ctor public GridView(android.content.Context);
    ctor public GridView(android.content.Context, android.util.AttributeSet);
    ctor public GridView(android.content.Context, android.util.AttributeSet, int);
    ctor public GridView(android.content.Context, android.util.AttributeSet, int, int);
    method public android.widget.ListAdapter getAdapter();
    method public int getColumnWidth();
    method public int getGravity();
    method public int getHorizontalSpacing();
    method @android.view.ViewDebug.ExportedProperty public int getNumColumns();
    method public int getRequestedColumnWidth();
    method public int getRequestedHorizontalSpacing();
    method public int getStretchMode();
    method public int getVerticalSpacing();
    method public void setColumnWidth(int);
    method public void setGravity(int);
    method public void setHorizontalSpacing(int);
    method public void setNumColumns(int);
    method public void setSelection(int);
    method public void setStretchMode(int);
    method public void setVerticalSpacing(int);
    method public void smoothScrollByOffset(int);
    field public static final int AUTO_FIT = -1; // 0xffffffff
    field public static final int NO_STRETCH = 0; // 0x0
    field public static final int STRETCH_COLUMN_WIDTH = 2; // 0x2
    field public static final int STRETCH_SPACING = 1; // 0x1
    field public static final int STRETCH_SPACING_UNIFORM = 3; // 0x3
  }

  public class HeaderViewListAdapter implements android.widget.Filterable android.widget.WrapperListAdapter {
    ctor public HeaderViewListAdapter(java.util.ArrayList<android.widget.ListView.FixedViewInfo>, java.util.ArrayList<android.widget.ListView.FixedViewInfo>, android.widget.ListAdapter);
    method public boolean areAllItemsEnabled();
    method public int getCount();
    method public android.widget.Filter getFilter();
    method public int getFootersCount();
    method public int getHeadersCount();
    method public Object getItem(int);
    method public long getItemId(int);
    method public int getItemViewType(int);
    method public android.view.View getView(int, android.view.View, android.view.ViewGroup);
    method public int getViewTypeCount();
    method public android.widget.ListAdapter getWrappedAdapter();
    method public boolean hasStableIds();
    method public boolean isEmpty();
    method public boolean isEnabled(int);
    method public void registerDataSetObserver(android.database.DataSetObserver);
    method public boolean removeFooter(android.view.View);
    method public boolean removeHeader(android.view.View);
    method public void unregisterDataSetObserver(android.database.DataSetObserver);
  }

  public interface HeterogeneousExpandableList {
    method public int getChildType(int, int);
    method public int getChildTypeCount();
    method public int getGroupType(int);
    method public int getGroupTypeCount();
  }

  public class HorizontalScrollView extends android.widget.FrameLayout {
    ctor public HorizontalScrollView(android.content.Context);
    ctor public HorizontalScrollView(android.content.Context, android.util.AttributeSet);
    ctor public HorizontalScrollView(android.content.Context, android.util.AttributeSet, int);
    ctor public HorizontalScrollView(android.content.Context, android.util.AttributeSet, int, int);
    method public boolean arrowScroll(int);
    method protected int computeScrollDeltaToGetChildRectOnScreen(android.graphics.Rect);
    method public boolean executeKeyEvent(android.view.KeyEvent);
    method public void fling(int);
    method public boolean fullScroll(int);
    method public int getMaxScrollAmount();
    method public boolean isFillViewport();
    method public boolean isSmoothScrollingEnabled();
    method public boolean pageScroll(int);
    method public void setFillViewport(boolean);
    method public void setSmoothScrollingEnabled(boolean);
    method public final void smoothScrollBy(int, int);
    method public final void smoothScrollTo(int, int);
  }

  @android.widget.RemoteViews.RemoteView public class ImageButton extends android.widget.ImageView {
    ctor public ImageButton(android.content.Context);
    ctor public ImageButton(android.content.Context, android.util.AttributeSet);
    ctor public ImageButton(android.content.Context, android.util.AttributeSet, int);
    ctor public ImageButton(android.content.Context, android.util.AttributeSet, int, int);
  }

  public class ImageSwitcher extends android.widget.ViewSwitcher {
    ctor public ImageSwitcher(android.content.Context);
    ctor public ImageSwitcher(android.content.Context, android.util.AttributeSet);
    method public void setImageDrawable(android.graphics.drawable.Drawable);
    method public void setImageResource(@DrawableRes int);
    method public void setImageURI(android.net.Uri);
  }

  @android.widget.RemoteViews.RemoteView public class ImageView extends android.view.View {
    ctor public ImageView(android.content.Context);
    ctor public ImageView(android.content.Context, @Nullable android.util.AttributeSet);
    ctor public ImageView(android.content.Context, @Nullable android.util.AttributeSet, int);
    ctor public ImageView(android.content.Context, @Nullable android.util.AttributeSet, int, int);
    method public final void clearColorFilter();
    method public boolean getAdjustViewBounds();
    method public boolean getBaselineAlignBottom();
    method public android.graphics.ColorFilter getColorFilter();
    method public boolean getCropToPadding();
    method public android.graphics.drawable.Drawable getDrawable();
    method public int getImageAlpha();
    method public android.graphics.Matrix getImageMatrix();
    method @Nullable public android.content.res.ColorStateList getImageTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getImageTintMode();
    method public int getMaxHeight();
    method public int getMaxWidth();
    method public android.widget.ImageView.ScaleType getScaleType();
    method public int[] onCreateDrawableState(int);
    method public void setAdjustViewBounds(boolean);
    method @Deprecated public void setAlpha(int);
    method public void setBaseline(int);
    method public void setBaselineAlignBottom(boolean);
    method public final void setColorFilter(int, android.graphics.PorterDuff.Mode);
    method public final void setColorFilter(int);
    method public void setColorFilter(android.graphics.ColorFilter);
    method public void setCropToPadding(boolean);
    method protected boolean setFrame(int, int, int, int);
    method public void setImageAlpha(int);
    method public void setImageBitmap(android.graphics.Bitmap);
    method public void setImageDrawable(@Nullable android.graphics.drawable.Drawable);
    method public void setImageIcon(@Nullable android.graphics.drawable.Icon);
    method public void setImageLevel(int);
    method public void setImageMatrix(android.graphics.Matrix);
    method public void setImageResource(@DrawableRes int);
    method public void setImageState(int[], boolean);
    method public void setImageTintList(@Nullable android.content.res.ColorStateList);
    method public void setImageTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public void setImageURI(@Nullable android.net.Uri);
    method public void setMaxHeight(int);
    method public void setMaxWidth(int);
    method public void setScaleType(android.widget.ImageView.ScaleType);
  }

  public enum ImageView.ScaleType {
    enum_constant public static final android.widget.ImageView.ScaleType CENTER;
    enum_constant public static final android.widget.ImageView.ScaleType CENTER_CROP;
    enum_constant public static final android.widget.ImageView.ScaleType CENTER_INSIDE;
    enum_constant public static final android.widget.ImageView.ScaleType FIT_CENTER;
    enum_constant public static final android.widget.ImageView.ScaleType FIT_END;
    enum_constant public static final android.widget.ImageView.ScaleType FIT_START;
    enum_constant public static final android.widget.ImageView.ScaleType FIT_XY;
    enum_constant public static final android.widget.ImageView.ScaleType MATRIX;
  }

  @android.widget.RemoteViews.RemoteView public class LinearLayout extends android.view.ViewGroup {
    ctor public LinearLayout(android.content.Context);
    ctor public LinearLayout(android.content.Context, @Nullable android.util.AttributeSet);
    ctor public LinearLayout(android.content.Context, @Nullable android.util.AttributeSet, int);
    ctor public LinearLayout(android.content.Context, android.util.AttributeSet, int, int);
    method protected android.widget.LinearLayout.LayoutParams generateDefaultLayoutParams();
    method public android.widget.LinearLayout.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method protected android.widget.LinearLayout.LayoutParams generateLayoutParams(android.view.ViewGroup.LayoutParams);
    method public int getBaselineAlignedChildIndex();
    method public android.graphics.drawable.Drawable getDividerDrawable();
    method public int getDividerPadding();
    method public int getGravity();
    method public int getOrientation();
    method public int getShowDividers();
    method public float getWeightSum();
    method public boolean isBaselineAligned();
    method public boolean isMeasureWithLargestChildEnabled();
    method public void setBaselineAligned(boolean);
    method public void setBaselineAlignedChildIndex(int);
    method public void setDividerDrawable(android.graphics.drawable.Drawable);
    method public void setDividerPadding(int);
    method public void setGravity(int);
    method public void setHorizontalGravity(int);
    method public void setMeasureWithLargestChildEnabled(boolean);
    method public void setOrientation(int);
    method public void setShowDividers(int);
    method public void setVerticalGravity(int);
    method public void setWeightSum(float);
    field public static final int HORIZONTAL = 0; // 0x0
    field public static final int SHOW_DIVIDER_BEGINNING = 1; // 0x1
    field public static final int SHOW_DIVIDER_END = 4; // 0x4
    field public static final int SHOW_DIVIDER_MIDDLE = 2; // 0x2
    field public static final int SHOW_DIVIDER_NONE = 0; // 0x0
    field public static final int VERTICAL = 1; // 0x1
  }

  public static class LinearLayout.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
    ctor public LinearLayout.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public LinearLayout.LayoutParams(int, int);
    ctor public LinearLayout.LayoutParams(int, int, float);
    ctor public LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
    ctor public LinearLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
    ctor public LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams);
    method public String debug(String);
    field @android.view.ViewDebug.ExportedProperty(category="layout", mapping={@android.view.ViewDebug.IntToString(from=0xffffffff, to="NONE"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.NO_GRAVITY, to="NONE"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.TOP, to="TOP"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.BOTTOM, to="BOTTOM"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.LEFT, to="LEFT"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.RIGHT, to="RIGHT"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.START, to="START"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.END, to="END"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.CENTER_VERTICAL, to="CENTER_VERTICAL"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.FILL_VERTICAL, to="FILL_VERTICAL"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.CENTER_HORIZONTAL, to="CENTER_HORIZONTAL"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.FILL_HORIZONTAL, to="FILL_HORIZONTAL"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.CENTER, to="CENTER"), @android.view.ViewDebug.IntToString(from=android.view.Gravity.FILL, to="FILL")}) public int gravity;
    field @android.view.ViewDebug.ExportedProperty(category="layout") public float weight;
  }

  public interface ListAdapter extends android.widget.Adapter {
    method public boolean areAllItemsEnabled();
    method public boolean isEnabled(int);
  }

  public class ListPopupWindow {
    ctor public ListPopupWindow(@NonNull android.content.Context);
    ctor public ListPopupWindow(@NonNull android.content.Context, @Nullable android.util.AttributeSet);
    ctor public ListPopupWindow(@NonNull android.content.Context, @Nullable android.util.AttributeSet, @AttrRes int);
    ctor public ListPopupWindow(@NonNull android.content.Context, @Nullable android.util.AttributeSet, @AttrRes int, @StyleRes int);
    method public void clearListSelection();
    method public android.view.View.OnTouchListener createDragToOpenListener(android.view.View);
    method public void dismiss();
    method @Nullable public android.view.View getAnchorView();
    method @StyleRes public int getAnimationStyle();
    method @Nullable public android.graphics.drawable.Drawable getBackground();
    method public int getHeight();
    method public int getHorizontalOffset();
    method public int getInputMethodMode();
    method @Nullable public android.widget.ListView getListView();
    method public int getPromptPosition();
    method @Nullable public Object getSelectedItem();
    method public long getSelectedItemId();
    method public int getSelectedItemPosition();
    method @Nullable public android.view.View getSelectedView();
    method public int getSoftInputMode();
    method public int getVerticalOffset();
    method public int getWidth();
    method public boolean isInputMethodNotNeeded();
    method public boolean isModal();
    method public boolean isShowing();
    method public boolean onKeyDown(int, @NonNull android.view.KeyEvent);
    method public boolean onKeyPreIme(int, @NonNull android.view.KeyEvent);
    method public boolean onKeyUp(int, @NonNull android.view.KeyEvent);
    method public boolean performItemClick(int);
    method public void postShow();
    method public void setAdapter(@Nullable android.widget.ListAdapter);
    method public void setAnchorView(@Nullable android.view.View);
    method public void setAnimationStyle(@StyleRes int);
    method public void setBackgroundDrawable(@Nullable android.graphics.drawable.Drawable);
    method public void setContentWidth(int);
    method public void setDropDownGravity(int);
    method public void setHeight(int);
    method public void setHorizontalOffset(int);
    method public void setInputMethodMode(int);
    method public void setListSelector(android.graphics.drawable.Drawable);
    method public void setModal(boolean);
    method public void setOnDismissListener(@Nullable android.widget.PopupWindow.OnDismissListener);
    method public void setOnItemClickListener(@Nullable android.widget.AdapterView.OnItemClickListener);
    method public void setOnItemSelectedListener(@Nullable android.widget.AdapterView.OnItemSelectedListener);
    method public void setPromptPosition(int);
    method public void setPromptView(@Nullable android.view.View);
    method public void setSelection(int);
    method public void setSoftInputMode(int);
    method public void setVerticalOffset(int);
    method public void setWidth(int);
    method public void setWindowLayoutType(int);
    method public void show();
    field public static final int INPUT_METHOD_FROM_FOCUSABLE = 0; // 0x0
    field public static final int INPUT_METHOD_NEEDED = 1; // 0x1
    field public static final int INPUT_METHOD_NOT_NEEDED = 2; // 0x2
    field public static final int MATCH_PARENT = -1; // 0xffffffff
    field public static final int POSITION_PROMPT_ABOVE = 0; // 0x0
    field public static final int POSITION_PROMPT_BELOW = 1; // 0x1
    field public static final int WRAP_CONTENT = -2; // 0xfffffffe
  }

  @android.widget.RemoteViews.RemoteView public class ListView extends android.widget.AbsListView {
    ctor public ListView(android.content.Context);
    ctor public ListView(android.content.Context, android.util.AttributeSet);
    ctor public ListView(android.content.Context, android.util.AttributeSet, int);
    ctor public ListView(android.content.Context, android.util.AttributeSet, int, int);
    method public void addFooterView(android.view.View, Object, boolean);
    method public void addFooterView(android.view.View);
    method public void addHeaderView(android.view.View, Object, boolean);
    method public void addHeaderView(android.view.View);
    method public boolean areFooterDividersEnabled();
    method public boolean areHeaderDividersEnabled();
    method public android.widget.ListAdapter getAdapter();
    method @Deprecated public long[] getCheckItemIds();
    method @Nullable public android.graphics.drawable.Drawable getDivider();
    method public int getDividerHeight();
    method public int getFooterViewsCount();
    method public int getHeaderViewsCount();
    method public boolean getItemsCanFocus();
    method public int getMaxScrollAmount();
    method public android.graphics.drawable.Drawable getOverscrollFooter();
    method public android.graphics.drawable.Drawable getOverscrollHeader();
    method public boolean removeFooterView(android.view.View);
    method public boolean removeHeaderView(android.view.View);
    method public void setDivider(@Nullable android.graphics.drawable.Drawable);
    method public void setDividerHeight(int);
    method public void setFooterDividersEnabled(boolean);
    method public void setHeaderDividersEnabled(boolean);
    method public void setItemsCanFocus(boolean);
    method public void setOverscrollFooter(android.graphics.drawable.Drawable);
    method public void setOverscrollHeader(android.graphics.drawable.Drawable);
    method public void setSelection(int);
    method public void setSelectionAfterHeaderView();
    method public void smoothScrollByOffset(int);
  }

  public class ListView.FixedViewInfo {
    ctor public ListView.FixedViewInfo();
    field public Object data;
    field public boolean isSelectable;
    field public android.view.View view;
  }

  @UiThread public final class Magnifier {
    ctor public Magnifier(@NonNull android.view.View);
    method public void dismiss();
    method public int getHeight();
    method public int getWidth();
    method public float getZoom();
    method public void show(@FloatRange(from=0) float, @FloatRange(from=0) float);
    method public void update();
  }

  public class MediaController extends android.widget.FrameLayout {
    ctor public MediaController(android.content.Context, android.util.AttributeSet);
    ctor public MediaController(android.content.Context, boolean);
    ctor public MediaController(android.content.Context);
    method public void hide();
    method public boolean isShowing();
    method public void onFinishInflate();
    method public void setAnchorView(android.view.View);
    method public void setMediaPlayer(android.widget.MediaController.MediaPlayerControl);
    method public void setPrevNextListeners(android.view.View.OnClickListener, android.view.View.OnClickListener);
    method public void show();
    method public void show(int);
  }

  public static interface MediaController.MediaPlayerControl {
    method public boolean canPause();
    method public boolean canSeekBackward();
    method public boolean canSeekForward();
    method public int getAudioSessionId();
    method public int getBufferPercentage();
    method public int getCurrentPosition();
    method public int getDuration();
    method public boolean isPlaying();
    method public void pause();
    method public void seekTo(int);
    method public void start();
  }

  public class MultiAutoCompleteTextView extends android.widget.AutoCompleteTextView {
    ctor public MultiAutoCompleteTextView(android.content.Context);
    ctor public MultiAutoCompleteTextView(android.content.Context, android.util.AttributeSet);
    ctor public MultiAutoCompleteTextView(android.content.Context, android.util.AttributeSet, int);
    ctor public MultiAutoCompleteTextView(android.content.Context, android.util.AttributeSet, int, int);
    method protected void performFiltering(CharSequence, int, int, int);
    method public void setTokenizer(android.widget.MultiAutoCompleteTextView.Tokenizer);
  }

  public static class MultiAutoCompleteTextView.CommaTokenizer implements android.widget.MultiAutoCompleteTextView.Tokenizer {
    ctor public MultiAutoCompleteTextView.CommaTokenizer();
    method public int findTokenEnd(CharSequence, int);
    method public int findTokenStart(CharSequence, int);
    method public CharSequence terminateToken(CharSequence);
  }

  public static interface MultiAutoCompleteTextView.Tokenizer {
    method public int findTokenEnd(CharSequence, int);
    method public int findTokenStart(CharSequence, int);
    method public CharSequence terminateToken(CharSequence);
  }

  public class NumberPicker extends android.widget.LinearLayout {
    ctor public NumberPicker(android.content.Context);
    ctor public NumberPicker(android.content.Context, android.util.AttributeSet);
    ctor public NumberPicker(android.content.Context, android.util.AttributeSet, int);
    ctor public NumberPicker(android.content.Context, android.util.AttributeSet, int, int);
    method public String[] getDisplayedValues();
    method public int getMaxValue();
    method public int getMinValue();
    method public int getValue();
    method public boolean getWrapSelectorWheel();
    method public void setDisplayedValues(String[]);
    method public void setFormatter(android.widget.NumberPicker.Formatter);
    method public void setMaxValue(int);
    method public void setMinValue(int);
    method public void setOnLongPressUpdateInterval(long);
    method public void setOnScrollListener(android.widget.NumberPicker.OnScrollListener);
    method public void setOnValueChangedListener(android.widget.NumberPicker.OnValueChangeListener);
    method public void setValue(int);
    method public void setWrapSelectorWheel(boolean);
  }

  public static interface NumberPicker.Formatter {
    method public String format(int);
  }

  public static interface NumberPicker.OnScrollListener {
    method public void onScrollStateChange(android.widget.NumberPicker, int);
    field public static final int SCROLL_STATE_FLING = 2; // 0x2
    field public static final int SCROLL_STATE_IDLE = 0; // 0x0
    field public static final int SCROLL_STATE_TOUCH_SCROLL = 1; // 0x1
  }

  public static interface NumberPicker.OnValueChangeListener {
    method public void onValueChange(android.widget.NumberPicker, int, int);
  }

  public class OverScroller {
    ctor public OverScroller(android.content.Context);
    ctor public OverScroller(android.content.Context, android.view.animation.Interpolator);
    ctor @Deprecated public OverScroller(android.content.Context, android.view.animation.Interpolator, float, float);
    ctor @Deprecated public OverScroller(android.content.Context, android.view.animation.Interpolator, float, float, boolean);
    method public void abortAnimation();
    method public boolean computeScrollOffset();
    method public void fling(int, int, int, int, int, int, int, int);
    method public void fling(int, int, int, int, int, int, int, int, int, int);
    method public final void forceFinished(boolean);
    method public float getCurrVelocity();
    method public final int getCurrX();
    method public final int getCurrY();
    method public final int getFinalX();
    method public final int getFinalY();
    method public final int getStartX();
    method public final int getStartY();
    method public final boolean isFinished();
    method public boolean isOverScrolled();
    method public void notifyHorizontalEdgeReached(int, int, int);
    method public void notifyVerticalEdgeReached(int, int, int);
    method public final void setFriction(float);
    method public boolean springBack(int, int, int, int, int, int);
    method public void startScroll(int, int, int, int);
    method public void startScroll(int, int, int, int, int);
  }

  public class PopupMenu {
    ctor public PopupMenu(android.content.Context, android.view.View);
    ctor public PopupMenu(android.content.Context, android.view.View, int);
    ctor public PopupMenu(android.content.Context, android.view.View, int, int, int);
    method public void dismiss();
    method public android.view.View.OnTouchListener getDragToOpenListener();
    method public int getGravity();
    method public android.view.Menu getMenu();
    method public android.view.MenuInflater getMenuInflater();
    method public void inflate(@MenuRes int);
    method public void setGravity(int);
    method public void setOnDismissListener(android.widget.PopupMenu.OnDismissListener);
    method public void setOnMenuItemClickListener(android.widget.PopupMenu.OnMenuItemClickListener);
    method public void show();
  }

  public static interface PopupMenu.OnDismissListener {
    method public void onDismiss(android.widget.PopupMenu);
  }

  public static interface PopupMenu.OnMenuItemClickListener {
    method public boolean onMenuItemClick(android.view.MenuItem);
  }

  public class PopupWindow {
    ctor public PopupWindow(android.content.Context);
    ctor public PopupWindow(android.content.Context, android.util.AttributeSet);
    ctor public PopupWindow(android.content.Context, android.util.AttributeSet, int);
    ctor public PopupWindow(android.content.Context, android.util.AttributeSet, int, int);
    ctor public PopupWindow();
    ctor public PopupWindow(android.view.View);
    ctor public PopupWindow(int, int);
    ctor public PopupWindow(android.view.View, int, int);
    ctor public PopupWindow(android.view.View, int, int, boolean);
    method public void dismiss();
    method public int getAnimationStyle();
    method public android.graphics.drawable.Drawable getBackground();
    method public android.view.View getContentView();
    method public float getElevation();
    method @Nullable public android.transition.Transition getEnterTransition();
    method @Nullable public android.transition.Transition getExitTransition();
    method public int getHeight();
    method public int getInputMethodMode();
    method public int getMaxAvailableHeight(@NonNull android.view.View);
    method public int getMaxAvailableHeight(@NonNull android.view.View, int);
    method public int getMaxAvailableHeight(@NonNull android.view.View, int, boolean);
    method public boolean getOverlapAnchor();
    method public int getSoftInputMode();
    method public int getWidth();
    method public int getWindowLayoutType();
    method public boolean isAboveAnchor();
    method public boolean isAttachedInDecor();
    method public boolean isClippingEnabled();
    method public boolean isFocusable();
    method public boolean isOutsideTouchable();
    method public boolean isShowing();
    method public boolean isSplitTouchEnabled();
    method public boolean isTouchable();
    method public void setAnimationStyle(int);
    method public void setAttachedInDecor(boolean);
    method public void setBackgroundDrawable(android.graphics.drawable.Drawable);
    method public void setClippingEnabled(boolean);
    method public void setContentView(android.view.View);
    method public void setElevation(float);
    method public void setEnterTransition(@Nullable android.transition.Transition);
    method public void setExitTransition(@Nullable android.transition.Transition);
    method public void setFocusable(boolean);
    method public void setHeight(int);
    method public void setIgnoreCheekPress();
    method public void setInputMethodMode(int);
    method public void setOnDismissListener(android.widget.PopupWindow.OnDismissListener);
    method public void setOutsideTouchable(boolean);
    method public void setOverlapAnchor(boolean);
    method public void setSoftInputMode(int);
    method public void setSplitTouchEnabled(boolean);
    method public void setTouchInterceptor(android.view.View.OnTouchListener);
    method public void setTouchable(boolean);
    method public void setWidth(int);
    method @Deprecated public void setWindowLayoutMode(int, int);
    method public void setWindowLayoutType(int);
    method public void showAsDropDown(android.view.View);
    method public void showAsDropDown(android.view.View, int, int);
    method public void showAsDropDown(android.view.View, int, int, int);
    method public void showAtLocation(android.view.View, int, int, int);
    method public void update();
    method public void update(int, int);
    method public void update(int, int, int, int);
    method public void update(int, int, int, int, boolean);
    method public void update(android.view.View, int, int);
    method public void update(android.view.View, int, int, int, int);
    field public static final int INPUT_METHOD_FROM_FOCUSABLE = 0; // 0x0
    field public static final int INPUT_METHOD_NEEDED = 1; // 0x1
    field public static final int INPUT_METHOD_NOT_NEEDED = 2; // 0x2
  }

  public static interface PopupWindow.OnDismissListener {
    method public void onDismiss();
  }

  @android.widget.RemoteViews.RemoteView public class ProgressBar extends android.view.View {
    ctor public ProgressBar(android.content.Context);
    ctor public ProgressBar(android.content.Context, android.util.AttributeSet);
    ctor public ProgressBar(android.content.Context, android.util.AttributeSet, int);
    ctor public ProgressBar(android.content.Context, android.util.AttributeSet, int, int);
    method public android.graphics.drawable.Drawable getIndeterminateDrawable();
    method @Nullable public android.content.res.ColorStateList getIndeterminateTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getIndeterminateTintMode();
    method public android.view.animation.Interpolator getInterpolator();
    method @android.view.ViewDebug.ExportedProperty(category="progress") public int getMax();
    method @android.view.ViewDebug.ExportedProperty(category="progress") public int getMin();
    method @android.view.ViewDebug.ExportedProperty(category="progress") public int getProgress();
    method @Nullable public android.content.res.ColorStateList getProgressBackgroundTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getProgressBackgroundTintMode();
    method public android.graphics.drawable.Drawable getProgressDrawable();
    method @Nullable public android.content.res.ColorStateList getProgressTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getProgressTintMode();
    method @android.view.ViewDebug.ExportedProperty(category="progress") public int getSecondaryProgress();
    method @Nullable public android.content.res.ColorStateList getSecondaryProgressTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getSecondaryProgressTintMode();
    method public final void incrementProgressBy(int);
    method public final void incrementSecondaryProgressBy(int);
    method public boolean isAnimating();
    method @android.view.ViewDebug.ExportedProperty(category="progress") public boolean isIndeterminate();
    method public void onRestoreInstanceState(android.os.Parcelable);
    method public android.os.Parcelable onSaveInstanceState();
    method public void setIndeterminate(boolean);
    method public void setIndeterminateDrawable(android.graphics.drawable.Drawable);
    method public void setIndeterminateDrawableTiled(android.graphics.drawable.Drawable);
    method public void setIndeterminateTintList(@Nullable android.content.res.ColorStateList);
    method public void setIndeterminateTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public void setInterpolator(android.content.Context, @InterpolatorRes int);
    method public void setInterpolator(android.view.animation.Interpolator);
    method public void setMax(int);
    method public void setMin(int);
    method public void setProgress(int);
    method public void setProgress(int, boolean);
    method public void setProgressBackgroundTintList(@Nullable android.content.res.ColorStateList);
    method public void setProgressBackgroundTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public void setProgressDrawable(android.graphics.drawable.Drawable);
    method public void setProgressDrawableTiled(android.graphics.drawable.Drawable);
    method public void setProgressTintList(@Nullable android.content.res.ColorStateList);
    method public void setProgressTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public void setSecondaryProgress(int);
    method public void setSecondaryProgressTintList(@Nullable android.content.res.ColorStateList);
    method public void setSecondaryProgressTintMode(@Nullable android.graphics.PorterDuff.Mode);
  }

  public class QuickContactBadge extends android.widget.ImageView implements android.view.View.OnClickListener {
    ctor public QuickContactBadge(android.content.Context);
    ctor public QuickContactBadge(android.content.Context, android.util.AttributeSet);
    ctor public QuickContactBadge(android.content.Context, android.util.AttributeSet, int);
    ctor public QuickContactBadge(android.content.Context, android.util.AttributeSet, int, int);
    method public void assignContactFromEmail(String, boolean);
    method public void assignContactFromEmail(String, boolean, android.os.Bundle);
    method public void assignContactFromPhone(String, boolean);
    method public void assignContactFromPhone(String, boolean, android.os.Bundle);
    method public void assignContactUri(android.net.Uri);
    method public void onClick(android.view.View);
    method public void setExcludeMimes(String[]);
    method public void setImageToDefault();
    method public void setMode(int);
    method public void setOverlay(android.graphics.drawable.Drawable);
    method public void setPrioritizedMimeType(String);
    field protected String[] mExcludeMimes;
  }

  public class RadioButton extends android.widget.CompoundButton {
    ctor public RadioButton(android.content.Context);
    ctor public RadioButton(android.content.Context, android.util.AttributeSet);
    ctor public RadioButton(android.content.Context, android.util.AttributeSet, int);
    ctor public RadioButton(android.content.Context, android.util.AttributeSet, int, int);
  }

  public class RadioGroup extends android.widget.LinearLayout {
    ctor public RadioGroup(android.content.Context);
    ctor public RadioGroup(android.content.Context, android.util.AttributeSet);
    method public void check(@IdRes int);
    method public void clearCheck();
    method public android.widget.RadioGroup.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method @IdRes public int getCheckedRadioButtonId();
    method public void setOnCheckedChangeListener(android.widget.RadioGroup.OnCheckedChangeListener);
  }

  public static class RadioGroup.LayoutParams extends android.widget.LinearLayout.LayoutParams {
    ctor public RadioGroup.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public RadioGroup.LayoutParams(int, int);
    ctor public RadioGroup.LayoutParams(int, int, float);
    ctor public RadioGroup.LayoutParams(android.view.ViewGroup.LayoutParams);
    ctor public RadioGroup.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
  }

  public static interface RadioGroup.OnCheckedChangeListener {
    method public void onCheckedChanged(android.widget.RadioGroup, @IdRes int);
  }

  public class RatingBar extends android.widget.AbsSeekBar {
    ctor public RatingBar(android.content.Context, android.util.AttributeSet, int);
    ctor public RatingBar(android.content.Context, android.util.AttributeSet, int, int);
    ctor public RatingBar(android.content.Context, android.util.AttributeSet);
    ctor public RatingBar(android.content.Context);
    method public int getNumStars();
    method public android.widget.RatingBar.OnRatingBarChangeListener getOnRatingBarChangeListener();
    method public float getRating();
    method public float getStepSize();
    method public boolean isIndicator();
    method public void setIsIndicator(boolean);
    method public void setNumStars(int);
    method public void setOnRatingBarChangeListener(android.widget.RatingBar.OnRatingBarChangeListener);
    method public void setRating(float);
    method public void setStepSize(float);
  }

  public static interface RatingBar.OnRatingBarChangeListener {
    method public void onRatingChanged(android.widget.RatingBar, float, boolean);
  }

  @android.widget.RemoteViews.RemoteView public class RelativeLayout extends android.view.ViewGroup {
    ctor public RelativeLayout(android.content.Context);
    ctor public RelativeLayout(android.content.Context, android.util.AttributeSet);
    ctor public RelativeLayout(android.content.Context, android.util.AttributeSet, int);
    ctor public RelativeLayout(android.content.Context, android.util.AttributeSet, int, int);
    method public android.widget.RelativeLayout.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method public int getGravity();
    method public void setGravity(int);
    method public void setHorizontalGravity(int);
    method public void setIgnoreGravity(int);
    method public void setVerticalGravity(int);
    field public static final int ABOVE = 2; // 0x2
    field public static final int ALIGN_BASELINE = 4; // 0x4
    field public static final int ALIGN_BOTTOM = 8; // 0x8
    field public static final int ALIGN_END = 19; // 0x13
    field public static final int ALIGN_LEFT = 5; // 0x5
    field public static final int ALIGN_PARENT_BOTTOM = 12; // 0xc
    field public static final int ALIGN_PARENT_END = 21; // 0x15
    field public static final int ALIGN_PARENT_LEFT = 9; // 0x9
    field public static final int ALIGN_PARENT_RIGHT = 11; // 0xb
    field public static final int ALIGN_PARENT_START = 20; // 0x14
    field public static final int ALIGN_PARENT_TOP = 10; // 0xa
    field public static final int ALIGN_RIGHT = 7; // 0x7
    field public static final int ALIGN_START = 18; // 0x12
    field public static final int ALIGN_TOP = 6; // 0x6
    field public static final int BELOW = 3; // 0x3
    field public static final int CENTER_HORIZONTAL = 14; // 0xe
    field public static final int CENTER_IN_PARENT = 13; // 0xd
    field public static final int CENTER_VERTICAL = 15; // 0xf
    field public static final int END_OF = 17; // 0x11
    field public static final int LEFT_OF = 0; // 0x0
    field public static final int RIGHT_OF = 1; // 0x1
    field public static final int START_OF = 16; // 0x10
    field public static final int TRUE = -1; // 0xffffffff
  }

  public static class RelativeLayout.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
    ctor public RelativeLayout.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public RelativeLayout.LayoutParams(int, int);
    ctor public RelativeLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
    ctor public RelativeLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
    ctor public RelativeLayout.LayoutParams(android.widget.RelativeLayout.LayoutParams);
    method public void addRule(int);
    method public void addRule(int, int);
    method public String debug(String);
    method public int getRule(int);
    method public int[] getRules();
    method public void removeRule(int);
    field @android.view.ViewDebug.ExportedProperty(category="layout") public boolean alignWithParent;
  }

  public class RemoteViews implements android.view.LayoutInflater.Filter android.os.Parcelable {
    ctor public RemoteViews(String, int);
    ctor public RemoteViews(android.widget.RemoteViews, android.widget.RemoteViews);
    ctor public RemoteViews(android.widget.RemoteViews);
    ctor public RemoteViews(android.os.Parcel);
    method public void addView(int, android.widget.RemoteViews);
    method public android.view.View apply(android.content.Context, android.view.ViewGroup);
    method @Deprecated public android.widget.RemoteViews clone();
    method public int describeContents();
    method public int getLayoutId();
    method public String getPackage();
    method public boolean onLoadClass(Class);
    method public void reapply(android.content.Context, android.view.View);
    method public void removeAllViews(int);
    method public void setAccessibilityTraversalAfter(int, int);
    method public void setAccessibilityTraversalBefore(int, int);
    method public void setBitmap(int, String, android.graphics.Bitmap);
    method public void setBoolean(int, String, boolean);
    method public void setBundle(int, String, android.os.Bundle);
    method public void setByte(int, String, byte);
    method public void setChar(int, String, char);
    method public void setCharSequence(int, String, CharSequence);
    method public void setChronometer(int, long, String, boolean);
    method public void setChronometerCountDown(int, boolean);
    method public void setContentDescription(int, CharSequence);
    method public void setDisplayedChild(int, int);
    method public void setDouble(int, String, double);
    method public void setEmptyView(int, int);
    method public void setFloat(int, String, float);
    method public void setIcon(int, String, android.graphics.drawable.Icon);
    method public void setImageViewBitmap(int, android.graphics.Bitmap);
    method public void setImageViewIcon(int, android.graphics.drawable.Icon);
    method public void setImageViewResource(int, int);
    method public void setImageViewUri(int, android.net.Uri);
    method public void setInt(int, String, int);
    method public void setIntent(int, String, android.content.Intent);
    method public void setLabelFor(int, int);
    method public void setLong(int, String, long);
    method public void setOnClickFillInIntent(int, android.content.Intent);
    method public void setOnClickPendingIntent(int, android.app.PendingIntent);
    method public void setPendingIntentTemplate(int, android.app.PendingIntent);
    method public void setProgressBar(int, int, int, boolean);
    method public void setRelativeScrollPosition(int, int);
    method @Deprecated public void setRemoteAdapter(int, int, android.content.Intent);
    method public void setRemoteAdapter(int, android.content.Intent);
    method public void setScrollPosition(int, int);
    method public void setShort(int, String, short);
    method public void setString(int, String, String);
    method public void setTextColor(int, @ColorInt int);
    method public void setTextViewCompoundDrawables(int, int, int, int, int);
    method public void setTextViewCompoundDrawablesRelative(int, int, int, int, int);
    method public void setTextViewText(int, CharSequence);
    method public void setTextViewTextSize(int, int, float);
    method public void setUri(int, String, android.net.Uri);
    method public void setViewPadding(int, int, int, int, int);
    method public void setViewVisibility(int, int);
    method public void showNext(int);
    method public void showPrevious(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.widget.RemoteViews> CREATOR;
  }

  public static class RemoteViews.ActionException extends java.lang.RuntimeException {
    ctor public RemoteViews.ActionException(Exception);
    ctor public RemoteViews.ActionException(String);
  }

  @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public static @interface RemoteViews.RemoteView {
  }

  public abstract class RemoteViewsService extends android.app.Service {
    ctor public RemoteViewsService();
    method public android.os.IBinder onBind(android.content.Intent);
    method public abstract android.widget.RemoteViewsService.RemoteViewsFactory onGetViewFactory(android.content.Intent);
  }

  public static interface RemoteViewsService.RemoteViewsFactory {
    method public int getCount();
    method public long getItemId(int);
    method public android.widget.RemoteViews getLoadingView();
    method public android.widget.RemoteViews getViewAt(int);
    method public int getViewTypeCount();
    method public boolean hasStableIds();
    method public void onCreate();
    method public void onDataSetChanged();
    method public void onDestroy();
  }

  public abstract class ResourceCursorAdapter extends android.widget.CursorAdapter {
    ctor @Deprecated public ResourceCursorAdapter(android.content.Context, int, android.database.Cursor);
    ctor public ResourceCursorAdapter(android.content.Context, int, android.database.Cursor, boolean);
    ctor public ResourceCursorAdapter(android.content.Context, int, android.database.Cursor, int);
    method public android.view.View newView(android.content.Context, android.database.Cursor, android.view.ViewGroup);
    method public void setDropDownViewResource(int);
    method public void setViewResource(int);
  }

  public abstract class ResourceCursorTreeAdapter extends android.widget.CursorTreeAdapter {
    ctor public ResourceCursorTreeAdapter(android.content.Context, android.database.Cursor, int, int, int, int);
    ctor public ResourceCursorTreeAdapter(android.content.Context, android.database.Cursor, int, int, int);
    ctor public ResourceCursorTreeAdapter(android.content.Context, android.database.Cursor, int, int);
    method public android.view.View newChildView(android.content.Context, android.database.Cursor, boolean, android.view.ViewGroup);
    method public android.view.View newGroupView(android.content.Context, android.database.Cursor, boolean, android.view.ViewGroup);
  }

  public class ScrollView extends android.widget.FrameLayout {
    ctor public ScrollView(android.content.Context);
    ctor public ScrollView(android.content.Context, android.util.AttributeSet);
    ctor public ScrollView(android.content.Context, android.util.AttributeSet, int);
    ctor public ScrollView(android.content.Context, android.util.AttributeSet, int, int);
    method public boolean arrowScroll(int);
    method protected int computeScrollDeltaToGetChildRectOnScreen(android.graphics.Rect);
    method public boolean executeKeyEvent(android.view.KeyEvent);
    method public void fling(int);
    method public boolean fullScroll(int);
    method public int getMaxScrollAmount();
    method public boolean isFillViewport();
    method public boolean isSmoothScrollingEnabled();
    method public boolean pageScroll(int);
    method public void setFillViewport(boolean);
    method public void setSmoothScrollingEnabled(boolean);
    method public final void smoothScrollBy(int, int);
    method public final void smoothScrollTo(int, int);
  }

  public class Scroller {
    ctor public Scroller(android.content.Context);
    ctor public Scroller(android.content.Context, android.view.animation.Interpolator);
    ctor public Scroller(android.content.Context, android.view.animation.Interpolator, boolean);
    method public void abortAnimation();
    method public boolean computeScrollOffset();
    method public void extendDuration(int);
    method public void fling(int, int, int, int, int, int, int, int);
    method public final void forceFinished(boolean);
    method public float getCurrVelocity();
    method public final int getCurrX();
    method public final int getCurrY();
    method public final int getDuration();
    method public final int getFinalX();
    method public final int getFinalY();
    method public final int getStartX();
    method public final int getStartY();
    method public final boolean isFinished();
    method public void setFinalX(int);
    method public void setFinalY(int);
    method public final void setFriction(float);
    method public void startScroll(int, int, int, int);
    method public void startScroll(int, int, int, int, int);
    method public int timePassed();
  }

  public class SearchView extends android.widget.LinearLayout implements android.view.CollapsibleActionView {
    ctor public SearchView(android.content.Context);
    ctor public SearchView(android.content.Context, android.util.AttributeSet);
    ctor public SearchView(android.content.Context, android.util.AttributeSet, int);
    ctor public SearchView(android.content.Context, android.util.AttributeSet, int, int);
    method public int getImeOptions();
    method public int getInputType();
    method public int getMaxWidth();
    method public CharSequence getQuery();
    method @Nullable public CharSequence getQueryHint();
    method public android.widget.CursorAdapter getSuggestionsAdapter();
    method public boolean isIconfiedByDefault();
    method public boolean isIconified();
    method public boolean isQueryRefinementEnabled();
    method public boolean isSubmitButtonEnabled();
    method public void onActionViewCollapsed();
    method public void onActionViewExpanded();
    method public void setIconified(boolean);
    method public void setIconifiedByDefault(boolean);
    method public void setImeOptions(int);
    method public void setInputType(int);
    method public void setMaxWidth(int);
    method public void setOnCloseListener(android.widget.SearchView.OnCloseListener);
    method public void setOnQueryTextFocusChangeListener(android.view.View.OnFocusChangeListener);
    method public void setOnQueryTextListener(android.widget.SearchView.OnQueryTextListener);
    method public void setOnSearchClickListener(android.view.View.OnClickListener);
    method public void setOnSuggestionListener(android.widget.SearchView.OnSuggestionListener);
    method public void setQuery(CharSequence, boolean);
    method public void setQueryHint(@Nullable CharSequence);
    method public void setQueryRefinementEnabled(boolean);
    method public void setSearchableInfo(android.app.SearchableInfo);
    method public void setSubmitButtonEnabled(boolean);
    method public void setSuggestionsAdapter(android.widget.CursorAdapter);
  }

  public static interface SearchView.OnCloseListener {
    method public boolean onClose();
  }

  public static interface SearchView.OnQueryTextListener {
    method public boolean onQueryTextChange(String);
    method public boolean onQueryTextSubmit(String);
  }

  public static interface SearchView.OnSuggestionListener {
    method public boolean onSuggestionClick(int);
    method public boolean onSuggestionSelect(int);
  }

  public interface SectionIndexer {
    method public int getPositionForSection(int);
    method public int getSectionForPosition(int);
    method public Object[] getSections();
  }

  public class SeekBar extends android.widget.AbsSeekBar {
    ctor public SeekBar(android.content.Context);
    ctor public SeekBar(android.content.Context, android.util.AttributeSet);
    ctor public SeekBar(android.content.Context, android.util.AttributeSet, int);
    ctor public SeekBar(android.content.Context, android.util.AttributeSet, int, int);
    method public void setOnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener);
  }

  public static interface SeekBar.OnSeekBarChangeListener {
    method public void onProgressChanged(android.widget.SeekBar, int, boolean);
    method public void onStartTrackingTouch(android.widget.SeekBar);
    method public void onStopTrackingTouch(android.widget.SeekBar);
  }

  public class ShareActionProvider extends android.view.ActionProvider {
    ctor public ShareActionProvider(android.content.Context);
    method public android.view.View onCreateActionView();
    method public void setOnShareTargetSelectedListener(android.widget.ShareActionProvider.OnShareTargetSelectedListener);
    method public void setShareHistoryFileName(String);
    method public void setShareIntent(android.content.Intent);
    field public static final String DEFAULT_SHARE_HISTORY_FILE_NAME = "share_history.xml";
  }

  public static interface ShareActionProvider.OnShareTargetSelectedListener {
    method public boolean onShareTargetSelected(android.widget.ShareActionProvider, android.content.Intent);
  }

  public class SimpleAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.ThemedSpinnerAdapter {
    ctor public SimpleAdapter(android.content.Context, java.util.List<? extends java.util.Map<java.lang.String,?>>, @LayoutRes int, String[], @IdRes int[]);
    method public int getCount();
    method public android.content.res.Resources.Theme getDropDownViewTheme();
    method public android.widget.Filter getFilter();
    method public Object getItem(int);
    method public long getItemId(int);
    method public android.view.View getView(int, android.view.View, android.view.ViewGroup);
    method public android.widget.SimpleAdapter.ViewBinder getViewBinder();
    method public void setDropDownViewResource(int);
    method public void setDropDownViewTheme(android.content.res.Resources.Theme);
    method public void setViewBinder(android.widget.SimpleAdapter.ViewBinder);
    method public void setViewImage(android.widget.ImageView, int);
    method public void setViewImage(android.widget.ImageView, String);
    method public void setViewText(android.widget.TextView, String);
  }

  public static interface SimpleAdapter.ViewBinder {
    method public boolean setViewValue(android.view.View, Object, String);
  }

  public class SimpleCursorAdapter extends android.widget.ResourceCursorAdapter {
    ctor @Deprecated public SimpleCursorAdapter(android.content.Context, int, android.database.Cursor, String[], int[]);
    ctor public SimpleCursorAdapter(android.content.Context, int, android.database.Cursor, String[], int[], int);
    method public void bindView(android.view.View, android.content.Context, android.database.Cursor);
    method public void changeCursorAndColumns(android.database.Cursor, String[], int[]);
    method public android.widget.SimpleCursorAdapter.CursorToStringConverter getCursorToStringConverter();
    method public int getStringConversionColumn();
    method public android.widget.SimpleCursorAdapter.ViewBinder getViewBinder();
    method public void setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter);
    method public void setStringConversionColumn(int);
    method public void setViewBinder(android.widget.SimpleCursorAdapter.ViewBinder);
    method public void setViewImage(android.widget.ImageView, String);
    method public void setViewText(android.widget.TextView, String);
  }

  public static interface SimpleCursorAdapter.CursorToStringConverter {
    method public CharSequence convertToString(android.database.Cursor);
  }

  public static interface SimpleCursorAdapter.ViewBinder {
    method public boolean setViewValue(android.view.View, android.database.Cursor, int);
  }

  public abstract class SimpleCursorTreeAdapter extends android.widget.ResourceCursorTreeAdapter {
    ctor public SimpleCursorTreeAdapter(android.content.Context, android.database.Cursor, int, int, String[], int[], int, int, String[], int[]);
    ctor public SimpleCursorTreeAdapter(android.content.Context, android.database.Cursor, int, int, String[], int[], int, String[], int[]);
    ctor public SimpleCursorTreeAdapter(android.content.Context, android.database.Cursor, int, String[], int[], int, String[], int[]);
    method protected void bindChildView(android.view.View, android.content.Context, android.database.Cursor, boolean);
    method protected void bindGroupView(android.view.View, android.content.Context, android.database.Cursor, boolean);
    method public android.widget.SimpleCursorTreeAdapter.ViewBinder getViewBinder();
    method public void setViewBinder(android.widget.SimpleCursorTreeAdapter.ViewBinder);
    method protected void setViewImage(android.widget.ImageView, String);
    method public void setViewText(android.widget.TextView, String);
  }

  public static interface SimpleCursorTreeAdapter.ViewBinder {
    method public boolean setViewValue(android.view.View, android.database.Cursor, int);
  }

  public class SimpleExpandableListAdapter extends android.widget.BaseExpandableListAdapter {
    ctor public SimpleExpandableListAdapter(android.content.Context, java.util.List<? extends java.util.Map<java.lang.String,?>>, int, String[], int[], java.util.List<? extends java.util.List<? extends java.util.Map<java.lang.String,?>>>, int, String[], int[]);
    ctor public SimpleExpandableListAdapter(android.content.Context, java.util.List<? extends java.util.Map<java.lang.String,?>>, int, int, String[], int[], java.util.List<? extends java.util.List<? extends java.util.Map<java.lang.String,?>>>, int, String[], int[]);
    ctor public SimpleExpandableListAdapter(android.content.Context, java.util.List<? extends java.util.Map<java.lang.String,?>>, int, int, String[], int[], java.util.List<? extends java.util.List<? extends java.util.Map<java.lang.String,?>>>, int, int, String[], int[]);
    method public Object getChild(int, int);
    method public long getChildId(int, int);
    method public android.view.View getChildView(int, int, boolean, android.view.View, android.view.ViewGroup);
    method public int getChildrenCount(int);
    method public Object getGroup(int);
    method public int getGroupCount();
    method public long getGroupId(int);
    method public android.view.View getGroupView(int, boolean, android.view.View, android.view.ViewGroup);
    method public boolean hasStableIds();
    method public boolean isChildSelectable(int, int);
    method public android.view.View newChildView(boolean, android.view.ViewGroup);
    method public android.view.View newGroupView(boolean, android.view.ViewGroup);
  }

  @Deprecated public class SlidingDrawer extends android.view.ViewGroup {
    ctor @Deprecated public SlidingDrawer(android.content.Context, android.util.AttributeSet);
    ctor @Deprecated public SlidingDrawer(android.content.Context, android.util.AttributeSet, int);
    ctor @Deprecated public SlidingDrawer(android.content.Context, android.util.AttributeSet, int, int);
    method @Deprecated public void animateClose();
    method @Deprecated public void animateOpen();
    method @Deprecated public void animateToggle();
    method @Deprecated public void close();
    method @Deprecated public android.view.View getContent();
    method @Deprecated public android.view.View getHandle();
    method @Deprecated public boolean isMoving();
    method @Deprecated public boolean isOpened();
    method @Deprecated public void lock();
    method @Deprecated public void open();
    method @Deprecated public void setOnDrawerCloseListener(android.widget.SlidingDrawer.OnDrawerCloseListener);
    method @Deprecated public void setOnDrawerOpenListener(android.widget.SlidingDrawer.OnDrawerOpenListener);
    method @Deprecated public void setOnDrawerScrollListener(android.widget.SlidingDrawer.OnDrawerScrollListener);
    method @Deprecated public void toggle();
    method @Deprecated public void unlock();
    field @Deprecated public static final int ORIENTATION_HORIZONTAL = 0; // 0x0
    field @Deprecated public static final int ORIENTATION_VERTICAL = 1; // 0x1
  }

  @Deprecated public static interface SlidingDrawer.OnDrawerCloseListener {
    method @Deprecated public void onDrawerClosed();
  }

  @Deprecated public static interface SlidingDrawer.OnDrawerOpenListener {
    method @Deprecated public void onDrawerOpened();
  }

  @Deprecated public static interface SlidingDrawer.OnDrawerScrollListener {
    method @Deprecated public void onScrollEnded();
    method @Deprecated public void onScrollStarted();
  }

  public final class Space extends android.view.View {
    ctor public Space(android.content.Context, android.util.AttributeSet, int, int);
    ctor public Space(android.content.Context, android.util.AttributeSet, int);
    ctor public Space(android.content.Context, android.util.AttributeSet);
    ctor public Space(android.content.Context);
  }

  public class Spinner extends android.widget.AbsSpinner implements android.content.DialogInterface.OnClickListener {
    ctor public Spinner(android.content.Context);
    ctor public Spinner(android.content.Context, int);
    ctor public Spinner(android.content.Context, android.util.AttributeSet);
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int);
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int, int);
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int, int, int);
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int, int, int, android.content.res.Resources.Theme);
    method public int getDropDownHorizontalOffset();
    method public int getDropDownVerticalOffset();
    method public int getDropDownWidth();
    method public int getGravity();
    method public android.graphics.drawable.Drawable getPopupBackground();
    method public android.content.Context getPopupContext();
    method public CharSequence getPrompt();
    method public void onClick(android.content.DialogInterface, int);
    method public void setDropDownHorizontalOffset(int);
    method public void setDropDownVerticalOffset(int);
    method public void setDropDownWidth(int);
    method public void setGravity(int);
    method public void setPopupBackgroundDrawable(android.graphics.drawable.Drawable);
    method public void setPopupBackgroundResource(@DrawableRes int);
    method public void setPrompt(CharSequence);
    method public void setPromptId(int);
    field public static final int MODE_DIALOG = 0; // 0x0
    field public static final int MODE_DROPDOWN = 1; // 0x1
  }

  public interface SpinnerAdapter extends android.widget.Adapter {
    method public android.view.View getDropDownView(int, android.view.View, android.view.ViewGroup);
  }

  @android.widget.RemoteViews.RemoteView public class StackView extends android.widget.AdapterViewAnimator {
    ctor public StackView(android.content.Context);
    ctor public StackView(android.content.Context, android.util.AttributeSet);
    ctor public StackView(android.content.Context, android.util.AttributeSet, int);
    ctor public StackView(android.content.Context, android.util.AttributeSet, int, int);
  }

  public class Switch extends android.widget.CompoundButton {
    ctor public Switch(android.content.Context);
    ctor public Switch(android.content.Context, android.util.AttributeSet);
    ctor public Switch(android.content.Context, android.util.AttributeSet, int);
    ctor public Switch(android.content.Context, android.util.AttributeSet, int, int);
    method public boolean getShowText();
    method public boolean getSplitTrack();
    method public int getSwitchMinWidth();
    method public int getSwitchPadding();
    method public CharSequence getTextOff();
    method public CharSequence getTextOn();
    method public android.graphics.drawable.Drawable getThumbDrawable();
    method public int getThumbTextPadding();
    method @Nullable public android.content.res.ColorStateList getThumbTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getThumbTintMode();
    method public android.graphics.drawable.Drawable getTrackDrawable();
    method @Nullable public android.content.res.ColorStateList getTrackTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getTrackTintMode();
    method public void onMeasure(int, int);
    method public void setShowText(boolean);
    method public void setSplitTrack(boolean);
    method public void setSwitchMinWidth(int);
    method public void setSwitchPadding(int);
    method public void setSwitchTextAppearance(android.content.Context, @StyleRes int);
    method public void setSwitchTypeface(android.graphics.Typeface, int);
    method public void setSwitchTypeface(android.graphics.Typeface);
    method public void setTextOff(CharSequence);
    method public void setTextOn(CharSequence);
    method public void setThumbDrawable(android.graphics.drawable.Drawable);
    method public void setThumbResource(@DrawableRes int);
    method public void setThumbTextPadding(int);
    method public void setThumbTintList(@Nullable android.content.res.ColorStateList);
    method public void setThumbTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public void setTrackDrawable(android.graphics.drawable.Drawable);
    method public void setTrackResource(@DrawableRes int);
    method public void setTrackTintList(@Nullable android.content.res.ColorStateList);
    method public void setTrackTintMode(@Nullable android.graphics.PorterDuff.Mode);
  }

  public class TabHost extends android.widget.FrameLayout implements android.view.ViewTreeObserver.OnTouchModeChangeListener {
    ctor public TabHost(android.content.Context);
    ctor public TabHost(android.content.Context, android.util.AttributeSet);
    ctor public TabHost(android.content.Context, android.util.AttributeSet, int);
    ctor public TabHost(android.content.Context, android.util.AttributeSet, int, int);
    method public void addTab(android.widget.TabHost.TabSpec);
    method public void clearAllTabs();
    method @Nullable public int getCurrentTab();
    method @Nullable public String getCurrentTabTag();
    method @Nullable public android.view.View getCurrentTabView();
    method public android.view.View getCurrentView();
    method public android.widget.FrameLayout getTabContentView();
    method public android.widget.TabWidget getTabWidget();
    method @NonNull public android.widget.TabHost.TabSpec newTabSpec(@NonNull String);
    method public void onTouchModeChanged(boolean);
    method public void setCurrentTab(int);
    method public void setCurrentTabByTag(String);
    method public void setOnTabChangedListener(android.widget.TabHost.OnTabChangeListener);
    method public void setup();
    method public void setup(android.app.LocalActivityManager);
  }

  public static interface TabHost.OnTabChangeListener {
    method public void onTabChanged(String);
  }

  public static interface TabHost.TabContentFactory {
    method public android.view.View createTabContent(String);
  }

  public class TabHost.TabSpec {
    method @NonNull public String getTag();
    method public android.widget.TabHost.TabSpec setContent(int);
    method public android.widget.TabHost.TabSpec setContent(android.widget.TabHost.TabContentFactory);
    method public android.widget.TabHost.TabSpec setContent(android.content.Intent);
    method public android.widget.TabHost.TabSpec setIndicator(CharSequence);
    method public android.widget.TabHost.TabSpec setIndicator(CharSequence, android.graphics.drawable.Drawable);
    method public android.widget.TabHost.TabSpec setIndicator(android.view.View);
  }

  public class TabWidget extends android.widget.LinearLayout implements android.view.View.OnFocusChangeListener {
    ctor public TabWidget(android.content.Context);
    ctor public TabWidget(android.content.Context, android.util.AttributeSet);
    ctor public TabWidget(android.content.Context, android.util.AttributeSet, int);
    ctor public TabWidget(android.content.Context, android.util.AttributeSet, int, int);
    method public void dispatchDraw(android.graphics.Canvas);
    method public void focusCurrentTab(int);
    method public android.view.View getChildTabViewAt(int);
    method @Nullable public android.graphics.drawable.Drawable getLeftStripDrawable();
    method @Nullable public android.graphics.drawable.Drawable getRightStripDrawable();
    method public int getTabCount();
    method public boolean isStripEnabled();
    method public void onFocusChange(android.view.View, boolean);
    method public void setCurrentTab(int);
    method public void setDividerDrawable(@DrawableRes int);
    method public void setLeftStripDrawable(@Nullable android.graphics.drawable.Drawable);
    method public void setLeftStripDrawable(@DrawableRes int);
    method public void setRightStripDrawable(@Nullable android.graphics.drawable.Drawable);
    method public void setRightStripDrawable(@DrawableRes int);
    method public void setStripEnabled(boolean);
  }

  public class TableLayout extends android.widget.LinearLayout {
    ctor public TableLayout(android.content.Context);
    ctor public TableLayout(android.content.Context, android.util.AttributeSet);
    method public android.widget.TableLayout.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method public boolean isColumnCollapsed(int);
    method public boolean isColumnShrinkable(int);
    method public boolean isColumnStretchable(int);
    method public boolean isShrinkAllColumns();
    method public boolean isStretchAllColumns();
    method public void setColumnCollapsed(int, boolean);
    method public void setColumnShrinkable(int, boolean);
    method public void setColumnStretchable(int, boolean);
    method public void setShrinkAllColumns(boolean);
    method public void setStretchAllColumns(boolean);
  }

  public static class TableLayout.LayoutParams extends android.widget.LinearLayout.LayoutParams {
    ctor public TableLayout.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public TableLayout.LayoutParams(int, int);
    ctor public TableLayout.LayoutParams(int, int, float);
    ctor public TableLayout.LayoutParams();
    ctor public TableLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
    ctor public TableLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
  }

  public class TableRow extends android.widget.LinearLayout {
    ctor public TableRow(android.content.Context);
    ctor public TableRow(android.content.Context, android.util.AttributeSet);
    method public android.widget.TableRow.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method public android.view.View getVirtualChildAt(int);
    method public int getVirtualChildCount();
  }

  public static class TableRow.LayoutParams extends android.widget.LinearLayout.LayoutParams {
    ctor public TableRow.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public TableRow.LayoutParams(int, int);
    ctor public TableRow.LayoutParams(int, int, float);
    ctor public TableRow.LayoutParams();
    ctor public TableRow.LayoutParams(int);
    ctor public TableRow.LayoutParams(android.view.ViewGroup.LayoutParams);
    ctor public TableRow.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
    field @android.view.ViewDebug.ExportedProperty(category="layout") public int column;
    field @android.view.ViewDebug.ExportedProperty(category="layout") public int span;
  }

  @android.widget.RemoteViews.RemoteView public class TextClock extends android.widget.TextView {
    ctor public TextClock(android.content.Context);
    ctor public TextClock(android.content.Context, android.util.AttributeSet);
    ctor public TextClock(android.content.Context, android.util.AttributeSet, int);
    ctor public TextClock(android.content.Context, android.util.AttributeSet, int, int);
    method @android.view.ViewDebug.ExportedProperty public CharSequence getFormat12Hour();
    method @android.view.ViewDebug.ExportedProperty public CharSequence getFormat24Hour();
    method public String getTimeZone();
    method public boolean is24HourModeEnabled();
    method public void setFormat12Hour(CharSequence);
    method public void setFormat24Hour(CharSequence);
    method public void setTimeZone(String);
    field @Deprecated public static final CharSequence DEFAULT_FORMAT_12_HOUR;
    field @Deprecated public static final CharSequence DEFAULT_FORMAT_24_HOUR;
  }

  public class TextSwitcher extends android.widget.ViewSwitcher {
    ctor public TextSwitcher(android.content.Context);
    ctor public TextSwitcher(android.content.Context, android.util.AttributeSet);
    method public void setCurrentText(CharSequence);
    method public void setText(CharSequence);
  }

  @android.widget.RemoteViews.RemoteView public class TextView extends android.view.View implements android.view.ViewTreeObserver.OnPreDrawListener {
    ctor public TextView(android.content.Context);
    ctor public TextView(android.content.Context, @Nullable android.util.AttributeSet);
    ctor public TextView(android.content.Context, @Nullable android.util.AttributeSet, int);
    ctor public TextView(android.content.Context, @Nullable android.util.AttributeSet, int, int);
    method public void addTextChangedListener(android.text.TextWatcher);
    method public final void append(CharSequence);
    method public void append(CharSequence, int, int);
    method public void beginBatchEdit();
    method public boolean bringPointIntoView(int);
    method public void clearComposingText();
    method public void debug(int);
    method public boolean didTouchFocusSelect();
    method public void endBatchEdit();
    method public boolean extractText(android.view.inputmethod.ExtractedTextRequest, android.view.inputmethod.ExtractedText);
    method public final int getAutoLinkMask();
    method public int getAutoSizeMaxTextSize();
    method public int getAutoSizeMinTextSize();
    method public int getAutoSizeStepGranularity();
    method public int[] getAutoSizeTextAvailableSizes();
    method public int getAutoSizeTextType();
    method public int getBreakStrategy();
    method public int getCompoundDrawablePadding();
    method public android.content.res.ColorStateList getCompoundDrawableTintList();
    method public android.graphics.PorterDuff.Mode getCompoundDrawableTintMode();
    method @NonNull public android.graphics.drawable.Drawable[] getCompoundDrawables();
    method @NonNull public android.graphics.drawable.Drawable[] getCompoundDrawablesRelative();
    method public int getCompoundPaddingBottom();
    method public int getCompoundPaddingEnd();
    method public int getCompoundPaddingLeft();
    method public int getCompoundPaddingRight();
    method public int getCompoundPaddingStart();
    method public int getCompoundPaddingTop();
    method @ColorInt public final int getCurrentHintTextColor();
    method @ColorInt public final int getCurrentTextColor();
    method public android.view.ActionMode.Callback getCustomInsertionActionModeCallback();
    method public android.view.ActionMode.Callback getCustomSelectionActionModeCallback();
    method protected boolean getDefaultEditable();
    method protected android.text.method.MovementMethod getDefaultMovementMethod();
    method public android.text.Editable getEditableText();
    method @android.view.ViewDebug.ExportedProperty public android.text.TextUtils.TruncateAt getEllipsize();
    method public CharSequence getError();
    method public int getExtendedPaddingBottom();
    method public int getExtendedPaddingTop();
    method public android.text.InputFilter[] getFilters();
    method public int getFirstBaselineToTopHeight();
    method @Nullable public String getFontFeatureSettings();
    method @Nullable public String getFontVariationSettings();
    method public boolean getFreezesText();
    method public int getGravity();
    method @ColorInt public int getHighlightColor();
    method @android.view.ViewDebug.CapturedViewProperty public CharSequence getHint();
    method public final android.content.res.ColorStateList getHintTextColors();
    method public int getHyphenationFrequency();
    method public int getImeActionId();
    method public CharSequence getImeActionLabel();
    method @Nullable public android.os.LocaleList getImeHintLocales();
    method public int getImeOptions();
    method public boolean getIncludeFontPadding();
    method public android.os.Bundle getInputExtras(boolean);
    method public int getInputType();
    method public int getJustificationMode();
    method public final android.text.method.KeyListener getKeyListener();
    method public int getLastBaselineToBottomHeight();
    method public final android.text.Layout getLayout();
    method public float getLetterSpacing();
    method public int getLineBounds(int, android.graphics.Rect);
    method public int getLineCount();
    method public int getLineHeight();
    method public float getLineSpacingExtra();
    method public float getLineSpacingMultiplier();
    method public final android.content.res.ColorStateList getLinkTextColors();
    method public final boolean getLinksClickable();
    method public int getMarqueeRepeatLimit();
    method public int getMaxEms();
    method public int getMaxHeight();
    method public int getMaxLines();
    method public int getMaxWidth();
    method public int getMinEms();
    method public int getMinHeight();
    method public int getMinLines();
    method public int getMinWidth();
    method public final android.text.method.MovementMethod getMovementMethod();
    method public int getOffsetForPosition(float, float);
    method public android.text.TextPaint getPaint();
    method public int getPaintFlags();
    method public String getPrivateImeOptions();
    method @android.view.ViewDebug.ExportedProperty(category="text") public int getSelectionEnd();
    method @android.view.ViewDebug.ExportedProperty(category="text") public int getSelectionStart();
    method @ColorInt public int getShadowColor();
    method public float getShadowDx();
    method public float getShadowDy();
    method public float getShadowRadius();
    method public final boolean getShowSoftInputOnFocus();
    method @android.view.ViewDebug.CapturedViewProperty public CharSequence getText();
    method @NonNull public android.view.textclassifier.TextClassifier getTextClassifier();
    method public final android.content.res.ColorStateList getTextColors();
    method @NonNull public java.util.Locale getTextLocale();
    method @NonNull @Size(min=1) public android.os.LocaleList getTextLocales();
    method @NonNull public android.text.PrecomputedText.Params getTextMetricsParams();
    method public float getTextScaleX();
    method @android.view.ViewDebug.ExportedProperty(category="text") public float getTextSize();
    method public int getTotalPaddingBottom();
    method public int getTotalPaddingEnd();
    method public int getTotalPaddingLeft();
    method public int getTotalPaddingRight();
    method public int getTotalPaddingStart();
    method public int getTotalPaddingTop();
    method public final android.text.method.TransformationMethod getTransformationMethod();
    method public android.graphics.Typeface getTypeface();
    method public android.text.style.URLSpan[] getUrls();
    method public boolean hasSelection();
    method public boolean isAllCaps();
    method public boolean isCursorVisible();
    method public boolean isElegantTextHeight();
    method public boolean isFallbackLineSpacing();
    method public boolean isInputMethodTarget();
    method public boolean isSuggestionsEnabled();
    method public boolean isTextSelectable();
    method public int length();
    method public boolean moveCursorToVisibleOffset();
    method public void onBeginBatchEdit();
    method public void onCommitCompletion(android.view.inputmethod.CompletionInfo);
    method public void onCommitCorrection(android.view.inputmethod.CorrectionInfo);
    method public void onEditorAction(int);
    method public void onEndBatchEdit();
    method public boolean onPreDraw();
    method public boolean onPrivateIMECommand(String, android.os.Bundle);
    method public void onRestoreInstanceState(android.os.Parcelable);
    method public android.os.Parcelable onSaveInstanceState();
    method protected void onSelectionChanged(int, int);
    method protected void onTextChanged(CharSequence, int, int, int);
    method public boolean onTextContextMenuItem(int);
    method public void removeTextChangedListener(android.text.TextWatcher);
    method public void setAllCaps(boolean);
    method public final void setAutoLinkMask(int);
    method public void setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int);
    method public void setAutoSizeTextTypeUniformWithPresetSizes(@NonNull int[], int);
    method public void setAutoSizeTextTypeWithDefaults(int);
    method public void setBreakStrategy(int);
    method public void setCompoundDrawablePadding(int);
    method public void setCompoundDrawableTintList(@Nullable android.content.res.ColorStateList);
    method public void setCompoundDrawableTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public void setCompoundDrawables(@Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable);
    method public void setCompoundDrawablesRelative(@Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable);
    method public void setCompoundDrawablesRelativeWithIntrinsicBounds(@DrawableRes int, @DrawableRes int, @DrawableRes int, @DrawableRes int);
    method public void setCompoundDrawablesRelativeWithIntrinsicBounds(@Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable);
    method public void setCompoundDrawablesWithIntrinsicBounds(@DrawableRes int, @DrawableRes int, @DrawableRes int, @DrawableRes int);
    method public void setCompoundDrawablesWithIntrinsicBounds(@Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable);
    method public void setCursorVisible(boolean);
    method public void setCustomInsertionActionModeCallback(android.view.ActionMode.Callback);
    method public void setCustomSelectionActionModeCallback(android.view.ActionMode.Callback);
    method public final void setEditableFactory(android.text.Editable.Factory);
    method public void setElegantTextHeight(boolean);
    method public void setEllipsize(android.text.TextUtils.TruncateAt);
    method public void setEms(int);
    method public void setError(CharSequence);
    method public void setError(CharSequence, android.graphics.drawable.Drawable);
    method public void setExtractedText(android.view.inputmethod.ExtractedText);
    method public void setFallbackLineSpacing(boolean);
    method public void setFilters(android.text.InputFilter[]);
    method public void setFirstBaselineToTopHeight(@Px @IntRange(from=0) int);
    method public void setFontFeatureSettings(@Nullable String);
    method public boolean setFontVariationSettings(@Nullable String);
    method protected boolean setFrame(int, int, int, int);
    method public void setFreezesText(boolean);
    method public void setGravity(int);
    method public void setHeight(int);
    method public void setHighlightColor(@ColorInt int);
    method public final void setHint(CharSequence);
    method public final void setHint(@StringRes int);
    method public final void setHintTextColor(@ColorInt int);
    method public final void setHintTextColor(android.content.res.ColorStateList);
    method public void setHorizontallyScrolling(boolean);
    method public void setHyphenationFrequency(int);
    method public void setImeActionLabel(CharSequence, int);
    method public void setImeHintLocales(@Nullable android.os.LocaleList);
    method public void setImeOptions(int);
    method public void setIncludeFontPadding(boolean);
    method public void setInputExtras(@XmlRes int) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public void setInputType(int);
    method public void setJustificationMode(int);
    method public void setKeyListener(android.text.method.KeyListener);
    method public void setLastBaselineToBottomHeight(@Px @IntRange(from=0) int);
    method public void setLetterSpacing(float);
    method public void setLineHeight(@Px @IntRange(from=0) int);
    method public void setLineSpacing(float, float);
    method public void setLines(int);
    method public final void setLinkTextColor(@ColorInt int);
    method public final void setLinkTextColor(android.content.res.ColorStateList);
    method public final void setLinksClickable(boolean);
    method public void setMarqueeRepeatLimit(int);
    method public void setMaxEms(int);
    method public void setMaxHeight(int);
    method public void setMaxLines(int);
    method public void setMaxWidth(int);
    method public void setMinEms(int);
    method public void setMinHeight(int);
    method public void setMinLines(int);
    method public void setMinWidth(int);
    method public final void setMovementMethod(android.text.method.MovementMethod);
    method public void setOnEditorActionListener(android.widget.TextView.OnEditorActionListener);
    method public void setPaintFlags(int);
    method public void setPrivateImeOptions(String);
    method public void setRawInputType(int);
    method public void setScroller(android.widget.Scroller);
    method public void setSelectAllOnFocus(boolean);
    method public void setShadowLayer(float, float, float, int);
    method public final void setShowSoftInputOnFocus(boolean);
    method public void setSingleLine();
    method public void setSingleLine(boolean);
    method public final void setSpannableFactory(android.text.Spannable.Factory);
    method public final void setText(CharSequence);
    method public void setText(CharSequence, android.widget.TextView.BufferType);
    method public final void setText(char[], int, int);
    method public final void setText(@StringRes int);
    method public final void setText(@StringRes int, android.widget.TextView.BufferType);
    method public void setTextAppearance(@StyleRes int);
    method @Deprecated public void setTextAppearance(android.content.Context, @StyleRes int);
    method public void setTextClassifier(@Nullable android.view.textclassifier.TextClassifier);
    method public void setTextColor(@ColorInt int);
    method public void setTextColor(android.content.res.ColorStateList);
    method public void setTextIsSelectable(boolean);
    method public final void setTextKeepState(CharSequence);
    method public final void setTextKeepState(CharSequence, android.widget.TextView.BufferType);
    method public void setTextLocale(@NonNull java.util.Locale);
    method public void setTextLocales(@NonNull @Size(min=1) android.os.LocaleList);
    method public void setTextMetricsParams(@NonNull android.text.PrecomputedText.Params);
    method public void setTextScaleX(float);
    method public void setTextSize(float);
    method public void setTextSize(int, float);
    method public final void setTransformationMethod(android.text.method.TransformationMethod);
    method public void setTypeface(@Nullable android.graphics.Typeface, int);
    method public void setTypeface(@Nullable android.graphics.Typeface);
    method public void setWidth(int);
    field public static final int AUTO_SIZE_TEXT_TYPE_NONE = 0; // 0x0
    field public static final int AUTO_SIZE_TEXT_TYPE_UNIFORM = 1; // 0x1
  }

  public enum TextView.BufferType {
    enum_constant public static final android.widget.TextView.BufferType EDITABLE;
    enum_constant public static final android.widget.TextView.BufferType NORMAL;
    enum_constant public static final android.widget.TextView.BufferType SPANNABLE;
  }

  public static interface TextView.OnEditorActionListener {
    method public boolean onEditorAction(android.widget.TextView, int, android.view.KeyEvent);
  }

  public static class TextView.SavedState extends android.view.View.BaseSavedState {
    field public static final android.os.Parcelable.Creator<android.widget.TextView.SavedState> CREATOR;
  }

  public interface ThemedSpinnerAdapter extends android.widget.SpinnerAdapter {
    method @Nullable public android.content.res.Resources.Theme getDropDownViewTheme();
    method public void setDropDownViewTheme(@Nullable android.content.res.Resources.Theme);
  }

  public class TimePicker extends android.widget.FrameLayout {
    ctor public TimePicker(android.content.Context);
    ctor public TimePicker(android.content.Context, android.util.AttributeSet);
    ctor public TimePicker(android.content.Context, android.util.AttributeSet, int);
    ctor public TimePicker(android.content.Context, android.util.AttributeSet, int, int);
    method @Deprecated @NonNull public Integer getCurrentHour();
    method @Deprecated @NonNull public Integer getCurrentMinute();
    method public int getHour();
    method public int getMinute();
    method public boolean is24HourView();
    method @Deprecated public void setCurrentHour(@NonNull Integer);
    method @Deprecated public void setCurrentMinute(@NonNull Integer);
    method public void setHour(@IntRange(from=0, to=23) int);
    method public void setIs24HourView(@NonNull Boolean);
    method public void setMinute(@IntRange(from=0, to=59) int);
    method public void setOnTimeChangedListener(android.widget.TimePicker.OnTimeChangedListener);
    method public boolean validateInput();
  }

  public static interface TimePicker.OnTimeChangedListener {
    method public void onTimeChanged(android.widget.TimePicker, int, int);
  }

  public class Toast {
    ctor public Toast(android.content.Context);
    method public void cancel();
    method public int getDuration();
    method public int getGravity();
    method public float getHorizontalMargin();
    method public float getVerticalMargin();
    method public android.view.View getView();
    method public int getXOffset();
    method public int getYOffset();
    method public static android.widget.Toast makeText(android.content.Context, CharSequence, int);
    method public static android.widget.Toast makeText(android.content.Context, @StringRes int, int) throws android.content.res.Resources.NotFoundException;
    method public void setDuration(int);
    method public void setGravity(int, int, int);
    method public void setMargin(float, float);
    method public void setText(@StringRes int);
    method public void setText(CharSequence);
    method public void setView(android.view.View);
    method public void show();
    field public static final int LENGTH_LONG = 1; // 0x1
    field public static final int LENGTH_SHORT = 0; // 0x0
  }

  public class ToggleButton extends android.widget.CompoundButton {
    ctor public ToggleButton(android.content.Context, android.util.AttributeSet, int, int);
    ctor public ToggleButton(android.content.Context, android.util.AttributeSet, int);
    ctor public ToggleButton(android.content.Context, android.util.AttributeSet);
    ctor public ToggleButton(android.content.Context);
    method public CharSequence getTextOff();
    method public CharSequence getTextOn();
    method public void setBackgroundDrawable(android.graphics.drawable.Drawable);
    method public void setTextOff(CharSequence);
    method public void setTextOn(CharSequence);
  }

  public class Toolbar extends android.view.ViewGroup {
    ctor public Toolbar(android.content.Context);
    ctor public Toolbar(android.content.Context, android.util.AttributeSet);
    ctor public Toolbar(android.content.Context, android.util.AttributeSet, int);
    ctor public Toolbar(android.content.Context, android.util.AttributeSet, int, int);
    method public void collapseActionView();
    method public void dismissPopupMenus();
    method protected android.widget.Toolbar.LayoutParams generateDefaultLayoutParams();
    method public android.widget.Toolbar.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method protected android.widget.Toolbar.LayoutParams generateLayoutParams(android.view.ViewGroup.LayoutParams);
    method public int getContentInsetEnd();
    method public int getContentInsetEndWithActions();
    method public int getContentInsetLeft();
    method public int getContentInsetRight();
    method public int getContentInsetStart();
    method public int getContentInsetStartWithNavigation();
    method public int getCurrentContentInsetEnd();
    method public int getCurrentContentInsetLeft();
    method public int getCurrentContentInsetRight();
    method public int getCurrentContentInsetStart();
    method public android.graphics.drawable.Drawable getLogo();
    method public CharSequence getLogoDescription();
    method public android.view.Menu getMenu();
    method @Nullable public CharSequence getNavigationContentDescription();
    method @Nullable public android.graphics.drawable.Drawable getNavigationIcon();
    method @Nullable public android.graphics.drawable.Drawable getOverflowIcon();
    method public int getPopupTheme();
    method public CharSequence getSubtitle();
    method public CharSequence getTitle();
    method public int getTitleMarginBottom();
    method public int getTitleMarginEnd();
    method public int getTitleMarginStart();
    method public int getTitleMarginTop();
    method public boolean hasExpandedActionView();
    method public boolean hideOverflowMenu();
    method public void inflateMenu(@MenuRes int);
    method public boolean isOverflowMenuShowing();
    method public void setContentInsetEndWithActions(int);
    method public void setContentInsetStartWithNavigation(int);
    method public void setContentInsetsAbsolute(int, int);
    method public void setContentInsetsRelative(int, int);
    method public void setLogo(@DrawableRes int);
    method public void setLogo(android.graphics.drawable.Drawable);
    method public void setLogoDescription(@StringRes int);
    method public void setLogoDescription(CharSequence);
    method public void setNavigationContentDescription(@StringRes int);
    method public void setNavigationContentDescription(@Nullable CharSequence);
    method public void setNavigationIcon(@DrawableRes int);
    method public void setNavigationIcon(@Nullable android.graphics.drawable.Drawable);
    method public void setNavigationOnClickListener(android.view.View.OnClickListener);
    method public void setOnMenuItemClickListener(android.widget.Toolbar.OnMenuItemClickListener);
    method public void setOverflowIcon(@Nullable android.graphics.drawable.Drawable);
    method public void setPopupTheme(@StyleRes int);
    method public void setSubtitle(@StringRes int);
    method public void setSubtitle(CharSequence);
    method public void setSubtitleTextAppearance(android.content.Context, @StyleRes int);
    method public void setSubtitleTextColor(@ColorInt int);
    method public void setTitle(@StringRes int);
    method public void setTitle(CharSequence);
    method public void setTitleMargin(int, int, int, int);
    method public void setTitleMarginBottom(int);
    method public void setTitleMarginEnd(int);
    method public void setTitleMarginStart(int);
    method public void setTitleMarginTop(int);
    method public void setTitleTextAppearance(android.content.Context, @StyleRes int);
    method public void setTitleTextColor(@ColorInt int);
    method public boolean showOverflowMenu();
  }

  public static class Toolbar.LayoutParams extends android.app.ActionBar.LayoutParams {
    ctor public Toolbar.LayoutParams(@NonNull android.content.Context, android.util.AttributeSet);
    ctor public Toolbar.LayoutParams(int, int);
    ctor public Toolbar.LayoutParams(int, int, int);
    ctor public Toolbar.LayoutParams(int);
    ctor public Toolbar.LayoutParams(android.widget.Toolbar.LayoutParams);
    ctor public Toolbar.LayoutParams(android.app.ActionBar.LayoutParams);
    ctor public Toolbar.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
    ctor public Toolbar.LayoutParams(android.view.ViewGroup.LayoutParams);
  }

  public static interface Toolbar.OnMenuItemClickListener {
    method public boolean onMenuItemClick(android.view.MenuItem);
  }

  @Deprecated public class TwoLineListItem extends android.widget.RelativeLayout {
    ctor @Deprecated public TwoLineListItem(android.content.Context);
    ctor @Deprecated public TwoLineListItem(android.content.Context, android.util.AttributeSet);
    ctor @Deprecated public TwoLineListItem(android.content.Context, android.util.AttributeSet, int);
    ctor @Deprecated public TwoLineListItem(android.content.Context, android.util.AttributeSet, int, int);
    method @Deprecated public android.widget.TextView getText1();
    method @Deprecated public android.widget.TextView getText2();
  }

  public class VideoView extends android.view.SurfaceView implements android.widget.MediaController.MediaPlayerControl {
    ctor public VideoView(android.content.Context);
    ctor public VideoView(android.content.Context, android.util.AttributeSet);
    ctor public VideoView(android.content.Context, android.util.AttributeSet, int);
    ctor public VideoView(android.content.Context, android.util.AttributeSet, int, int);
    method public void addSubtitleSource(java.io.InputStream, android.media.MediaFormat);
    method public boolean canPause();
    method public boolean canSeekBackward();
    method public boolean canSeekForward();
    method public int getAudioSessionId();
    method public int getBufferPercentage();
    method public int getCurrentPosition();
    method public int getDuration();
    method public boolean isPlaying();
    method public void pause();
    method public int resolveAdjustedSize(int, int);
    method public void resume();
    method public void seekTo(int);
    method public void setAudioAttributes(@NonNull android.media.AudioAttributes);
    method public void setAudioFocusRequest(int);
    method public void setMediaController(android.widget.MediaController);
    method public void setOnCompletionListener(android.media.MediaPlayer.OnCompletionListener);
    method public void setOnErrorListener(android.media.MediaPlayer.OnErrorListener);
    method public void setOnInfoListener(android.media.MediaPlayer.OnInfoListener);
    method public void setOnPreparedListener(android.media.MediaPlayer.OnPreparedListener);
    method public void setVideoPath(String);
    method public void setVideoURI(android.net.Uri);
    method public void setVideoURI(android.net.Uri, java.util.Map<java.lang.String,java.lang.String>);
    method public void start();
    method public void stopPlayback();
    method public void suspend();
  }

  public class ViewAnimator extends android.widget.FrameLayout {
    ctor public ViewAnimator(android.content.Context);
    ctor public ViewAnimator(android.content.Context, android.util.AttributeSet);
    method public boolean getAnimateFirstView();
    method public android.view.View getCurrentView();
    method public int getDisplayedChild();
    method public android.view.animation.Animation getInAnimation();
    method public android.view.animation.Animation getOutAnimation();
    method public void setAnimateFirstView(boolean);
    method public void setDisplayedChild(int);
    method public void setInAnimation(android.view.animation.Animation);
    method public void setInAnimation(android.content.Context, @AnimRes int);
    method public void setOutAnimation(android.view.animation.Animation);
    method public void setOutAnimation(android.content.Context, @AnimRes int);
    method public void showNext();
    method public void showPrevious();
  }

  @android.widget.RemoteViews.RemoteView public class ViewFlipper extends android.widget.ViewAnimator {
    ctor public ViewFlipper(android.content.Context);
    ctor public ViewFlipper(android.content.Context, android.util.AttributeSet);
    method public boolean isAutoStart();
    method public boolean isFlipping();
    method public void setAutoStart(boolean);
    method public void setFlipInterval(int);
    method public void startFlipping();
    method public void stopFlipping();
  }

  public class ViewSwitcher extends android.widget.ViewAnimator {
    ctor public ViewSwitcher(android.content.Context);
    ctor public ViewSwitcher(android.content.Context, android.util.AttributeSet);
    method public android.view.View getNextView();
    method public void reset();
    method public void setFactory(android.widget.ViewSwitcher.ViewFactory);
  }

  public static interface ViewSwitcher.ViewFactory {
    method public android.view.View makeView();
  }

  public interface WrapperListAdapter extends android.widget.ListAdapter {
    method public android.widget.ListAdapter getWrappedAdapter();
  }

  @Deprecated public class ZoomButton extends android.widget.ImageButton implements android.view.View.OnLongClickListener {
    ctor @Deprecated public ZoomButton(android.content.Context);
    ctor @Deprecated public ZoomButton(android.content.Context, android.util.AttributeSet);
    ctor @Deprecated public ZoomButton(android.content.Context, android.util.AttributeSet, int);
    ctor @Deprecated public ZoomButton(android.content.Context, android.util.AttributeSet, int, int);
    method @Deprecated public boolean onLongClick(android.view.View);
    method @Deprecated public void setZoomSpeed(long);
  }

  @Deprecated public class ZoomButtonsController implements android.view.View.OnTouchListener {
    ctor @Deprecated public ZoomButtonsController(android.view.View);
    method @Deprecated public android.view.ViewGroup getContainer();
    method @Deprecated public android.view.View getZoomControls();
    method @Deprecated public boolean isAutoDismissed();
    method @Deprecated public boolean isVisible();
    method public boolean onTouch(android.view.View, android.view.MotionEvent);
    method @Deprecated public void setAutoDismissed(boolean);
    method @Deprecated public void setFocusable(boolean);
    method @Deprecated public void setOnZoomListener(android.widget.ZoomButtonsController.OnZoomListener);
    method @Deprecated public void setVisible(boolean);
    method @Deprecated public void setZoomInEnabled(boolean);
    method @Deprecated public void setZoomOutEnabled(boolean);
    method @Deprecated public void setZoomSpeed(long);
  }

  @Deprecated public static interface ZoomButtonsController.OnZoomListener {
    method @Deprecated public void onVisibilityChanged(boolean);
    method @Deprecated public void onZoom(boolean);
  }

  public class ZoomControls extends android.widget.LinearLayout {
    ctor public ZoomControls(android.content.Context);
    ctor public ZoomControls(android.content.Context, android.util.AttributeSet);
    method public void hide();
    method public void setIsZoomInEnabled(boolean);
    method public void setIsZoomOutEnabled(boolean);
    method public void setOnZoomInClickListener(android.view.View.OnClickListener);
    method public void setOnZoomOutClickListener(android.view.View.OnClickListener);
    method public void setZoomSpeed(long);
    method public void show();
  }

}

package dalvik.annotation {

  @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface TestTarget {
    method @Deprecated public abstract String conceptName() default "";
    method @Deprecated public abstract Class<?>[] methodArgs() default {};
    method @Deprecated public abstract String methodName() default "";
  }

  @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public @interface TestTargetClass {
    method @Deprecated public abstract Class<?> value();
  }

}

package dalvik.bytecode {

  public final class OpcodeInfo {
    field public static final int MAXIMUM_PACKED_VALUE;
    field public static final int MAXIMUM_VALUE;
  }

  public interface Opcodes {
    field public static final int OP_ADD_DOUBLE = 171; // 0xab
    field public static final int OP_ADD_DOUBLE_2ADDR = 203; // 0xcb
    field public static final int OP_ADD_FLOAT = 166; // 0xa6
    field public static final int OP_ADD_FLOAT_2ADDR = 198; // 0xc6
    field public static final int OP_ADD_INT = 144; // 0x90
    field public static final int OP_ADD_INT_2ADDR = 176; // 0xb0
    field public static final int OP_ADD_INT_LIT16 = 208; // 0xd0
    field public static final int OP_ADD_INT_LIT8 = 216; // 0xd8
    field public static final int OP_ADD_LONG = 155; // 0x9b
    field public static final int OP_ADD_LONG_2ADDR = 187; // 0xbb
    field public static final int OP_AGET = 68; // 0x44
    field public static final int OP_AGET_BOOLEAN = 71; // 0x47
    field public static final int OP_AGET_BYTE = 72; // 0x48
    field public static final int OP_AGET_CHAR = 73; // 0x49
    field public static final int OP_AGET_OBJECT = 70; // 0x46
    field public static final int OP_AGET_SHORT = 74; // 0x4a
    field public static final int OP_AGET_WIDE = 69; // 0x45
    field public static final int OP_AND_INT = 149; // 0x95
    field public static final int OP_AND_INT_2ADDR = 181; // 0xb5
    field public static final int OP_AND_INT_LIT16 = 213; // 0xd5
    field public static final int OP_AND_INT_LIT8 = 221; // 0xdd
    field public static final int OP_AND_LONG = 160; // 0xa0
    field public static final int OP_AND_LONG_2ADDR = 192; // 0xc0
    field public static final int OP_APUT = 75; // 0x4b
    field public static final int OP_APUT_BOOLEAN = 78; // 0x4e
    field public static final int OP_APUT_BYTE = 79; // 0x4f
    field public static final int OP_APUT_CHAR = 80; // 0x50
    field public static final int OP_APUT_OBJECT = 77; // 0x4d
    field public static final int OP_APUT_SHORT = 81; // 0x51
    field public static final int OP_APUT_WIDE = 76; // 0x4c
    field public static final int OP_ARRAY_LENGTH = 33; // 0x21
    field @Deprecated public static final int OP_BREAKPOINT = 236; // 0xec
    field public static final int OP_CHECK_CAST = 31; // 0x1f
    field public static final int OP_CHECK_CAST_JUMBO = 511; // 0x1ff
    field public static final int OP_CMPG_DOUBLE = 48; // 0x30
    field public static final int OP_CMPG_FLOAT = 46; // 0x2e
    field public static final int OP_CMPL_DOUBLE = 47; // 0x2f
    field public static final int OP_CMPL_FLOAT = 45; // 0x2d
    field public static final int OP_CMP_LONG = 49; // 0x31
    field public static final int OP_CONST = 20; // 0x14
    field public static final int OP_CONST_16 = 19; // 0x13
    field public static final int OP_CONST_4 = 18; // 0x12
    field public static final int OP_CONST_CLASS = 28; // 0x1c
    field public static final int OP_CONST_CLASS_JUMBO = 255; // 0xff
    field public static final int OP_CONST_HIGH16 = 21; // 0x15
    field public static final int OP_CONST_METHOD_HANDLE = 254; // 0xfe
    field public static final int OP_CONST_METHOD_TYPE = 255; // 0xff
    field public static final int OP_CONST_STRING = 26; // 0x1a
    field public static final int OP_CONST_STRING_JUMBO = 27; // 0x1b
    field public static final int OP_CONST_WIDE = 24; // 0x18
    field public static final int OP_CONST_WIDE_16 = 22; // 0x16
    field public static final int OP_CONST_WIDE_32 = 23; // 0x17
    field public static final int OP_CONST_WIDE_HIGH16 = 25; // 0x19
    field public static final int OP_DIV_DOUBLE = 174; // 0xae
    field public static final int OP_DIV_DOUBLE_2ADDR = 206; // 0xce
    field public static final int OP_DIV_FLOAT = 169; // 0xa9
    field public static final int OP_DIV_FLOAT_2ADDR = 201; // 0xc9
    field public static final int OP_DIV_INT = 147; // 0x93
    field public static final int OP_DIV_INT_2ADDR = 179; // 0xb3
    field public static final int OP_DIV_INT_LIT16 = 211; // 0xd3
    field public static final int OP_DIV_INT_LIT8 = 219; // 0xdb
    field public static final int OP_DIV_LONG = 158; // 0x9e
    field public static final int OP_DIV_LONG_2ADDR = 190; // 0xbe
    field public static final int OP_DOUBLE_TO_FLOAT = 140; // 0x8c
    field public static final int OP_DOUBLE_TO_INT = 138; // 0x8a
    field public static final int OP_DOUBLE_TO_LONG = 139; // 0x8b
    field @Deprecated public static final int OP_EXECUTE_INLINE = 238; // 0xee
    field @Deprecated public static final int OP_EXECUTE_INLINE_RANGE = 239; // 0xef
    field public static final int OP_FILLED_NEW_ARRAY = 36; // 0x24
    field public static final int OP_FILLED_NEW_ARRAY_JUMBO = 1535; // 0x5ff
    field public static final int OP_FILLED_NEW_ARRAY_RANGE = 37; // 0x25
    field public static final int OP_FILL_ARRAY_DATA = 38; // 0x26
    field public static final int OP_FLOAT_TO_DOUBLE = 137; // 0x89
    field public static final int OP_FLOAT_TO_INT = 135; // 0x87
    field public static final int OP_FLOAT_TO_LONG = 136; // 0x88
    field public static final int OP_GOTO = 40; // 0x28
    field public static final int OP_GOTO_16 = 41; // 0x29
    field public static final int OP_GOTO_32 = 42; // 0x2a
    field public static final int OP_IF_EQ = 50; // 0x32
    field public static final int OP_IF_EQZ = 56; // 0x38
    field public static final int OP_IF_GE = 53; // 0x35
    field public static final int OP_IF_GEZ = 59; // 0x3b
    field public static final int OP_IF_GT = 54; // 0x36
    field public static final int OP_IF_GTZ = 60; // 0x3c
    field public static final int OP_IF_LE = 55; // 0x37
    field public static final int OP_IF_LEZ = 61; // 0x3d
    field public static final int OP_IF_LT = 52; // 0x34
    field public static final int OP_IF_LTZ = 58; // 0x3a
    field public static final int OP_IF_NE = 51; // 0x33
    field public static final int OP_IF_NEZ = 57; // 0x39
    field public static final int OP_IGET = 82; // 0x52
    field public static final int OP_IGET_BOOLEAN = 85; // 0x55
    field public static final int OP_IGET_BOOLEAN_JUMBO = 2559; // 0x9ff
    field public static final int OP_IGET_BYTE = 86; // 0x56
    field public static final int OP_IGET_BYTE_JUMBO = 2815; // 0xaff
    field public static final int OP_IGET_CHAR = 87; // 0x57
    field public static final int OP_IGET_CHAR_JUMBO = 3071; // 0xbff
    field public static final int OP_IGET_JUMBO = 1791; // 0x6ff
    field public static final int OP_IGET_OBJECT = 84; // 0x54
    field public static final int OP_IGET_OBJECT_JUMBO = 2303; // 0x8ff
    field @Deprecated public static final int OP_IGET_OBJECT_QUICK = 244; // 0xf4
    field @Deprecated public static final int OP_IGET_QUICK = 242; // 0xf2
    field public static final int OP_IGET_SHORT = 88; // 0x58
    field public static final int OP_IGET_SHORT_JUMBO = 3327; // 0xcff
    field public static final int OP_IGET_WIDE = 83; // 0x53
    field public static final int OP_IGET_WIDE_JUMBO = 2047; // 0x7ff
    field @Deprecated public static final int OP_IGET_WIDE_QUICK = 243; // 0xf3
    field @Deprecated public static final int OP_IGET_WIDE_VOLATILE = 232; // 0xe8
    field public static final int OP_INSTANCE_OF = 32; // 0x20
    field public static final int OP_INSTANCE_OF_JUMBO = 767; // 0x2ff
    field public static final int OP_INT_TO_BYTE = 141; // 0x8d
    field public static final int OP_INT_TO_CHAR = 142; // 0x8e
    field public static final int OP_INT_TO_DOUBLE = 131; // 0x83
    field public static final int OP_INT_TO_FLOAT = 130; // 0x82
    field public static final int OP_INT_TO_LONG = 129; // 0x81
    field public static final int OP_INT_TO_SHORT = 143; // 0x8f
    field public static final int OP_INVOKE_CUSTOM = 252; // 0xfc
    field public static final int OP_INVOKE_CUSTOM_RANGE = 253; // 0xfd
    field public static final int OP_INVOKE_DIRECT = 112; // 0x70
    field @Deprecated public static final int OP_INVOKE_DIRECT_EMPTY = 240; // 0xf0
    field public static final int OP_INVOKE_DIRECT_JUMBO = 9471; // 0x24ff
    field public static final int OP_INVOKE_DIRECT_RANGE = 118; // 0x76
    field public static final int OP_INVOKE_INTERFACE = 114; // 0x72
    field public static final int OP_INVOKE_INTERFACE_JUMBO = 9983; // 0x26ff
    field public static final int OP_INVOKE_INTERFACE_RANGE = 120; // 0x78
    field public static final int OP_INVOKE_POLYMORPHIC = 250; // 0xfa
    field public static final int OP_INVOKE_POLYMORPHIC_RANGE = 251; // 0xfb
    field public static final int OP_INVOKE_STATIC = 113; // 0x71
    field public static final int OP_INVOKE_STATIC_JUMBO = 9727; // 0x25ff
    field public static final int OP_INVOKE_STATIC_RANGE = 119; // 0x77
    field public static final int OP_INVOKE_SUPER = 111; // 0x6f
    field public static final int OP_INVOKE_SUPER_JUMBO = 9215; // 0x23ff
    field @Deprecated public static final int OP_INVOKE_SUPER_QUICK = 250; // 0xfa
    field @Deprecated public static final int OP_INVOKE_SUPER_QUICK_RANGE = 251; // 0xfb
    field public static final int OP_INVOKE_SUPER_RANGE = 117; // 0x75
    field public static final int OP_INVOKE_VIRTUAL = 110; // 0x6e
    field public static final int OP_INVOKE_VIRTUAL_JUMBO = 8959; // 0x22ff
    field @Deprecated public static final int OP_INVOKE_VIRTUAL_QUICK = 248; // 0xf8
    field @Deprecated public static final int OP_INVOKE_VIRTUAL_QUICK_RANGE = 249; // 0xf9
    field public static final int OP_INVOKE_VIRTUAL_RANGE = 116; // 0x74
    field public static final int OP_IPUT = 89; // 0x59
    field public static final int OP_IPUT_BOOLEAN = 92; // 0x5c
    field public static final int OP_IPUT_BOOLEAN_JUMBO = 4351; // 0x10ff
    field public static final int OP_IPUT_BYTE = 93; // 0x5d
    field public static final int OP_IPUT_BYTE_JUMBO = 4607; // 0x11ff
    field public static final int OP_IPUT_CHAR = 94; // 0x5e
    field public static final int OP_IPUT_CHAR_JUMBO = 4863; // 0x12ff
    field public static final int OP_IPUT_JUMBO = 3583; // 0xdff
    field public static final int OP_IPUT_OBJECT = 91; // 0x5b
    field public static final int OP_IPUT_OBJECT_JUMBO = 4095; // 0xfff
    field @Deprecated public static final int OP_IPUT_OBJECT_QUICK = 247; // 0xf7
    field @Deprecated public static final int OP_IPUT_QUICK = 245; // 0xf5
    field public static final int OP_IPUT_SHORT = 95; // 0x5f
    field public static final int OP_IPUT_SHORT_JUMBO = 5119; // 0x13ff
    field public static final int OP_IPUT_WIDE = 90; // 0x5a
    field public static final int OP_IPUT_WIDE_JUMBO = 3839; // 0xeff
    field @Deprecated public static final int OP_IPUT_WIDE_QUICK = 246; // 0xf6
    field @Deprecated public static final int OP_IPUT_WIDE_VOLATILE = 233; // 0xe9
    field public static final int OP_LONG_TO_DOUBLE = 134; // 0x86
    field public static final int OP_LONG_TO_FLOAT = 133; // 0x85
    field public static final int OP_LONG_TO_INT = 132; // 0x84
    field public static final int OP_MONITOR_ENTER = 29; // 0x1d
    field public static final int OP_MONITOR_EXIT = 30; // 0x1e
    field public static final int OP_MOVE = 1; // 0x1
    field public static final int OP_MOVE_16 = 3; // 0x3
    field public static final int OP_MOVE_EXCEPTION = 13; // 0xd
    field public static final int OP_MOVE_FROM16 = 2; // 0x2
    field public static final int OP_MOVE_OBJECT = 7; // 0x7
    field public static final int OP_MOVE_OBJECT_16 = 9; // 0x9
    field public static final int OP_MOVE_OBJECT_FROM16 = 8; // 0x8
    field public static final int OP_MOVE_RESULT = 10; // 0xa
    field public static final int OP_MOVE_RESULT_OBJECT = 12; // 0xc
    field public static final int OP_MOVE_RESULT_WIDE = 11; // 0xb
    field public static final int OP_MOVE_WIDE = 4; // 0x4
    field public static final int OP_MOVE_WIDE_16 = 6; // 0x6
    field public static final int OP_MOVE_WIDE_FROM16 = 5; // 0x5
    field public static final int OP_MUL_DOUBLE = 173; // 0xad
    field public static final int OP_MUL_DOUBLE_2ADDR = 205; // 0xcd
    field public static final int OP_MUL_FLOAT = 168; // 0xa8
    field public static final int OP_MUL_FLOAT_2ADDR = 200; // 0xc8
    field public static final int OP_MUL_INT = 146; // 0x92
    field public static final int OP_MUL_INT_2ADDR = 178; // 0xb2
    field public static final int OP_MUL_INT_LIT16 = 210; // 0xd2
    field public static final int OP_MUL_INT_LIT8 = 218; // 0xda
    field public static final int OP_MUL_LONG = 157; // 0x9d
    field public static final int OP_MUL_LONG_2ADDR = 189; // 0xbd
    field public static final int OP_NEG_DOUBLE = 128; // 0x80
    field public static final int OP_NEG_FLOAT = 127; // 0x7f
    field public static final int OP_NEG_INT = 123; // 0x7b
    field public static final int OP_NEG_LONG = 125; // 0x7d
    field public static final int OP_NEW_ARRAY = 35; // 0x23
    field public static final int OP_NEW_ARRAY_JUMBO = 1279; // 0x4ff
    field public static final int OP_NEW_INSTANCE = 34; // 0x22
    field public static final int OP_NEW_INSTANCE_JUMBO = 1023; // 0x3ff
    field public static final int OP_NOP = 0; // 0x0
    field public static final int OP_NOT_INT = 124; // 0x7c
    field public static final int OP_NOT_LONG = 126; // 0x7e
    field public static final int OP_OR_INT = 150; // 0x96
    field public static final int OP_OR_INT_2ADDR = 182; // 0xb6
    field public static final int OP_OR_INT_LIT16 = 214; // 0xd6
    field public static final int OP_OR_INT_LIT8 = 222; // 0xde
    field public static final int OP_OR_LONG = 161; // 0xa1
    field public static final int OP_OR_LONG_2ADDR = 193; // 0xc1
    field public static final int OP_PACKED_SWITCH = 43; // 0x2b
    field public static final int OP_REM_DOUBLE = 175; // 0xaf
    field public static final int OP_REM_DOUBLE_2ADDR = 207; // 0xcf
    field public static final int OP_REM_FLOAT = 170; // 0xaa
    field public static final int OP_REM_FLOAT_2ADDR = 202; // 0xca
    field public static final int OP_REM_INT = 148; // 0x94
    field public static final int OP_REM_INT_2ADDR = 180; // 0xb4
    field public static final int OP_REM_INT_LIT16 = 212; // 0xd4
    field public static final int OP_REM_INT_LIT8 = 220; // 0xdc
    field public static final int OP_REM_LONG = 159; // 0x9f
    field public static final int OP_REM_LONG_2ADDR = 191; // 0xbf
    field public static final int OP_RETURN = 15; // 0xf
    field public static final int OP_RETURN_OBJECT = 17; // 0x11
    field public static final int OP_RETURN_VOID = 14; // 0xe
    field public static final int OP_RETURN_WIDE = 16; // 0x10
    field public static final int OP_RSUB_INT = 209; // 0xd1
    field public static final int OP_RSUB_INT_LIT8 = 217; // 0xd9
    field public static final int OP_SGET = 96; // 0x60
    field public static final int OP_SGET_BOOLEAN = 99; // 0x63
    field public static final int OP_SGET_BOOLEAN_JUMBO = 6143; // 0x17ff
    field public static final int OP_SGET_BYTE = 100; // 0x64
    field public static final int OP_SGET_BYTE_JUMBO = 6399; // 0x18ff
    field public static final int OP_SGET_CHAR = 101; // 0x65
    field public static final int OP_SGET_CHAR_JUMBO = 6655; // 0x19ff
    field public static final int OP_SGET_JUMBO = 5375; // 0x14ff
    field public static final int OP_SGET_OBJECT = 98; // 0x62
    field public static final int OP_SGET_OBJECT_JUMBO = 5887; // 0x16ff
    field public static final int OP_SGET_SHORT = 102; // 0x66
    field public static final int OP_SGET_SHORT_JUMBO = 6911; // 0x1aff
    field public static final int OP_SGET_WIDE = 97; // 0x61
    field public static final int OP_SGET_WIDE_JUMBO = 5631; // 0x15ff
    field @Deprecated public static final int OP_SGET_WIDE_VOLATILE = 234; // 0xea
    field public static final int OP_SHL_INT = 152; // 0x98
    field public static final int OP_SHL_INT_2ADDR = 184; // 0xb8
    field public static final int OP_SHL_INT_LIT8 = 224; // 0xe0
    field public static final int OP_SHL_LONG = 163; // 0xa3
    field public static final int OP_SHL_LONG_2ADDR = 195; // 0xc3
    field public static final int OP_SHR_INT = 153; // 0x99
    field public static final int OP_SHR_INT_2ADDR = 185; // 0xb9
    field public static final int OP_SHR_INT_LIT8 = 225; // 0xe1
    field public static final int OP_SHR_LONG = 164; // 0xa4
    field public static final int OP_SHR_LONG_2ADDR = 196; // 0xc4
    field public static final int OP_SPARSE_SWITCH = 44; // 0x2c
    field public static final int OP_SPUT = 103; // 0x67
    field public static final int OP_SPUT_BOOLEAN = 106; // 0x6a
    field public static final int OP_SPUT_BOOLEAN_JUMBO = 7935; // 0x1eff
    field public static final int OP_SPUT_BYTE = 107; // 0x6b
    field public static final int OP_SPUT_BYTE_JUMBO = 8191; // 0x1fff
    field public static final int OP_SPUT_CHAR = 108; // 0x6c
    field public static final int OP_SPUT_CHAR_JUMBO = 8447; // 0x20ff
    field public static final int OP_SPUT_JUMBO = 7167; // 0x1bff
    field public static final int OP_SPUT_OBJECT = 105; // 0x69
    field public static final int OP_SPUT_OBJECT_JUMBO = 7679; // 0x1dff
    field public static final int OP_SPUT_SHORT = 109; // 0x6d
    field public static final int OP_SPUT_SHORT_JUMBO = 8703; // 0x21ff
    field public static final int OP_SPUT_WIDE = 104; // 0x68
    field public static final int OP_SPUT_WIDE_JUMBO = 7423; // 0x1cff
    field @Deprecated public static final int OP_SPUT_WIDE_VOLATILE = 235; // 0xeb
    field public static final int OP_SUB_DOUBLE = 172; // 0xac
    field public static final int OP_SUB_DOUBLE_2ADDR = 204; // 0xcc
    field public static final int OP_SUB_FLOAT = 167; // 0xa7
    field public static final int OP_SUB_FLOAT_2ADDR = 199; // 0xc7
    field public static final int OP_SUB_INT = 145; // 0x91
    field public static final int OP_SUB_INT_2ADDR = 177; // 0xb1
    field public static final int OP_SUB_LONG = 156; // 0x9c
    field public static final int OP_SUB_LONG_2ADDR = 188; // 0xbc
    field public static final int OP_THROW = 39; // 0x27
    field @Deprecated public static final int OP_THROW_VERIFICATION_ERROR = 237; // 0xed
    field public static final int OP_USHR_INT = 154; // 0x9a
    field public static final int OP_USHR_INT_2ADDR = 186; // 0xba
    field public static final int OP_USHR_INT_LIT8 = 226; // 0xe2
    field public static final int OP_USHR_LONG = 165; // 0xa5
    field public static final int OP_USHR_LONG_2ADDR = 197; // 0xc5
    field public static final int OP_XOR_INT = 151; // 0x97
    field public static final int OP_XOR_INT_2ADDR = 183; // 0xb7
    field public static final int OP_XOR_INT_LIT16 = 215; // 0xd7
    field public static final int OP_XOR_INT_LIT8 = 223; // 0xdf
    field public static final int OP_XOR_LONG = 162; // 0xa2
    field public static final int OP_XOR_LONG_2ADDR = 194; // 0xc2
  }

}

package dalvik.system {

  public class BaseDexClassLoader extends java.lang.ClassLoader {
    ctor public BaseDexClassLoader(String, java.io.File, String, ClassLoader);
    method public String findLibrary(String);
    method protected java.util.Enumeration<java.net.URL> findResources(String);
  }

  public final class DelegateLastClassLoader extends dalvik.system.PathClassLoader {
    ctor public DelegateLastClassLoader(String, ClassLoader);
    ctor public DelegateLastClassLoader(String, String, ClassLoader);
    ctor public DelegateLastClassLoader(String, String, ClassLoader, boolean);
  }

  public class DexClassLoader extends dalvik.system.BaseDexClassLoader {
    ctor public DexClassLoader(String, String, String, ClassLoader);
  }

  @Deprecated public final class DexFile {
    ctor @Deprecated public DexFile(java.io.File) throws java.io.IOException;
    ctor @Deprecated public DexFile(String) throws java.io.IOException;
    method @Deprecated public void close() throws java.io.IOException;
    method @Deprecated public java.util.Enumeration<java.lang.String> entries();
    method @Deprecated public String getName();
    method @Deprecated public static boolean isDexOptNeeded(String) throws java.io.FileNotFoundException, java.io.IOException;
    method @Deprecated public Class loadClass(String, ClassLoader);
    method @Deprecated public static dalvik.system.DexFile loadDex(String, String, int) throws java.io.IOException;
  }

  public final class InMemoryDexClassLoader extends dalvik.system.BaseDexClassLoader {
    ctor public InMemoryDexClassLoader(@NonNull java.nio.ByteBuffer[], @Nullable String, @Nullable ClassLoader);
    ctor public InMemoryDexClassLoader(@NonNull java.nio.ByteBuffer[], @Nullable ClassLoader);
    ctor public InMemoryDexClassLoader(@NonNull java.nio.ByteBuffer, @Nullable ClassLoader);
  }

  public class PathClassLoader extends dalvik.system.BaseDexClassLoader {
    ctor public PathClassLoader(String, ClassLoader);
    ctor public PathClassLoader(String, String, ClassLoader);
  }

}

package java.awt.font {

  public final class NumericShaper implements java.io.Serializable {
    method public static java.awt.font.NumericShaper getContextualShaper(int);
    method public static java.awt.font.NumericShaper getContextualShaper(java.util.Set<java.awt.font.NumericShaper.Range>);
    method public static java.awt.font.NumericShaper getContextualShaper(int, int);
    method public static java.awt.font.NumericShaper getContextualShaper(java.util.Set<java.awt.font.NumericShaper.Range>, java.awt.font.NumericShaper.Range);
    method public java.util.Set<java.awt.font.NumericShaper.Range> getRangeSet();
    method public int getRanges();
    method public static java.awt.font.NumericShaper getShaper(int);
    method public static java.awt.font.NumericShaper getShaper(java.awt.font.NumericShaper.Range);
    method public boolean isContextual();
    method public void shape(char[], int, int);
    method public void shape(char[], int, int, int);
    method public void shape(char[], int, int, java.awt.font.NumericShaper.Range);
    field public static final int ALL_RANGES = 524287; // 0x7ffff
    field public static final int ARABIC = 2; // 0x2
    field public static final int BENGALI = 16; // 0x10
    field public static final int DEVANAGARI = 8; // 0x8
    field public static final int EASTERN_ARABIC = 4; // 0x4
    field public static final int ETHIOPIC = 65536; // 0x10000
    field public static final int EUROPEAN = 1; // 0x1
    field public static final int GUJARATI = 64; // 0x40
    field public static final int GURMUKHI = 32; // 0x20
    field public static final int KANNADA = 1024; // 0x400
    field public static final int KHMER = 131072; // 0x20000
    field public static final int LAO = 8192; // 0x2000
    field public static final int MALAYALAM = 2048; // 0x800
    field public static final int MONGOLIAN = 262144; // 0x40000
    field public static final int MYANMAR = 32768; // 0x8000
    field public static final int ORIYA = 128; // 0x80
    field public static final int TAMIL = 256; // 0x100
    field public static final int TELUGU = 512; // 0x200
    field public static final int THAI = 4096; // 0x1000
    field public static final int TIBETAN = 16384; // 0x4000
  }

  public enum NumericShaper.Range {
    enum_constant public static final java.awt.font.NumericShaper.Range ARABIC;
    enum_constant public static final java.awt.font.NumericShaper.Range BALINESE;
    enum_constant public static final java.awt.font.NumericShaper.Range BENGALI;
    enum_constant public static final java.awt.font.NumericShaper.Range CHAM;
    enum_constant public static final java.awt.font.NumericShaper.Range DEVANAGARI;
    enum_constant public static final java.awt.font.NumericShaper.Range EASTERN_ARABIC;
    enum_constant public static final java.awt.font.NumericShaper.Range ETHIOPIC;
    enum_constant public static final java.awt.font.NumericShaper.Range EUROPEAN;
    enum_constant public static final java.awt.font.NumericShaper.Range GUJARATI;
    enum_constant public static final java.awt.font.NumericShaper.Range GURMUKHI;
    enum_constant public static final java.awt.font.NumericShaper.Range JAVANESE;
    enum_constant public static final java.awt.font.NumericShaper.Range KANNADA;
    enum_constant public static final java.awt.font.NumericShaper.Range KAYAH_LI;
    enum_constant public static final java.awt.font.NumericShaper.Range KHMER;
    enum_constant public static final java.awt.font.NumericShaper.Range LAO;
    enum_constant public static final java.awt.font.NumericShaper.Range LEPCHA;
    enum_constant public static final java.awt.font.NumericShaper.Range LIMBU;
    enum_constant public static final java.awt.font.NumericShaper.Range MALAYALAM;
    enum_constant public static final java.awt.font.NumericShaper.Range MEETEI_MAYEK;
    enum_constant public static final java.awt.font.NumericShaper.Range MONGOLIAN;
    enum_constant public static final java.awt.font.NumericShaper.Range MYANMAR;
    enum_constant public static final java.awt.font.NumericShaper.Range MYANMAR_SHAN;
    enum_constant public static final java.awt.font.NumericShaper.Range NEW_TAI_LUE;
    enum_constant public static final java.awt.font.NumericShaper.Range NKO;
    enum_constant public static final java.awt.font.NumericShaper.Range OL_CHIKI;
    enum_constant public static final java.awt.font.NumericShaper.Range ORIYA;
    enum_constant public static final java.awt.font.NumericShaper.Range SAURASHTRA;
    enum_constant public static final java.awt.font.NumericShaper.Range SUNDANESE;
    enum_constant public static final java.awt.font.NumericShaper.Range TAI_THAM_HORA;
    enum_constant public static final java.awt.font.NumericShaper.Range TAI_THAM_THAM;
    enum_constant public static final java.awt.font.NumericShaper.Range TAMIL;
    enum_constant public static final java.awt.font.NumericShaper.Range TELUGU;
    enum_constant public static final java.awt.font.NumericShaper.Range THAI;
    enum_constant public static final java.awt.font.NumericShaper.Range TIBETAN;
    enum_constant public static final java.awt.font.NumericShaper.Range VAI;
  }

  public final class TextAttribute extends java.text.AttributedCharacterIterator.Attribute {
    ctor protected TextAttribute(String);
    field public static final java.awt.font.TextAttribute BACKGROUND;
    field public static final java.awt.font.TextAttribute BIDI_EMBEDDING;
    field public static final java.awt.font.TextAttribute CHAR_REPLACEMENT;
    field public static final java.awt.font.TextAttribute FAMILY;
    field public static final java.awt.font.TextAttribute FONT;
    field public static final java.awt.font.TextAttribute FOREGROUND;
    field public static final java.awt.font.TextAttribute INPUT_METHOD_HIGHLIGHT;
    field public static final java.awt.font.TextAttribute INPUT_METHOD_UNDERLINE;
    field public static final java.awt.font.TextAttribute JUSTIFICATION;
    field public static final Float JUSTIFICATION_FULL;
    field public static final Float JUSTIFICATION_NONE;
    field public static final java.awt.font.TextAttribute KERNING;
    field public static final Integer KERNING_ON;
    field public static final java.awt.font.TextAttribute LIGATURES;
    field public static final Integer LIGATURES_ON;
    field public static final java.awt.font.TextAttribute NUMERIC_SHAPING;
    field public static final java.awt.font.TextAttribute POSTURE;
    field public static final Float POSTURE_OBLIQUE;
    field public static final Float POSTURE_REGULAR;
    field public static final java.awt.font.TextAttribute RUN_DIRECTION;
    field public static final Boolean RUN_DIRECTION_LTR;
    field public static final Boolean RUN_DIRECTION_RTL;
    field public static final java.awt.font.TextAttribute SIZE;
    field public static final java.awt.font.TextAttribute STRIKETHROUGH;
    field public static final Boolean STRIKETHROUGH_ON;
    field public static final java.awt.font.TextAttribute SUPERSCRIPT;
    field public static final Integer SUPERSCRIPT_SUB;
    field public static final Integer SUPERSCRIPT_SUPER;
    field public static final java.awt.font.TextAttribute SWAP_COLORS;
    field public static final Boolean SWAP_COLORS_ON;
    field public static final java.awt.font.TextAttribute TRACKING;
    field public static final Float TRACKING_LOOSE;
    field public static final Float TRACKING_TIGHT;
    field public static final java.awt.font.TextAttribute TRANSFORM;
    field public static final java.awt.font.TextAttribute UNDERLINE;
    field public static final Integer UNDERLINE_LOW_DASHED;
    field public static final Integer UNDERLINE_LOW_DOTTED;
    field public static final Integer UNDERLINE_LOW_GRAY;
    field public static final Integer UNDERLINE_LOW_ONE_PIXEL;
    field public static final Integer UNDERLINE_LOW_TWO_PIXEL;
    field public static final Integer UNDERLINE_ON;
    field public static final java.awt.font.TextAttribute WEIGHT;
    field public static final Float WEIGHT_BOLD;
    field public static final Float WEIGHT_DEMIBOLD;
    field public static final Float WEIGHT_DEMILIGHT;
    field public static final Float WEIGHT_EXTRABOLD;
    field public static final Float WEIGHT_EXTRA_LIGHT;
    field public static final Float WEIGHT_HEAVY;
    field public static final Float WEIGHT_LIGHT;
    field public static final Float WEIGHT_MEDIUM;
    field public static final Float WEIGHT_REGULAR;
    field public static final Float WEIGHT_SEMIBOLD;
    field public static final Float WEIGHT_ULTRABOLD;
    field public static final java.awt.font.TextAttribute WIDTH;
    field public static final Float WIDTH_CONDENSED;
    field public static final Float WIDTH_EXTENDED;
    field public static final Float WIDTH_REGULAR;
    field public static final Float WIDTH_SEMI_CONDENSED;
    field public static final Float WIDTH_SEMI_EXTENDED;
  }

}

package java.beans {

  public class IndexedPropertyChangeEvent extends java.beans.PropertyChangeEvent {
    ctor public IndexedPropertyChangeEvent(Object, String, Object, Object, int);
    method public int getIndex();
  }

  public class PropertyChangeEvent extends java.util.EventObject {
    ctor public PropertyChangeEvent(Object, String, Object, Object);
    method public Object getNewValue();
    method public Object getOldValue();
    method public Object getPropagationId();
    method public String getPropertyName();
    method public void setPropagationId(Object);
  }

  public interface PropertyChangeListener extends java.util.EventListener {
    method public void propertyChange(java.beans.PropertyChangeEvent);
  }

  public class PropertyChangeListenerProxy extends java.util.EventListenerProxy<java.beans.PropertyChangeListener> implements java.beans.PropertyChangeListener {
    ctor public PropertyChangeListenerProxy(String, java.beans.PropertyChangeListener);
    method public String getPropertyName();
    method public void propertyChange(java.beans.PropertyChangeEvent);
  }

  public class PropertyChangeSupport implements java.io.Serializable {
    ctor public PropertyChangeSupport(Object);
    method public void addPropertyChangeListener(java.beans.PropertyChangeListener);
    method public void addPropertyChangeListener(String, java.beans.PropertyChangeListener);
    method public void fireIndexedPropertyChange(String, int, Object, Object);
    method public void fireIndexedPropertyChange(String, int, int, int);
    method public void fireIndexedPropertyChange(String, int, boolean, boolean);
    method public void firePropertyChange(String, Object, Object);
    method public void firePropertyChange(String, int, int);
    method public void firePropertyChange(String, boolean, boolean);
    method public void firePropertyChange(java.beans.PropertyChangeEvent);
    method public java.beans.PropertyChangeListener[] getPropertyChangeListeners();
    method public java.beans.PropertyChangeListener[] getPropertyChangeListeners(String);
    method public boolean hasListeners(String);
    method public void removePropertyChangeListener(java.beans.PropertyChangeListener);
    method public void removePropertyChangeListener(String, java.beans.PropertyChangeListener);
  }

}

package java.io {

  public class BufferedInputStream extends java.io.FilterInputStream {
    ctor public BufferedInputStream(java.io.InputStream);
    ctor public BufferedInputStream(java.io.InputStream, int);
    field protected volatile byte[] buf;
    field protected int count;
    field protected int marklimit;
    field protected int markpos;
    field protected int pos;
  }

  public class BufferedOutputStream extends java.io.FilterOutputStream {
    ctor public BufferedOutputStream(java.io.OutputStream);
    ctor public BufferedOutputStream(java.io.OutputStream, int);
    field protected byte[] buf;
    field protected int count;
  }

  public class BufferedReader extends java.io.Reader {
    ctor public BufferedReader(java.io.Reader, int);
    ctor public BufferedReader(java.io.Reader);
    method public void close() throws java.io.IOException;
    method public java.util.stream.Stream<java.lang.String> lines();
    method public int read(char[], int, int) throws java.io.IOException;
    method public String readLine() throws java.io.IOException;
  }

  public class BufferedWriter extends java.io.Writer {
    ctor public BufferedWriter(java.io.Writer);
    ctor public BufferedWriter(java.io.Writer, int);
    method public void close() throws java.io.IOException;
    method public void flush() throws java.io.IOException;
    method public void newLine() throws java.io.IOException;
    method public void write(char[], int, int) throws java.io.IOException;
  }

  public class ByteArrayInputStream extends java.io.InputStream {
    ctor public ByteArrayInputStream(byte[]);
    ctor public ByteArrayInputStream(byte[], int, int);
    method public int available();
    method public int read();
    method public int read(byte[], int, int);
    method public void reset();
    method public long skip(long);
    field protected byte[] buf;
    field protected int count;
    field protected int mark;
    field protected int pos;
  }

  public class ByteArrayOutputStream extends java.io.OutputStream {
    ctor public ByteArrayOutputStream();
    ctor public ByteArrayOutputStream(int);
    method public void reset();
    method public int size();
    method @NonNull public byte[] toByteArray();
    method @NonNull public String toString(@NonNull String) throws java.io.UnsupportedEncodingException;
    method @Deprecated @NonNull public String toString(int);
    method public void write(int);
    method public void write(@NonNull byte[], int, int);
    method public void writeTo(@NonNull java.io.OutputStream) throws java.io.IOException;
    field @NonNull protected byte[] buf;
    field protected int count;
  }

  public class CharArrayReader extends java.io.Reader {
    ctor public CharArrayReader(char[]);
    ctor public CharArrayReader(char[], int, int);
    method public void close();
    method public int read(char[], int, int) throws java.io.IOException;
    field protected char[] buf;
    field protected int count;
    field protected int markedPos;
    field protected int pos;
  }

  public class CharArrayWriter extends java.io.Writer {
    ctor public CharArrayWriter();
    ctor public CharArrayWriter(int);
    method public java.io.CharArrayWriter append(CharSequence);
    method public java.io.CharArrayWriter append(CharSequence, int, int);
    method public java.io.CharArrayWriter append(char);
    method public void close();
    method public void flush();
    method public void reset();
    method public int size();
    method public char[] toCharArray();
    method public void write(int);
    method public void write(char[], int, int);
    method public void write(String, int, int);
    method public void writeTo(java.io.Writer) throws java.io.IOException;
    field protected char[] buf;
    field protected int count;
  }

  public class CharConversionException extends java.io.IOException {
    ctor public CharConversionException();
    ctor public CharConversionException(String);
  }

  public interface Closeable extends java.lang.AutoCloseable {
    method public void close() throws java.io.IOException;
  }

  public final class Console implements java.io.Flushable {
    method public void flush();
    method public java.io.Console format(String, java.lang.Object...);
    method public java.io.Console printf(String, java.lang.Object...);
    method public String readLine(String, java.lang.Object...);
    method public String readLine();
    method public char[] readPassword(String, java.lang.Object...);
    method public char[] readPassword();
    method public java.io.Reader reader();
    method public java.io.PrintWriter writer();
  }

  public interface DataInput {
    method public boolean readBoolean() throws java.io.IOException;
    method public byte readByte() throws java.io.IOException;
    method public char readChar() throws java.io.IOException;
    method public double readDouble() throws java.io.IOException;
    method public float readFloat() throws java.io.IOException;
    method public void readFully(byte[]) throws java.io.IOException;
    method public void readFully(byte[], int, int) throws java.io.IOException;
    method public int readInt() throws java.io.IOException;
    method public String readLine() throws java.io.IOException;
    method public long readLong() throws java.io.IOException;
    method public short readShort() throws java.io.IOException;
    method public String readUTF() throws java.io.IOException;
    method public int readUnsignedByte() throws java.io.IOException;
    method public int readUnsignedShort() throws java.io.IOException;
    method public int skipBytes(int) throws java.io.IOException;
  }

  public class DataInputStream extends java.io.FilterInputStream implements java.io.DataInput {
    ctor public DataInputStream(java.io.InputStream);
    method public final int read(byte[]) throws java.io.IOException;
    method public final int read(byte[], int, int) throws java.io.IOException;
    method public final boolean readBoolean() throws java.io.IOException;
    method public final byte readByte() throws java.io.IOException;
    method public final char readChar() throws java.io.IOException;
    method public final double readDouble() throws java.io.IOException;
    method public final float readFloat() throws java.io.IOException;
    method public final void readFully(byte[]) throws java.io.IOException;
    method public final void readFully(byte[], int, int) throws java.io.IOException;
    method public final int readInt() throws java.io.IOException;
    method @Deprecated public final String readLine() throws java.io.IOException;
    method public final long readLong() throws java.io.IOException;
    method public final short readShort() throws java.io.IOException;
    method public final String readUTF() throws java.io.IOException;
    method public static final String readUTF(java.io.DataInput) throws java.io.IOException;
    method public final int readUnsignedByte() throws java.io.IOException;
    method public final int readUnsignedShort() throws java.io.IOException;
    method public final int skipBytes(int) throws java.io.IOException;
  }

  public interface DataOutput {
    method public void write(int) throws java.io.IOException;
    method public void write(byte[]) throws java.io.IOException;
    method public void write(byte[], int, int) throws java.io.IOException;
    method public void writeBoolean(boolean) throws java.io.IOException;
    method public void writeByte(int) throws java.io.IOException;
    method public void writeBytes(String) throws java.io.IOException;
    method public void writeChar(int) throws java.io.IOException;
    method public void writeChars(String) throws java.io.IOException;
    method public void writeDouble(double) throws java.io.IOException;
    method public void writeFloat(float) throws java.io.IOException;
    method public void writeInt(int) throws java.io.IOException;
    method public void writeLong(long) throws java.io.IOException;
    method public void writeShort(int) throws java.io.IOException;
    method public void writeUTF(String) throws java.io.IOException;
  }

  public class DataOutputStream extends java.io.FilterOutputStream implements java.io.DataOutput {
    ctor public DataOutputStream(java.io.OutputStream);
    method public final int size();
    method public final void writeBoolean(boolean) throws java.io.IOException;
    method public final void writeByte(int) throws java.io.IOException;
    method public final void writeBytes(String) throws java.io.IOException;
    method public final void writeChar(int) throws java.io.IOException;
    method public final void writeChars(String) throws java.io.IOException;
    method public final void writeDouble(double) throws java.io.IOException;
    method public final void writeFloat(float) throws java.io.IOException;
    method public final void writeInt(int) throws java.io.IOException;
    method public final void writeLong(long) throws java.io.IOException;
    method public final void writeShort(int) throws java.io.IOException;
    method public final void writeUTF(String) throws java.io.IOException;
    field protected int written;
  }

  public class EOFException extends java.io.IOException {
    ctor public EOFException();
    ctor public EOFException(String);
  }

  public interface Externalizable extends java.io.Serializable {
    method public void readExternal(java.io.ObjectInput) throws java.lang.ClassNotFoundException, java.io.IOException;
    method public void writeExternal(java.io.ObjectOutput) throws java.io.IOException;
  }

  public class File implements java.lang.Comparable<java.io.File> java.io.Serializable {
    ctor public File(@NonNull String);
    ctor public File(@Nullable String, @NonNull String);
    ctor public File(@Nullable java.io.File, @NonNull String);
    ctor public File(@NonNull java.net.URI);
    method public boolean canExecute();
    method public boolean canRead();
    method public boolean canWrite();
    method public int compareTo(@NonNull java.io.File);
    method public boolean createNewFile() throws java.io.IOException;
    method @NonNull public static java.io.File createTempFile(@NonNull String, @Nullable String, @Nullable java.io.File) throws java.io.IOException;
    method @NonNull public static java.io.File createTempFile(@NonNull String, @Nullable String) throws java.io.IOException;
    method public boolean delete();
    method public void deleteOnExit();
    method public boolean exists();
    method @NonNull public java.io.File getAbsoluteFile();
    method @NonNull public String getAbsolutePath();
    method @NonNull public java.io.File getCanonicalFile() throws java.io.IOException;
    method @NonNull public String getCanonicalPath() throws java.io.IOException;
    method public long getFreeSpace();
    method @NonNull public String getName();
    method @Nullable public String getParent();
    method @Nullable public java.io.File getParentFile();
    method @NonNull public String getPath();
    method public long getTotalSpace();
    method public long getUsableSpace();
    method public boolean isAbsolute();
    method public boolean isDirectory();
    method public boolean isFile();
    method public boolean isHidden();
    method public long lastModified();
    method public long length();
    method @Nullable public String[] list();
    method @Nullable public String[] list(@Nullable java.io.FilenameFilter);
    method @Nullable public java.io.File[] listFiles();
    method @Nullable public java.io.File[] listFiles(@Nullable java.io.FilenameFilter);
    method @Nullable public java.io.File[] listFiles(@Nullable java.io.FileFilter);
    method @NonNull public static java.io.File[] listRoots();
    method public boolean mkdir();
    method public boolean mkdirs();
    method public boolean renameTo(@NonNull java.io.File);
    method public boolean setExecutable(boolean, boolean);
    method public boolean setExecutable(boolean);
    method public boolean setLastModified(long);
    method public boolean setReadOnly();
    method public boolean setReadable(boolean, boolean);
    method public boolean setReadable(boolean);
    method public boolean setWritable(boolean, boolean);
    method public boolean setWritable(boolean);
    method @NonNull public java.nio.file.Path toPath();
    method @NonNull public java.net.URI toURI();
    method @Deprecated @NonNull public java.net.URL toURL() throws java.net.MalformedURLException;
    field @NonNull public static final String pathSeparator;
    field public static final char pathSeparatorChar;
    field @NonNull public static final String separator;
    field public static final char separatorChar;
  }

  public final class FileDescriptor {
    ctor public FileDescriptor();
    method public void sync() throws java.io.SyncFailedException;
    method public boolean valid();
    field public static final java.io.FileDescriptor err;
    field public static final java.io.FileDescriptor in;
    field public static final java.io.FileDescriptor out;
  }

  @java.lang.FunctionalInterface public interface FileFilter {
    method public boolean accept(java.io.File);
  }

  public class FileInputStream extends java.io.InputStream {
    ctor public FileInputStream(String) throws java.io.FileNotFoundException;
    ctor public FileInputStream(java.io.File) throws java.io.FileNotFoundException;
    ctor public FileInputStream(java.io.FileDescriptor);
    method protected void finalize() throws java.io.IOException;
    method public java.nio.channels.FileChannel getChannel();
    method public final java.io.FileDescriptor getFD() throws java.io.IOException;
    method public int read() throws java.io.IOException;
  }

  public class FileNotFoundException extends java.io.IOException {
    ctor public FileNotFoundException();
    ctor public FileNotFoundException(String);
  }

  public class FileOutputStream extends java.io.OutputStream {
    ctor public FileOutputStream(String) throws java.io.FileNotFoundException;
    ctor public FileOutputStream(String, boolean) throws java.io.FileNotFoundException;
    ctor public FileOutputStream(java.io.File) throws java.io.FileNotFoundException;
    ctor public FileOutputStream(java.io.File, boolean) throws java.io.FileNotFoundException;
    ctor public FileOutputStream(java.io.FileDescriptor);
    method protected void finalize() throws java.io.IOException;
    method public java.nio.channels.FileChannel getChannel();
    method public final java.io.FileDescriptor getFD() throws java.io.IOException;
    method public void write(int) throws java.io.IOException;
  }

  public final class FilePermission extends java.security.Permission implements java.io.Serializable {
    ctor public FilePermission(String, String);
    method public String getActions();
    method public boolean implies(java.security.Permission);
  }

  public class FileReader extends java.io.InputStreamReader {
    ctor public FileReader(String) throws java.io.FileNotFoundException;
    ctor public FileReader(java.io.File) throws java.io.FileNotFoundException;
    ctor public FileReader(java.io.FileDescriptor);
  }

  public class FileWriter extends java.io.OutputStreamWriter {
    ctor public FileWriter(String) throws java.io.IOException;
    ctor public FileWriter(String, boolean) throws java.io.IOException;
    ctor public FileWriter(java.io.File) throws java.io.IOException;
    ctor public FileWriter(java.io.File, boolean) throws java.io.IOException;
    ctor public FileWriter(java.io.FileDescriptor);
  }

  @java.lang.FunctionalInterface public interface FilenameFilter {
    method public boolean accept(java.io.File, String);
  }

  public class FilterInputStream extends java.io.InputStream {
    ctor protected FilterInputStream(java.io.InputStream);
    method public int read() throws java.io.IOException;
    field protected volatile java.io.InputStream in;
  }

  public class FilterOutputStream extends java.io.OutputStream {
    ctor public FilterOutputStream(java.io.OutputStream);
    method public void write(int) throws java.io.IOException;
    field protected java.io.OutputStream out;
  }

  public abstract class FilterReader extends java.io.Reader {
    ctor protected FilterReader(java.io.Reader);
    method public void close() throws java.io.IOException;
    method public int read(char[], int, int) throws java.io.IOException;
    field protected java.io.Reader in;
  }

  public abstract class FilterWriter extends java.io.Writer {
    ctor protected FilterWriter(java.io.Writer);
    method public void close() throws java.io.IOException;
    method public void flush() throws java.io.IOException;
    method public void write(char[], int, int) throws java.io.IOException;
    field protected java.io.Writer out;
  }

  public interface Flushable {
    method public void flush() throws java.io.IOException;
  }

  public class IOError extends java.lang.Error {
    ctor public IOError(Throwable);
  }

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

  public abstract class InputStream implements java.io.Closeable {
    ctor public InputStream();
    method public int available() throws java.io.IOException;
    method public void close() throws java.io.IOException;
    method public void mark(int);
    method public boolean markSupported();
    method public abstract int read() throws java.io.IOException;
    method public int read(byte[]) throws java.io.IOException;
    method public int read(byte[], int, int) throws java.io.IOException;
    method public void reset() throws java.io.IOException;
    method public long skip(long) throws java.io.IOException;
  }

  public class InputStreamReader extends java.io.Reader {
    ctor public InputStreamReader(java.io.InputStream);
    ctor public InputStreamReader(java.io.InputStream, String) throws java.io.UnsupportedEncodingException;
    ctor public InputStreamReader(java.io.InputStream, java.nio.charset.Charset);
    ctor public InputStreamReader(java.io.InputStream, java.nio.charset.CharsetDecoder);
    method public void close() throws java.io.IOException;
    method public String getEncoding();
    method public int read(char[], int, int) throws java.io.IOException;
  }

  public class InterruptedIOException extends java.io.IOException {
    ctor public InterruptedIOException();
    ctor public InterruptedIOException(String);
    field public int bytesTransferred;
  }

  public class InvalidClassException extends java.io.ObjectStreamException {
    ctor public InvalidClassException(String);
    ctor public InvalidClassException(String, String);
    field public String classname;
  }

  public class InvalidObjectException extends java.io.ObjectStreamException {
    ctor public InvalidObjectException(String);
  }

  @Deprecated public class LineNumberInputStream extends java.io.FilterInputStream {
    ctor @Deprecated public LineNumberInputStream(java.io.InputStream);
    method @Deprecated public int getLineNumber();
    method @Deprecated public void setLineNumber(int);
  }

  public class LineNumberReader extends java.io.BufferedReader {
    ctor public LineNumberReader(java.io.Reader);
    ctor public LineNumberReader(java.io.Reader, int);
    method public int getLineNumber();
    method public void setLineNumber(int);
  }

  public class NotActiveException extends java.io.ObjectStreamException {
    ctor public NotActiveException(String);
    ctor public NotActiveException();
  }

  public class NotSerializableException extends java.io.ObjectStreamException {
    ctor public NotSerializableException(String);
    ctor public NotSerializableException();
  }

  public interface ObjectInput extends java.io.DataInput java.lang.AutoCloseable {
    method public int available() throws java.io.IOException;
    method public void close() throws java.io.IOException;
    method public int read() throws java.io.IOException;
    method public int read(byte[]) throws java.io.IOException;
    method public int read(byte[], int, int) throws java.io.IOException;
    method public Object readObject() throws java.lang.ClassNotFoundException, java.io.IOException;
    method public long skip(long) throws java.io.IOException;
  }

  public class ObjectInputStream extends java.io.InputStream implements java.io.ObjectInput java.io.ObjectStreamConstants {
    ctor public ObjectInputStream(java.io.InputStream) throws java.io.IOException;
    ctor protected ObjectInputStream() throws java.io.IOException, java.lang.SecurityException;
    method public void defaultReadObject() throws java.lang.ClassNotFoundException, java.io.IOException;
    method protected boolean enableResolveObject(boolean) throws java.lang.SecurityException;
    method public int read() throws java.io.IOException;
    method public boolean readBoolean() throws java.io.IOException;
    method public byte readByte() throws java.io.IOException;
    method public char readChar() throws java.io.IOException;
    method protected java.io.ObjectStreamClass readClassDescriptor() throws java.lang.ClassNotFoundException, java.io.IOException;
    method public double readDouble() throws java.io.IOException;
    method public java.io.ObjectInputStream.GetField readFields() throws java.lang.ClassNotFoundException, java.io.IOException;
    method public float readFloat() throws java.io.IOException;
    method public void readFully(byte[]) throws java.io.IOException;
    method public void readFully(byte[], int, int) throws java.io.IOException;
    method public int readInt() throws java.io.IOException;
    method @Deprecated public String readLine() throws java.io.IOException;
    method public long readLong() throws java.io.IOException;
    method public final Object readObject() throws java.lang.ClassNotFoundException, java.io.IOException;
    method protected Object readObjectOverride() throws java.lang.ClassNotFoundException, java.io.IOException;
    method public short readShort() throws java.io.IOException;
    method protected void readStreamHeader() throws java.io.IOException, java.io.StreamCorruptedException;
    method public String readUTF() throws java.io.IOException;
    method public Object readUnshared() throws java.lang.ClassNotFoundException, java.io.IOException;
    method public int readUnsignedByte() throws java.io.IOException;
    method public int readUnsignedShort() throws java.io.IOException;
    method public void registerValidation(java.io.ObjectInputValidation, int) throws java.io.InvalidObjectException, java.io.NotActiveException;
    method protected Class<?> resolveClass(java.io.ObjectStreamClass) throws java.lang.ClassNotFoundException, java.io.IOException;
    method protected Object resolveObject(Object) throws java.io.IOException;
    method protected Class<?> resolveProxyClass(String[]) throws java.lang.ClassNotFoundException, java.io.IOException;
    method public int skipBytes(int) throws java.io.IOException;
  }

  public abstract static class ObjectInputStream.GetField {
    ctor public ObjectInputStream.GetField();
    method public abstract boolean defaulted(String) throws java.io.IOException;
    method public abstract boolean get(String, boolean) throws java.io.IOException;
    method public abstract byte get(String, byte) throws java.io.IOException;
    method public abstract char get(String, char) throws java.io.IOException;
    method public abstract short get(String, short) throws java.io.IOException;
    method public abstract int get(String, int) throws java.io.IOException;
    method public abstract long get(String, long) throws java.io.IOException;
    method public abstract float get(String, float) throws java.io.IOException;
    method public abstract double get(String, double) throws java.io.IOException;
    method public abstract Object get(String, Object) throws java.io.IOException;
    method public abstract java.io.ObjectStreamClass getObjectStreamClass();
  }

  public interface ObjectInputValidation {
    method public void validateObject() throws java.io.InvalidObjectException;
  }

  public interface ObjectOutput extends java.io.DataOutput java.lang.AutoCloseable {
    method public void close() throws java.io.IOException;
    method public void flush() throws java.io.IOException;
    method public void writeObject(Object) throws java.io.IOException;
  }

  public class ObjectOutputStream extends java.io.OutputStream implements java.io.ObjectOutput java.io.ObjectStreamConstants {
    ctor public ObjectOutputStream(java.io.OutputStream) throws java.io.IOException;
    ctor protected ObjectOutputStream() throws java.io.IOException, java.lang.SecurityException;
    method protected void annotateClass(Class<?>) throws java.io.IOException;
    method protected void annotateProxyClass(Class<?>) throws java.io.IOException;
    method public void defaultWriteObject() throws java.io.IOException;
    method protected void drain() throws java.io.IOException;
    method protected boolean enableReplaceObject(boolean) throws java.lang.SecurityException;
    method public java.io.ObjectOutputStream.PutField putFields() throws java.io.IOException;
    method protected Object replaceObject(Object) throws java.io.IOException;
    method public void reset() throws java.io.IOException;
    method public void useProtocolVersion(int) throws java.io.IOException;
    method public void write(int) throws java.io.IOException;
    method public void writeBoolean(boolean) throws java.io.IOException;
    method public void writeByte(int) throws java.io.IOException;
    method public void writeBytes(String) throws java.io.IOException;
    method public void writeChar(int) throws java.io.IOException;
    method public void writeChars(String) throws java.io.IOException;
    method protected void writeClassDescriptor(java.io.ObjectStreamClass) throws java.io.IOException;
    method public void writeDouble(double) throws java.io.IOException;
    method public void writeFields() throws java.io.IOException;
    method public void writeFloat(float) throws java.io.IOException;
    method public void writeInt(int) throws java.io.IOException;
    method public void writeLong(long) throws java.io.IOException;
    method public final void writeObject(Object) throws java.io.IOException;
    method protected void writeObjectOverride(Object) throws java.io.IOException;
    method public void writeShort(int) throws java.io.IOException;
    method protected void writeStreamHeader() throws java.io.IOException;
    method public void writeUTF(String) throws java.io.IOException;
    method public void writeUnshared(Object) throws java.io.IOException;
  }

  public abstract static class ObjectOutputStream.PutField {
    ctor public ObjectOutputStream.PutField();
    method public abstract void put(String, boolean);
    method public abstract void put(String, byte);
    method public abstract void put(String, char);
    method public abstract void put(String, short);
    method public abstract void put(String, int);
    method public abstract void put(String, long);
    method public abstract void put(String, float);
    method public abstract void put(String, double);
    method public abstract void put(String, Object);
    method @Deprecated public abstract void write(java.io.ObjectOutput) throws java.io.IOException;
  }

  public class ObjectStreamClass implements java.io.Serializable {
    method public Class<?> forClass();
    method public java.io.ObjectStreamField getField(String);
    method public java.io.ObjectStreamField[] getFields();
    method public String getName();
    method public long getSerialVersionUID();
    method public static java.io.ObjectStreamClass lookup(Class<?>);
    method public static java.io.ObjectStreamClass lookupAny(Class<?>);
    field public static final java.io.ObjectStreamField[] NO_FIELDS;
  }

  public interface ObjectStreamConstants {
    field public static final int PROTOCOL_VERSION_1 = 1; // 0x1
    field public static final int PROTOCOL_VERSION_2 = 2; // 0x2
    field public static final byte SC_BLOCK_DATA = 8; // 0x8
    field public static final byte SC_ENUM = 16; // 0x10
    field public static final byte SC_EXTERNALIZABLE = 4; // 0x4
    field public static final byte SC_SERIALIZABLE = 2; // 0x2
    field public static final byte SC_WRITE_METHOD = 1; // 0x1
    field public static final short STREAM_MAGIC = -21267; // 0xffffaced
    field public static final short STREAM_VERSION = 5; // 0x5
    field public static final java.io.SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION;
    field public static final java.io.SerializablePermission SUBSTITUTION_PERMISSION;
    field public static final byte TC_ARRAY = 117; // 0x75
    field public static final byte TC_BASE = 112; // 0x70
    field public static final byte TC_BLOCKDATA = 119; // 0x77
    field public static final byte TC_BLOCKDATALONG = 122; // 0x7a
    field public static final byte TC_CLASS = 118; // 0x76
    field public static final byte TC_CLASSDESC = 114; // 0x72
    field public static final byte TC_ENDBLOCKDATA = 120; // 0x78
    field public static final byte TC_ENUM = 126; // 0x7e
    field public static final byte TC_EXCEPTION = 123; // 0x7b
    field public static final byte TC_LONGSTRING = 124; // 0x7c
    field public static final byte TC_MAX = 126; // 0x7e
    field public static final byte TC_NULL = 112; // 0x70
    field public static final byte TC_OBJECT = 115; // 0x73
    field public static final byte TC_PROXYCLASSDESC = 125; // 0x7d
    field public static final byte TC_REFERENCE = 113; // 0x71
    field public static final byte TC_RESET = 121; // 0x79
    field public static final byte TC_STRING = 116; // 0x74
    field public static final int baseWireHandle = 8257536; // 0x7e0000
  }

  public abstract class ObjectStreamException extends java.io.IOException {
    ctor protected ObjectStreamException(String);
    ctor protected ObjectStreamException();
  }

  public class ObjectStreamField implements java.lang.Comparable<java.lang.Object> {
    ctor public ObjectStreamField(String, Class<?>);
    ctor public ObjectStreamField(String, Class<?>, boolean);
    method public int compareTo(Object);
    method public String getName();
    method public int getOffset();
    method public Class<?> getType();
    method public char getTypeCode();
    method public String getTypeString();
    method public boolean isPrimitive();
    method public boolean isUnshared();
    method protected void setOffset(int);
  }

  public class OptionalDataException extends java.io.ObjectStreamException {
    field public boolean eof;
    field public int length;
  }

  public abstract class OutputStream implements java.io.Closeable java.io.Flushable {
    ctor public OutputStream();
    method public void close() throws java.io.IOException;
    method public void flush() throws java.io.IOException;
    method public abstract void write(int) throws java.io.IOException;
    method public void write(byte[]) throws java.io.IOException;
    method public void write(byte[], int, int) throws java.io.IOException;
  }

  public class OutputStreamWriter extends java.io.Writer {
    ctor public OutputStreamWriter(java.io.OutputStream, String) throws java.io.UnsupportedEncodingException;
    ctor public OutputStreamWriter(java.io.OutputStream);
    ctor public OutputStreamWriter(java.io.OutputStream, java.nio.charset.Charset);
    ctor public OutputStreamWriter(java.io.OutputStream, java.nio.charset.CharsetEncoder);
    method public void close() throws java.io.IOException;
    method public void flush() throws java.io.IOException;
    method public String getEncoding();
    method public void write(char[], int, int) throws java.io.IOException;
  }

  public class PipedInputStream extends java.io.InputStream {
    ctor public PipedInputStream(java.io.PipedOutputStream) throws java.io.IOException;
    ctor public PipedInputStream(java.io.PipedOutputStream, int) throws java.io.IOException;
    ctor public PipedInputStream();
    ctor public PipedInputStream(int);
    method public void connect(java.io.PipedOutputStream) throws java.io.IOException;
    method public int read() throws java.io.IOException;
    method protected void receive(int) throws java.io.IOException;
    field protected static final int PIPE_SIZE = 1024; // 0x400
    field protected byte[] buffer;
    field protected int in;
    field protected int out;
  }

  public class PipedOutputStream extends java.io.OutputStream {
    ctor public PipedOutputStream(java.io.PipedInputStream) throws java.io.IOException;
    ctor public PipedOutputStream();
    method public void connect(java.io.PipedInputStream) throws java.io.IOException;
    method public void write(int) throws java.io.IOException;
  }

  public class PipedReader extends java.io.Reader {
    ctor public PipedReader(java.io.PipedWriter) throws java.io.IOException;
    ctor public PipedReader(java.io.PipedWriter, int) throws java.io.IOException;
    ctor public PipedReader();
    ctor public PipedReader(int);
    method public void close() throws java.io.IOException;
    method public void connect(java.io.PipedWriter) throws java.io.IOException;
    method public int read(char[], int, int) throws java.io.IOException;
  }

  public class PipedWriter extends java.io.Writer {
    ctor public PipedWriter(java.io.PipedReader) throws java.io.IOException;
    ctor public PipedWriter();
    method public void close() throws java.io.IOException;
    method public void connect(java.io.PipedReader) throws java.io.IOException;
    method public void flush() throws java.io.IOException;
    method public void write(char[], int, int) throws java.io.IOException;
  }

  public class PrintStream extends java.io.FilterOutputStream implements java.lang.Appendable java.io.Closeable {
    ctor public PrintStream(java.io.OutputStream);
    ctor public PrintStream(java.io.OutputStream, boolean);
    ctor public PrintStream(java.io.OutputStream, boolean, String) throws java.io.UnsupportedEncodingException;
    ctor public PrintStream(String) throws java.io.FileNotFoundException;
    ctor public PrintStream(String, String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    ctor public PrintStream(java.io.File) throws java.io.FileNotFoundException;
    ctor public PrintStream(java.io.File, String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    method public java.io.PrintStream append(CharSequence);
    method public java.io.PrintStream append(CharSequence, int, int);
    method public java.io.PrintStream append(char);
    method public boolean checkError();
    method protected void clearError();
    method public void close();
    method public void flush();
    method public java.io.PrintStream format(String, java.lang.Object...);
    method public java.io.PrintStream format(java.util.Locale, String, java.lang.Object...);
    method public void print(boolean);
    method public void print(char);
    method public void print(int);
    method public void print(long);
    method public void print(float);
    method public void print(double);
    method public void print(char[]);
    method public void print(String);
    method public void print(Object);
    method public java.io.PrintStream printf(String, java.lang.Object...);
    method public java.io.PrintStream printf(java.util.Locale, String, java.lang.Object...);
    method public void println();
    method public void println(boolean);
    method public void println(char);
    method public void println(int);
    method public void println(long);
    method public void println(float);
    method public void println(double);
    method public void println(char[]);
    method public void println(String);
    method public void println(Object);
    method protected void setError();
    method public void write(int);
    method public void write(byte[], int, int);
  }

  public class PrintWriter extends java.io.Writer {
    ctor public PrintWriter(@NonNull java.io.Writer);
    ctor public PrintWriter(@NonNull java.io.Writer, boolean);
    ctor public PrintWriter(@NonNull java.io.OutputStream);
    ctor public PrintWriter(@NonNull java.io.OutputStream, boolean);
    ctor public PrintWriter(@NonNull String) throws java.io.FileNotFoundException;
    ctor public PrintWriter(@NonNull String, @NonNull String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    ctor public PrintWriter(@NonNull java.io.File) throws java.io.FileNotFoundException;
    ctor public PrintWriter(@NonNull java.io.File, @NonNull String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    method @NonNull public java.io.PrintWriter append(@Nullable CharSequence);
    method @NonNull public java.io.PrintWriter append(@Nullable CharSequence, int, int);
    method @NonNull public java.io.PrintWriter append(char);
    method public boolean checkError();
    method protected void clearError();
    method public void close();
    method public void flush();
    method @NonNull public java.io.PrintWriter format(@NonNull String, @NonNull java.lang.Object...);
    method @NonNull public java.io.PrintWriter format(@Nullable java.util.Locale, @NonNull String, @NonNull java.lang.Object...);
    method public void print(boolean);
    method public void print(char);
    method public void print(int);
    method public void print(long);
    method public void print(float);
    method public void print(double);
    method public void print(char[]);
    method public void print(@Nullable String);
    method public void print(@Nullable Object);
    method @NonNull public java.io.PrintWriter printf(@NonNull String, @NonNull java.lang.Object...);
    method @NonNull public java.io.PrintWriter printf(@Nullable java.util.Locale, @NonNull String, @NonNull java.lang.Object...);
    method public void println();
    method public void println(boolean);
    method public void println(char);
    method public void println(int);
    method public void println(long);
    method public void println(float);
    method public void println(double);
    method public void println(char[]);
    method public void println(@Nullable String);
    method public void println(@Nullable Object);
    method protected void setError();
    method public void write(int);
    method public void write(char[], int, int);
    method public void write(char[]);
    method public void write(@NonNull String, int, int);
    method public void write(@NonNull String);
    field protected java.io.Writer out;
  }

  public class PushbackInputStream extends java.io.FilterInputStream {
    ctor public PushbackInputStream(java.io.InputStream, int);
    ctor public PushbackInputStream(java.io.InputStream);
    method public void unread(int) throws java.io.IOException;
    method public void unread(byte[], int, int) throws java.io.IOException;
    method public void unread(byte[]) throws java.io.IOException;
    field protected byte[] buf;
    field protected int pos;
  }

  public class PushbackReader extends java.io.FilterReader {
    ctor public PushbackReader(java.io.Reader, int);
    ctor public PushbackReader(java.io.Reader);
    method public void unread(int) throws java.io.IOException;
    method public void unread(char[], int, int) throws java.io.IOException;
    method public void unread(char[]) throws java.io.IOException;
  }

  public class RandomAccessFile implements java.io.Closeable java.io.DataInput java.io.DataOutput {
    ctor public RandomAccessFile(String, String) throws java.io.FileNotFoundException;
    ctor public RandomAccessFile(java.io.File, String) throws java.io.FileNotFoundException;
    method public void close() throws java.io.IOException;
    method public final java.nio.channels.FileChannel getChannel();
    method public final java.io.FileDescriptor getFD() throws java.io.IOException;
    method public long getFilePointer() throws java.io.IOException;
    method public long length() throws java.io.IOException;
    method public int read() throws java.io.IOException;
    method public int read(byte[], int, int) throws java.io.IOException;
    method public int read(byte[]) throws java.io.IOException;
    method public final boolean readBoolean() throws java.io.IOException;
    method public final byte readByte() throws java.io.IOException;
    method public final char readChar() throws java.io.IOException;
    method public final double readDouble() throws java.io.IOException;
    method public final float readFloat() throws java.io.IOException;
    method public final void readFully(byte[]) throws java.io.IOException;
    method public final void readFully(byte[], int, int) throws java.io.IOException;
    method public final int readInt() throws java.io.IOException;
    method public final String readLine() throws java.io.IOException;
    method public final long readLong() throws java.io.IOException;
    method public final short readShort() throws java.io.IOException;
    method public final String readUTF() throws java.io.IOException;
    method public final int readUnsignedByte() throws java.io.IOException;
    method public final int readUnsignedShort() throws java.io.IOException;
    method public void seek(long) throws java.io.IOException;
    method public void setLength(long) throws java.io.IOException;
    method public int skipBytes(int) throws java.io.IOException;
    method public void write(int) throws java.io.IOException;
    method public void write(byte[]) throws java.io.IOException;
    method public void write(byte[], int, int) throws java.io.IOException;
    method public final void writeBoolean(boolean) throws java.io.IOException;
    method public final void writeByte(int) throws java.io.IOException;
    method public final void writeBytes(String) throws java.io.IOException;
    method public final void writeChar(int) throws java.io.IOException;
    method public final void writeChars(String) throws java.io.IOException;
    method public final void writeDouble(double) throws java.io.IOException;
    method public final void writeFloat(float) throws java.io.IOException;
    method public final void writeInt(int) throws java.io.IOException;
    method public final void writeLong(long) throws java.io.IOException;
    method public final void writeShort(int) throws java.io.IOException;
    method public final void writeUTF(String) throws java.io.IOException;
  }

  public abstract class Reader implements java.io.Closeable java.lang.Readable {
    ctor protected Reader();
    ctor protected Reader(Object);
    method public void mark(int) throws java.io.IOException;
    method public boolean markSupported();
    method public int read(java.nio.CharBuffer) throws java.io.IOException;
    method public int read() throws java.io.IOException;
    method public int read(char[]) throws java.io.IOException;
    method public abstract int read(char[], int, int) throws java.io.IOException;
    method public boolean ready() throws java.io.IOException;
    method public void reset() throws java.io.IOException;
    method public long skip(long) throws java.io.IOException;
    field protected Object lock;
  }

  public class SequenceInputStream extends java.io.InputStream {
    ctor public SequenceInputStream(java.util.Enumeration<? extends java.io.InputStream>);
    ctor public SequenceInputStream(java.io.InputStream, java.io.InputStream);
    method public int read() throws java.io.IOException;
  }

  public interface Serializable {
  }

  public final class SerializablePermission extends java.security.BasicPermission {
    ctor public SerializablePermission(String);
    ctor public SerializablePermission(String, String);
  }

  public class StreamCorruptedException extends java.io.ObjectStreamException {
    ctor public StreamCorruptedException(String);
    ctor public StreamCorruptedException();
  }

  public class StreamTokenizer {
    ctor @Deprecated public StreamTokenizer(java.io.InputStream);
    ctor public StreamTokenizer(java.io.Reader);
    method public void commentChar(int);
    method public void eolIsSignificant(boolean);
    method public int lineno();
    method public void lowerCaseMode(boolean);
    method public int nextToken() throws java.io.IOException;
    method public void ordinaryChar(int);
    method public void ordinaryChars(int, int);
    method public void parseNumbers();
    method public void pushBack();
    method public void quoteChar(int);
    method public void resetSyntax();
    method public void slashSlashComments(boolean);
    method public void slashStarComments(boolean);
    method public void whitespaceChars(int, int);
    method public void wordChars(int, int);
    field public static final int TT_EOF = -1; // 0xffffffff
    field public static final int TT_EOL = 10; // 0xa
    field public static final int TT_NUMBER = -2; // 0xfffffffe
    field public static final int TT_WORD = -3; // 0xfffffffd
    field public double nval;
    field public String sval;
    field public int ttype;
  }

  @Deprecated public class StringBufferInputStream extends java.io.InputStream {
    ctor @Deprecated public StringBufferInputStream(String);
    method @Deprecated public int available();
    method @Deprecated public int read();
    method @Deprecated public int read(byte[], int, int);
    method @Deprecated public void reset();
    method @Deprecated public long skip(long);
    field @Deprecated protected String buffer;
    field @Deprecated protected int count;
    field @Deprecated protected int pos;
  }

  public class StringReader extends java.io.Reader {
    ctor public StringReader(String);
    method public void close();
    method public int read(char[], int, int) throws java.io.IOException;
  }

  public class StringWriter extends java.io.Writer {
    ctor public StringWriter();
    ctor public StringWriter(int);
    method public java.io.StringWriter append(CharSequence);
    method public java.io.StringWriter append(CharSequence, int, int);
    method public java.io.StringWriter append(char);
    method public void close() throws java.io.IOException;
    method public void flush();
    method public StringBuffer getBuffer();
    method public void write(int);
    method public void write(char[], int, int);
    method public void write(String);
    method public void write(String, int, int);
  }

  public class SyncFailedException extends java.io.IOException {
    ctor public SyncFailedException(String);
  }

  public class UTFDataFormatException extends java.io.IOException {
    ctor public UTFDataFormatException();
    ctor public UTFDataFormatException(String);
  }

  public class UncheckedIOException extends java.lang.RuntimeException {
    ctor public UncheckedIOException(String, java.io.IOException);
    ctor public UncheckedIOException(java.io.IOException);
    method public java.io.IOException getCause();
  }

  public class UnsupportedEncodingException extends java.io.IOException {
    ctor public UnsupportedEncodingException();
    ctor public UnsupportedEncodingException(String);
  }

  public class WriteAbortedException extends java.io.ObjectStreamException {
    ctor public WriteAbortedException(String, Exception);
    field public Exception detail;
  }

  public abstract class Writer implements java.lang.Appendable java.io.Closeable java.io.Flushable {
    ctor protected Writer();
    ctor protected Writer(Object);
    method public java.io.Writer append(CharSequence) throws java.io.IOException;
    method public java.io.Writer append(CharSequence, int, int) throws java.io.IOException;
    method public java.io.Writer append(char) throws java.io.IOException;
    method public void write(int) throws java.io.IOException;
    method public void write(char[]) throws java.io.IOException;
    method public abstract void write(char[], int, int) throws java.io.IOException;
    method public void write(String) throws java.io.IOException;
    method public void write(String, int, int) throws java.io.IOException;
    field protected Object lock;
  }

}

package java.lang {

  public class AbstractMethodError extends java.lang.IncompatibleClassChangeError {
    ctor public AbstractMethodError();
    ctor public AbstractMethodError(String);
  }

  public interface Appendable {
    method @NonNull public Appendable append(@Nullable CharSequence) throws java.io.IOException;
    method @NonNull public Appendable append(@Nullable CharSequence, int, int) throws java.io.IOException;
    method @NonNull public Appendable append(char) throws java.io.IOException;
  }

  public class ArithmeticException extends java.lang.RuntimeException {
    ctor public ArithmeticException();
    ctor public ArithmeticException(String);
  }

  public class ArrayIndexOutOfBoundsException extends java.lang.IndexOutOfBoundsException {
    ctor public ArrayIndexOutOfBoundsException();
    ctor public ArrayIndexOutOfBoundsException(int);
    ctor public ArrayIndexOutOfBoundsException(String);
  }

  public class ArrayStoreException extends java.lang.RuntimeException {
    ctor public ArrayStoreException();
    ctor public ArrayStoreException(String);
  }

  public class AssertionError extends java.lang.Error {
    ctor public AssertionError();
    ctor public AssertionError(Object);
    ctor public AssertionError(boolean);
    ctor public AssertionError(char);
    ctor public AssertionError(int);
    ctor public AssertionError(long);
    ctor public AssertionError(float);
    ctor public AssertionError(double);
    ctor public AssertionError(String, Throwable);
  }

  public interface AutoCloseable {
    method public void close() throws java.lang.Exception;
  }

  public final class Boolean implements java.lang.Comparable<java.lang.Boolean> java.io.Serializable {
    ctor public Boolean(boolean);
    ctor public Boolean(@Nullable String);
    method public boolean booleanValue();
    method public static int compare(boolean, boolean);
    method public int compareTo(@NonNull Boolean);
    method public static boolean getBoolean(@NonNull String);
    method public static int hashCode(boolean);
    method public static boolean logicalAnd(boolean, boolean);
    method public static boolean logicalOr(boolean, boolean);
    method public static boolean logicalXor(boolean, boolean);
    method public static boolean parseBoolean(@Nullable String);
    method @NonNull public static String toString(boolean);
    method @NonNull public static Boolean valueOf(boolean);
    method @NonNull public static Boolean valueOf(@Nullable String);
    field public static final Boolean FALSE;
    field public static final Boolean TRUE;
    field public static final Class<java.lang.Boolean> TYPE;
  }

  public class BootstrapMethodError extends java.lang.LinkageError {
    ctor public BootstrapMethodError();
    ctor public BootstrapMethodError(String);
    ctor public BootstrapMethodError(String, Throwable);
    ctor public BootstrapMethodError(Throwable);
  }

  public final class Byte extends java.lang.Number implements java.lang.Comparable<java.lang.Byte> {
    ctor public Byte(byte);
    ctor public Byte(@NonNull String) throws java.lang.NumberFormatException;
    method public static int compare(byte, byte);
    method public int compareTo(@NonNull Byte);
    method @NonNull public static Byte decode(@NonNull String) throws java.lang.NumberFormatException;
    method public double doubleValue();
    method public float floatValue();
    method public static int hashCode(byte);
    method public int intValue();
    method public long longValue();
    method public static byte parseByte(@NonNull String, int) throws java.lang.NumberFormatException;
    method public static byte parseByte(@NonNull String) throws java.lang.NumberFormatException;
    method @NonNull public static String toString(byte);
    method public static int toUnsignedInt(byte);
    method public static long toUnsignedLong(byte);
    method @NonNull public static Byte valueOf(byte);
    method @NonNull public static Byte valueOf(@NonNull String, int) throws java.lang.NumberFormatException;
    method @NonNull public static Byte valueOf(@NonNull String) throws java.lang.NumberFormatException;
    field public static final int BYTES = 1; // 0x1
    field public static final byte MAX_VALUE = 127; // 0x7f
    field public static final byte MIN_VALUE = -128; // 0xffffff80
    field public static final int SIZE = 8; // 0x8
    field public static final Class<java.lang.Byte> TYPE;
  }

  public interface CharSequence {
    method public char charAt(int);
    method @NonNull public default java.util.stream.IntStream chars();
    method @NonNull public default java.util.stream.IntStream codePoints();
    method public int length();
    method @NonNull public CharSequence subSequence(int, int);
    method @NonNull public String toString();
  }

  public final class Character implements java.lang.Comparable<java.lang.Character> java.io.Serializable {
    ctor public Character(char);
    method public static int charCount(int);
    method public char charValue();
    method public static int codePointAt(@NonNull CharSequence, int);
    method public static int codePointAt(char[], int);
    method public static int codePointAt(char[], int, int);
    method public static int codePointBefore(@NonNull CharSequence, int);
    method public static int codePointBefore(char[], int);
    method public static int codePointBefore(char[], int, int);
    method public static int codePointCount(@NonNull CharSequence, int, int);
    method public static int codePointCount(char[], int, int);
    method public static int compare(char, char);
    method public int compareTo(@NonNull Character);
    method public static int digit(char, int);
    method public static int digit(int, int);
    method public static char forDigit(int, int);
    method public static byte getDirectionality(char);
    method public static byte getDirectionality(int);
    method @Nullable public static String getName(int);
    method public static int getNumericValue(char);
    method public static int getNumericValue(int);
    method public static int getType(char);
    method public static int getType(int);
    method public static int hashCode(char);
    method public static char highSurrogate(int);
    method public static boolean isAlphabetic(int);
    method public static boolean isBmpCodePoint(int);
    method public static boolean isDefined(char);
    method public static boolean isDefined(int);
    method public static boolean isDigit(char);
    method public static boolean isDigit(int);
    method public static boolean isHighSurrogate(char);
    method public static boolean isISOControl(char);
    method public static boolean isISOControl(int);
    method public static boolean isIdentifierIgnorable(char);
    method public static boolean isIdentifierIgnorable(int);
    method public static boolean isIdeographic(int);
    method public static boolean isJavaIdentifierPart(char);
    method public static boolean isJavaIdentifierPart(int);
    method public static boolean isJavaIdentifierStart(char);
    method public static boolean isJavaIdentifierStart(int);
    method @Deprecated public static boolean isJavaLetter(char);
    method @Deprecated public static boolean isJavaLetterOrDigit(char);
    method public static boolean isLetter(char);
    method public static boolean isLetter(int);
    method public static boolean isLetterOrDigit(char);
    method public static boolean isLetterOrDigit(int);
    method public static boolean isLowSurrogate(char);
    method public static boolean isLowerCase(char);
    method public static boolean isLowerCase(int);
    method public static boolean isMirrored(char);
    method public static boolean isMirrored(int);
    method @Deprecated public static boolean isSpace(char);
    method public static boolean isSpaceChar(char);
    method public static boolean isSpaceChar(int);
    method public static boolean isSupplementaryCodePoint(int);
    method public static boolean isSurrogate(char);
    method public static boolean isSurrogatePair(char, char);
    method public static boolean isTitleCase(char);
    method public static boolean isTitleCase(int);
    method public static boolean isUnicodeIdentifierPart(char);
    method public static boolean isUnicodeIdentifierPart(int);
    method public static boolean isUnicodeIdentifierStart(char);
    method public static boolean isUnicodeIdentifierStart(int);
    method public static boolean isUpperCase(char);
    method public static boolean isUpperCase(int);
    method public static boolean isValidCodePoint(int);
    method public static boolean isWhitespace(char);
    method public static boolean isWhitespace(int);
    method public static char lowSurrogate(int);
    method public static int offsetByCodePoints(@NonNull CharSequence, int, int);
    method public static int offsetByCodePoints(char[], int, int, int, int);
    method public static char reverseBytes(char);
    method public static int toChars(int, char[], int);
    method public static char[] toChars(int);
    method public static int toCodePoint(char, char);
    method public static char toLowerCase(char);
    method public static int toLowerCase(int);
    method @NonNull public static String toString(char);
    method public static char toTitleCase(char);
    method public static int toTitleCase(int);
    method public static char toUpperCase(char);
    method public static int toUpperCase(int);
    method @NonNull public static Character valueOf(char);
    field public static final int BYTES = 2; // 0x2
    field public static final byte COMBINING_SPACING_MARK = 8; // 0x8
    field public static final byte CONNECTOR_PUNCTUATION = 23; // 0x17
    field public static final byte CONTROL = 15; // 0xf
    field public static final byte CURRENCY_SYMBOL = 26; // 0x1a
    field public static final byte DASH_PUNCTUATION = 20; // 0x14
    field public static final byte DECIMAL_DIGIT_NUMBER = 9; // 0x9
    field public static final byte DIRECTIONALITY_ARABIC_NUMBER = 6; // 0x6
    field public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL = 9; // 0x9
    field public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR = 7; // 0x7
    field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER = 3; // 0x3
    field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR = 4; // 0x4
    field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR = 5; // 0x5
    field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT = 0; // 0x0
    field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING = 14; // 0xe
    field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE = 15; // 0xf
    field public static final byte DIRECTIONALITY_NONSPACING_MARK = 8; // 0x8
    field public static final byte DIRECTIONALITY_OTHER_NEUTRALS = 13; // 0xd
    field public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR = 10; // 0xa
    field public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = 18; // 0x12
    field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT = 1; // 0x1
    field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC = 2; // 0x2
    field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING = 16; // 0x10
    field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE = 17; // 0x11
    field public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR = 11; // 0xb
    field public static final byte DIRECTIONALITY_UNDEFINED = -1; // 0xffffffff
    field public static final byte DIRECTIONALITY_WHITESPACE = 12; // 0xc
    field public static final byte ENCLOSING_MARK = 7; // 0x7
    field public static final byte END_PUNCTUATION = 22; // 0x16
    field public static final byte FINAL_QUOTE_PUNCTUATION = 30; // 0x1e
    field public static final byte FORMAT = 16; // 0x10
    field public static final byte INITIAL_QUOTE_PUNCTUATION = 29; // 0x1d
    field public static final byte LETTER_NUMBER = 10; // 0xa
    field public static final byte LINE_SEPARATOR = 13; // 0xd
    field public static final byte LOWERCASE_LETTER = 2; // 0x2
    field public static final byte MATH_SYMBOL = 25; // 0x19
    field public static final int MAX_CODE_POINT = 1114111; // 0x10ffff
    field public static final char MAX_HIGH_SURROGATE = 56319; // 0xdbff '\udbff'
    field public static final char MAX_LOW_SURROGATE = 57343; // 0xdfff '\udfff'
    field public static final int MAX_RADIX = 36; // 0x24
    field public static final char MAX_SURROGATE = 57343; // 0xdfff '\udfff'
    field public static final char MAX_VALUE = 65535; // 0xffff '\uffff'
    field public static final int MIN_CODE_POINT = 0; // 0x0
    field public static final char MIN_HIGH_SURROGATE = 55296; // 0xd800 '\ud800'
    field public static final char MIN_LOW_SURROGATE = 56320; // 0xdc00 '\udc00'
    field public static final int MIN_RADIX = 2; // 0x2
    field public static final int MIN_SUPPLEMENTARY_CODE_POINT = 65536; // 0x10000
    field public static final char MIN_SURROGATE = 55296; // 0xd800 '\ud800'
    field public static final char MIN_VALUE = 0; // 0x0000 '\u0000'
    field public static final byte MODIFIER_LETTER = 4; // 0x4
    field public static final byte MODIFIER_SYMBOL = 27; // 0x1b
    field public static final byte NON_SPACING_MARK = 6; // 0x6
    field public static final byte OTHER_LETTER = 5; // 0x5
    field public static final byte OTHER_NUMBER = 11; // 0xb
    field public static final byte OTHER_PUNCTUATION = 24; // 0x18
    field public static final byte OTHER_SYMBOL = 28; // 0x1c
    field public static final byte PARAGRAPH_SEPARATOR = 14; // 0xe
    field public static final byte PRIVATE_USE = 18; // 0x12
    field public static final int SIZE = 16; // 0x10
    field public static final byte SPACE_SEPARATOR = 12; // 0xc
    field public static final byte START_PUNCTUATION = 21; // 0x15
    field public static final byte SURROGATE = 19; // 0x13
    field public static final byte TITLECASE_LETTER = 3; // 0x3
    field public static final Class<java.lang.Character> TYPE;
    field public static final byte UNASSIGNED = 0; // 0x0
    field public static final byte UPPERCASE_LETTER = 1; // 0x1
  }

  public static class Character.Subset {
    ctor protected Character.Subset(@NonNull String);
    method public final boolean equals(@Nullable Object);
    method public final int hashCode();
    method @NonNull public final String toString();
  }

  public static final class Character.UnicodeBlock extends java.lang.Character.Subset {
    method @NonNull public static java.lang.Character.UnicodeBlock forName(@NonNull String);
    method @Nullable public static java.lang.Character.UnicodeBlock of(char);
    method @Nullable public static java.lang.Character.UnicodeBlock of(int);
    field public static final java.lang.Character.UnicodeBlock AEGEAN_NUMBERS;
    field public static final java.lang.Character.UnicodeBlock ALCHEMICAL_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock ALPHABETIC_PRESENTATION_FORMS;
    field public static final java.lang.Character.UnicodeBlock ANCIENT_GREEK_MUSICAL_NOTATION;
    field public static final java.lang.Character.UnicodeBlock ANCIENT_GREEK_NUMBERS;
    field public static final java.lang.Character.UnicodeBlock ANCIENT_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock ARABIC;
    field public static final java.lang.Character.UnicodeBlock ARABIC_EXTENDED_A;
    field public static final java.lang.Character.UnicodeBlock ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock ARABIC_PRESENTATION_FORMS_A;
    field public static final java.lang.Character.UnicodeBlock ARABIC_PRESENTATION_FORMS_B;
    field public static final java.lang.Character.UnicodeBlock ARABIC_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock ARMENIAN;
    field public static final java.lang.Character.UnicodeBlock ARROWS;
    field public static final java.lang.Character.UnicodeBlock AVESTAN;
    field public static final java.lang.Character.UnicodeBlock BALINESE;
    field public static final java.lang.Character.UnicodeBlock BAMUM;
    field public static final java.lang.Character.UnicodeBlock BAMUM_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock BASIC_LATIN;
    field public static final java.lang.Character.UnicodeBlock BATAK;
    field public static final java.lang.Character.UnicodeBlock BENGALI;
    field public static final java.lang.Character.UnicodeBlock BLOCK_ELEMENTS;
    field public static final java.lang.Character.UnicodeBlock BOPOMOFO;
    field public static final java.lang.Character.UnicodeBlock BOPOMOFO_EXTENDED;
    field public static final java.lang.Character.UnicodeBlock BOX_DRAWING;
    field public static final java.lang.Character.UnicodeBlock BRAHMI;
    field public static final java.lang.Character.UnicodeBlock BRAILLE_PATTERNS;
    field public static final java.lang.Character.UnicodeBlock BUGINESE;
    field public static final java.lang.Character.UnicodeBlock BUHID;
    field public static final java.lang.Character.UnicodeBlock BYZANTINE_MUSICAL_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock CARIAN;
    field public static final java.lang.Character.UnicodeBlock CHAKMA;
    field public static final java.lang.Character.UnicodeBlock CHAM;
    field public static final java.lang.Character.UnicodeBlock CHEROKEE;
    field public static final java.lang.Character.UnicodeBlock CJK_COMPATIBILITY;
    field public static final java.lang.Character.UnicodeBlock CJK_COMPATIBILITY_FORMS;
    field public static final java.lang.Character.UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS;
    field public static final java.lang.Character.UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock CJK_RADICALS_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock CJK_STROKES;
    field public static final java.lang.Character.UnicodeBlock CJK_SYMBOLS_AND_PUNCTUATION;
    field public static final java.lang.Character.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS;
    field public static final java.lang.Character.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A;
    field public static final java.lang.Character.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B;
    field public static final java.lang.Character.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C;
    field public static final java.lang.Character.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D;
    field public static final java.lang.Character.UnicodeBlock COMBINING_DIACRITICAL_MARKS;
    field public static final java.lang.Character.UnicodeBlock COMBINING_DIACRITICAL_MARKS_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock COMBINING_HALF_MARKS;
    field public static final java.lang.Character.UnicodeBlock COMBINING_MARKS_FOR_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock COMMON_INDIC_NUMBER_FORMS;
    field public static final java.lang.Character.UnicodeBlock CONTROL_PICTURES;
    field public static final java.lang.Character.UnicodeBlock COPTIC;
    field public static final java.lang.Character.UnicodeBlock COUNTING_ROD_NUMERALS;
    field public static final java.lang.Character.UnicodeBlock CUNEIFORM;
    field public static final java.lang.Character.UnicodeBlock CUNEIFORM_NUMBERS_AND_PUNCTUATION;
    field public static final java.lang.Character.UnicodeBlock CURRENCY_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock CYPRIOT_SYLLABARY;
    field public static final java.lang.Character.UnicodeBlock CYRILLIC;
    field public static final java.lang.Character.UnicodeBlock CYRILLIC_EXTENDED_A;
    field public static final java.lang.Character.UnicodeBlock CYRILLIC_EXTENDED_B;
    field public static final java.lang.Character.UnicodeBlock CYRILLIC_SUPPLEMENTARY;
    field public static final java.lang.Character.UnicodeBlock DESERET;
    field public static final java.lang.Character.UnicodeBlock DEVANAGARI;
    field public static final java.lang.Character.UnicodeBlock DEVANAGARI_EXTENDED;
    field public static final java.lang.Character.UnicodeBlock DINGBATS;
    field public static final java.lang.Character.UnicodeBlock DOMINO_TILES;
    field public static final java.lang.Character.UnicodeBlock EGYPTIAN_HIEROGLYPHS;
    field public static final java.lang.Character.UnicodeBlock EMOTICONS;
    field public static final java.lang.Character.UnicodeBlock ENCLOSED_ALPHANUMERICS;
    field public static final java.lang.Character.UnicodeBlock ENCLOSED_ALPHANUMERIC_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock ENCLOSED_CJK_LETTERS_AND_MONTHS;
    field public static final java.lang.Character.UnicodeBlock ENCLOSED_IDEOGRAPHIC_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock ETHIOPIC;
    field public static final java.lang.Character.UnicodeBlock ETHIOPIC_EXTENDED;
    field public static final java.lang.Character.UnicodeBlock ETHIOPIC_EXTENDED_A;
    field public static final java.lang.Character.UnicodeBlock ETHIOPIC_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock GENERAL_PUNCTUATION;
    field public static final java.lang.Character.UnicodeBlock GEOMETRIC_SHAPES;
    field public static final java.lang.Character.UnicodeBlock GEORGIAN;
    field public static final java.lang.Character.UnicodeBlock GEORGIAN_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock GLAGOLITIC;
    field public static final java.lang.Character.UnicodeBlock GOTHIC;
    field public static final java.lang.Character.UnicodeBlock GREEK;
    field public static final java.lang.Character.UnicodeBlock GREEK_EXTENDED;
    field public static final java.lang.Character.UnicodeBlock GUJARATI;
    field public static final java.lang.Character.UnicodeBlock GURMUKHI;
    field public static final java.lang.Character.UnicodeBlock HALFWIDTH_AND_FULLWIDTH_FORMS;
    field public static final java.lang.Character.UnicodeBlock HANGUL_COMPATIBILITY_JAMO;
    field public static final java.lang.Character.UnicodeBlock HANGUL_JAMO;
    field public static final java.lang.Character.UnicodeBlock HANGUL_JAMO_EXTENDED_A;
    field public static final java.lang.Character.UnicodeBlock HANGUL_JAMO_EXTENDED_B;
    field public static final java.lang.Character.UnicodeBlock HANGUL_SYLLABLES;
    field public static final java.lang.Character.UnicodeBlock HANUNOO;
    field public static final java.lang.Character.UnicodeBlock HEBREW;
    field public static final java.lang.Character.UnicodeBlock HIGH_PRIVATE_USE_SURROGATES;
    field public static final java.lang.Character.UnicodeBlock HIGH_SURROGATES;
    field public static final java.lang.Character.UnicodeBlock HIRAGANA;
    field public static final java.lang.Character.UnicodeBlock IDEOGRAPHIC_DESCRIPTION_CHARACTERS;
    field public static final java.lang.Character.UnicodeBlock IMPERIAL_ARAMAIC;
    field public static final java.lang.Character.UnicodeBlock INSCRIPTIONAL_PAHLAVI;
    field public static final java.lang.Character.UnicodeBlock INSCRIPTIONAL_PARTHIAN;
    field public static final java.lang.Character.UnicodeBlock IPA_EXTENSIONS;
    field public static final java.lang.Character.UnicodeBlock JAVANESE;
    field public static final java.lang.Character.UnicodeBlock KAITHI;
    field public static final java.lang.Character.UnicodeBlock KANA_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock KANBUN;
    field public static final java.lang.Character.UnicodeBlock KANGXI_RADICALS;
    field public static final java.lang.Character.UnicodeBlock KANNADA;
    field public static final java.lang.Character.UnicodeBlock KATAKANA;
    field public static final java.lang.Character.UnicodeBlock KATAKANA_PHONETIC_EXTENSIONS;
    field public static final java.lang.Character.UnicodeBlock KAYAH_LI;
    field public static final java.lang.Character.UnicodeBlock KHAROSHTHI;
    field public static final java.lang.Character.UnicodeBlock KHMER;
    field public static final java.lang.Character.UnicodeBlock KHMER_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock LAO;
    field public static final java.lang.Character.UnicodeBlock LATIN_1_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock LATIN_EXTENDED_A;
    field public static final java.lang.Character.UnicodeBlock LATIN_EXTENDED_ADDITIONAL;
    field public static final java.lang.Character.UnicodeBlock LATIN_EXTENDED_B;
    field public static final java.lang.Character.UnicodeBlock LATIN_EXTENDED_C;
    field public static final java.lang.Character.UnicodeBlock LATIN_EXTENDED_D;
    field public static final java.lang.Character.UnicodeBlock LEPCHA;
    field public static final java.lang.Character.UnicodeBlock LETTERLIKE_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock LIMBU;
    field public static final java.lang.Character.UnicodeBlock LINEAR_B_IDEOGRAMS;
    field public static final java.lang.Character.UnicodeBlock LINEAR_B_SYLLABARY;
    field public static final java.lang.Character.UnicodeBlock LISU;
    field public static final java.lang.Character.UnicodeBlock LOW_SURROGATES;
    field public static final java.lang.Character.UnicodeBlock LYCIAN;
    field public static final java.lang.Character.UnicodeBlock LYDIAN;
    field public static final java.lang.Character.UnicodeBlock MAHJONG_TILES;
    field public static final java.lang.Character.UnicodeBlock MALAYALAM;
    field public static final java.lang.Character.UnicodeBlock MANDAIC;
    field public static final java.lang.Character.UnicodeBlock MATHEMATICAL_ALPHANUMERIC_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock MATHEMATICAL_OPERATORS;
    field public static final java.lang.Character.UnicodeBlock MEETEI_MAYEK;
    field public static final java.lang.Character.UnicodeBlock MEETEI_MAYEK_EXTENSIONS;
    field public static final java.lang.Character.UnicodeBlock MEROITIC_CURSIVE;
    field public static final java.lang.Character.UnicodeBlock MEROITIC_HIEROGLYPHS;
    field public static final java.lang.Character.UnicodeBlock MIAO;
    field public static final java.lang.Character.UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A;
    field public static final java.lang.Character.UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B;
    field public static final java.lang.Character.UnicodeBlock MISCELLANEOUS_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_ARROWS;
    field public static final java.lang.Character.UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS;
    field public static final java.lang.Character.UnicodeBlock MISCELLANEOUS_TECHNICAL;
    field public static final java.lang.Character.UnicodeBlock MODIFIER_TONE_LETTERS;
    field public static final java.lang.Character.UnicodeBlock MONGOLIAN;
    field public static final java.lang.Character.UnicodeBlock MUSICAL_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock MYANMAR;
    field public static final java.lang.Character.UnicodeBlock MYANMAR_EXTENDED_A;
    field public static final java.lang.Character.UnicodeBlock NEW_TAI_LUE;
    field public static final java.lang.Character.UnicodeBlock NKO;
    field public static final java.lang.Character.UnicodeBlock NUMBER_FORMS;
    field public static final java.lang.Character.UnicodeBlock OGHAM;
    field public static final java.lang.Character.UnicodeBlock OLD_ITALIC;
    field public static final java.lang.Character.UnicodeBlock OLD_PERSIAN;
    field public static final java.lang.Character.UnicodeBlock OLD_SOUTH_ARABIAN;
    field public static final java.lang.Character.UnicodeBlock OLD_TURKIC;
    field public static final java.lang.Character.UnicodeBlock OL_CHIKI;
    field public static final java.lang.Character.UnicodeBlock OPTICAL_CHARACTER_RECOGNITION;
    field public static final java.lang.Character.UnicodeBlock ORIYA;
    field public static final java.lang.Character.UnicodeBlock OSMANYA;
    field public static final java.lang.Character.UnicodeBlock PHAGS_PA;
    field public static final java.lang.Character.UnicodeBlock PHAISTOS_DISC;
    field public static final java.lang.Character.UnicodeBlock PHOENICIAN;
    field public static final java.lang.Character.UnicodeBlock PHONETIC_EXTENSIONS;
    field public static final java.lang.Character.UnicodeBlock PHONETIC_EXTENSIONS_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock PLAYING_CARDS;
    field public static final java.lang.Character.UnicodeBlock PRIVATE_USE_AREA;
    field public static final java.lang.Character.UnicodeBlock REJANG;
    field public static final java.lang.Character.UnicodeBlock RUMI_NUMERAL_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock RUNIC;
    field public static final java.lang.Character.UnicodeBlock SAMARITAN;
    field public static final java.lang.Character.UnicodeBlock SAURASHTRA;
    field public static final java.lang.Character.UnicodeBlock SHARADA;
    field public static final java.lang.Character.UnicodeBlock SHAVIAN;
    field public static final java.lang.Character.UnicodeBlock SINHALA;
    field public static final java.lang.Character.UnicodeBlock SMALL_FORM_VARIANTS;
    field public static final java.lang.Character.UnicodeBlock SORA_SOMPENG;
    field public static final java.lang.Character.UnicodeBlock SPACING_MODIFIER_LETTERS;
    field public static final java.lang.Character.UnicodeBlock SPECIALS;
    field public static final java.lang.Character.UnicodeBlock SUNDANESE;
    field public static final java.lang.Character.UnicodeBlock SUNDANESE_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock SUPERSCRIPTS_AND_SUBSCRIPTS;
    field public static final java.lang.Character.UnicodeBlock SUPPLEMENTAL_ARROWS_A;
    field public static final java.lang.Character.UnicodeBlock SUPPLEMENTAL_ARROWS_B;
    field public static final java.lang.Character.UnicodeBlock SUPPLEMENTAL_MATHEMATICAL_OPERATORS;
    field public static final java.lang.Character.UnicodeBlock SUPPLEMENTAL_PUNCTUATION;
    field public static final java.lang.Character.UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_A;
    field public static final java.lang.Character.UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_B;
    field @Deprecated public static final java.lang.Character.UnicodeBlock SURROGATES_AREA;
    field public static final java.lang.Character.UnicodeBlock SYLOTI_NAGRI;
    field public static final java.lang.Character.UnicodeBlock SYRIAC;
    field public static final java.lang.Character.UnicodeBlock TAGALOG;
    field public static final java.lang.Character.UnicodeBlock TAGBANWA;
    field public static final java.lang.Character.UnicodeBlock TAGS;
    field public static final java.lang.Character.UnicodeBlock TAI_LE;
    field public static final java.lang.Character.UnicodeBlock TAI_THAM;
    field public static final java.lang.Character.UnicodeBlock TAI_VIET;
    field public static final java.lang.Character.UnicodeBlock TAI_XUAN_JING_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock TAKRI;
    field public static final java.lang.Character.UnicodeBlock TAMIL;
    field public static final java.lang.Character.UnicodeBlock TELUGU;
    field public static final java.lang.Character.UnicodeBlock THAANA;
    field public static final java.lang.Character.UnicodeBlock THAI;
    field public static final java.lang.Character.UnicodeBlock TIBETAN;
    field public static final java.lang.Character.UnicodeBlock TIFINAGH;
    field public static final java.lang.Character.UnicodeBlock TRANSPORT_AND_MAP_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock UGARITIC;
    field public static final java.lang.Character.UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS;
    field public static final java.lang.Character.UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED;
    field public static final java.lang.Character.UnicodeBlock VAI;
    field public static final java.lang.Character.UnicodeBlock VARIATION_SELECTORS;
    field public static final java.lang.Character.UnicodeBlock VARIATION_SELECTORS_SUPPLEMENT;
    field public static final java.lang.Character.UnicodeBlock VEDIC_EXTENSIONS;
    field public static final java.lang.Character.UnicodeBlock VERTICAL_FORMS;
    field public static final java.lang.Character.UnicodeBlock YIJING_HEXAGRAM_SYMBOLS;
    field public static final java.lang.Character.UnicodeBlock YI_RADICALS;
    field public static final java.lang.Character.UnicodeBlock YI_SYLLABLES;
  }

  public enum Character.UnicodeScript {
    method @NonNull public static java.lang.Character.UnicodeScript forName(@NonNull String);
    method @NonNull public static java.lang.Character.UnicodeScript of(int);
    enum_constant public static final java.lang.Character.UnicodeScript ARABIC;
    enum_constant public static final java.lang.Character.UnicodeScript ARMENIAN;
    enum_constant public static final java.lang.Character.UnicodeScript AVESTAN;
    enum_constant public static final java.lang.Character.UnicodeScript BALINESE;
    enum_constant public static final java.lang.Character.UnicodeScript BAMUM;
    enum_constant public static final java.lang.Character.UnicodeScript BATAK;
    enum_constant public static final java.lang.Character.UnicodeScript BENGALI;
    enum_constant public static final java.lang.Character.UnicodeScript BOPOMOFO;
    enum_constant public static final java.lang.Character.UnicodeScript BRAHMI;
    enum_constant public static final java.lang.Character.UnicodeScript BRAILLE;
    enum_constant public static final java.lang.Character.UnicodeScript BUGINESE;
    enum_constant public static final java.lang.Character.UnicodeScript BUHID;
    enum_constant public static final java.lang.Character.UnicodeScript CANADIAN_ABORIGINAL;
    enum_constant public static final java.lang.Character.UnicodeScript CARIAN;
    enum_constant public static final java.lang.Character.UnicodeScript CHAKMA;
    enum_constant public static final java.lang.Character.UnicodeScript CHAM;
    enum_constant public static final java.lang.Character.UnicodeScript CHEROKEE;
    enum_constant public static final java.lang.Character.UnicodeScript COMMON;
    enum_constant public static final java.lang.Character.UnicodeScript COPTIC;
    enum_constant public static final java.lang.Character.UnicodeScript CUNEIFORM;
    enum_constant public static final java.lang.Character.UnicodeScript CYPRIOT;
    enum_constant public static final java.lang.Character.UnicodeScript CYRILLIC;
    enum_constant public static final java.lang.Character.UnicodeScript DESERET;
    enum_constant public static final java.lang.Character.UnicodeScript DEVANAGARI;
    enum_constant public static final java.lang.Character.UnicodeScript EGYPTIAN_HIEROGLYPHS;
    enum_constant public static final java.lang.Character.UnicodeScript ETHIOPIC;
    enum_constant public static final java.lang.Character.UnicodeScript GEORGIAN;
    enum_constant public static final java.lang.Character.UnicodeScript GLAGOLITIC;
    enum_constant public static final java.lang.Character.UnicodeScript GOTHIC;
    enum_constant public static final java.lang.Character.UnicodeScript GREEK;
    enum_constant public static final java.lang.Character.UnicodeScript GUJARATI;
    enum_constant public static final java.lang.Character.UnicodeScript GURMUKHI;
    enum_constant public static final java.lang.Character.UnicodeScript HAN;
    enum_constant public static final java.lang.Character.UnicodeScript HANGUL;
    enum_constant public static final java.lang.Character.UnicodeScript HANUNOO;
    enum_constant public static final java.lang.Character.UnicodeScript HEBREW;
    enum_constant public static final java.lang.Character.UnicodeScript HIRAGANA;
    enum_constant public static final java.lang.Character.UnicodeScript IMPERIAL_ARAMAIC;
    enum_constant public static final java.lang.Character.UnicodeScript INHERITED;
    enum_constant public static final java.lang.Character.UnicodeScript INSCRIPTIONAL_PAHLAVI;
    enum_constant public static final java.lang.Character.UnicodeScript INSCRIPTIONAL_PARTHIAN;
    enum_constant public static final java.lang.Character.UnicodeScript JAVANESE;
    enum_constant public static final java.lang.Character.UnicodeScript KAITHI;
    enum_constant public static final java.lang.Character.UnicodeScript KANNADA;
    enum_constant public static final java.lang.Character.UnicodeScript KATAKANA;
    enum_constant public static final java.lang.Character.UnicodeScript KAYAH_LI;
    enum_constant public static final java.lang.Character.UnicodeScript KHAROSHTHI;
    enum_constant public static final java.lang.Character.UnicodeScript KHMER;
    enum_constant public static final java.lang.Character.UnicodeScript LAO;
    enum_constant public static final java.lang.Character.UnicodeScript LATIN;
    enum_constant public static final java.lang.Character.UnicodeScript LEPCHA;
    enum_constant public static final java.lang.Character.UnicodeScript LIMBU;
    enum_constant public static final java.lang.Character.UnicodeScript LINEAR_B;
    enum_constant public static final java.lang.Character.UnicodeScript LISU;
    enum_constant public static final java.lang.Character.UnicodeScript LYCIAN;
    enum_constant public static final java.lang.Character.UnicodeScript LYDIAN;
    enum_constant public static final java.lang.Character.UnicodeScript MALAYALAM;
    enum_constant public static final java.lang.Character.UnicodeScript MANDAIC;
    enum_constant public static final java.lang.Character.UnicodeScript MEETEI_MAYEK;
    enum_constant public static final java.lang.Character.UnicodeScript MEROITIC_CURSIVE;
    enum_constant public static final java.lang.Character.UnicodeScript MEROITIC_HIEROGLYPHS;
    enum_constant public static final java.lang.Character.UnicodeScript MIAO;
    enum_constant public static final java.lang.Character.UnicodeScript MONGOLIAN;
    enum_constant public static final java.lang.Character.UnicodeScript MYANMAR;
    enum_constant public static final java.lang.Character.UnicodeScript NEW_TAI_LUE;
    enum_constant public static final java.lang.Character.UnicodeScript NKO;
    enum_constant public static final java.lang.Character.UnicodeScript OGHAM;
    enum_constant public static final java.lang.Character.UnicodeScript OLD_ITALIC;
    enum_constant public static final java.lang.Character.UnicodeScript OLD_PERSIAN;
    enum_constant public static final java.lang.Character.UnicodeScript OLD_SOUTH_ARABIAN;
    enum_constant public static final java.lang.Character.UnicodeScript OLD_TURKIC;
    enum_constant public static final java.lang.Character.UnicodeScript OL_CHIKI;
    enum_constant public static final java.lang.Character.UnicodeScript ORIYA;
    enum_constant public static final java.lang.Character.UnicodeScript OSMANYA;
    enum_constant public static final java.lang.Character.UnicodeScript PHAGS_PA;
    enum_constant public static final java.lang.Character.UnicodeScript PHOENICIAN;
    enum_constant public static final java.lang.Character.UnicodeScript REJANG;
    enum_constant public static final java.lang.Character.UnicodeScript RUNIC;
    enum_constant public static final java.lang.Character.UnicodeScript SAMARITAN;
    enum_constant public static final java.lang.Character.UnicodeScript SAURASHTRA;
    enum_constant public static final java.lang.Character.UnicodeScript SHARADA;
    enum_constant public static final java.lang.Character.UnicodeScript SHAVIAN;
    enum_constant public static final java.lang.Character.UnicodeScript SINHALA;
    enum_constant public static final java.lang.Character.UnicodeScript SORA_SOMPENG;
    enum_constant public static final java.lang.Character.UnicodeScript SUNDANESE;
    enum_constant public static final java.lang.Character.UnicodeScript SYLOTI_NAGRI;
    enum_constant public static final java.lang.Character.UnicodeScript SYRIAC;
    enum_constant public static final java.lang.Character.UnicodeScript TAGALOG;
    enum_constant public static final java.lang.Character.UnicodeScript TAGBANWA;
    enum_constant public static final java.lang.Character.UnicodeScript TAI_LE;
    enum_constant public static final java.lang.Character.UnicodeScript TAI_THAM;
    enum_constant public static final java.lang.Character.UnicodeScript TAI_VIET;
    enum_constant public static final java.lang.Character.UnicodeScript TAKRI;
    enum_constant public static final java.lang.Character.UnicodeScript TAMIL;
    enum_constant public static final java.lang.Character.UnicodeScript TELUGU;
    enum_constant public static final java.lang.Character.UnicodeScript THAANA;
    enum_constant public static final java.lang.Character.UnicodeScript THAI;
    enum_constant public static final java.lang.Character.UnicodeScript TIBETAN;
    enum_constant public static final java.lang.Character.UnicodeScript TIFINAGH;
    enum_constant public static final java.lang.Character.UnicodeScript UGARITIC;
    enum_constant public static final java.lang.Character.UnicodeScript UNKNOWN;
    enum_constant public static final java.lang.Character.UnicodeScript VAI;
    enum_constant public static final java.lang.Character.UnicodeScript YI;
  }

  public final class Class<T> implements java.lang.reflect.AnnotatedElement java.lang.reflect.GenericDeclaration java.io.Serializable java.lang.reflect.Type {
    method @NonNull public <U> Class<? extends U> asSubclass(@NonNull Class<U>);
    method @Nullable public T cast(@Nullable Object);
    method public boolean desiredAssertionStatus();
    method @NonNull public static Class<?> forName(@NonNull String) throws java.lang.ClassNotFoundException;
    method @NonNull public static Class<?> forName(@NonNull String, boolean, @Nullable ClassLoader) throws java.lang.ClassNotFoundException;
    method @Nullable public <A extends java.lang.annotation.Annotation> A getAnnotation(@NonNull Class<A>);
    method @NonNull public java.lang.annotation.Annotation[] getAnnotations();
    method @NonNull public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType(@NonNull Class<A>);
    method @Nullable public String getCanonicalName();
    method @Nullable public ClassLoader getClassLoader();
    method @NonNull public Class<?>[] getClasses();
    method @Nullable public Class<?> getComponentType();
    method @NonNull public java.lang.reflect.Constructor<T> getConstructor(@Nullable Class<?>...) throws java.lang.NoSuchMethodException, java.lang.SecurityException;
    method @NonNull public java.lang.reflect.Constructor<?>[] getConstructors() throws java.lang.SecurityException;
    method @Nullable public <A extends java.lang.annotation.Annotation> A getDeclaredAnnotation(@NonNull Class<A>);
    method @NonNull public java.lang.annotation.Annotation[] getDeclaredAnnotations();
    method @NonNull public Class<?>[] getDeclaredClasses();
    method @NonNull public java.lang.reflect.Constructor<T> getDeclaredConstructor(@Nullable Class<?>...) throws java.lang.NoSuchMethodException, java.lang.SecurityException;
    method @NonNull public java.lang.reflect.Constructor<?>[] getDeclaredConstructors() throws java.lang.SecurityException;
    method @NonNull public java.lang.reflect.Field getDeclaredField(@NonNull String) throws java.lang.NoSuchFieldException;
    method @NonNull public java.lang.reflect.Field[] getDeclaredFields();
    method @NonNull public java.lang.reflect.Method getDeclaredMethod(@NonNull String, @Nullable Class<?>...) throws java.lang.NoSuchMethodException, java.lang.SecurityException;
    method @NonNull public java.lang.reflect.Method[] getDeclaredMethods() throws java.lang.SecurityException;
    method @Nullable public Class<?> getDeclaringClass();
    method @Nullable public Class<?> getEnclosingClass();
    method @Nullable public java.lang.reflect.Constructor<?> getEnclosingConstructor();
    method @Nullable public java.lang.reflect.Method getEnclosingMethod();
    method @Nullable public T[] getEnumConstants();
    method @NonNull public java.lang.reflect.Field getField(@NonNull String) throws java.lang.NoSuchFieldException;
    method @NonNull public java.lang.reflect.Field[] getFields() throws java.lang.SecurityException;
    method @NonNull public java.lang.reflect.Type[] getGenericInterfaces();
    method @Nullable public java.lang.reflect.Type getGenericSuperclass();
    method @NonNull public Class<?>[] getInterfaces();
    method @NonNull public java.lang.reflect.Method getMethod(@NonNull String, @Nullable Class<?>...) throws java.lang.NoSuchMethodException, java.lang.SecurityException;
    method @NonNull public java.lang.reflect.Method[] getMethods() throws java.lang.SecurityException;
    method public int getModifiers();
    method @NonNull public String getName();
    method @Nullable public Package getPackage();
    method @Nullable public java.security.ProtectionDomain getProtectionDomain();
    method @Nullable public java.net.URL getResource(@NonNull String);
    method @Nullable public java.io.InputStream getResourceAsStream(@NonNull String);
    method @Nullable public Object[] getSigners();
    method @NonNull public String getSimpleName();
    method @Nullable public Class<? super T> getSuperclass();
    method @NonNull public java.lang.reflect.TypeVariable<java.lang.Class<T>>[] getTypeParameters();
    method public boolean isAnnotation();
    method public boolean isAnonymousClass();
    method public boolean isArray();
    method public boolean isAssignableFrom(@NonNull Class<?>);
    method public boolean isEnum();
    method public boolean isInstance(@Nullable Object);
    method public boolean isInterface();
    method public boolean isLocalClass();
    method public boolean isMemberClass();
    method public boolean isPrimitive();
    method public boolean isSynthetic();
    method @NonNull public T newInstance() throws java.lang.IllegalAccessException, java.lang.InstantiationException;
    method @NonNull public String toGenericString();
  }

  public class ClassCastException extends java.lang.RuntimeException {
    ctor public ClassCastException();
    ctor public ClassCastException(String);
  }

  public class ClassCircularityError extends java.lang.LinkageError {
    ctor public ClassCircularityError();
    ctor public ClassCircularityError(String);
  }

  public class ClassFormatError extends java.lang.LinkageError {
    ctor public ClassFormatError();
    ctor public ClassFormatError(String);
  }

  public abstract class ClassLoader {
    ctor protected ClassLoader(ClassLoader);
    ctor protected ClassLoader();
    method public void clearAssertionStatus();
    method @Deprecated protected final Class<?> defineClass(byte[], int, int) throws java.lang.ClassFormatError;
    method protected final Class<?> defineClass(String, byte[], int, int) throws java.lang.ClassFormatError;
    method protected final Class<?> defineClass(String, byte[], int, int, java.security.ProtectionDomain) throws java.lang.ClassFormatError;
    method protected final Class<?> defineClass(String, java.nio.ByteBuffer, java.security.ProtectionDomain) throws java.lang.ClassFormatError;
    method protected Package definePackage(String, String, String, String, String, String, String, java.net.URL) throws java.lang.IllegalArgumentException;
    method protected Class<?> findClass(String) throws java.lang.ClassNotFoundException;
    method protected String findLibrary(String);
    method protected final Class<?> findLoadedClass(String);
    method protected java.net.URL findResource(String);
    method protected java.util.Enumeration<java.net.URL> findResources(String) throws java.io.IOException;
    method protected final Class<?> findSystemClass(String) throws java.lang.ClassNotFoundException;
    method protected Package getPackage(String);
    method protected Package[] getPackages();
    method public final ClassLoader getParent();
    method public java.net.URL getResource(String);
    method public java.io.InputStream getResourceAsStream(String);
    method public java.util.Enumeration<java.net.URL> getResources(String) throws java.io.IOException;
    method public static ClassLoader getSystemClassLoader();
    method public static java.net.URL getSystemResource(String);
    method public static java.io.InputStream getSystemResourceAsStream(String);
    method public static java.util.Enumeration<java.net.URL> getSystemResources(String) throws java.io.IOException;
    method public Class<?> loadClass(String) throws java.lang.ClassNotFoundException;
    method protected Class<?> loadClass(String, boolean) throws java.lang.ClassNotFoundException;
    method protected static boolean registerAsParallelCapable();
    method protected final void resolveClass(Class<?>);
    method public void setClassAssertionStatus(String, boolean);
    method public void setDefaultAssertionStatus(boolean);
    method public void setPackageAssertionStatus(String, boolean);
    method protected final void setSigners(Class<?>, Object[]);
  }

  public class ClassNotFoundException extends java.lang.ReflectiveOperationException {
    ctor public ClassNotFoundException();
    ctor public ClassNotFoundException(String);
    ctor public ClassNotFoundException(String, Throwable);
    method public Throwable getException();
  }

  public class CloneNotSupportedException extends java.lang.Exception {
    ctor public CloneNotSupportedException();
    ctor public CloneNotSupportedException(String);
  }

  public interface Cloneable {
  }

  public interface Comparable<T> {
    method public int compareTo(T);
  }

  public final class Compiler {
    method public static Object command(Object);
    method public static boolean compileClass(Class<?>);
    method public static boolean compileClasses(String);
    method public static void disable();
    method public static void enable();
  }

  @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PACKAGE, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.TYPE}) public @interface Deprecated {
  }

  public final class Double extends java.lang.Number implements java.lang.Comparable<java.lang.Double> {
    ctor public Double(double);
    ctor public Double(@NonNull String) throws java.lang.NumberFormatException;
    method public static int compare(double, double);
    method public int compareTo(@NonNull Double);
    method public static long doubleToLongBits(double);
    method public static long doubleToRawLongBits(double);
    method public double doubleValue();
    method public float floatValue();
    method public static int hashCode(double);
    method public int intValue();
    method public static boolean isFinite(double);
    method public static boolean isInfinite(double);
    method public boolean isInfinite();
    method public static boolean isNaN(double);
    method public boolean isNaN();
    method public static double longBitsToDouble(long);
    method public long longValue();
    method public static double max(double, double);
    method public static double min(double, double);
    method public static double parseDouble(@NonNull String) throws java.lang.NumberFormatException;
    method public static double sum(double, double);
    method @NonNull public static String toHexString(double);
    method @NonNull public static String toString(double);
    method @NonNull public static Double valueOf(@NonNull String) throws java.lang.NumberFormatException;
    method @NonNull public static Double valueOf(double);
    field public static final int BYTES = 8; // 0x8
    field public static final int MAX_EXPONENT = 1023; // 0x3ff
    field public static final double MAX_VALUE = 1.7976931348623157E308;
    field public static final int MIN_EXPONENT = -1022; // 0xfffffc02
    field public static final double MIN_NORMAL = 2.2250738585072014E-308;
    field public static final double MIN_VALUE = 4.9E-324;
    field public static final double NEGATIVE_INFINITY = (-1.0/0.0);
    field public static final double NaN = (0.0/0.0);
    field public static final double POSITIVE_INFINITY = (1.0/0.0);
    field public static final int SIZE = 64; // 0x40
    field public static final Class<java.lang.Double> TYPE;
  }

  public abstract class Enum<E extends java.lang.Enum<E>> implements java.lang.Comparable<E> java.io.Serializable {
    ctor protected Enum(@NonNull String, int);
    method @NonNull protected final Object clone() throws java.lang.CloneNotSupportedException;
    method public final int compareTo(E);
    method public final boolean equals(@Nullable Object);
    method protected final void finalize();
    method @NonNull public final Class<E> getDeclaringClass();
    method public final int hashCode();
    method @NonNull public final String name();
    method public final int ordinal();
    method @NonNull public static <T extends java.lang.Enum<T>> T valueOf(@NonNull Class<T>, @NonNull String);
  }

  public class EnumConstantNotPresentException extends java.lang.RuntimeException {
    ctor public EnumConstantNotPresentException(Class<? extends java.lang.Enum>, String);
    method public String constantName();
    method public Class<? extends java.lang.Enum> enumType();
  }

  public class Error extends java.lang.Throwable {
    ctor public Error();
    ctor public Error(String);
    ctor public Error(String, Throwable);
    ctor public Error(Throwable);
    ctor protected Error(String, Throwable, boolean, boolean);
  }

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

  public class ExceptionInInitializerError extends java.lang.LinkageError {
    ctor public ExceptionInInitializerError();
    ctor public ExceptionInInitializerError(Throwable);
    ctor public ExceptionInInitializerError(String);
    method public Throwable getException();
  }

  public final class Float extends java.lang.Number implements java.lang.Comparable<java.lang.Float> {
    ctor public Float(float);
    ctor public Float(double);
    ctor public Float(@NonNull String) throws java.lang.NumberFormatException;
    method public static int compare(float, float);
    method public int compareTo(@NonNull Float);
    method public double doubleValue();
    method public static int floatToIntBits(float);
    method public static int floatToRawIntBits(float);
    method public float floatValue();
    method public static int hashCode(float);
    method public static float intBitsToFloat(int);
    method public int intValue();
    method public static boolean isFinite(float);
    method public static boolean isInfinite(float);
    method public boolean isInfinite();
    method public static boolean isNaN(float);
    method public boolean isNaN();
    method public long longValue();
    method public static float max(float, float);
    method public static float min(float, float);
    method public static float parseFloat(@NonNull String) throws java.lang.NumberFormatException;
    method public static float sum(float, float);
    method @NonNull public static String toHexString(float);
    method @NonNull public static String toString(float);
    method @NonNull public static Float valueOf(@NonNull String) throws java.lang.NumberFormatException;
    method @NonNull public static Float valueOf(float);
    field public static final int BYTES = 4; // 0x4
    field public static final int MAX_EXPONENT = 127; // 0x7f
    field public static final float MAX_VALUE = 3.4028235E38f;
    field public static final int MIN_EXPONENT = -126; // 0xffffff82
    field public static final float MIN_NORMAL = 1.17549435E-38f;
    field public static final float MIN_VALUE = 1.4E-45f;
    field public static final float NEGATIVE_INFINITY = (-1.0f/0.0f);
    field public static final float NaN = (0.0f/0.0f);
    field public static final float POSITIVE_INFINITY = (1.0f/0.0f);
    field public static final int SIZE = 32; // 0x20
    field public static final Class<java.lang.Float> TYPE;
  }

  @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) public @interface FunctionalInterface {
  }

  public class IllegalAccessError extends java.lang.IncompatibleClassChangeError {
    ctor public IllegalAccessError();
    ctor public IllegalAccessError(String);
  }

  public class IllegalAccessException extends java.lang.ReflectiveOperationException {
    ctor public IllegalAccessException();
    ctor public IllegalAccessException(String);
  }

  public class IllegalArgumentException extends java.lang.RuntimeException {
    ctor public IllegalArgumentException();
    ctor public IllegalArgumentException(String);
    ctor public IllegalArgumentException(String, Throwable);
    ctor public IllegalArgumentException(Throwable);
  }

  public class IllegalMonitorStateException extends java.lang.RuntimeException {
    ctor public IllegalMonitorStateException();
    ctor public IllegalMonitorStateException(String);
  }

  public class IllegalStateException extends java.lang.RuntimeException {
    ctor public IllegalStateException();
    ctor public IllegalStateException(String);
    ctor public IllegalStateException(String, Throwable);
    ctor public IllegalStateException(Throwable);
  }

  public class IllegalThreadStateException extends java.lang.IllegalArgumentException {
    ctor public IllegalThreadStateException();
    ctor public IllegalThreadStateException(String);
  }

  public class IncompatibleClassChangeError extends java.lang.LinkageError {
    ctor public IncompatibleClassChangeError();
    ctor public IncompatibleClassChangeError(String);
  }

  public class IndexOutOfBoundsException extends java.lang.RuntimeException {
    ctor public IndexOutOfBoundsException();
    ctor public IndexOutOfBoundsException(String);
  }

  public class InheritableThreadLocal<T> extends java.lang.ThreadLocal<T> {
    ctor public InheritableThreadLocal();
    method protected T childValue(T);
  }

  public class InstantiationError extends java.lang.IncompatibleClassChangeError {
    ctor public InstantiationError();
    ctor public InstantiationError(String);
  }

  public class InstantiationException extends java.lang.ReflectiveOperationException {
    ctor public InstantiationException();
    ctor public InstantiationException(String);
  }

  public final class Integer extends java.lang.Number implements java.lang.Comparable<java.lang.Integer> {
    ctor public Integer(int);
    ctor public Integer(@NonNull String) throws java.lang.NumberFormatException;
    method public static int bitCount(int);
    method public static int compare(int, int);
    method public int compareTo(@NonNull Integer);
    method public static int compareUnsigned(int, int);
    method @NonNull public static Integer decode(@NonNull String) throws java.lang.NumberFormatException;
    method public static int divideUnsigned(int, int);
    method public double doubleValue();
    method public float floatValue();
    method @Nullable public static Integer getInteger(@NonNull String);
    method @Nullable public static Integer getInteger(@NonNull String, int);
    method @Nullable public static Integer getInteger(@NonNull String, @Nullable Integer);
    method public static int hashCode(int);
    method public static int highestOneBit(int);
    method public int intValue();
    method public long longValue();
    method public static int lowestOneBit(int);
    method public static int max(int, int);
    method public static int min(int, int);
    method public static int numberOfLeadingZeros(int);
    method public static int numberOfTrailingZeros(int);
    method public static int parseInt(@NonNull String, int) throws java.lang.NumberFormatException;
    method public static int parseInt(@NonNull String) throws java.lang.NumberFormatException;
    method public static int parseUnsignedInt(@NonNull String, int) throws java.lang.NumberFormatException;
    method public static int parseUnsignedInt(@NonNull String) throws java.lang.NumberFormatException;
    method public static int remainderUnsigned(int, int);
    method public static int reverse(int);
    method public static int reverseBytes(int);
    method public static int rotateLeft(int, int);
    method public static int rotateRight(int, int);
    method public static int signum(int);
    method public static int sum(int, int);
    method @NonNull public static String toBinaryString(int);
    method @NonNull public static String toHexString(int);
    method @NonNull public static String toOctalString(int);
    method @NonNull public static String toString(int, int);
    method @NonNull public static String toString(int);
    method public static long toUnsignedLong(int);
    method @NonNull public static String toUnsignedString(int, int);
    method @NonNull public static String toUnsignedString(int);
    method @NonNull public static Integer valueOf(@NonNull String, int) throws java.lang.NumberFormatException;
    method @NonNull public static Integer valueOf(@NonNull String) throws java.lang.NumberFormatException;
    method @NonNull public static Integer valueOf(int);
    field public static final int BYTES = 4; // 0x4
    field public static final int MAX_VALUE = 2147483647; // 0x7fffffff
    field public static final int MIN_VALUE = -2147483648; // 0x80000000
    field public static final int SIZE = 32; // 0x20
    field public static final Class<java.lang.Integer> TYPE;
  }

  public class InternalError extends java.lang.VirtualMachineError {
    ctor public InternalError();
    ctor public InternalError(String);
    ctor public InternalError(String, Throwable);
    ctor public InternalError(Throwable);
  }

  public class InterruptedException extends java.lang.Exception {
    ctor public InterruptedException();
    ctor public InterruptedException(String);
  }

  public interface Iterable<T> {
    method public default void forEach(@NonNull java.util.function.Consumer<? super T>);
    method @NonNull public java.util.Iterator<T> iterator();
    method @NonNull public default java.util.Spliterator<T> spliterator();
  }

  public class LinkageError extends java.lang.Error {
    ctor public LinkageError();
    ctor public LinkageError(String);
    ctor public LinkageError(String, Throwable);
  }

  public final class Long extends java.lang.Number implements java.lang.Comparable<java.lang.Long> {
    ctor public Long(long);
    ctor public Long(@NonNull String) throws java.lang.NumberFormatException;
    method public static int bitCount(long);
    method public static int compare(long, long);
    method public int compareTo(@NonNull Long);
    method public static int compareUnsigned(long, long);
    method @NonNull public static Long decode(@NonNull String) throws java.lang.NumberFormatException;
    method public static long divideUnsigned(long, long);
    method public double doubleValue();
    method public float floatValue();
    method @Nullable public static Long getLong(@NonNull String);
    method @Nullable public static Long getLong(@NonNull String, long);
    method @Nullable public static Long getLong(@NonNull String, @Nullable Long);
    method public static int hashCode(long);
    method public static long highestOneBit(long);
    method public int intValue();
    method public long longValue();
    method public static long lowestOneBit(long);
    method public static long max(long, long);
    method public static long min(long, long);
    method public static int numberOfLeadingZeros(long);
    method public static int numberOfTrailingZeros(long);
    method public static long parseLong(@NonNull String, int) throws java.lang.NumberFormatException;
    method public static long parseLong(@NonNull String) throws java.lang.NumberFormatException;
    method public static long parseUnsignedLong(@NonNull String, int) throws java.lang.NumberFormatException;
    method public static long parseUnsignedLong(@NonNull String) throws java.lang.NumberFormatException;
    method public static long remainderUnsigned(long, long);
    method public static long reverse(long);
    method public static long reverseBytes(long);
    method public static long rotateLeft(long, int);
    method public static long rotateRight(long, int);
    method public static int signum(long);
    method public static long sum(long, long);
    method @NonNull public static String toBinaryString(long);
    method @NonNull public static String toHexString(long);
    method @NonNull public static String toOctalString(long);
    method @NonNull public static String toString(long, int);
    method @NonNull public static String toString(long);
    method @NonNull public static String toUnsignedString(long, int);
    method @NonNull public static String toUnsignedString(long);
    method @NonNull public static Long valueOf(@NonNull String, int) throws java.lang.NumberFormatException;
    method @NonNull public static Long valueOf(@NonNull String) throws java.lang.NumberFormatException;
    method @NonNull public static Long valueOf(long);
    field public static final int BYTES = 8; // 0x8
    field public static final long MAX_VALUE = 9223372036854775807L; // 0x7fffffffffffffffL
    field public static final long MIN_VALUE = -9223372036854775808L; // 0x8000000000000000L
    field public static final int SIZE = 64; // 0x40
    field public static final Class<java.lang.Long> TYPE;
  }

  public final class Math {
    method public static double IEEEremainder(double, double);
    method public static int abs(int);
    method public static long abs(long);
    method public static float abs(float);
    method public static double abs(double);
    method public static double acos(double);
    method public static int addExact(int, int);
    method public static long addExact(long, long);
    method public static double asin(double);
    method public static double atan(double);
    method public static double atan2(double, double);
    method public static double cbrt(double);
    method public static double ceil(double);
    method public static double copySign(double, double);
    method public static float copySign(float, float);
    method public static double cos(double);
    method public static double cosh(double);
    method public static int decrementExact(int);
    method public static long decrementExact(long);
    method public static double exp(double);
    method public static double expm1(double);
    method public static double floor(double);
    method public static int floorDiv(int, int);
    method public static long floorDiv(long, long);
    method public static int floorMod(int, int);
    method public static long floorMod(long, long);
    method public static int getExponent(float);
    method public static int getExponent(double);
    method public static double hypot(double, double);
    method public static int incrementExact(int);
    method public static long incrementExact(long);
    method public static double log(double);
    method public static double log10(double);
    method public static double log1p(double);
    method public static int max(int, int);
    method public static long max(long, long);
    method public static float max(float, float);
    method public static double max(double, double);
    method public static int min(int, int);
    method public static long min(long, long);
    method public static float min(float, float);
    method public static double min(double, double);
    method public static int multiplyExact(int, int);
    method public static long multiplyExact(long, long);
    method public static int negateExact(int);
    method public static long negateExact(long);
    method public static double nextAfter(double, double);
    method public static float nextAfter(float, double);
    method public static double nextDown(double);
    method public static float nextDown(float);
    method public static double nextUp(double);
    method public static float nextUp(float);
    method public static double pow(double, double);
    method public static double random();
    method public static double rint(double);
    method public static int round(float);
    method public static long round(double);
    method public static double scalb(double, int);
    method public static float scalb(float, int);
    method public static double signum(double);
    method public static float signum(float);
    method public static double sin(double);
    method public static double sinh(double);
    method public static double sqrt(double);
    method public static int subtractExact(int, int);
    method public static long subtractExact(long, long);
    method public static double tan(double);
    method public static double tanh(double);
    method public static double toDegrees(double);
    method public static int toIntExact(long);
    method public static double toRadians(double);
    method public static double ulp(double);
    method public static float ulp(float);
    field public static final double E = 2.718281828459045;
    field public static final double PI = 3.141592653589793;
  }

  public class NegativeArraySizeException extends java.lang.RuntimeException {
    ctor public NegativeArraySizeException();
    ctor public NegativeArraySizeException(String);
  }

  public class NoClassDefFoundError extends java.lang.LinkageError {
    ctor public NoClassDefFoundError();
    ctor public NoClassDefFoundError(String);
  }

  public class NoSuchFieldError extends java.lang.IncompatibleClassChangeError {
    ctor public NoSuchFieldError();
    ctor public NoSuchFieldError(String);
  }

  public class NoSuchFieldException extends java.lang.ReflectiveOperationException {
    ctor public NoSuchFieldException();
    ctor public NoSuchFieldException(String);
  }

  public class NoSuchMethodError extends java.lang.IncompatibleClassChangeError {
    ctor public NoSuchMethodError();
    ctor public NoSuchMethodError(String);
  }

  public class NoSuchMethodException extends java.lang.ReflectiveOperationException {
    ctor public NoSuchMethodException();
    ctor public NoSuchMethodException(String);
  }

  public class NullPointerException extends java.lang.RuntimeException {
    ctor public NullPointerException();
    ctor public NullPointerException(String);
  }

  public abstract class Number implements java.io.Serializable {
    ctor public Number();
    method public byte byteValue();
    method public abstract double doubleValue();
    method public abstract float floatValue();
    method public abstract int intValue();
    method public abstract long longValue();
    method public short shortValue();
  }

  public class NumberFormatException extends java.lang.IllegalArgumentException {
    ctor public NumberFormatException();
    ctor public NumberFormatException(String);
  }

  public class Object {
    ctor public Object();
    method @NonNull protected Object clone() throws java.lang.CloneNotSupportedException;
    method public boolean equals(@Nullable Object);
    method protected void finalize() throws java.lang.Throwable;
    method @NonNull public final Class<?> getClass();
    method public int hashCode();
    method public final void notify();
    method public final void notifyAll();
    method @NonNull public String toString();
    method public final void wait(long) throws java.lang.InterruptedException;
    method public final void wait(long, int) throws java.lang.InterruptedException;
    method public final void wait() throws java.lang.InterruptedException;
  }

  public class OutOfMemoryError extends java.lang.VirtualMachineError {
    ctor public OutOfMemoryError();
    ctor public OutOfMemoryError(String);
  }

  @java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public @interface Override {
  }

  public class Package implements java.lang.reflect.AnnotatedElement {
    method public <A extends java.lang.annotation.Annotation> A getAnnotation(Class<A>);
    method public java.lang.annotation.Annotation[] getAnnotations();
    method public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType(Class<A>);
    method public <A extends java.lang.annotation.Annotation> A getDeclaredAnnotation(Class<A>);
    method public java.lang.annotation.Annotation[] getDeclaredAnnotations();
    method public <A extends java.lang.annotation.Annotation> A[] getDeclaredAnnotationsByType(Class<A>);
    method public String getImplementationTitle();
    method public String getImplementationVendor();
    method public String getImplementationVersion();
    method public String getName();
    method public static Package getPackage(String);
    method public static Package[] getPackages();
    method public String getSpecificationTitle();
    method public String getSpecificationVendor();
    method public String getSpecificationVersion();
    method public boolean isCompatibleWith(String) throws java.lang.NumberFormatException;
    method public boolean isSealed();
    method public boolean isSealed(java.net.URL);
  }

  public abstract class Process {
    ctor public Process();
    method public abstract void destroy();
    method public Process destroyForcibly();
    method public abstract int exitValue();
    method public abstract java.io.InputStream getErrorStream();
    method public abstract java.io.InputStream getInputStream();
    method public abstract java.io.OutputStream getOutputStream();
    method public boolean isAlive();
    method public abstract int waitFor() throws java.lang.InterruptedException;
    method public boolean waitFor(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
  }

  public final class ProcessBuilder {
    ctor public ProcessBuilder(java.util.List<java.lang.String>);
    ctor public ProcessBuilder(java.lang.String...);
    method public ProcessBuilder command(java.util.List<java.lang.String>);
    method public ProcessBuilder command(java.lang.String...);
    method public java.util.List<java.lang.String> command();
    method public java.io.File directory();
    method public ProcessBuilder directory(java.io.File);
    method public java.util.Map<java.lang.String,java.lang.String> environment();
    method public ProcessBuilder inheritIO();
    method public ProcessBuilder redirectError(java.lang.ProcessBuilder.Redirect);
    method public ProcessBuilder redirectError(java.io.File);
    method public java.lang.ProcessBuilder.Redirect redirectError();
    method public boolean redirectErrorStream();
    method public ProcessBuilder redirectErrorStream(boolean);
    method public ProcessBuilder redirectInput(java.lang.ProcessBuilder.Redirect);
    method public ProcessBuilder redirectInput(java.io.File);
    method public java.lang.ProcessBuilder.Redirect redirectInput();
    method public ProcessBuilder redirectOutput(java.lang.ProcessBuilder.Redirect);
    method public ProcessBuilder redirectOutput(java.io.File);
    method public java.lang.ProcessBuilder.Redirect redirectOutput();
    method public Process start() throws java.io.IOException;
  }

  public abstract static class ProcessBuilder.Redirect {
    method public static java.lang.ProcessBuilder.Redirect appendTo(java.io.File);
    method public java.io.File file();
    method public static java.lang.ProcessBuilder.Redirect from(java.io.File);
    method public static java.lang.ProcessBuilder.Redirect to(java.io.File);
    method public abstract java.lang.ProcessBuilder.Redirect.Type type();
    field public static final java.lang.ProcessBuilder.Redirect INHERIT;
    field public static final java.lang.ProcessBuilder.Redirect PIPE;
  }

  public enum ProcessBuilder.Redirect.Type {
    enum_constant public static final java.lang.ProcessBuilder.Redirect.Type APPEND;
    enum_constant public static final java.lang.ProcessBuilder.Redirect.Type INHERIT;
    enum_constant public static final java.lang.ProcessBuilder.Redirect.Type PIPE;
    enum_constant public static final java.lang.ProcessBuilder.Redirect.Type READ;
    enum_constant public static final java.lang.ProcessBuilder.Redirect.Type WRITE;
  }

  public interface Readable {
    method public int read(java.nio.CharBuffer) throws java.io.IOException;
  }

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

  @java.lang.FunctionalInterface public interface Runnable {
    method public void run();
  }

  public class Runtime {
    method public void addShutdownHook(Thread);
    method public int availableProcessors();
    method public Process exec(String) throws java.io.IOException;
    method public Process exec(String, String[]) throws java.io.IOException;
    method public Process exec(String, String[], java.io.File) throws java.io.IOException;
    method public Process exec(String[]) throws java.io.IOException;
    method public Process exec(String[], String[]) throws java.io.IOException;
    method public Process exec(String[], String[], java.io.File) throws java.io.IOException;
    method public void exit(int);
    method public long freeMemory();
    method public void gc();
    method @Deprecated public java.io.InputStream getLocalizedInputStream(java.io.InputStream);
    method @Deprecated public java.io.OutputStream getLocalizedOutputStream(java.io.OutputStream);
    method public static Runtime getRuntime();
    method public void halt(int);
    method public void load(String);
    method public void loadLibrary(String);
    method public long maxMemory();
    method public boolean removeShutdownHook(Thread);
    method public void runFinalization();
    method @Deprecated public static void runFinalizersOnExit(boolean);
    method public long totalMemory();
    method public void traceInstructions(boolean);
    method public void traceMethodCalls(boolean);
  }

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

  public final class RuntimePermission extends java.security.BasicPermission {
    ctor public RuntimePermission(String);
    ctor public RuntimePermission(String, String);
  }

  @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.METHOD}) public @interface SafeVarargs {
  }

  public class SecurityException extends java.lang.RuntimeException {
    ctor public SecurityException();
    ctor public SecurityException(String);
    ctor public SecurityException(String, Throwable);
    ctor public SecurityException(Throwable);
  }

  public class SecurityManager {
    ctor public SecurityManager();
    method public void checkAccept(String, int);
    method public void checkAccess(Thread);
    method public void checkAccess(ThreadGroup);
    method public void checkAwtEventQueueAccess();
    method public void checkConnect(String, int);
    method public void checkConnect(String, int, Object);
    method public void checkCreateClassLoader();
    method public void checkDelete(String);
    method public void checkExec(String);
    method public void checkExit(int);
    method public void checkLink(String);
    method public void checkListen(int);
    method public void checkMemberAccess(Class<?>, int);
    method public void checkMulticast(java.net.InetAddress);
    method @Deprecated public void checkMulticast(java.net.InetAddress, byte);
    method public void checkPackageAccess(String);
    method public void checkPackageDefinition(String);
    method public void checkPermission(java.security.Permission);
    method public void checkPermission(java.security.Permission, Object);
    method public void checkPrintJobAccess();
    method public void checkPropertiesAccess();
    method public void checkPropertyAccess(String);
    method public void checkRead(java.io.FileDescriptor);
    method public void checkRead(String);
    method public void checkRead(String, Object);
    method public void checkSecurityAccess(String);
    method public void checkSetFactory();
    method public void checkSystemClipboardAccess();
    method public boolean checkTopLevelWindow(Object);
    method public void checkWrite(java.io.FileDescriptor);
    method public void checkWrite(String);
    method @Deprecated protected int classDepth(String);
    method @Deprecated protected int classLoaderDepth();
    method @Deprecated protected ClassLoader currentClassLoader();
    method @Deprecated protected Class<?> currentLoadedClass();
    method protected Class[] getClassContext();
    method @Deprecated public boolean getInCheck();
    method public Object getSecurityContext();
    method public ThreadGroup getThreadGroup();
    method @Deprecated protected boolean inClass(String);
    method @Deprecated protected boolean inClassLoader();
    field @Deprecated protected boolean inCheck;
  }

  public final class Short extends java.lang.Number implements java.lang.Comparable<java.lang.Short> {
    ctor public Short(short);
    ctor public Short(String) throws java.lang.NumberFormatException;
    method public static int compare(short, short);
    method public int compareTo(Short);
    method public static Short decode(String) throws java.lang.NumberFormatException;
    method public double doubleValue();
    method public float floatValue();
    method public static int hashCode(short);
    method public int intValue();
    method public long longValue();
    method public static short parseShort(String, int) throws java.lang.NumberFormatException;
    method public static short parseShort(String) throws java.lang.NumberFormatException;
    method public static short reverseBytes(short);
    method public static String toString(short);
    method public static int toUnsignedInt(short);
    method public static long toUnsignedLong(short);
    method public static Short valueOf(String, int) throws java.lang.NumberFormatException;
    method public static Short valueOf(String) throws java.lang.NumberFormatException;
    method public static Short valueOf(short);
    field public static final int BYTES = 2; // 0x2
    field public static final short MAX_VALUE = 32767; // 0x7fff
    field public static final short MIN_VALUE = -32768; // 0xffff8000
    field public static final int SIZE = 16; // 0x10
    field public static final Class<java.lang.Short> TYPE;
  }

  public class StackOverflowError extends java.lang.VirtualMachineError {
    ctor public StackOverflowError();
    ctor public StackOverflowError(String);
  }

  public final class StackTraceElement implements java.io.Serializable {
    ctor public StackTraceElement(String, String, String, int);
    method public String getClassName();
    method public String getFileName();
    method public int getLineNumber();
    method public String getMethodName();
    method public boolean isNativeMethod();
  }

  public final class StrictMath {
    method public static double IEEEremainder(double, double);
    method public static int abs(int);
    method public static long abs(long);
    method public static float abs(float);
    method public static double abs(double);
    method public static double acos(double);
    method public static int addExact(int, int);
    method public static long addExact(long, long);
    method public static double asin(double);
    method public static double atan(double);
    method public static double atan2(double, double);
    method public static double cbrt(double);
    method public static double ceil(double);
    method public static double copySign(double, double);
    method public static float copySign(float, float);
    method public static double cos(double);
    method public static double cosh(double);
    method public static double exp(double);
    method public static double expm1(double);
    method public static double floor(double);
    method public static int floorDiv(int, int);
    method public static long floorDiv(long, long);
    method public static int floorMod(int, int);
    method public static long floorMod(long, long);
    method public static int getExponent(float);
    method public static int getExponent(double);
    method public static double hypot(double, double);
    method public static double log(double);
    method public static double log10(double);
    method public static double log1p(double);
    method public static int max(int, int);
    method public static long max(long, long);
    method public static float max(float, float);
    method public static double max(double, double);
    method public static int min(int, int);
    method public static long min(long, long);
    method public static float min(float, float);
    method public static double min(double, double);
    method public static int multiplyExact(int, int);
    method public static long multiplyExact(long, long);
    method public static double nextAfter(double, double);
    method public static float nextAfter(float, double);
    method public static double nextDown(double);
    method public static float nextDown(float);
    method public static double nextUp(double);
    method public static float nextUp(float);
    method public static double pow(double, double);
    method public static double random();
    method public static double rint(double);
    method public static int round(float);
    method public static long round(double);
    method public static double scalb(double, int);
    method public static float scalb(float, int);
    method public static double signum(double);
    method public static float signum(float);
    method public static double sin(double);
    method public static double sinh(double);
    method public static double sqrt(double);
    method public static int subtractExact(int, int);
    method public static long subtractExact(long, long);
    method public static double tan(double);
    method public static double tanh(double);
    method public static double toDegrees(double);
    method public static int toIntExact(long);
    method public static double toRadians(double);
    method public static double ulp(double);
    method public static float ulp(float);
    field public static final double E = 2.718281828459045;
    field public static final double PI = 3.141592653589793;
  }

  public final class String implements java.lang.CharSequence java.lang.Comparable<java.lang.String> java.io.Serializable {
    ctor public String();
    ctor public String(@NonNull String);
    ctor public String(char[]);
    ctor public String(char[], int, int);
    ctor public String(int[], int, int);
    ctor @Deprecated public String(byte[], int, int, int);
    ctor @Deprecated public String(byte[], int);
    ctor public String(byte[], int, int, @NonNull String) throws java.io.UnsupportedEncodingException;
    ctor public String(byte[], int, int, @NonNull java.nio.charset.Charset);
    ctor public String(byte[], @NonNull String) throws java.io.UnsupportedEncodingException;
    ctor public String(byte[], @NonNull java.nio.charset.Charset);
    ctor public String(byte[], int, int);
    ctor public String(byte[]);
    ctor public String(@NonNull StringBuffer);
    ctor public String(@NonNull StringBuilder);
    method public char charAt(int);
    method public int codePointAt(int);
    method public int codePointBefore(int);
    method public int codePointCount(int, int);
    method public int compareTo(@NonNull String);
    method public int compareToIgnoreCase(@NonNull String);
    method @NonNull public String concat(@NonNull String);
    method public boolean contains(@NonNull CharSequence);
    method public boolean contentEquals(@NonNull StringBuffer);
    method public boolean contentEquals(@NonNull CharSequence);
    method @NonNull public static String copyValueOf(char[], int, int);
    method @NonNull public static String copyValueOf(char[]);
    method public boolean endsWith(@NonNull String);
    method public boolean equalsIgnoreCase(@Nullable String);
    method @NonNull public static String format(@NonNull String, @NonNull java.lang.Object...);
    method @NonNull public static String format(@NonNull java.util.Locale, @NonNull String, @NonNull java.lang.Object...);
    method @Deprecated public void getBytes(int, int, byte[], int);
    method public byte[] getBytes(@NonNull String) throws java.io.UnsupportedEncodingException;
    method public byte[] getBytes(@NonNull java.nio.charset.Charset);
    method public byte[] getBytes();
    method public void getChars(int, int, char[], int);
    method public int indexOf(int);
    method public int indexOf(int, int);
    method public int indexOf(@NonNull String);
    method public int indexOf(@NonNull String, int);
    method @NonNull public String intern();
    method public boolean isEmpty();
    method @NonNull public static String join(@NonNull CharSequence, @Nullable java.lang.CharSequence...);
    method @NonNull public static String join(@NonNull CharSequence, @NonNull Iterable<? extends java.lang.CharSequence>);
    method public int lastIndexOf(int);
    method public int lastIndexOf(int, int);
    method public int lastIndexOf(@NonNull String);
    method public int lastIndexOf(@NonNull String, int);
    method public int length();
    method public boolean matches(@NonNull String);
    method public int offsetByCodePoints(int, int);
    method public boolean regionMatches(int, @NonNull String, int, int);
    method public boolean regionMatches(boolean, int, @NonNull String, int, int);
    method @NonNull public String replace(char, char);
    method @NonNull public String replace(@NonNull CharSequence, @NonNull CharSequence);
    method @NonNull public String replaceAll(@NonNull String, @NonNull String);
    method @NonNull public String replaceFirst(@NonNull String, @NonNull String);
    method @NonNull public String[] split(@NonNull String, int);
    method @NonNull public String[] split(@NonNull String);
    method public boolean startsWith(@NonNull String, int);
    method public boolean startsWith(@NonNull String);
    method @NonNull public CharSequence subSequence(int, int);
    method @NonNull public String substring(int);
    method @NonNull public String substring(int, int);
    method public char[] toCharArray();
    method @NonNull public String toLowerCase(@NonNull java.util.Locale);
    method @NonNull public String toLowerCase();
    method @NonNull public String toUpperCase(@NonNull java.util.Locale);
    method @NonNull public String toUpperCase();
    method @NonNull public String trim();
    method @NonNull public static String valueOf(@Nullable Object);
    method @NonNull public static String valueOf(char[]);
    method @NonNull public static String valueOf(char[], int, int);
    method @NonNull public static String valueOf(boolean);
    method @NonNull public static String valueOf(char);
    method @NonNull public static String valueOf(int);
    method @NonNull public static String valueOf(long);
    method @NonNull public static String valueOf(float);
    method @NonNull public static String valueOf(double);
    field public static final java.util.Comparator<java.lang.String> CASE_INSENSITIVE_ORDER;
  }

  public final class StringBuffer implements java.lang.Appendable java.lang.CharSequence java.io.Serializable {
    ctor public StringBuffer();
    ctor public StringBuffer(int);
    ctor public StringBuffer(@NonNull String);
    ctor public StringBuffer(@NonNull CharSequence);
    method @NonNull public StringBuffer append(@Nullable Object);
    method @NonNull public StringBuffer append(@Nullable String);
    method @NonNull public StringBuffer append(@Nullable StringBuffer);
    method @NonNull public StringBuffer append(@Nullable CharSequence);
    method @NonNull public StringBuffer append(@Nullable CharSequence, int, int);
    method @NonNull public StringBuffer append(char[]);
    method @NonNull public StringBuffer append(char[], int, int);
    method @NonNull public StringBuffer append(boolean);
    method @NonNull public StringBuffer append(char);
    method @NonNull public StringBuffer append(int);
    method @NonNull public StringBuffer append(long);
    method @NonNull public StringBuffer append(float);
    method @NonNull public StringBuffer append(double);
    method @NonNull public StringBuffer appendCodePoint(int);
    method public int capacity();
    method public char charAt(int);
    method public int codePointAt(int);
    method public int codePointBefore(int);
    method public int codePointCount(int, int);
    method @NonNull public StringBuffer delete(int, int);
    method @NonNull public StringBuffer deleteCharAt(int);
    method public void ensureCapacity(int);
    method public void getChars(int, int, char[], int);
    method public int indexOf(@NonNull String);
    method public int indexOf(@NonNull String, int);
    method @NonNull public StringBuffer insert(int, char[], int, int);
    method @NonNull public StringBuffer insert(int, @Nullable Object);
    method @NonNull public StringBuffer insert(int, @Nullable String);
    method @NonNull public StringBuffer insert(int, char[]);
    method @NonNull public StringBuffer insert(int, @Nullable CharSequence);
    method @NonNull public StringBuffer insert(int, @Nullable CharSequence, int, int);
    method @NonNull public StringBuffer insert(int, boolean);
    method @NonNull public StringBuffer insert(int, char);
    method @NonNull public StringBuffer insert(int, int);
    method @NonNull public StringBuffer insert(int, long);
    method @NonNull public StringBuffer insert(int, float);
    method @NonNull public StringBuffer insert(int, double);
    method public int lastIndexOf(@NonNull String);
    method public int lastIndexOf(@NonNull String, int);
    method public int length();
    method public int offsetByCodePoints(int, int);
    method @NonNull public StringBuffer replace(int, int, @NonNull String);
    method @NonNull public StringBuffer reverse();
    method public void setCharAt(int, char);
    method public void setLength(int);
    method @NonNull public CharSequence subSequence(int, int);
    method @NonNull public String substring(int);
    method @NonNull public String substring(int, int);
    method public void trimToSize();
  }

  public final class StringBuilder implements java.lang.Appendable java.lang.CharSequence java.io.Serializable {
    ctor public StringBuilder();
    ctor public StringBuilder(int);
    ctor public StringBuilder(@NonNull String);
    ctor public StringBuilder(@NonNull CharSequence);
    method @NonNull public StringBuilder append(@Nullable Object);
    method @NonNull public StringBuilder append(@Nullable String);
    method @NonNull public StringBuilder append(@Nullable StringBuffer);
    method @NonNull public StringBuilder append(@Nullable CharSequence);
    method @NonNull public StringBuilder append(@Nullable CharSequence, int, int);
    method @NonNull public StringBuilder append(char[]);
    method @NonNull public StringBuilder append(char[], int, int);
    method @NonNull public StringBuilder append(boolean);
    method @NonNull public StringBuilder append(char);
    method @NonNull public StringBuilder append(int);
    method @NonNull public StringBuilder append(long);
    method @NonNull public StringBuilder append(float);
    method @NonNull public StringBuilder append(double);
    method @NonNull public StringBuilder appendCodePoint(int);
    method public int capacity();
    method public char charAt(int);
    method public int codePointAt(int);
    method public int codePointBefore(int);
    method public int codePointCount(int, int);
    method @NonNull public StringBuilder delete(int, int);
    method @NonNull public StringBuilder deleteCharAt(int);
    method public void ensureCapacity(int);
    method public void getChars(int, int, char[], int);
    method public int indexOf(@NonNull String);
    method public int indexOf(@NonNull String, int);
    method @NonNull public StringBuilder insert(int, char[], int, int);
    method @NonNull public StringBuilder insert(int, @Nullable Object);
    method @NonNull public StringBuilder insert(int, @Nullable String);
    method @NonNull public StringBuilder insert(int, char[]);
    method @NonNull public StringBuilder insert(int, @Nullable CharSequence);
    method @NonNull public StringBuilder insert(int, @Nullable CharSequence, int, int);
    method @NonNull public StringBuilder insert(int, boolean);
    method @NonNull public StringBuilder insert(int, char);
    method @NonNull public StringBuilder insert(int, int);
    method @NonNull public StringBuilder insert(int, long);
    method @NonNull public StringBuilder insert(int, float);
    method @NonNull public StringBuilder insert(int, double);
    method public int lastIndexOf(@NonNull String);
    method public int lastIndexOf(@NonNull String, int);
    method public int length();
    method public int offsetByCodePoints(int, int);
    method @NonNull public StringBuilder replace(int, int, @NonNull String);
    method @NonNull public StringBuilder reverse();
    method public void setCharAt(int, char);
    method public void setLength(int);
    method public CharSequence subSequence(int, int);
    method public String substring(int);
    method public String substring(int, int);
    method public void trimToSize();
  }

  public class StringIndexOutOfBoundsException extends java.lang.IndexOutOfBoundsException {
    ctor public StringIndexOutOfBoundsException();
    ctor public StringIndexOutOfBoundsException(String);
    ctor public StringIndexOutOfBoundsException(int);
  }

  @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.LOCAL_VARIABLE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public @interface SuppressWarnings {
    method public abstract String[] value();
  }

  public final class System {
    method public static void arraycopy(@NonNull Object, int, @NonNull Object, int, int);
    method @Nullable public static String clearProperty(@NonNull String);
    method @Nullable public static java.io.Console console();
    method public static long currentTimeMillis();
    method public static void exit(int);
    method public static void gc();
    method @NonNull public static java.util.Properties getProperties();
    method @Nullable public static String getProperty(@NonNull String);
    method @Nullable public static String getProperty(@NonNull String, @Nullable String);
    method @Nullable public static SecurityManager getSecurityManager();
    method @Nullable public static String getenv(@NonNull String);
    method @NonNull public static java.util.Map<java.lang.String,java.lang.String> getenv();
    method public static int identityHashCode(@Nullable Object);
    method @Nullable public static java.nio.channels.Channel inheritedChannel() throws java.io.IOException;
    method @NonNull public static String lineSeparator();
    method public static void load(@NonNull String);
    method public static void loadLibrary(@NonNull String);
    method @NonNull public static String mapLibraryName(@NonNull String);
    method public static long nanoTime();
    method public static void runFinalization();
    method @Deprecated public static void runFinalizersOnExit(boolean);
    method public static void setErr(@Nullable java.io.PrintStream);
    method public static void setIn(@Nullable java.io.InputStream);
    method public static void setOut(@Nullable java.io.PrintStream);
    method public static void setProperties(@Nullable java.util.Properties);
    method @Nullable public static String setProperty(@NonNull String, @Nullable String);
    method public static void setSecurityManager(@Nullable SecurityManager);
    field public static final java.io.PrintStream err;
    field public static final java.io.InputStream in;
    field public static final java.io.PrintStream out;
  }

  public class Thread implements java.lang.Runnable {
    ctor public Thread();
    ctor public Thread(@Nullable Runnable);
    ctor public Thread(@Nullable ThreadGroup, @Nullable Runnable);
    ctor public Thread(@NonNull String);
    ctor public Thread(@Nullable ThreadGroup, @NonNull String);
    ctor public Thread(@Nullable Runnable, @NonNull String);
    ctor public Thread(@Nullable ThreadGroup, @Nullable Runnable, @NonNull String);
    ctor public Thread(@Nullable ThreadGroup, @Nullable Runnable, @NonNull String, long);
    method public static int activeCount();
    method public final void checkAccess();
    method @Deprecated public int countStackFrames();
    method @NonNull public static Thread currentThread();
    method @Deprecated public void destroy();
    method public static void dumpStack();
    method public static int enumerate(Thread[]);
    method @NonNull public static java.util.Map<java.lang.Thread,java.lang.StackTraceElement[]> getAllStackTraces();
    method @Nullable public ClassLoader getContextClassLoader();
    method @Nullable public static java.lang.Thread.UncaughtExceptionHandler getDefaultUncaughtExceptionHandler();
    method public long getId();
    method @NonNull public final String getName();
    method public final int getPriority();
    method @NonNull public StackTraceElement[] getStackTrace();
    method @NonNull public java.lang.Thread.State getState();
    method @Nullable public final ThreadGroup getThreadGroup();
    method @Nullable public java.lang.Thread.UncaughtExceptionHandler getUncaughtExceptionHandler();
    method public static boolean holdsLock(@NonNull Object);
    method public void interrupt();
    method public static boolean interrupted();
    method public final boolean isAlive();
    method public final boolean isDaemon();
    method public boolean isInterrupted();
    method public final void join(long) throws java.lang.InterruptedException;
    method public final void join(long, int) throws java.lang.InterruptedException;
    method public final void join() throws java.lang.InterruptedException;
    method @Deprecated public final void resume();
    method public void run();
    method public void setContextClassLoader(@Nullable ClassLoader);
    method public final void setDaemon(boolean);
    method public static void setDefaultUncaughtExceptionHandler(@Nullable java.lang.Thread.UncaughtExceptionHandler);
    method public final void setName(@NonNull String);
    method public final void setPriority(int);
    method public void setUncaughtExceptionHandler(@Nullable java.lang.Thread.UncaughtExceptionHandler);
    method public static void sleep(long) throws java.lang.InterruptedException;
    method public static void sleep(long, int) throws java.lang.InterruptedException;
    method public void start();
    method @Deprecated public final void stop();
    method @Deprecated public final void stop(@Nullable Throwable);
    method @Deprecated public final void suspend();
    method public static void yield();
    field public static final int MAX_PRIORITY = 10; // 0xa
    field public static final int MIN_PRIORITY = 1; // 0x1
    field public static final int NORM_PRIORITY = 5; // 0x5
  }

  public enum Thread.State {
    enum_constant public static final java.lang.Thread.State BLOCKED;
    enum_constant public static final java.lang.Thread.State NEW;
    enum_constant public static final java.lang.Thread.State RUNNABLE;
    enum_constant public static final java.lang.Thread.State TERMINATED;
    enum_constant public static final java.lang.Thread.State TIMED_WAITING;
    enum_constant public static final java.lang.Thread.State WAITING;
  }

  @java.lang.FunctionalInterface public static interface Thread.UncaughtExceptionHandler {
    method public void uncaughtException(@NonNull Thread, @NonNull Throwable);
  }

  public class ThreadDeath extends java.lang.Error {
    ctor public ThreadDeath();
  }

  public class ThreadGroup implements java.lang.Thread.UncaughtExceptionHandler {
    ctor public ThreadGroup(String);
    ctor public ThreadGroup(ThreadGroup, String);
    method public int activeCount();
    method public int activeGroupCount();
    method @Deprecated public boolean allowThreadSuspension(boolean);
    method public final void checkAccess();
    method public final void destroy();
    method public int enumerate(Thread[]);
    method public int enumerate(Thread[], boolean);
    method public int enumerate(ThreadGroup[]);
    method public int enumerate(ThreadGroup[], boolean);
    method public final int getMaxPriority();
    method public final String getName();
    method public final ThreadGroup getParent();
    method public final void interrupt();
    method public final boolean isDaemon();
    method public boolean isDestroyed();
    method public void list();
    method public final boolean parentOf(ThreadGroup);
    method @Deprecated public final void resume();
    method public final void setDaemon(boolean);
    method public final void setMaxPriority(int);
    method @Deprecated public final void stop();
    method @Deprecated public final void suspend();
    method public void uncaughtException(Thread, Throwable);
  }

  public class ThreadLocal<T> {
    ctor public ThreadLocal();
    method @Nullable public T get();
    method @Nullable protected T initialValue();
    method public void remove();
    method public void set(T);
    method @NonNull public static <S> ThreadLocal<S> withInitial(@NonNull java.util.function.Supplier<? extends S>);
  }

  public class Throwable implements java.io.Serializable {
    ctor public Throwable();
    ctor public Throwable(@Nullable String);
    ctor public Throwable(@Nullable String, @Nullable Throwable);
    ctor public Throwable(@Nullable Throwable);
    ctor protected Throwable(@Nullable String, @Nullable Throwable, boolean, boolean);
    method public final void addSuppressed(@NonNull Throwable);
    method @NonNull public Throwable fillInStackTrace();
    method @Nullable public Throwable getCause();
    method @Nullable public String getLocalizedMessage();
    method @Nullable public String getMessage();
    method @NonNull public StackTraceElement[] getStackTrace();
    method @NonNull public final Throwable[] getSuppressed();
    method @NonNull public Throwable initCause(@Nullable Throwable);
    method public void printStackTrace();
    method public void printStackTrace(@NonNull java.io.PrintStream);
    method public void printStackTrace(@NonNull java.io.PrintWriter);
    method public void setStackTrace(@NonNull StackTraceElement[]);
  }

  public class TypeNotPresentException extends java.lang.RuntimeException {
    ctor public TypeNotPresentException(String, Throwable);
    method public String typeName();
  }

  public class UnknownError extends java.lang.VirtualMachineError {
    ctor public UnknownError();
    ctor public UnknownError(String);
  }

  public class UnsatisfiedLinkError extends java.lang.LinkageError {
    ctor public UnsatisfiedLinkError();
    ctor public UnsatisfiedLinkError(String);
  }

  public class UnsupportedClassVersionError extends java.lang.ClassFormatError {
    ctor public UnsupportedClassVersionError();
    ctor public UnsupportedClassVersionError(String);
  }

  public class UnsupportedOperationException extends java.lang.RuntimeException {
    ctor public UnsupportedOperationException();
    ctor public UnsupportedOperationException(String);
    ctor public UnsupportedOperationException(String, Throwable);
    ctor public UnsupportedOperationException(Throwable);
  }

  public class VerifyError extends java.lang.LinkageError {
    ctor public VerifyError();
    ctor public VerifyError(String);
  }

  public abstract class VirtualMachineError extends java.lang.Error {
    ctor public VirtualMachineError();
    ctor public VirtualMachineError(String);
    ctor public VirtualMachineError(String, Throwable);
    ctor public VirtualMachineError(Throwable);
  }

  public final class Void {
    field public static final Class<java.lang.Void> TYPE;
  }

}

package java.lang.annotation {

  public interface Annotation {
    method public Class<? extends java.lang.annotation.Annotation> annotationType();
    method public boolean equals(Object);
    method public int hashCode();
    method public String toString();
  }

  public class AnnotationFormatError extends java.lang.Error {
    ctor public AnnotationFormatError(String);
    ctor public AnnotationFormatError(String, Throwable);
    ctor public AnnotationFormatError(Throwable);
  }

  public class AnnotationTypeMismatchException extends java.lang.RuntimeException {
    ctor public AnnotationTypeMismatchException(java.lang.reflect.Method, String);
    method public java.lang.reflect.Method element();
    method public String foundType();
  }

  @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.ANNOTATION_TYPE) public @interface Documented {
  }

  public enum ElementType {
    enum_constant public static final java.lang.annotation.ElementType ANNOTATION_TYPE;
    enum_constant public static final java.lang.annotation.ElementType CONSTRUCTOR;
    enum_constant public static final java.lang.annotation.ElementType FIELD;
    enum_constant public static final java.lang.annotation.ElementType LOCAL_VARIABLE;
    enum_constant public static final java.lang.annotation.ElementType METHOD;
    enum_constant public static final java.lang.annotation.ElementType PACKAGE;
    enum_constant public static final java.lang.annotation.ElementType PARAMETER;
    enum_constant public static final java.lang.annotation.ElementType TYPE;
    enum_constant public static final java.lang.annotation.ElementType TYPE_PARAMETER;
    enum_constant public static final java.lang.annotation.ElementType TYPE_USE;
  }

  public class IncompleteAnnotationException extends java.lang.RuntimeException {
    ctor public IncompleteAnnotationException(Class<? extends java.lang.annotation.Annotation>, String);
    method public Class<? extends java.lang.annotation.Annotation> annotationType();
    method public String elementName();
  }

  @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.ANNOTATION_TYPE) public @interface Inherited {
  }

  @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target(java.lang.annotation.ElementType.FIELD) public @interface Native {
  }

  @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.ANNOTATION_TYPE) public @interface Repeatable {
    method public abstract Class<? extends java.lang.annotation.Annotation> value();
  }

  @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.ANNOTATION_TYPE) public @interface Retention {
    method public abstract java.lang.annotation.RetentionPolicy value();
  }

  public enum RetentionPolicy {
    enum_constant public static final java.lang.annotation.RetentionPolicy CLASS;
    enum_constant public static final java.lang.annotation.RetentionPolicy RUNTIME;
    enum_constant public static final java.lang.annotation.RetentionPolicy SOURCE;
  }

  @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.ANNOTATION_TYPE) public @interface Target {
    method public abstract java.lang.annotation.ElementType[] value();
  }

}

package java.lang.invoke {

  public abstract class CallSite {
    method public abstract java.lang.invoke.MethodHandle dynamicInvoker();
    method public abstract java.lang.invoke.MethodHandle getTarget();
    method public abstract void setTarget(java.lang.invoke.MethodHandle);
    method public java.lang.invoke.MethodType type();
  }

  public class ConstantCallSite extends java.lang.invoke.CallSite {
    ctor public ConstantCallSite(java.lang.invoke.MethodHandle);
    ctor protected ConstantCallSite(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) throws java.lang.Throwable;
    method public final java.lang.invoke.MethodHandle dynamicInvoker();
    method public final java.lang.invoke.MethodHandle getTarget();
    method public final void setTarget(java.lang.invoke.MethodHandle);
  }

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

  public abstract class MethodHandle {
    method public java.lang.invoke.MethodHandle asCollector(Class<?>, int);
    method public java.lang.invoke.MethodHandle asFixedArity();
    method public java.lang.invoke.MethodHandle asSpreader(Class<?>, int);
    method public java.lang.invoke.MethodHandle asType(java.lang.invoke.MethodType);
    method public java.lang.invoke.MethodHandle asVarargsCollector(Class<?>);
    method public java.lang.invoke.MethodHandle bindTo(Object);
    method public final Object invoke(java.lang.Object...) throws java.lang.Throwable;
    method public final Object invokeExact(java.lang.Object...) throws java.lang.Throwable;
    method public Object invokeWithArguments(java.lang.Object...) throws java.lang.Throwable;
    method public Object invokeWithArguments(java.util.List<?>) throws java.lang.Throwable;
    method public boolean isVarargsCollector();
    method public java.lang.invoke.MethodType type();
  }

  public interface MethodHandleInfo {
    method public Class<?> getDeclaringClass();
    method public java.lang.invoke.MethodType getMethodType();
    method public int getModifiers();
    method public String getName();
    method public int getReferenceKind();
    method public default boolean isVarArgs();
    method public static boolean refKindIsField(int);
    method public static boolean refKindIsValid(int);
    method public static String refKindName(int);
    method public static String referenceKindToString(int);
    method public <T extends java.lang.reflect.Member> T reflectAs(Class<T>, java.lang.invoke.MethodHandles.Lookup);
    method public static String toString(int, Class<?>, String, java.lang.invoke.MethodType);
    field public static final int REF_getField = 1; // 0x1
    field public static final int REF_getStatic = 2; // 0x2
    field public static final int REF_invokeInterface = 9; // 0x9
    field public static final int REF_invokeSpecial = 7; // 0x7
    field public static final int REF_invokeStatic = 6; // 0x6
    field public static final int REF_invokeVirtual = 5; // 0x5
    field public static final int REF_newInvokeSpecial = 8; // 0x8
    field public static final int REF_putField = 3; // 0x3
    field public static final int REF_putStatic = 4; // 0x4
  }

  public class MethodHandles {
    method public static java.lang.invoke.MethodHandle arrayElementGetter(Class<?>) throws java.lang.IllegalArgumentException;
    method public static java.lang.invoke.MethodHandle arrayElementSetter(Class<?>) throws java.lang.IllegalArgumentException;
    method public static java.lang.invoke.MethodHandle catchException(java.lang.invoke.MethodHandle, Class<? extends java.lang.Throwable>, java.lang.invoke.MethodHandle);
    method public static java.lang.invoke.MethodHandle collectArguments(java.lang.invoke.MethodHandle, int, java.lang.invoke.MethodHandle);
    method public static java.lang.invoke.MethodHandle constant(Class<?>, Object);
    method public static java.lang.invoke.MethodHandle dropArguments(java.lang.invoke.MethodHandle, int, java.util.List<java.lang.Class<?>>);
    method public static java.lang.invoke.MethodHandle dropArguments(java.lang.invoke.MethodHandle, int, Class<?>...);
    method public static java.lang.invoke.MethodHandle exactInvoker(java.lang.invoke.MethodType);
    method public static java.lang.invoke.MethodHandle explicitCastArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType);
    method public static java.lang.invoke.MethodHandle filterArguments(java.lang.invoke.MethodHandle, int, java.lang.invoke.MethodHandle...);
    method public static java.lang.invoke.MethodHandle filterReturnValue(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle);
    method public static java.lang.invoke.MethodHandle foldArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle);
    method public static java.lang.invoke.MethodHandle guardWithTest(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle);
    method public static java.lang.invoke.MethodHandle identity(Class<?>);
    method public static java.lang.invoke.MethodHandle insertArguments(java.lang.invoke.MethodHandle, int, java.lang.Object...);
    method public static java.lang.invoke.MethodHandle invoker(java.lang.invoke.MethodType);
    method public static java.lang.invoke.MethodHandles.Lookup lookup();
    method public static java.lang.invoke.MethodHandle permuteArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, int...);
    method public static java.lang.invoke.MethodHandles.Lookup publicLookup();
    method public static <T extends java.lang.reflect.Member> T reflectAs(Class<T>, java.lang.invoke.MethodHandle);
    method public static java.lang.invoke.MethodHandle spreadInvoker(java.lang.invoke.MethodType, int);
    method public static java.lang.invoke.MethodHandle throwException(Class<?>, Class<? extends java.lang.Throwable>);
  }

  public static final class MethodHandles.Lookup {
    method public java.lang.invoke.MethodHandle bind(Object, String, java.lang.invoke.MethodType) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
    method public java.lang.invoke.MethodHandle findConstructor(Class<?>, java.lang.invoke.MethodType) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
    method public java.lang.invoke.MethodHandle findGetter(Class<?>, String, Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException;
    method public java.lang.invoke.MethodHandle findSetter(Class<?>, String, Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException;
    method public java.lang.invoke.MethodHandle findSpecial(Class<?>, String, java.lang.invoke.MethodType, Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
    method public java.lang.invoke.MethodHandle findStatic(Class<?>, String, java.lang.invoke.MethodType) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
    method public java.lang.invoke.MethodHandle findStaticGetter(Class<?>, String, Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException;
    method public java.lang.invoke.MethodHandle findStaticSetter(Class<?>, String, Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException;
    method public java.lang.invoke.MethodHandle findVirtual(Class<?>, String, java.lang.invoke.MethodType) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
    method public java.lang.invoke.MethodHandles.Lookup in(Class<?>);
    method public Class<?> lookupClass();
    method public int lookupModes();
    method public java.lang.invoke.MethodHandleInfo revealDirect(java.lang.invoke.MethodHandle);
    method public java.lang.invoke.MethodHandle unreflect(java.lang.reflect.Method) throws java.lang.IllegalAccessException;
    method public java.lang.invoke.MethodHandle unreflectConstructor(java.lang.reflect.Constructor<?>) throws java.lang.IllegalAccessException;
    method public java.lang.invoke.MethodHandle unreflectGetter(java.lang.reflect.Field) throws java.lang.IllegalAccessException;
    method public java.lang.invoke.MethodHandle unreflectSetter(java.lang.reflect.Field) throws java.lang.IllegalAccessException;
    method public java.lang.invoke.MethodHandle unreflectSpecial(java.lang.reflect.Method, Class<?>) throws java.lang.IllegalAccessException;
    field public static final int PACKAGE = 8; // 0x8
    field public static final int PRIVATE = 2; // 0x2
    field public static final int PROTECTED = 4; // 0x4
    field public static final int PUBLIC = 1; // 0x1
  }

  public final class MethodType implements java.io.Serializable {
    method public java.lang.invoke.MethodType appendParameterTypes(Class<?>...);
    method public java.lang.invoke.MethodType appendParameterTypes(java.util.List<java.lang.Class<?>>);
    method public java.lang.invoke.MethodType changeParameterType(int, Class<?>);
    method public java.lang.invoke.MethodType changeReturnType(Class<?>);
    method public java.lang.invoke.MethodType dropParameterTypes(int, int);
    method public java.lang.invoke.MethodType erase();
    method public static java.lang.invoke.MethodType fromMethodDescriptorString(String, ClassLoader) throws java.lang.IllegalArgumentException, java.lang.TypeNotPresentException;
    method public java.lang.invoke.MethodType generic();
    method public static java.lang.invoke.MethodType genericMethodType(int, boolean);
    method public static java.lang.invoke.MethodType genericMethodType(int);
    method public boolean hasPrimitives();
    method public boolean hasWrappers();
    method public java.lang.invoke.MethodType insertParameterTypes(int, Class<?>...);
    method public java.lang.invoke.MethodType insertParameterTypes(int, java.util.List<java.lang.Class<?>>);
    method public static java.lang.invoke.MethodType methodType(Class<?>, Class<?>[]);
    method public static java.lang.invoke.MethodType methodType(Class<?>, java.util.List<java.lang.Class<?>>);
    method public static java.lang.invoke.MethodType methodType(Class<?>, Class<?>, Class<?>...);
    method public static java.lang.invoke.MethodType methodType(Class<?>);
    method public static java.lang.invoke.MethodType methodType(Class<?>, Class<?>);
    method public static java.lang.invoke.MethodType methodType(Class<?>, java.lang.invoke.MethodType);
    method public Class<?>[] parameterArray();
    method public int parameterCount();
    method public java.util.List<java.lang.Class<?>> parameterList();
    method public Class<?> parameterType(int);
    method public Class<?> returnType();
    method public String toMethodDescriptorString();
    method public java.lang.invoke.MethodType unwrap();
    method public java.lang.invoke.MethodType wrap();
  }

  public class MutableCallSite extends java.lang.invoke.CallSite {
    ctor public MutableCallSite(java.lang.invoke.MethodType);
    ctor public MutableCallSite(java.lang.invoke.MethodHandle);
    method public final java.lang.invoke.MethodHandle dynamicInvoker();
    method public final java.lang.invoke.MethodHandle getTarget();
    method public void setTarget(java.lang.invoke.MethodHandle);
  }

  public class VolatileCallSite extends java.lang.invoke.CallSite {
    ctor public VolatileCallSite(java.lang.invoke.MethodType);
    ctor public VolatileCallSite(java.lang.invoke.MethodHandle);
    method public final java.lang.invoke.MethodHandle dynamicInvoker();
    method public final java.lang.invoke.MethodHandle getTarget();
    method public void setTarget(java.lang.invoke.MethodHandle);
  }

  public class WrongMethodTypeException extends java.lang.RuntimeException {
    ctor public WrongMethodTypeException();
    ctor public WrongMethodTypeException(String);
  }

}

package java.lang.ref {

  public class PhantomReference<T> extends java.lang.ref.Reference<T> {
    ctor public PhantomReference(T, java.lang.ref.ReferenceQueue<? super T>);
  }

  public abstract class Reference<T> {
    method public void clear();
    method public boolean enqueue();
    method public T get();
    method public boolean isEnqueued();
    method public static void reachabilityFence(Object);
  }

  public class ReferenceQueue<T> {
    ctor public ReferenceQueue();
    method public java.lang.ref.Reference<? extends T> poll();
    method public java.lang.ref.Reference<? extends T> remove(long) throws java.lang.IllegalArgumentException, java.lang.InterruptedException;
    method public java.lang.ref.Reference<? extends T> remove() throws java.lang.InterruptedException;
  }

  public class SoftReference<T> extends java.lang.ref.Reference<T> {
    ctor public SoftReference(T);
    ctor public SoftReference(T, java.lang.ref.ReferenceQueue<? super T>);
  }

  public class WeakReference<T> extends java.lang.ref.Reference<T> {
    ctor public WeakReference(T);
    ctor public WeakReference(T, java.lang.ref.ReferenceQueue<? super T>);
  }

}

package java.lang.reflect {

  public class AccessibleObject implements java.lang.reflect.AnnotatedElement {
    ctor protected AccessibleObject();
    method @Nullable public <T extends java.lang.annotation.Annotation> T getAnnotation(@NonNull Class<T>);
    method @NonNull public java.lang.annotation.Annotation[] getAnnotations();
    method @NonNull public java.lang.annotation.Annotation[] getDeclaredAnnotations();
    method public boolean isAccessible();
    method public static void setAccessible(java.lang.reflect.AccessibleObject[], boolean) throws java.lang.SecurityException;
    method public void setAccessible(boolean) throws java.lang.SecurityException;
  }

  public interface AnnotatedElement {
    method @Nullable public <T extends java.lang.annotation.Annotation> T getAnnotation(@NonNull Class<T>);
    method @NonNull public java.lang.annotation.Annotation[] getAnnotations();
    method public default <T extends java.lang.annotation.Annotation> T[] getAnnotationsByType(@NonNull Class<T>);
    method @Nullable public default <T extends java.lang.annotation.Annotation> T getDeclaredAnnotation(@NonNull Class<T>);
    method @NonNull public java.lang.annotation.Annotation[] getDeclaredAnnotations();
    method public default <T extends java.lang.annotation.Annotation> T[] getDeclaredAnnotationsByType(@NonNull Class<T>);
    method public default boolean isAnnotationPresent(@NonNull Class<? extends java.lang.annotation.Annotation>);
  }

  public final class Array {
    method @Nullable public static Object get(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static boolean getBoolean(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static byte getByte(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static char getChar(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static double getDouble(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static float getFloat(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static int getInt(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static int getLength(@NonNull Object);
    method public static long getLong(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static short getShort(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method @NonNull public static Object newInstance(@NonNull Class<?>, int) throws java.lang.NegativeArraySizeException;
    method @NonNull public static Object newInstance(@NonNull Class<?>, int...) throws java.lang.IllegalArgumentException, java.lang.NegativeArraySizeException;
    method public static void set(@NonNull Object, int, @Nullable Object) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setBoolean(@NonNull Object, int, boolean);
    method public static void setByte(@NonNull Object, int, byte) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setChar(@NonNull Object, int, char) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setDouble(@NonNull Object, int, double) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setFloat(@NonNull Object, int, float) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setInt(@NonNull Object, int, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setLong(@NonNull Object, int, long) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setShort(@NonNull Object, int, short) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
  }

  public final class Constructor<T> extends java.lang.reflect.Executable {
    method @NonNull public Class<T> getDeclaringClass();
    method public Class<?>[] getExceptionTypes();
    method public int getModifiers();
    method @NonNull public String getName();
    method public java.lang.annotation.Annotation[][] getParameterAnnotations();
    method @NonNull public Class<?>[] getParameterTypes();
    method public java.lang.reflect.TypeVariable<java.lang.reflect.Constructor<T>>[] getTypeParameters();
    method @NonNull public T newInstance(java.lang.Object...) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException;
    method @NonNull public String toGenericString();
  }

  public abstract class Executable extends java.lang.reflect.AccessibleObject implements java.lang.reflect.GenericDeclaration java.lang.reflect.Member {
    method @NonNull public abstract Class<?>[] getExceptionTypes();
    method @NonNull public java.lang.reflect.Type[] getGenericExceptionTypes();
    method @NonNull public java.lang.reflect.Type[] getGenericParameterTypes();
    method @NonNull public abstract java.lang.annotation.Annotation[][] getParameterAnnotations();
    method public int getParameterCount();
    method @NonNull public abstract Class<?>[] getParameterTypes();
    method @NonNull public java.lang.reflect.Parameter[] getParameters();
    method public final boolean isAnnotationPresent(@NonNull Class<? extends java.lang.annotation.Annotation>);
    method public boolean isSynthetic();
    method public boolean isVarArgs();
    method @NonNull public abstract String toGenericString();
  }

  public final class Field extends java.lang.reflect.AccessibleObject implements java.lang.reflect.Member {
    method @Nullable public Object get(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public boolean getBoolean(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public byte getByte(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public char getChar(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method @NonNull public Class<?> getDeclaringClass();
    method public double getDouble(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public float getFloat(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method @NonNull public java.lang.reflect.Type getGenericType();
    method public int getInt(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public long getLong(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public int getModifiers();
    method @NonNull public String getName();
    method public short getShort(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method @NonNull public Class<?> getType();
    method public boolean isEnumConstant();
    method public boolean isSynthetic();
    method public void set(@Nullable Object, @Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setBoolean(@Nullable Object, boolean) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setByte(@Nullable Object, byte) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setChar(@Nullable Object, char) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setDouble(@Nullable Object, double) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setFloat(@Nullable Object, float) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setInt(@Nullable Object, int) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setLong(@Nullable Object, long) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setShort(@Nullable Object, short) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method @NonNull public String toGenericString();
  }

  public interface GenericArrayType extends java.lang.reflect.Type {
    method @NonNull public java.lang.reflect.Type getGenericComponentType();
  }

  public interface GenericDeclaration extends java.lang.reflect.AnnotatedElement {
    method @NonNull public java.lang.reflect.TypeVariable<?>[] getTypeParameters();
  }

  public class GenericSignatureFormatError extends java.lang.ClassFormatError {
    ctor public GenericSignatureFormatError();
    ctor public GenericSignatureFormatError(String);
  }

  public interface InvocationHandler {
    method public Object invoke(Object, java.lang.reflect.Method, Object[]) throws java.lang.Throwable;
  }

  public class InvocationTargetException extends java.lang.ReflectiveOperationException {
    ctor protected InvocationTargetException();
    ctor public InvocationTargetException(Throwable);
    ctor public InvocationTargetException(Throwable, String);
    method public Throwable getTargetException();
  }

  public class MalformedParameterizedTypeException extends java.lang.RuntimeException {
    ctor public MalformedParameterizedTypeException();
  }

  public class MalformedParametersException extends java.lang.RuntimeException {
    ctor public MalformedParametersException();
    ctor public MalformedParametersException(String);
  }

  public interface Member {
    method @NonNull public Class<?> getDeclaringClass();
    method public int getModifiers();
    method @NonNull public String getName();
    method public boolean isSynthetic();
    field public static final int DECLARED = 1; // 0x1
    field public static final int PUBLIC = 0; // 0x0
  }

  public final class Method extends java.lang.reflect.Executable {
    method @NonNull public Class<?> getDeclaringClass();
    method @Nullable public Object getDefaultValue();
    method @NonNull public Class<?>[] getExceptionTypes();
    method @NonNull public java.lang.reflect.Type getGenericReturnType();
    method public int getModifiers();
    method @NonNull public String getName();
    method @NonNull public java.lang.annotation.Annotation[][] getParameterAnnotations();
    method @NonNull public Class<?>[] getParameterTypes();
    method @NonNull public Class<?> getReturnType();
    method @NonNull public java.lang.reflect.TypeVariable<java.lang.reflect.Method>[] getTypeParameters();
    method @Nullable public Object invoke(@Nullable Object, @Nullable java.lang.Object...) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException;
    method public boolean isBridge();
    method public boolean isDefault();
    method @NonNull public String toGenericString();
  }

  public class Modifier {
    ctor public Modifier();
    method public static int classModifiers();
    method public static int constructorModifiers();
    method public static int fieldModifiers();
    method public static int interfaceModifiers();
    method public static boolean isAbstract(int);
    method public static boolean isFinal(int);
    method public static boolean isInterface(int);
    method public static boolean isNative(int);
    method public static boolean isPrivate(int);
    method public static boolean isProtected(int);
    method public static boolean isPublic(int);
    method public static boolean isStatic(int);
    method public static boolean isStrict(int);
    method public static boolean isSynchronized(int);
    method public static boolean isTransient(int);
    method public static boolean isVolatile(int);
    method public static int methodModifiers();
    method public static int parameterModifiers();
    method public static String toString(int);
    field public static final int ABSTRACT = 1024; // 0x400
    field public static final int FINAL = 16; // 0x10
    field public static final int INTERFACE = 512; // 0x200
    field public static final int NATIVE = 256; // 0x100
    field public static final int PRIVATE = 2; // 0x2
    field public static final int PROTECTED = 4; // 0x4
    field public static final int PUBLIC = 1; // 0x1
    field public static final int STATIC = 8; // 0x8
    field public static final int STRICT = 2048; // 0x800
    field public static final int SYNCHRONIZED = 32; // 0x20
    field public static final int TRANSIENT = 128; // 0x80
    field public static final int VOLATILE = 64; // 0x40
  }

  public final class Parameter implements java.lang.reflect.AnnotatedElement {
    method @Nullable public <T extends java.lang.annotation.Annotation> T getAnnotation(@NonNull Class<T>);
    method @NonNull public java.lang.annotation.Annotation[] getAnnotations();
    method @NonNull public java.lang.annotation.Annotation[] getDeclaredAnnotations();
    method @NonNull public java.lang.reflect.Executable getDeclaringExecutable();
    method public int getModifiers();
    method @NonNull public String getName();
    method @NonNull public java.lang.reflect.Type getParameterizedType();
    method @NonNull public Class<?> getType();
    method public boolean isImplicit();
    method public boolean isNamePresent();
    method public boolean isSynthetic();
    method public boolean isVarArgs();
  }

  public interface ParameterizedType extends java.lang.reflect.Type {
    method @NonNull public java.lang.reflect.Type[] getActualTypeArguments();
    method @Nullable public java.lang.reflect.Type getOwnerType();
    method @NonNull public java.lang.reflect.Type getRawType();
  }

  public class Proxy implements java.io.Serializable {
    ctor protected Proxy(@NonNull java.lang.reflect.InvocationHandler);
    method @NonNull public static java.lang.reflect.InvocationHandler getInvocationHandler(@NonNull Object) throws java.lang.IllegalArgumentException;
    method @NonNull public static Class<?> getProxyClass(@Nullable ClassLoader, @NonNull Class<?>...) throws java.lang.IllegalArgumentException;
    method public static boolean isProxyClass(@NonNull Class<?>);
    method @NonNull public static Object newProxyInstance(@Nullable ClassLoader, @NonNull Class<?>[], @NonNull java.lang.reflect.InvocationHandler) throws java.lang.IllegalArgumentException;
    field protected java.lang.reflect.InvocationHandler h;
  }

  public final class ReflectPermission extends java.security.BasicPermission {
    ctor public ReflectPermission(String);
    ctor public ReflectPermission(String, String);
  }

  public interface Type {
    method @NonNull public default String getTypeName();
  }

  public interface TypeVariable<D extends java.lang.reflect.GenericDeclaration> extends java.lang.reflect.Type {
    method @NonNull public java.lang.reflect.Type[] getBounds();
    method @NonNull public D getGenericDeclaration();
    method @NonNull public String getName();
  }

  public class UndeclaredThrowableException extends java.lang.RuntimeException {
    ctor public UndeclaredThrowableException(Throwable);
    ctor public UndeclaredThrowableException(Throwable, String);
    method public Throwable getUndeclaredThrowable();
  }

  public interface WildcardType extends java.lang.reflect.Type {
    method @NonNull public java.lang.reflect.Type[] getLowerBounds();
    method @NonNull public java.lang.reflect.Type[] getUpperBounds();
  }

}

package java.math {

  public class BigDecimal extends java.lang.Number implements java.lang.Comparable<java.math.BigDecimal> java.io.Serializable {
    ctor public BigDecimal(char[], int, int);
    ctor public BigDecimal(char[], int, int, java.math.MathContext);
    ctor public BigDecimal(char[]);
    ctor public BigDecimal(char[], java.math.MathContext);
    ctor public BigDecimal(String);
    ctor public BigDecimal(String, java.math.MathContext);
    ctor public BigDecimal(double);
    ctor public BigDecimal(double, java.math.MathContext);
    ctor public BigDecimal(java.math.BigInteger);
    ctor public BigDecimal(java.math.BigInteger, java.math.MathContext);
    ctor public BigDecimal(java.math.BigInteger, int);
    ctor public BigDecimal(java.math.BigInteger, int, java.math.MathContext);
    ctor public BigDecimal(int);
    ctor public BigDecimal(int, java.math.MathContext);
    ctor public BigDecimal(long);
    ctor public BigDecimal(long, java.math.MathContext);
    method public java.math.BigDecimal abs();
    method public java.math.BigDecimal abs(java.math.MathContext);
    method public java.math.BigDecimal add(java.math.BigDecimal);
    method public java.math.BigDecimal add(java.math.BigDecimal, java.math.MathContext);
    method public byte byteValueExact();
    method public int compareTo(java.math.BigDecimal);
    method public java.math.BigDecimal divide(java.math.BigDecimal, int, int);
    method public java.math.BigDecimal divide(java.math.BigDecimal, int, java.math.RoundingMode);
    method public java.math.BigDecimal divide(java.math.BigDecimal, int);
    method public java.math.BigDecimal divide(java.math.BigDecimal, java.math.RoundingMode);
    method public java.math.BigDecimal divide(java.math.BigDecimal);
    method public java.math.BigDecimal divide(java.math.BigDecimal, java.math.MathContext);
    method public java.math.BigDecimal[] divideAndRemainder(java.math.BigDecimal);
    method public java.math.BigDecimal[] divideAndRemainder(java.math.BigDecimal, java.math.MathContext);
    method public java.math.BigDecimal divideToIntegralValue(java.math.BigDecimal);
    method public java.math.BigDecimal divideToIntegralValue(java.math.BigDecimal, java.math.MathContext);
    method public double doubleValue();
    method public float floatValue();
    method public int intValue();
    method public int intValueExact();
    method public long longValue();
    method public long longValueExact();
    method public java.math.BigDecimal max(java.math.BigDecimal);
    method public java.math.BigDecimal min(java.math.BigDecimal);
    method public java.math.BigDecimal movePointLeft(int);
    method public java.math.BigDecimal movePointRight(int);
    method public java.math.BigDecimal multiply(java.math.BigDecimal);
    method public java.math.BigDecimal multiply(java.math.BigDecimal, java.math.MathContext);
    method public java.math.BigDecimal negate();
    method public java.math.BigDecimal negate(java.math.MathContext);
    method public java.math.BigDecimal plus();
    method public java.math.BigDecimal plus(java.math.MathContext);
    method public java.math.BigDecimal pow(int);
    method public java.math.BigDecimal pow(int, java.math.MathContext);
    method public int precision();
    method public java.math.BigDecimal remainder(java.math.BigDecimal);
    method public java.math.BigDecimal remainder(java.math.BigDecimal, java.math.MathContext);
    method public java.math.BigDecimal round(java.math.MathContext);
    method public int scale();
    method public java.math.BigDecimal scaleByPowerOfTen(int);
    method public java.math.BigDecimal setScale(int, java.math.RoundingMode);
    method public java.math.BigDecimal setScale(int, int);
    method public java.math.BigDecimal setScale(int);
    method public short shortValueExact();
    method public int signum();
    method public java.math.BigDecimal stripTrailingZeros();
    method public java.math.BigDecimal subtract(java.math.BigDecimal);
    method public java.math.BigDecimal subtract(java.math.BigDecimal, java.math.MathContext);
    method public java.math.BigInteger toBigInteger();
    method public java.math.BigInteger toBigIntegerExact();
    method public String toEngineeringString();
    method public String toPlainString();
    method public java.math.BigDecimal ulp();
    method public java.math.BigInteger unscaledValue();
    method public static java.math.BigDecimal valueOf(long, int);
    method public static java.math.BigDecimal valueOf(long);
    method public static java.math.BigDecimal valueOf(double);
    field public static final java.math.BigDecimal ONE;
    field public static final int ROUND_CEILING = 2; // 0x2
    field public static final int ROUND_DOWN = 1; // 0x1
    field public static final int ROUND_FLOOR = 3; // 0x3
    field public static final int ROUND_HALF_DOWN = 5; // 0x5
    field public static final int ROUND_HALF_EVEN = 6; // 0x6
    field public static final int ROUND_HALF_UP = 4; // 0x4
    field public static final int ROUND_UNNECESSARY = 7; // 0x7
    field public static final int ROUND_UP = 0; // 0x0
    field public static final java.math.BigDecimal TEN;
    field public static final java.math.BigDecimal ZERO;
  }

  public class BigInteger extends java.lang.Number implements java.lang.Comparable<java.math.BigInteger> java.io.Serializable {
    ctor public BigInteger(int, @NonNull java.util.Random);
    ctor public BigInteger(int, int, @NonNull java.util.Random);
    ctor public BigInteger(@NonNull String);
    ctor public BigInteger(@NonNull String, int);
    ctor public BigInteger(int, byte[]);
    ctor public BigInteger(byte[]);
    method @NonNull public java.math.BigInteger abs();
    method @NonNull public java.math.BigInteger add(@NonNull java.math.BigInteger);
    method @NonNull public java.math.BigInteger and(@NonNull java.math.BigInteger);
    method @NonNull public java.math.BigInteger andNot(@NonNull java.math.BigInteger);
    method public int bitCount();
    method public int bitLength();
    method @NonNull public java.math.BigInteger clearBit(int);
    method public int compareTo(@NonNull java.math.BigInteger);
    method @NonNull public java.math.BigInteger divide(@NonNull java.math.BigInteger);
    method @NonNull public java.math.BigInteger[] divideAndRemainder(@NonNull java.math.BigInteger);
    method public double doubleValue();
    method @NonNull public java.math.BigInteger flipBit(int);
    method public float floatValue();
    method @NonNull public java.math.BigInteger gcd(@NonNull java.math.BigInteger);
    method public int getLowestSetBit();
    method public int intValue();
    method public boolean isProbablePrime(int);
    method public long longValue();
    method @NonNull public java.math.BigInteger max(@NonNull java.math.BigInteger);
    method @NonNull public java.math.BigInteger min(@NonNull java.math.BigInteger);
    method @NonNull public java.math.BigInteger mod(@NonNull java.math.BigInteger);
    method @NonNull public java.math.BigInteger modInverse(@NonNull java.math.BigInteger);
    method @NonNull public java.math.BigInteger modPow(@NonNull java.math.BigInteger, @NonNull java.math.BigInteger);
    method @NonNull public java.math.BigInteger multiply(@NonNull java.math.BigInteger);
    method @NonNull public java.math.BigInteger negate();
    method @NonNull public java.math.BigInteger nextProbablePrime();
    method @NonNull public java.math.BigInteger not();
    method @NonNull public java.math.BigInteger or(@NonNull java.math.BigInteger);
    method @NonNull public java.math.BigInteger pow(int);
    method @NonNull public static java.math.BigInteger probablePrime(int, @NonNull java.util.Random);
    method @NonNull public java.math.BigInteger remainder(@NonNull java.math.BigInteger);
    method @NonNull public java.math.BigInteger setBit(int);
    method @NonNull public java.math.BigInteger shiftLeft(int);
    method @NonNull public java.math.BigInteger shiftRight(int);
    method public int signum();
    method @NonNull public java.math.BigInteger subtract(@NonNull java.math.BigInteger);
    method public boolean testBit(int);
    method public byte[] toByteArray();
    method @NonNull public String toString(int);
    method @NonNull public static java.math.BigInteger valueOf(long);
    method @NonNull public java.math.BigInteger xor(@NonNull java.math.BigInteger);
    field @NonNull public static final java.math.BigInteger ONE;
    field @NonNull public static final java.math.BigInteger TEN;
    field @NonNull public static final java.math.BigInteger ZERO;
  }

  public final class MathContext implements java.io.Serializable {
    ctor public MathContext(int);
    ctor public MathContext(int, java.math.RoundingMode);
    ctor public MathContext(String);
    method public int getPrecision();
    method public java.math.RoundingMode getRoundingMode();
    field public static final java.math.MathContext DECIMAL128;
    field public static final java.math.MathContext DECIMAL32;
    field public static final java.math.MathContext DECIMAL64;
    field public static final java.math.MathContext UNLIMITED;
  }

  public enum RoundingMode {
    method public static java.math.RoundingMode valueOf(int);
    enum_constant public static final java.math.RoundingMode CEILING;
    enum_constant public static final java.math.RoundingMode DOWN;
    enum_constant public static final java.math.RoundingMode FLOOR;
    enum_constant public static final java.math.RoundingMode HALF_DOWN;
    enum_constant public static final java.math.RoundingMode HALF_EVEN;
    enum_constant public static final java.math.RoundingMode HALF_UP;
    enum_constant public static final java.math.RoundingMode UNNECESSARY;
    enum_constant public static final java.math.RoundingMode UP;
  }

}

package java.net {

  public abstract class Authenticator {
    ctor public Authenticator();
    method protected java.net.PasswordAuthentication getPasswordAuthentication();
    method protected final String getRequestingHost();
    method protected final int getRequestingPort();
    method protected final String getRequestingPrompt();
    method protected final String getRequestingProtocol();
    method protected final String getRequestingScheme();
    method protected final java.net.InetAddress getRequestingSite();
    method protected java.net.URL getRequestingURL();
    method protected java.net.Authenticator.RequestorType getRequestorType();
    method public static java.net.PasswordAuthentication requestPasswordAuthentication(java.net.InetAddress, int, String, String, String);
    method public static java.net.PasswordAuthentication requestPasswordAuthentication(String, java.net.InetAddress, int, String, String, String);
    method public static java.net.PasswordAuthentication requestPasswordAuthentication(String, java.net.InetAddress, int, String, String, String, java.net.URL, java.net.Authenticator.RequestorType);
    method public static void setDefault(java.net.Authenticator);
  }

  public enum Authenticator.RequestorType {
    enum_constant public static final java.net.Authenticator.RequestorType PROXY;
    enum_constant public static final java.net.Authenticator.RequestorType SERVER;
  }

  public class BindException extends java.net.SocketException {
    ctor public BindException(String);
    ctor public BindException();
  }

  public abstract class CacheRequest {
    ctor public CacheRequest();
    method public abstract void abort();
    method public abstract java.io.OutputStream getBody() throws java.io.IOException;
  }

  public abstract class CacheResponse {
    ctor public CacheResponse();
    method public abstract java.io.InputStream getBody() throws java.io.IOException;
    method public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders() throws java.io.IOException;
  }

  public class ConnectException extends java.net.SocketException {
    ctor public ConnectException(String);
    ctor public ConnectException();
  }

  public abstract class ContentHandler {
    ctor public ContentHandler();
    method public abstract Object getContent(java.net.URLConnection) throws java.io.IOException;
    method public Object getContent(java.net.URLConnection, Class[]) throws java.io.IOException;
  }

  public interface ContentHandlerFactory {
    method public java.net.ContentHandler createContentHandler(String);
  }

  public abstract class CookieHandler {
    ctor public CookieHandler();
    method public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> get(java.net.URI, java.util.Map<java.lang.String,java.util.List<java.lang.String>>) throws java.io.IOException;
    method public static java.net.CookieHandler getDefault();
    method public abstract void put(java.net.URI, java.util.Map<java.lang.String,java.util.List<java.lang.String>>) throws java.io.IOException;
    method public static void setDefault(java.net.CookieHandler);
  }

  public class CookieManager extends java.net.CookieHandler {
    ctor public CookieManager();
    ctor public CookieManager(java.net.CookieStore, java.net.CookiePolicy);
    method public java.util.Map<java.lang.String,java.util.List<java.lang.String>> get(java.net.URI, java.util.Map<java.lang.String,java.util.List<java.lang.String>>) throws java.io.IOException;
    method public java.net.CookieStore getCookieStore();
    method public void put(java.net.URI, java.util.Map<java.lang.String,java.util.List<java.lang.String>>) throws java.io.IOException;
    method public void setCookiePolicy(java.net.CookiePolicy);
  }

  public interface CookiePolicy {
    method public boolean shouldAccept(java.net.URI, java.net.HttpCookie);
    field public static final java.net.CookiePolicy ACCEPT_ALL;
    field public static final java.net.CookiePolicy ACCEPT_NONE;
    field public static final java.net.CookiePolicy ACCEPT_ORIGINAL_SERVER;
  }

  public interface CookieStore {
    method public void add(java.net.URI, java.net.HttpCookie);
    method public java.util.List<java.net.HttpCookie> get(java.net.URI);
    method public java.util.List<java.net.HttpCookie> getCookies();
    method public java.util.List<java.net.URI> getURIs();
    method public boolean remove(java.net.URI, java.net.HttpCookie);
    method public boolean removeAll();
  }

  public final class DatagramPacket {
    ctor public DatagramPacket(byte[], int, int);
    ctor public DatagramPacket(byte[], int);
    ctor public DatagramPacket(byte[], int, int, java.net.InetAddress, int);
    ctor public DatagramPacket(byte[], int, int, java.net.SocketAddress);
    ctor public DatagramPacket(byte[], int, java.net.InetAddress, int);
    ctor public DatagramPacket(byte[], int, java.net.SocketAddress);
    method public java.net.InetAddress getAddress();
    method public byte[] getData();
    method public int getLength();
    method public int getOffset();
    method public int getPort();
    method public java.net.SocketAddress getSocketAddress();
    method public void setAddress(java.net.InetAddress);
    method public void setData(byte[], int, int);
    method public void setData(byte[]);
    method public void setLength(int);
    method public void setPort(int);
    method public void setSocketAddress(java.net.SocketAddress);
  }

  public class DatagramSocket implements java.io.Closeable {
    ctor public DatagramSocket() throws java.net.SocketException;
    ctor protected DatagramSocket(java.net.DatagramSocketImpl);
    ctor public DatagramSocket(java.net.SocketAddress) throws java.net.SocketException;
    ctor public DatagramSocket(int) throws java.net.SocketException;
    ctor public DatagramSocket(int, java.net.InetAddress) throws java.net.SocketException;
    method public void bind(java.net.SocketAddress) throws java.net.SocketException;
    method public void close();
    method public void connect(java.net.InetAddress, int);
    method public void connect(java.net.SocketAddress) throws java.net.SocketException;
    method public void disconnect();
    method public boolean getBroadcast() throws java.net.SocketException;
    method public java.nio.channels.DatagramChannel getChannel();
    method public java.net.InetAddress getInetAddress();
    method public java.net.InetAddress getLocalAddress();
    method public int getLocalPort();
    method public java.net.SocketAddress getLocalSocketAddress();
    method public int getPort();
    method public int getReceiveBufferSize() throws java.net.SocketException;
    method public java.net.SocketAddress getRemoteSocketAddress();
    method public boolean getReuseAddress() throws java.net.SocketException;
    method public int getSendBufferSize() throws java.net.SocketException;
    method public int getSoTimeout() throws java.net.SocketException;
    method public int getTrafficClass() throws java.net.SocketException;
    method public boolean isBound();
    method public boolean isClosed();
    method public boolean isConnected();
    method public void receive(java.net.DatagramPacket) throws java.io.IOException;
    method public void send(java.net.DatagramPacket) throws java.io.IOException;
    method public void setBroadcast(boolean) throws java.net.SocketException;
    method public static void setDatagramSocketImplFactory(java.net.DatagramSocketImplFactory) throws java.io.IOException;
    method public void setReceiveBufferSize(int) throws java.net.SocketException;
    method public void setReuseAddress(boolean) throws java.net.SocketException;
    method public void setSendBufferSize(int) throws java.net.SocketException;
    method public void setSoTimeout(int) throws java.net.SocketException;
    method public void setTrafficClass(int) throws java.net.SocketException;
  }

  public abstract class DatagramSocketImpl implements java.net.SocketOptions {
    ctor public DatagramSocketImpl();
    method protected abstract void bind(int, java.net.InetAddress) throws java.net.SocketException;
    method protected abstract void close();
    method protected void connect(java.net.InetAddress, int) throws java.net.SocketException;
    method protected abstract void create() throws java.net.SocketException;
    method protected void disconnect();
    method protected java.io.FileDescriptor getFileDescriptor();
    method protected int getLocalPort();
    method @Deprecated protected abstract byte getTTL() throws java.io.IOException;
    method protected abstract int getTimeToLive() throws java.io.IOException;
    method protected abstract void join(java.net.InetAddress) throws java.io.IOException;
    method protected abstract void joinGroup(java.net.SocketAddress, java.net.NetworkInterface) throws java.io.IOException;
    method protected abstract void leave(java.net.InetAddress) throws java.io.IOException;
    method protected abstract void leaveGroup(java.net.SocketAddress, java.net.NetworkInterface) throws java.io.IOException;
    method protected abstract int peek(java.net.InetAddress) throws java.io.IOException;
    method protected abstract int peekData(java.net.DatagramPacket) throws java.io.IOException;
    method protected abstract void receive(java.net.DatagramPacket) throws java.io.IOException;
    method protected abstract void send(java.net.DatagramPacket) throws java.io.IOException;
    method @Deprecated protected abstract void setTTL(byte) throws java.io.IOException;
    method protected abstract void setTimeToLive(int) throws java.io.IOException;
    field protected java.io.FileDescriptor fd;
    field protected int localPort;
  }

  public interface DatagramSocketImplFactory {
    method public java.net.DatagramSocketImpl createDatagramSocketImpl();
  }

  public interface FileNameMap {
    method public String getContentTypeFor(String);
  }

  public final class HttpCookie implements java.lang.Cloneable {
    ctor public HttpCookie(String, String);
    method public Object clone();
    method public static boolean domainMatches(String, String);
    method public String getComment();
    method public String getCommentURL();
    method public boolean getDiscard();
    method public String getDomain();
    method public long getMaxAge();
    method public String getName();
    method public String getPath();
    method public String getPortlist();
    method public boolean getSecure();
    method public String getValue();
    method public int getVersion();
    method public boolean hasExpired();
    method public boolean isHttpOnly();
    method public static java.util.List<java.net.HttpCookie> parse(String);
    method public void setComment(String);
    method public void setCommentURL(String);
    method public void setDiscard(boolean);
    method public void setDomain(String);
    method public void setHttpOnly(boolean);
    method public void setMaxAge(long);
    method public void setPath(String);
    method public void setPortlist(String);
    method public void setSecure(boolean);
    method public void setValue(String);
    method public void setVersion(int);
  }

  public class HttpRetryException extends java.io.IOException {
    ctor public HttpRetryException(String, int);
    ctor public HttpRetryException(String, int, String);
    method public String getLocation();
    method public String getReason();
    method public int responseCode();
  }

  public abstract class HttpURLConnection extends java.net.URLConnection {
    ctor protected HttpURLConnection(java.net.URL);
    method public abstract void disconnect();
    method public java.io.InputStream getErrorStream();
    method public static boolean getFollowRedirects();
    method public boolean getInstanceFollowRedirects();
    method public String getRequestMethod();
    method public int getResponseCode() throws java.io.IOException;
    method public String getResponseMessage() throws java.io.IOException;
    method public void setChunkedStreamingMode(int);
    method public void setFixedLengthStreamingMode(int);
    method public void setFixedLengthStreamingMode(long);
    method public static void setFollowRedirects(boolean);
    method public void setInstanceFollowRedirects(boolean);
    method public void setRequestMethod(String) throws java.net.ProtocolException;
    method public abstract boolean usingProxy();
    field public static final int HTTP_ACCEPTED = 202; // 0xca
    field public static final int HTTP_BAD_GATEWAY = 502; // 0x1f6
    field public static final int HTTP_BAD_METHOD = 405; // 0x195
    field public static final int HTTP_BAD_REQUEST = 400; // 0x190
    field public static final int HTTP_CLIENT_TIMEOUT = 408; // 0x198
    field public static final int HTTP_CONFLICT = 409; // 0x199
    field public static final int HTTP_CREATED = 201; // 0xc9
    field public static final int HTTP_ENTITY_TOO_LARGE = 413; // 0x19d
    field public static final int HTTP_FORBIDDEN = 403; // 0x193
    field public static final int HTTP_GATEWAY_TIMEOUT = 504; // 0x1f8
    field public static final int HTTP_GONE = 410; // 0x19a
    field public static final int HTTP_INTERNAL_ERROR = 500; // 0x1f4
    field public static final int HTTP_LENGTH_REQUIRED = 411; // 0x19b
    field public static final int HTTP_MOVED_PERM = 301; // 0x12d
    field public static final int HTTP_MOVED_TEMP = 302; // 0x12e
    field public static final int HTTP_MULT_CHOICE = 300; // 0x12c
    field public static final int HTTP_NOT_ACCEPTABLE = 406; // 0x196
    field public static final int HTTP_NOT_AUTHORITATIVE = 203; // 0xcb
    field public static final int HTTP_NOT_FOUND = 404; // 0x194
    field public static final int HTTP_NOT_IMPLEMENTED = 501; // 0x1f5
    field public static final int HTTP_NOT_MODIFIED = 304; // 0x130
    field public static final int HTTP_NO_CONTENT = 204; // 0xcc
    field public static final int HTTP_OK = 200; // 0xc8
    field public static final int HTTP_PARTIAL = 206; // 0xce
    field public static final int HTTP_PAYMENT_REQUIRED = 402; // 0x192
    field public static final int HTTP_PRECON_FAILED = 412; // 0x19c
    field public static final int HTTP_PROXY_AUTH = 407; // 0x197
    field public static final int HTTP_REQ_TOO_LONG = 414; // 0x19e
    field public static final int HTTP_RESET = 205; // 0xcd
    field public static final int HTTP_SEE_OTHER = 303; // 0x12f
    field @Deprecated public static final int HTTP_SERVER_ERROR = 500; // 0x1f4
    field public static final int HTTP_UNAUTHORIZED = 401; // 0x191
    field public static final int HTTP_UNAVAILABLE = 503; // 0x1f7
    field public static final int HTTP_UNSUPPORTED_TYPE = 415; // 0x19f
    field public static final int HTTP_USE_PROXY = 305; // 0x131
    field public static final int HTTP_VERSION = 505; // 0x1f9
    field protected int chunkLength;
    field protected int fixedContentLength;
    field protected long fixedContentLengthLong;
    field protected boolean instanceFollowRedirects;
    field protected String method;
    field protected int responseCode;
    field protected String responseMessage;
  }

  public final class IDN {
    method public static String toASCII(String, int);
    method public static String toASCII(String);
    method public static String toUnicode(String, int);
    method public static String toUnicode(String);
    field public static final int ALLOW_UNASSIGNED = 1; // 0x1
    field public static final int USE_STD3_ASCII_RULES = 2; // 0x2
  }

  public final class Inet4Address extends java.net.InetAddress {
  }

  public final class Inet6Address extends java.net.InetAddress {
    method public static java.net.Inet6Address getByAddress(String, byte[], java.net.NetworkInterface) throws java.net.UnknownHostException;
    method public static java.net.Inet6Address getByAddress(String, byte[], int) throws java.net.UnknownHostException;
    method public int getScopeId();
    method public java.net.NetworkInterface getScopedInterface();
    method public boolean isIPv4CompatibleAddress();
  }

  public class InetAddress implements java.io.Serializable {
    method public byte[] getAddress();
    method public static java.net.InetAddress[] getAllByName(String) throws java.net.UnknownHostException;
    method public static java.net.InetAddress getByAddress(String, byte[]) throws java.net.UnknownHostException;
    method public static java.net.InetAddress getByAddress(byte[]) throws java.net.UnknownHostException;
    method public static java.net.InetAddress getByName(String) throws java.net.UnknownHostException;
    method public String getCanonicalHostName();
    method public String getHostAddress();
    method public String getHostName();
    method public static java.net.InetAddress getLocalHost() throws java.net.UnknownHostException;
    method public static java.net.InetAddress getLoopbackAddress();
    method public boolean isAnyLocalAddress();
    method public boolean isLinkLocalAddress();
    method public boolean isLoopbackAddress();
    method public boolean isMCGlobal();
    method public boolean isMCLinkLocal();
    method public boolean isMCNodeLocal();
    method public boolean isMCOrgLocal();
    method public boolean isMCSiteLocal();
    method public boolean isMulticastAddress();
    method public boolean isReachable(int) throws java.io.IOException;
    method public boolean isReachable(java.net.NetworkInterface, int, int) throws java.io.IOException;
    method public boolean isSiteLocalAddress();
  }

  public class InetSocketAddress extends java.net.SocketAddress {
    ctor public InetSocketAddress(int);
    ctor public InetSocketAddress(java.net.InetAddress, int);
    ctor public InetSocketAddress(String, int);
    method public static java.net.InetSocketAddress createUnresolved(String, int);
    method public final boolean equals(Object);
    method public final java.net.InetAddress getAddress();
    method public final String getHostName();
    method public final String getHostString();
    method public final int getPort();
    method public final int hashCode();
    method public final boolean isUnresolved();
  }

  public class InterfaceAddress {
    method public java.net.InetAddress getAddress();
    method public java.net.InetAddress getBroadcast();
    method public short getNetworkPrefixLength();
  }

  public abstract class JarURLConnection extends java.net.URLConnection {
    ctor protected JarURLConnection(java.net.URL) throws java.net.MalformedURLException;
    method public java.util.jar.Attributes getAttributes() throws java.io.IOException;
    method public java.security.cert.Certificate[] getCertificates() throws java.io.IOException;
    method public String getEntryName();
    method public java.util.jar.JarEntry getJarEntry() throws java.io.IOException;
    method public abstract java.util.jar.JarFile getJarFile() throws java.io.IOException;
    method public java.net.URL getJarFileURL();
    method public java.util.jar.Attributes getMainAttributes() throws java.io.IOException;
    method public java.util.jar.Manifest getManifest() throws java.io.IOException;
    field protected java.net.URLConnection jarFileURLConnection;
  }

  public class MalformedURLException extends java.io.IOException {
    ctor public MalformedURLException();
    ctor public MalformedURLException(String);
  }

  public class MulticastSocket extends java.net.DatagramSocket {
    ctor public MulticastSocket() throws java.io.IOException;
    ctor public MulticastSocket(int) throws java.io.IOException;
    ctor public MulticastSocket(java.net.SocketAddress) throws java.io.IOException;
    method public java.net.InetAddress getInterface() throws java.net.SocketException;
    method public boolean getLoopbackMode() throws java.net.SocketException;
    method public java.net.NetworkInterface getNetworkInterface() throws java.net.SocketException;
    method @Deprecated public byte getTTL() throws java.io.IOException;
    method public int getTimeToLive() throws java.io.IOException;
    method public void joinGroup(java.net.InetAddress) throws java.io.IOException;
    method public void joinGroup(java.net.SocketAddress, java.net.NetworkInterface) throws java.io.IOException;
    method public void leaveGroup(java.net.InetAddress) throws java.io.IOException;
    method public void leaveGroup(java.net.SocketAddress, java.net.NetworkInterface) throws java.io.IOException;
    method @Deprecated public void send(java.net.DatagramPacket, byte) throws java.io.IOException;
    method public void setInterface(java.net.InetAddress) throws java.net.SocketException;
    method public void setLoopbackMode(boolean) throws java.net.SocketException;
    method public void setNetworkInterface(java.net.NetworkInterface) throws java.net.SocketException;
    method @Deprecated public void setTTL(byte) throws java.io.IOException;
    method public void setTimeToLive(int) throws java.io.IOException;
  }

  public final class NetPermission extends java.security.BasicPermission {
    ctor public NetPermission(String);
    ctor public NetPermission(String, String);
  }

  public final class NetworkInterface {
    method public static java.net.NetworkInterface getByIndex(int) throws java.net.SocketException;
    method public static java.net.NetworkInterface getByInetAddress(java.net.InetAddress) throws java.net.SocketException;
    method public static java.net.NetworkInterface getByName(String) throws java.net.SocketException;
    method public String getDisplayName();
    method public byte[] getHardwareAddress() throws java.net.SocketException;
    method public int getIndex();
    method public java.util.Enumeration<java.net.InetAddress> getInetAddresses();
    method public java.util.List<java.net.InterfaceAddress> getInterfaceAddresses();
    method public int getMTU() throws java.net.SocketException;
    method public String getName();
    method public static java.util.Enumeration<java.net.NetworkInterface> getNetworkInterfaces() throws java.net.SocketException;
    method public java.net.NetworkInterface getParent();
    method public java.util.Enumeration<java.net.NetworkInterface> getSubInterfaces();
    method public boolean isLoopback() throws java.net.SocketException;
    method public boolean isPointToPoint() throws java.net.SocketException;
    method public boolean isUp() throws java.net.SocketException;
    method public boolean isVirtual();
    method public boolean supportsMulticast() throws java.net.SocketException;
  }

  public class NoRouteToHostException extends java.net.SocketException {
    ctor public NoRouteToHostException(String);
    ctor public NoRouteToHostException();
  }

  public final class PasswordAuthentication {
    ctor public PasswordAuthentication(String, char[]);
    method public char[] getPassword();
    method public String getUserName();
  }

  public class PortUnreachableException extends java.net.SocketException {
    ctor public PortUnreachableException(String);
    ctor public PortUnreachableException();
  }

  public class ProtocolException extends java.io.IOException {
    ctor public ProtocolException(String);
    ctor public ProtocolException();
  }

  public interface ProtocolFamily {
    method public String name();
  }

  public class Proxy {
    ctor public Proxy(java.net.Proxy.Type, java.net.SocketAddress);
    method public java.net.SocketAddress address();
    method public final boolean equals(Object);
    method public final int hashCode();
    method public java.net.Proxy.Type type();
    field public static final java.net.Proxy NO_PROXY;
  }

  public enum Proxy.Type {
    enum_constant public static final java.net.Proxy.Type DIRECT;
    enum_constant public static final java.net.Proxy.Type HTTP;
    enum_constant public static final java.net.Proxy.Type SOCKS;
  }

  public abstract class ProxySelector {
    ctor public ProxySelector();
    method public abstract void connectFailed(java.net.URI, java.net.SocketAddress, java.io.IOException);
    method public static java.net.ProxySelector getDefault();
    method public abstract java.util.List<java.net.Proxy> select(java.net.URI);
    method public static void setDefault(java.net.ProxySelector);
  }

  public abstract class ResponseCache {
    ctor public ResponseCache();
    method public abstract java.net.CacheResponse get(java.net.URI, String, java.util.Map<java.lang.String,java.util.List<java.lang.String>>) throws java.io.IOException;
    method public static java.net.ResponseCache getDefault();
    method public abstract java.net.CacheRequest put(java.net.URI, java.net.URLConnection) throws java.io.IOException;
    method public static void setDefault(java.net.ResponseCache);
  }

  public abstract class SecureCacheResponse extends java.net.CacheResponse {
    ctor public SecureCacheResponse();
    method public abstract String getCipherSuite();
    method public abstract java.util.List<java.security.cert.Certificate> getLocalCertificateChain();
    method public abstract java.security.Principal getLocalPrincipal();
    method public abstract java.security.Principal getPeerPrincipal() throws javax.net.ssl.SSLPeerUnverifiedException;
    method public abstract java.util.List<java.security.cert.Certificate> getServerCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedException;
  }

  public class ServerSocket implements java.io.Closeable {
    ctor public ServerSocket() throws java.io.IOException;
    ctor public ServerSocket(int) throws java.io.IOException;
    ctor public ServerSocket(int, int) throws java.io.IOException;
    ctor public ServerSocket(int, int, java.net.InetAddress) throws java.io.IOException;
    method public java.net.Socket accept() throws java.io.IOException;
    method public void bind(java.net.SocketAddress) throws java.io.IOException;
    method public void bind(java.net.SocketAddress, int) throws java.io.IOException;
    method public void close() throws java.io.IOException;
    method public java.nio.channels.ServerSocketChannel getChannel();
    method public java.net.InetAddress getInetAddress();
    method public int getLocalPort();
    method public java.net.SocketAddress getLocalSocketAddress();
    method public int getReceiveBufferSize() throws java.net.SocketException;
    method public boolean getReuseAddress() throws java.net.SocketException;
    method public int getSoTimeout() throws java.io.IOException;
    method protected final void implAccept(java.net.Socket) throws java.io.IOException;
    method public boolean isBound();
    method public boolean isClosed();
    method public void setPerformancePreferences(int, int, int);
    method public void setReceiveBufferSize(int) throws java.net.SocketException;
    method public void setReuseAddress(boolean) throws java.net.SocketException;
    method public void setSoTimeout(int) throws java.net.SocketException;
    method public static void setSocketFactory(java.net.SocketImplFactory) throws java.io.IOException;
  }

  public class Socket implements java.io.Closeable {
    ctor public Socket();
    ctor public Socket(java.net.Proxy);
    ctor protected Socket(java.net.SocketImpl) throws java.net.SocketException;
    ctor public Socket(String, int) throws java.io.IOException, java.net.UnknownHostException;
    ctor public Socket(java.net.InetAddress, int) throws java.io.IOException;
    ctor public Socket(String, int, java.net.InetAddress, int) throws java.io.IOException;
    ctor public Socket(java.net.InetAddress, int, java.net.InetAddress, int) throws java.io.IOException;
    ctor @Deprecated public Socket(String, int, boolean) throws java.io.IOException;
    ctor @Deprecated public Socket(java.net.InetAddress, int, boolean) throws java.io.IOException;
    method public void bind(java.net.SocketAddress) throws java.io.IOException;
    method public void close() throws java.io.IOException;
    method public void connect(java.net.SocketAddress) throws java.io.IOException;
    method public void connect(java.net.SocketAddress, int) throws java.io.IOException;
    method public java.nio.channels.SocketChannel getChannel();
    method public java.net.InetAddress getInetAddress();
    method public java.io.InputStream getInputStream() throws java.io.IOException;
    method public boolean getKeepAlive() throws java.net.SocketException;
    method public java.net.InetAddress getLocalAddress();
    method public int getLocalPort();
    method public java.net.SocketAddress getLocalSocketAddress();
    method public boolean getOOBInline() throws java.net.SocketException;
    method public java.io.OutputStream getOutputStream() throws java.io.IOException;
    method public int getPort();
    method public int getReceiveBufferSize() throws java.net.SocketException;
    method public java.net.SocketAddress getRemoteSocketAddress();
    method public boolean getReuseAddress() throws java.net.SocketException;
    method public int getSendBufferSize() throws java.net.SocketException;
    method public int getSoLinger() throws java.net.SocketException;
    method public int getSoTimeout() throws java.net.SocketException;
    method public boolean getTcpNoDelay() throws java.net.SocketException;
    method public int getTrafficClass() throws java.net.SocketException;
    method public boolean isBound();
    method public boolean isClosed();
    method public boolean isConnected();
    method public boolean isInputShutdown();
    method public boolean isOutputShutdown();
    method public void sendUrgentData(int) throws java.io.IOException;
    method public void setKeepAlive(boolean) throws java.net.SocketException;
    method public void setOOBInline(boolean) throws java.net.SocketException;
    method public void setPerformancePreferences(int, int, int);
    method public void setReceiveBufferSize(int) throws java.net.SocketException;
    method public void setReuseAddress(boolean) throws java.net.SocketException;
    method public void setSendBufferSize(int) throws java.net.SocketException;
    method public void setSoLinger(boolean, int) throws java.net.SocketException;
    method public void setSoTimeout(int) throws java.net.SocketException;
    method public static void setSocketImplFactory(java.net.SocketImplFactory) throws java.io.IOException;
    method public void setTcpNoDelay(boolean) throws java.net.SocketException;
    method public void setTrafficClass(int) throws java.net.SocketException;
    method public void shutdownInput() throws java.io.IOException;
    method public void shutdownOutput() throws java.io.IOException;
  }

  public abstract class SocketAddress implements java.io.Serializable {
    ctor public SocketAddress();
  }

  public class SocketException extends java.io.IOException {
    ctor public SocketException(String);
    ctor public SocketException();
  }

  public abstract class SocketImpl implements java.net.SocketOptions {
    ctor public SocketImpl();
    method protected abstract void accept(java.net.SocketImpl) throws java.io.IOException;
    method protected abstract int available() throws java.io.IOException;
    method protected abstract void bind(java.net.InetAddress, int) throws java.io.IOException;
    method protected abstract void close() throws java.io.IOException;
    method protected abstract void connect(String, int) throws java.io.IOException;
    method protected abstract void connect(java.net.InetAddress, int) throws java.io.IOException;
    method protected abstract void connect(java.net.SocketAddress, int) throws java.io.IOException;
    method protected abstract void create(boolean) throws java.io.IOException;
    method protected java.io.FileDescriptor getFileDescriptor();
    method protected java.net.InetAddress getInetAddress();
    method protected abstract java.io.InputStream getInputStream() throws java.io.IOException;
    method protected int getLocalPort();
    method protected abstract java.io.OutputStream getOutputStream() throws java.io.IOException;
    method protected int getPort();
    method protected abstract void listen(int) throws java.io.IOException;
    method protected abstract void sendUrgentData(int) throws java.io.IOException;
    method protected void setPerformancePreferences(int, int, int);
    method protected void shutdownInput() throws java.io.IOException;
    method protected void shutdownOutput() throws java.io.IOException;
    method protected boolean supportsUrgentData();
    field protected java.net.InetAddress address;
    field protected java.io.FileDescriptor fd;
    field protected int localport;
    field protected int port;
  }

  public interface SocketImplFactory {
    method public java.net.SocketImpl createSocketImpl();
  }

  public interface SocketOption<T> {
    method public String name();
    method public Class<T> type();
  }

  public interface SocketOptions {
    method public Object getOption(int) throws java.net.SocketException;
    method public void setOption(int, Object) throws java.net.SocketException;
    field public static final int IP_MULTICAST_IF = 16; // 0x10
    field public static final int IP_MULTICAST_IF2 = 31; // 0x1f
    field public static final int IP_MULTICAST_LOOP = 18; // 0x12
    field public static final int IP_TOS = 3; // 0x3
    field public static final int SO_BINDADDR = 15; // 0xf
    field public static final int SO_BROADCAST = 32; // 0x20
    field public static final int SO_KEEPALIVE = 8; // 0x8
    field public static final int SO_LINGER = 128; // 0x80
    field public static final int SO_OOBINLINE = 4099; // 0x1003
    field public static final int SO_RCVBUF = 4098; // 0x1002
    field public static final int SO_REUSEADDR = 4; // 0x4
    field public static final int SO_SNDBUF = 4097; // 0x1001
    field public static final int SO_TIMEOUT = 4102; // 0x1006
    field public static final int TCP_NODELAY = 1; // 0x1
  }

  public final class SocketPermission extends java.security.Permission implements java.io.Serializable {
    ctor public SocketPermission(String, String);
    method public String getActions();
    method public boolean implies(java.security.Permission);
  }

  public class SocketTimeoutException extends java.io.InterruptedIOException {
    ctor public SocketTimeoutException(String);
    ctor public SocketTimeoutException();
  }

  public enum StandardProtocolFamily implements java.net.ProtocolFamily {
    enum_constant public static final java.net.StandardProtocolFamily INET;
    enum_constant public static final java.net.StandardProtocolFamily INET6;
  }

  public final class StandardSocketOptions {
    field public static final java.net.SocketOption<java.net.NetworkInterface> IP_MULTICAST_IF;
    field public static final java.net.SocketOption<java.lang.Boolean> IP_MULTICAST_LOOP;
    field public static final java.net.SocketOption<java.lang.Integer> IP_MULTICAST_TTL;
    field public static final java.net.SocketOption<java.lang.Integer> IP_TOS;
    field public static final java.net.SocketOption<java.lang.Boolean> SO_BROADCAST;
    field public static final java.net.SocketOption<java.lang.Boolean> SO_KEEPALIVE;
    field public static final java.net.SocketOption<java.lang.Integer> SO_LINGER;
    field public static final java.net.SocketOption<java.lang.Integer> SO_RCVBUF;
    field public static final java.net.SocketOption<java.lang.Boolean> SO_REUSEADDR;
    field public static final java.net.SocketOption<java.lang.Integer> SO_SNDBUF;
    field public static final java.net.SocketOption<java.lang.Boolean> TCP_NODELAY;
  }

  public final class URI implements java.lang.Comparable<java.net.URI> java.io.Serializable {
    ctor public URI(String) throws java.net.URISyntaxException;
    ctor public URI(String, String, String, int, String, String, String) throws java.net.URISyntaxException;
    ctor public URI(String, String, String, String, String) throws java.net.URISyntaxException;
    ctor public URI(String, String, String, String) throws java.net.URISyntaxException;
    ctor public URI(String, String, String) throws java.net.URISyntaxException;
    method public int compareTo(java.net.URI);
    method public static java.net.URI create(String);
    method public String getAuthority();
    method public String getFragment();
    method public String getHost();
    method public String getPath();
    method public int getPort();
    method public String getQuery();
    method public String getRawAuthority();
    method public String getRawFragment();
    method public String getRawPath();
    method public String getRawQuery();
    method public String getRawSchemeSpecificPart();
    method public String getRawUserInfo();
    method public String getScheme();
    method public String getSchemeSpecificPart();
    method public String getUserInfo();
    method public boolean isAbsolute();
    method public boolean isOpaque();
    method public java.net.URI normalize();
    method public java.net.URI parseServerAuthority() throws java.net.URISyntaxException;
    method public java.net.URI relativize(java.net.URI);
    method public java.net.URI resolve(java.net.URI);
    method public java.net.URI resolve(String);
    method public String toASCIIString();
    method public java.net.URL toURL() throws java.net.MalformedURLException;
  }

  public class URISyntaxException extends java.lang.Exception {
    ctor public URISyntaxException(String, String, int);
    ctor public URISyntaxException(String, String);
    method public int getIndex();
    method public String getInput();
    method public String getReason();
  }

  public final class URL implements java.io.Serializable {
    ctor public URL(String, String, int, String) throws java.net.MalformedURLException;
    ctor public URL(String, String, String) throws java.net.MalformedURLException;
    ctor public URL(String, String, int, String, java.net.URLStreamHandler) throws java.net.MalformedURLException;
    ctor public URL(String) throws java.net.MalformedURLException;
    ctor public URL(java.net.URL, String) throws java.net.MalformedURLException;
    ctor public URL(java.net.URL, String, java.net.URLStreamHandler) throws java.net.MalformedURLException;
    method public String getAuthority();
    method public Object getContent() throws java.io.IOException;
    method public Object getContent(Class[]) throws java.io.IOException;
    method public int getDefaultPort();
    method public String getFile();
    method public String getHost();
    method public String getPath();
    method public int getPort();
    method public String getProtocol();
    method public String getQuery();
    method public String getRef();
    method public String getUserInfo();
    method public java.net.URLConnection openConnection() throws java.io.IOException;
    method public java.net.URLConnection openConnection(java.net.Proxy) throws java.io.IOException;
    method public java.io.InputStream openStream() throws java.io.IOException;
    method public boolean sameFile(java.net.URL);
    method public static void setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory);
    method public String toExternalForm();
    method public java.net.URI toURI() throws java.net.URISyntaxException;
  }

  public class URLClassLoader extends java.security.SecureClassLoader implements java.io.Closeable {
    ctor public URLClassLoader(java.net.URL[], ClassLoader);
    ctor public URLClassLoader(java.net.URL[]);
    ctor public URLClassLoader(java.net.URL[], ClassLoader, java.net.URLStreamHandlerFactory);
    method protected void addURL(java.net.URL);
    method public void close() throws java.io.IOException;
    method protected Package definePackage(String, java.util.jar.Manifest, java.net.URL) throws java.lang.IllegalArgumentException;
    method public java.net.URL findResource(String);
    method public java.util.Enumeration<java.net.URL> findResources(String) throws java.io.IOException;
    method public java.net.URL[] getURLs();
    method public static java.net.URLClassLoader newInstance(java.net.URL[], ClassLoader);
    method public static java.net.URLClassLoader newInstance(java.net.URL[]);
  }

  public abstract class URLConnection {
    ctor protected URLConnection(java.net.URL);
    method public void addRequestProperty(String, String);
    method public abstract void connect() throws java.io.IOException;
    method public boolean getAllowUserInteraction();
    method public int getConnectTimeout();
    method public Object getContent() throws java.io.IOException;
    method public Object getContent(Class[]) throws java.io.IOException;
    method public String getContentEncoding();
    method public int getContentLength();
    method public long getContentLengthLong();
    method public String getContentType();
    method public long getDate();
    method public static boolean getDefaultAllowUserInteraction();
    method @Deprecated public static String getDefaultRequestProperty(String);
    method public boolean getDefaultUseCaches();
    method public boolean getDoInput();
    method public boolean getDoOutput();
    method public long getExpiration();
    method public static java.net.FileNameMap getFileNameMap();
    method public String getHeaderField(String);
    method public String getHeaderField(int);
    method public long getHeaderFieldDate(String, long);
    method public int getHeaderFieldInt(String, int);
    method public String getHeaderFieldKey(int);
    method public long getHeaderFieldLong(String, long);
    method public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaderFields();
    method public long getIfModifiedSince();
    method public java.io.InputStream getInputStream() throws java.io.IOException;
    method public long getLastModified();
    method public java.io.OutputStream getOutputStream() throws java.io.IOException;
    method public java.security.Permission getPermission() throws java.io.IOException;
    method public int getReadTimeout();
    method public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getRequestProperties();
    method public String getRequestProperty(String);
    method public java.net.URL getURL();
    method public boolean getUseCaches();
    method public static String guessContentTypeFromName(String);
    method public static String guessContentTypeFromStream(java.io.InputStream) throws java.io.IOException;
    method public void setAllowUserInteraction(boolean);
    method public void setConnectTimeout(int);
    method public static void setContentHandlerFactory(java.net.ContentHandlerFactory);
    method public static void setDefaultAllowUserInteraction(boolean);
    method @Deprecated public static void setDefaultRequestProperty(String, String);
    method public void setDefaultUseCaches(boolean);
    method public void setDoInput(boolean);
    method public void setDoOutput(boolean);
    method public static void setFileNameMap(java.net.FileNameMap);
    method public void setIfModifiedSince(long);
    method public void setReadTimeout(int);
    method public void setRequestProperty(String, String);
    method public void setUseCaches(boolean);
    field protected boolean allowUserInteraction;
    field protected boolean connected;
    field protected boolean doInput;
    field protected boolean doOutput;
    field protected long ifModifiedSince;
    field protected java.net.URL url;
    field protected boolean useCaches;
  }

  public class URLDecoder {
    ctor public URLDecoder();
    method @Deprecated public static String decode(String);
    method public static String decode(String, String) throws java.io.UnsupportedEncodingException;
  }

  public class URLEncoder {
    method @Deprecated public static String encode(String);
    method public static String encode(String, String) throws java.io.UnsupportedEncodingException;
  }

  public abstract class URLStreamHandler {
    ctor public URLStreamHandler();
    method protected boolean equals(java.net.URL, java.net.URL);
    method protected int getDefaultPort();
    method protected java.net.InetAddress getHostAddress(java.net.URL);
    method protected int hashCode(java.net.URL);
    method protected boolean hostsEqual(java.net.URL, java.net.URL);
    method protected abstract java.net.URLConnection openConnection(java.net.URL) throws java.io.IOException;
    method protected java.net.URLConnection openConnection(java.net.URL, java.net.Proxy) throws java.io.IOException;
    method protected void parseURL(java.net.URL, String, int, int);
    method protected boolean sameFile(java.net.URL, java.net.URL);
    method protected void setURL(java.net.URL, String, String, int, String, String, String, String, String);
    method @Deprecated protected void setURL(java.net.URL, String, String, int, String, String);
    method protected String toExternalForm(java.net.URL);
  }

  public interface URLStreamHandlerFactory {
    method public java.net.URLStreamHandler createURLStreamHandler(String);
  }

  public class UnknownHostException extends java.io.IOException {
    ctor public UnknownHostException(String);
    ctor public UnknownHostException();
  }

  public class UnknownServiceException extends java.io.IOException {
    ctor public UnknownServiceException();
    ctor public UnknownServiceException(String);
  }

}

package java.nio {

  public abstract class Buffer {
    method public abstract Object array();
    method public abstract int arrayOffset();
    method public final int capacity();
    method public java.nio.Buffer clear();
    method public java.nio.Buffer flip();
    method public abstract boolean hasArray();
    method public final boolean hasRemaining();
    method public abstract boolean isDirect();
    method public abstract boolean isReadOnly();
    method public final int limit();
    method public java.nio.Buffer limit(int);
    method public java.nio.Buffer mark();
    method public final int position();
    method public java.nio.Buffer position(int);
    method public final int remaining();
    method public java.nio.Buffer reset();
    method public java.nio.Buffer rewind();
  }

  public class BufferOverflowException extends java.lang.RuntimeException {
    ctor public BufferOverflowException();
  }

  public class BufferUnderflowException extends java.lang.RuntimeException {
    ctor public BufferUnderflowException();
  }

  public abstract class ByteBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.ByteBuffer> {
    method @NonNull public static java.nio.ByteBuffer allocate(int);
    method @NonNull public static java.nio.ByteBuffer allocateDirect(int);
    method @NonNull public final byte[] array();
    method public final int arrayOffset();
    method @NonNull public abstract java.nio.CharBuffer asCharBuffer();
    method @NonNull public abstract java.nio.DoubleBuffer asDoubleBuffer();
    method @NonNull public abstract java.nio.FloatBuffer asFloatBuffer();
    method @NonNull public abstract java.nio.IntBuffer asIntBuffer();
    method @NonNull public abstract java.nio.LongBuffer asLongBuffer();
    method @NonNull public abstract java.nio.ByteBuffer asReadOnlyBuffer();
    method @NonNull public abstract java.nio.ShortBuffer asShortBuffer();
    method @NonNull public abstract java.nio.ByteBuffer compact();
    method public int compareTo(@NonNull java.nio.ByteBuffer);
    method @NonNull public abstract java.nio.ByteBuffer duplicate();
    method public abstract byte get();
    method public abstract byte get(int);
    method @NonNull public java.nio.ByteBuffer get(@NonNull byte[], int, int);
    method @NonNull public java.nio.ByteBuffer get(@NonNull byte[]);
    method public abstract char getChar();
    method public abstract char getChar(int);
    method public abstract double getDouble();
    method public abstract double getDouble(int);
    method public abstract float getFloat();
    method public abstract float getFloat(int);
    method public abstract int getInt();
    method public abstract int getInt(int);
    method public abstract long getLong();
    method public abstract long getLong(int);
    method public abstract short getShort();
    method public abstract short getShort(int);
    method public final boolean hasArray();
    method @NonNull public final java.nio.ByteOrder order();
    method @NonNull public final java.nio.ByteBuffer order(@NonNull java.nio.ByteOrder);
    method @NonNull public abstract java.nio.ByteBuffer put(byte);
    method @NonNull public abstract java.nio.ByteBuffer put(int, byte);
    method @NonNull public java.nio.ByteBuffer put(@NonNull java.nio.ByteBuffer);
    method @NonNull public java.nio.ByteBuffer put(@NonNull byte[], int, int);
    method @NonNull public final java.nio.ByteBuffer put(@NonNull byte[]);
    method @NonNull public abstract java.nio.ByteBuffer putChar(char);
    method @NonNull public abstract java.nio.ByteBuffer putChar(int, char);
    method @NonNull public abstract java.nio.ByteBuffer putDouble(double);
    method @NonNull public abstract java.nio.ByteBuffer putDouble(int, double);
    method @NonNull public abstract java.nio.ByteBuffer putFloat(float);
    method @NonNull public abstract java.nio.ByteBuffer putFloat(int, float);
    method @NonNull public abstract java.nio.ByteBuffer putInt(int);
    method @NonNull public abstract java.nio.ByteBuffer putInt(int, int);
    method @NonNull public abstract java.nio.ByteBuffer putLong(long);
    method @NonNull public abstract java.nio.ByteBuffer putLong(int, long);
    method @NonNull public abstract java.nio.ByteBuffer putShort(short);
    method @NonNull public abstract java.nio.ByteBuffer putShort(int, short);
    method @NonNull public abstract java.nio.ByteBuffer slice();
    method @NonNull public static java.nio.ByteBuffer wrap(@NonNull byte[], int, int);
    method @NonNull public static java.nio.ByteBuffer wrap(@NonNull byte[]);
  }

  public final class ByteOrder {
    method public static java.nio.ByteOrder nativeOrder();
    field public static final java.nio.ByteOrder BIG_ENDIAN;
    field public static final java.nio.ByteOrder LITTLE_ENDIAN;
  }

  public abstract class CharBuffer extends java.nio.Buffer implements java.lang.Appendable java.lang.CharSequence java.lang.Comparable<java.nio.CharBuffer> java.lang.Readable {
    method public static java.nio.CharBuffer allocate(int);
    method public java.nio.CharBuffer append(CharSequence);
    method public java.nio.CharBuffer append(CharSequence, int, int);
    method public java.nio.CharBuffer append(char);
    method public final char[] array();
    method public final int arrayOffset();
    method public abstract java.nio.CharBuffer asReadOnlyBuffer();
    method public final char charAt(int);
    method public abstract java.nio.CharBuffer compact();
    method public int compareTo(java.nio.CharBuffer);
    method public abstract java.nio.CharBuffer duplicate();
    method public abstract char get();
    method public abstract char get(int);
    method public java.nio.CharBuffer get(char[], int, int);
    method public java.nio.CharBuffer get(char[]);
    method public final boolean hasArray();
    method public final int length();
    method public abstract java.nio.ByteOrder order();
    method public abstract java.nio.CharBuffer put(char);
    method public abstract java.nio.CharBuffer put(int, char);
    method public java.nio.CharBuffer put(java.nio.CharBuffer);
    method public java.nio.CharBuffer put(char[], int, int);
    method public final java.nio.CharBuffer put(char[]);
    method public java.nio.CharBuffer put(String, int, int);
    method public final java.nio.CharBuffer put(String);
    method public int read(java.nio.CharBuffer) throws java.io.IOException;
    method public abstract java.nio.CharBuffer slice();
    method public abstract java.nio.CharBuffer subSequence(int, int);
    method public static java.nio.CharBuffer wrap(char[], int, int);
    method public static java.nio.CharBuffer wrap(char[]);
    method public static java.nio.CharBuffer wrap(CharSequence, int, int);
    method public static java.nio.CharBuffer wrap(CharSequence);
  }

  public abstract class DoubleBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.DoubleBuffer> {
    method public static java.nio.DoubleBuffer allocate(int);
    method public final double[] array();
    method public final int arrayOffset();
    method public abstract java.nio.DoubleBuffer asReadOnlyBuffer();
    method public abstract java.nio.DoubleBuffer compact();
    method public int compareTo(java.nio.DoubleBuffer);
    method public abstract java.nio.DoubleBuffer duplicate();
    method public abstract double get();
    method public abstract double get(int);
    method public java.nio.DoubleBuffer get(double[], int, int);
    method public java.nio.DoubleBuffer get(double[]);
    method public final boolean hasArray();
    method public abstract java.nio.ByteOrder order();
    method public abstract java.nio.DoubleBuffer put(double);
    method public abstract java.nio.DoubleBuffer put(int, double);
    method public java.nio.DoubleBuffer put(java.nio.DoubleBuffer);
    method public java.nio.DoubleBuffer put(double[], int, int);
    method public final java.nio.DoubleBuffer put(double[]);
    method public abstract java.nio.DoubleBuffer slice();
    method public static java.nio.DoubleBuffer wrap(double[], int, int);
    method public static java.nio.DoubleBuffer wrap(double[]);
  }

  public abstract class FloatBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.FloatBuffer> {
    method public static java.nio.FloatBuffer allocate(int);
    method public final float[] array();
    method public final int arrayOffset();
    method public abstract java.nio.FloatBuffer asReadOnlyBuffer();
    method public abstract java.nio.FloatBuffer compact();
    method public int compareTo(java.nio.FloatBuffer);
    method public abstract java.nio.FloatBuffer duplicate();
    method public abstract float get();
    method public abstract float get(int);
    method public java.nio.FloatBuffer get(float[], int, int);
    method public java.nio.FloatBuffer get(float[]);
    method public final boolean hasArray();
    method public abstract java.nio.ByteOrder order();
    method public abstract java.nio.FloatBuffer put(float);
    method public abstract java.nio.FloatBuffer put(int, float);
    method public java.nio.FloatBuffer put(java.nio.FloatBuffer);
    method public java.nio.FloatBuffer put(float[], int, int);
    method public final java.nio.FloatBuffer put(float[]);
    method public abstract java.nio.FloatBuffer slice();
    method public static java.nio.FloatBuffer wrap(float[], int, int);
    method public static java.nio.FloatBuffer wrap(float[]);
  }

  public abstract class IntBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.IntBuffer> {
    method public static java.nio.IntBuffer allocate(int);
    method public final int[] array();
    method public final int arrayOffset();
    method public abstract java.nio.IntBuffer asReadOnlyBuffer();
    method public abstract java.nio.IntBuffer compact();
    method public int compareTo(java.nio.IntBuffer);
    method public abstract java.nio.IntBuffer duplicate();
    method public abstract int get();
    method public abstract int get(int);
    method public java.nio.IntBuffer get(int[], int, int);
    method public java.nio.IntBuffer get(int[]);
    method public final boolean hasArray();
    method public abstract java.nio.ByteOrder order();
    method public abstract java.nio.IntBuffer put(int);
    method public abstract java.nio.IntBuffer put(int, int);
    method public java.nio.IntBuffer put(java.nio.IntBuffer);
    method public java.nio.IntBuffer put(int[], int, int);
    method public final java.nio.IntBuffer put(int[]);
    method public abstract java.nio.IntBuffer slice();
    method public static java.nio.IntBuffer wrap(int[], int, int);
    method public static java.nio.IntBuffer wrap(int[]);
  }

  public class InvalidMarkException extends java.lang.IllegalStateException {
    ctor public InvalidMarkException();
  }

  public abstract class LongBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.LongBuffer> {
    method public static java.nio.LongBuffer allocate(int);
    method public final long[] array();
    method public final int arrayOffset();
    method public abstract java.nio.LongBuffer asReadOnlyBuffer();
    method public abstract java.nio.LongBuffer compact();
    method public int compareTo(java.nio.LongBuffer);
    method public abstract java.nio.LongBuffer duplicate();
    method public abstract long get();
    method public abstract long get(int);
    method public java.nio.LongBuffer get(long[], int, int);
    method public java.nio.LongBuffer get(long[]);
    method public final boolean hasArray();
    method public abstract java.nio.ByteOrder order();
    method public abstract java.nio.LongBuffer put(long);
    method public abstract java.nio.LongBuffer put(int, long);
    method public java.nio.LongBuffer put(java.nio.LongBuffer);
    method public java.nio.LongBuffer put(long[], int, int);
    method public final java.nio.LongBuffer put(long[]);
    method public abstract java.nio.LongBuffer slice();
    method public static java.nio.LongBuffer wrap(long[], int, int);
    method public static java.nio.LongBuffer wrap(long[]);
  }

  public abstract class MappedByteBuffer extends java.nio.ByteBuffer {
    method public final java.nio.MappedByteBuffer force();
    method public final boolean isLoaded();
    method public final java.nio.MappedByteBuffer load();
  }

  public class ReadOnlyBufferException extends java.lang.UnsupportedOperationException {
    ctor public ReadOnlyBufferException();
  }

  public abstract class ShortBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.ShortBuffer> {
    method public static java.nio.ShortBuffer allocate(int);
    method public final short[] array();
    method public final int arrayOffset();
    method public abstract java.nio.ShortBuffer asReadOnlyBuffer();
    method public abstract java.nio.ShortBuffer compact();
    method public int compareTo(java.nio.ShortBuffer);
    method public abstract java.nio.ShortBuffer duplicate();
    method public abstract short get();
    method public abstract short get(int);
    method public java.nio.ShortBuffer get(short[], int, int);
    method public java.nio.ShortBuffer get(short[]);
    method public final boolean hasArray();
    method public abstract java.nio.ByteOrder order();
    method public abstract java.nio.ShortBuffer put(short);
    method public abstract java.nio.ShortBuffer put(int, short);
    method public java.nio.ShortBuffer put(java.nio.ShortBuffer);
    method public java.nio.ShortBuffer put(short[], int, int);
    method public final java.nio.ShortBuffer put(short[]);
    method public abstract java.nio.ShortBuffer slice();
    method public static java.nio.ShortBuffer wrap(short[], int, int);
    method public static java.nio.ShortBuffer wrap(short[]);
  }

}

package java.nio.channels {

  public class AcceptPendingException extends java.lang.IllegalStateException {
    ctor public AcceptPendingException();
  }

  public class AlreadyBoundException extends java.lang.IllegalStateException {
    ctor public AlreadyBoundException();
  }

  public class AlreadyConnectedException extends java.lang.IllegalStateException {
    ctor public AlreadyConnectedException();
  }

  public interface AsynchronousByteChannel extends java.nio.channels.AsynchronousChannel {
    method public <A> void read(java.nio.ByteBuffer, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
    method public java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer);
    method public <A> void write(java.nio.ByteBuffer, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
    method public java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer);
  }

  public interface AsynchronousChannel extends java.nio.channels.Channel {
  }

  public abstract class AsynchronousChannelGroup {
    ctor protected AsynchronousChannelGroup(java.nio.channels.spi.AsynchronousChannelProvider);
    method public abstract boolean awaitTermination(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract boolean isShutdown();
    method public abstract boolean isTerminated();
    method public final java.nio.channels.spi.AsynchronousChannelProvider provider();
    method public abstract void shutdown();
    method public abstract void shutdownNow() throws java.io.IOException;
    method public static java.nio.channels.AsynchronousChannelGroup withCachedThreadPool(java.util.concurrent.ExecutorService, int) throws java.io.IOException;
    method public static java.nio.channels.AsynchronousChannelGroup withFixedThreadPool(int, java.util.concurrent.ThreadFactory) throws java.io.IOException;
    method public static java.nio.channels.AsynchronousChannelGroup withThreadPool(java.util.concurrent.ExecutorService) throws java.io.IOException;
  }

  public class AsynchronousCloseException extends java.nio.channels.ClosedChannelException {
    ctor public AsynchronousCloseException();
  }

  public abstract class AsynchronousFileChannel implements java.nio.channels.AsynchronousChannel {
    ctor protected AsynchronousFileChannel();
    method public abstract void force(boolean) throws java.io.IOException;
    method public abstract <A> void lock(long, long, boolean, A, java.nio.channels.CompletionHandler<java.nio.channels.FileLock,? super A>);
    method public final <A> void lock(A, java.nio.channels.CompletionHandler<java.nio.channels.FileLock,? super A>);
    method public abstract java.util.concurrent.Future<java.nio.channels.FileLock> lock(long, long, boolean);
    method public final java.util.concurrent.Future<java.nio.channels.FileLock> lock();
    method public static java.nio.channels.AsynchronousFileChannel open(java.nio.file.Path, java.util.Set<? extends java.nio.file.OpenOption>, java.util.concurrent.ExecutorService, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.channels.AsynchronousFileChannel open(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
    method public abstract <A> void read(java.nio.ByteBuffer, long, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
    method public abstract java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer, long);
    method public abstract long size() throws java.io.IOException;
    method public abstract java.nio.channels.AsynchronousFileChannel truncate(long) throws java.io.IOException;
    method public abstract java.nio.channels.FileLock tryLock(long, long, boolean) throws java.io.IOException;
    method public final java.nio.channels.FileLock tryLock() throws java.io.IOException;
    method public abstract <A> void write(java.nio.ByteBuffer, long, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
    method public abstract java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer, long);
  }

  public abstract class AsynchronousServerSocketChannel implements java.nio.channels.AsynchronousChannel java.nio.channels.NetworkChannel {
    ctor protected AsynchronousServerSocketChannel(java.nio.channels.spi.AsynchronousChannelProvider);
    method public abstract <A> void accept(A, java.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,? super A>);
    method public abstract java.util.concurrent.Future<java.nio.channels.AsynchronousSocketChannel> accept();
    method public final java.nio.channels.AsynchronousServerSocketChannel bind(java.net.SocketAddress) throws java.io.IOException;
    method public abstract java.nio.channels.AsynchronousServerSocketChannel bind(java.net.SocketAddress, int) throws java.io.IOException;
    method public static java.nio.channels.AsynchronousServerSocketChannel open(java.nio.channels.AsynchronousChannelGroup) throws java.io.IOException;
    method public static java.nio.channels.AsynchronousServerSocketChannel open() throws java.io.IOException;
    method public final java.nio.channels.spi.AsynchronousChannelProvider provider();
    method public abstract <T> java.nio.channels.AsynchronousServerSocketChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
  }

  public abstract class AsynchronousSocketChannel implements java.nio.channels.AsynchronousByteChannel java.nio.channels.NetworkChannel {
    ctor protected AsynchronousSocketChannel(java.nio.channels.spi.AsynchronousChannelProvider);
    method public abstract java.nio.channels.AsynchronousSocketChannel bind(java.net.SocketAddress) throws java.io.IOException;
    method public abstract <A> void connect(java.net.SocketAddress, A, java.nio.channels.CompletionHandler<java.lang.Void,? super A>);
    method public abstract java.util.concurrent.Future<java.lang.Void> connect(java.net.SocketAddress);
    method public abstract java.net.SocketAddress getRemoteAddress() throws java.io.IOException;
    method public static java.nio.channels.AsynchronousSocketChannel open(java.nio.channels.AsynchronousChannelGroup) throws java.io.IOException;
    method public static java.nio.channels.AsynchronousSocketChannel open() throws java.io.IOException;
    method public final java.nio.channels.spi.AsynchronousChannelProvider provider();
    method public abstract <A> void read(java.nio.ByteBuffer, long, java.util.concurrent.TimeUnit, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
    method public final <A> void read(java.nio.ByteBuffer, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
    method public abstract <A> void read(java.nio.ByteBuffer[], int, int, long, java.util.concurrent.TimeUnit, A, java.nio.channels.CompletionHandler<java.lang.Long,? super A>);
    method public abstract <T> java.nio.channels.AsynchronousSocketChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
    method public abstract java.nio.channels.AsynchronousSocketChannel shutdownInput() throws java.io.IOException;
    method public abstract java.nio.channels.AsynchronousSocketChannel shutdownOutput() throws java.io.IOException;
    method public abstract <A> void write(java.nio.ByteBuffer, long, java.util.concurrent.TimeUnit, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
    method public final <A> void write(java.nio.ByteBuffer, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
    method public abstract <A> void write(java.nio.ByteBuffer[], int, int, long, java.util.concurrent.TimeUnit, A, java.nio.channels.CompletionHandler<java.lang.Long,? super A>);
  }

  public interface ByteChannel extends java.nio.channels.ReadableByteChannel java.nio.channels.WritableByteChannel {
  }

  public class CancelledKeyException extends java.lang.IllegalStateException {
    ctor public CancelledKeyException();
  }

  public interface Channel extends java.io.Closeable {
    method public boolean isOpen();
  }

  public final class Channels {
    method public static java.nio.channels.ReadableByteChannel newChannel(java.io.InputStream);
    method public static java.nio.channels.WritableByteChannel newChannel(java.io.OutputStream);
    method public static java.io.InputStream newInputStream(java.nio.channels.ReadableByteChannel);
    method public static java.io.InputStream newInputStream(java.nio.channels.AsynchronousByteChannel);
    method public static java.io.OutputStream newOutputStream(java.nio.channels.WritableByteChannel);
    method public static java.io.OutputStream newOutputStream(java.nio.channels.AsynchronousByteChannel);
    method public static java.io.Reader newReader(java.nio.channels.ReadableByteChannel, java.nio.charset.CharsetDecoder, int);
    method public static java.io.Reader newReader(java.nio.channels.ReadableByteChannel, String);
    method public static java.io.Writer newWriter(java.nio.channels.WritableByteChannel, java.nio.charset.CharsetEncoder, int);
    method public static java.io.Writer newWriter(java.nio.channels.WritableByteChannel, String);
  }

  public class ClosedByInterruptException extends java.nio.channels.AsynchronousCloseException {
    ctor public ClosedByInterruptException();
  }

  public class ClosedChannelException extends java.io.IOException {
    ctor public ClosedChannelException();
  }

  public class ClosedSelectorException extends java.lang.IllegalStateException {
    ctor public ClosedSelectorException();
  }

  public interface CompletionHandler<V, A> {
    method public void completed(V, A);
    method public void failed(Throwable, A);
  }

  public class ConnectionPendingException extends java.lang.IllegalStateException {
    ctor public ConnectionPendingException();
  }

  public abstract class DatagramChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.ByteChannel java.nio.channels.GatheringByteChannel java.nio.channels.MulticastChannel java.nio.channels.ScatteringByteChannel {
    ctor protected DatagramChannel(java.nio.channels.spi.SelectorProvider);
    method public abstract java.nio.channels.DatagramChannel bind(java.net.SocketAddress) throws java.io.IOException;
    method public abstract java.nio.channels.DatagramChannel connect(java.net.SocketAddress) throws java.io.IOException;
    method public abstract java.nio.channels.DatagramChannel disconnect() throws java.io.IOException;
    method public abstract java.net.SocketAddress getRemoteAddress() throws java.io.IOException;
    method public abstract boolean isConnected();
    method public static java.nio.channels.DatagramChannel open() throws java.io.IOException;
    method public static java.nio.channels.DatagramChannel open(java.net.ProtocolFamily) throws java.io.IOException;
    method public final long read(java.nio.ByteBuffer[]) throws java.io.IOException;
    method public abstract java.net.SocketAddress receive(java.nio.ByteBuffer) throws java.io.IOException;
    method public abstract int send(java.nio.ByteBuffer, java.net.SocketAddress) throws java.io.IOException;
    method public abstract <T> java.nio.channels.DatagramChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
    method public abstract java.net.DatagramSocket socket();
    method public final int validOps();
    method public final long write(java.nio.ByteBuffer[]) throws java.io.IOException;
  }

  public abstract class FileChannel extends java.nio.channels.spi.AbstractInterruptibleChannel implements java.nio.channels.GatheringByteChannel java.nio.channels.ScatteringByteChannel java.nio.channels.SeekableByteChannel {
    ctor protected FileChannel();
    method public abstract void force(boolean) throws java.io.IOException;
    method public abstract java.nio.channels.FileLock lock(long, long, boolean) throws java.io.IOException;
    method public final java.nio.channels.FileLock lock() throws java.io.IOException;
    method public abstract java.nio.MappedByteBuffer map(java.nio.channels.FileChannel.MapMode, long, long) throws java.io.IOException;
    method public static java.nio.channels.FileChannel open(java.nio.file.Path, java.util.Set<? extends java.nio.file.OpenOption>, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.channels.FileChannel open(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
    method public abstract java.nio.channels.FileChannel position(long) throws java.io.IOException;
    method public final long read(java.nio.ByteBuffer[]) throws java.io.IOException;
    method public abstract int read(java.nio.ByteBuffer, long) throws java.io.IOException;
    method public abstract long transferFrom(java.nio.channels.ReadableByteChannel, long, long) throws java.io.IOException;
    method public abstract long transferTo(long, long, java.nio.channels.WritableByteChannel) throws java.io.IOException;
    method public abstract java.nio.channels.FileChannel truncate(long) throws java.io.IOException;
    method public abstract java.nio.channels.FileLock tryLock(long, long, boolean) throws java.io.IOException;
    method public final java.nio.channels.FileLock tryLock() throws java.io.IOException;
    method public final long write(java.nio.ByteBuffer[]) throws java.io.IOException;
    method public abstract int write(java.nio.ByteBuffer, long) throws java.io.IOException;
  }

  public static class FileChannel.MapMode {
    field public static final java.nio.channels.FileChannel.MapMode PRIVATE;
    field public static final java.nio.channels.FileChannel.MapMode READ_ONLY;
    field public static final java.nio.channels.FileChannel.MapMode READ_WRITE;
  }

  public abstract class FileLock implements java.lang.AutoCloseable {
    ctor protected FileLock(java.nio.channels.FileChannel, long, long, boolean);
    ctor protected FileLock(java.nio.channels.AsynchronousFileChannel, long, long, boolean);
    method public java.nio.channels.Channel acquiredBy();
    method public final java.nio.channels.FileChannel channel();
    method public final void close() throws java.io.IOException;
    method public final boolean isShared();
    method public abstract boolean isValid();
    method public final boolean overlaps(long, long);
    method public final long position();
    method public abstract void release() throws java.io.IOException;
    method public final long size();
    method public final String toString();
  }

  public class FileLockInterruptionException extends java.io.IOException {
    ctor public FileLockInterruptionException();
  }

  public interface GatheringByteChannel extends java.nio.channels.WritableByteChannel {
    method public long write(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
    method public long write(java.nio.ByteBuffer[]) throws java.io.IOException;
  }

  public class IllegalBlockingModeException extends java.lang.IllegalStateException {
    ctor public IllegalBlockingModeException();
  }

  public class IllegalChannelGroupException extends java.lang.IllegalArgumentException {
    ctor public IllegalChannelGroupException();
  }

  public class IllegalSelectorException extends java.lang.IllegalArgumentException {
    ctor public IllegalSelectorException();
  }

  public class InterruptedByTimeoutException extends java.io.IOException {
    ctor public InterruptedByTimeoutException();
  }

  public interface InterruptibleChannel extends java.nio.channels.Channel {
  }

  public abstract class MembershipKey {
    ctor protected MembershipKey();
    method public abstract java.nio.channels.MembershipKey block(java.net.InetAddress) throws java.io.IOException;
    method public abstract java.nio.channels.MulticastChannel channel();
    method public abstract void drop();
    method public abstract java.net.InetAddress group();
    method public abstract boolean isValid();
    method public abstract java.net.NetworkInterface networkInterface();
    method public abstract java.net.InetAddress sourceAddress();
    method public abstract java.nio.channels.MembershipKey unblock(java.net.InetAddress);
  }

  public interface MulticastChannel extends java.nio.channels.NetworkChannel {
    method public java.nio.channels.MembershipKey join(java.net.InetAddress, java.net.NetworkInterface) throws java.io.IOException;
    method public java.nio.channels.MembershipKey join(java.net.InetAddress, java.net.NetworkInterface, java.net.InetAddress) throws java.io.IOException;
  }

  public interface NetworkChannel extends java.nio.channels.Channel {
    method public java.nio.channels.NetworkChannel bind(java.net.SocketAddress) throws java.io.IOException;
    method public java.net.SocketAddress getLocalAddress() throws java.io.IOException;
    method public <T> T getOption(java.net.SocketOption<T>) throws java.io.IOException;
    method public <T> java.nio.channels.NetworkChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
    method public java.util.Set<java.net.SocketOption<?>> supportedOptions();
  }

  public class NoConnectionPendingException extends java.lang.IllegalStateException {
    ctor public NoConnectionPendingException();
  }

  public class NonReadableChannelException extends java.lang.IllegalStateException {
    ctor public NonReadableChannelException();
  }

  public class NonWritableChannelException extends java.lang.IllegalStateException {
    ctor public NonWritableChannelException();
  }

  public class NotYetBoundException extends java.lang.IllegalStateException {
    ctor public NotYetBoundException();
  }

  public class NotYetConnectedException extends java.lang.IllegalStateException {
    ctor public NotYetConnectedException();
  }

  public class OverlappingFileLockException extends java.lang.IllegalStateException {
    ctor public OverlappingFileLockException();
  }

  public abstract class Pipe {
    ctor protected Pipe();
    method public static java.nio.channels.Pipe open() throws java.io.IOException;
    method public abstract java.nio.channels.Pipe.SinkChannel sink();
    method public abstract java.nio.channels.Pipe.SourceChannel source();
  }

  public abstract static class Pipe.SinkChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.GatheringByteChannel java.nio.channels.WritableByteChannel {
    ctor protected Pipe.SinkChannel(java.nio.channels.spi.SelectorProvider);
    method public final int validOps();
  }

  public abstract static class Pipe.SourceChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.ReadableByteChannel java.nio.channels.ScatteringByteChannel {
    ctor protected Pipe.SourceChannel(java.nio.channels.spi.SelectorProvider);
    method public final int validOps();
  }

  public class ReadPendingException extends java.lang.IllegalStateException {
    ctor public ReadPendingException();
  }

  public interface ReadableByteChannel extends java.nio.channels.Channel {
    method public int read(java.nio.ByteBuffer) throws java.io.IOException;
  }

  public interface ScatteringByteChannel extends java.nio.channels.ReadableByteChannel {
    method public long read(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
    method public long read(java.nio.ByteBuffer[]) throws java.io.IOException;
  }

  public interface SeekableByteChannel extends java.nio.channels.ByteChannel {
    method public long position() throws java.io.IOException;
    method public java.nio.channels.SeekableByteChannel position(long) throws java.io.IOException;
    method public long size() throws java.io.IOException;
    method public java.nio.channels.SeekableByteChannel truncate(long) throws java.io.IOException;
  }

  public abstract class SelectableChannel extends java.nio.channels.spi.AbstractInterruptibleChannel implements java.nio.channels.Channel {
    ctor protected SelectableChannel();
    method public abstract Object blockingLock();
    method public abstract java.nio.channels.SelectableChannel configureBlocking(boolean) throws java.io.IOException;
    method public abstract boolean isBlocking();
    method public abstract boolean isRegistered();
    method public abstract java.nio.channels.SelectionKey keyFor(java.nio.channels.Selector);
    method public abstract java.nio.channels.spi.SelectorProvider provider();
    method public abstract java.nio.channels.SelectionKey register(java.nio.channels.Selector, int, Object) throws java.nio.channels.ClosedChannelException;
    method public final java.nio.channels.SelectionKey register(java.nio.channels.Selector, int) throws java.nio.channels.ClosedChannelException;
    method public abstract int validOps();
  }

  public abstract class SelectionKey {
    ctor protected SelectionKey();
    method public final Object attach(Object);
    method public final Object attachment();
    method public abstract void cancel();
    method public abstract java.nio.channels.SelectableChannel channel();
    method public abstract int interestOps();
    method public abstract java.nio.channels.SelectionKey interestOps(int);
    method public final boolean isAcceptable();
    method public final boolean isConnectable();
    method public final boolean isReadable();
    method public abstract boolean isValid();
    method public final boolean isWritable();
    method public abstract int readyOps();
    method public abstract java.nio.channels.Selector selector();
    field public static final int OP_ACCEPT = 16; // 0x10
    field public static final int OP_CONNECT = 8; // 0x8
    field public static final int OP_READ = 1; // 0x1
    field public static final int OP_WRITE = 4; // 0x4
  }

  public abstract class Selector implements java.io.Closeable {
    ctor protected Selector();
    method public abstract boolean isOpen();
    method public abstract java.util.Set<java.nio.channels.SelectionKey> keys();
    method public static java.nio.channels.Selector open() throws java.io.IOException;
    method public abstract java.nio.channels.spi.SelectorProvider provider();
    method public abstract int select(long) throws java.io.IOException;
    method public abstract int select() throws java.io.IOException;
    method public abstract int selectNow() throws java.io.IOException;
    method public abstract java.util.Set<java.nio.channels.SelectionKey> selectedKeys();
    method public abstract java.nio.channels.Selector wakeup();
  }

  public abstract class ServerSocketChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.NetworkChannel {
    ctor protected ServerSocketChannel(java.nio.channels.spi.SelectorProvider);
    method public abstract java.nio.channels.SocketChannel accept() throws java.io.IOException;
    method public final java.nio.channels.ServerSocketChannel bind(java.net.SocketAddress) throws java.io.IOException;
    method public abstract java.nio.channels.ServerSocketChannel bind(java.net.SocketAddress, int) throws java.io.IOException;
    method public static java.nio.channels.ServerSocketChannel open() throws java.io.IOException;
    method public abstract <T> java.nio.channels.ServerSocketChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
    method public abstract java.net.ServerSocket socket();
    method public final int validOps();
  }

  public class ShutdownChannelGroupException extends java.lang.IllegalStateException {
    ctor public ShutdownChannelGroupException();
  }

  public abstract class SocketChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.ByteChannel java.nio.channels.GatheringByteChannel java.nio.channels.NetworkChannel java.nio.channels.ScatteringByteChannel {
    ctor protected SocketChannel(java.nio.channels.spi.SelectorProvider);
    method public abstract java.nio.channels.SocketChannel bind(java.net.SocketAddress) throws java.io.IOException;
    method public abstract boolean connect(java.net.SocketAddress) throws java.io.IOException;
    method public abstract boolean finishConnect() throws java.io.IOException;
    method public abstract java.net.SocketAddress getRemoteAddress() throws java.io.IOException;
    method public abstract boolean isConnected();
    method public abstract boolean isConnectionPending();
    method public static java.nio.channels.SocketChannel open() throws java.io.IOException;
    method public static java.nio.channels.SocketChannel open(java.net.SocketAddress) throws java.io.IOException;
    method public final long read(java.nio.ByteBuffer[]) throws java.io.IOException;
    method public abstract <T> java.nio.channels.SocketChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
    method public abstract java.nio.channels.SocketChannel shutdownInput() throws java.io.IOException;
    method public abstract java.nio.channels.SocketChannel shutdownOutput() throws java.io.IOException;
    method public abstract java.net.Socket socket();
    method public final int validOps();
    method public final long write(java.nio.ByteBuffer[]) throws java.io.IOException;
  }

  public class UnresolvedAddressException extends java.lang.IllegalArgumentException {
    ctor public UnresolvedAddressException();
  }

  public class UnsupportedAddressTypeException extends java.lang.IllegalArgumentException {
    ctor public UnsupportedAddressTypeException();
  }

  public interface WritableByteChannel extends java.nio.channels.Channel {
    method public int write(java.nio.ByteBuffer) throws java.io.IOException;
  }

  public class WritePendingException extends java.lang.IllegalStateException {
    ctor public WritePendingException();
  }

}

package java.nio.channels.spi {

  public abstract class AbstractInterruptibleChannel implements java.nio.channels.Channel java.nio.channels.InterruptibleChannel {
    ctor protected AbstractInterruptibleChannel();
    method protected final void begin();
    method public final void close() throws java.io.IOException;
    method protected final void end(boolean) throws java.nio.channels.AsynchronousCloseException;
    method protected abstract void implCloseChannel() throws java.io.IOException;
    method public final boolean isOpen();
  }

  public abstract class AbstractSelectableChannel extends java.nio.channels.SelectableChannel {
    ctor protected AbstractSelectableChannel(java.nio.channels.spi.SelectorProvider);
    method public final Object blockingLock();
    method public final java.nio.channels.SelectableChannel configureBlocking(boolean) throws java.io.IOException;
    method protected final void implCloseChannel() throws java.io.IOException;
    method protected abstract void implCloseSelectableChannel() throws java.io.IOException;
    method protected abstract void implConfigureBlocking(boolean) throws java.io.IOException;
    method public final boolean isBlocking();
    method public final boolean isRegistered();
    method public final java.nio.channels.SelectionKey keyFor(java.nio.channels.Selector);
    method public final java.nio.channels.spi.SelectorProvider provider();
    method public final java.nio.channels.SelectionKey register(java.nio.channels.Selector, int, Object) throws java.nio.channels.ClosedChannelException;
  }

  public abstract class AbstractSelectionKey extends java.nio.channels.SelectionKey {
    ctor protected AbstractSelectionKey();
    method public final void cancel();
    method public final boolean isValid();
  }

  public abstract class AbstractSelector extends java.nio.channels.Selector {
    ctor protected AbstractSelector(java.nio.channels.spi.SelectorProvider);
    method protected final void begin();
    method protected final java.util.Set<java.nio.channels.SelectionKey> cancelledKeys();
    method public final void close() throws java.io.IOException;
    method protected final void deregister(java.nio.channels.spi.AbstractSelectionKey);
    method protected final void end();
    method protected abstract void implCloseSelector() throws java.io.IOException;
    method public final boolean isOpen();
    method public final java.nio.channels.spi.SelectorProvider provider();
    method protected abstract java.nio.channels.SelectionKey register(java.nio.channels.spi.AbstractSelectableChannel, int, Object);
  }

  public abstract class AsynchronousChannelProvider {
    ctor protected AsynchronousChannelProvider();
    method public abstract java.nio.channels.AsynchronousChannelGroup openAsynchronousChannelGroup(int, java.util.concurrent.ThreadFactory) throws java.io.IOException;
    method public abstract java.nio.channels.AsynchronousChannelGroup openAsynchronousChannelGroup(java.util.concurrent.ExecutorService, int) throws java.io.IOException;
    method public abstract java.nio.channels.AsynchronousServerSocketChannel openAsynchronousServerSocketChannel(java.nio.channels.AsynchronousChannelGroup) throws java.io.IOException;
    method public abstract java.nio.channels.AsynchronousSocketChannel openAsynchronousSocketChannel(java.nio.channels.AsynchronousChannelGroup) throws java.io.IOException;
    method public static java.nio.channels.spi.AsynchronousChannelProvider provider();
  }

  public abstract class SelectorProvider {
    ctor protected SelectorProvider();
    method public java.nio.channels.Channel inheritedChannel() throws java.io.IOException;
    method public abstract java.nio.channels.DatagramChannel openDatagramChannel() throws java.io.IOException;
    method public abstract java.nio.channels.DatagramChannel openDatagramChannel(java.net.ProtocolFamily) throws java.io.IOException;
    method public abstract java.nio.channels.Pipe openPipe() throws java.io.IOException;
    method public abstract java.nio.channels.spi.AbstractSelector openSelector() throws java.io.IOException;
    method public abstract java.nio.channels.ServerSocketChannel openServerSocketChannel() throws java.io.IOException;
    method public abstract java.nio.channels.SocketChannel openSocketChannel() throws java.io.IOException;
    method public static java.nio.channels.spi.SelectorProvider provider();
  }

}

package java.nio.charset {

  public class CharacterCodingException extends java.io.IOException {
    ctor public CharacterCodingException();
  }

  public abstract class Charset implements java.lang.Comparable<java.nio.charset.Charset> {
    ctor protected Charset(String, String[]);
    method public final java.util.Set<java.lang.String> aliases();
    method public static java.util.SortedMap<java.lang.String,java.nio.charset.Charset> availableCharsets();
    method public boolean canEncode();
    method public final int compareTo(java.nio.charset.Charset);
    method public abstract boolean contains(java.nio.charset.Charset);
    method public final java.nio.CharBuffer decode(java.nio.ByteBuffer);
    method public static java.nio.charset.Charset defaultCharset();
    method public String displayName();
    method public String displayName(java.util.Locale);
    method public final java.nio.ByteBuffer encode(java.nio.CharBuffer);
    method public final java.nio.ByteBuffer encode(String);
    method public final boolean equals(Object);
    method public static java.nio.charset.Charset forName(String);
    method public final int hashCode();
    method public final boolean isRegistered();
    method public static boolean isSupported(String);
    method public final String name();
    method public abstract java.nio.charset.CharsetDecoder newDecoder();
    method public abstract java.nio.charset.CharsetEncoder newEncoder();
    method public final String toString();
  }

  public abstract class CharsetDecoder {
    ctor protected CharsetDecoder(java.nio.charset.Charset, float, float);
    method public final float averageCharsPerByte();
    method public final java.nio.charset.Charset charset();
    method public final java.nio.charset.CoderResult decode(java.nio.ByteBuffer, java.nio.CharBuffer, boolean);
    method public final java.nio.CharBuffer decode(java.nio.ByteBuffer) throws java.nio.charset.CharacterCodingException;
    method protected abstract java.nio.charset.CoderResult decodeLoop(java.nio.ByteBuffer, java.nio.CharBuffer);
    method public java.nio.charset.Charset detectedCharset();
    method public final java.nio.charset.CoderResult flush(java.nio.CharBuffer);
    method protected java.nio.charset.CoderResult implFlush(java.nio.CharBuffer);
    method protected void implOnMalformedInput(java.nio.charset.CodingErrorAction);
    method protected void implOnUnmappableCharacter(java.nio.charset.CodingErrorAction);
    method protected void implReplaceWith(String);
    method protected void implReset();
    method public boolean isAutoDetecting();
    method public boolean isCharsetDetected();
    method public java.nio.charset.CodingErrorAction malformedInputAction();
    method public final float maxCharsPerByte();
    method public final java.nio.charset.CharsetDecoder onMalformedInput(java.nio.charset.CodingErrorAction);
    method public final java.nio.charset.CharsetDecoder onUnmappableCharacter(java.nio.charset.CodingErrorAction);
    method public final java.nio.charset.CharsetDecoder replaceWith(String);
    method public final String replacement();
    method public final java.nio.charset.CharsetDecoder reset();
    method public java.nio.charset.CodingErrorAction unmappableCharacterAction();
  }

  public abstract class CharsetEncoder {
    ctor protected CharsetEncoder(java.nio.charset.Charset, float, float, byte[]);
    ctor protected CharsetEncoder(java.nio.charset.Charset, float, float);
    method public final float averageBytesPerChar();
    method public boolean canEncode(char);
    method public boolean canEncode(CharSequence);
    method public final java.nio.charset.Charset charset();
    method public final java.nio.charset.CoderResult encode(java.nio.CharBuffer, java.nio.ByteBuffer, boolean);
    method public final java.nio.ByteBuffer encode(java.nio.CharBuffer) throws java.nio.charset.CharacterCodingException;
    method protected abstract java.nio.charset.CoderResult encodeLoop(java.nio.CharBuffer, java.nio.ByteBuffer);
    method public final java.nio.charset.CoderResult flush(java.nio.ByteBuffer);
    method protected java.nio.charset.CoderResult implFlush(java.nio.ByteBuffer);
    method protected void implOnMalformedInput(java.nio.charset.CodingErrorAction);
    method protected void implOnUnmappableCharacter(java.nio.charset.CodingErrorAction);
    method protected void implReplaceWith(byte[]);
    method protected void implReset();
    method public boolean isLegalReplacement(byte[]);
    method public java.nio.charset.CodingErrorAction malformedInputAction();
    method public final float maxBytesPerChar();
    method public final java.nio.charset.CharsetEncoder onMalformedInput(java.nio.charset.CodingErrorAction);
    method public final java.nio.charset.CharsetEncoder onUnmappableCharacter(java.nio.charset.CodingErrorAction);
    method public final java.nio.charset.CharsetEncoder replaceWith(byte[]);
    method public final byte[] replacement();
    method public final java.nio.charset.CharsetEncoder reset();
    method public java.nio.charset.CodingErrorAction unmappableCharacterAction();
  }

  public class CoderMalfunctionError extends java.lang.Error {
    ctor public CoderMalfunctionError(Exception);
  }

  public class CoderResult {
    method public boolean isError();
    method public boolean isMalformed();
    method public boolean isOverflow();
    method public boolean isUnderflow();
    method public boolean isUnmappable();
    method public int length();
    method public static java.nio.charset.CoderResult malformedForLength(int);
    method public void throwException() throws java.nio.charset.CharacterCodingException;
    method public static java.nio.charset.CoderResult unmappableForLength(int);
    field public static final java.nio.charset.CoderResult OVERFLOW;
    field public static final java.nio.charset.CoderResult UNDERFLOW;
  }

  public class CodingErrorAction {
    field public static final java.nio.charset.CodingErrorAction IGNORE;
    field public static final java.nio.charset.CodingErrorAction REPLACE;
    field public static final java.nio.charset.CodingErrorAction REPORT;
  }

  public class IllegalCharsetNameException extends java.lang.IllegalArgumentException {
    ctor public IllegalCharsetNameException(String);
    method public String getCharsetName();
  }

  public class MalformedInputException extends java.nio.charset.CharacterCodingException {
    ctor public MalformedInputException(int);
    method public int getInputLength();
  }

  public final class StandardCharsets {
    field public static final java.nio.charset.Charset ISO_8859_1;
    field public static final java.nio.charset.Charset US_ASCII;
    field public static final java.nio.charset.Charset UTF_16;
    field public static final java.nio.charset.Charset UTF_16BE;
    field public static final java.nio.charset.Charset UTF_16LE;
    field public static final java.nio.charset.Charset UTF_8;
  }

  public class UnmappableCharacterException extends java.nio.charset.CharacterCodingException {
    ctor public UnmappableCharacterException(int);
    method public int getInputLength();
  }

  public class UnsupportedCharsetException extends java.lang.IllegalArgumentException {
    ctor public UnsupportedCharsetException(String);
    method public String getCharsetName();
  }

}

package java.nio.charset.spi {

  public abstract class CharsetProvider {
    ctor protected CharsetProvider();
    method public abstract java.nio.charset.Charset charsetForName(String);
    method public abstract java.util.Iterator<java.nio.charset.Charset> charsets();
  }

}

package java.nio.file {

  public class AccessDeniedException extends java.nio.file.FileSystemException {
    ctor public AccessDeniedException(String);
    ctor public AccessDeniedException(String, String, String);
  }

  public enum AccessMode {
    enum_constant public static final java.nio.file.AccessMode EXECUTE;
    enum_constant public static final java.nio.file.AccessMode READ;
    enum_constant public static final java.nio.file.AccessMode WRITE;
  }

  public class AtomicMoveNotSupportedException extends java.nio.file.FileSystemException {
    ctor public AtomicMoveNotSupportedException(String, String, String);
  }

  public class ClosedDirectoryStreamException extends java.lang.IllegalStateException {
    ctor public ClosedDirectoryStreamException();
  }

  public class ClosedFileSystemException extends java.lang.IllegalStateException {
    ctor public ClosedFileSystemException();
  }

  public class ClosedWatchServiceException extends java.lang.IllegalStateException {
    ctor public ClosedWatchServiceException();
  }

  public interface CopyOption {
  }

  public final class DirectoryIteratorException extends java.util.ConcurrentModificationException {
    ctor public DirectoryIteratorException(java.io.IOException);
    method public java.io.IOException getCause();
  }

  public class DirectoryNotEmptyException extends java.nio.file.FileSystemException {
    ctor public DirectoryNotEmptyException(String);
  }

  public interface DirectoryStream<T> extends java.io.Closeable java.lang.Iterable<T> {
  }

  @java.lang.FunctionalInterface public static interface DirectoryStream.Filter<T> {
    method public boolean accept(T) throws java.io.IOException;
  }

  public class FileAlreadyExistsException extends java.nio.file.FileSystemException {
    ctor public FileAlreadyExistsException(String);
    ctor public FileAlreadyExistsException(String, String, String);
  }

  public abstract class FileStore {
    ctor protected FileStore();
    method public abstract Object getAttribute(String) throws java.io.IOException;
    method public abstract <V extends java.nio.file.attribute.FileStoreAttributeView> V getFileStoreAttributeView(Class<V>);
    method public abstract long getTotalSpace() throws java.io.IOException;
    method public abstract long getUnallocatedSpace() throws java.io.IOException;
    method public abstract long getUsableSpace() throws java.io.IOException;
    method public abstract boolean isReadOnly();
    method public abstract String name();
    method public abstract boolean supportsFileAttributeView(Class<? extends java.nio.file.attribute.FileAttributeView>);
    method public abstract boolean supportsFileAttributeView(String);
    method public abstract String type();
  }

  public abstract class FileSystem implements java.io.Closeable {
    ctor protected FileSystem();
    method public abstract Iterable<java.nio.file.FileStore> getFileStores();
    method public abstract java.nio.file.Path getPath(String, java.lang.String...);
    method public abstract java.nio.file.PathMatcher getPathMatcher(String);
    method public abstract Iterable<java.nio.file.Path> getRootDirectories();
    method public abstract String getSeparator();
    method public abstract java.nio.file.attribute.UserPrincipalLookupService getUserPrincipalLookupService();
    method public abstract boolean isOpen();
    method public abstract boolean isReadOnly();
    method public abstract java.nio.file.WatchService newWatchService() throws java.io.IOException;
    method public abstract java.nio.file.spi.FileSystemProvider provider();
    method public abstract java.util.Set<java.lang.String> supportedFileAttributeViews();
  }

  public class FileSystemAlreadyExistsException extends java.lang.RuntimeException {
    ctor public FileSystemAlreadyExistsException();
    ctor public FileSystemAlreadyExistsException(String);
  }

  public class FileSystemException extends java.io.IOException {
    ctor public FileSystemException(String);
    ctor public FileSystemException(String, String, String);
    method public String getFile();
    method public String getOtherFile();
    method public String getReason();
  }

  public class FileSystemLoopException extends java.nio.file.FileSystemException {
    ctor public FileSystemLoopException(String);
  }

  public class FileSystemNotFoundException extends java.lang.RuntimeException {
    ctor public FileSystemNotFoundException();
    ctor public FileSystemNotFoundException(String);
  }

  public final class FileSystems {
    method public static java.nio.file.FileSystem getDefault();
    method public static java.nio.file.FileSystem getFileSystem(java.net.URI);
    method public static java.nio.file.FileSystem newFileSystem(java.net.URI, java.util.Map<java.lang.String,?>) throws java.io.IOException;
    method public static java.nio.file.FileSystem newFileSystem(java.net.URI, java.util.Map<java.lang.String,?>, ClassLoader) throws java.io.IOException;
    method public static java.nio.file.FileSystem newFileSystem(java.nio.file.Path, ClassLoader) throws java.io.IOException;
  }

  public enum FileVisitOption {
    enum_constant public static final java.nio.file.FileVisitOption FOLLOW_LINKS;
  }

  public enum FileVisitResult {
    enum_constant public static final java.nio.file.FileVisitResult CONTINUE;
    enum_constant public static final java.nio.file.FileVisitResult SKIP_SIBLINGS;
    enum_constant public static final java.nio.file.FileVisitResult SKIP_SUBTREE;
    enum_constant public static final java.nio.file.FileVisitResult TERMINATE;
  }

  public interface FileVisitor<T> {
    method public java.nio.file.FileVisitResult postVisitDirectory(T, java.io.IOException) throws java.io.IOException;
    method public java.nio.file.FileVisitResult preVisitDirectory(T, java.nio.file.attribute.BasicFileAttributes) throws java.io.IOException;
    method public java.nio.file.FileVisitResult visitFile(T, java.nio.file.attribute.BasicFileAttributes) throws java.io.IOException;
    method public java.nio.file.FileVisitResult visitFileFailed(T, java.io.IOException) throws java.io.IOException;
  }

  public final class Files {
    method public static java.nio.file.Path copy(java.nio.file.Path, java.nio.file.Path, java.nio.file.CopyOption...) throws java.io.IOException;
    method public static long copy(java.io.InputStream, java.nio.file.Path, java.nio.file.CopyOption...) throws java.io.IOException;
    method public static long copy(java.nio.file.Path, java.io.OutputStream) throws java.io.IOException;
    method public static java.nio.file.Path createDirectories(java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.file.Path createDirectory(java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.file.Path createFile(java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.file.Path createLink(java.nio.file.Path, java.nio.file.Path) throws java.io.IOException;
    method public static java.nio.file.Path createSymbolicLink(java.nio.file.Path, java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.file.Path createTempDirectory(java.nio.file.Path, String, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.file.Path createTempDirectory(String, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.file.Path createTempFile(java.nio.file.Path, String, String, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.file.Path createTempFile(String, String, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static void delete(java.nio.file.Path) throws java.io.IOException;
    method public static boolean deleteIfExists(java.nio.file.Path) throws java.io.IOException;
    method public static boolean exists(java.nio.file.Path, java.nio.file.LinkOption...);
    method public static java.util.stream.Stream<java.nio.file.Path> find(java.nio.file.Path, int, java.util.function.BiPredicate<java.nio.file.Path,java.nio.file.attribute.BasicFileAttributes>, java.nio.file.FileVisitOption...) throws java.io.IOException;
    method public static Object getAttribute(java.nio.file.Path, String, java.nio.file.LinkOption...) throws java.io.IOException;
    method public static <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(java.nio.file.Path, Class<V>, java.nio.file.LinkOption...);
    method public static java.nio.file.FileStore getFileStore(java.nio.file.Path) throws java.io.IOException;
    method public static java.nio.file.attribute.FileTime getLastModifiedTime(java.nio.file.Path, java.nio.file.LinkOption...) throws java.io.IOException;
    method public static java.nio.file.attribute.UserPrincipal getOwner(java.nio.file.Path, java.nio.file.LinkOption...) throws java.io.IOException;
    method public static java.util.Set<java.nio.file.attribute.PosixFilePermission> getPosixFilePermissions(java.nio.file.Path, java.nio.file.LinkOption...) throws java.io.IOException;
    method public static boolean isDirectory(java.nio.file.Path, java.nio.file.LinkOption...);
    method public static boolean isExecutable(java.nio.file.Path);
    method public static boolean isHidden(java.nio.file.Path) throws java.io.IOException;
    method public static boolean isReadable(java.nio.file.Path);
    method public static boolean isRegularFile(java.nio.file.Path, java.nio.file.LinkOption...);
    method public static boolean isSameFile(java.nio.file.Path, java.nio.file.Path) throws java.io.IOException;
    method public static boolean isSymbolicLink(java.nio.file.Path);
    method public static boolean isWritable(java.nio.file.Path);
    method public static java.util.stream.Stream<java.lang.String> lines(java.nio.file.Path, java.nio.charset.Charset) throws java.io.IOException;
    method public static java.util.stream.Stream<java.lang.String> lines(java.nio.file.Path) throws java.io.IOException;
    method public static java.util.stream.Stream<java.nio.file.Path> list(java.nio.file.Path) throws java.io.IOException;
    method public static java.nio.file.Path move(java.nio.file.Path, java.nio.file.Path, java.nio.file.CopyOption...) throws java.io.IOException;
    method public static java.io.BufferedReader newBufferedReader(java.nio.file.Path, java.nio.charset.Charset) throws java.io.IOException;
    method public static java.io.BufferedReader newBufferedReader(java.nio.file.Path) throws java.io.IOException;
    method public static java.io.BufferedWriter newBufferedWriter(java.nio.file.Path, java.nio.charset.Charset, java.nio.file.OpenOption...) throws java.io.IOException;
    method public static java.io.BufferedWriter newBufferedWriter(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
    method public static java.nio.channels.SeekableByteChannel newByteChannel(java.nio.file.Path, java.util.Set<? extends java.nio.file.OpenOption>, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.channels.SeekableByteChannel newByteChannel(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
    method public static java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path) throws java.io.IOException;
    method public static java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path, String) throws java.io.IOException;
    method public static java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path>) throws java.io.IOException;
    method public static java.io.InputStream newInputStream(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
    method public static java.io.OutputStream newOutputStream(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
    method public static boolean notExists(java.nio.file.Path, java.nio.file.LinkOption...);
    method public static String probeContentType(java.nio.file.Path) throws java.io.IOException;
    method public static byte[] readAllBytes(java.nio.file.Path) throws java.io.IOException;
    method public static java.util.List<java.lang.String> readAllLines(java.nio.file.Path, java.nio.charset.Charset) throws java.io.IOException;
    method public static java.util.List<java.lang.String> readAllLines(java.nio.file.Path) throws java.io.IOException;
    method public static <A extends java.nio.file.attribute.BasicFileAttributes> A readAttributes(java.nio.file.Path, Class<A>, java.nio.file.LinkOption...) throws java.io.IOException;
    method public static java.util.Map<java.lang.String,java.lang.Object> readAttributes(java.nio.file.Path, String, java.nio.file.LinkOption...) throws java.io.IOException;
    method public static java.nio.file.Path readSymbolicLink(java.nio.file.Path) throws java.io.IOException;
    method public static java.nio.file.Path setAttribute(java.nio.file.Path, String, Object, java.nio.file.LinkOption...) throws java.io.IOException;
    method public static java.nio.file.Path setLastModifiedTime(java.nio.file.Path, java.nio.file.attribute.FileTime) throws java.io.IOException;
    method public static java.nio.file.Path setOwner(java.nio.file.Path, java.nio.file.attribute.UserPrincipal) throws java.io.IOException;
    method public static java.nio.file.Path setPosixFilePermissions(java.nio.file.Path, java.util.Set<java.nio.file.attribute.PosixFilePermission>) throws java.io.IOException;
    method public static long size(java.nio.file.Path) throws java.io.IOException;
    method public static java.util.stream.Stream<java.nio.file.Path> walk(java.nio.file.Path, int, java.nio.file.FileVisitOption...) throws java.io.IOException;
    method public static java.util.stream.Stream<java.nio.file.Path> walk(java.nio.file.Path, java.nio.file.FileVisitOption...) throws java.io.IOException;
    method public static java.nio.file.Path walkFileTree(java.nio.file.Path, java.util.Set<java.nio.file.FileVisitOption>, int, java.nio.file.FileVisitor<? super java.nio.file.Path>) throws java.io.IOException;
    method public static java.nio.file.Path walkFileTree(java.nio.file.Path, java.nio.file.FileVisitor<? super java.nio.file.Path>) throws java.io.IOException;
    method public static java.nio.file.Path write(java.nio.file.Path, byte[], java.nio.file.OpenOption...) throws java.io.IOException;
    method public static java.nio.file.Path write(java.nio.file.Path, Iterable<? extends java.lang.CharSequence>, java.nio.charset.Charset, java.nio.file.OpenOption...) throws java.io.IOException;
    method public static java.nio.file.Path write(java.nio.file.Path, Iterable<? extends java.lang.CharSequence>, java.nio.file.OpenOption...) throws java.io.IOException;
  }

  public class InvalidPathException extends java.lang.IllegalArgumentException {
    ctor public InvalidPathException(String, String, int);
    ctor public InvalidPathException(String, String);
    method public int getIndex();
    method public String getInput();
    method public String getReason();
  }

  public enum LinkOption implements java.nio.file.CopyOption java.nio.file.OpenOption {
    enum_constant public static final java.nio.file.LinkOption NOFOLLOW_LINKS;
  }

  public final class LinkPermission extends java.security.BasicPermission {
    ctor public LinkPermission(String);
    ctor public LinkPermission(String, String);
  }

  public class NoSuchFileException extends java.nio.file.FileSystemException {
    ctor public NoSuchFileException(String);
    ctor public NoSuchFileException(String, String, String);
  }

  public class NotDirectoryException extends java.nio.file.FileSystemException {
    ctor public NotDirectoryException(String);
  }

  public class NotLinkException extends java.nio.file.FileSystemException {
    ctor public NotLinkException(String);
    ctor public NotLinkException(String, String, String);
  }

  public interface OpenOption {
  }

  public interface Path extends java.lang.Comparable<java.nio.file.Path> java.lang.Iterable<java.nio.file.Path> java.nio.file.Watchable {
    method public int compareTo(java.nio.file.Path);
    method public boolean endsWith(java.nio.file.Path);
    method public boolean endsWith(String);
    method public boolean equals(Object);
    method public java.nio.file.Path getFileName();
    method public java.nio.file.FileSystem getFileSystem();
    method public java.nio.file.Path getName(int);
    method public int getNameCount();
    method public java.nio.file.Path getParent();
    method public java.nio.file.Path getRoot();
    method public int hashCode();
    method public boolean isAbsolute();
    method public java.util.Iterator<java.nio.file.Path> iterator();
    method public java.nio.file.Path normalize();
    method public java.nio.file.Path relativize(java.nio.file.Path);
    method public java.nio.file.Path resolve(java.nio.file.Path);
    method public java.nio.file.Path resolve(String);
    method public java.nio.file.Path resolveSibling(java.nio.file.Path);
    method public java.nio.file.Path resolveSibling(String);
    method public boolean startsWith(java.nio.file.Path);
    method public boolean startsWith(String);
    method public java.nio.file.Path subpath(int, int);
    method public java.nio.file.Path toAbsolutePath();
    method public java.io.File toFile();
    method public java.nio.file.Path toRealPath(java.nio.file.LinkOption...) throws java.io.IOException;
    method public String toString();
    method public java.net.URI toUri();
  }

  @java.lang.FunctionalInterface public interface PathMatcher {
    method public boolean matches(java.nio.file.Path);
  }

  public final class Paths {
    method public static java.nio.file.Path get(String, java.lang.String...);
    method public static java.nio.file.Path get(java.net.URI);
  }

  public class ProviderMismatchException extends java.lang.IllegalArgumentException {
    ctor public ProviderMismatchException();
    ctor public ProviderMismatchException(String);
  }

  public class ProviderNotFoundException extends java.lang.RuntimeException {
    ctor public ProviderNotFoundException();
    ctor public ProviderNotFoundException(String);
  }

  public class ReadOnlyFileSystemException extends java.lang.UnsupportedOperationException {
    ctor public ReadOnlyFileSystemException();
  }

  public interface SecureDirectoryStream<T> extends java.nio.file.DirectoryStream<T> {
    method public void deleteDirectory(T) throws java.io.IOException;
    method public void deleteFile(T) throws java.io.IOException;
    method public <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(Class<V>);
    method public <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(T, Class<V>, java.nio.file.LinkOption...);
    method public void move(T, java.nio.file.SecureDirectoryStream<T>, T) throws java.io.IOException;
    method public java.nio.channels.SeekableByteChannel newByteChannel(T, java.util.Set<? extends java.nio.file.OpenOption>, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public java.nio.file.SecureDirectoryStream<T> newDirectoryStream(T, java.nio.file.LinkOption...) throws java.io.IOException;
  }

  public class SimpleFileVisitor<T> implements java.nio.file.FileVisitor<T> {
    ctor protected SimpleFileVisitor();
    method public java.nio.file.FileVisitResult postVisitDirectory(T, java.io.IOException) throws java.io.IOException;
    method public java.nio.file.FileVisitResult preVisitDirectory(T, java.nio.file.attribute.BasicFileAttributes) throws java.io.IOException;
    method public java.nio.file.FileVisitResult visitFile(T, java.nio.file.attribute.BasicFileAttributes) throws java.io.IOException;
    method public java.nio.file.FileVisitResult visitFileFailed(T, java.io.IOException) throws java.io.IOException;
  }

  public enum StandardCopyOption implements java.nio.file.CopyOption {
    enum_constant public static final java.nio.file.StandardCopyOption ATOMIC_MOVE;
    enum_constant public static final java.nio.file.StandardCopyOption COPY_ATTRIBUTES;
    enum_constant public static final java.nio.file.StandardCopyOption REPLACE_EXISTING;
  }

  public enum StandardOpenOption implements java.nio.file.OpenOption {
    enum_constant public static final java.nio.file.StandardOpenOption APPEND;
    enum_constant public static final java.nio.file.StandardOpenOption CREATE;
    enum_constant public static final java.nio.file.StandardOpenOption CREATE_NEW;
    enum_constant public static final java.nio.file.StandardOpenOption DELETE_ON_CLOSE;
    enum_constant public static final java.nio.file.StandardOpenOption DSYNC;
    enum_constant public static final java.nio.file.StandardOpenOption READ;
    enum_constant public static final java.nio.file.StandardOpenOption SPARSE;
    enum_constant public static final java.nio.file.StandardOpenOption SYNC;
    enum_constant public static final java.nio.file.StandardOpenOption TRUNCATE_EXISTING;
    enum_constant public static final java.nio.file.StandardOpenOption WRITE;
  }

  public final class StandardWatchEventKinds {
    field public static final java.nio.file.WatchEvent.Kind<java.nio.file.Path> ENTRY_CREATE;
    field public static final java.nio.file.WatchEvent.Kind<java.nio.file.Path> ENTRY_DELETE;
    field public static final java.nio.file.WatchEvent.Kind<java.nio.file.Path> ENTRY_MODIFY;
    field public static final java.nio.file.WatchEvent.Kind<java.lang.Object> OVERFLOW;
  }

  public interface WatchEvent<T> {
    method public T context();
    method public int count();
    method public java.nio.file.WatchEvent.Kind<T> kind();
  }

  public static interface WatchEvent.Kind<T> {
    method public String name();
    method public Class<T> type();
  }

  public static interface WatchEvent.Modifier {
    method public String name();
  }

  public interface WatchKey {
    method public void cancel();
    method public boolean isValid();
    method public java.util.List<java.nio.file.WatchEvent<?>> pollEvents();
    method public boolean reset();
    method public java.nio.file.Watchable watchable();
  }

  public interface WatchService extends java.io.Closeable {
    method public java.nio.file.WatchKey poll();
    method public java.nio.file.WatchKey poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public java.nio.file.WatchKey take() throws java.lang.InterruptedException;
  }

  public interface Watchable {
    method public java.nio.file.WatchKey register(java.nio.file.WatchService, java.nio.file.WatchEvent.Kind<?>[], java.nio.file.WatchEvent.Modifier...) throws java.io.IOException;
    method public java.nio.file.WatchKey register(java.nio.file.WatchService, java.nio.file.WatchEvent.Kind<?>...) throws java.io.IOException;
  }

}

package java.nio.file.attribute {

  public final class AclEntry {
    method public java.util.Set<java.nio.file.attribute.AclEntryFlag> flags();
    method public static java.nio.file.attribute.AclEntry.Builder newBuilder();
    method public static java.nio.file.attribute.AclEntry.Builder newBuilder(java.nio.file.attribute.AclEntry);
    method public java.util.Set<java.nio.file.attribute.AclEntryPermission> permissions();
    method public java.nio.file.attribute.UserPrincipal principal();
    method public java.nio.file.attribute.AclEntryType type();
  }

  public static final class AclEntry.Builder {
    method public java.nio.file.attribute.AclEntry build();
    method public java.nio.file.attribute.AclEntry.Builder setFlags(java.util.Set<java.nio.file.attribute.AclEntryFlag>);
    method public java.nio.file.attribute.AclEntry.Builder setFlags(java.nio.file.attribute.AclEntryFlag...);
    method public java.nio.file.attribute.AclEntry.Builder setPermissions(java.util.Set<java.nio.file.attribute.AclEntryPermission>);
    method public java.nio.file.attribute.AclEntry.Builder setPermissions(java.nio.file.attribute.AclEntryPermission...);
    method public java.nio.file.attribute.AclEntry.Builder setPrincipal(java.nio.file.attribute.UserPrincipal);
    method public java.nio.file.attribute.AclEntry.Builder setType(java.nio.file.attribute.AclEntryType);
  }

  public enum AclEntryFlag {
    enum_constant public static final java.nio.file.attribute.AclEntryFlag DIRECTORY_INHERIT;
    enum_constant public static final java.nio.file.attribute.AclEntryFlag FILE_INHERIT;
    enum_constant public static final java.nio.file.attribute.AclEntryFlag INHERIT_ONLY;
    enum_constant public static final java.nio.file.attribute.AclEntryFlag NO_PROPAGATE_INHERIT;
  }

  public enum AclEntryPermission {
    enum_constant public static final java.nio.file.attribute.AclEntryPermission APPEND_DATA;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission DELETE;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission DELETE_CHILD;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission EXECUTE;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission READ_ACL;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission READ_ATTRIBUTES;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission READ_DATA;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission READ_NAMED_ATTRS;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission SYNCHRONIZE;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission WRITE_ACL;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission WRITE_ATTRIBUTES;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission WRITE_DATA;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission WRITE_NAMED_ATTRS;
    enum_constant public static final java.nio.file.attribute.AclEntryPermission WRITE_OWNER;
    field public static final java.nio.file.attribute.AclEntryPermission ADD_FILE;
    field public static final java.nio.file.attribute.AclEntryPermission ADD_SUBDIRECTORY;
    field public static final java.nio.file.attribute.AclEntryPermission LIST_DIRECTORY;
  }

  public enum AclEntryType {
    enum_constant public static final java.nio.file.attribute.AclEntryType ALARM;
    enum_constant public static final java.nio.file.attribute.AclEntryType ALLOW;
    enum_constant public static final java.nio.file.attribute.AclEntryType AUDIT;
    enum_constant public static final java.nio.file.attribute.AclEntryType DENY;
  }

  public interface AclFileAttributeView extends java.nio.file.attribute.FileOwnerAttributeView {
    method public java.util.List<java.nio.file.attribute.AclEntry> getAcl() throws java.io.IOException;
    method public void setAcl(java.util.List<java.nio.file.attribute.AclEntry>) throws java.io.IOException;
  }

  public interface AttributeView {
    method public String name();
  }

  public interface BasicFileAttributeView extends java.nio.file.attribute.FileAttributeView {
    method public java.nio.file.attribute.BasicFileAttributes readAttributes() throws java.io.IOException;
    method public void setTimes(java.nio.file.attribute.FileTime, java.nio.file.attribute.FileTime, java.nio.file.attribute.FileTime) throws java.io.IOException;
  }

  public interface BasicFileAttributes {
    method public java.nio.file.attribute.FileTime creationTime();
    method public Object fileKey();
    method public boolean isDirectory();
    method public boolean isOther();
    method public boolean isRegularFile();
    method public boolean isSymbolicLink();
    method public java.nio.file.attribute.FileTime lastAccessTime();
    method public java.nio.file.attribute.FileTime lastModifiedTime();
    method public long size();
  }

  public interface DosFileAttributeView extends java.nio.file.attribute.BasicFileAttributeView {
    method public java.nio.file.attribute.DosFileAttributes readAttributes() throws java.io.IOException;
    method public void setArchive(boolean) throws java.io.IOException;
    method public void setHidden(boolean) throws java.io.IOException;
    method public void setReadOnly(boolean) throws java.io.IOException;
    method public void setSystem(boolean) throws java.io.IOException;
  }

  public interface DosFileAttributes extends java.nio.file.attribute.BasicFileAttributes {
    method public boolean isArchive();
    method public boolean isHidden();
    method public boolean isReadOnly();
    method public boolean isSystem();
  }

  public interface FileAttribute<T> {
    method public String name();
    method public T value();
  }

  public interface FileAttributeView extends java.nio.file.attribute.AttributeView {
  }

  public interface FileOwnerAttributeView extends java.nio.file.attribute.FileAttributeView {
    method public java.nio.file.attribute.UserPrincipal getOwner() throws java.io.IOException;
    method public void setOwner(java.nio.file.attribute.UserPrincipal) throws java.io.IOException;
  }

  public interface FileStoreAttributeView extends java.nio.file.attribute.AttributeView {
  }

  public final class FileTime implements java.lang.Comparable<java.nio.file.attribute.FileTime> {
    method public int compareTo(java.nio.file.attribute.FileTime);
    method public static java.nio.file.attribute.FileTime from(long, java.util.concurrent.TimeUnit);
    method public static java.nio.file.attribute.FileTime from(java.time.Instant);
    method public static java.nio.file.attribute.FileTime fromMillis(long);
    method public long to(java.util.concurrent.TimeUnit);
    method public java.time.Instant toInstant();
    method public long toMillis();
  }

  public interface GroupPrincipal extends java.nio.file.attribute.UserPrincipal {
  }

  public interface PosixFileAttributeView extends java.nio.file.attribute.BasicFileAttributeView java.nio.file.attribute.FileOwnerAttributeView {
    method public java.nio.file.attribute.PosixFileAttributes readAttributes() throws java.io.IOException;
    method public void setGroup(java.nio.file.attribute.GroupPrincipal) throws java.io.IOException;
    method public void setPermissions(java.util.Set<java.nio.file.attribute.PosixFilePermission>) throws java.io.IOException;
  }

  public interface PosixFileAttributes extends java.nio.file.attribute.BasicFileAttributes {
    method public java.nio.file.attribute.GroupPrincipal group();
    method public java.nio.file.attribute.UserPrincipal owner();
    method public java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions();
  }

  public enum PosixFilePermission {
    enum_constant public static final java.nio.file.attribute.PosixFilePermission GROUP_EXECUTE;
    enum_constant public static final java.nio.file.attribute.PosixFilePermission GROUP_READ;
    enum_constant public static final java.nio.file.attribute.PosixFilePermission GROUP_WRITE;
    enum_constant public static final java.nio.file.attribute.PosixFilePermission OTHERS_EXECUTE;
    enum_constant public static final java.nio.file.attribute.PosixFilePermission OTHERS_READ;
    enum_constant public static final java.nio.file.attribute.PosixFilePermission OTHERS_WRITE;
    enum_constant public static final java.nio.file.attribute.PosixFilePermission OWNER_EXECUTE;
    enum_constant public static final java.nio.file.attribute.PosixFilePermission OWNER_READ;
    enum_constant public static final java.nio.file.attribute.PosixFilePermission OWNER_WRITE;
  }

  public final class PosixFilePermissions {
    method public static java.nio.file.attribute.FileAttribute<java.util.Set<java.nio.file.attribute.PosixFilePermission>> asFileAttribute(java.util.Set<java.nio.file.attribute.PosixFilePermission>);
    method public static java.util.Set<java.nio.file.attribute.PosixFilePermission> fromString(String);
    method public static String toString(java.util.Set<java.nio.file.attribute.PosixFilePermission>);
  }

  public interface UserDefinedFileAttributeView extends java.nio.file.attribute.FileAttributeView {
    method public void delete(String) throws java.io.IOException;
    method public java.util.List<java.lang.String> list() throws java.io.IOException;
    method public int read(String, java.nio.ByteBuffer) throws java.io.IOException;
    method public int size(String) throws java.io.IOException;
    method public int write(String, java.nio.ByteBuffer) throws java.io.IOException;
  }

  public interface UserPrincipal extends java.security.Principal {
  }

  public abstract class UserPrincipalLookupService {
    ctor protected UserPrincipalLookupService();
    method public abstract java.nio.file.attribute.GroupPrincipal lookupPrincipalByGroupName(String) throws java.io.IOException;
    method public abstract java.nio.file.attribute.UserPrincipal lookupPrincipalByName(String) throws java.io.IOException;
  }

  public class UserPrincipalNotFoundException extends java.io.IOException {
    ctor public UserPrincipalNotFoundException(String);
    method public String getName();
  }

}

package java.nio.file.spi {

  public abstract class FileSystemProvider {
    ctor protected FileSystemProvider();
    method public abstract void checkAccess(java.nio.file.Path, java.nio.file.AccessMode...) throws java.io.IOException;
    method public abstract void copy(java.nio.file.Path, java.nio.file.Path, java.nio.file.CopyOption...) throws java.io.IOException;
    method public abstract void createDirectory(java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public void createLink(java.nio.file.Path, java.nio.file.Path) throws java.io.IOException;
    method public void createSymbolicLink(java.nio.file.Path, java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public abstract void delete(java.nio.file.Path) throws java.io.IOException;
    method public boolean deleteIfExists(java.nio.file.Path) throws java.io.IOException;
    method public abstract <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(java.nio.file.Path, Class<V>, java.nio.file.LinkOption...);
    method public abstract java.nio.file.FileStore getFileStore(java.nio.file.Path) throws java.io.IOException;
    method public abstract java.nio.file.FileSystem getFileSystem(java.net.URI);
    method public abstract java.nio.file.Path getPath(java.net.URI);
    method public abstract String getScheme();
    method public static java.util.List<java.nio.file.spi.FileSystemProvider> installedProviders();
    method public abstract boolean isHidden(java.nio.file.Path) throws java.io.IOException;
    method public abstract boolean isSameFile(java.nio.file.Path, java.nio.file.Path) throws java.io.IOException;
    method public abstract void move(java.nio.file.Path, java.nio.file.Path, java.nio.file.CopyOption...) throws java.io.IOException;
    method public java.nio.channels.AsynchronousFileChannel newAsynchronousFileChannel(java.nio.file.Path, java.util.Set<? extends java.nio.file.OpenOption>, java.util.concurrent.ExecutorService, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public abstract java.nio.channels.SeekableByteChannel newByteChannel(java.nio.file.Path, java.util.Set<? extends java.nio.file.OpenOption>, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public abstract java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path>) throws java.io.IOException;
    method public java.nio.channels.FileChannel newFileChannel(java.nio.file.Path, java.util.Set<? extends java.nio.file.OpenOption>, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public abstract java.nio.file.FileSystem newFileSystem(java.net.URI, java.util.Map<java.lang.String,?>) throws java.io.IOException;
    method public java.nio.file.FileSystem newFileSystem(java.nio.file.Path, java.util.Map<java.lang.String,?>) throws java.io.IOException;
    method public java.io.InputStream newInputStream(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
    method public java.io.OutputStream newOutputStream(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
    method public abstract <A extends java.nio.file.attribute.BasicFileAttributes> A readAttributes(java.nio.file.Path, Class<A>, java.nio.file.LinkOption...) throws java.io.IOException;
    method public abstract java.util.Map<java.lang.String,java.lang.Object> readAttributes(java.nio.file.Path, String, java.nio.file.LinkOption...) throws java.io.IOException;
    method public java.nio.file.Path readSymbolicLink(java.nio.file.Path) throws java.io.IOException;
    method public abstract void setAttribute(java.nio.file.Path, String, Object, java.nio.file.LinkOption...) throws java.io.IOException;
  }

  public abstract class FileTypeDetector {
    ctor protected FileTypeDetector();
    method public abstract String probeContentType(java.nio.file.Path) throws java.io.IOException;
  }

}

package java.security {

  public final class AccessControlContext {
    ctor public AccessControlContext(java.security.ProtectionDomain[]);
    ctor public AccessControlContext(java.security.AccessControlContext, java.security.DomainCombiner);
    method public void checkPermission(java.security.Permission) throws java.security.AccessControlException;
    method public java.security.DomainCombiner getDomainCombiner();
  }

  public class AccessControlException extends java.lang.SecurityException {
    ctor public AccessControlException(String);
    ctor public AccessControlException(String, java.security.Permission);
    method public java.security.Permission getPermission();
  }

  public final class AccessController {
    method public static void checkPermission(java.security.Permission) throws java.security.AccessControlException;
    method public static <T> T doPrivileged(java.security.PrivilegedAction<T>);
    method public static <T> T doPrivileged(java.security.PrivilegedAction<T>, java.security.AccessControlContext);
    method public static <T> T doPrivileged(java.security.PrivilegedExceptionAction<T>) throws java.security.PrivilegedActionException;
    method public static <T> T doPrivileged(java.security.PrivilegedExceptionAction<T>, java.security.AccessControlContext) throws java.security.PrivilegedActionException;
    method public static <T> T doPrivilegedWithCombiner(java.security.PrivilegedAction<T>);
    method public static <T> T doPrivilegedWithCombiner(java.security.PrivilegedExceptionAction<T>) throws java.security.PrivilegedActionException;
    method public static java.security.AccessControlContext getContext();
  }

  public interface AlgorithmConstraints {
    method public boolean permits(java.util.Set<java.security.CryptoPrimitive>, String, java.security.AlgorithmParameters);
    method public boolean permits(java.util.Set<java.security.CryptoPrimitive>, java.security.Key);
    method public boolean permits(java.util.Set<java.security.CryptoPrimitive>, String, java.security.Key, java.security.AlgorithmParameters);
  }

  public class AlgorithmParameterGenerator {
    ctor protected AlgorithmParameterGenerator(java.security.AlgorithmParameterGeneratorSpi, java.security.Provider, String);
    method public final java.security.AlgorithmParameters generateParameters();
    method public final String getAlgorithm();
    method public static java.security.AlgorithmParameterGenerator getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.AlgorithmParameterGenerator getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.AlgorithmParameterGenerator getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final java.security.Provider getProvider();
    method public final void init(int);
    method public final void init(int, java.security.SecureRandom);
    method public final void init(java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException;
    method public final void init(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException;
  }

  public abstract class AlgorithmParameterGeneratorSpi {
    ctor public AlgorithmParameterGeneratorSpi();
    method protected abstract java.security.AlgorithmParameters engineGenerateParameters();
    method protected abstract void engineInit(int, java.security.SecureRandom);
    method protected abstract void engineInit(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException;
  }

  public class AlgorithmParameters {
    ctor protected AlgorithmParameters(java.security.AlgorithmParametersSpi, java.security.Provider, String);
    method public final String getAlgorithm();
    method public final byte[] getEncoded() throws java.io.IOException;
    method public final byte[] getEncoded(String) throws java.io.IOException;
    method public static java.security.AlgorithmParameters getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.AlgorithmParameters getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.AlgorithmParameters getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final <T extends java.security.spec.AlgorithmParameterSpec> T getParameterSpec(Class<T>) throws java.security.spec.InvalidParameterSpecException;
    method public final java.security.Provider getProvider();
    method public final void init(java.security.spec.AlgorithmParameterSpec) throws java.security.spec.InvalidParameterSpecException;
    method public final void init(byte[]) throws java.io.IOException;
    method public final void init(byte[], String) throws java.io.IOException;
    method public final String toString();
  }

  public abstract class AlgorithmParametersSpi {
    ctor public AlgorithmParametersSpi();
    method protected abstract byte[] engineGetEncoded() throws java.io.IOException;
    method protected abstract byte[] engineGetEncoded(String) throws java.io.IOException;
    method protected abstract <T extends java.security.spec.AlgorithmParameterSpec> T engineGetParameterSpec(Class<T>) throws java.security.spec.InvalidParameterSpecException;
    method protected abstract void engineInit(java.security.spec.AlgorithmParameterSpec) throws java.security.spec.InvalidParameterSpecException;
    method protected abstract void engineInit(byte[]) throws java.io.IOException;
    method protected abstract void engineInit(byte[], String) throws java.io.IOException;
    method protected abstract String engineToString();
  }

  public final class AllPermission extends java.security.Permission {
    ctor public AllPermission();
    ctor public AllPermission(String, String);
    method public String getActions();
    method public boolean implies(java.security.Permission);
  }

  public abstract class AuthProvider extends java.security.Provider {
    ctor protected AuthProvider(String, double, String);
    method public abstract void login(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler) throws javax.security.auth.login.LoginException;
    method public abstract void logout() throws javax.security.auth.login.LoginException;
    method public abstract void setCallbackHandler(javax.security.auth.callback.CallbackHandler);
  }

  public abstract class BasicPermission extends java.security.Permission implements java.io.Serializable {
    ctor public BasicPermission(String);
    ctor public BasicPermission(String, String);
    method public String getActions();
    method public boolean implies(java.security.Permission);
  }

  @Deprecated public interface Certificate {
    method @Deprecated public void decode(java.io.InputStream) throws java.io.IOException, java.security.KeyException;
    method @Deprecated public void encode(java.io.OutputStream) throws java.io.IOException, java.security.KeyException;
    method @Deprecated public String getFormat();
    method @Deprecated public java.security.Principal getGuarantor();
    method @Deprecated public java.security.Principal getPrincipal();
    method @Deprecated public java.security.PublicKey getPublicKey();
    method @Deprecated public String toString(boolean);
  }

  public final class CodeSigner implements java.io.Serializable {
    ctor public CodeSigner(java.security.cert.CertPath, java.security.Timestamp);
    method public java.security.cert.CertPath getSignerCertPath();
    method public java.security.Timestamp getTimestamp();
  }

  public class CodeSource implements java.io.Serializable {
    ctor public CodeSource(java.net.URL, java.security.cert.Certificate[]);
    ctor public CodeSource(java.net.URL, java.security.CodeSigner[]);
    method public final java.security.cert.Certificate[] getCertificates();
    method public final java.security.CodeSigner[] getCodeSigners();
    method public final java.net.URL getLocation();
    method public boolean implies(java.security.CodeSource);
  }

  public enum CryptoPrimitive {
    enum_constant public static final java.security.CryptoPrimitive BLOCK_CIPHER;
    enum_constant public static final java.security.CryptoPrimitive KEY_AGREEMENT;
    enum_constant public static final java.security.CryptoPrimitive KEY_ENCAPSULATION;
    enum_constant public static final java.security.CryptoPrimitive KEY_WRAP;
    enum_constant public static final java.security.CryptoPrimitive MAC;
    enum_constant public static final java.security.CryptoPrimitive MESSAGE_DIGEST;
    enum_constant public static final java.security.CryptoPrimitive PUBLIC_KEY_ENCRYPTION;
    enum_constant public static final java.security.CryptoPrimitive SECURE_RANDOM;
    enum_constant public static final java.security.CryptoPrimitive SIGNATURE;
    enum_constant public static final java.security.CryptoPrimitive STREAM_CIPHER;
  }

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

  public class DigestInputStream extends java.io.FilterInputStream {
    ctor public DigestInputStream(java.io.InputStream, java.security.MessageDigest);
    method public java.security.MessageDigest getMessageDigest();
    method public void on(boolean);
    method public void setMessageDigest(java.security.MessageDigest);
    field protected java.security.MessageDigest digest;
  }

  public class DigestOutputStream extends java.io.FilterOutputStream {
    ctor public DigestOutputStream(java.io.OutputStream, java.security.MessageDigest);
    method public java.security.MessageDigest getMessageDigest();
    method public void on(boolean);
    method public void setMessageDigest(java.security.MessageDigest);
    field protected java.security.MessageDigest digest;
  }

  public interface DomainCombiner {
    method public java.security.ProtectionDomain[] combine(java.security.ProtectionDomain[], java.security.ProtectionDomain[]);
  }

  public final class DomainLoadStoreParameter implements java.security.KeyStore.LoadStoreParameter {
    ctor public DomainLoadStoreParameter(java.net.URI, java.util.Map<java.lang.String,java.security.KeyStore.ProtectionParameter>);
    method public java.net.URI getConfiguration();
    method public java.security.KeyStore.ProtectionParameter getProtectionParameter();
    method public java.util.Map<java.lang.String,java.security.KeyStore.ProtectionParameter> getProtectionParams();
  }

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

  public interface Guard {
    method public void checkGuard(Object) throws java.lang.SecurityException;
  }

  public class GuardedObject implements java.io.Serializable {
    ctor public GuardedObject(Object, java.security.Guard);
    method public Object getObject() throws java.lang.SecurityException;
  }

  @Deprecated public abstract class Identity implements java.security.Principal java.io.Serializable {
    ctor @Deprecated protected Identity();
    ctor @Deprecated public Identity(String, java.security.IdentityScope) throws java.security.KeyManagementException;
    ctor @Deprecated public Identity(String);
    method @Deprecated public void addCertificate(java.security.Certificate) throws java.security.KeyManagementException;
    method @Deprecated public java.security.Certificate[] certificates();
    method @Deprecated public final boolean equals(Object);
    method @Deprecated public String getInfo();
    method @Deprecated public final String getName();
    method @Deprecated public java.security.PublicKey getPublicKey();
    method @Deprecated public final java.security.IdentityScope getScope();
    method @Deprecated protected boolean identityEquals(java.security.Identity);
    method @Deprecated public void removeCertificate(java.security.Certificate) throws java.security.KeyManagementException;
    method @Deprecated public void setInfo(String);
    method @Deprecated public void setPublicKey(java.security.PublicKey) throws java.security.KeyManagementException;
    method @Deprecated public String toString(boolean);
  }

  @Deprecated public abstract class IdentityScope extends java.security.Identity {
    ctor @Deprecated protected IdentityScope();
    ctor @Deprecated public IdentityScope(String);
    ctor @Deprecated public IdentityScope(String, java.security.IdentityScope) throws java.security.KeyManagementException;
    method @Deprecated public abstract void addIdentity(java.security.Identity) throws java.security.KeyManagementException;
    method @Deprecated public abstract java.security.Identity getIdentity(String);
    method @Deprecated public java.security.Identity getIdentity(java.security.Principal);
    method @Deprecated public abstract java.security.Identity getIdentity(java.security.PublicKey);
    method @Deprecated public static java.security.IdentityScope getSystemScope();
    method @Deprecated public abstract java.util.Enumeration<java.security.Identity> identities();
    method @Deprecated public abstract void removeIdentity(java.security.Identity) throws java.security.KeyManagementException;
    method @Deprecated protected static void setSystemScope(java.security.IdentityScope);
    method @Deprecated public abstract int size();
  }

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

  public class InvalidKeyException extends java.security.KeyException {
    ctor public InvalidKeyException();
    ctor public InvalidKeyException(String);
    ctor public InvalidKeyException(String, Throwable);
    ctor public InvalidKeyException(Throwable);
  }

  public class InvalidParameterException extends java.lang.IllegalArgumentException {
    ctor public InvalidParameterException();
    ctor public InvalidParameterException(String);
  }

  public interface Key extends java.io.Serializable {
    method public String getAlgorithm();
    method public byte[] getEncoded();
    method public String getFormat();
    field public static final long serialVersionUID = 6603384152749567654L; // 0x5ba3eee69414eea6L
  }

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

  public class KeyFactory {
    ctor protected KeyFactory(java.security.KeyFactorySpi, java.security.Provider, String);
    method public final java.security.PrivateKey generatePrivate(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
    method public final java.security.PublicKey generatePublic(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
    method public final String getAlgorithm();
    method public static java.security.KeyFactory getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.KeyFactory getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.KeyFactory getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final <T extends java.security.spec.KeySpec> T getKeySpec(java.security.Key, Class<T>) throws java.security.spec.InvalidKeySpecException;
    method public final java.security.Provider getProvider();
    method public final java.security.Key translateKey(java.security.Key) throws java.security.InvalidKeyException;
  }

  public abstract class KeyFactorySpi {
    ctor public KeyFactorySpi();
    method protected abstract java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
    method protected abstract java.security.PublicKey engineGeneratePublic(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
    method protected abstract <T extends java.security.spec.KeySpec> T engineGetKeySpec(java.security.Key, Class<T>) throws java.security.spec.InvalidKeySpecException;
    method protected abstract java.security.Key engineTranslateKey(java.security.Key) throws java.security.InvalidKeyException;
  }

  public class KeyManagementException extends java.security.KeyException {
    ctor public KeyManagementException();
    ctor public KeyManagementException(String);
    ctor public KeyManagementException(String, Throwable);
    ctor public KeyManagementException(Throwable);
  }

  public final class KeyPair implements java.io.Serializable {
    ctor public KeyPair(java.security.PublicKey, java.security.PrivateKey);
    method public java.security.PrivateKey getPrivate();
    method public java.security.PublicKey getPublic();
  }

  public abstract class KeyPairGenerator extends java.security.KeyPairGeneratorSpi {
    ctor protected KeyPairGenerator(String);
    method public final java.security.KeyPair genKeyPair();
    method public java.security.KeyPair generateKeyPair();
    method public String getAlgorithm();
    method public static java.security.KeyPairGenerator getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.KeyPairGenerator getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.KeyPairGenerator getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final java.security.Provider getProvider();
    method public void initialize(int);
    method public void initialize(int, java.security.SecureRandom);
    method public void initialize(java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException;
  }

  public abstract class KeyPairGeneratorSpi {
    ctor public KeyPairGeneratorSpi();
    method public abstract java.security.KeyPair generateKeyPair();
    method public abstract void initialize(int, java.security.SecureRandom);
    method public void initialize(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException;
  }

  public class KeyRep implements java.io.Serializable {
    ctor public KeyRep(java.security.KeyRep.Type, String, String, byte[]);
    method protected Object readResolve() throws java.io.ObjectStreamException;
  }

  public enum KeyRep.Type {
    enum_constant public static final java.security.KeyRep.Type PRIVATE;
    enum_constant public static final java.security.KeyRep.Type PUBLIC;
    enum_constant public static final java.security.KeyRep.Type SECRET;
  }

  public class KeyStore {
    ctor protected KeyStore(java.security.KeyStoreSpi, java.security.Provider, String);
    method public final java.util.Enumeration<java.lang.String> aliases() throws java.security.KeyStoreException;
    method public final boolean containsAlias(String) throws java.security.KeyStoreException;
    method public final void deleteEntry(String) throws java.security.KeyStoreException;
    method public final boolean entryInstanceOf(String, Class<? extends java.security.KeyStore.Entry>) throws java.security.KeyStoreException;
    method public final java.security.cert.Certificate getCertificate(String) throws java.security.KeyStoreException;
    method public final String getCertificateAlias(java.security.cert.Certificate) throws java.security.KeyStoreException;
    method public final java.security.cert.Certificate[] getCertificateChain(String) throws java.security.KeyStoreException;
    method public final java.util.Date getCreationDate(String) throws java.security.KeyStoreException;
    method public static final String getDefaultType();
    method public final java.security.KeyStore.Entry getEntry(String, java.security.KeyStore.ProtectionParameter) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableEntryException;
    method public static java.security.KeyStore getInstance(String) throws java.security.KeyStoreException;
    method public static java.security.KeyStore getInstance(String, String) throws java.security.KeyStoreException, java.security.NoSuchProviderException;
    method public static java.security.KeyStore getInstance(String, java.security.Provider) throws java.security.KeyStoreException;
    method public final java.security.Key getKey(String, char[]) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    method public final java.security.Provider getProvider();
    method public final String getType();
    method public final boolean isCertificateEntry(String) throws java.security.KeyStoreException;
    method public final boolean isKeyEntry(String) throws java.security.KeyStoreException;
    method public final void load(java.io.InputStream, char[]) throws java.security.cert.CertificateException, java.io.IOException, java.security.NoSuchAlgorithmException;
    method public final void load(java.security.KeyStore.LoadStoreParameter) throws java.security.cert.CertificateException, java.io.IOException, java.security.NoSuchAlgorithmException;
    method public final void setCertificateEntry(String, java.security.cert.Certificate) throws java.security.KeyStoreException;
    method public final void setEntry(String, java.security.KeyStore.Entry, java.security.KeyStore.ProtectionParameter) throws java.security.KeyStoreException;
    method public final void setKeyEntry(String, java.security.Key, char[], java.security.cert.Certificate[]) throws java.security.KeyStoreException;
    method public final void setKeyEntry(String, byte[], java.security.cert.Certificate[]) throws java.security.KeyStoreException;
    method public final int size() throws java.security.KeyStoreException;
    method public final void store(java.io.OutputStream, char[]) throws java.security.cert.CertificateException, java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException;
    method public final void store(java.security.KeyStore.LoadStoreParameter) throws java.security.cert.CertificateException, java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException;
  }

  public abstract static class KeyStore.Builder {
    ctor protected KeyStore.Builder();
    method public abstract java.security.KeyStore getKeyStore() throws java.security.KeyStoreException;
    method public abstract java.security.KeyStore.ProtectionParameter getProtectionParameter(String) throws java.security.KeyStoreException;
    method public static java.security.KeyStore.Builder newInstance(java.security.KeyStore, java.security.KeyStore.ProtectionParameter);
    method public static java.security.KeyStore.Builder newInstance(String, java.security.Provider, java.io.File, java.security.KeyStore.ProtectionParameter);
    method public static java.security.KeyStore.Builder newInstance(String, java.security.Provider, java.security.KeyStore.ProtectionParameter);
  }

  public static class KeyStore.CallbackHandlerProtection implements java.security.KeyStore.ProtectionParameter {
    ctor public KeyStore.CallbackHandlerProtection(javax.security.auth.callback.CallbackHandler);
    method public javax.security.auth.callback.CallbackHandler getCallbackHandler();
  }

  public static interface KeyStore.Entry {
    method public default java.util.Set<java.security.KeyStore.Entry.Attribute> getAttributes();
  }

  public static interface KeyStore.Entry.Attribute {
    method public String getName();
    method public String getValue();
  }

  public static interface KeyStore.LoadStoreParameter {
    method public java.security.KeyStore.ProtectionParameter getProtectionParameter();
  }

  public static class KeyStore.PasswordProtection implements javax.security.auth.Destroyable java.security.KeyStore.ProtectionParameter {
    ctor public KeyStore.PasswordProtection(char[]);
    ctor public KeyStore.PasswordProtection(char[], String, java.security.spec.AlgorithmParameterSpec);
    method public char[] getPassword();
    method public String getProtectionAlgorithm();
    method public java.security.spec.AlgorithmParameterSpec getProtectionParameters();
  }

  public static final class KeyStore.PrivateKeyEntry implements java.security.KeyStore.Entry {
    ctor public KeyStore.PrivateKeyEntry(java.security.PrivateKey, java.security.cert.Certificate[]);
    ctor public KeyStore.PrivateKeyEntry(java.security.PrivateKey, java.security.cert.Certificate[], java.util.Set<java.security.KeyStore.Entry.Attribute>);
    method public java.security.cert.Certificate getCertificate();
    method public java.security.cert.Certificate[] getCertificateChain();
    method public java.security.PrivateKey getPrivateKey();
  }

  public static interface KeyStore.ProtectionParameter {
  }

  public static final class KeyStore.SecretKeyEntry implements java.security.KeyStore.Entry {
    ctor public KeyStore.SecretKeyEntry(javax.crypto.SecretKey);
    ctor public KeyStore.SecretKeyEntry(javax.crypto.SecretKey, java.util.Set<java.security.KeyStore.Entry.Attribute>);
    method public javax.crypto.SecretKey getSecretKey();
  }

  public static final class KeyStore.TrustedCertificateEntry implements java.security.KeyStore.Entry {
    ctor public KeyStore.TrustedCertificateEntry(java.security.cert.Certificate);
    ctor public KeyStore.TrustedCertificateEntry(java.security.cert.Certificate, java.util.Set<java.security.KeyStore.Entry.Attribute>);
    method public java.security.cert.Certificate getTrustedCertificate();
  }

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

  public abstract class KeyStoreSpi {
    ctor public KeyStoreSpi();
    method public abstract java.util.Enumeration<java.lang.String> engineAliases();
    method public abstract boolean engineContainsAlias(String);
    method public abstract void engineDeleteEntry(String) throws java.security.KeyStoreException;
    method public boolean engineEntryInstanceOf(String, Class<? extends java.security.KeyStore.Entry>);
    method public abstract java.security.cert.Certificate engineGetCertificate(String);
    method public abstract String engineGetCertificateAlias(java.security.cert.Certificate);
    method public abstract java.security.cert.Certificate[] engineGetCertificateChain(String);
    method public abstract java.util.Date engineGetCreationDate(String);
    method public java.security.KeyStore.Entry engineGetEntry(String, java.security.KeyStore.ProtectionParameter) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableEntryException;
    method public abstract java.security.Key engineGetKey(String, char[]) throws java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    method public abstract boolean engineIsCertificateEntry(String);
    method public abstract boolean engineIsKeyEntry(String);
    method public abstract void engineLoad(java.io.InputStream, char[]) throws java.security.cert.CertificateException, java.io.IOException, java.security.NoSuchAlgorithmException;
    method public void engineLoad(java.security.KeyStore.LoadStoreParameter) throws java.security.cert.CertificateException, java.io.IOException, java.security.NoSuchAlgorithmException;
    method public abstract void engineSetCertificateEntry(String, java.security.cert.Certificate) throws java.security.KeyStoreException;
    method public void engineSetEntry(String, java.security.KeyStore.Entry, java.security.KeyStore.ProtectionParameter) throws java.security.KeyStoreException;
    method public abstract void engineSetKeyEntry(String, java.security.Key, char[], java.security.cert.Certificate[]) throws java.security.KeyStoreException;
    method public abstract void engineSetKeyEntry(String, byte[], java.security.cert.Certificate[]) throws java.security.KeyStoreException;
    method public abstract int engineSize();
    method public abstract void engineStore(java.io.OutputStream, char[]) throws java.security.cert.CertificateException, java.io.IOException, java.security.NoSuchAlgorithmException;
    method public void engineStore(java.security.KeyStore.LoadStoreParameter) throws java.security.cert.CertificateException, java.io.IOException, java.security.NoSuchAlgorithmException;
  }

  public abstract class MessageDigest extends java.security.MessageDigestSpi {
    ctor protected MessageDigest(@NonNull String);
    method @NonNull public byte[] digest();
    method public int digest(@NonNull byte[], int, int) throws java.security.DigestException;
    method @NonNull public byte[] digest(@NonNull byte[]);
    method @NonNull public final String getAlgorithm();
    method public final int getDigestLength();
    method @NonNull public static java.security.MessageDigest getInstance(@NonNull String) throws java.security.NoSuchAlgorithmException;
    method @NonNull public static java.security.MessageDigest getInstance(@NonNull String, @NonNull String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method @NonNull public static java.security.MessageDigest getInstance(@NonNull String, @NonNull java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method @NonNull public final java.security.Provider getProvider();
    method public static boolean isEqual(@Nullable byte[], @Nullable byte[]);
    method public void reset();
    method public void update(byte);
    method public void update(@NonNull byte[], int, int);
    method public void update(@NonNull byte[]);
    method public final void update(@NonNull java.nio.ByteBuffer);
  }

  public abstract class MessageDigestSpi {
    ctor public MessageDigestSpi();
    method public Object clone() throws java.lang.CloneNotSupportedException;
    method protected abstract byte[] engineDigest();
    method protected int engineDigest(byte[], int, int) throws java.security.DigestException;
    method protected int engineGetDigestLength();
    method protected abstract void engineReset();
    method protected abstract void engineUpdate(byte);
    method protected abstract void engineUpdate(byte[], int, int);
    method protected void engineUpdate(java.nio.ByteBuffer);
  }

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

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

  public final class PKCS12Attribute implements java.security.KeyStore.Entry.Attribute {
    ctor public PKCS12Attribute(String, String);
    ctor public PKCS12Attribute(byte[]);
    method public byte[] getEncoded();
    method public String getName();
    method public String getValue();
  }

  public abstract class Permission implements java.security.Guard java.io.Serializable {
    ctor public Permission(String);
    method public void checkGuard(Object) throws java.lang.SecurityException;
    method public abstract String getActions();
    method public final String getName();
    method public abstract boolean implies(java.security.Permission);
    method public java.security.PermissionCollection newPermissionCollection();
  }

  public abstract class PermissionCollection implements java.io.Serializable {
    ctor public PermissionCollection();
    method public abstract void add(java.security.Permission);
    method public abstract java.util.Enumeration<java.security.Permission> elements();
    method public abstract boolean implies(java.security.Permission);
    method public boolean isReadOnly();
    method public void setReadOnly();
  }

  public final class Permissions extends java.security.PermissionCollection implements java.io.Serializable {
    ctor public Permissions();
    method public void add(java.security.Permission);
    method public java.util.Enumeration<java.security.Permission> elements();
    method public boolean implies(java.security.Permission);
  }

  public abstract class Policy {
    ctor public Policy();
    method public static java.security.Policy getInstance(String, java.security.Policy.Parameters) throws java.security.NoSuchAlgorithmException;
    method public static java.security.Policy getInstance(String, java.security.Policy.Parameters, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.Policy getInstance(String, java.security.Policy.Parameters, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public java.security.Policy.Parameters getParameters();
    method public java.security.PermissionCollection getPermissions(java.security.CodeSource);
    method public java.security.PermissionCollection getPermissions(java.security.ProtectionDomain);
    method public static java.security.Policy getPolicy();
    method public java.security.Provider getProvider();
    method public String getType();
    method public boolean implies(java.security.ProtectionDomain, java.security.Permission);
    method public void refresh();
    method public static void setPolicy(java.security.Policy);
    field public static final java.security.PermissionCollection UNSUPPORTED_EMPTY_COLLECTION;
  }

  public static interface Policy.Parameters {
  }

  public abstract class PolicySpi {
    ctor public PolicySpi();
    method protected java.security.PermissionCollection engineGetPermissions(java.security.CodeSource);
    method protected java.security.PermissionCollection engineGetPermissions(java.security.ProtectionDomain);
    method protected abstract boolean engineImplies(java.security.ProtectionDomain, java.security.Permission);
    method protected void engineRefresh();
  }

  public interface Principal {
    method public boolean equals(Object);
    method public String getName();
    method public int hashCode();
    method public default boolean implies(javax.security.auth.Subject);
    method public String toString();
  }

  public interface PrivateKey extends java.security.Key javax.security.auth.Destroyable {
    field public static final long serialVersionUID = 6034044314589513430L; // 0x53bd3b559a12c6d6L
  }

  public interface PrivilegedAction<T> {
    method public T run();
  }

  public class PrivilegedActionException extends java.lang.Exception {
    ctor public PrivilegedActionException(Exception);
    method public Exception getException();
  }

  public interface PrivilegedExceptionAction<T> {
    method public T run() throws java.lang.Exception;
  }

  public class ProtectionDomain {
    ctor public ProtectionDomain(java.security.CodeSource, java.security.PermissionCollection);
    ctor public ProtectionDomain(java.security.CodeSource, java.security.PermissionCollection, ClassLoader, java.security.Principal[]);
    method public final ClassLoader getClassLoader();
    method public final java.security.CodeSource getCodeSource();
    method public final java.security.PermissionCollection getPermissions();
    method public final java.security.Principal[] getPrincipals();
    method public boolean implies(java.security.Permission);
  }

  public abstract class Provider extends java.util.Properties {
    ctor protected Provider(String, double, String);
    method public Object compute(Object, java.util.function.BiFunction<? super java.lang.Object,? super java.lang.Object,?>);
    method public Object computeIfAbsent(Object, java.util.function.Function<? super java.lang.Object,?>);
    method public Object computeIfPresent(Object, java.util.function.BiFunction<? super java.lang.Object,? super java.lang.Object,?>);
    method public java.util.Enumeration<java.lang.Object> elements();
    method public java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> entrySet();
    method public void forEach(java.util.function.BiConsumer<? super java.lang.Object,? super java.lang.Object>);
    method public Object get(Object);
    method public String getInfo();
    method public String getName();
    method public Object getOrDefault(Object, Object);
    method public java.security.Provider.Service getService(String, String);
    method public java.util.Set<java.security.Provider.Service> getServices();
    method public double getVersion();
    method public java.util.Set<java.lang.Object> keySet();
    method public java.util.Enumeration<java.lang.Object> keys();
    method public Object merge(Object, Object, java.util.function.BiFunction<? super java.lang.Object,? super java.lang.Object,?>);
    method public Object put(Object, Object);
    method public void putAll(java.util.Map<?,?>);
    method public Object putIfAbsent(Object, Object);
    method protected void putService(java.security.Provider.Service);
    method public Object remove(Object);
    method protected void removeService(java.security.Provider.Service);
    method public boolean replace(Object, Object, Object);
    method public Object replace(Object, Object);
    method public void replaceAll(java.util.function.BiFunction<? super java.lang.Object,? super java.lang.Object,?>);
    method public java.util.Collection<java.lang.Object> values();
  }

  public static class Provider.Service {
    ctor public Provider.Service(java.security.Provider, String, String, String, java.util.List<java.lang.String>, java.util.Map<java.lang.String,java.lang.String>);
    method public final String getAlgorithm();
    method public final String getAttribute(String);
    method public final String getClassName();
    method public final java.security.Provider getProvider();
    method public final String getType();
    method public Object newInstance(Object) throws java.security.NoSuchAlgorithmException;
    method public boolean supportsParameter(Object);
  }

  public class ProviderException extends java.lang.RuntimeException {
    ctor public ProviderException();
    ctor public ProviderException(String);
    ctor public ProviderException(String, Throwable);
    ctor public ProviderException(Throwable);
  }

  public interface PublicKey extends java.security.Key {
    field public static final long serialVersionUID = 7187392471159151072L; // 0x63bebf5f40c219e0L
  }

  public class SecureClassLoader extends java.lang.ClassLoader {
    ctor protected SecureClassLoader(ClassLoader);
    ctor protected SecureClassLoader();
    method protected final Class<?> defineClass(String, byte[], int, int, java.security.CodeSource);
    method protected final Class<?> defineClass(String, java.nio.ByteBuffer, java.security.CodeSource);
    method protected java.security.PermissionCollection getPermissions(java.security.CodeSource);
  }

  public class SecureRandom extends java.util.Random {
    ctor public SecureRandom();
    ctor public SecureRandom(byte[]);
    ctor protected SecureRandom(java.security.SecureRandomSpi, java.security.Provider);
    method public byte[] generateSeed(int);
    method public String getAlgorithm();
    method public static java.security.SecureRandom getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.SecureRandom getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.SecureRandom getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public static java.security.SecureRandom getInstanceStrong() throws java.security.NoSuchAlgorithmException;
    method public final java.security.Provider getProvider();
    method public static byte[] getSeed(int);
    method protected final int next(int);
    method public void setSeed(byte[]);
  }

  public abstract class SecureRandomSpi implements java.io.Serializable {
    ctor public SecureRandomSpi();
    method protected abstract byte[] engineGenerateSeed(int);
    method protected abstract void engineNextBytes(byte[]);
    method protected abstract void engineSetSeed(byte[]);
  }

  public final class Security {
    method public static int addProvider(java.security.Provider);
    method @Deprecated public static String getAlgorithmProperty(String, String);
    method public static java.util.Set<java.lang.String> getAlgorithms(String);
    method public static String getProperty(String);
    method public static java.security.Provider getProvider(String);
    method public static java.security.Provider[] getProviders();
    method public static java.security.Provider[] getProviders(String);
    method public static java.security.Provider[] getProviders(java.util.Map<java.lang.String,java.lang.String>);
    method public static int insertProviderAt(java.security.Provider, int);
    method public static void removeProvider(String);
    method public static void setProperty(String, String);
  }

  public final class SecurityPermission extends java.security.BasicPermission {
    ctor public SecurityPermission(String);
    ctor public SecurityPermission(String, String);
  }

  public abstract class Signature extends java.security.SignatureSpi {
    ctor protected Signature(String);
    method public final String getAlgorithm();
    method public static java.security.Signature getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.Signature getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.Signature getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method @Deprecated public final Object getParameter(String) throws java.security.InvalidParameterException;
    method public final java.security.AlgorithmParameters getParameters();
    method public final java.security.Provider getProvider();
    method public final void initSign(java.security.PrivateKey) throws java.security.InvalidKeyException;
    method public final void initSign(java.security.PrivateKey, java.security.SecureRandom) throws java.security.InvalidKeyException;
    method public final void initVerify(java.security.PublicKey) throws java.security.InvalidKeyException;
    method public final void initVerify(java.security.cert.Certificate) throws java.security.InvalidKeyException;
    method @Deprecated public final void setParameter(String, Object) throws java.security.InvalidParameterException;
    method public final void setParameter(java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException;
    method public final byte[] sign() throws java.security.SignatureException;
    method public final int sign(byte[], int, int) throws java.security.SignatureException;
    method public final void update(byte) throws java.security.SignatureException;
    method public final void update(byte[]) throws java.security.SignatureException;
    method public final void update(byte[], int, int) throws java.security.SignatureException;
    method public final void update(java.nio.ByteBuffer) throws java.security.SignatureException;
    method public final boolean verify(byte[]) throws java.security.SignatureException;
    method public final boolean verify(byte[], int, int) throws java.security.SignatureException;
    field protected static final int SIGN = 2; // 0x2
    field protected static final int UNINITIALIZED = 0; // 0x0
    field protected static final int VERIFY = 3; // 0x3
    field protected int state;
  }

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

  public abstract class SignatureSpi {
    ctor public SignatureSpi();
    method public Object clone() throws java.lang.CloneNotSupportedException;
    method @Deprecated protected abstract Object engineGetParameter(String) throws java.security.InvalidParameterException;
    method protected java.security.AlgorithmParameters engineGetParameters();
    method protected abstract void engineInitSign(java.security.PrivateKey) throws java.security.InvalidKeyException;
    method protected void engineInitSign(java.security.PrivateKey, java.security.SecureRandom) throws java.security.InvalidKeyException;
    method protected abstract void engineInitVerify(java.security.PublicKey) throws java.security.InvalidKeyException;
    method @Deprecated protected abstract void engineSetParameter(String, Object) throws java.security.InvalidParameterException;
    method protected void engineSetParameter(java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException;
    method protected abstract byte[] engineSign() throws java.security.SignatureException;
    method protected int engineSign(byte[], int, int) throws java.security.SignatureException;
    method protected abstract void engineUpdate(byte) throws java.security.SignatureException;
    method protected abstract void engineUpdate(byte[], int, int) throws java.security.SignatureException;
    method protected void engineUpdate(java.nio.ByteBuffer);
    method protected abstract boolean engineVerify(byte[]) throws java.security.SignatureException;
    method protected boolean engineVerify(byte[], int, int) throws java.security.SignatureException;
    field protected java.security.SecureRandom appRandom;
  }

  public final class SignedObject implements java.io.Serializable {
    ctor public SignedObject(java.io.Serializable, java.security.PrivateKey, java.security.Signature) throws java.io.IOException, java.security.InvalidKeyException, java.security.SignatureException;
    method public String getAlgorithm();
    method public Object getObject() throws java.lang.ClassNotFoundException, java.io.IOException;
    method public byte[] getSignature();
    method public boolean verify(java.security.PublicKey, java.security.Signature) throws java.security.InvalidKeyException, java.security.SignatureException;
  }

  @Deprecated public abstract class Signer extends java.security.Identity {
    ctor @Deprecated protected Signer();
    ctor @Deprecated public Signer(String);
    ctor @Deprecated public Signer(String, java.security.IdentityScope) throws java.security.KeyManagementException;
    method @Deprecated public java.security.PrivateKey getPrivateKey();
    method @Deprecated public final void setKeyPair(java.security.KeyPair) throws java.security.InvalidParameterException, java.security.KeyException;
  }

  public final class Timestamp implements java.io.Serializable {
    ctor public Timestamp(java.util.Date, java.security.cert.CertPath);
    method public java.security.cert.CertPath getSignerCertPath();
    method public java.util.Date getTimestamp();
  }

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

  public class UnrecoverableKeyException extends java.security.UnrecoverableEntryException {
    ctor public UnrecoverableKeyException();
    ctor public UnrecoverableKeyException(String);
  }

  public final class UnresolvedPermission extends java.security.Permission implements java.io.Serializable {
    ctor public UnresolvedPermission(String, String, String, java.security.cert.Certificate[]);
    method public String getActions();
    method public String getUnresolvedActions();
    method public java.security.cert.Certificate[] getUnresolvedCerts();
    method public String getUnresolvedName();
    method public String getUnresolvedType();
    method public boolean implies(java.security.Permission);
  }

}

package java.security.acl {

  public interface Acl extends java.security.acl.Owner {
    method public boolean addEntry(java.security.Principal, java.security.acl.AclEntry) throws java.security.acl.NotOwnerException;
    method public boolean checkPermission(java.security.Principal, java.security.acl.Permission);
    method public java.util.Enumeration<java.security.acl.AclEntry> entries();
    method public String getName();
    method public java.util.Enumeration<java.security.acl.Permission> getPermissions(java.security.Principal);
    method public boolean removeEntry(java.security.Principal, java.security.acl.AclEntry) throws java.security.acl.NotOwnerException;
    method public void setName(java.security.Principal, String) throws java.security.acl.NotOwnerException;
    method public String toString();
  }

  public interface AclEntry extends java.lang.Cloneable {
    method public boolean addPermission(java.security.acl.Permission);
    method public boolean checkPermission(java.security.acl.Permission);
    method public Object clone();
    method public java.security.Principal getPrincipal();
    method public boolean isNegative();
    method public java.util.Enumeration<java.security.acl.Permission> permissions();
    method public boolean removePermission(java.security.acl.Permission);
    method public void setNegativePermissions();
    method public boolean setPrincipal(java.security.Principal);
    method public String toString();
  }

  public class AclNotFoundException extends java.lang.Exception {
    ctor public AclNotFoundException();
  }

  public interface Group extends java.security.Principal {
    method public boolean addMember(java.security.Principal);
    method public boolean isMember(java.security.Principal);
    method public java.util.Enumeration<? extends java.security.Principal> members();
    method public boolean removeMember(java.security.Principal);
  }

  public class LastOwnerException extends java.lang.Exception {
    ctor public LastOwnerException();
  }

  public class NotOwnerException extends java.lang.Exception {
    ctor public NotOwnerException();
  }

  public interface Owner {
    method public boolean addOwner(java.security.Principal, java.security.Principal) throws java.security.acl.NotOwnerException;
    method public boolean deleteOwner(java.security.Principal, java.security.Principal) throws java.security.acl.LastOwnerException, java.security.acl.NotOwnerException;
    method public boolean isOwner(java.security.Principal);
  }

  public interface Permission {
  }

}

package java.security.cert {

  public abstract class CRL {
    ctor protected CRL(String);
    method public final String getType();
    method public abstract boolean isRevoked(java.security.cert.Certificate);
    method public abstract String toString();
  }

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

  public enum CRLReason {
    enum_constant public static final java.security.cert.CRLReason AA_COMPROMISE;
    enum_constant public static final java.security.cert.CRLReason AFFILIATION_CHANGED;
    enum_constant public static final java.security.cert.CRLReason CA_COMPROMISE;
    enum_constant public static final java.security.cert.CRLReason CERTIFICATE_HOLD;
    enum_constant public static final java.security.cert.CRLReason CESSATION_OF_OPERATION;
    enum_constant public static final java.security.cert.CRLReason KEY_COMPROMISE;
    enum_constant public static final java.security.cert.CRLReason PRIVILEGE_WITHDRAWN;
    enum_constant public static final java.security.cert.CRLReason REMOVE_FROM_CRL;
    enum_constant public static final java.security.cert.CRLReason SUPERSEDED;
    enum_constant public static final java.security.cert.CRLReason UNSPECIFIED;
    enum_constant public static final java.security.cert.CRLReason UNUSED;
  }

  public interface CRLSelector extends java.lang.Cloneable {
    method public Object clone();
    method public boolean match(java.security.cert.CRL);
  }

  public abstract class CertPath implements java.io.Serializable {
    ctor protected CertPath(String);
    method public abstract java.util.List<? extends java.security.cert.Certificate> getCertificates();
    method public abstract byte[] getEncoded() throws java.security.cert.CertificateEncodingException;
    method public abstract byte[] getEncoded(String) throws java.security.cert.CertificateEncodingException;
    method public abstract java.util.Iterator<java.lang.String> getEncodings();
    method public String getType();
    method protected Object writeReplace() throws java.io.ObjectStreamException;
  }

  protected static class CertPath.CertPathRep implements java.io.Serializable {
    ctor protected CertPath.CertPathRep(String, byte[]);
    method protected Object readResolve() throws java.io.ObjectStreamException;
  }

  public class CertPathBuilder {
    ctor protected CertPathBuilder(java.security.cert.CertPathBuilderSpi, java.security.Provider, String);
    method public final java.security.cert.CertPathBuilderResult build(java.security.cert.CertPathParameters) throws java.security.cert.CertPathBuilderException, java.security.InvalidAlgorithmParameterException;
    method public final String getAlgorithm();
    method public static final String getDefaultType();
    method public static java.security.cert.CertPathBuilder getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.cert.CertPathBuilder getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.cert.CertPathBuilder getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final java.security.Provider getProvider();
    method public final java.security.cert.CertPathChecker getRevocationChecker();
  }

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

  public interface CertPathBuilderResult extends java.lang.Cloneable {
    method public Object clone();
    method public java.security.cert.CertPath getCertPath();
  }

  public abstract class CertPathBuilderSpi {
    ctor public CertPathBuilderSpi();
    method public abstract java.security.cert.CertPathBuilderResult engineBuild(java.security.cert.CertPathParameters) throws java.security.cert.CertPathBuilderException, java.security.InvalidAlgorithmParameterException;
    method public java.security.cert.CertPathChecker engineGetRevocationChecker();
  }

  public interface CertPathChecker {
    method public void check(java.security.cert.Certificate) throws java.security.cert.CertPathValidatorException;
    method public void init(boolean) throws java.security.cert.CertPathValidatorException;
    method public boolean isForwardCheckingSupported();
  }

  public interface CertPathParameters extends java.lang.Cloneable {
    method public Object clone();
  }

  public class CertPathValidator {
    ctor protected CertPathValidator(java.security.cert.CertPathValidatorSpi, java.security.Provider, String);
    method public final String getAlgorithm();
    method public static final String getDefaultType();
    method public static java.security.cert.CertPathValidator getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.cert.CertPathValidator getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.cert.CertPathValidator getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final java.security.Provider getProvider();
    method public final java.security.cert.CertPathChecker getRevocationChecker();
    method public final java.security.cert.CertPathValidatorResult validate(java.security.cert.CertPath, java.security.cert.CertPathParameters) throws java.security.cert.CertPathValidatorException, java.security.InvalidAlgorithmParameterException;
  }

  public class CertPathValidatorException extends java.security.GeneralSecurityException {
    ctor public CertPathValidatorException();
    ctor public CertPathValidatorException(String);
    ctor public CertPathValidatorException(Throwable);
    ctor public CertPathValidatorException(String, Throwable);
    ctor public CertPathValidatorException(String, Throwable, java.security.cert.CertPath, int);
    ctor public CertPathValidatorException(String, Throwable, java.security.cert.CertPath, int, java.security.cert.CertPathValidatorException.Reason);
    method public java.security.cert.CertPath getCertPath();
    method public int getIndex();
    method public java.security.cert.CertPathValidatorException.Reason getReason();
  }

  public enum CertPathValidatorException.BasicReason implements java.security.cert.CertPathValidatorException.Reason {
    enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason ALGORITHM_CONSTRAINED;
    enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason EXPIRED;
    enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason INVALID_SIGNATURE;
    enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason NOT_YET_VALID;
    enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason REVOKED;
    enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason UNDETERMINED_REVOCATION_STATUS;
    enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason UNSPECIFIED;
  }

  public static interface CertPathValidatorException.Reason extends java.io.Serializable {
  }

  public interface CertPathValidatorResult extends java.lang.Cloneable {
    method public Object clone();
  }

  public abstract class CertPathValidatorSpi {
    ctor public CertPathValidatorSpi();
    method public java.security.cert.CertPathChecker engineGetRevocationChecker();
    method public abstract java.security.cert.CertPathValidatorResult engineValidate(java.security.cert.CertPath, java.security.cert.CertPathParameters) throws java.security.cert.CertPathValidatorException, java.security.InvalidAlgorithmParameterException;
  }

  public interface CertSelector extends java.lang.Cloneable {
    method public Object clone();
    method public boolean match(java.security.cert.Certificate);
  }

  public class CertStore {
    ctor protected CertStore(java.security.cert.CertStoreSpi, java.security.Provider, String, java.security.cert.CertStoreParameters);
    method public final java.util.Collection<? extends java.security.cert.CRL> getCRLs(java.security.cert.CRLSelector) throws java.security.cert.CertStoreException;
    method public final java.security.cert.CertStoreParameters getCertStoreParameters();
    method public final java.util.Collection<? extends java.security.cert.Certificate> getCertificates(java.security.cert.CertSelector) throws java.security.cert.CertStoreException;
    method public static final String getDefaultType();
    method public static java.security.cert.CertStore getInstance(String, java.security.cert.CertStoreParameters) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException;
    method public static java.security.cert.CertStore getInstance(String, java.security.cert.CertStoreParameters, String) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.cert.CertStore getInstance(String, java.security.cert.CertStoreParameters, java.security.Provider) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException;
    method public final java.security.Provider getProvider();
    method public final String getType();
  }

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

  public interface CertStoreParameters extends java.lang.Cloneable {
    method public Object clone();
  }

  public abstract class CertStoreSpi {
    ctor public CertStoreSpi(java.security.cert.CertStoreParameters) throws java.security.InvalidAlgorithmParameterException;
    method public abstract java.util.Collection<? extends java.security.cert.CRL> engineGetCRLs(java.security.cert.CRLSelector) throws java.security.cert.CertStoreException;
    method public abstract java.util.Collection<? extends java.security.cert.Certificate> engineGetCertificates(java.security.cert.CertSelector) throws java.security.cert.CertStoreException;
  }

  public abstract class Certificate implements java.io.Serializable {
    ctor protected Certificate(String);
    method public abstract byte[] getEncoded() throws java.security.cert.CertificateEncodingException;
    method public abstract java.security.PublicKey getPublicKey();
    method public final String getType();
    method public abstract String toString();
    method public abstract void verify(java.security.PublicKey) throws java.security.cert.CertificateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException;
    method public abstract void verify(java.security.PublicKey, String) throws java.security.cert.CertificateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException;
    method public void verify(java.security.PublicKey, java.security.Provider) throws java.security.cert.CertificateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.SignatureException;
    method protected Object writeReplace() throws java.io.ObjectStreamException;
  }

  protected static class Certificate.CertificateRep implements java.io.Serializable {
    ctor protected Certificate.CertificateRep(String, byte[]);
    method protected Object readResolve() throws java.io.ObjectStreamException;
  }

  public class CertificateEncodingException extends java.security.cert.CertificateException {
    ctor public CertificateEncodingException();
    ctor public CertificateEncodingException(String);
    ctor public CertificateEncodingException(String, Throwable);
    ctor public CertificateEncodingException(Throwable);
  }

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

  public class CertificateExpiredException extends java.security.cert.CertificateException {
    ctor public CertificateExpiredException();
    ctor public CertificateExpiredException(String);
  }

  public class CertificateFactory {
    ctor protected CertificateFactory(java.security.cert.CertificateFactorySpi, java.security.Provider, String);
    method public final java.security.cert.CRL generateCRL(java.io.InputStream) throws java.security.cert.CRLException;
    method public final java.util.Collection<? extends java.security.cert.CRL> generateCRLs(java.io.InputStream) throws java.security.cert.CRLException;
    method public final java.security.cert.CertPath generateCertPath(java.io.InputStream) throws java.security.cert.CertificateException;
    method public final java.security.cert.CertPath generateCertPath(java.io.InputStream, String) throws java.security.cert.CertificateException;
    method public final java.security.cert.CertPath generateCertPath(java.util.List<? extends java.security.cert.Certificate>) throws java.security.cert.CertificateException;
    method public final java.security.cert.Certificate generateCertificate(java.io.InputStream) throws java.security.cert.CertificateException;
    method public final java.util.Collection<? extends java.security.cert.Certificate> generateCertificates(java.io.InputStream) throws java.security.cert.CertificateException;
    method public final java.util.Iterator<java.lang.String> getCertPathEncodings();
    method public static final java.security.cert.CertificateFactory getInstance(String) throws java.security.cert.CertificateException;
    method public static final java.security.cert.CertificateFactory getInstance(String, String) throws java.security.cert.CertificateException, java.security.NoSuchProviderException;
    method public static final java.security.cert.CertificateFactory getInstance(String, java.security.Provider) throws java.security.cert.CertificateException;
    method public final java.security.Provider getProvider();
    method public final String getType();
  }

  public abstract class CertificateFactorySpi {
    ctor public CertificateFactorySpi();
    method public abstract java.security.cert.CRL engineGenerateCRL(java.io.InputStream) throws java.security.cert.CRLException;
    method public abstract java.util.Collection<? extends java.security.cert.CRL> engineGenerateCRLs(java.io.InputStream) throws java.security.cert.CRLException;
    method public java.security.cert.CertPath engineGenerateCertPath(java.io.InputStream) throws java.security.cert.CertificateException;
    method public java.security.cert.CertPath engineGenerateCertPath(java.io.InputStream, String) throws java.security.cert.CertificateException;
    method public java.security.cert.CertPath engineGenerateCertPath(java.util.List<? extends java.security.cert.Certificate>) throws java.security.cert.CertificateException;
    method public abstract java.security.cert.Certificate engineGenerateCertificate(java.io.InputStream) throws java.security.cert.CertificateException;
    method public abstract java.util.Collection<? extends java.security.cert.Certificate> engineGenerateCertificates(java.io.InputStream) throws java.security.cert.CertificateException;
    method public java.util.Iterator<java.lang.String> engineGetCertPathEncodings();
  }

  public class CertificateNotYetValidException extends java.security.cert.CertificateException {
    ctor public CertificateNotYetValidException();
    ctor public CertificateNotYetValidException(String);
  }

  public class CertificateParsingException extends java.security.cert.CertificateException {
    ctor public CertificateParsingException();
    ctor public CertificateParsingException(String);
    ctor public CertificateParsingException(String, Throwable);
    ctor public CertificateParsingException(Throwable);
  }

  public class CertificateRevokedException extends java.security.cert.CertificateException {
    ctor public CertificateRevokedException(java.util.Date, java.security.cert.CRLReason, javax.security.auth.x500.X500Principal, java.util.Map<java.lang.String,java.security.cert.Extension>);
    method public javax.security.auth.x500.X500Principal getAuthorityName();
    method public java.util.Map<java.lang.String,java.security.cert.Extension> getExtensions();
    method public java.util.Date getInvalidityDate();
    method public java.util.Date getRevocationDate();
    method public java.security.cert.CRLReason getRevocationReason();
  }

  public class CollectionCertStoreParameters implements java.security.cert.CertStoreParameters {
    ctor public CollectionCertStoreParameters(java.util.Collection<?>);
    ctor public CollectionCertStoreParameters();
    method public Object clone();
    method public java.util.Collection<?> getCollection();
  }

  public interface Extension {
    method public void encode(java.io.OutputStream) throws java.io.IOException;
    method public String getId();
    method public byte[] getValue();
    method public boolean isCritical();
  }

  public class LDAPCertStoreParameters implements java.security.cert.CertStoreParameters {
    ctor public LDAPCertStoreParameters(String, int);
    ctor public LDAPCertStoreParameters(String);
    ctor public LDAPCertStoreParameters();
    method public Object clone();
    method public int getPort();
    method public String getServerName();
  }

  public class PKIXBuilderParameters extends java.security.cert.PKIXParameters {
    ctor public PKIXBuilderParameters(java.util.Set<java.security.cert.TrustAnchor>, java.security.cert.CertSelector) throws java.security.InvalidAlgorithmParameterException;
    ctor public PKIXBuilderParameters(java.security.KeyStore, java.security.cert.CertSelector) throws java.security.InvalidAlgorithmParameterException, java.security.KeyStoreException;
    method public int getMaxPathLength();
    method public void setMaxPathLength(int);
  }

  public class PKIXCertPathBuilderResult extends java.security.cert.PKIXCertPathValidatorResult implements java.security.cert.CertPathBuilderResult {
    ctor public PKIXCertPathBuilderResult(java.security.cert.CertPath, java.security.cert.TrustAnchor, java.security.cert.PolicyNode, java.security.PublicKey);
    method public java.security.cert.CertPath getCertPath();
  }

  public abstract class PKIXCertPathChecker implements java.security.cert.CertPathChecker java.lang.Cloneable {
    ctor protected PKIXCertPathChecker();
    method public abstract void check(java.security.cert.Certificate, java.util.Collection<java.lang.String>) throws java.security.cert.CertPathValidatorException;
    method public void check(java.security.cert.Certificate) throws java.security.cert.CertPathValidatorException;
    method public Object clone();
    method public abstract java.util.Set<java.lang.String> getSupportedExtensions();
  }

  public class PKIXCertPathValidatorResult implements java.security.cert.CertPathValidatorResult {
    ctor public PKIXCertPathValidatorResult(java.security.cert.TrustAnchor, java.security.cert.PolicyNode, java.security.PublicKey);
    method public Object clone();
    method public java.security.cert.PolicyNode getPolicyTree();
    method public java.security.PublicKey getPublicKey();
    method public java.security.cert.TrustAnchor getTrustAnchor();
  }

  public class PKIXParameters implements java.security.cert.CertPathParameters {
    ctor public PKIXParameters(java.util.Set<java.security.cert.TrustAnchor>) throws java.security.InvalidAlgorithmParameterException;
    ctor public PKIXParameters(java.security.KeyStore) throws java.security.InvalidAlgorithmParameterException, java.security.KeyStoreException;
    method public void addCertPathChecker(java.security.cert.PKIXCertPathChecker);
    method public void addCertStore(java.security.cert.CertStore);
    method public Object clone();
    method public java.util.List<java.security.cert.PKIXCertPathChecker> getCertPathCheckers();
    method public java.util.List<java.security.cert.CertStore> getCertStores();
    method public java.util.Date getDate();
    method public java.util.Set<java.lang.String> getInitialPolicies();
    method public boolean getPolicyQualifiersRejected();
    method public String getSigProvider();
    method public java.security.cert.CertSelector getTargetCertConstraints();
    method public java.util.Set<java.security.cert.TrustAnchor> getTrustAnchors();
    method public boolean isAnyPolicyInhibited();
    method public boolean isExplicitPolicyRequired();
    method public boolean isPolicyMappingInhibited();
    method public boolean isRevocationEnabled();
    method public void setAnyPolicyInhibited(boolean);
    method public void setCertPathCheckers(java.util.List<java.security.cert.PKIXCertPathChecker>);
    method public void setCertStores(java.util.List<java.security.cert.CertStore>);
    method public void setDate(java.util.Date);
    method public void setExplicitPolicyRequired(boolean);
    method public void setInitialPolicies(java.util.Set<java.lang.String>);
    method public void setPolicyMappingInhibited(boolean);
    method public void setPolicyQualifiersRejected(boolean);
    method public void setRevocationEnabled(boolean);
    method public void setSigProvider(String);
    method public void setTargetCertConstraints(java.security.cert.CertSelector);
    method public void setTrustAnchors(java.util.Set<java.security.cert.TrustAnchor>) throws java.security.InvalidAlgorithmParameterException;
  }

  public enum PKIXReason implements java.security.cert.CertPathValidatorException.Reason {
    enum_constant public static final java.security.cert.PKIXReason INVALID_KEY_USAGE;
    enum_constant public static final java.security.cert.PKIXReason INVALID_NAME;
    enum_constant public static final java.security.cert.PKIXReason INVALID_POLICY;
    enum_constant public static final java.security.cert.PKIXReason NAME_CHAINING;
    enum_constant public static final java.security.cert.PKIXReason NOT_CA_CERT;
    enum_constant public static final java.security.cert.PKIXReason NO_TRUST_ANCHOR;
    enum_constant public static final java.security.cert.PKIXReason PATH_TOO_LONG;
    enum_constant public static final java.security.cert.PKIXReason UNRECOGNIZED_CRIT_EXT;
  }

  public abstract class PKIXRevocationChecker extends java.security.cert.PKIXCertPathChecker {
    ctor protected PKIXRevocationChecker();
    method public java.security.cert.PKIXRevocationChecker clone();
    method public java.util.List<java.security.cert.Extension> getOcspExtensions();
    method public java.net.URI getOcspResponder();
    method public java.security.cert.X509Certificate getOcspResponderCert();
    method public java.util.Map<java.security.cert.X509Certificate,byte[]> getOcspResponses();
    method public java.util.Set<java.security.cert.PKIXRevocationChecker.Option> getOptions();
    method public abstract java.util.List<java.security.cert.CertPathValidatorException> getSoftFailExceptions();
    method public void setOcspExtensions(java.util.List<java.security.cert.Extension>);
    method public void setOcspResponder(java.net.URI);
    method public void setOcspResponderCert(java.security.cert.X509Certificate);
    method public void setOcspResponses(java.util.Map<java.security.cert.X509Certificate,byte[]>);
    method public void setOptions(java.util.Set<java.security.cert.PKIXRevocationChecker.Option>);
  }

  public enum PKIXRevocationChecker.Option {
    enum_constant public static final java.security.cert.PKIXRevocationChecker.Option NO_FALLBACK;
    enum_constant public static final java.security.cert.PKIXRevocationChecker.Option ONLY_END_ENTITY;
    enum_constant public static final java.security.cert.PKIXRevocationChecker.Option PREFER_CRLS;
    enum_constant public static final java.security.cert.PKIXRevocationChecker.Option SOFT_FAIL;
  }

  public interface PolicyNode {
    method public java.util.Iterator<? extends java.security.cert.PolicyNode> getChildren();
    method public int getDepth();
    method public java.util.Set<java.lang.String> getExpectedPolicies();
    method public java.security.cert.PolicyNode getParent();
    method public java.util.Set<? extends java.security.cert.PolicyQualifierInfo> getPolicyQualifiers();
    method public String getValidPolicy();
    method public boolean isCritical();
  }

  public class PolicyQualifierInfo {
    ctor public PolicyQualifierInfo(byte[]) throws java.io.IOException;
    method public final byte[] getEncoded();
    method public final byte[] getPolicyQualifier();
    method public final String getPolicyQualifierId();
  }

  public class TrustAnchor {
    ctor public TrustAnchor(java.security.cert.X509Certificate, byte[]);
    ctor public TrustAnchor(javax.security.auth.x500.X500Principal, java.security.PublicKey, byte[]);
    ctor public TrustAnchor(String, java.security.PublicKey, byte[]);
    method public final javax.security.auth.x500.X500Principal getCA();
    method public final String getCAName();
    method public final java.security.PublicKey getCAPublicKey();
    method public final byte[] getNameConstraints();
    method public final java.security.cert.X509Certificate getTrustedCert();
  }

  public abstract class X509CRL extends java.security.cert.CRL implements java.security.cert.X509Extension {
    ctor protected X509CRL();
    method public abstract byte[] getEncoded() throws java.security.cert.CRLException;
    method public abstract java.security.Principal getIssuerDN();
    method public javax.security.auth.x500.X500Principal getIssuerX500Principal();
    method public abstract java.util.Date getNextUpdate();
    method public abstract java.security.cert.X509CRLEntry getRevokedCertificate(java.math.BigInteger);
    method public java.security.cert.X509CRLEntry getRevokedCertificate(java.security.cert.X509Certificate);
    method public abstract java.util.Set<? extends java.security.cert.X509CRLEntry> getRevokedCertificates();
    method public abstract String getSigAlgName();
    method public abstract String getSigAlgOID();
    method public abstract byte[] getSigAlgParams();
    method public abstract byte[] getSignature();
    method public abstract byte[] getTBSCertList() throws java.security.cert.CRLException;
    method public abstract java.util.Date getThisUpdate();
    method public abstract int getVersion();
    method public abstract void verify(java.security.PublicKey) throws java.security.cert.CRLException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException;
    method public abstract void verify(java.security.PublicKey, String) throws java.security.cert.CRLException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException;
    method public void verify(java.security.PublicKey, java.security.Provider) throws java.security.cert.CRLException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.SignatureException;
  }

  public abstract class X509CRLEntry implements java.security.cert.X509Extension {
    ctor public X509CRLEntry();
    method public javax.security.auth.x500.X500Principal getCertificateIssuer();
    method public abstract byte[] getEncoded() throws java.security.cert.CRLException;
    method public abstract java.util.Date getRevocationDate();
    method public java.security.cert.CRLReason getRevocationReason();
    method public abstract java.math.BigInteger getSerialNumber();
    method public abstract boolean hasExtensions();
    method public abstract String toString();
  }

  public class X509CRLSelector implements java.security.cert.CRLSelector {
    ctor public X509CRLSelector();
    method public void addIssuer(javax.security.auth.x500.X500Principal);
    method public void addIssuerName(String) throws java.io.IOException;
    method public void addIssuerName(byte[]) throws java.io.IOException;
    method public Object clone();
    method public java.security.cert.X509Certificate getCertificateChecking();
    method public java.util.Date getDateAndTime();
    method public java.util.Collection<java.lang.Object> getIssuerNames();
    method public java.util.Collection<javax.security.auth.x500.X500Principal> getIssuers();
    method public java.math.BigInteger getMaxCRL();
    method public java.math.BigInteger getMinCRL();
    method public boolean match(java.security.cert.CRL);
    method public void setCertificateChecking(java.security.cert.X509Certificate);
    method public void setDateAndTime(java.util.Date);
    method public void setIssuerNames(java.util.Collection<?>) throws java.io.IOException;
    method public void setIssuers(java.util.Collection<javax.security.auth.x500.X500Principal>);
    method public void setMaxCRLNumber(java.math.BigInteger);
    method public void setMinCRLNumber(java.math.BigInteger);
  }

  public class X509CertSelector implements java.security.cert.CertSelector {
    ctor public X509CertSelector();
    method public void addPathToName(int, String) throws java.io.IOException;
    method public void addPathToName(int, byte[]) throws java.io.IOException;
    method public void addSubjectAlternativeName(int, String) throws java.io.IOException;
    method public void addSubjectAlternativeName(int, byte[]) throws java.io.IOException;
    method public Object clone();
    method public byte[] getAuthorityKeyIdentifier();
    method public int getBasicConstraints();
    method public java.security.cert.X509Certificate getCertificate();
    method public java.util.Date getCertificateValid();
    method public java.util.Set<java.lang.String> getExtendedKeyUsage();
    method public javax.security.auth.x500.X500Principal getIssuer();
    method public byte[] getIssuerAsBytes() throws java.io.IOException;
    method public String getIssuerAsString();
    method public boolean[] getKeyUsage();
    method public boolean getMatchAllSubjectAltNames();
    method public byte[] getNameConstraints();
    method public java.util.Collection<java.util.List<?>> getPathToNames();
    method public java.util.Set<java.lang.String> getPolicy();
    method public java.util.Date getPrivateKeyValid();
    method public java.math.BigInteger getSerialNumber();
    method public javax.security.auth.x500.X500Principal getSubject();
    method public java.util.Collection<java.util.List<?>> getSubjectAlternativeNames();
    method public byte[] getSubjectAsBytes() throws java.io.IOException;
    method public String getSubjectAsString();
    method public byte[] getSubjectKeyIdentifier();
    method public java.security.PublicKey getSubjectPublicKey();
    method public String getSubjectPublicKeyAlgID();
    method public boolean match(java.security.cert.Certificate);
    method public void setAuthorityKeyIdentifier(byte[]);
    method public void setBasicConstraints(int);
    method public void setCertificate(java.security.cert.X509Certificate);
    method public void setCertificateValid(java.util.Date);
    method public void setExtendedKeyUsage(java.util.Set<java.lang.String>) throws java.io.IOException;
    method public void setIssuer(javax.security.auth.x500.X500Principal);
    method public void setIssuer(String) throws java.io.IOException;
    method public void setIssuer(byte[]) throws java.io.IOException;
    method public void setKeyUsage(boolean[]);
    method public void setMatchAllSubjectAltNames(boolean);
    method public void setNameConstraints(byte[]) throws java.io.IOException;
    method public void setPathToNames(java.util.Collection<java.util.List<?>>) throws java.io.IOException;
    method public void setPolicy(java.util.Set<java.lang.String>) throws java.io.IOException;
    method public void setPrivateKeyValid(java.util.Date);
    method public void setSerialNumber(java.math.BigInteger);
    method public void setSubject(javax.security.auth.x500.X500Principal);
    method public void setSubject(String) throws java.io.IOException;
    method public void setSubject(byte[]) throws java.io.IOException;
    method public void setSubjectAlternativeNames(java.util.Collection<java.util.List<?>>) throws java.io.IOException;
    method public void setSubjectKeyIdentifier(byte[]);
    method public void setSubjectPublicKey(java.security.PublicKey);
    method public void setSubjectPublicKey(byte[]) throws java.io.IOException;
    method public void setSubjectPublicKeyAlgID(String) throws java.io.IOException;
  }

  public abstract class X509Certificate extends java.security.cert.Certificate implements java.security.cert.X509Extension {
    ctor protected X509Certificate();
    method public abstract void checkValidity() throws java.security.cert.CertificateExpiredException, java.security.cert.CertificateNotYetValidException;
    method public abstract void checkValidity(java.util.Date) throws java.security.cert.CertificateExpiredException, java.security.cert.CertificateNotYetValidException;
    method public abstract int getBasicConstraints();
    method public java.util.List<java.lang.String> getExtendedKeyUsage() throws java.security.cert.CertificateParsingException;
    method public java.util.Collection<java.util.List<?>> getIssuerAlternativeNames() throws java.security.cert.CertificateParsingException;
    method public abstract java.security.Principal getIssuerDN();
    method public abstract boolean[] getIssuerUniqueID();
    method public javax.security.auth.x500.X500Principal getIssuerX500Principal();
    method public abstract boolean[] getKeyUsage();
    method public abstract java.util.Date getNotAfter();
    method public abstract java.util.Date getNotBefore();
    method public abstract java.math.BigInteger getSerialNumber();
    method public abstract String getSigAlgName();
    method public abstract String getSigAlgOID();
    method public abstract byte[] getSigAlgParams();
    method public abstract byte[] getSignature();
    method public java.util.Collection<java.util.List<?>> getSubjectAlternativeNames() throws java.security.cert.CertificateParsingException;
    method public abstract java.security.Principal getSubjectDN();
    method public abstract boolean[] getSubjectUniqueID();
    method public javax.security.auth.x500.X500Principal getSubjectX500Principal();
    method public abstract byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException;
    method public abstract int getVersion();
  }

  public interface X509Extension {
    method public java.util.Set<java.lang.String> getCriticalExtensionOIDs();
    method public byte[] getExtensionValue(String);
    method public java.util.Set<java.lang.String> getNonCriticalExtensionOIDs();
    method public boolean hasUnsupportedCriticalExtension();
  }

}

package java.security.interfaces {

  public interface DSAKey {
    method public java.security.interfaces.DSAParams getParams();
  }

  public interface DSAKeyPairGenerator {
    method public void initialize(java.security.interfaces.DSAParams, java.security.SecureRandom) throws java.security.InvalidParameterException;
    method public void initialize(int, boolean, java.security.SecureRandom) throws java.security.InvalidParameterException;
  }

  public interface DSAParams {
    method public java.math.BigInteger getG();
    method public java.math.BigInteger getP();
    method public java.math.BigInteger getQ();
  }

  public interface DSAPrivateKey extends java.security.interfaces.DSAKey java.security.PrivateKey {
    method public java.math.BigInteger getX();
    field public static final long serialVersionUID = 7776497482533790279L; // 0x6bebab423b256247L
  }

  public interface DSAPublicKey extends java.security.interfaces.DSAKey java.security.PublicKey {
    method public java.math.BigInteger getY();
    field public static final long serialVersionUID = 1234526332779022332L; // 0x1121eb28ab28c7fcL
  }

  public interface ECKey {
    method public java.security.spec.ECParameterSpec getParams();
  }

  public interface ECPrivateKey extends java.security.PrivateKey java.security.interfaces.ECKey {
    method public java.math.BigInteger getS();
    field public static final long serialVersionUID = -7896394956925609184L; // 0x926a5e9fa2435b20L
  }

  public interface ECPublicKey extends java.security.PublicKey java.security.interfaces.ECKey {
    method public java.security.spec.ECPoint getW();
    field public static final long serialVersionUID = -3314988629879632826L; // 0xd1fecb679990cc46L
  }

  public interface RSAKey {
    method public java.math.BigInteger getModulus();
  }

  public interface RSAMultiPrimePrivateCrtKey extends java.security.interfaces.RSAPrivateKey {
    method public java.math.BigInteger getCrtCoefficient();
    method public java.security.spec.RSAOtherPrimeInfo[] getOtherPrimeInfo();
    method public java.math.BigInteger getPrimeExponentP();
    method public java.math.BigInteger getPrimeExponentQ();
    method public java.math.BigInteger getPrimeP();
    method public java.math.BigInteger getPrimeQ();
    method public java.math.BigInteger getPublicExponent();
    field public static final long serialVersionUID = 618058533534628008L; // 0x893c8f62dbaf8a8L
  }

  public interface RSAPrivateCrtKey extends java.security.interfaces.RSAPrivateKey {
    method public java.math.BigInteger getCrtCoefficient();
    method public java.math.BigInteger getPrimeExponentP();
    method public java.math.BigInteger getPrimeExponentQ();
    method public java.math.BigInteger getPrimeP();
    method public java.math.BigInteger getPrimeQ();
    method public java.math.BigInteger getPublicExponent();
    field public static final long serialVersionUID = -5682214253527700368L; // 0xb124b83df8d1ec70L
  }

  public interface RSAPrivateKey extends java.security.PrivateKey java.security.interfaces.RSAKey {
    method public java.math.BigInteger getPrivateExponent();
    field public static final long serialVersionUID = 5187144804936595022L; // 0x47fc70b7a8c2364eL
  }

  public interface RSAPublicKey extends java.security.PublicKey java.security.interfaces.RSAKey {
    method public java.math.BigInteger getPublicExponent();
    field public static final long serialVersionUID = -8727434096241101194L; // 0x86e1ecedeceab676L
  }

}

package java.security.spec {

  public interface AlgorithmParameterSpec {
  }

  public class DSAParameterSpec implements java.security.spec.AlgorithmParameterSpec java.security.interfaces.DSAParams {
    ctor public DSAParameterSpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
    method public java.math.BigInteger getG();
    method public java.math.BigInteger getP();
    method public java.math.BigInteger getQ();
  }

  public class DSAPrivateKeySpec implements java.security.spec.KeySpec {
    ctor public DSAPrivateKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
    method public java.math.BigInteger getG();
    method public java.math.BigInteger getP();
    method public java.math.BigInteger getQ();
    method public java.math.BigInteger getX();
  }

  public class DSAPublicKeySpec implements java.security.spec.KeySpec {
    ctor public DSAPublicKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
    method public java.math.BigInteger getG();
    method public java.math.BigInteger getP();
    method public java.math.BigInteger getQ();
    method public java.math.BigInteger getY();
  }

  public interface ECField {
    method public int getFieldSize();
  }

  public class ECFieldF2m implements java.security.spec.ECField {
    ctor public ECFieldF2m(int);
    ctor public ECFieldF2m(int, java.math.BigInteger);
    ctor public ECFieldF2m(int, int[]);
    method public int getFieldSize();
    method public int getM();
    method public int[] getMidTermsOfReductionPolynomial();
    method public java.math.BigInteger getReductionPolynomial();
  }

  public class ECFieldFp implements java.security.spec.ECField {
    ctor public ECFieldFp(java.math.BigInteger);
    method public int getFieldSize();
    method public java.math.BigInteger getP();
  }

  public class ECGenParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public ECGenParameterSpec(String);
    method public String getName();
  }

  public class ECParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public ECParameterSpec(java.security.spec.EllipticCurve, java.security.spec.ECPoint, java.math.BigInteger, int);
    method public int getCofactor();
    method public java.security.spec.EllipticCurve getCurve();
    method public java.security.spec.ECPoint getGenerator();
    method public java.math.BigInteger getOrder();
  }

  public class ECPoint {
    ctor public ECPoint(java.math.BigInteger, java.math.BigInteger);
    method public java.math.BigInteger getAffineX();
    method public java.math.BigInteger getAffineY();
    field public static final java.security.spec.ECPoint POINT_INFINITY;
  }

  public class ECPrivateKeySpec implements java.security.spec.KeySpec {
    ctor public ECPrivateKeySpec(java.math.BigInteger, java.security.spec.ECParameterSpec);
    method public java.security.spec.ECParameterSpec getParams();
    method public java.math.BigInteger getS();
  }

  public class ECPublicKeySpec implements java.security.spec.KeySpec {
    ctor public ECPublicKeySpec(java.security.spec.ECPoint, java.security.spec.ECParameterSpec);
    method public java.security.spec.ECParameterSpec getParams();
    method public java.security.spec.ECPoint getW();
  }

  public class EllipticCurve {
    ctor public EllipticCurve(java.security.spec.ECField, java.math.BigInteger, java.math.BigInteger);
    ctor public EllipticCurve(java.security.spec.ECField, java.math.BigInteger, java.math.BigInteger, byte[]);
    method public java.math.BigInteger getA();
    method public java.math.BigInteger getB();
    method public java.security.spec.ECField getField();
    method public byte[] getSeed();
  }

  public abstract class EncodedKeySpec implements java.security.spec.KeySpec {
    ctor public EncodedKeySpec(byte[]);
    method public byte[] getEncoded();
    method public abstract String getFormat();
  }

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

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

  public interface KeySpec {
  }

  public class MGF1ParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public MGF1ParameterSpec(String);
    method public String getDigestAlgorithm();
    field public static final java.security.spec.MGF1ParameterSpec SHA1;
    field public static final java.security.spec.MGF1ParameterSpec SHA224;
    field public static final java.security.spec.MGF1ParameterSpec SHA256;
    field public static final java.security.spec.MGF1ParameterSpec SHA384;
    field public static final java.security.spec.MGF1ParameterSpec SHA512;
  }

  public class PKCS8EncodedKeySpec extends java.security.spec.EncodedKeySpec {
    ctor public PKCS8EncodedKeySpec(byte[]);
    method public final String getFormat();
  }

  public class PSSParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public PSSParameterSpec(String, String, java.security.spec.AlgorithmParameterSpec, int, int);
    ctor public PSSParameterSpec(int);
    method public String getDigestAlgorithm();
    method public String getMGFAlgorithm();
    method public java.security.spec.AlgorithmParameterSpec getMGFParameters();
    method public int getSaltLength();
    method public int getTrailerField();
    field public static final java.security.spec.PSSParameterSpec DEFAULT;
  }

  public class RSAKeyGenParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public RSAKeyGenParameterSpec(int, java.math.BigInteger);
    method public int getKeysize();
    method public java.math.BigInteger getPublicExponent();
    field public static final java.math.BigInteger F0;
    field public static final java.math.BigInteger F4;
  }

  public class RSAMultiPrimePrivateCrtKeySpec extends java.security.spec.RSAPrivateKeySpec {
    ctor public RSAMultiPrimePrivateCrtKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.security.spec.RSAOtherPrimeInfo[]);
    method public java.math.BigInteger getCrtCoefficient();
    method public java.security.spec.RSAOtherPrimeInfo[] getOtherPrimeInfo();
    method public java.math.BigInteger getPrimeExponentP();
    method public java.math.BigInteger getPrimeExponentQ();
    method public java.math.BigInteger getPrimeP();
    method public java.math.BigInteger getPrimeQ();
    method public java.math.BigInteger getPublicExponent();
  }

  public class RSAOtherPrimeInfo {
    ctor public RSAOtherPrimeInfo(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
    method public final java.math.BigInteger getCrtCoefficient();
    method public final java.math.BigInteger getExponent();
    method public final java.math.BigInteger getPrime();
  }

  public class RSAPrivateCrtKeySpec extends java.security.spec.RSAPrivateKeySpec {
    ctor public RSAPrivateCrtKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
    method public java.math.BigInteger getCrtCoefficient();
    method public java.math.BigInteger getPrimeExponentP();
    method public java.math.BigInteger getPrimeExponentQ();
    method public java.math.BigInteger getPrimeP();
    method public java.math.BigInteger getPrimeQ();
    method public java.math.BigInteger getPublicExponent();
  }

  public class RSAPrivateKeySpec implements java.security.spec.KeySpec {
    ctor public RSAPrivateKeySpec(java.math.BigInteger, java.math.BigInteger);
    method public java.math.BigInteger getModulus();
    method public java.math.BigInteger getPrivateExponent();
  }

  public class RSAPublicKeySpec implements java.security.spec.KeySpec {
    ctor public RSAPublicKeySpec(java.math.BigInteger, java.math.BigInteger);
    method public java.math.BigInteger getModulus();
    method public java.math.BigInteger getPublicExponent();
  }

  public class X509EncodedKeySpec extends java.security.spec.EncodedKeySpec {
    ctor public X509EncodedKeySpec(byte[]);
    method public final String getFormat();
  }

}

package java.sql {

  public interface Array {
    method public void free() throws java.sql.SQLException;
    method public Object getArray() throws java.sql.SQLException;
    method public Object getArray(java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
    method public Object getArray(long, int) throws java.sql.SQLException;
    method public Object getArray(long, int, java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
    method public int getBaseType() throws java.sql.SQLException;
    method public String getBaseTypeName() throws java.sql.SQLException;
    method public java.sql.ResultSet getResultSet() throws java.sql.SQLException;
    method public java.sql.ResultSet getResultSet(java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
    method public java.sql.ResultSet getResultSet(long, int) throws java.sql.SQLException;
    method public java.sql.ResultSet getResultSet(long, int, java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
  }

  public class BatchUpdateException extends java.sql.SQLException {
    ctor public BatchUpdateException(String, String, int, int[]);
    ctor public BatchUpdateException(String, String, int[]);
    ctor public BatchUpdateException(String, int[]);
    ctor public BatchUpdateException(int[]);
    ctor public BatchUpdateException();
    ctor public BatchUpdateException(Throwable);
    ctor public BatchUpdateException(int[], Throwable);
    ctor public BatchUpdateException(String, int[], Throwable);
    ctor public BatchUpdateException(String, String, int[], Throwable);
    ctor public BatchUpdateException(String, String, int, int[], Throwable);
    method public int[] getUpdateCounts();
  }

  public interface Blob {
    method public void free() throws java.sql.SQLException;
    method public java.io.InputStream getBinaryStream() throws java.sql.SQLException;
    method public java.io.InputStream getBinaryStream(long, long) throws java.sql.SQLException;
    method public byte[] getBytes(long, int) throws java.sql.SQLException;
    method public long length() throws java.sql.SQLException;
    method public long position(byte[], long) throws java.sql.SQLException;
    method public long position(java.sql.Blob, long) throws java.sql.SQLException;
    method public java.io.OutputStream setBinaryStream(long) throws java.sql.SQLException;
    method public int setBytes(long, byte[]) throws java.sql.SQLException;
    method public int setBytes(long, byte[], int, int) throws java.sql.SQLException;
    method public void truncate(long) throws java.sql.SQLException;
  }

  public interface CallableStatement extends java.sql.PreparedStatement {
    method public java.sql.Array getArray(int) throws java.sql.SQLException;
    method public java.sql.Array getArray(String) throws java.sql.SQLException;
    method @Deprecated public java.math.BigDecimal getBigDecimal(int, int) throws java.sql.SQLException;
    method public java.math.BigDecimal getBigDecimal(int) throws java.sql.SQLException;
    method public java.math.BigDecimal getBigDecimal(String) throws java.sql.SQLException;
    method public java.sql.Blob getBlob(int) throws java.sql.SQLException;
    method public java.sql.Blob getBlob(String) throws java.sql.SQLException;
    method public boolean getBoolean(int) throws java.sql.SQLException;
    method public boolean getBoolean(String) throws java.sql.SQLException;
    method public byte getByte(int) throws java.sql.SQLException;
    method public byte getByte(String) throws java.sql.SQLException;
    method public byte[] getBytes(int) throws java.sql.SQLException;
    method public byte[] getBytes(String) throws java.sql.SQLException;
    method public java.io.Reader getCharacterStream(int) throws java.sql.SQLException;
    method public java.io.Reader getCharacterStream(String) throws java.sql.SQLException;
    method public java.sql.Clob getClob(int) throws java.sql.SQLException;
    method public java.sql.Clob getClob(String) throws java.sql.SQLException;
    method public java.sql.Date getDate(int) throws java.sql.SQLException;
    method public java.sql.Date getDate(int, java.util.Calendar) throws java.sql.SQLException;
    method public java.sql.Date getDate(String) throws java.sql.SQLException;
    method public java.sql.Date getDate(String, java.util.Calendar) throws java.sql.SQLException;
    method public double getDouble(int) throws java.sql.SQLException;
    method public double getDouble(String) throws java.sql.SQLException;
    method public float getFloat(int) throws java.sql.SQLException;
    method public float getFloat(String) throws java.sql.SQLException;
    method public int getInt(int) throws java.sql.SQLException;
    method public int getInt(String) throws java.sql.SQLException;
    method public long getLong(int) throws java.sql.SQLException;
    method public long getLong(String) throws java.sql.SQLException;
    method public java.io.Reader getNCharacterStream(int) throws java.sql.SQLException;
    method public java.io.Reader getNCharacterStream(String) throws java.sql.SQLException;
    method public java.sql.NClob getNClob(int) throws java.sql.SQLException;
    method public java.sql.NClob getNClob(String) throws java.sql.SQLException;
    method public String getNString(int) throws java.sql.SQLException;
    method public String getNString(String) throws java.sql.SQLException;
    method public Object getObject(int) throws java.sql.SQLException;
    method public Object getObject(int, java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
    method public Object getObject(String) throws java.sql.SQLException;
    method public Object getObject(String, java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
    method public java.sql.Ref getRef(int) throws java.sql.SQLException;
    method public java.sql.Ref getRef(String) throws java.sql.SQLException;
    method public java.sql.RowId getRowId(int) throws java.sql.SQLException;
    method public java.sql.RowId getRowId(String) throws java.sql.SQLException;
    method public java.sql.SQLXML getSQLXML(int) throws java.sql.SQLException;
    method public java.sql.SQLXML getSQLXML(String) throws java.sql.SQLException;
    method public short getShort(int) throws java.sql.SQLException;
    method public short getShort(String) throws java.sql.SQLException;
    method public String getString(int) throws java.sql.SQLException;
    method public String getString(String) throws java.sql.SQLException;
    method public java.sql.Time getTime(int) throws java.sql.SQLException;
    method public java.sql.Time getTime(int, java.util.Calendar) throws java.sql.SQLException;
    method public java.sql.Time getTime(String) throws java.sql.SQLException;
    method public java.sql.Time getTime(String, java.util.Calendar) throws java.sql.SQLException;
    method public java.sql.Timestamp getTimestamp(int) throws java.sql.SQLException;
    method public java.sql.Timestamp getTimestamp(int, java.util.Calendar) throws java.sql.SQLException;
    method public java.sql.Timestamp getTimestamp(String) throws java.sql.SQLException;
    method public java.sql.Timestamp getTimestamp(String, java.util.Calendar) throws java.sql.SQLException;
    method public java.net.URL getURL(int) throws java.sql.SQLException;
    method public java.net.URL getURL(String) throws java.sql.SQLException;
    method public void registerOutParameter(int, int) throws java.sql.SQLException;
    method public void registerOutParameter(int, int, int) throws java.sql.SQLException;
    method public void registerOutParameter(int, int, String) throws java.sql.SQLException;
    method public void registerOutParameter(String, int) throws java.sql.SQLException;
    method public void registerOutParameter(String, int, int) throws java.sql.SQLException;
    method public void registerOutParameter(String, int, String) throws java.sql.SQLException;
    method public void setAsciiStream(String, java.io.InputStream, int) throws java.sql.SQLException;
    method public void setAsciiStream(String, java.io.InputStream, long) throws java.sql.SQLException;
    method public void setAsciiStream(String, java.io.InputStream) throws java.sql.SQLException;
    method public void setBigDecimal(String, java.math.BigDecimal) throws java.sql.SQLException;
    method public void setBinaryStream(String, java.io.InputStream, int) throws java.sql.SQLException;
    method public void setBinaryStream(String, java.io.InputStream, long) throws java.sql.SQLException;
    method public void setBinaryStream(String, java.io.InputStream) throws java.sql.SQLException;
    method public void setBlob(String, java.io.InputStream, long) throws java.sql.SQLException;
    method public void setBlob(String, java.sql.Blob) throws java.sql.SQLException;
    method public void setBlob(String, java.io.InputStream) throws java.sql.SQLException;
    method public void setBoolean(String, boolean) throws java.sql.SQLException;
    method public void setByte(String, byte) throws java.sql.SQLException;
    method public void setBytes(String, byte[]) throws java.sql.SQLException;
    method public void setCharacterStream(String, java.io.Reader, int) throws java.sql.SQLException;
    method public void setCharacterStream(String, java.io.Reader, long) throws java.sql.SQLException;
    method public void setCharacterStream(String, java.io.Reader) throws java.sql.SQLException;
    method public void setClob(String, java.io.Reader, long) throws java.sql.SQLException;
    method public void setClob(String, java.sql.Clob) throws java.sql.SQLException;
    method public void setClob(String, java.io.Reader) throws java.sql.SQLException;
    method public void setDate(String, java.sql.Date) throws java.sql.SQLException;
    method public void setDate(String, java.sql.Date, java.util.Calendar) throws java.sql.SQLException;
    method public void setDouble(String, double) throws java.sql.SQLException;
    method public void setFloat(String, float) throws java.sql.SQLException;
    method public void setInt(String, int) throws java.sql.SQLException;
    method public void setLong(String, long) throws java.sql.SQLException;
    method public void setNCharacterStream(String, java.io.Reader, long) throws java.sql.SQLException;
    method public void setNCharacterStream(String, java.io.Reader) throws java.sql.SQLException;
    method public void setNClob(String, java.sql.NClob) throws java.sql.SQLException;
    method public void setNClob(String, java.io.Reader, long) throws java.sql.SQLException;
    method public void setNClob(String, java.io.Reader) throws java.sql.SQLException;
    method public void setNString(String, String) throws java.sql.SQLException;
    method public void setNull(String, int) throws java.sql.SQLException;
    method public void setNull(String, int, String) throws java.sql.SQLException;
    method public void setObject(String, Object, int, int) throws java.sql.SQLException;
    method public void setObject(String, Object, int) throws java.sql.SQLException;
    method public void setObject(String, Object) throws java.sql.SQLException;
    method public void setRowId(String, java.sql.RowId) throws java.sql.SQLException;
    method public void setSQLXML(String, java.sql.SQLXML) throws java.sql.SQLException;
    method public void setShort(String, short) throws java.sql.SQLException;
    method public void setString(String, String) throws java.sql.SQLException;
    method public void setTime(String, java.sql.Time) throws java.sql.SQLException;
    method public void setTime(String, java.sql.Time, java.util.Calendar) throws java.sql.SQLException;
    method public void setTimestamp(String, java.sql.Timestamp) throws java.sql.SQLException;
    method public void setTimestamp(String, java.sql.Timestamp, java.util.Calendar) throws java.sql.SQLException;
    method public void setURL(String, java.net.URL) throws java.sql.SQLException;
    method public boolean wasNull() throws java.sql.SQLException;
  }

  public enum ClientInfoStatus {
    enum_constant public static final java.sql.ClientInfoStatus REASON_UNKNOWN;
    enum_constant public static final java.sql.ClientInfoStatus REASON_UNKNOWN_PROPERTY;
    enum_constant public static final java.sql.ClientInfoStatus REASON_VALUE_INVALID;
    enum_constant public static final java.sql.ClientInfoStatus REASON_VALUE_TRUNCATED;
  }

  public interface Clob {
    method public void free() throws java.sql.SQLException;
    method public java.io.InputStream getAsciiStream() throws java.sql.SQLException;
    method public java.io.Reader getCharacterStream() throws java.sql.SQLException;
    method public java.io.Reader getCharacterStream(long, long) throws java.sql.SQLException;
    method public String getSubString(long, int) throws java.sql.SQLException;
    method public long length() throws java.sql.SQLException;
    method public long position(String, long) throws java.sql.SQLException;
    method public long position(java.sql.Clob, long) throws java.sql.SQLException;
    method public java.io.OutputStream setAsciiStream(long) throws java.sql.SQLException;
    method public java.io.Writer setCharacterStream(long) throws java.sql.SQLException;
    method public int setString(long, String) throws java.sql.SQLException;
    method public int setString(long, String, int, int) throws java.sql.SQLException;
    method public void truncate(long) throws java.sql.SQLException;
  }

  public interface Connection extends java.sql.Wrapper java.lang.AutoCloseable {
    method public void clearWarnings() throws java.sql.SQLException;
    method public void close() throws java.sql.SQLException;
    method public void commit() throws java.sql.SQLException;
    method public java.sql.Array createArrayOf(String, Object[]) throws java.sql.SQLException;
    method public java.sql.Blob createBlob() throws java.sql.SQLException;
    method public java.sql.Clob createClob() throws java.sql.SQLException;
    method public java.sql.NClob createNClob() throws java.sql.SQLException;
    method public java.sql.SQLXML createSQLXML() throws java.sql.SQLException;
    method public java.sql.Statement createStatement() throws java.sql.SQLException;
    method public java.sql.Statement createStatement(int, int) throws java.sql.SQLException;
    method public java.sql.Statement createStatement(int, int, int) throws java.sql.SQLException;
    method public java.sql.Struct createStruct(String, Object[]) throws java.sql.SQLException;
    method public boolean getAutoCommit() throws java.sql.SQLException;
    method public String getCatalog() throws java.sql.SQLException;
    method public String getClientInfo(String) throws java.sql.SQLException;
    method public java.util.Properties getClientInfo() throws java.sql.SQLException;
    method public int getHoldability() throws java.sql.SQLException;
    method public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException;
    method public int getTransactionIsolation() throws java.sql.SQLException;
    method public java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap() throws java.sql.SQLException;
    method public java.sql.SQLWarning getWarnings() throws java.sql.SQLException;
    method public boolean isClosed() throws java.sql.SQLException;
    method public boolean isReadOnly() throws java.sql.SQLException;
    method public boolean isValid(int) throws java.sql.SQLException;
    method public String nativeSQL(String) throws java.sql.SQLException;
    method public java.sql.CallableStatement prepareCall(String) throws java.sql.SQLException;
    method public java.sql.CallableStatement prepareCall(String, int, int) throws java.sql.SQLException;
    method public java.sql.CallableStatement prepareCall(String, int, int, int) throws java.sql.SQLException;
    method public java.sql.PreparedStatement prepareStatement(String) throws java.sql.SQLException;
    method public java.sql.PreparedStatement prepareStatement(String, int, int) throws java.sql.SQLException;
    method public java.sql.PreparedStatement prepareStatement(String, int, int, int) throws java.sql.SQLException;
    method public java.sql.PreparedStatement prepareStatement(String, int) throws java.sql.SQLException;
    method public java.sql.PreparedStatement prepareStatement(String, int[]) throws java.sql.SQLException;
    method public java.sql.PreparedStatement prepareStatement(String, String[]) throws java.sql.SQLException;
    method public void releaseSavepoint(java.sql.Savepoint) throws java.sql.SQLException;
    method public void rollback() throws java.sql.SQLException;
    method public void rollback(java.sql.Savepoint) throws java.sql.SQLException;
    method public void setAutoCommit(boolean) throws java.sql.SQLException;
    method public void setCatalog(String) throws java.sql.SQLException;
    method public void setClientInfo(String, String) throws java.sql.SQLClientInfoException;
    method public void setClientInfo(java.util.Properties) throws java.sql.SQLClientInfoException;
    method public void setHoldability(int) throws java.sql.SQLException;
    method public void setReadOnly(boolean) throws java.sql.SQLException;
    method public java.sql.Savepoint setSavepoint() throws java.sql.SQLException;
    method public java.sql.Savepoint setSavepoint(String) throws java.sql.SQLException;
    method public void setTransactionIsolation(int) throws java.sql.SQLException;
    method public void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
    field public static final int TRANSACTION_NONE = 0; // 0x0
    field public static final int TRANSACTION_READ_COMMITTED = 2; // 0x2
    field public static final int TRANSACTION_READ_UNCOMMITTED = 1; // 0x1
    field public static final int TRANSACTION_REPEATABLE_READ = 4; // 0x4
    field public static final int TRANSACTION_SERIALIZABLE = 8; // 0x8
  }

  public class DataTruncation extends java.sql.SQLWarning {
    ctor public DataTruncation(int, boolean, boolean, int, int);
    ctor public DataTruncation(int, boolean, boolean, int, int, Throwable);
    method public int getDataSize();
    method public int getIndex();
    method public boolean getParameter();
    method public boolean getRead();
    method public int getTransferSize();
  }

  public interface DatabaseMetaData extends java.sql.Wrapper {
    method public boolean allProceduresAreCallable() throws java.sql.SQLException;
    method public boolean allTablesAreSelectable() throws java.sql.SQLException;
    method public boolean autoCommitFailureClosesAllResultSets() throws java.sql.SQLException;
    method public boolean dataDefinitionCausesTransactionCommit() throws java.sql.SQLException;
    method public boolean dataDefinitionIgnoredInTransactions() throws java.sql.SQLException;
    method public boolean deletesAreDetected(int) throws java.sql.SQLException;
    method public boolean doesMaxRowSizeIncludeBlobs() throws java.sql.SQLException;
    method public java.sql.ResultSet getAttributes(String, String, String, String) throws java.sql.SQLException;
    method public java.sql.ResultSet getBestRowIdentifier(String, String, String, int, boolean) throws java.sql.SQLException;
    method public String getCatalogSeparator() throws java.sql.SQLException;
    method public String getCatalogTerm() throws java.sql.SQLException;
    method public java.sql.ResultSet getCatalogs() throws java.sql.SQLException;
    method public java.sql.ResultSet getClientInfoProperties() throws java.sql.SQLException;
    method public java.sql.ResultSet getColumnPrivileges(String, String, String, String) throws java.sql.SQLException;
    method public java.sql.ResultSet getColumns(String, String, String, String) throws java.sql.SQLException;
    method public java.sql.Connection getConnection() throws java.sql.SQLException;
    method public java.sql.ResultSet getCrossReference(String, String, String, String, String, String) throws java.sql.SQLException;
    method public int getDatabaseMajorVersion() throws java.sql.SQLException;
    method public int getDatabaseMinorVersion() throws java.sql.SQLException;
    method public String getDatabaseProductName() throws java.sql.SQLException;
    method public String getDatabaseProductVersion() throws java.sql.SQLException;
    method public int getDefaultTransactionIsolation() throws java.sql.SQLException;
    method public int getDriverMajorVersion();
    method public int getDriverMinorVersion();
    method public String getDriverName() throws java.sql.SQLException;
    method public String getDriverVersion() throws java.sql.SQLException;
    method public java.sql.ResultSet getExportedKeys(String, String, String) throws java.sql.SQLException;
    method public String getExtraNameCharacters() throws java.sql.SQLException;
    method public java.sql.ResultSet getFunctionColumns(String, String, String, String) throws java.sql.SQLException;
    method public java.sql.ResultSet getFunctions(String, String, String) throws java.sql.SQLException;
    method public String getIdentifierQuoteString() throws java.sql.SQLException;
    method public java.sql.ResultSet getImportedKeys(String, String, String) throws java.sql.SQLException;
    method public java.sql.ResultSet getIndexInfo(String, String, String, boolean, boolean) throws java.sql.SQLException;
    method public int getJDBCMajorVersion() throws java.sql.SQLException;
    method public int getJDBCMinorVersion() throws java.sql.SQLException;
    method public int getMaxBinaryLiteralLength() throws java.sql.SQLException;
    method public int getMaxCatalogNameLength() throws java.sql.SQLException;
    method public int getMaxCharLiteralLength() throws java.sql.SQLException;
    method public int getMaxColumnNameLength() throws java.sql.SQLException;
    method public int getMaxColumnsInGroupBy() throws java.sql.SQLException;
    method public int getMaxColumnsInIndex() throws java.sql.SQLException;
    method public int getMaxColumnsInOrderBy() throws java.sql.SQLException;
    method public int getMaxColumnsInSelect() throws java.sql.SQLException;
    method public int getMaxColumnsInTable() throws java.sql.SQLException;
    method public int getMaxConnections() throws java.sql.SQLException;
    method public int getMaxCursorNameLength() throws java.sql.SQLException;
    method public int getMaxIndexLength() throws java.sql.SQLException;
    method public int getMaxProcedureNameLength() throws java.sql.SQLException;
    method public int getMaxRowSize() throws java.sql.SQLException;
    method public int getMaxSchemaNameLength() throws java.sql.SQLException;
    method public int getMaxStatementLength() throws java.sql.SQLException;
    method public int getMaxStatements() throws java.sql.SQLException;
    method public int getMaxTableNameLength() throws java.sql.SQLException;
    method public int getMaxTablesInSelect() throws java.sql.SQLException;
    method public int getMaxUserNameLength() throws java.sql.SQLException;
    method public String getNumericFunctions() throws java.sql.SQLException;
    method public java.sql.ResultSet getPrimaryKeys(String, String, String) throws java.sql.SQLException;
    method public java.sql.ResultSet getProcedureColumns(String, String, String, String) throws java.sql.SQLException;
    method public String getProcedureTerm() throws java.sql.SQLException;
    method public java.sql.ResultSet getProcedures(String, String, String) throws java.sql.SQLException;
    method public int getResultSetHoldability() throws java.sql.SQLException;
    method public java.sql.RowIdLifetime getRowIdLifetime() throws java.sql.SQLException;
    method public String getSQLKeywords() throws java.sql.SQLException;
    method public int getSQLStateType() throws java.sql.SQLException;
    method public String getSchemaTerm() throws java.sql.SQLException;
    method public java.sql.ResultSet getSchemas() throws java.sql.SQLException;
    method public java.sql.ResultSet getSchemas(String, String) throws java.sql.SQLException;
    method public String getSearchStringEscape() throws java.sql.SQLException;
    method public String getStringFunctions() throws java.sql.SQLException;
    method public java.sql.ResultSet getSuperTables(String, String, String) throws java.sql.SQLException;
    method public java.sql.ResultSet getSuperTypes(String, String, String) throws java.sql.SQLException;
    method public String getSystemFunctions() throws java.sql.SQLException;
    method public java.sql.ResultSet getTablePrivileges(String, String, String) throws java.sql.SQLException;
    method public java.sql.ResultSet getTableTypes() throws java.sql.SQLException;
    method public java.sql.ResultSet getTables(String, String, String, String[]) throws java.sql.SQLException;
    method public String getTimeDateFunctions() throws java.sql.SQLException;
    method public java.sql.ResultSet getTypeInfo() throws java.sql.SQLException;
    method public java.sql.ResultSet getUDTs(String, String, String, int[]) throws java.sql.SQLException;
    method public String getURL() throws java.sql.SQLException;
    method public String getUserName() throws java.sql.SQLException;
    method public java.sql.ResultSet getVersionColumns(String, String, String) throws java.sql.SQLException;
    method public boolean insertsAreDetected(int) throws java.sql.SQLException;
    method public boolean isCatalogAtStart() throws java.sql.SQLException;
    method public boolean isReadOnly() throws java.sql.SQLException;
    method public boolean locatorsUpdateCopy() throws java.sql.SQLException;
    method public boolean nullPlusNonNullIsNull() throws java.sql.SQLException;
    method public boolean nullsAreSortedAtEnd() throws java.sql.SQLException;
    method public boolean nullsAreSortedAtStart() throws java.sql.SQLException;
    method public boolean nullsAreSortedHigh() throws java.sql.SQLException;
    method public boolean nullsAreSortedLow() throws java.sql.SQLException;
    method public boolean othersDeletesAreVisible(int) throws java.sql.SQLException;
    method public boolean othersInsertsAreVisible(int) throws java.sql.SQLException;
    method public boolean othersUpdatesAreVisible(int) throws java.sql.SQLException;
    method public boolean ownDeletesAreVisible(int) throws java.sql.SQLException;
    method public boolean ownInsertsAreVisible(int) throws java.sql.SQLException;
    method public boolean ownUpdatesAreVisible(int) throws java.sql.SQLException;
    method public boolean storesLowerCaseIdentifiers() throws java.sql.SQLException;
    method public boolean storesLowerCaseQuotedIdentifiers() throws java.sql.SQLException;
    method public boolean storesMixedCaseIdentifiers() throws java.sql.SQLException;
    method public boolean storesMixedCaseQuotedIdentifiers() throws java.sql.SQLException;
    method public boolean storesUpperCaseIdentifiers() throws java.sql.SQLException;
    method public boolean storesUpperCaseQuotedIdentifiers() throws java.sql.SQLException;
    method public boolean supportsANSI92EntryLevelSQL() throws java.sql.SQLException;
    method public boolean supportsANSI92FullSQL() throws java.sql.SQLException;
    method public boolean supportsANSI92IntermediateSQL() throws java.sql.SQLException;
    method public boolean supportsAlterTableWithAddColumn() throws java.sql.SQLException;
    method public boolean supportsAlterTableWithDropColumn() throws java.sql.SQLException;
    method public boolean supportsBatchUpdates() throws java.sql.SQLException;
    method public boolean supportsCatalogsInDataManipulation() throws java.sql.SQLException;
    method public boolean supportsCatalogsInIndexDefinitions() throws java.sql.SQLException;
    method public boolean supportsCatalogsInPrivilegeDefinitions() throws java.sql.SQLException;
    method public boolean supportsCatalogsInProcedureCalls() throws java.sql.SQLException;
    method public boolean supportsCatalogsInTableDefinitions() throws java.sql.SQLException;
    method public boolean supportsColumnAliasing() throws java.sql.SQLException;
    method public boolean supportsConvert() throws java.sql.SQLException;
    method public boolean supportsConvert(int, int) throws java.sql.SQLException;
    method public boolean supportsCoreSQLGrammar() throws java.sql.SQLException;
    method public boolean supportsCorrelatedSubqueries() throws java.sql.SQLException;
    method public boolean supportsDataDefinitionAndDataManipulationTransactions() throws java.sql.SQLException;
    method public boolean supportsDataManipulationTransactionsOnly() throws java.sql.SQLException;
    method public boolean supportsDifferentTableCorrelationNames() throws java.sql.SQLException;
    method public boolean supportsExpressionsInOrderBy() throws java.sql.SQLException;
    method public boolean supportsExtendedSQLGrammar() throws java.sql.SQLException;
    method public boolean supportsFullOuterJoins() throws java.sql.SQLException;
    method public boolean supportsGetGeneratedKeys() throws java.sql.SQLException;
    method public boolean supportsGroupBy() throws java.sql.SQLException;
    method public boolean supportsGroupByBeyondSelect() throws java.sql.SQLException;
    method public boolean supportsGroupByUnrelated() throws java.sql.SQLException;
    method public boolean supportsIntegrityEnhancementFacility() throws java.sql.SQLException;
    method public boolean supportsLikeEscapeClause() throws java.sql.SQLException;
    method public boolean supportsLimitedOuterJoins() throws java.sql.SQLException;
    method public boolean supportsMinimumSQLGrammar() throws java.sql.SQLException;
    method public boolean supportsMixedCaseIdentifiers() throws java.sql.SQLException;
    method public boolean supportsMixedCaseQuotedIdentifiers() throws java.sql.SQLException;
    method public boolean supportsMultipleOpenResults() throws java.sql.SQLException;
    method public boolean supportsMultipleResultSets() throws java.sql.SQLException;
    method public boolean supportsMultipleTransactions() throws java.sql.SQLException;
    method public boolean supportsNamedParameters() throws java.sql.SQLException;
    method public boolean supportsNonNullableColumns() throws java.sql.SQLException;
    method public boolean supportsOpenCursorsAcrossCommit() throws java.sql.SQLException;
    method public boolean supportsOpenCursorsAcrossRollback() throws java.sql.SQLException;
    method public boolean supportsOpenStatementsAcrossCommit() throws java.sql.SQLException;
    method public boolean supportsOpenStatementsAcrossRollback() throws java.sql.SQLException;
    method public boolean supportsOrderByUnrelated() throws java.sql.SQLException;
    method public boolean supportsOuterJoins() throws java.sql.SQLException;
    method public boolean supportsPositionedDelete() throws java.sql.SQLException;
    method public boolean supportsPositionedUpdate() throws java.sql.SQLException;
    method public boolean supportsResultSetConcurrency(int, int) throws java.sql.SQLException;
    method public boolean supportsResultSetHoldability(int) throws java.sql.SQLException;
    method public boolean supportsResultSetType(int) throws java.sql.SQLException;
    method public boolean supportsSavepoints() throws java.sql.SQLException;
    method public boolean supportsSchemasInDataManipulation() throws java.sql.SQLException;
    method public boolean supportsSchemasInIndexDefinitions() throws java.sql.SQLException;
    method public boolean supportsSchemasInPrivilegeDefinitions() throws java.sql.SQLException;
    method public boolean supportsSchemasInProcedureCalls() throws java.sql.SQLException;
    method public boolean supportsSchemasInTableDefinitions() throws java.sql.SQLException;
    method public boolean supportsSelectForUpdate() throws java.sql.SQLException;
    method public boolean supportsStatementPooling() throws java.sql.SQLException;
    method public boolean supportsStoredFunctionsUsingCallSyntax() throws java.sql.SQLException;
    method public boolean supportsStoredProcedures() throws java.sql.SQLException;
    method public boolean supportsSubqueriesInComparisons() throws java.sql.SQLException;
    method public boolean supportsSubqueriesInExists() throws java.sql.SQLException;
    method public boolean supportsSubqueriesInIns() throws java.sql.SQLException;
    method public boolean supportsSubqueriesInQuantifieds() throws java.sql.SQLException;
    method public boolean supportsTableCorrelationNames() throws java.sql.SQLException;
    method public boolean supportsTransactionIsolationLevel(int) throws java.sql.SQLException;
    method public boolean supportsTransactions() throws java.sql.SQLException;
    method public boolean supportsUnion() throws java.sql.SQLException;
    method public boolean supportsUnionAll() throws java.sql.SQLException;
    method public boolean updatesAreDetected(int) throws java.sql.SQLException;
    method public boolean usesLocalFilePerTable() throws java.sql.SQLException;
    method public boolean usesLocalFiles() throws java.sql.SQLException;
    field public static final short attributeNoNulls = 0; // 0x0
    field public static final short attributeNullable = 1; // 0x1
    field public static final short attributeNullableUnknown = 2; // 0x2
    field public static final int bestRowNotPseudo = 1; // 0x1
    field public static final int bestRowPseudo = 2; // 0x2
    field public static final int bestRowSession = 2; // 0x2
    field public static final int bestRowTemporary = 0; // 0x0
    field public static final int bestRowTransaction = 1; // 0x1
    field public static final int bestRowUnknown = 0; // 0x0
    field public static final int columnNoNulls = 0; // 0x0
    field public static final int columnNullable = 1; // 0x1
    field public static final int columnNullableUnknown = 2; // 0x2
    field public static final int functionColumnIn = 1; // 0x1
    field public static final int functionColumnInOut = 2; // 0x2
    field public static final int functionColumnOut = 3; // 0x3
    field public static final int functionColumnResult = 5; // 0x5
    field public static final int functionColumnUnknown = 0; // 0x0
    field public static final int functionNoNulls = 0; // 0x0
    field public static final int functionNoTable = 1; // 0x1
    field public static final int functionNullable = 1; // 0x1
    field public static final int functionNullableUnknown = 2; // 0x2
    field public static final int functionResultUnknown = 0; // 0x0
    field public static final int functionReturn = 4; // 0x4
    field public static final int functionReturnsTable = 2; // 0x2
    field public static final int importedKeyCascade = 0; // 0x0
    field public static final int importedKeyInitiallyDeferred = 5; // 0x5
    field public static final int importedKeyInitiallyImmediate = 6; // 0x6
    field public static final int importedKeyNoAction = 3; // 0x3
    field public static final int importedKeyNotDeferrable = 7; // 0x7
    field public static final int importedKeyRestrict = 1; // 0x1
    field public static final int importedKeySetDefault = 4; // 0x4
    field public static final int importedKeySetNull = 2; // 0x2
    field public static final int procedureColumnIn = 1; // 0x1
    field public static final int procedureColumnInOut = 2; // 0x2
    field public static final int procedureColumnOut = 4; // 0x4
    field public static final int procedureColumnResult = 3; // 0x3
    field public static final int procedureColumnReturn = 5; // 0x5
    field public static final int procedureColumnUnknown = 0; // 0x0
    field public static final int procedureNoNulls = 0; // 0x0
    field public static final int procedureNoResult = 1; // 0x1
    field public static final int procedureNullable = 1; // 0x1
    field public static final int procedureNullableUnknown = 2; // 0x2
    field public static final int procedureResultUnknown = 0; // 0x0
    field public static final int procedureReturnsResult = 2; // 0x2
    field public static final int sqlStateSQL = 2; // 0x2
    field public static final int sqlStateSQL99 = 2; // 0x2
    field public static final int sqlStateXOpen = 1; // 0x1
    field public static final short tableIndexClustered = 1; // 0x1
    field public static final short tableIndexHashed = 2; // 0x2
    field public static final short tableIndexOther = 3; // 0x3
    field public static final short tableIndexStatistic = 0; // 0x0
    field public static final int typeNoNulls = 0; // 0x0
    field public static final int typeNullable = 1; // 0x1
    field public static final int typeNullableUnknown = 2; // 0x2
    field public static final int typePredBasic = 2; // 0x2
    field public static final int typePredChar = 1; // 0x1
    field public static final int typePredNone = 0; // 0x0
    field public static final int typeSearchable = 3; // 0x3
    field public static final int versionColumnNotPseudo = 1; // 0x1
    field public static final int versionColumnPseudo = 2; // 0x2
    field public static final int versionColumnUnknown = 0; // 0x0
  }

  public class Date extends java.util.Date {
    ctor @Deprecated public Date(int, int, int);
    ctor public Date(long);
    method public static java.sql.Date valueOf(String);
  }

  public interface Driver {
    method public boolean acceptsURL(String) throws java.sql.SQLException;
    method public java.sql.Connection connect(String, java.util.Properties) throws java.sql.SQLException;
    method public int getMajorVersion();
    method public int getMinorVersion();
    method public java.sql.DriverPropertyInfo[] getPropertyInfo(String, java.util.Properties) throws java.sql.SQLException;
    method public boolean jdbcCompliant();
  }

  public class DriverManager {
    method public static void deregisterDriver(java.sql.Driver) throws java.sql.SQLException;
    method public static java.sql.Connection getConnection(String, java.util.Properties) throws java.sql.SQLException;
    method public static java.sql.Connection getConnection(String, String, String) throws java.sql.SQLException;
    method public static java.sql.Connection getConnection(String) throws java.sql.SQLException;
    method public static java.sql.Driver getDriver(String) throws java.sql.SQLException;
    method public static java.util.Enumeration<java.sql.Driver> getDrivers();
    method @Deprecated public static java.io.PrintStream getLogStream();
    method public static java.io.PrintWriter getLogWriter();
    method public static int getLoginTimeout();
    method public static void println(String);
    method public static void registerDriver(java.sql.Driver) throws java.sql.SQLException;
    method @Deprecated public static void setLogStream(java.io.PrintStream);
    method public static void setLogWriter(java.io.PrintWriter);
    method public static void setLoginTimeout(int);
  }

  public class DriverPropertyInfo {
    ctor public DriverPropertyInfo(String, String);
    field public String[] choices;
    field public String description;
    field public String name;
    field public boolean required;
    field public String value;
  }

  public interface NClob extends java.sql.Clob {
  }

  public interface ParameterMetaData extends java.sql.Wrapper {
    method public String getParameterClassName(int) throws java.sql.SQLException;
    method public int getParameterCount() throws java.sql.SQLException;
    method public int getParameterMode(int) throws java.sql.SQLException;
    method public int getParameterType(int) throws java.sql.SQLException;
    method public String getParameterTypeName(int) throws java.sql.SQLException;
    method public int getPrecision(int) throws java.sql.SQLException;
    method public int getScale(int) throws java.sql.SQLException;
    method public int isNullable(int) throws java.sql.SQLException;
    method public boolean isSigned(int) throws java.sql.SQLException;
    field public static final int parameterModeIn = 1; // 0x1
    field public static final int parameterModeInOut = 2; // 0x2
    field public static final int parameterModeOut = 4; // 0x4
    field public static final int parameterModeUnknown = 0; // 0x0
    field public static final int parameterNoNulls = 0; // 0x0
    field public static final int parameterNullable = 1; // 0x1
    field public static final int parameterNullableUnknown = 2; // 0x2
  }

  public interface PreparedStatement extends java.sql.Statement {
    method public void addBatch() throws java.sql.SQLException;
    method public void clearParameters() throws java.sql.SQLException;
    method public boolean execute() throws java.sql.SQLException;
    method public java.sql.ResultSet executeQuery() throws java.sql.SQLException;
    method public int executeUpdate() throws java.sql.SQLException;
    method public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException;
    method public java.sql.ParameterMetaData getParameterMetaData() throws java.sql.SQLException;
    method public void setArray(int, java.sql.Array) throws java.sql.SQLException;
    method public void setAsciiStream(int, java.io.InputStream, int) throws java.sql.SQLException;
    method public void setAsciiStream(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public void setAsciiStream(int, java.io.InputStream) throws java.sql.SQLException;
    method public void setBigDecimal(int, java.math.BigDecimal) throws java.sql.SQLException;
    method public void setBinaryStream(int, java.io.InputStream, int) throws java.sql.SQLException;
    method public void setBinaryStream(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public void setBinaryStream(int, java.io.InputStream) throws java.sql.SQLException;
    method public void setBlob(int, java.sql.Blob) throws java.sql.SQLException;
    method public void setBlob(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public void setBlob(int, java.io.InputStream) throws java.sql.SQLException;
    method public void setBoolean(int, boolean) throws java.sql.SQLException;
    method public void setByte(int, byte) throws java.sql.SQLException;
    method public void setBytes(int, byte[]) throws java.sql.SQLException;
    method public void setCharacterStream(int, java.io.Reader, int) throws java.sql.SQLException;
    method public void setCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
    method public void setCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
    method public void setClob(int, java.sql.Clob) throws java.sql.SQLException;
    method public void setClob(int, java.io.Reader, long) throws java.sql.SQLException;
    method public void setClob(int, java.io.Reader) throws java.sql.SQLException;
    method public void setDate(int, java.sql.Date) throws java.sql.SQLException;
    method public void setDate(int, java.sql.Date, java.util.Calendar) throws java.sql.SQLException;
    method public void setDouble(int, double) throws java.sql.SQLException;
    method public void setFloat(int, float) throws java.sql.SQLException;
    method public void setInt(int, int) throws java.sql.SQLException;
    method public void setLong(int, long) throws java.sql.SQLException;
    method public void setNCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
    method public void setNCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
    method public void setNClob(int, java.sql.NClob) throws java.sql.SQLException;
    method public void setNClob(int, java.io.Reader, long) throws java.sql.SQLException;
    method public void setNClob(int, java.io.Reader) throws java.sql.SQLException;
    method public void setNString(int, String) throws java.sql.SQLException;
    method public void setNull(int, int) throws java.sql.SQLException;
    method public void setNull(int, int, String) throws java.sql.SQLException;
    method public void setObject(int, Object, int) throws java.sql.SQLException;
    method public void setObject(int, Object) throws java.sql.SQLException;
    method public void setObject(int, Object, int, int) throws java.sql.SQLException;
    method public void setRef(int, java.sql.Ref) throws java.sql.SQLException;
    method public void setRowId(int, java.sql.RowId) throws java.sql.SQLException;
    method public void setSQLXML(int, java.sql.SQLXML) throws java.sql.SQLException;
    method public void setShort(int, short) throws java.sql.SQLException;
    method public void setString(int, String) throws java.sql.SQLException;
    method public void setTime(int, java.sql.Time) throws java.sql.SQLException;
    method public void setTime(int, java.sql.Time, java.util.Calendar) throws java.sql.SQLException;
    method public void setTimestamp(int, java.sql.Timestamp) throws java.sql.SQLException;
    method public void setTimestamp(int, java.sql.Timestamp, java.util.Calendar) throws java.sql.SQLException;
    method public void setURL(int, java.net.URL) throws java.sql.SQLException;
    method @Deprecated public void setUnicodeStream(int, java.io.InputStream, int) throws java.sql.SQLException;
  }

  public interface Ref {
    method public String getBaseTypeName() throws java.sql.SQLException;
    method public Object getObject(java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
    method public Object getObject() throws java.sql.SQLException;
    method public void setObject(Object) throws java.sql.SQLException;
  }

  public interface ResultSet extends java.sql.Wrapper java.lang.AutoCloseable {
    method public boolean absolute(int) throws java.sql.SQLException;
    method public void afterLast() throws java.sql.SQLException;
    method public void beforeFirst() throws java.sql.SQLException;
    method public void cancelRowUpdates() throws java.sql.SQLException;
    method public void clearWarnings() throws java.sql.SQLException;
    method public void close() throws java.sql.SQLException;
    method public void deleteRow() throws java.sql.SQLException;
    method public int findColumn(String) throws java.sql.SQLException;
    method public boolean first() throws java.sql.SQLException;
    method public java.sql.Array getArray(int) throws java.sql.SQLException;
    method public java.sql.Array getArray(String) throws java.sql.SQLException;
    method public java.io.InputStream getAsciiStream(int) throws java.sql.SQLException;
    method public java.io.InputStream getAsciiStream(String) throws java.sql.SQLException;
    method @Deprecated public java.math.BigDecimal getBigDecimal(int, int) throws java.sql.SQLException;
    method @Deprecated public java.math.BigDecimal getBigDecimal(String, int) throws java.sql.SQLException;
    method public java.math.BigDecimal getBigDecimal(int) throws java.sql.SQLException;
    method public java.math.BigDecimal getBigDecimal(String) throws java.sql.SQLException;
    method public java.io.InputStream getBinaryStream(int) throws java.sql.SQLException;
    method public java.io.InputStream getBinaryStream(String) throws java.sql.SQLException;
    method public java.sql.Blob getBlob(int) throws java.sql.SQLException;
    method public java.sql.Blob getBlob(String) throws java.sql.SQLException;
    method public boolean getBoolean(int) throws java.sql.SQLException;
    method public boolean getBoolean(String) throws java.sql.SQLException;
    method public byte getByte(int) throws java.sql.SQLException;
    method public byte getByte(String) throws java.sql.SQLException;
    method public byte[] getBytes(int) throws java.sql.SQLException;
    method public byte[] getBytes(String) throws java.sql.SQLException;
    method public java.io.Reader getCharacterStream(int) throws java.sql.SQLException;
    method public java.io.Reader getCharacterStream(String) throws java.sql.SQLException;
    method public java.sql.Clob getClob(int) throws java.sql.SQLException;
    method public java.sql.Clob getClob(String) throws java.sql.SQLException;
    method public int getConcurrency() throws java.sql.SQLException;
    method public String getCursorName() throws java.sql.SQLException;
    method public java.sql.Date getDate(int) throws java.sql.SQLException;
    method public java.sql.Date getDate(String) throws java.sql.SQLException;
    method public java.sql.Date getDate(int, java.util.Calendar) throws java.sql.SQLException;
    method public java.sql.Date getDate(String, java.util.Calendar) throws java.sql.SQLException;
    method public double getDouble(int) throws java.sql.SQLException;
    method public double getDouble(String) throws java.sql.SQLException;
    method public int getFetchDirection() throws java.sql.SQLException;
    method public int getFetchSize() throws java.sql.SQLException;
    method public float getFloat(int) throws java.sql.SQLException;
    method public float getFloat(String) throws java.sql.SQLException;
    method public int getHoldability() throws java.sql.SQLException;
    method public int getInt(int) throws java.sql.SQLException;
    method public int getInt(String) throws java.sql.SQLException;
    method public long getLong(int) throws java.sql.SQLException;
    method public long getLong(String) throws java.sql.SQLException;
    method public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException;
    method public java.io.Reader getNCharacterStream(int) throws java.sql.SQLException;
    method public java.io.Reader getNCharacterStream(String) throws java.sql.SQLException;
    method public java.sql.NClob getNClob(int) throws java.sql.SQLException;
    method public java.sql.NClob getNClob(String) throws java.sql.SQLException;
    method public String getNString(int) throws java.sql.SQLException;
    method public String getNString(String) throws java.sql.SQLException;
    method public Object getObject(int) throws java.sql.SQLException;
    method public Object getObject(String) throws java.sql.SQLException;
    method public Object getObject(int, java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
    method public Object getObject(String, java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
    method public java.sql.Ref getRef(int) throws java.sql.SQLException;
    method public java.sql.Ref getRef(String) throws java.sql.SQLException;
    method public int getRow() throws java.sql.SQLException;
    method public java.sql.RowId getRowId(int) throws java.sql.SQLException;
    method public java.sql.RowId getRowId(String) throws java.sql.SQLException;
    method public java.sql.SQLXML getSQLXML(int) throws java.sql.SQLException;
    method public java.sql.SQLXML getSQLXML(String) throws java.sql.SQLException;
    method public short getShort(int) throws java.sql.SQLException;
    method public short getShort(String) throws java.sql.SQLException;
    method public java.sql.Statement getStatement() throws java.sql.SQLException;
    method public String getString(int) throws java.sql.SQLException;
    method public String getString(String) throws java.sql.SQLException;
    method public java.sql.Time getTime(int) throws java.sql.SQLException;
    method public java.sql.Time getTime(String) throws java.sql.SQLException;
    method public java.sql.Time getTime(int, java.util.Calendar) throws java.sql.SQLException;
    method public java.sql.Time getTime(String, java.util.Calendar) throws java.sql.SQLException;
    method public java.sql.Timestamp getTimestamp(int) throws java.sql.SQLException;
    method public java.sql.Timestamp getTimestamp(String) throws java.sql.SQLException;
    method public java.sql.Timestamp getTimestamp(int, java.util.Calendar) throws java.sql.SQLException;
    method public java.sql.Timestamp getTimestamp(String, java.util.Calendar) throws java.sql.SQLException;
    method public int getType() throws java.sql.SQLException;
    method public java.net.URL getURL(int) throws java.sql.SQLException;
    method public java.net.URL getURL(String) throws java.sql.SQLException;
    method @Deprecated public java.io.InputStream getUnicodeStream(int) throws java.sql.SQLException;
    method @Deprecated public java.io.InputStream getUnicodeStream(String) throws java.sql.SQLException;
    method public java.sql.SQLWarning getWarnings() throws java.sql.SQLException;
    method public void insertRow() throws java.sql.SQLException;
    method public boolean isAfterLast() throws java.sql.SQLException;
    method public boolean isBeforeFirst() throws java.sql.SQLException;
    method public boolean isClosed() throws java.sql.SQLException;
    method public boolean isFirst() throws java.sql.SQLException;
    method public boolean isLast() throws java.sql.SQLException;
    method public boolean last() throws java.sql.SQLException;
    method public void moveToCurrentRow() throws java.sql.SQLException;
    method public void moveToInsertRow() throws java.sql.SQLException;
    method public boolean next() throws java.sql.SQLException;
    method public boolean previous() throws java.sql.SQLException;
    method public void refreshRow() throws java.sql.SQLException;
    method public boolean relative(int) throws java.sql.SQLException;
    method public boolean rowDeleted() throws java.sql.SQLException;
    method public boolean rowInserted() throws java.sql.SQLException;
    method public boolean rowUpdated() throws java.sql.SQLException;
    method public void setFetchDirection(int) throws java.sql.SQLException;
    method public void setFetchSize(int) throws java.sql.SQLException;
    method public void updateArray(int, java.sql.Array) throws java.sql.SQLException;
    method public void updateArray(String, java.sql.Array) throws java.sql.SQLException;
    method public void updateAsciiStream(int, java.io.InputStream, int) throws java.sql.SQLException;
    method public void updateAsciiStream(String, java.io.InputStream, int) throws java.sql.SQLException;
    method public void updateAsciiStream(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public void updateAsciiStream(String, java.io.InputStream, long) throws java.sql.SQLException;
    method public void updateAsciiStream(int, java.io.InputStream) throws java.sql.SQLException;
    method public void updateAsciiStream(String, java.io.InputStream) throws java.sql.SQLException;
    method public void updateBigDecimal(int, java.math.BigDecimal) throws java.sql.SQLException;
    method public void updateBigDecimal(String, java.math.BigDecimal) throws java.sql.SQLException;
    method public void updateBinaryStream(int, java.io.InputStream, int) throws java.sql.SQLException;
    method public void updateBinaryStream(String, java.io.InputStream, int) throws java.sql.SQLException;
    method public void updateBinaryStream(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public void updateBinaryStream(String, java.io.InputStream, long) throws java.sql.SQLException;
    method public void updateBinaryStream(int, java.io.InputStream) throws java.sql.SQLException;
    method public void updateBinaryStream(String, java.io.InputStream) throws java.sql.SQLException;
    method public void updateBlob(int, java.sql.Blob) throws java.sql.SQLException;
    method public void updateBlob(String, java.sql.Blob) throws java.sql.SQLException;
    method public void updateBlob(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public void updateBlob(String, java.io.InputStream, long) throws java.sql.SQLException;
    method public void updateBlob(int, java.io.InputStream) throws java.sql.SQLException;
    method public void updateBlob(String, java.io.InputStream) throws java.sql.SQLException;
    method public void updateBoolean(int, boolean) throws java.sql.SQLException;
    method public void updateBoolean(String, boolean) throws java.sql.SQLException;
    method public void updateByte(int, byte) throws java.sql.SQLException;
    method public void updateByte(String, byte) throws java.sql.SQLException;
    method public void updateBytes(int, byte[]) throws java.sql.SQLException;
    method public void updateBytes(String, byte[]) throws java.sql.SQLException;
    method public void updateCharacterStream(int, java.io.Reader, int) throws java.sql.SQLException;
    method public void updateCharacterStream(String, java.io.Reader, int) throws java.sql.SQLException;
    method public void updateCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
    method public void updateCharacterStream(String, java.io.Reader, long) throws java.sql.SQLException;
    method public void updateCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
    method public void updateCharacterStream(String, java.io.Reader) throws java.sql.SQLException;
    method public void updateClob(int, java.sql.Clob) throws java.sql.SQLException;
    method public void updateClob(String, java.sql.Clob) throws java.sql.SQLException;
    method public void updateClob(int, java.io.Reader, long) throws java.sql.SQLException;
    method public void updateClob(String, java.io.Reader, long) throws java.sql.SQLException;
    method public void updateClob(int, java.io.Reader) throws java.sql.SQLException;
    method public void updateClob(String, java.io.Reader) throws java.sql.SQLException;
    method public void updateDate(int, java.sql.Date) throws java.sql.SQLException;
    method public void updateDate(String, java.sql.Date) throws java.sql.SQLException;
    method public void updateDouble(int, double) throws java.sql.SQLException;
    method public void updateDouble(String, double) throws java.sql.SQLException;
    method public void updateFloat(int, float) throws java.sql.SQLException;
    method public void updateFloat(String, float) throws java.sql.SQLException;
    method public void updateInt(int, int) throws java.sql.SQLException;
    method public void updateInt(String, int) throws java.sql.SQLException;
    method public void updateLong(int, long) throws java.sql.SQLException;
    method public void updateLong(String, long) throws java.sql.SQLException;
    method public void updateNCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
    method public void updateNCharacterStream(String, java.io.Reader, long) throws java.sql.SQLException;
    method public void updateNCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
    method public void updateNCharacterStream(String, java.io.Reader) throws java.sql.SQLException;
    method public void updateNClob(int, java.sql.NClob) throws java.sql.SQLException;
    method public void updateNClob(String, java.sql.NClob) throws java.sql.SQLException;
    method public void updateNClob(int, java.io.Reader, long) throws java.sql.SQLException;
    method public void updateNClob(String, java.io.Reader, long) throws java.sql.SQLException;
    method public void updateNClob(int, java.io.Reader) throws java.sql.SQLException;
    method public void updateNClob(String, java.io.Reader) throws java.sql.SQLException;
    method public void updateNString(int, String) throws java.sql.SQLException;
    method public void updateNString(String, String) throws java.sql.SQLException;
    method public void updateNull(int) throws java.sql.SQLException;
    method public void updateNull(String) throws java.sql.SQLException;
    method public void updateObject(int, Object, int) throws java.sql.SQLException;
    method public void updateObject(int, Object) throws java.sql.SQLException;
    method public void updateObject(String, Object, int) throws java.sql.SQLException;
    method public void updateObject(String, Object) throws java.sql.SQLException;
    method public void updateRef(int, java.sql.Ref) throws java.sql.SQLException;
    method public void updateRef(String, java.sql.Ref) throws java.sql.SQLException;
    method public void updateRow() throws java.sql.SQLException;
    method public void updateRowId(int, java.sql.RowId) throws java.sql.SQLException;
    method public void updateRowId(String, java.sql.RowId) throws java.sql.SQLException;
    method public void updateSQLXML(int, java.sql.SQLXML) throws java.sql.SQLException;
    method public void updateSQLXML(String, java.sql.SQLXML) throws java.sql.SQLException;
    method public void updateShort(int, short) throws java.sql.SQLException;
    method public void updateShort(String, short) throws java.sql.SQLException;
    method public void updateString(int, String) throws java.sql.SQLException;
    method public void updateString(String, String) throws java.sql.SQLException;
    method public void updateTime(int, java.sql.Time) throws java.sql.SQLException;
    method public void updateTime(String, java.sql.Time) throws java.sql.SQLException;
    method public void updateTimestamp(int, java.sql.Timestamp) throws java.sql.SQLException;
    method public void updateTimestamp(String, java.sql.Timestamp) throws java.sql.SQLException;
    method public boolean wasNull() throws java.sql.SQLException;
    field public static final int CLOSE_CURSORS_AT_COMMIT = 2; // 0x2
    field public static final int CONCUR_READ_ONLY = 1007; // 0x3ef
    field public static final int CONCUR_UPDATABLE = 1008; // 0x3f0
    field public static final int FETCH_FORWARD = 1000; // 0x3e8
    field public static final int FETCH_REVERSE = 1001; // 0x3e9
    field public static final int FETCH_UNKNOWN = 1002; // 0x3ea
    field public static final int HOLD_CURSORS_OVER_COMMIT = 1; // 0x1
    field public static final int TYPE_FORWARD_ONLY = 1003; // 0x3eb
    field public static final int TYPE_SCROLL_INSENSITIVE = 1004; // 0x3ec
    field public static final int TYPE_SCROLL_SENSITIVE = 1005; // 0x3ed
  }

  public interface ResultSetMetaData extends java.sql.Wrapper {
    method public String getCatalogName(int) throws java.sql.SQLException;
    method public String getColumnClassName(int) throws java.sql.SQLException;
    method public int getColumnCount() throws java.sql.SQLException;
    method public int getColumnDisplaySize(int) throws java.sql.SQLException;
    method public String getColumnLabel(int) throws java.sql.SQLException;
    method public String getColumnName(int) throws java.sql.SQLException;
    method public int getColumnType(int) throws java.sql.SQLException;
    method public String getColumnTypeName(int) throws java.sql.SQLException;
    method public int getPrecision(int) throws java.sql.SQLException;
    method public int getScale(int) throws java.sql.SQLException;
    method public String getSchemaName(int) throws java.sql.SQLException;
    method public String getTableName(int) throws java.sql.SQLException;
    method public boolean isAutoIncrement(int) throws java.sql.SQLException;
    method public boolean isCaseSensitive(int) throws java.sql.SQLException;
    method public boolean isCurrency(int) throws java.sql.SQLException;
    method public boolean isDefinitelyWritable(int) throws java.sql.SQLException;
    method public int isNullable(int) throws java.sql.SQLException;
    method public boolean isReadOnly(int) throws java.sql.SQLException;
    method public boolean isSearchable(int) throws java.sql.SQLException;
    method public boolean isSigned(int) throws java.sql.SQLException;
    method public boolean isWritable(int) throws java.sql.SQLException;
    field public static final int columnNoNulls = 0; // 0x0
    field public static final int columnNullable = 1; // 0x1
    field public static final int columnNullableUnknown = 2; // 0x2
  }

  public interface RowId {
    method public boolean equals(Object);
    method public byte[] getBytes();
    method public int hashCode();
    method public String toString();
  }

  public enum RowIdLifetime {
    enum_constant public static final java.sql.RowIdLifetime ROWID_UNSUPPORTED;
    enum_constant public static final java.sql.RowIdLifetime ROWID_VALID_FOREVER;
    enum_constant public static final java.sql.RowIdLifetime ROWID_VALID_OTHER;
    enum_constant public static final java.sql.RowIdLifetime ROWID_VALID_SESSION;
    enum_constant public static final java.sql.RowIdLifetime ROWID_VALID_TRANSACTION;
  }

  public class SQLClientInfoException extends java.sql.SQLException {
    ctor public SQLClientInfoException();
    ctor public SQLClientInfoException(java.util.Map<java.lang.String,java.sql.ClientInfoStatus>);
    ctor public SQLClientInfoException(java.util.Map<java.lang.String,java.sql.ClientInfoStatus>, Throwable);
    ctor public SQLClientInfoException(String, java.util.Map<java.lang.String,java.sql.ClientInfoStatus>);
    ctor public SQLClientInfoException(String, java.util.Map<java.lang.String,java.sql.ClientInfoStatus>, Throwable);
    ctor public SQLClientInfoException(String, String, java.util.Map<java.lang.String,java.sql.ClientInfoStatus>);
    ctor public SQLClientInfoException(String, String, java.util.Map<java.lang.String,java.sql.ClientInfoStatus>, Throwable);
    ctor public SQLClientInfoException(String, String, int, java.util.Map<java.lang.String,java.sql.ClientInfoStatus>);
    ctor public SQLClientInfoException(String, String, int, java.util.Map<java.lang.String,java.sql.ClientInfoStatus>, Throwable);
    method public java.util.Map<java.lang.String,java.sql.ClientInfoStatus> getFailedProperties();
  }

  public interface SQLData {
    method public String getSQLTypeName() throws java.sql.SQLException;
    method public void readSQL(java.sql.SQLInput, String) throws java.sql.SQLException;
    method public void writeSQL(java.sql.SQLOutput) throws java.sql.SQLException;
  }

  public class SQLDataException extends java.sql.SQLNonTransientException {
    ctor public SQLDataException();
    ctor public SQLDataException(String);
    ctor public SQLDataException(String, String);
    ctor public SQLDataException(String, String, int);
    ctor public SQLDataException(Throwable);
    ctor public SQLDataException(String, Throwable);
    ctor public SQLDataException(String, String, Throwable);
    ctor public SQLDataException(String, String, int, Throwable);
  }

  public class SQLException extends java.lang.Exception implements java.lang.Iterable<java.lang.Throwable> {
    ctor public SQLException(String, String, int);
    ctor public SQLException(String, String);
    ctor public SQLException(String);
    ctor public SQLException();
    ctor public SQLException(Throwable);
    ctor public SQLException(String, Throwable);
    ctor public SQLException(String, String, Throwable);
    ctor public SQLException(String, String, int, Throwable);
    method public int getErrorCode();
    method public java.sql.SQLException getNextException();
    method public String getSQLState();
    method public java.util.Iterator<java.lang.Throwable> iterator();
    method public void setNextException(java.sql.SQLException);
  }

  public class SQLFeatureNotSupportedException extends java.sql.SQLNonTransientException {
    ctor public SQLFeatureNotSupportedException();
    ctor public SQLFeatureNotSupportedException(String);
    ctor public SQLFeatureNotSupportedException(String, String);
    ctor public SQLFeatureNotSupportedException(String, String, int);
    ctor public SQLFeatureNotSupportedException(Throwable);
    ctor public SQLFeatureNotSupportedException(String, Throwable);
    ctor public SQLFeatureNotSupportedException(String, String, Throwable);
    ctor public SQLFeatureNotSupportedException(String, String, int, Throwable);
  }

  public interface SQLInput {
    method public java.sql.Array readArray() throws java.sql.SQLException;
    method public java.io.InputStream readAsciiStream() throws java.sql.SQLException;
    method public java.math.BigDecimal readBigDecimal() throws java.sql.SQLException;
    method public java.io.InputStream readBinaryStream() throws java.sql.SQLException;
    method public java.sql.Blob readBlob() throws java.sql.SQLException;
    method public boolean readBoolean() throws java.sql.SQLException;
    method public byte readByte() throws java.sql.SQLException;
    method public byte[] readBytes() throws java.sql.SQLException;
    method public java.io.Reader readCharacterStream() throws java.sql.SQLException;
    method public java.sql.Clob readClob() throws java.sql.SQLException;
    method public java.sql.Date readDate() throws java.sql.SQLException;
    method public double readDouble() throws java.sql.SQLException;
    method public float readFloat() throws java.sql.SQLException;
    method public int readInt() throws java.sql.SQLException;
    method public long readLong() throws java.sql.SQLException;
    method public java.sql.NClob readNClob() throws java.sql.SQLException;
    method public String readNString() throws java.sql.SQLException;
    method public Object readObject() throws java.sql.SQLException;
    method public java.sql.Ref readRef() throws java.sql.SQLException;
    method public java.sql.RowId readRowId() throws java.sql.SQLException;
    method public java.sql.SQLXML readSQLXML() throws java.sql.SQLException;
    method public short readShort() throws java.sql.SQLException;
    method public String readString() throws java.sql.SQLException;
    method public java.sql.Time readTime() throws java.sql.SQLException;
    method public java.sql.Timestamp readTimestamp() throws java.sql.SQLException;
    method public java.net.URL readURL() throws java.sql.SQLException;
    method public boolean wasNull() throws java.sql.SQLException;
  }

  public class SQLIntegrityConstraintViolationException extends java.sql.SQLNonTransientException {
    ctor public SQLIntegrityConstraintViolationException();
    ctor public SQLIntegrityConstraintViolationException(String);
    ctor public SQLIntegrityConstraintViolationException(String, String);
    ctor public SQLIntegrityConstraintViolationException(String, String, int);
    ctor public SQLIntegrityConstraintViolationException(Throwable);
    ctor public SQLIntegrityConstraintViolationException(String, Throwable);
    ctor public SQLIntegrityConstraintViolationException(String, String, Throwable);
    ctor public SQLIntegrityConstraintViolationException(String, String, int, Throwable);
  }

  public class SQLInvalidAuthorizationSpecException extends java.sql.SQLNonTransientException {
    ctor public SQLInvalidAuthorizationSpecException();
    ctor public SQLInvalidAuthorizationSpecException(String);
    ctor public SQLInvalidAuthorizationSpecException(String, String);
    ctor public SQLInvalidAuthorizationSpecException(String, String, int);
    ctor public SQLInvalidAuthorizationSpecException(Throwable);
    ctor public SQLInvalidAuthorizationSpecException(String, Throwable);
    ctor public SQLInvalidAuthorizationSpecException(String, String, Throwable);
    ctor public SQLInvalidAuthorizationSpecException(String, String, int, Throwable);
  }

  public class SQLNonTransientConnectionException extends java.sql.SQLNonTransientException {
    ctor public SQLNonTransientConnectionException();
    ctor public SQLNonTransientConnectionException(String);
    ctor public SQLNonTransientConnectionException(String, String);
    ctor public SQLNonTransientConnectionException(String, String, int);
    ctor public SQLNonTransientConnectionException(Throwable);
    ctor public SQLNonTransientConnectionException(String, Throwable);
    ctor public SQLNonTransientConnectionException(String, String, Throwable);
    ctor public SQLNonTransientConnectionException(String, String, int, Throwable);
  }

  public class SQLNonTransientException extends java.sql.SQLException {
    ctor public SQLNonTransientException();
    ctor public SQLNonTransientException(String);
    ctor public SQLNonTransientException(String, String);
    ctor public SQLNonTransientException(String, String, int);
    ctor public SQLNonTransientException(Throwable);
    ctor public SQLNonTransientException(String, Throwable);
    ctor public SQLNonTransientException(String, String, Throwable);
    ctor public SQLNonTransientException(String, String, int, Throwable);
  }

  public interface SQLOutput {
    method public void writeArray(java.sql.Array) throws java.sql.SQLException;
    method public void writeAsciiStream(java.io.InputStream) throws java.sql.SQLException;
    method public void writeBigDecimal(java.math.BigDecimal) throws java.sql.SQLException;
    method public void writeBinaryStream(java.io.InputStream) throws java.sql.SQLException;
    method public void writeBlob(java.sql.Blob) throws java.sql.SQLException;
    method public void writeBoolean(boolean) throws java.sql.SQLException;
    method public void writeByte(byte) throws java.sql.SQLException;
    method public void writeBytes(byte[]) throws java.sql.SQLException;
    method public void writeCharacterStream(java.io.Reader) throws java.sql.SQLException;
    method public void writeClob(java.sql.Clob) throws java.sql.SQLException;
    method public void writeDate(java.sql.Date) throws java.sql.SQLException;
    method public void writeDouble(double) throws java.sql.SQLException;
    method public void writeFloat(float) throws java.sql.SQLException;
    method public void writeInt(int) throws java.sql.SQLException;
    method public void writeLong(long) throws java.sql.SQLException;
    method public void writeNClob(java.sql.NClob) throws java.sql.SQLException;
    method public void writeNString(String) throws java.sql.SQLException;
    method public void writeObject(java.sql.SQLData) throws java.sql.SQLException;
    method public void writeRef(java.sql.Ref) throws java.sql.SQLException;
    method public void writeRowId(java.sql.RowId) throws java.sql.SQLException;
    method public void writeSQLXML(java.sql.SQLXML) throws java.sql.SQLException;
    method public void writeShort(short) throws java.sql.SQLException;
    method public void writeString(String) throws java.sql.SQLException;
    method public void writeStruct(java.sql.Struct) throws java.sql.SQLException;
    method public void writeTime(java.sql.Time) throws java.sql.SQLException;
    method public void writeTimestamp(java.sql.Timestamp) throws java.sql.SQLException;
    method public void writeURL(java.net.URL) throws java.sql.SQLException;
  }

  public final class SQLPermission extends java.security.BasicPermission {
    ctor public SQLPermission(String);
    ctor public SQLPermission(String, String);
  }

  public class SQLRecoverableException extends java.sql.SQLException {
    ctor public SQLRecoverableException();
    ctor public SQLRecoverableException(String);
    ctor public SQLRecoverableException(String, String);
    ctor public SQLRecoverableException(String, String, int);
    ctor public SQLRecoverableException(Throwable);
    ctor public SQLRecoverableException(String, Throwable);
    ctor public SQLRecoverableException(String, String, Throwable);
    ctor public SQLRecoverableException(String, String, int, Throwable);
  }

  public class SQLSyntaxErrorException extends java.sql.SQLNonTransientException {
    ctor public SQLSyntaxErrorException();
    ctor public SQLSyntaxErrorException(String);
    ctor public SQLSyntaxErrorException(String, String);
    ctor public SQLSyntaxErrorException(String, String, int);
    ctor public SQLSyntaxErrorException(Throwable);
    ctor public SQLSyntaxErrorException(String, Throwable);
    ctor public SQLSyntaxErrorException(String, String, Throwable);
    ctor public SQLSyntaxErrorException(String, String, int, Throwable);
  }

  public class SQLTimeoutException extends java.sql.SQLTransientException {
    ctor public SQLTimeoutException();
    ctor public SQLTimeoutException(String);
    ctor public SQLTimeoutException(String, String);
    ctor public SQLTimeoutException(String, String, int);
    ctor public SQLTimeoutException(Throwable);
    ctor public SQLTimeoutException(String, Throwable);
    ctor public SQLTimeoutException(String, String, Throwable);
    ctor public SQLTimeoutException(String, String, int, Throwable);
  }

  public class SQLTransactionRollbackException extends java.sql.SQLTransientException {
    ctor public SQLTransactionRollbackException();
    ctor public SQLTransactionRollbackException(String);
    ctor public SQLTransactionRollbackException(String, String);
    ctor public SQLTransactionRollbackException(String, String, int);
    ctor public SQLTransactionRollbackException(Throwable);
    ctor public SQLTransactionRollbackException(String, Throwable);
    ctor public SQLTransactionRollbackException(String, String, Throwable);
    ctor public SQLTransactionRollbackException(String, String, int, Throwable);
  }

  public class SQLTransientConnectionException extends java.sql.SQLTransientException {
    ctor public SQLTransientConnectionException();
    ctor public SQLTransientConnectionException(String);
    ctor public SQLTransientConnectionException(String, String);
    ctor public SQLTransientConnectionException(String, String, int);
    ctor public SQLTransientConnectionException(Throwable);
    ctor public SQLTransientConnectionException(String, Throwable);
    ctor public SQLTransientConnectionException(String, String, Throwable);
    ctor public SQLTransientConnectionException(String, String, int, Throwable);
  }

  public class SQLTransientException extends java.sql.SQLException {
    ctor public SQLTransientException();
    ctor public SQLTransientException(String);
    ctor public SQLTransientException(String, String);
    ctor public SQLTransientException(String, String, int);
    ctor public SQLTransientException(Throwable);
    ctor public SQLTransientException(String, Throwable);
    ctor public SQLTransientException(String, String, Throwable);
    ctor public SQLTransientException(String, String, int, Throwable);
  }

  public class SQLWarning extends java.sql.SQLException {
    ctor public SQLWarning(String, String, int);
    ctor public SQLWarning(String, String);
    ctor public SQLWarning(String);
    ctor public SQLWarning();
    ctor public SQLWarning(Throwable);
    ctor public SQLWarning(String, Throwable);
    ctor public SQLWarning(String, String, Throwable);
    ctor public SQLWarning(String, String, int, Throwable);
    method public java.sql.SQLWarning getNextWarning();
    method public void setNextWarning(java.sql.SQLWarning);
  }

  public interface SQLXML {
    method public void free() throws java.sql.SQLException;
    method public java.io.InputStream getBinaryStream() throws java.sql.SQLException;
    method public java.io.Reader getCharacterStream() throws java.sql.SQLException;
    method public <T extends javax.xml.transform.Source> T getSource(Class<T>) throws java.sql.SQLException;
    method public String getString() throws java.sql.SQLException;
    method public java.io.OutputStream setBinaryStream() throws java.sql.SQLException;
    method public java.io.Writer setCharacterStream() throws java.sql.SQLException;
    method public <T extends javax.xml.transform.Result> T setResult(Class<T>) throws java.sql.SQLException;
    method public void setString(String) throws java.sql.SQLException;
  }

  public interface Savepoint {
    method public int getSavepointId() throws java.sql.SQLException;
    method public String getSavepointName() throws java.sql.SQLException;
  }

  public interface Statement extends java.sql.Wrapper java.lang.AutoCloseable {
    method public void addBatch(String) throws java.sql.SQLException;
    method public void cancel() throws java.sql.SQLException;
    method public void clearBatch() throws java.sql.SQLException;
    method public void clearWarnings() throws java.sql.SQLException;
    method public void close() throws java.sql.SQLException;
    method public boolean execute(String) throws java.sql.SQLException;
    method public boolean execute(String, int) throws java.sql.SQLException;
    method public boolean execute(String, int[]) throws java.sql.SQLException;
    method public boolean execute(String, String[]) throws java.sql.SQLException;
    method public int[] executeBatch() throws java.sql.SQLException;
    method public java.sql.ResultSet executeQuery(String) throws java.sql.SQLException;
    method public int executeUpdate(String) throws java.sql.SQLException;
    method public int executeUpdate(String, int) throws java.sql.SQLException;
    method public int executeUpdate(String, int[]) throws java.sql.SQLException;
    method public int executeUpdate(String, String[]) throws java.sql.SQLException;
    method public java.sql.Connection getConnection() throws java.sql.SQLException;
    method public int getFetchDirection() throws java.sql.SQLException;
    method public int getFetchSize() throws java.sql.SQLException;
    method public java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException;
    method public int getMaxFieldSize() throws java.sql.SQLException;
    method public int getMaxRows() throws java.sql.SQLException;
    method public boolean getMoreResults() throws java.sql.SQLException;
    method public boolean getMoreResults(int) throws java.sql.SQLException;
    method public int getQueryTimeout() throws java.sql.SQLException;
    method public java.sql.ResultSet getResultSet() throws java.sql.SQLException;
    method public int getResultSetConcurrency() throws java.sql.SQLException;
    method public int getResultSetHoldability() throws java.sql.SQLException;
    method public int getResultSetType() throws java.sql.SQLException;
    method public int getUpdateCount() throws java.sql.SQLException;
    method public java.sql.SQLWarning getWarnings() throws java.sql.SQLException;
    method public boolean isClosed() throws java.sql.SQLException;
    method public boolean isPoolable() throws java.sql.SQLException;
    method public void setCursorName(String) throws java.sql.SQLException;
    method public void setEscapeProcessing(boolean) throws java.sql.SQLException;
    method public void setFetchDirection(int) throws java.sql.SQLException;
    method public void setFetchSize(int) throws java.sql.SQLException;
    method public void setMaxFieldSize(int) throws java.sql.SQLException;
    method public void setMaxRows(int) throws java.sql.SQLException;
    method public void setPoolable(boolean) throws java.sql.SQLException;
    method public void setQueryTimeout(int) throws java.sql.SQLException;
    field public static final int CLOSE_ALL_RESULTS = 3; // 0x3
    field public static final int CLOSE_CURRENT_RESULT = 1; // 0x1
    field public static final int EXECUTE_FAILED = -3; // 0xfffffffd
    field public static final int KEEP_CURRENT_RESULT = 2; // 0x2
    field public static final int NO_GENERATED_KEYS = 2; // 0x2
    field public static final int RETURN_GENERATED_KEYS = 1; // 0x1
    field public static final int SUCCESS_NO_INFO = -2; // 0xfffffffe
  }

  public interface Struct {
    method public Object[] getAttributes() throws java.sql.SQLException;
    method public Object[] getAttributes(java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
    method public String getSQLTypeName() throws java.sql.SQLException;
  }

  public class Time extends java.util.Date {
    ctor @Deprecated public Time(int, int, int);
    ctor public Time(long);
    method public static java.sql.Time valueOf(String);
  }

  public class Timestamp extends java.util.Date {
    ctor @Deprecated public Timestamp(int, int, int, int, int, int, int);
    ctor public Timestamp(long);
    method public boolean after(java.sql.Timestamp);
    method public boolean before(java.sql.Timestamp);
    method public int compareTo(java.sql.Timestamp);
    method public boolean equals(java.sql.Timestamp);
    method public int getNanos();
    method public void setNanos(int);
    method public static java.sql.Timestamp valueOf(String);
  }

  public class Types {
    field public static final int ARRAY = 2003; // 0x7d3
    field public static final int BIGINT = -5; // 0xfffffffb
    field public static final int BINARY = -2; // 0xfffffffe
    field public static final int BIT = -7; // 0xfffffff9
    field public static final int BLOB = 2004; // 0x7d4
    field public static final int BOOLEAN = 16; // 0x10
    field public static final int CHAR = 1; // 0x1
    field public static final int CLOB = 2005; // 0x7d5
    field public static final int DATALINK = 70; // 0x46
    field public static final int DATE = 91; // 0x5b
    field public static final int DECIMAL = 3; // 0x3
    field public static final int DISTINCT = 2001; // 0x7d1
    field public static final int DOUBLE = 8; // 0x8
    field public static final int FLOAT = 6; // 0x6
    field public static final int INTEGER = 4; // 0x4
    field public static final int JAVA_OBJECT = 2000; // 0x7d0
    field public static final int LONGNVARCHAR = -16; // 0xfffffff0
    field public static final int LONGVARBINARY = -4; // 0xfffffffc
    field public static final int LONGVARCHAR = -1; // 0xffffffff
    field public static final int NCHAR = -15; // 0xfffffff1
    field public static final int NCLOB = 2011; // 0x7db
    field public static final int NULL = 0; // 0x0
    field public static final int NUMERIC = 2; // 0x2
    field public static final int NVARCHAR = -9; // 0xfffffff7
    field public static final int OTHER = 1111; // 0x457
    field public static final int REAL = 7; // 0x7
    field public static final int REF = 2006; // 0x7d6
    field public static final int ROWID = -8; // 0xfffffff8
    field public static final int SMALLINT = 5; // 0x5
    field public static final int SQLXML = 2009; // 0x7d9
    field public static final int STRUCT = 2002; // 0x7d2
    field public static final int TIME = 92; // 0x5c
    field public static final int TIMESTAMP = 93; // 0x5d
    field public static final int TINYINT = -6; // 0xfffffffa
    field public static final int VARBINARY = -3; // 0xfffffffd
    field public static final int VARCHAR = 12; // 0xc
  }

  public interface Wrapper {
    method public boolean isWrapperFor(Class<?>) throws java.sql.SQLException;
    method public <T> T unwrap(Class<T>) throws java.sql.SQLException;
  }

}

package java.text {

  public class Annotation {
    ctor public Annotation(Object);
    method public Object getValue();
  }

  public interface AttributedCharacterIterator extends java.text.CharacterIterator {
    method public java.util.Set<java.text.AttributedCharacterIterator.Attribute> getAllAttributeKeys();
    method public Object getAttribute(java.text.AttributedCharacterIterator.Attribute);
    method public java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> getAttributes();
    method public int getRunLimit();
    method public int getRunLimit(java.text.AttributedCharacterIterator.Attribute);
    method public int getRunLimit(java.util.Set<? extends java.text.AttributedCharacterIterator.Attribute>);
    method public int getRunStart();
    method public int getRunStart(java.text.AttributedCharacterIterator.Attribute);
    method public int getRunStart(java.util.Set<? extends java.text.AttributedCharacterIterator.Attribute>);
  }

  public static class AttributedCharacterIterator.Attribute implements java.io.Serializable {
    ctor protected AttributedCharacterIterator.Attribute(String);
    method public final boolean equals(Object);
    method protected String getName();
    method public final int hashCode();
    method protected Object readResolve() throws java.io.InvalidObjectException;
    field public static final java.text.AttributedCharacterIterator.Attribute INPUT_METHOD_SEGMENT;
    field public static final java.text.AttributedCharacterIterator.Attribute LANGUAGE;
    field public static final java.text.AttributedCharacterIterator.Attribute READING;
  }

  public class AttributedString {
    ctor public AttributedString(String);
    ctor public AttributedString(String, java.util.Map<? extends java.text.AttributedCharacterIterator.Attribute,?>);
    ctor public AttributedString(java.text.AttributedCharacterIterator);
    ctor public AttributedString(java.text.AttributedCharacterIterator, int, int);
    ctor public AttributedString(java.text.AttributedCharacterIterator, int, int, java.text.AttributedCharacterIterator.Attribute[]);
    method public void addAttribute(java.text.AttributedCharacterIterator.Attribute, Object);
    method public void addAttribute(java.text.AttributedCharacterIterator.Attribute, Object, int, int);
    method public void addAttributes(java.util.Map<? extends java.text.AttributedCharacterIterator.Attribute,?>, int, int);
    method public java.text.AttributedCharacterIterator getIterator();
    method public java.text.AttributedCharacterIterator getIterator(java.text.AttributedCharacterIterator.Attribute[]);
    method public java.text.AttributedCharacterIterator getIterator(java.text.AttributedCharacterIterator.Attribute[], int, int);
  }

  public final class Bidi {
    ctor public Bidi(String, int);
    ctor public Bidi(java.text.AttributedCharacterIterator);
    ctor public Bidi(char[], int, byte[], int, int, int);
    method public boolean baseIsLeftToRight();
    method public java.text.Bidi createLineBidi(int, int);
    method public int getBaseLevel();
    method public int getLength();
    method public int getLevelAt(int);
    method public int getRunCount();
    method public int getRunLevel(int);
    method public int getRunLimit(int);
    method public int getRunStart(int);
    method public boolean isLeftToRight();
    method public boolean isMixed();
    method public boolean isRightToLeft();
    method public static void reorderVisually(byte[], int, Object[], int, int);
    method public static boolean requiresBidi(char[], int, int);
    field public static final int DIRECTION_DEFAULT_LEFT_TO_RIGHT = -2; // 0xfffffffe
    field public static final int DIRECTION_DEFAULT_RIGHT_TO_LEFT = -1; // 0xffffffff
    field public static final int DIRECTION_LEFT_TO_RIGHT = 0; // 0x0
    field public static final int DIRECTION_RIGHT_TO_LEFT = 1; // 0x1
  }

  public abstract class BreakIterator implements java.lang.Cloneable {
    ctor protected BreakIterator();
    method public Object clone();
    method public abstract int current();
    method public abstract int first();
    method public abstract int following(int);
    method public static java.util.Locale[] getAvailableLocales();
    method public static java.text.BreakIterator getCharacterInstance();
    method public static java.text.BreakIterator getCharacterInstance(java.util.Locale);
    method public static java.text.BreakIterator getLineInstance();
    method public static java.text.BreakIterator getLineInstance(java.util.Locale);
    method public static java.text.BreakIterator getSentenceInstance();
    method public static java.text.BreakIterator getSentenceInstance(java.util.Locale);
    method public abstract java.text.CharacterIterator getText();
    method public static java.text.BreakIterator getWordInstance();
    method public static java.text.BreakIterator getWordInstance(java.util.Locale);
    method public boolean isBoundary(int);
    method public abstract int last();
    method public abstract int next(int);
    method public abstract int next();
    method public int preceding(int);
    method public abstract int previous();
    method public void setText(String);
    method public abstract void setText(java.text.CharacterIterator);
    field public static final int DONE = -1; // 0xffffffff
  }

  public interface CharacterIterator extends java.lang.Cloneable {
    method public Object clone();
    method public char current();
    method public char first();
    method public int getBeginIndex();
    method public int getEndIndex();
    method public int getIndex();
    method public char last();
    method public char next();
    method public char previous();
    method public char setIndex(int);
    field public static final char DONE = 65535; // 0xffff '\uffff'
  }

  public class ChoiceFormat extends java.text.NumberFormat {
    ctor public ChoiceFormat(String);
    ctor public ChoiceFormat(double[], String[]);
    method public void applyPattern(String);
    method public StringBuffer format(long, StringBuffer, java.text.FieldPosition);
    method public StringBuffer format(double, StringBuffer, java.text.FieldPosition);
    method public Object[] getFormats();
    method public double[] getLimits();
    method public static final double nextDouble(double);
    method public static double nextDouble(double, boolean);
    method public Number parse(String, java.text.ParsePosition);
    method public static final double previousDouble(double);
    method public void setChoices(double[], String[]);
    method public String toPattern();
  }

  public final class CollationElementIterator {
    method public int getMaxExpansion(int);
    method public int getOffset();
    method public int next();
    method public int previous();
    method public static int primaryOrder(int);
    method public void reset();
    method public static short secondaryOrder(int);
    method public void setOffset(int);
    method public void setText(String);
    method public void setText(java.text.CharacterIterator);
    method public static short tertiaryOrder(int);
    field public static final int NULLORDER = -1; // 0xffffffff
  }

  public abstract class CollationKey implements java.lang.Comparable<java.text.CollationKey> {
    ctor protected CollationKey(String);
    method public abstract int compareTo(java.text.CollationKey);
    method public String getSourceString();
    method public abstract byte[] toByteArray();
  }

  public abstract class Collator implements java.lang.Cloneable java.util.Comparator<java.lang.Object> {
    ctor protected Collator();
    method public Object clone();
    method public abstract int compare(String, String);
    method public int compare(Object, Object);
    method public boolean equals(String, String);
    method public static java.util.Locale[] getAvailableLocales();
    method public abstract java.text.CollationKey getCollationKey(String);
    method public int getDecomposition();
    method public static java.text.Collator getInstance();
    method public static java.text.Collator getInstance(java.util.Locale);
    method public int getStrength();
    method public abstract int hashCode();
    method public void setDecomposition(int);
    method public void setStrength(int);
    field public static final int CANONICAL_DECOMPOSITION = 1; // 0x1
    field public static final int FULL_DECOMPOSITION = 2; // 0x2
    field public static final int IDENTICAL = 3; // 0x3
    field public static final int NO_DECOMPOSITION = 0; // 0x0
    field public static final int PRIMARY = 0; // 0x0
    field public static final int SECONDARY = 1; // 0x1
    field public static final int TERTIARY = 2; // 0x2
  }

  public abstract class DateFormat extends java.text.Format {
    ctor protected DateFormat();
    method @NonNull public final StringBuffer format(@NonNull Object, @NonNull StringBuffer, @NonNull java.text.FieldPosition);
    method @NonNull public abstract StringBuffer format(@NonNull java.util.Date, @NonNull StringBuffer, @NonNull java.text.FieldPosition);
    method @NonNull public final String format(@NonNull java.util.Date);
    method @NonNull public static java.util.Locale[] getAvailableLocales();
    method @NonNull public java.util.Calendar getCalendar();
    method @NonNull public static final java.text.DateFormat getDateInstance();
    method @NonNull public static final java.text.DateFormat getDateInstance(int);
    method @NonNull public static final java.text.DateFormat getDateInstance(int, @NonNull java.util.Locale);
    method @NonNull public static final java.text.DateFormat getDateTimeInstance();
    method @NonNull public static final java.text.DateFormat getDateTimeInstance(int, int);
    method @NonNull public static final java.text.DateFormat getDateTimeInstance(int, int, @NonNull java.util.Locale);
    method @NonNull public static final java.text.DateFormat getInstance();
    method @NonNull public java.text.NumberFormat getNumberFormat();
    method @NonNull public static final java.text.DateFormat getTimeInstance();
    method @NonNull public static final java.text.DateFormat getTimeInstance(int);
    method @NonNull public static final java.text.DateFormat getTimeInstance(int, @NonNull java.util.Locale);
    method @NonNull public java.util.TimeZone getTimeZone();
    method public boolean isLenient();
    method @Nullable public java.util.Date parse(@NonNull String) throws java.text.ParseException;
    method @Nullable public abstract java.util.Date parse(@NonNull String, @NonNull java.text.ParsePosition);
    method @Nullable public Object parseObject(@NonNull String, @NonNull java.text.ParsePosition);
    method public void setCalendar(@NonNull java.util.Calendar);
    method public void setLenient(boolean);
    method public void setNumberFormat(@NonNull java.text.NumberFormat);
    method public void setTimeZone(@NonNull java.util.TimeZone);
    field public static final int AM_PM_FIELD = 14; // 0xe
    field public static final int DATE_FIELD = 3; // 0x3
    field public static final int DAY_OF_WEEK_FIELD = 9; // 0x9
    field public static final int DAY_OF_WEEK_IN_MONTH_FIELD = 11; // 0xb
    field public static final int DAY_OF_YEAR_FIELD = 10; // 0xa
    field public static final int DEFAULT = 2; // 0x2
    field public static final int ERA_FIELD = 0; // 0x0
    field public static final int FULL = 0; // 0x0
    field public static final int HOUR0_FIELD = 16; // 0x10
    field public static final int HOUR1_FIELD = 15; // 0xf
    field public static final int HOUR_OF_DAY0_FIELD = 5; // 0x5
    field public static final int HOUR_OF_DAY1_FIELD = 4; // 0x4
    field public static final int LONG = 1; // 0x1
    field public static final int MEDIUM = 2; // 0x2
    field public static final int MILLISECOND_FIELD = 8; // 0x8
    field public static final int MINUTE_FIELD = 6; // 0x6
    field public static final int MONTH_FIELD = 2; // 0x2
    field public static final int SECOND_FIELD = 7; // 0x7
    field public static final int SHORT = 3; // 0x3
    field public static final int TIMEZONE_FIELD = 17; // 0x11
    field public static final int WEEK_OF_MONTH_FIELD = 13; // 0xd
    field public static final int WEEK_OF_YEAR_FIELD = 12; // 0xc
    field public static final int YEAR_FIELD = 1; // 0x1
    field @NonNull protected java.util.Calendar calendar;
    field @NonNull protected java.text.NumberFormat numberFormat;
  }

  public static class DateFormat.Field extends java.text.Format.Field {
    ctor protected DateFormat.Field(@NonNull String, int);
    method public int getCalendarField();
    method @NonNull public static java.text.DateFormat.Field ofCalendarField(int);
    field @NonNull public static final java.text.DateFormat.Field AM_PM;
    field @NonNull public static final java.text.DateFormat.Field DAY_OF_MONTH;
    field @NonNull public static final java.text.DateFormat.Field DAY_OF_WEEK;
    field @NonNull public static final java.text.DateFormat.Field DAY_OF_WEEK_IN_MONTH;
    field @NonNull public static final java.text.DateFormat.Field DAY_OF_YEAR;
    field @NonNull public static final java.text.DateFormat.Field ERA;
    field @NonNull public static final java.text.DateFormat.Field HOUR0;
    field @NonNull public static final java.text.DateFormat.Field HOUR1;
    field @NonNull public static final java.text.DateFormat.Field HOUR_OF_DAY0;
    field @NonNull public static final java.text.DateFormat.Field HOUR_OF_DAY1;
    field @NonNull public static final java.text.DateFormat.Field MILLISECOND;
    field @NonNull public static final java.text.DateFormat.Field MINUTE;
    field @NonNull public static final java.text.DateFormat.Field MONTH;
    field @NonNull public static final java.text.DateFormat.Field SECOND;
    field @NonNull public static final java.text.DateFormat.Field TIME_ZONE;
    field @NonNull public static final java.text.DateFormat.Field WEEK_OF_MONTH;
    field @NonNull public static final java.text.DateFormat.Field WEEK_OF_YEAR;
    field @NonNull public static final java.text.DateFormat.Field YEAR;
  }

  public class DateFormatSymbols implements java.lang.Cloneable java.io.Serializable {
    ctor public DateFormatSymbols();
    ctor public DateFormatSymbols(java.util.Locale);
    method public Object clone();
    method public String[] getAmPmStrings();
    method public static java.util.Locale[] getAvailableLocales();
    method public String[] getEras();
    method public static final java.text.DateFormatSymbols getInstance();
    method public static final java.text.DateFormatSymbols getInstance(java.util.Locale);
    method public String getLocalPatternChars();
    method public String[] getMonths();
    method public String[] getShortMonths();
    method public String[] getShortWeekdays();
    method public String[] getWeekdays();
    method public String[][] getZoneStrings();
    method public void setAmPmStrings(String[]);
    method public void setEras(String[]);
    method public void setLocalPatternChars(String);
    method public void setMonths(String[]);
    method public void setShortMonths(String[]);
    method public void setShortWeekdays(String[]);
    method public void setWeekdays(String[]);
    method public void setZoneStrings(String[][]);
  }

  public class DecimalFormat extends java.text.NumberFormat {
    ctor public DecimalFormat();
    ctor public DecimalFormat(String);
    ctor public DecimalFormat(String, java.text.DecimalFormatSymbols);
    method public void applyLocalizedPattern(String);
    method public void applyPattern(String);
    method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
    method public StringBuffer format(double, StringBuffer, java.text.FieldPosition);
    method public StringBuffer format(long, StringBuffer, java.text.FieldPosition);
    method public java.text.DecimalFormatSymbols getDecimalFormatSymbols();
    method public int getGroupingSize();
    method public int getMultiplier();
    method public String getNegativePrefix();
    method public String getNegativeSuffix();
    method public String getPositivePrefix();
    method public String getPositiveSuffix();
    method public boolean isDecimalSeparatorAlwaysShown();
    method public boolean isParseBigDecimal();
    method public Number parse(String, java.text.ParsePosition);
    method public void setDecimalFormatSymbols(java.text.DecimalFormatSymbols);
    method public void setDecimalSeparatorAlwaysShown(boolean);
    method public void setGroupingSize(int);
    method public void setMultiplier(int);
    method public void setNegativePrefix(String);
    method public void setNegativeSuffix(String);
    method public void setParseBigDecimal(boolean);
    method public void setPositivePrefix(String);
    method public void setPositiveSuffix(String);
    method public String toLocalizedPattern();
    method public String toPattern();
  }

  public class DecimalFormatSymbols implements java.lang.Cloneable java.io.Serializable {
    ctor public DecimalFormatSymbols();
    ctor public DecimalFormatSymbols(java.util.Locale);
    method public Object clone();
    method public static java.util.Locale[] getAvailableLocales();
    method public java.util.Currency getCurrency();
    method public String getCurrencySymbol();
    method public char getDecimalSeparator();
    method public char getDigit();
    method public String getExponentSeparator();
    method public char getGroupingSeparator();
    method public String getInfinity();
    method public static final java.text.DecimalFormatSymbols getInstance();
    method public static final java.text.DecimalFormatSymbols getInstance(java.util.Locale);
    method public String getInternationalCurrencySymbol();
    method public char getMinusSign();
    method public char getMonetaryDecimalSeparator();
    method public String getNaN();
    method public char getPatternSeparator();
    method public char getPerMill();
    method public char getPercent();
    method public char getZeroDigit();
    method public void setCurrency(java.util.Currency);
    method public void setCurrencySymbol(String);
    method public void setDecimalSeparator(char);
    method public void setDigit(char);
    method public void setExponentSeparator(String);
    method public void setGroupingSeparator(char);
    method public void setInfinity(String);
    method public void setInternationalCurrencySymbol(String);
    method public void setMinusSign(char);
    method public void setMonetaryDecimalSeparator(char);
    method public void setNaN(String);
    method public void setPatternSeparator(char);
    method public void setPerMill(char);
    method public void setPercent(char);
    method public void setZeroDigit(char);
  }

  public class FieldPosition {
    ctor public FieldPosition(int);
    ctor public FieldPosition(java.text.Format.Field);
    ctor public FieldPosition(java.text.Format.Field, int);
    method public int getBeginIndex();
    method public int getEndIndex();
    method public int getField();
    method public java.text.Format.Field getFieldAttribute();
    method public void setBeginIndex(int);
    method public void setEndIndex(int);
  }

  public abstract class Format implements java.lang.Cloneable java.io.Serializable {
    ctor protected Format();
    method public Object clone();
    method public final String format(Object);
    method public abstract StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
    method public java.text.AttributedCharacterIterator formatToCharacterIterator(Object);
    method public abstract Object parseObject(String, java.text.ParsePosition);
    method public Object parseObject(String) throws java.text.ParseException;
  }

  public static class Format.Field extends java.text.AttributedCharacterIterator.Attribute {
    ctor protected Format.Field(String);
  }

  public class MessageFormat extends java.text.Format {
    ctor public MessageFormat(String);
    ctor public MessageFormat(String, java.util.Locale);
    method public void applyPattern(String);
    method public final StringBuffer format(Object[], StringBuffer, java.text.FieldPosition);
    method public static String format(String, java.lang.Object...);
    method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
    method public java.text.Format[] getFormats();
    method public java.text.Format[] getFormatsByArgumentIndex();
    method public java.util.Locale getLocale();
    method public Object[] parse(String, java.text.ParsePosition);
    method public Object[] parse(String) throws java.text.ParseException;
    method public Object parseObject(String, java.text.ParsePosition);
    method public void setFormat(int, java.text.Format);
    method public void setFormatByArgumentIndex(int, java.text.Format);
    method public void setFormats(java.text.Format[]);
    method public void setFormatsByArgumentIndex(java.text.Format[]);
    method public void setLocale(java.util.Locale);
    method public String toPattern();
  }

  public static class MessageFormat.Field extends java.text.Format.Field {
    ctor protected MessageFormat.Field(String);
    field public static final java.text.MessageFormat.Field ARGUMENT;
  }

  public final class Normalizer {
    method public static boolean isNormalized(CharSequence, java.text.Normalizer.Form);
    method public static String normalize(CharSequence, java.text.Normalizer.Form);
  }

  public enum Normalizer.Form {
    enum_constant public static final java.text.Normalizer.Form NFC;
    enum_constant public static final java.text.Normalizer.Form NFD;
    enum_constant public static final java.text.Normalizer.Form NFKC;
    enum_constant public static final java.text.Normalizer.Form NFKD;
  }

  public abstract class NumberFormat extends java.text.Format {
    ctor protected NumberFormat();
    method @NonNull public StringBuffer format(@NonNull Object, @NonNull StringBuffer, @NonNull java.text.FieldPosition);
    method @NonNull public final String format(double);
    method @NonNull public final String format(long);
    method @NonNull public abstract StringBuffer format(double, @NonNull StringBuffer, @NonNull java.text.FieldPosition);
    method @NonNull public abstract StringBuffer format(long, @NonNull StringBuffer, @NonNull java.text.FieldPosition);
    method @NonNull public static java.util.Locale[] getAvailableLocales();
    method @Nullable public java.util.Currency getCurrency();
    method @NonNull public static final java.text.NumberFormat getCurrencyInstance();
    method @NonNull public static java.text.NumberFormat getCurrencyInstance(@NonNull java.util.Locale);
    method @NonNull public static final java.text.NumberFormat getInstance();
    method @NonNull public static java.text.NumberFormat getInstance(@NonNull java.util.Locale);
    method @NonNull public static final java.text.NumberFormat getIntegerInstance();
    method @NonNull public static java.text.NumberFormat getIntegerInstance(@NonNull java.util.Locale);
    method public int getMaximumFractionDigits();
    method public int getMaximumIntegerDigits();
    method public int getMinimumFractionDigits();
    method public int getMinimumIntegerDigits();
    method @NonNull public static final java.text.NumberFormat getNumberInstance();
    method @NonNull public static java.text.NumberFormat getNumberInstance(@NonNull java.util.Locale);
    method @NonNull public static final java.text.NumberFormat getPercentInstance();
    method @NonNull public static java.text.NumberFormat getPercentInstance(@NonNull java.util.Locale);
    method @NonNull public java.math.RoundingMode getRoundingMode();
    method public boolean isGroupingUsed();
    method public boolean isParseIntegerOnly();
    method @Nullable public abstract Number parse(@NonNull String, @NonNull java.text.ParsePosition);
    method @Nullable public Number parse(@NonNull String) throws java.text.ParseException;
    method @Nullable public final Object parseObject(@NonNull String, @NonNull java.text.ParsePosition);
    method public void setCurrency(@NonNull java.util.Currency);
    method public void setGroupingUsed(boolean);
    method public void setMaximumFractionDigits(int);
    method public void setMaximumIntegerDigits(int);
    method public void setMinimumFractionDigits(int);
    method public void setMinimumIntegerDigits(int);
    method public void setParseIntegerOnly(boolean);
    method public void setRoundingMode(@Nullable java.math.RoundingMode);
    field public static final int FRACTION_FIELD = 1; // 0x1
    field public static final int INTEGER_FIELD = 0; // 0x0
  }

  public static class NumberFormat.Field extends java.text.Format.Field {
    ctor protected NumberFormat.Field(@NonNull String);
    field @NonNull public static final java.text.NumberFormat.Field CURRENCY;
    field @NonNull public static final java.text.NumberFormat.Field DECIMAL_SEPARATOR;
    field @NonNull public static final java.text.NumberFormat.Field EXPONENT;
    field @NonNull public static final java.text.NumberFormat.Field EXPONENT_SIGN;
    field @NonNull public static final java.text.NumberFormat.Field EXPONENT_SYMBOL;
    field @NonNull public static final java.text.NumberFormat.Field FRACTION;
    field @NonNull public static final java.text.NumberFormat.Field GROUPING_SEPARATOR;
    field @NonNull public static final java.text.NumberFormat.Field INTEGER;
    field @NonNull public static final java.text.NumberFormat.Field PERCENT;
    field @NonNull public static final java.text.NumberFormat.Field PERMILLE;
    field @NonNull public static final java.text.NumberFormat.Field SIGN;
  }

  public class ParseException extends java.lang.Exception {
    ctor public ParseException(String, int);
    method public int getErrorOffset();
  }

  public class ParsePosition {
    ctor public ParsePosition(int);
    method public int getErrorIndex();
    method public int getIndex();
    method public void setErrorIndex(int);
    method public void setIndex(int);
  }

  public class RuleBasedCollator extends java.text.Collator {
    ctor public RuleBasedCollator(String) throws java.text.ParseException;
    method public int compare(String, String);
    method public java.text.CollationElementIterator getCollationElementIterator(String);
    method public java.text.CollationElementIterator getCollationElementIterator(java.text.CharacterIterator);
    method public java.text.CollationKey getCollationKey(String);
    method public String getRules();
  }

  public class SimpleDateFormat extends java.text.DateFormat {
    ctor public SimpleDateFormat();
    ctor public SimpleDateFormat(String);
    ctor public SimpleDateFormat(String, java.util.Locale);
    ctor public SimpleDateFormat(String, java.text.DateFormatSymbols);
    method public void applyLocalizedPattern(String);
    method public void applyPattern(String);
    method public StringBuffer format(java.util.Date, StringBuffer, java.text.FieldPosition);
    method public java.util.Date get2DigitYearStart();
    method public java.text.DateFormatSymbols getDateFormatSymbols();
    method public java.util.Date parse(String, java.text.ParsePosition);
    method public void set2DigitYearStart(java.util.Date);
    method public void setDateFormatSymbols(java.text.DateFormatSymbols);
    method public String toLocalizedPattern();
    method public String toPattern();
  }

  public final class StringCharacterIterator implements java.text.CharacterIterator {
    ctor public StringCharacterIterator(String);
    ctor public StringCharacterIterator(String, int);
    ctor public StringCharacterIterator(String, int, int, int);
    method public Object clone();
    method public char current();
    method public char first();
    method public int getBeginIndex();
    method public int getEndIndex();
    method public int getIndex();
    method public char last();
    method public char next();
    method public char previous();
    method public char setIndex(int);
    method public void setText(String);
  }

}

package java.time {

  public abstract class Clock {
    ctor protected Clock();
    method public static java.time.Clock fixed(java.time.Instant, java.time.ZoneId);
    method public abstract java.time.ZoneId getZone();
    method public abstract java.time.Instant instant();
    method public long millis();
    method public static java.time.Clock offset(java.time.Clock, java.time.Duration);
    method public static java.time.Clock system(java.time.ZoneId);
    method public static java.time.Clock systemDefaultZone();
    method public static java.time.Clock systemUTC();
    method public static java.time.Clock tick(java.time.Clock, java.time.Duration);
    method public static java.time.Clock tickMinutes(java.time.ZoneId);
    method public static java.time.Clock tickSeconds(java.time.ZoneId);
    method public abstract java.time.Clock withZone(java.time.ZoneId);
  }

  public class DateTimeException extends java.lang.RuntimeException {
    ctor public DateTimeException(String);
    ctor public DateTimeException(String, Throwable);
  }

  public enum DayOfWeek implements java.time.temporal.TemporalAccessor java.time.temporal.TemporalAdjuster {
    method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public static java.time.DayOfWeek from(java.time.temporal.TemporalAccessor);
    method public String getDisplayName(java.time.format.TextStyle, java.util.Locale);
    method public long getLong(java.time.temporal.TemporalField);
    method public int getValue();
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public java.time.DayOfWeek minus(long);
    method public static java.time.DayOfWeek of(int);
    method public java.time.DayOfWeek plus(long);
    enum_constant public static final java.time.DayOfWeek FRIDAY;
    enum_constant public static final java.time.DayOfWeek MONDAY;
    enum_constant public static final java.time.DayOfWeek SATURDAY;
    enum_constant public static final java.time.DayOfWeek SUNDAY;
    enum_constant public static final java.time.DayOfWeek THURSDAY;
    enum_constant public static final java.time.DayOfWeek TUESDAY;
    enum_constant public static final java.time.DayOfWeek WEDNESDAY;
  }

  public final class Duration implements java.lang.Comparable<java.time.Duration> java.io.Serializable java.time.temporal.TemporalAmount {
    method public java.time.Duration abs();
    method public java.time.temporal.Temporal addTo(java.time.temporal.Temporal);
    method public static java.time.Duration between(java.time.temporal.Temporal, java.time.temporal.Temporal);
    method public int compareTo(java.time.Duration);
    method public java.time.Duration dividedBy(long);
    method public static java.time.Duration from(java.time.temporal.TemporalAmount);
    method public long get(java.time.temporal.TemporalUnit);
    method public int getNano();
    method public long getSeconds();
    method public java.util.List<java.time.temporal.TemporalUnit> getUnits();
    method public boolean isNegative();
    method public boolean isZero();
    method public java.time.Duration minus(java.time.Duration);
    method public java.time.Duration minus(long, java.time.temporal.TemporalUnit);
    method public java.time.Duration minusDays(long);
    method public java.time.Duration minusHours(long);
    method public java.time.Duration minusMillis(long);
    method public java.time.Duration minusMinutes(long);
    method public java.time.Duration minusNanos(long);
    method public java.time.Duration minusSeconds(long);
    method public java.time.Duration multipliedBy(long);
    method public java.time.Duration negated();
    method public static java.time.Duration of(long, java.time.temporal.TemporalUnit);
    method public static java.time.Duration ofDays(long);
    method public static java.time.Duration ofHours(long);
    method public static java.time.Duration ofMillis(long);
    method public static java.time.Duration ofMinutes(long);
    method public static java.time.Duration ofNanos(long);
    method public static java.time.Duration ofSeconds(long);
    method public static java.time.Duration ofSeconds(long, long);
    method public static java.time.Duration parse(CharSequence);
    method public java.time.Duration plus(java.time.Duration);
    method public java.time.Duration plus(long, java.time.temporal.TemporalUnit);
    method public java.time.Duration plusDays(long);
    method public java.time.Duration plusHours(long);
    method public java.time.Duration plusMillis(long);
    method public java.time.Duration plusMinutes(long);
    method public java.time.Duration plusNanos(long);
    method public java.time.Duration plusSeconds(long);
    method public java.time.temporal.Temporal subtractFrom(java.time.temporal.Temporal);
    method public long toDays();
    method public long toHours();
    method public long toMillis();
    method public long toMinutes();
    method public long toNanos();
    method public java.time.Duration withNanos(int);
    method public java.time.Duration withSeconds(long);
    field public static final java.time.Duration ZERO;
  }

  public final class Instant implements java.lang.Comparable<java.time.Instant> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public java.time.OffsetDateTime atOffset(java.time.ZoneOffset);
    method public java.time.ZonedDateTime atZone(java.time.ZoneId);
    method public int compareTo(java.time.Instant);
    method public static java.time.Instant from(java.time.temporal.TemporalAccessor);
    method public long getEpochSecond();
    method public long getLong(java.time.temporal.TemporalField);
    method public int getNano();
    method public boolean isAfter(java.time.Instant);
    method public boolean isBefore(java.time.Instant);
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public boolean isSupported(java.time.temporal.TemporalUnit);
    method public java.time.Instant minus(java.time.temporal.TemporalAmount);
    method public java.time.Instant minus(long, java.time.temporal.TemporalUnit);
    method public java.time.Instant minusMillis(long);
    method public java.time.Instant minusNanos(long);
    method public java.time.Instant minusSeconds(long);
    method public static java.time.Instant now();
    method public static java.time.Instant now(java.time.Clock);
    method public static java.time.Instant ofEpochMilli(long);
    method public static java.time.Instant ofEpochSecond(long);
    method public static java.time.Instant ofEpochSecond(long, long);
    method public static java.time.Instant parse(CharSequence);
    method public java.time.Instant plus(java.time.temporal.TemporalAmount);
    method public java.time.Instant plus(long, java.time.temporal.TemporalUnit);
    method public java.time.Instant plusMillis(long);
    method public java.time.Instant plusNanos(long);
    method public java.time.Instant plusSeconds(long);
    method public long toEpochMilli();
    method public java.time.Instant truncatedTo(java.time.temporal.TemporalUnit);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.Instant with(java.time.temporal.TemporalAdjuster);
    method public java.time.Instant with(java.time.temporal.TemporalField, long);
    field public static final java.time.Instant EPOCH;
    field public static final java.time.Instant MAX;
    field public static final java.time.Instant MIN;
  }

  public final class LocalDate implements java.time.chrono.ChronoLocalDate java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public java.time.LocalDateTime atStartOfDay();
    method public java.time.ZonedDateTime atStartOfDay(java.time.ZoneId);
    method public java.time.LocalDateTime atTime(java.time.LocalTime);
    method public java.time.LocalDateTime atTime(int, int);
    method public java.time.LocalDateTime atTime(int, int, int);
    method public java.time.LocalDateTime atTime(int, int, int, int);
    method public java.time.OffsetDateTime atTime(java.time.OffsetTime);
    method public static java.time.LocalDate from(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.IsoChronology getChronology();
    method public int getDayOfMonth();
    method public java.time.DayOfWeek getDayOfWeek();
    method public int getDayOfYear();
    method public long getLong(java.time.temporal.TemporalField);
    method public java.time.Month getMonth();
    method public int getMonthValue();
    method public int getYear();
    method public int lengthOfMonth();
    method public java.time.LocalDate minus(java.time.temporal.TemporalAmount);
    method public java.time.LocalDate minus(long, java.time.temporal.TemporalUnit);
    method public java.time.LocalDate minusDays(long);
    method public java.time.LocalDate minusMonths(long);
    method public java.time.LocalDate minusWeeks(long);
    method public java.time.LocalDate minusYears(long);
    method public static java.time.LocalDate now();
    method public static java.time.LocalDate now(java.time.ZoneId);
    method public static java.time.LocalDate now(java.time.Clock);
    method public static java.time.LocalDate of(int, java.time.Month, int);
    method public static java.time.LocalDate of(int, int, int);
    method public static java.time.LocalDate ofEpochDay(long);
    method public static java.time.LocalDate ofYearDay(int, int);
    method public static java.time.LocalDate parse(CharSequence);
    method public static java.time.LocalDate parse(CharSequence, java.time.format.DateTimeFormatter);
    method public java.time.LocalDate plus(java.time.temporal.TemporalAmount);
    method public java.time.LocalDate plus(long, java.time.temporal.TemporalUnit);
    method public java.time.LocalDate plusDays(long);
    method public java.time.LocalDate plusMonths(long);
    method public java.time.LocalDate plusWeeks(long);
    method public java.time.LocalDate plusYears(long);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.Period until(java.time.chrono.ChronoLocalDate);
    method public java.time.LocalDate with(java.time.temporal.TemporalAdjuster);
    method public java.time.LocalDate with(java.time.temporal.TemporalField, long);
    method public java.time.LocalDate withDayOfMonth(int);
    method public java.time.LocalDate withDayOfYear(int);
    method public java.time.LocalDate withMonth(int);
    method public java.time.LocalDate withYear(int);
    field public static final java.time.LocalDate MAX;
    field public static final java.time.LocalDate MIN;
  }

  public final class LocalDateTime implements java.time.chrono.ChronoLocalDateTime<java.time.LocalDate> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public java.time.OffsetDateTime atOffset(java.time.ZoneOffset);
    method public java.time.ZonedDateTime atZone(java.time.ZoneId);
    method public static java.time.LocalDateTime from(java.time.temporal.TemporalAccessor);
    method public int getDayOfMonth();
    method public java.time.DayOfWeek getDayOfWeek();
    method public int getDayOfYear();
    method public int getHour();
    method public long getLong(java.time.temporal.TemporalField);
    method public int getMinute();
    method public java.time.Month getMonth();
    method public int getMonthValue();
    method public int getNano();
    method public int getSecond();
    method public int getYear();
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public java.time.LocalDateTime minus(java.time.temporal.TemporalAmount);
    method public java.time.LocalDateTime minus(long, java.time.temporal.TemporalUnit);
    method public java.time.LocalDateTime minusDays(long);
    method public java.time.LocalDateTime minusHours(long);
    method public java.time.LocalDateTime minusMinutes(long);
    method public java.time.LocalDateTime minusMonths(long);
    method public java.time.LocalDateTime minusNanos(long);
    method public java.time.LocalDateTime minusSeconds(long);
    method public java.time.LocalDateTime minusWeeks(long);
    method public java.time.LocalDateTime minusYears(long);
    method public static java.time.LocalDateTime now();
    method public static java.time.LocalDateTime now(java.time.ZoneId);
    method public static java.time.LocalDateTime now(java.time.Clock);
    method public static java.time.LocalDateTime of(int, java.time.Month, int, int, int);
    method public static java.time.LocalDateTime of(int, java.time.Month, int, int, int, int);
    method public static java.time.LocalDateTime of(int, java.time.Month, int, int, int, int, int);
    method public static java.time.LocalDateTime of(int, int, int, int, int);
    method public static java.time.LocalDateTime of(int, int, int, int, int, int);
    method public static java.time.LocalDateTime of(int, int, int, int, int, int, int);
    method public static java.time.LocalDateTime of(java.time.LocalDate, java.time.LocalTime);
    method public static java.time.LocalDateTime ofEpochSecond(long, int, java.time.ZoneOffset);
    method public static java.time.LocalDateTime ofInstant(java.time.Instant, java.time.ZoneId);
    method public static java.time.LocalDateTime parse(CharSequence);
    method public static java.time.LocalDateTime parse(CharSequence, java.time.format.DateTimeFormatter);
    method public java.time.LocalDateTime plus(java.time.temporal.TemporalAmount);
    method public java.time.LocalDateTime plus(long, java.time.temporal.TemporalUnit);
    method public java.time.LocalDateTime plusDays(long);
    method public java.time.LocalDateTime plusHours(long);
    method public java.time.LocalDateTime plusMinutes(long);
    method public java.time.LocalDateTime plusMonths(long);
    method public java.time.LocalDateTime plusNanos(long);
    method public java.time.LocalDateTime plusSeconds(long);
    method public java.time.LocalDateTime plusWeeks(long);
    method public java.time.LocalDateTime plusYears(long);
    method public java.time.LocalDate toLocalDate();
    method public java.time.LocalTime toLocalTime();
    method public java.time.LocalDateTime truncatedTo(java.time.temporal.TemporalUnit);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.LocalDateTime with(java.time.temporal.TemporalAdjuster);
    method public java.time.LocalDateTime with(java.time.temporal.TemporalField, long);
    method public java.time.LocalDateTime withDayOfMonth(int);
    method public java.time.LocalDateTime withDayOfYear(int);
    method public java.time.LocalDateTime withHour(int);
    method public java.time.LocalDateTime withMinute(int);
    method public java.time.LocalDateTime withMonth(int);
    method public java.time.LocalDateTime withNano(int);
    method public java.time.LocalDateTime withSecond(int);
    method public java.time.LocalDateTime withYear(int);
    field public static final java.time.LocalDateTime MAX;
    field public static final java.time.LocalDateTime MIN;
  }

  public final class LocalTime implements java.lang.Comparable<java.time.LocalTime> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public java.time.LocalDateTime atDate(java.time.LocalDate);
    method public java.time.OffsetTime atOffset(java.time.ZoneOffset);
    method public int compareTo(java.time.LocalTime);
    method public String format(java.time.format.DateTimeFormatter);
    method public static java.time.LocalTime from(java.time.temporal.TemporalAccessor);
    method public int getHour();
    method public long getLong(java.time.temporal.TemporalField);
    method public int getMinute();
    method public int getNano();
    method public int getSecond();
    method public boolean isAfter(java.time.LocalTime);
    method public boolean isBefore(java.time.LocalTime);
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public boolean isSupported(java.time.temporal.TemporalUnit);
    method public java.time.LocalTime minus(java.time.temporal.TemporalAmount);
    method public java.time.LocalTime minus(long, java.time.temporal.TemporalUnit);
    method public java.time.LocalTime minusHours(long);
    method public java.time.LocalTime minusMinutes(long);
    method public java.time.LocalTime minusNanos(long);
    method public java.time.LocalTime minusSeconds(long);
    method public static java.time.LocalTime now();
    method public static java.time.LocalTime now(java.time.ZoneId);
    method public static java.time.LocalTime now(java.time.Clock);
    method public static java.time.LocalTime of(int, int);
    method public static java.time.LocalTime of(int, int, int);
    method public static java.time.LocalTime of(int, int, int, int);
    method public static java.time.LocalTime ofNanoOfDay(long);
    method public static java.time.LocalTime ofSecondOfDay(long);
    method public static java.time.LocalTime parse(CharSequence);
    method public static java.time.LocalTime parse(CharSequence, java.time.format.DateTimeFormatter);
    method public java.time.LocalTime plus(java.time.temporal.TemporalAmount);
    method public java.time.LocalTime plus(long, java.time.temporal.TemporalUnit);
    method public java.time.LocalTime plusHours(long);
    method public java.time.LocalTime plusMinutes(long);
    method public java.time.LocalTime plusNanos(long);
    method public java.time.LocalTime plusSeconds(long);
    method public long toNanoOfDay();
    method public int toSecondOfDay();
    method public java.time.LocalTime truncatedTo(java.time.temporal.TemporalUnit);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.LocalTime with(java.time.temporal.TemporalAdjuster);
    method public java.time.LocalTime with(java.time.temporal.TemporalField, long);
    method public java.time.LocalTime withHour(int);
    method public java.time.LocalTime withMinute(int);
    method public java.time.LocalTime withNano(int);
    method public java.time.LocalTime withSecond(int);
    field public static final java.time.LocalTime MAX;
    field public static final java.time.LocalTime MIDNIGHT;
    field public static final java.time.LocalTime MIN;
    field public static final java.time.LocalTime NOON;
  }

  public enum Month implements java.time.temporal.TemporalAccessor java.time.temporal.TemporalAdjuster {
    method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public int firstDayOfYear(boolean);
    method public java.time.Month firstMonthOfQuarter();
    method public static java.time.Month from(java.time.temporal.TemporalAccessor);
    method public String getDisplayName(java.time.format.TextStyle, java.util.Locale);
    method public long getLong(java.time.temporal.TemporalField);
    method public int getValue();
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public int length(boolean);
    method public int maxLength();
    method public int minLength();
    method public java.time.Month minus(long);
    method public static java.time.Month of(int);
    method public java.time.Month plus(long);
    enum_constant public static final java.time.Month APRIL;
    enum_constant public static final java.time.Month AUGUST;
    enum_constant public static final java.time.Month DECEMBER;
    enum_constant public static final java.time.Month FEBRUARY;
    enum_constant public static final java.time.Month JANUARY;
    enum_constant public static final java.time.Month JULY;
    enum_constant public static final java.time.Month JUNE;
    enum_constant public static final java.time.Month MARCH;
    enum_constant public static final java.time.Month MAY;
    enum_constant public static final java.time.Month NOVEMBER;
    enum_constant public static final java.time.Month OCTOBER;
    enum_constant public static final java.time.Month SEPTEMBER;
  }

  public final class MonthDay implements java.lang.Comparable<java.time.MonthDay> java.io.Serializable java.time.temporal.TemporalAccessor java.time.temporal.TemporalAdjuster {
    method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public java.time.LocalDate atYear(int);
    method public int compareTo(java.time.MonthDay);
    method public String format(java.time.format.DateTimeFormatter);
    method public static java.time.MonthDay from(java.time.temporal.TemporalAccessor);
    method public int getDayOfMonth();
    method public long getLong(java.time.temporal.TemporalField);
    method public java.time.Month getMonth();
    method public int getMonthValue();
    method public boolean isAfter(java.time.MonthDay);
    method public boolean isBefore(java.time.MonthDay);
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public boolean isValidYear(int);
    method public static java.time.MonthDay now();
    method public static java.time.MonthDay now(java.time.ZoneId);
    method public static java.time.MonthDay now(java.time.Clock);
    method public static java.time.MonthDay of(java.time.Month, int);
    method public static java.time.MonthDay of(int, int);
    method public static java.time.MonthDay parse(CharSequence);
    method public static java.time.MonthDay parse(CharSequence, java.time.format.DateTimeFormatter);
    method public java.time.MonthDay with(java.time.Month);
    method public java.time.MonthDay withDayOfMonth(int);
    method public java.time.MonthDay withMonth(int);
  }

  public final class OffsetDateTime implements java.lang.Comparable<java.time.OffsetDateTime> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public java.time.ZonedDateTime atZoneSameInstant(java.time.ZoneId);
    method public java.time.ZonedDateTime atZoneSimilarLocal(java.time.ZoneId);
    method public int compareTo(java.time.OffsetDateTime);
    method public String format(java.time.format.DateTimeFormatter);
    method public static java.time.OffsetDateTime from(java.time.temporal.TemporalAccessor);
    method public int getDayOfMonth();
    method public java.time.DayOfWeek getDayOfWeek();
    method public int getDayOfYear();
    method public int getHour();
    method public long getLong(java.time.temporal.TemporalField);
    method public int getMinute();
    method public java.time.Month getMonth();
    method public int getMonthValue();
    method public int getNano();
    method public java.time.ZoneOffset getOffset();
    method public int getSecond();
    method public int getYear();
    method public boolean isAfter(java.time.OffsetDateTime);
    method public boolean isBefore(java.time.OffsetDateTime);
    method public boolean isEqual(java.time.OffsetDateTime);
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public boolean isSupported(java.time.temporal.TemporalUnit);
    method public java.time.OffsetDateTime minus(java.time.temporal.TemporalAmount);
    method public java.time.OffsetDateTime minus(long, java.time.temporal.TemporalUnit);
    method public java.time.OffsetDateTime minusDays(long);
    method public java.time.OffsetDateTime minusHours(long);
    method public java.time.OffsetDateTime minusMinutes(long);
    method public java.time.OffsetDateTime minusMonths(long);
    method public java.time.OffsetDateTime minusNanos(long);
    method public java.time.OffsetDateTime minusSeconds(long);
    method public java.time.OffsetDateTime minusWeeks(long);
    method public java.time.OffsetDateTime minusYears(long);
    method public static java.time.OffsetDateTime now();
    method public static java.time.OffsetDateTime now(java.time.ZoneId);
    method public static java.time.OffsetDateTime now(java.time.Clock);
    method public static java.time.OffsetDateTime of(java.time.LocalDate, java.time.LocalTime, java.time.ZoneOffset);
    method public static java.time.OffsetDateTime of(java.time.LocalDateTime, java.time.ZoneOffset);
    method public static java.time.OffsetDateTime of(int, int, int, int, int, int, int, java.time.ZoneOffset);
    method public static java.time.OffsetDateTime ofInstant(java.time.Instant, java.time.ZoneId);
    method public static java.time.OffsetDateTime parse(CharSequence);
    method public static java.time.OffsetDateTime parse(CharSequence, java.time.format.DateTimeFormatter);
    method public java.time.OffsetDateTime plus(java.time.temporal.TemporalAmount);
    method public java.time.OffsetDateTime plus(long, java.time.temporal.TemporalUnit);
    method public java.time.OffsetDateTime plusDays(long);
    method public java.time.OffsetDateTime plusHours(long);
    method public java.time.OffsetDateTime plusMinutes(long);
    method public java.time.OffsetDateTime plusMonths(long);
    method public java.time.OffsetDateTime plusNanos(long);
    method public java.time.OffsetDateTime plusSeconds(long);
    method public java.time.OffsetDateTime plusWeeks(long);
    method public java.time.OffsetDateTime plusYears(long);
    method public static java.util.Comparator<java.time.OffsetDateTime> timeLineOrder();
    method public long toEpochSecond();
    method public java.time.Instant toInstant();
    method public java.time.LocalDate toLocalDate();
    method public java.time.LocalDateTime toLocalDateTime();
    method public java.time.LocalTime toLocalTime();
    method public java.time.OffsetTime toOffsetTime();
    method public java.time.ZonedDateTime toZonedDateTime();
    method public java.time.OffsetDateTime truncatedTo(java.time.temporal.TemporalUnit);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.OffsetDateTime with(java.time.temporal.TemporalAdjuster);
    method public java.time.OffsetDateTime with(java.time.temporal.TemporalField, long);
    method public java.time.OffsetDateTime withDayOfMonth(int);
    method public java.time.OffsetDateTime withDayOfYear(int);
    method public java.time.OffsetDateTime withHour(int);
    method public java.time.OffsetDateTime withMinute(int);
    method public java.time.OffsetDateTime withMonth(int);
    method public java.time.OffsetDateTime withNano(int);
    method public java.time.OffsetDateTime withOffsetSameInstant(java.time.ZoneOffset);
    method public java.time.OffsetDateTime withOffsetSameLocal(java.time.ZoneOffset);
    method public java.time.OffsetDateTime withSecond(int);
    method public java.time.OffsetDateTime withYear(int);
    field public static final java.time.OffsetDateTime MAX;
    field public static final java.time.OffsetDateTime MIN;
  }

  public final class OffsetTime implements java.lang.Comparable<java.time.OffsetTime> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public java.time.OffsetDateTime atDate(java.time.LocalDate);
    method public int compareTo(java.time.OffsetTime);
    method public String format(java.time.format.DateTimeFormatter);
    method public static java.time.OffsetTime from(java.time.temporal.TemporalAccessor);
    method public int getHour();
    method public long getLong(java.time.temporal.TemporalField);
    method public int getMinute();
    method public int getNano();
    method public java.time.ZoneOffset getOffset();
    method public int getSecond();
    method public boolean isAfter(java.time.OffsetTime);
    method public boolean isBefore(java.time.OffsetTime);
    method public boolean isEqual(java.time.OffsetTime);
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public boolean isSupported(java.time.temporal.TemporalUnit);
    method public java.time.OffsetTime minus(java.time.temporal.TemporalAmount);
    method public java.time.OffsetTime minus(long, java.time.temporal.TemporalUnit);
    method public java.time.OffsetTime minusHours(long);
    method public java.time.OffsetTime minusMinutes(long);
    method public java.time.OffsetTime minusNanos(long);
    method public java.time.OffsetTime minusSeconds(long);
    method public static java.time.OffsetTime now();
    method public static java.time.OffsetTime now(java.time.ZoneId);
    method public static java.time.OffsetTime now(java.time.Clock);
    method public static java.time.OffsetTime of(java.time.LocalTime, java.time.ZoneOffset);
    method public static java.time.OffsetTime of(int, int, int, int, java.time.ZoneOffset);
    method public static java.time.OffsetTime ofInstant(java.time.Instant, java.time.ZoneId);
    method public static java.time.OffsetTime parse(CharSequence);
    method public static java.time.OffsetTime parse(CharSequence, java.time.format.DateTimeFormatter);
    method public java.time.OffsetTime plus(java.time.temporal.TemporalAmount);
    method public java.time.OffsetTime plus(long, java.time.temporal.TemporalUnit);
    method public java.time.OffsetTime plusHours(long);
    method public java.time.OffsetTime plusMinutes(long);
    method public java.time.OffsetTime plusNanos(long);
    method public java.time.OffsetTime plusSeconds(long);
    method public java.time.LocalTime toLocalTime();
    method public java.time.OffsetTime truncatedTo(java.time.temporal.TemporalUnit);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.OffsetTime with(java.time.temporal.TemporalAdjuster);
    method public java.time.OffsetTime with(java.time.temporal.TemporalField, long);
    method public java.time.OffsetTime withHour(int);
    method public java.time.OffsetTime withMinute(int);
    method public java.time.OffsetTime withNano(int);
    method public java.time.OffsetTime withOffsetSameInstant(java.time.ZoneOffset);
    method public java.time.OffsetTime withOffsetSameLocal(java.time.ZoneOffset);
    method public java.time.OffsetTime withSecond(int);
    field public static final java.time.OffsetTime MAX;
    field public static final java.time.OffsetTime MIN;
  }

  public final class Period implements java.time.chrono.ChronoPeriod java.io.Serializable {
    method public java.time.temporal.Temporal addTo(java.time.temporal.Temporal);
    method public static java.time.Period between(java.time.LocalDate, java.time.LocalDate);
    method public static java.time.Period from(java.time.temporal.TemporalAmount);
    method public long get(java.time.temporal.TemporalUnit);
    method public java.time.chrono.IsoChronology getChronology();
    method public int getDays();
    method public int getMonths();
    method public java.util.List<java.time.temporal.TemporalUnit> getUnits();
    method public int getYears();
    method public java.time.Period minus(java.time.temporal.TemporalAmount);
    method public java.time.Period minusDays(long);
    method public java.time.Period minusMonths(long);
    method public java.time.Period minusYears(long);
    method public java.time.Period multipliedBy(int);
    method public java.time.Period negated();
    method public java.time.Period normalized();
    method public static java.time.Period of(int, int, int);
    method public static java.time.Period ofDays(int);
    method public static java.time.Period ofMonths(int);
    method public static java.time.Period ofWeeks(int);
    method public static java.time.Period ofYears(int);
    method public static java.time.Period parse(CharSequence);
    method public java.time.Period plus(java.time.temporal.TemporalAmount);
    method public java.time.Period plusDays(long);
    method public java.time.Period plusMonths(long);
    method public java.time.Period plusYears(long);
    method public java.time.temporal.Temporal subtractFrom(java.time.temporal.Temporal);
    method public long toTotalMonths();
    method public java.time.Period withDays(int);
    method public java.time.Period withMonths(int);
    method public java.time.Period withYears(int);
    field public static final java.time.Period ZERO;
  }

  public final class Year implements java.lang.Comparable<java.time.Year> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public java.time.LocalDate atDay(int);
    method public java.time.YearMonth atMonth(java.time.Month);
    method public java.time.YearMonth atMonth(int);
    method public java.time.LocalDate atMonthDay(java.time.MonthDay);
    method public int compareTo(java.time.Year);
    method public String format(java.time.format.DateTimeFormatter);
    method public static java.time.Year from(java.time.temporal.TemporalAccessor);
    method public long getLong(java.time.temporal.TemporalField);
    method public int getValue();
    method public boolean isAfter(java.time.Year);
    method public boolean isBefore(java.time.Year);
    method public static boolean isLeap(long);
    method public boolean isLeap();
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public boolean isSupported(java.time.temporal.TemporalUnit);
    method public boolean isValidMonthDay(java.time.MonthDay);
    method public int length();
    method public java.time.Year minus(java.time.temporal.TemporalAmount);
    method public java.time.Year minus(long, java.time.temporal.TemporalUnit);
    method public java.time.Year minusYears(long);
    method public static java.time.Year now();
    method public static java.time.Year now(java.time.ZoneId);
    method public static java.time.Year now(java.time.Clock);
    method public static java.time.Year of(int);
    method public static java.time.Year parse(CharSequence);
    method public static java.time.Year parse(CharSequence, java.time.format.DateTimeFormatter);
    method public java.time.Year plus(java.time.temporal.TemporalAmount);
    method public java.time.Year plus(long, java.time.temporal.TemporalUnit);
    method public java.time.Year plusYears(long);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.Year with(java.time.temporal.TemporalAdjuster);
    method public java.time.Year with(java.time.temporal.TemporalField, long);
    field public static final int MAX_VALUE = 999999999; // 0x3b9ac9ff
    field public static final int MIN_VALUE = -999999999; // 0xc4653601
  }

  public final class YearMonth implements java.lang.Comparable<java.time.YearMonth> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public java.time.LocalDate atDay(int);
    method public java.time.LocalDate atEndOfMonth();
    method public int compareTo(java.time.YearMonth);
    method public String format(java.time.format.DateTimeFormatter);
    method public static java.time.YearMonth from(java.time.temporal.TemporalAccessor);
    method public long getLong(java.time.temporal.TemporalField);
    method public java.time.Month getMonth();
    method public int getMonthValue();
    method public int getYear();
    method public boolean isAfter(java.time.YearMonth);
    method public boolean isBefore(java.time.YearMonth);
    method public boolean isLeapYear();
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public boolean isSupported(java.time.temporal.TemporalUnit);
    method public boolean isValidDay(int);
    method public int lengthOfMonth();
    method public int lengthOfYear();
    method public java.time.YearMonth minus(java.time.temporal.TemporalAmount);
    method public java.time.YearMonth minus(long, java.time.temporal.TemporalUnit);
    method public java.time.YearMonth minusMonths(long);
    method public java.time.YearMonth minusYears(long);
    method public static java.time.YearMonth now();
    method public static java.time.YearMonth now(java.time.ZoneId);
    method public static java.time.YearMonth now(java.time.Clock);
    method public static java.time.YearMonth of(int, java.time.Month);
    method public static java.time.YearMonth of(int, int);
    method public static java.time.YearMonth parse(CharSequence);
    method public static java.time.YearMonth parse(CharSequence, java.time.format.DateTimeFormatter);
    method public java.time.YearMonth plus(java.time.temporal.TemporalAmount);
    method public java.time.YearMonth plus(long, java.time.temporal.TemporalUnit);
    method public java.time.YearMonth plusMonths(long);
    method public java.time.YearMonth plusYears(long);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.YearMonth with(java.time.temporal.TemporalAdjuster);
    method public java.time.YearMonth with(java.time.temporal.TemporalField, long);
    method public java.time.YearMonth withMonth(int);
    method public java.time.YearMonth withYear(int);
  }

  public abstract class ZoneId implements java.io.Serializable {
    method public static java.time.ZoneId from(java.time.temporal.TemporalAccessor);
    method public static java.util.Set<java.lang.String> getAvailableZoneIds();
    method public String getDisplayName(java.time.format.TextStyle, java.util.Locale);
    method public abstract String getId();
    method public abstract java.time.zone.ZoneRules getRules();
    method public java.time.ZoneId normalized();
    method public static java.time.ZoneId of(String, java.util.Map<java.lang.String,java.lang.String>);
    method public static java.time.ZoneId of(String);
    method public static java.time.ZoneId ofOffset(String, java.time.ZoneOffset);
    method public static java.time.ZoneId systemDefault();
    field public static final java.util.Map<java.lang.String,java.lang.String> SHORT_IDS;
  }

  public final class ZoneOffset extends java.time.ZoneId implements java.lang.Comparable<java.time.ZoneOffset> java.io.Serializable java.time.temporal.TemporalAccessor java.time.temporal.TemporalAdjuster {
    method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public int compareTo(java.time.ZoneOffset);
    method public static java.time.ZoneOffset from(java.time.temporal.TemporalAccessor);
    method public String getId();
    method public long getLong(java.time.temporal.TemporalField);
    method public java.time.zone.ZoneRules getRules();
    method public int getTotalSeconds();
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public static java.time.ZoneOffset of(String);
    method public static java.time.ZoneOffset ofHours(int);
    method public static java.time.ZoneOffset ofHoursMinutes(int, int);
    method public static java.time.ZoneOffset ofHoursMinutesSeconds(int, int, int);
    method public static java.time.ZoneOffset ofTotalSeconds(int);
    field public static final java.time.ZoneOffset MAX;
    field public static final java.time.ZoneOffset MIN;
    field public static final java.time.ZoneOffset UTC;
  }

  public final class ZonedDateTime implements java.time.chrono.ChronoZonedDateTime<java.time.LocalDate> java.io.Serializable java.time.temporal.Temporal {
    method public static java.time.ZonedDateTime from(java.time.temporal.TemporalAccessor);
    method public int getDayOfMonth();
    method public java.time.DayOfWeek getDayOfWeek();
    method public int getDayOfYear();
    method public int getHour();
    method public int getMinute();
    method public java.time.Month getMonth();
    method public int getMonthValue();
    method public int getNano();
    method public java.time.ZoneOffset getOffset();
    method public int getSecond();
    method public int getYear();
    method public java.time.ZoneId getZone();
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public java.time.ZonedDateTime minus(java.time.temporal.TemporalAmount);
    method public java.time.ZonedDateTime minus(long, java.time.temporal.TemporalUnit);
    method public java.time.ZonedDateTime minusDays(long);
    method public java.time.ZonedDateTime minusHours(long);
    method public java.time.ZonedDateTime minusMinutes(long);
    method public java.time.ZonedDateTime minusMonths(long);
    method public java.time.ZonedDateTime minusNanos(long);
    method public java.time.ZonedDateTime minusSeconds(long);
    method public java.time.ZonedDateTime minusWeeks(long);
    method public java.time.ZonedDateTime minusYears(long);
    method public static java.time.ZonedDateTime now();
    method public static java.time.ZonedDateTime now(java.time.ZoneId);
    method public static java.time.ZonedDateTime now(java.time.Clock);
    method public static java.time.ZonedDateTime of(java.time.LocalDate, java.time.LocalTime, java.time.ZoneId);
    method public static java.time.ZonedDateTime of(java.time.LocalDateTime, java.time.ZoneId);
    method public static java.time.ZonedDateTime of(int, int, int, int, int, int, int, java.time.ZoneId);
    method public static java.time.ZonedDateTime ofInstant(java.time.Instant, java.time.ZoneId);
    method public static java.time.ZonedDateTime ofInstant(java.time.LocalDateTime, java.time.ZoneOffset, java.time.ZoneId);
    method public static java.time.ZonedDateTime ofLocal(java.time.LocalDateTime, java.time.ZoneId, java.time.ZoneOffset);
    method public static java.time.ZonedDateTime ofStrict(java.time.LocalDateTime, java.time.ZoneOffset, java.time.ZoneId);
    method public static java.time.ZonedDateTime parse(CharSequence);
    method public static java.time.ZonedDateTime parse(CharSequence, java.time.format.DateTimeFormatter);
    method public java.time.ZonedDateTime plus(java.time.temporal.TemporalAmount);
    method public java.time.ZonedDateTime plus(long, java.time.temporal.TemporalUnit);
    method public java.time.ZonedDateTime plusDays(long);
    method public java.time.ZonedDateTime plusHours(long);
    method public java.time.ZonedDateTime plusMinutes(long);
    method public java.time.ZonedDateTime plusMonths(long);
    method public java.time.ZonedDateTime plusNanos(long);
    method public java.time.ZonedDateTime plusSeconds(long);
    method public java.time.ZonedDateTime plusWeeks(long);
    method public java.time.ZonedDateTime plusYears(long);
    method public java.time.LocalDate toLocalDate();
    method public java.time.LocalDateTime toLocalDateTime();
    method public java.time.OffsetDateTime toOffsetDateTime();
    method public java.time.ZonedDateTime truncatedTo(java.time.temporal.TemporalUnit);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.ZonedDateTime with(java.time.temporal.TemporalAdjuster);
    method public java.time.ZonedDateTime with(java.time.temporal.TemporalField, long);
    method public java.time.ZonedDateTime withDayOfMonth(int);
    method public java.time.ZonedDateTime withDayOfYear(int);
    method public java.time.ZonedDateTime withEarlierOffsetAtOverlap();
    method public java.time.ZonedDateTime withFixedOffsetZone();
    method public java.time.ZonedDateTime withHour(int);
    method public java.time.ZonedDateTime withLaterOffsetAtOverlap();
    method public java.time.ZonedDateTime withMinute(int);
    method public java.time.ZonedDateTime withMonth(int);
    method public java.time.ZonedDateTime withNano(int);
    method public java.time.ZonedDateTime withSecond(int);
    method public java.time.ZonedDateTime withYear(int);
    method public java.time.ZonedDateTime withZoneSameInstant(java.time.ZoneId);
    method public java.time.ZonedDateTime withZoneSameLocal(java.time.ZoneId);
  }

}

package java.time.chrono {

  public abstract class AbstractChronology implements java.time.chrono.Chronology {
    ctor protected AbstractChronology();
    method public int compareTo(java.time.chrono.Chronology);
    method public java.time.chrono.ChronoLocalDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
  }

  public interface ChronoLocalDate extends java.time.temporal.Temporal java.lang.Comparable<java.time.chrono.ChronoLocalDate> java.time.temporal.TemporalAdjuster {
    method public default java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public default java.time.chrono.ChronoLocalDateTime<?> atTime(java.time.LocalTime);
    method public default int compareTo(java.time.chrono.ChronoLocalDate);
    method public boolean equals(Object);
    method public default String format(java.time.format.DateTimeFormatter);
    method public static java.time.chrono.ChronoLocalDate from(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.Chronology getChronology();
    method public default java.time.chrono.Era getEra();
    method public int hashCode();
    method public default boolean isAfter(java.time.chrono.ChronoLocalDate);
    method public default boolean isBefore(java.time.chrono.ChronoLocalDate);
    method public default boolean isEqual(java.time.chrono.ChronoLocalDate);
    method public default boolean isLeapYear();
    method public default boolean isSupported(java.time.temporal.TemporalField);
    method public default boolean isSupported(java.time.temporal.TemporalUnit);
    method public int lengthOfMonth();
    method public default int lengthOfYear();
    method public default java.time.chrono.ChronoLocalDate minus(java.time.temporal.TemporalAmount);
    method public default java.time.chrono.ChronoLocalDate minus(long, java.time.temporal.TemporalUnit);
    method public default java.time.chrono.ChronoLocalDate plus(java.time.temporal.TemporalAmount);
    method public default java.time.chrono.ChronoLocalDate plus(long, java.time.temporal.TemporalUnit);
    method public static java.util.Comparator<java.time.chrono.ChronoLocalDate> timeLineOrder();
    method public default long toEpochDay();
    method public String toString();
    method public java.time.chrono.ChronoPeriod until(java.time.chrono.ChronoLocalDate);
    method public default java.time.chrono.ChronoLocalDate with(java.time.temporal.TemporalAdjuster);
    method public default java.time.chrono.ChronoLocalDate with(java.time.temporal.TemporalField, long);
  }

  public interface ChronoLocalDateTime<D extends java.time.chrono.ChronoLocalDate> extends java.time.temporal.Temporal java.lang.Comparable<java.time.chrono.ChronoLocalDateTime<?>> java.time.temporal.TemporalAdjuster {
    method public default java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public java.time.chrono.ChronoZonedDateTime<D> atZone(java.time.ZoneId);
    method public default int compareTo(java.time.chrono.ChronoLocalDateTime<?>);
    method public boolean equals(Object);
    method public default String format(java.time.format.DateTimeFormatter);
    method public static java.time.chrono.ChronoLocalDateTime<?> from(java.time.temporal.TemporalAccessor);
    method public default java.time.chrono.Chronology getChronology();
    method public int hashCode();
    method public default boolean isAfter(java.time.chrono.ChronoLocalDateTime<?>);
    method public default boolean isBefore(java.time.chrono.ChronoLocalDateTime<?>);
    method public default boolean isEqual(java.time.chrono.ChronoLocalDateTime<?>);
    method public default boolean isSupported(java.time.temporal.TemporalUnit);
    method public default java.time.chrono.ChronoLocalDateTime<D> minus(java.time.temporal.TemporalAmount);
    method public default java.time.chrono.ChronoLocalDateTime<D> minus(long, java.time.temporal.TemporalUnit);
    method public default java.time.chrono.ChronoLocalDateTime<D> plus(java.time.temporal.TemporalAmount);
    method public java.time.chrono.ChronoLocalDateTime<D> plus(long, java.time.temporal.TemporalUnit);
    method public static java.util.Comparator<java.time.chrono.ChronoLocalDateTime<?>> timeLineOrder();
    method public default long toEpochSecond(java.time.ZoneOffset);
    method public default java.time.Instant toInstant(java.time.ZoneOffset);
    method public D toLocalDate();
    method public java.time.LocalTime toLocalTime();
    method public String toString();
    method public default java.time.chrono.ChronoLocalDateTime<D> with(java.time.temporal.TemporalAdjuster);
    method public java.time.chrono.ChronoLocalDateTime<D> with(java.time.temporal.TemporalField, long);
  }

  public interface ChronoPeriod extends java.time.temporal.TemporalAmount {
    method public static java.time.chrono.ChronoPeriod between(java.time.chrono.ChronoLocalDate, java.time.chrono.ChronoLocalDate);
    method public boolean equals(Object);
    method public java.time.chrono.Chronology getChronology();
    method public int hashCode();
    method public default boolean isNegative();
    method public default boolean isZero();
    method public java.time.chrono.ChronoPeriod minus(java.time.temporal.TemporalAmount);
    method public java.time.chrono.ChronoPeriod multipliedBy(int);
    method public default java.time.chrono.ChronoPeriod negated();
    method public java.time.chrono.ChronoPeriod normalized();
    method public java.time.chrono.ChronoPeriod plus(java.time.temporal.TemporalAmount);
    method public String toString();
  }

  public interface ChronoZonedDateTime<D extends java.time.chrono.ChronoLocalDate> extends java.time.temporal.Temporal java.lang.Comparable<java.time.chrono.ChronoZonedDateTime<?>> {
    method public default int compareTo(java.time.chrono.ChronoZonedDateTime<?>);
    method public boolean equals(Object);
    method public default String format(java.time.format.DateTimeFormatter);
    method public static java.time.chrono.ChronoZonedDateTime<?> from(java.time.temporal.TemporalAccessor);
    method public default java.time.chrono.Chronology getChronology();
    method public default long getLong(java.time.temporal.TemporalField);
    method public java.time.ZoneOffset getOffset();
    method public java.time.ZoneId getZone();
    method public int hashCode();
    method public default boolean isAfter(java.time.chrono.ChronoZonedDateTime<?>);
    method public default boolean isBefore(java.time.chrono.ChronoZonedDateTime<?>);
    method public default boolean isEqual(java.time.chrono.ChronoZonedDateTime<?>);
    method public default boolean isSupported(java.time.temporal.TemporalUnit);
    method public default java.time.chrono.ChronoZonedDateTime<D> minus(java.time.temporal.TemporalAmount);
    method public default java.time.chrono.ChronoZonedDateTime<D> minus(long, java.time.temporal.TemporalUnit);
    method public default java.time.chrono.ChronoZonedDateTime<D> plus(java.time.temporal.TemporalAmount);
    method public java.time.chrono.ChronoZonedDateTime<D> plus(long, java.time.temporal.TemporalUnit);
    method public static java.util.Comparator<java.time.chrono.ChronoZonedDateTime<?>> timeLineOrder();
    method public default long toEpochSecond();
    method public default java.time.Instant toInstant();
    method public default D toLocalDate();
    method public java.time.chrono.ChronoLocalDateTime<D> toLocalDateTime();
    method public default java.time.LocalTime toLocalTime();
    method public String toString();
    method public default java.time.chrono.ChronoZonedDateTime<D> with(java.time.temporal.TemporalAdjuster);
    method public java.time.chrono.ChronoZonedDateTime<D> with(java.time.temporal.TemporalField, long);
    method public java.time.chrono.ChronoZonedDateTime<D> withEarlierOffsetAtOverlap();
    method public java.time.chrono.ChronoZonedDateTime<D> withLaterOffsetAtOverlap();
    method public java.time.chrono.ChronoZonedDateTime<D> withZoneSameInstant(java.time.ZoneId);
    method public java.time.chrono.ChronoZonedDateTime<D> withZoneSameLocal(java.time.ZoneId);
  }

  public interface Chronology extends java.lang.Comparable<java.time.chrono.Chronology> {
    method public int compareTo(java.time.chrono.Chronology);
    method public default java.time.chrono.ChronoLocalDate date(java.time.chrono.Era, int, int, int);
    method public java.time.chrono.ChronoLocalDate date(int, int, int);
    method public java.time.chrono.ChronoLocalDate date(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.ChronoLocalDate dateEpochDay(long);
    method public default java.time.chrono.ChronoLocalDate dateNow();
    method public default java.time.chrono.ChronoLocalDate dateNow(java.time.ZoneId);
    method public default java.time.chrono.ChronoLocalDate dateNow(java.time.Clock);
    method public default java.time.chrono.ChronoLocalDate dateYearDay(java.time.chrono.Era, int, int);
    method public java.time.chrono.ChronoLocalDate dateYearDay(int, int);
    method public boolean equals(Object);
    method public java.time.chrono.Era eraOf(int);
    method public java.util.List<java.time.chrono.Era> eras();
    method public static java.time.chrono.Chronology from(java.time.temporal.TemporalAccessor);
    method public static java.util.Set<java.time.chrono.Chronology> getAvailableChronologies();
    method public String getCalendarType();
    method public default String getDisplayName(java.time.format.TextStyle, java.util.Locale);
    method public String getId();
    method public int hashCode();
    method public boolean isLeapYear(long);
    method public default java.time.chrono.ChronoLocalDateTime<? extends java.time.chrono.ChronoLocalDate> localDateTime(java.time.temporal.TemporalAccessor);
    method public static java.time.chrono.Chronology of(String);
    method public static java.time.chrono.Chronology ofLocale(java.util.Locale);
    method public default java.time.chrono.ChronoPeriod period(int, int, int);
    method public int prolepticYear(java.time.chrono.Era, int);
    method public java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
    method public java.time.chrono.ChronoLocalDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
    method public String toString();
    method public default java.time.chrono.ChronoZonedDateTime<? extends java.time.chrono.ChronoLocalDate> zonedDateTime(java.time.temporal.TemporalAccessor);
    method public default java.time.chrono.ChronoZonedDateTime<? extends java.time.chrono.ChronoLocalDate> zonedDateTime(java.time.Instant, java.time.ZoneId);
  }

  public interface Era extends java.time.temporal.TemporalAccessor java.time.temporal.TemporalAdjuster {
    method public default java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public default String getDisplayName(java.time.format.TextStyle, java.util.Locale);
    method public default long getLong(java.time.temporal.TemporalField);
    method public int getValue();
    method public default boolean isSupported(java.time.temporal.TemporalField);
  }

  public final class HijrahChronology extends java.time.chrono.AbstractChronology implements java.io.Serializable {
    method public java.time.chrono.HijrahDate date(java.time.chrono.Era, int, int, int);
    method public java.time.chrono.HijrahDate date(int, int, int);
    method public java.time.chrono.HijrahDate date(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.HijrahDate dateEpochDay(long);
    method public java.time.chrono.HijrahDate dateNow();
    method public java.time.chrono.HijrahDate dateNow(java.time.ZoneId);
    method public java.time.chrono.HijrahDate dateNow(java.time.Clock);
    method public java.time.chrono.HijrahDate dateYearDay(java.time.chrono.Era, int, int);
    method public java.time.chrono.HijrahDate dateYearDay(int, int);
    method public java.time.chrono.HijrahEra eraOf(int);
    method public java.util.List<java.time.chrono.Era> eras();
    method public String getCalendarType();
    method public String getId();
    method public boolean isLeapYear(long);
    method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.HijrahDate> localDateTime(java.time.temporal.TemporalAccessor);
    method public int prolepticYear(java.time.chrono.Era, int);
    method public java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
    method public java.time.chrono.HijrahDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
    method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.HijrahDate> zonedDateTime(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.HijrahDate> zonedDateTime(java.time.Instant, java.time.ZoneId);
    field public static final java.time.chrono.HijrahChronology INSTANCE;
  }

  public final class HijrahDate implements java.time.chrono.ChronoLocalDate java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.HijrahDate> atTime(java.time.LocalTime);
    method public static java.time.chrono.HijrahDate from(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.HijrahChronology getChronology();
    method public java.time.chrono.HijrahEra getEra();
    method public long getLong(java.time.temporal.TemporalField);
    method public int lengthOfMonth();
    method public java.time.chrono.HijrahDate minus(java.time.temporal.TemporalAmount);
    method public java.time.chrono.HijrahDate minus(long, java.time.temporal.TemporalUnit);
    method public static java.time.chrono.HijrahDate now();
    method public static java.time.chrono.HijrahDate now(java.time.ZoneId);
    method public static java.time.chrono.HijrahDate now(java.time.Clock);
    method public static java.time.chrono.HijrahDate of(int, int, int);
    method public java.time.chrono.HijrahDate plus(java.time.temporal.TemporalAmount);
    method public java.time.chrono.HijrahDate plus(long, java.time.temporal.TemporalUnit);
    method public java.time.chrono.ChronoPeriod until(java.time.chrono.ChronoLocalDate);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.chrono.HijrahDate with(java.time.temporal.TemporalField, long);
    method public java.time.chrono.HijrahDate with(java.time.temporal.TemporalAdjuster);
    method public java.time.chrono.HijrahDate withVariant(java.time.chrono.HijrahChronology);
  }

  public enum HijrahEra implements java.time.chrono.Era {
    method public int getValue();
    method public static java.time.chrono.HijrahEra of(int);
    enum_constant public static final java.time.chrono.HijrahEra AH;
  }

  public final class IsoChronology extends java.time.chrono.AbstractChronology implements java.io.Serializable {
    method public java.time.LocalDate date(java.time.chrono.Era, int, int, int);
    method public java.time.LocalDate date(int, int, int);
    method public java.time.LocalDate date(java.time.temporal.TemporalAccessor);
    method public java.time.LocalDate dateEpochDay(long);
    method public java.time.LocalDate dateNow();
    method public java.time.LocalDate dateNow(java.time.ZoneId);
    method public java.time.LocalDate dateNow(java.time.Clock);
    method public java.time.LocalDate dateYearDay(java.time.chrono.Era, int, int);
    method public java.time.LocalDate dateYearDay(int, int);
    method public java.time.chrono.IsoEra eraOf(int);
    method public java.util.List<java.time.chrono.Era> eras();
    method public String getCalendarType();
    method public String getId();
    method public boolean isLeapYear(long);
    method public java.time.LocalDateTime localDateTime(java.time.temporal.TemporalAccessor);
    method public java.time.Period period(int, int, int);
    method public int prolepticYear(java.time.chrono.Era, int);
    method public java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
    method public java.time.LocalDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
    method public java.time.ZonedDateTime zonedDateTime(java.time.temporal.TemporalAccessor);
    method public java.time.ZonedDateTime zonedDateTime(java.time.Instant, java.time.ZoneId);
    field public static final java.time.chrono.IsoChronology INSTANCE;
  }

  public enum IsoEra implements java.time.chrono.Era {
    method public int getValue();
    method public static java.time.chrono.IsoEra of(int);
    enum_constant public static final java.time.chrono.IsoEra BCE;
    enum_constant public static final java.time.chrono.IsoEra CE;
  }

  public final class JapaneseChronology extends java.time.chrono.AbstractChronology implements java.io.Serializable {
    method public java.time.chrono.JapaneseDate date(java.time.chrono.Era, int, int, int);
    method public java.time.chrono.JapaneseDate date(int, int, int);
    method public java.time.chrono.JapaneseDate date(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.JapaneseDate dateEpochDay(long);
    method public java.time.chrono.JapaneseDate dateNow();
    method public java.time.chrono.JapaneseDate dateNow(java.time.ZoneId);
    method public java.time.chrono.JapaneseDate dateNow(java.time.Clock);
    method public java.time.chrono.JapaneseDate dateYearDay(java.time.chrono.Era, int, int);
    method public java.time.chrono.JapaneseDate dateYearDay(int, int);
    method public java.time.chrono.JapaneseEra eraOf(int);
    method public java.util.List<java.time.chrono.Era> eras();
    method public String getCalendarType();
    method public String getId();
    method public boolean isLeapYear(long);
    method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.JapaneseDate> localDateTime(java.time.temporal.TemporalAccessor);
    method public int prolepticYear(java.time.chrono.Era, int);
    method public java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
    method public java.time.chrono.JapaneseDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
    method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.JapaneseDate> zonedDateTime(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.JapaneseDate> zonedDateTime(java.time.Instant, java.time.ZoneId);
    field public static final java.time.chrono.JapaneseChronology INSTANCE;
  }

  public final class JapaneseDate implements java.time.chrono.ChronoLocalDate java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.JapaneseDate> atTime(java.time.LocalTime);
    method public static java.time.chrono.JapaneseDate from(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.JapaneseChronology getChronology();
    method public java.time.chrono.JapaneseEra getEra();
    method public long getLong(java.time.temporal.TemporalField);
    method public int lengthOfMonth();
    method public java.time.chrono.JapaneseDate minus(java.time.temporal.TemporalAmount);
    method public java.time.chrono.JapaneseDate minus(long, java.time.temporal.TemporalUnit);
    method public static java.time.chrono.JapaneseDate now();
    method public static java.time.chrono.JapaneseDate now(java.time.ZoneId);
    method public static java.time.chrono.JapaneseDate now(java.time.Clock);
    method public static java.time.chrono.JapaneseDate of(java.time.chrono.JapaneseEra, int, int, int);
    method public static java.time.chrono.JapaneseDate of(int, int, int);
    method public java.time.chrono.JapaneseDate plus(java.time.temporal.TemporalAmount);
    method public java.time.chrono.JapaneseDate plus(long, java.time.temporal.TemporalUnit);
    method public java.time.chrono.ChronoPeriod until(java.time.chrono.ChronoLocalDate);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.chrono.JapaneseDate with(java.time.temporal.TemporalField, long);
    method public java.time.chrono.JapaneseDate with(java.time.temporal.TemporalAdjuster);
  }

  public final class JapaneseEra implements java.time.chrono.Era java.io.Serializable {
    method public int getValue();
    method public static java.time.chrono.JapaneseEra of(int);
    method public static java.time.chrono.JapaneseEra valueOf(String);
    method public static java.time.chrono.JapaneseEra[] values();
    field public static final java.time.chrono.JapaneseEra HEISEI;
    field public static final java.time.chrono.JapaneseEra MEIJI;
    field public static final java.time.chrono.JapaneseEra SHOWA;
    field public static final java.time.chrono.JapaneseEra TAISHO;
  }

  public final class MinguoChronology extends java.time.chrono.AbstractChronology implements java.io.Serializable {
    method public java.time.chrono.MinguoDate date(java.time.chrono.Era, int, int, int);
    method public java.time.chrono.MinguoDate date(int, int, int);
    method public java.time.chrono.MinguoDate date(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.MinguoDate dateEpochDay(long);
    method public java.time.chrono.MinguoDate dateNow();
    method public java.time.chrono.MinguoDate dateNow(java.time.ZoneId);
    method public java.time.chrono.MinguoDate dateNow(java.time.Clock);
    method public java.time.chrono.MinguoDate dateYearDay(java.time.chrono.Era, int, int);
    method public java.time.chrono.MinguoDate dateYearDay(int, int);
    method public java.time.chrono.MinguoEra eraOf(int);
    method public java.util.List<java.time.chrono.Era> eras();
    method public String getCalendarType();
    method public String getId();
    method public boolean isLeapYear(long);
    method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.MinguoDate> localDateTime(java.time.temporal.TemporalAccessor);
    method public int prolepticYear(java.time.chrono.Era, int);
    method public java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
    method public java.time.chrono.MinguoDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
    method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.MinguoDate> zonedDateTime(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.MinguoDate> zonedDateTime(java.time.Instant, java.time.ZoneId);
    field public static final java.time.chrono.MinguoChronology INSTANCE;
  }

  public final class MinguoDate implements java.time.chrono.ChronoLocalDate java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.MinguoDate> atTime(java.time.LocalTime);
    method public static java.time.chrono.MinguoDate from(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.MinguoChronology getChronology();
    method public java.time.chrono.MinguoEra getEra();
    method public long getLong(java.time.temporal.TemporalField);
    method public int lengthOfMonth();
    method public java.time.chrono.MinguoDate minus(java.time.temporal.TemporalAmount);
    method public java.time.chrono.MinguoDate minus(long, java.time.temporal.TemporalUnit);
    method public static java.time.chrono.MinguoDate now();
    method public static java.time.chrono.MinguoDate now(java.time.ZoneId);
    method public static java.time.chrono.MinguoDate now(java.time.Clock);
    method public static java.time.chrono.MinguoDate of(int, int, int);
    method public java.time.chrono.MinguoDate plus(java.time.temporal.TemporalAmount);
    method public java.time.chrono.MinguoDate plus(long, java.time.temporal.TemporalUnit);
    method public java.time.chrono.ChronoPeriod until(java.time.chrono.ChronoLocalDate);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.chrono.MinguoDate with(java.time.temporal.TemporalField, long);
    method public java.time.chrono.MinguoDate with(java.time.temporal.TemporalAdjuster);
  }

  public enum MinguoEra implements java.time.chrono.Era {
    method public int getValue();
    method public static java.time.chrono.MinguoEra of(int);
    enum_constant public static final java.time.chrono.MinguoEra BEFORE_ROC;
    enum_constant public static final java.time.chrono.MinguoEra ROC;
  }

  public final class ThaiBuddhistChronology extends java.time.chrono.AbstractChronology implements java.io.Serializable {
    method public java.time.chrono.ThaiBuddhistDate date(java.time.chrono.Era, int, int, int);
    method public java.time.chrono.ThaiBuddhistDate date(int, int, int);
    method public java.time.chrono.ThaiBuddhistDate date(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.ThaiBuddhistDate dateEpochDay(long);
    method public java.time.chrono.ThaiBuddhistDate dateNow();
    method public java.time.chrono.ThaiBuddhistDate dateNow(java.time.ZoneId);
    method public java.time.chrono.ThaiBuddhistDate dateNow(java.time.Clock);
    method public java.time.chrono.ThaiBuddhistDate dateYearDay(java.time.chrono.Era, int, int);
    method public java.time.chrono.ThaiBuddhistDate dateYearDay(int, int);
    method public java.time.chrono.ThaiBuddhistEra eraOf(int);
    method public java.util.List<java.time.chrono.Era> eras();
    method public String getCalendarType();
    method public String getId();
    method public boolean isLeapYear(long);
    method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.ThaiBuddhistDate> localDateTime(java.time.temporal.TemporalAccessor);
    method public int prolepticYear(java.time.chrono.Era, int);
    method public java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
    method public java.time.chrono.ThaiBuddhistDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
    method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.ThaiBuddhistDate> zonedDateTime(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.ThaiBuddhistDate> zonedDateTime(java.time.Instant, java.time.ZoneId);
    field public static final java.time.chrono.ThaiBuddhistChronology INSTANCE;
  }

  public final class ThaiBuddhistDate implements java.time.chrono.ChronoLocalDate java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.ThaiBuddhistDate> atTime(java.time.LocalTime);
    method public static java.time.chrono.ThaiBuddhistDate from(java.time.temporal.TemporalAccessor);
    method public java.time.chrono.ThaiBuddhistChronology getChronology();
    method public java.time.chrono.ThaiBuddhistEra getEra();
    method public long getLong(java.time.temporal.TemporalField);
    method public int lengthOfMonth();
    method public java.time.chrono.ThaiBuddhistDate minus(java.time.temporal.TemporalAmount);
    method public java.time.chrono.ThaiBuddhistDate minus(long, java.time.temporal.TemporalUnit);
    method public static java.time.chrono.ThaiBuddhistDate now();
    method public static java.time.chrono.ThaiBuddhistDate now(java.time.ZoneId);
    method public static java.time.chrono.ThaiBuddhistDate now(java.time.Clock);
    method public static java.time.chrono.ThaiBuddhistDate of(int, int, int);
    method public java.time.chrono.ThaiBuddhistDate plus(java.time.temporal.TemporalAmount);
    method public java.time.chrono.ThaiBuddhistDate plus(long, java.time.temporal.TemporalUnit);
    method public java.time.chrono.ChronoPeriod until(java.time.chrono.ChronoLocalDate);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public java.time.chrono.ThaiBuddhistDate with(java.time.temporal.TemporalField, long);
    method public java.time.chrono.ThaiBuddhistDate with(java.time.temporal.TemporalAdjuster);
  }

  public enum ThaiBuddhistEra implements java.time.chrono.Era {
    method public int getValue();
    method public static java.time.chrono.ThaiBuddhistEra of(int);
    enum_constant public static final java.time.chrono.ThaiBuddhistEra BE;
    enum_constant public static final java.time.chrono.ThaiBuddhistEra BEFORE_BE;
  }

}

package java.time.format {

  public final class DateTimeFormatter {
    method public String format(java.time.temporal.TemporalAccessor);
    method public void formatTo(java.time.temporal.TemporalAccessor, Appendable);
    method public java.time.chrono.Chronology getChronology();
    method public java.time.format.DecimalStyle getDecimalStyle();
    method public java.util.Locale getLocale();
    method public java.util.Set<java.time.temporal.TemporalField> getResolverFields();
    method public java.time.format.ResolverStyle getResolverStyle();
    method public java.time.ZoneId getZone();
    method public static java.time.format.DateTimeFormatter ofLocalizedDate(java.time.format.FormatStyle);
    method public static java.time.format.DateTimeFormatter ofLocalizedDateTime(java.time.format.FormatStyle);
    method public static java.time.format.DateTimeFormatter ofLocalizedDateTime(java.time.format.FormatStyle, java.time.format.FormatStyle);
    method public static java.time.format.DateTimeFormatter ofLocalizedTime(java.time.format.FormatStyle);
    method public static java.time.format.DateTimeFormatter ofPattern(String);
    method public static java.time.format.DateTimeFormatter ofPattern(String, java.util.Locale);
    method public java.time.temporal.TemporalAccessor parse(CharSequence);
    method public java.time.temporal.TemporalAccessor parse(CharSequence, java.text.ParsePosition);
    method public <T> T parse(CharSequence, java.time.temporal.TemporalQuery<T>);
    method public java.time.temporal.TemporalAccessor parseBest(CharSequence, java.time.temporal.TemporalQuery<?>...);
    method public java.time.temporal.TemporalAccessor parseUnresolved(CharSequence, java.text.ParsePosition);
    method public static java.time.temporal.TemporalQuery<java.time.Period> parsedExcessDays();
    method public static java.time.temporal.TemporalQuery<java.lang.Boolean> parsedLeapSecond();
    method public java.text.Format toFormat();
    method public java.text.Format toFormat(java.time.temporal.TemporalQuery<?>);
    method public java.time.format.DateTimeFormatter withChronology(java.time.chrono.Chronology);
    method public java.time.format.DateTimeFormatter withDecimalStyle(java.time.format.DecimalStyle);
    method public java.time.format.DateTimeFormatter withLocale(java.util.Locale);
    method public java.time.format.DateTimeFormatter withResolverFields(java.time.temporal.TemporalField...);
    method public java.time.format.DateTimeFormatter withResolverFields(java.util.Set<java.time.temporal.TemporalField>);
    method public java.time.format.DateTimeFormatter withResolverStyle(java.time.format.ResolverStyle);
    method public java.time.format.DateTimeFormatter withZone(java.time.ZoneId);
    field public static final java.time.format.DateTimeFormatter BASIC_ISO_DATE;
    field public static final java.time.format.DateTimeFormatter ISO_DATE;
    field public static final java.time.format.DateTimeFormatter ISO_DATE_TIME;
    field public static final java.time.format.DateTimeFormatter ISO_INSTANT;
    field public static final java.time.format.DateTimeFormatter ISO_LOCAL_DATE;
    field public static final java.time.format.DateTimeFormatter ISO_LOCAL_DATE_TIME;
    field public static final java.time.format.DateTimeFormatter ISO_LOCAL_TIME;
    field public static final java.time.format.DateTimeFormatter ISO_OFFSET_DATE;
    field public static final java.time.format.DateTimeFormatter ISO_OFFSET_DATE_TIME;
    field public static final java.time.format.DateTimeFormatter ISO_OFFSET_TIME;
    field public static final java.time.format.DateTimeFormatter ISO_ORDINAL_DATE;
    field public static final java.time.format.DateTimeFormatter ISO_TIME;
    field public static final java.time.format.DateTimeFormatter ISO_WEEK_DATE;
    field public static final java.time.format.DateTimeFormatter ISO_ZONED_DATE_TIME;
    field public static final java.time.format.DateTimeFormatter RFC_1123_DATE_TIME;
  }

  public final class DateTimeFormatterBuilder {
    ctor public DateTimeFormatterBuilder();
    method public java.time.format.DateTimeFormatterBuilder append(java.time.format.DateTimeFormatter);
    method public java.time.format.DateTimeFormatterBuilder appendChronologyId();
    method public java.time.format.DateTimeFormatterBuilder appendChronologyText(java.time.format.TextStyle);
    method public java.time.format.DateTimeFormatterBuilder appendFraction(java.time.temporal.TemporalField, int, int, boolean);
    method public java.time.format.DateTimeFormatterBuilder appendInstant();
    method public java.time.format.DateTimeFormatterBuilder appendInstant(int);
    method public java.time.format.DateTimeFormatterBuilder appendLiteral(char);
    method public java.time.format.DateTimeFormatterBuilder appendLiteral(String);
    method public java.time.format.DateTimeFormatterBuilder appendLocalized(java.time.format.FormatStyle, java.time.format.FormatStyle);
    method public java.time.format.DateTimeFormatterBuilder appendLocalizedOffset(java.time.format.TextStyle);
    method public java.time.format.DateTimeFormatterBuilder appendOffset(String, String);
    method public java.time.format.DateTimeFormatterBuilder appendOffsetId();
    method public java.time.format.DateTimeFormatterBuilder appendOptional(java.time.format.DateTimeFormatter);
    method public java.time.format.DateTimeFormatterBuilder appendPattern(String);
    method public java.time.format.DateTimeFormatterBuilder appendText(java.time.temporal.TemporalField);
    method public java.time.format.DateTimeFormatterBuilder appendText(java.time.temporal.TemporalField, java.time.format.TextStyle);
    method public java.time.format.DateTimeFormatterBuilder appendText(java.time.temporal.TemporalField, java.util.Map<java.lang.Long,java.lang.String>);
    method public java.time.format.DateTimeFormatterBuilder appendValue(java.time.temporal.TemporalField);
    method public java.time.format.DateTimeFormatterBuilder appendValue(java.time.temporal.TemporalField, int);
    method public java.time.format.DateTimeFormatterBuilder appendValue(java.time.temporal.TemporalField, int, int, java.time.format.SignStyle);
    method public java.time.format.DateTimeFormatterBuilder appendValueReduced(java.time.temporal.TemporalField, int, int, int);
    method public java.time.format.DateTimeFormatterBuilder appendValueReduced(java.time.temporal.TemporalField, int, int, java.time.chrono.ChronoLocalDate);
    method public java.time.format.DateTimeFormatterBuilder appendZoneId();
    method public java.time.format.DateTimeFormatterBuilder appendZoneOrOffsetId();
    method public java.time.format.DateTimeFormatterBuilder appendZoneRegionId();
    method public java.time.format.DateTimeFormatterBuilder appendZoneText(java.time.format.TextStyle);
    method public java.time.format.DateTimeFormatterBuilder appendZoneText(java.time.format.TextStyle, java.util.Set<java.time.ZoneId>);
    method public static String getLocalizedDateTimePattern(java.time.format.FormatStyle, java.time.format.FormatStyle, java.time.chrono.Chronology, java.util.Locale);
    method public java.time.format.DateTimeFormatterBuilder optionalEnd();
    method public java.time.format.DateTimeFormatterBuilder optionalStart();
    method public java.time.format.DateTimeFormatterBuilder padNext(int);
    method public java.time.format.DateTimeFormatterBuilder padNext(int, char);
    method public java.time.format.DateTimeFormatterBuilder parseCaseInsensitive();
    method public java.time.format.DateTimeFormatterBuilder parseCaseSensitive();
    method public java.time.format.DateTimeFormatterBuilder parseDefaulting(java.time.temporal.TemporalField, long);
    method public java.time.format.DateTimeFormatterBuilder parseLenient();
    method public java.time.format.DateTimeFormatterBuilder parseStrict();
    method public java.time.format.DateTimeFormatter toFormatter();
    method public java.time.format.DateTimeFormatter toFormatter(java.util.Locale);
  }

  public class DateTimeParseException extends java.time.DateTimeException {
    ctor public DateTimeParseException(String, CharSequence, int);
    ctor public DateTimeParseException(String, CharSequence, int, Throwable);
    method public int getErrorIndex();
    method public String getParsedString();
  }

  public final class DecimalStyle {
    method public static java.util.Set<java.util.Locale> getAvailableLocales();
    method public char getDecimalSeparator();
    method public char getNegativeSign();
    method public char getPositiveSign();
    method public char getZeroDigit();
    method public static java.time.format.DecimalStyle of(java.util.Locale);
    method public static java.time.format.DecimalStyle ofDefaultLocale();
    method public java.time.format.DecimalStyle withDecimalSeparator(char);
    method public java.time.format.DecimalStyle withNegativeSign(char);
    method public java.time.format.DecimalStyle withPositiveSign(char);
    method public java.time.format.DecimalStyle withZeroDigit(char);
    field public static final java.time.format.DecimalStyle STANDARD;
  }

  public enum FormatStyle {
    enum_constant public static final java.time.format.FormatStyle FULL;
    enum_constant public static final java.time.format.FormatStyle LONG;
    enum_constant public static final java.time.format.FormatStyle MEDIUM;
    enum_constant public static final java.time.format.FormatStyle SHORT;
  }

  public enum ResolverStyle {
    enum_constant public static final java.time.format.ResolverStyle LENIENT;
    enum_constant public static final java.time.format.ResolverStyle SMART;
    enum_constant public static final java.time.format.ResolverStyle STRICT;
  }

  public enum SignStyle {
    enum_constant public static final java.time.format.SignStyle ALWAYS;
    enum_constant public static final java.time.format.SignStyle EXCEEDS_PAD;
    enum_constant public static final java.time.format.SignStyle NEVER;
    enum_constant public static final java.time.format.SignStyle NORMAL;
    enum_constant public static final java.time.format.SignStyle NOT_NEGATIVE;
  }

  public enum TextStyle {
    method public java.time.format.TextStyle asNormal();
    method public java.time.format.TextStyle asStandalone();
    method public boolean isStandalone();
    enum_constant public static final java.time.format.TextStyle FULL;
    enum_constant public static final java.time.format.TextStyle FULL_STANDALONE;
    enum_constant public static final java.time.format.TextStyle NARROW;
    enum_constant public static final java.time.format.TextStyle NARROW_STANDALONE;
    enum_constant public static final java.time.format.TextStyle SHORT;
    enum_constant public static final java.time.format.TextStyle SHORT_STANDALONE;
  }

}

package java.time.temporal {

  public enum ChronoField implements java.time.temporal.TemporalField {
    method public <R extends java.time.temporal.Temporal> R adjustInto(R, long);
    method public int checkValidIntValue(long);
    method public long checkValidValue(long);
    method public java.time.temporal.TemporalUnit getBaseUnit();
    method public long getFrom(java.time.temporal.TemporalAccessor);
    method public java.time.temporal.TemporalUnit getRangeUnit();
    method public boolean isDateBased();
    method public boolean isSupportedBy(java.time.temporal.TemporalAccessor);
    method public boolean isTimeBased();
    method public java.time.temporal.ValueRange range();
    method public java.time.temporal.ValueRange rangeRefinedBy(java.time.temporal.TemporalAccessor);
    enum_constant public static final java.time.temporal.ChronoField ALIGNED_DAY_OF_WEEK_IN_MONTH;
    enum_constant public static final java.time.temporal.ChronoField ALIGNED_DAY_OF_WEEK_IN_YEAR;
    enum_constant public static final java.time.temporal.ChronoField ALIGNED_WEEK_OF_MONTH;
    enum_constant public static final java.time.temporal.ChronoField ALIGNED_WEEK_OF_YEAR;
    enum_constant public static final java.time.temporal.ChronoField AMPM_OF_DAY;
    enum_constant public static final java.time.temporal.ChronoField CLOCK_HOUR_OF_AMPM;
    enum_constant public static final java.time.temporal.ChronoField CLOCK_HOUR_OF_DAY;
    enum_constant public static final java.time.temporal.ChronoField DAY_OF_MONTH;
    enum_constant public static final java.time.temporal.ChronoField DAY_OF_WEEK;
    enum_constant public static final java.time.temporal.ChronoField DAY_OF_YEAR;
    enum_constant public static final java.time.temporal.ChronoField EPOCH_DAY;
    enum_constant public static final java.time.temporal.ChronoField ERA;
    enum_constant public static final java.time.temporal.ChronoField HOUR_OF_AMPM;
    enum_constant public static final java.time.temporal.ChronoField HOUR_OF_DAY;
    enum_constant public static final java.time.temporal.ChronoField INSTANT_SECONDS;
    enum_constant public static final java.time.temporal.ChronoField MICRO_OF_DAY;
    enum_constant public static final java.time.temporal.ChronoField MICRO_OF_SECOND;
    enum_constant public static final java.time.temporal.ChronoField MILLI_OF_DAY;
    enum_constant public static final java.time.temporal.ChronoField MILLI_OF_SECOND;
    enum_constant public static final java.time.temporal.ChronoField MINUTE_OF_DAY;
    enum_constant public static final java.time.temporal.ChronoField MINUTE_OF_HOUR;
    enum_constant public static final java.time.temporal.ChronoField MONTH_OF_YEAR;
    enum_constant public static final java.time.temporal.ChronoField NANO_OF_DAY;
    enum_constant public static final java.time.temporal.ChronoField NANO_OF_SECOND;
    enum_constant public static final java.time.temporal.ChronoField OFFSET_SECONDS;
    enum_constant public static final java.time.temporal.ChronoField PROLEPTIC_MONTH;
    enum_constant public static final java.time.temporal.ChronoField SECOND_OF_DAY;
    enum_constant public static final java.time.temporal.ChronoField SECOND_OF_MINUTE;
    enum_constant public static final java.time.temporal.ChronoField YEAR;
    enum_constant public static final java.time.temporal.ChronoField YEAR_OF_ERA;
  }

  public enum ChronoUnit implements java.time.temporal.TemporalUnit {
    method public <R extends java.time.temporal.Temporal> R addTo(R, long);
    method public long between(java.time.temporal.Temporal, java.time.temporal.Temporal);
    method public java.time.Duration getDuration();
    method public boolean isDateBased();
    method public boolean isDurationEstimated();
    method public boolean isTimeBased();
    enum_constant public static final java.time.temporal.ChronoUnit CENTURIES;
    enum_constant public static final java.time.temporal.ChronoUnit DAYS;
    enum_constant public static final java.time.temporal.ChronoUnit DECADES;
    enum_constant public static final java.time.temporal.ChronoUnit ERAS;
    enum_constant public static final java.time.temporal.ChronoUnit FOREVER;
    enum_constant public static final java.time.temporal.ChronoUnit HALF_DAYS;
    enum_constant public static final java.time.temporal.ChronoUnit HOURS;
    enum_constant public static final java.time.temporal.ChronoUnit MICROS;
    enum_constant public static final java.time.temporal.ChronoUnit MILLENNIA;
    enum_constant public static final java.time.temporal.ChronoUnit MILLIS;
    enum_constant public static final java.time.temporal.ChronoUnit MINUTES;
    enum_constant public static final java.time.temporal.ChronoUnit MONTHS;
    enum_constant public static final java.time.temporal.ChronoUnit NANOS;
    enum_constant public static final java.time.temporal.ChronoUnit SECONDS;
    enum_constant public static final java.time.temporal.ChronoUnit WEEKS;
    enum_constant public static final java.time.temporal.ChronoUnit YEARS;
  }

  public final class IsoFields {
    field public static final java.time.temporal.TemporalField DAY_OF_QUARTER;
    field public static final java.time.temporal.TemporalField QUARTER_OF_YEAR;
    field public static final java.time.temporal.TemporalUnit QUARTER_YEARS;
    field public static final java.time.temporal.TemporalField WEEK_BASED_YEAR;
    field public static final java.time.temporal.TemporalUnit WEEK_BASED_YEARS;
    field public static final java.time.temporal.TemporalField WEEK_OF_WEEK_BASED_YEAR;
  }

  public final class JulianFields {
    field public static final java.time.temporal.TemporalField JULIAN_DAY;
    field public static final java.time.temporal.TemporalField MODIFIED_JULIAN_DAY;
    field public static final java.time.temporal.TemporalField RATA_DIE;
  }

  public interface Temporal extends java.time.temporal.TemporalAccessor {
    method public boolean isSupported(java.time.temporal.TemporalUnit);
    method public default java.time.temporal.Temporal minus(java.time.temporal.TemporalAmount);
    method public default java.time.temporal.Temporal minus(long, java.time.temporal.TemporalUnit);
    method public default java.time.temporal.Temporal plus(java.time.temporal.TemporalAmount);
    method public java.time.temporal.Temporal plus(long, java.time.temporal.TemporalUnit);
    method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public default java.time.temporal.Temporal with(java.time.temporal.TemporalAdjuster);
    method public java.time.temporal.Temporal with(java.time.temporal.TemporalField, long);
  }

  public interface TemporalAccessor {
    method public default int get(java.time.temporal.TemporalField);
    method public long getLong(java.time.temporal.TemporalField);
    method public boolean isSupported(java.time.temporal.TemporalField);
    method public default <R> R query(java.time.temporal.TemporalQuery<R>);
    method public default java.time.temporal.ValueRange range(java.time.temporal.TemporalField);
  }

  @java.lang.FunctionalInterface public interface TemporalAdjuster {
    method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
  }

  public final class TemporalAdjusters {
    method public static java.time.temporal.TemporalAdjuster dayOfWeekInMonth(int, java.time.DayOfWeek);
    method public static java.time.temporal.TemporalAdjuster firstDayOfMonth();
    method public static java.time.temporal.TemporalAdjuster firstDayOfNextMonth();
    method public static java.time.temporal.TemporalAdjuster firstDayOfNextYear();
    method public static java.time.temporal.TemporalAdjuster firstDayOfYear();
    method public static java.time.temporal.TemporalAdjuster firstInMonth(java.time.DayOfWeek);
    method public static java.time.temporal.TemporalAdjuster lastDayOfMonth();
    method public static java.time.temporal.TemporalAdjuster lastDayOfYear();
    method public static java.time.temporal.TemporalAdjuster lastInMonth(java.time.DayOfWeek);
    method public static java.time.temporal.TemporalAdjuster next(java.time.DayOfWeek);
    method public static java.time.temporal.TemporalAdjuster nextOrSame(java.time.DayOfWeek);
    method public static java.time.temporal.TemporalAdjuster ofDateAdjuster(java.util.function.UnaryOperator<java.time.LocalDate>);
    method public static java.time.temporal.TemporalAdjuster previous(java.time.DayOfWeek);
    method public static java.time.temporal.TemporalAdjuster previousOrSame(java.time.DayOfWeek);
  }

  public interface TemporalAmount {
    method public java.time.temporal.Temporal addTo(java.time.temporal.Temporal);
    method public long get(java.time.temporal.TemporalUnit);
    method public java.util.List<java.time.temporal.TemporalUnit> getUnits();
    method public java.time.temporal.Temporal subtractFrom(java.time.temporal.Temporal);
  }

  public interface TemporalField {
    method public <R extends java.time.temporal.Temporal> R adjustInto(R, long);
    method public java.time.temporal.TemporalUnit getBaseUnit();
    method public default String getDisplayName(java.util.Locale);
    method public long getFrom(java.time.temporal.TemporalAccessor);
    method public java.time.temporal.TemporalUnit getRangeUnit();
    method public boolean isDateBased();
    method public boolean isSupportedBy(java.time.temporal.TemporalAccessor);
    method public boolean isTimeBased();
    method public java.time.temporal.ValueRange range();
    method public java.time.temporal.ValueRange rangeRefinedBy(java.time.temporal.TemporalAccessor);
    method public default java.time.temporal.TemporalAccessor resolve(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.temporal.TemporalAccessor, java.time.format.ResolverStyle);
    method public String toString();
  }

  public final class TemporalQueries {
    method public static java.time.temporal.TemporalQuery<java.time.chrono.Chronology> chronology();
    method public static java.time.temporal.TemporalQuery<java.time.LocalDate> localDate();
    method public static java.time.temporal.TemporalQuery<java.time.LocalTime> localTime();
    method public static java.time.temporal.TemporalQuery<java.time.ZoneOffset> offset();
    method public static java.time.temporal.TemporalQuery<java.time.temporal.TemporalUnit> precision();
    method public static java.time.temporal.TemporalQuery<java.time.ZoneId> zone();
    method public static java.time.temporal.TemporalQuery<java.time.ZoneId> zoneId();
  }

  @java.lang.FunctionalInterface public interface TemporalQuery<R> {
    method public R queryFrom(java.time.temporal.TemporalAccessor);
  }

  public interface TemporalUnit {
    method public <R extends java.time.temporal.Temporal> R addTo(R, long);
    method public long between(java.time.temporal.Temporal, java.time.temporal.Temporal);
    method public java.time.Duration getDuration();
    method public boolean isDateBased();
    method public boolean isDurationEstimated();
    method public default boolean isSupportedBy(java.time.temporal.Temporal);
    method public boolean isTimeBased();
    method public String toString();
  }

  public class UnsupportedTemporalTypeException extends java.time.DateTimeException {
    ctor public UnsupportedTemporalTypeException(String);
    ctor public UnsupportedTemporalTypeException(String, Throwable);
  }

  public final class ValueRange implements java.io.Serializable {
    method public int checkValidIntValue(long, java.time.temporal.TemporalField);
    method public long checkValidValue(long, java.time.temporal.TemporalField);
    method public long getLargestMinimum();
    method public long getMaximum();
    method public long getMinimum();
    method public long getSmallestMaximum();
    method public boolean isFixed();
    method public boolean isIntValue();
    method public boolean isValidIntValue(long);
    method public boolean isValidValue(long);
    method public static java.time.temporal.ValueRange of(long, long);
    method public static java.time.temporal.ValueRange of(long, long, long);
    method public static java.time.temporal.ValueRange of(long, long, long, long);
  }

  public final class WeekFields implements java.io.Serializable {
    method public java.time.temporal.TemporalField dayOfWeek();
    method public java.time.DayOfWeek getFirstDayOfWeek();
    method public int getMinimalDaysInFirstWeek();
    method public static java.time.temporal.WeekFields of(java.util.Locale);
    method public static java.time.temporal.WeekFields of(java.time.DayOfWeek, int);
    method public java.time.temporal.TemporalField weekBasedYear();
    method public java.time.temporal.TemporalField weekOfMonth();
    method public java.time.temporal.TemporalField weekOfWeekBasedYear();
    method public java.time.temporal.TemporalField weekOfYear();
    field public static final java.time.temporal.WeekFields ISO;
    field public static final java.time.temporal.WeekFields SUNDAY_START;
    field public static final java.time.temporal.TemporalUnit WEEK_BASED_YEARS;
  }

}

package java.time.zone {

  public final class ZoneOffsetTransition implements java.lang.Comparable<java.time.zone.ZoneOffsetTransition> java.io.Serializable {
    method public int compareTo(java.time.zone.ZoneOffsetTransition);
    method public java.time.LocalDateTime getDateTimeAfter();
    method public java.time.LocalDateTime getDateTimeBefore();
    method public java.time.Duration getDuration();
    method public java.time.Instant getInstant();
    method public java.time.ZoneOffset getOffsetAfter();
    method public java.time.ZoneOffset getOffsetBefore();
    method public boolean isGap();
    method public boolean isOverlap();
    method public boolean isValidOffset(java.time.ZoneOffset);
    method public static java.time.zone.ZoneOffsetTransition of(java.time.LocalDateTime, java.time.ZoneOffset, java.time.ZoneOffset);
    method public long toEpochSecond();
  }

  public final class ZoneOffsetTransitionRule implements java.io.Serializable {
    method public java.time.zone.ZoneOffsetTransition createTransition(int);
    method public int getDayOfMonthIndicator();
    method public java.time.DayOfWeek getDayOfWeek();
    method public java.time.LocalTime getLocalTime();
    method public java.time.Month getMonth();
    method public java.time.ZoneOffset getOffsetAfter();
    method public java.time.ZoneOffset getOffsetBefore();
    method public java.time.ZoneOffset getStandardOffset();
    method public java.time.zone.ZoneOffsetTransitionRule.TimeDefinition getTimeDefinition();
    method public boolean isMidnightEndOfDay();
    method public static java.time.zone.ZoneOffsetTransitionRule of(java.time.Month, int, java.time.DayOfWeek, java.time.LocalTime, boolean, java.time.zone.ZoneOffsetTransitionRule.TimeDefinition, java.time.ZoneOffset, java.time.ZoneOffset, java.time.ZoneOffset);
  }

  public enum ZoneOffsetTransitionRule.TimeDefinition {
    method public java.time.LocalDateTime createDateTime(java.time.LocalDateTime, java.time.ZoneOffset, java.time.ZoneOffset);
    enum_constant public static final java.time.zone.ZoneOffsetTransitionRule.TimeDefinition STANDARD;
    enum_constant public static final java.time.zone.ZoneOffsetTransitionRule.TimeDefinition UTC;
    enum_constant public static final java.time.zone.ZoneOffsetTransitionRule.TimeDefinition WALL;
  }

  public final class ZoneRules implements java.io.Serializable {
    method public java.time.Duration getDaylightSavings(java.time.Instant);
    method public java.time.ZoneOffset getOffset(java.time.Instant);
    method public java.time.ZoneOffset getOffset(java.time.LocalDateTime);
    method public java.time.ZoneOffset getStandardOffset(java.time.Instant);
    method public java.time.zone.ZoneOffsetTransition getTransition(java.time.LocalDateTime);
    method public java.util.List<java.time.zone.ZoneOffsetTransitionRule> getTransitionRules();
    method public java.util.List<java.time.zone.ZoneOffsetTransition> getTransitions();
    method public java.util.List<java.time.ZoneOffset> getValidOffsets(java.time.LocalDateTime);
    method public boolean isDaylightSavings(java.time.Instant);
    method public boolean isFixedOffset();
    method public boolean isValidOffset(java.time.LocalDateTime, java.time.ZoneOffset);
    method public java.time.zone.ZoneOffsetTransition nextTransition(java.time.Instant);
    method public static java.time.zone.ZoneRules of(java.time.ZoneOffset, java.time.ZoneOffset, java.util.List<java.time.zone.ZoneOffsetTransition>, java.util.List<java.time.zone.ZoneOffsetTransition>, java.util.List<java.time.zone.ZoneOffsetTransitionRule>);
    method public static java.time.zone.ZoneRules of(java.time.ZoneOffset);
    method public java.time.zone.ZoneOffsetTransition previousTransition(java.time.Instant);
  }

  public class ZoneRulesException extends java.time.DateTimeException {
    ctor public ZoneRulesException(String);
    ctor public ZoneRulesException(String, Throwable);
  }

}

package java.util {

  public abstract class AbstractCollection<E> implements java.util.Collection<E> {
    ctor protected AbstractCollection();
    method public boolean add(E);
    method public boolean addAll(@NonNull java.util.Collection<? extends E>);
    method public void clear();
    method public boolean contains(@Nullable Object);
    method public boolean containsAll(@NonNull java.util.Collection<?>);
    method public boolean isEmpty();
    method public boolean remove(@Nullable Object);
    method public boolean removeAll(@NonNull java.util.Collection<?>);
    method public boolean retainAll(@NonNull java.util.Collection<?>);
    method @NonNull public Object[] toArray();
    method @NonNull public <T> T[] toArray(@NonNull T[]);
  }

  public abstract class AbstractList<E> extends java.util.AbstractCollection<E> implements java.util.List<E> {
    ctor protected AbstractList();
    method public void add(int, E);
    method public boolean addAll(int, @NonNull java.util.Collection<? extends E>);
    method public int indexOf(@Nullable Object);
    method @NonNull public java.util.Iterator<E> iterator();
    method public int lastIndexOf(@Nullable Object);
    method @NonNull public java.util.ListIterator<E> listIterator();
    method @NonNull public java.util.ListIterator<E> listIterator(int);
    method public E remove(int);
    method protected void removeRange(int, int);
    method public E set(int, E);
    method @NonNull public java.util.List<E> subList(int, int);
    field protected transient int modCount;
  }

  public abstract class AbstractMap<K, V> implements java.util.Map<K,V> {
    ctor protected AbstractMap();
    method public void clear();
    method public boolean containsKey(@Nullable Object);
    method public boolean containsValue(@Nullable Object);
    method @Nullable public V get(@Nullable Object);
    method public boolean isEmpty();
    method @NonNull public java.util.Set<K> keySet();
    method @Nullable public V put(K, V);
    method public void putAll(@NonNull java.util.Map<? extends K,? extends V>);
    method @Nullable public V remove(@Nullable Object);
    method public int size();
    method @NonNull public java.util.Collection<V> values();
  }

  public static class AbstractMap.SimpleEntry<K, V> implements java.util.Map.Entry<K,V> java.io.Serializable {
    ctor public AbstractMap.SimpleEntry(K, V);
    ctor public AbstractMap.SimpleEntry(@NonNull java.util.Map.Entry<? extends K,? extends V>);
    method public K getKey();
    method public V getValue();
    method public V setValue(V);
  }

  public static class AbstractMap.SimpleImmutableEntry<K, V> implements java.util.Map.Entry<K,V> java.io.Serializable {
    ctor public AbstractMap.SimpleImmutableEntry(K, V);
    ctor public AbstractMap.SimpleImmutableEntry(@NonNull java.util.Map.Entry<? extends K,? extends V>);
    method public K getKey();
    method public V getValue();
    method public V setValue(V);
  }

  public abstract class AbstractQueue<E> extends java.util.AbstractCollection<E> implements java.util.Queue<E> {
    ctor protected AbstractQueue();
    method public E element();
    method public E remove();
  }

  public abstract class AbstractSequentialList<E> extends java.util.AbstractList<E> {
    ctor protected AbstractSequentialList();
    method public E get(int);
  }

  public abstract class AbstractSet<E> extends java.util.AbstractCollection<E> implements java.util.Set<E> {
    ctor protected AbstractSet();
  }

  public class ArrayDeque<E> extends java.util.AbstractCollection<E> implements java.lang.Cloneable java.util.Deque<E> java.io.Serializable {
    ctor public ArrayDeque();
    ctor public ArrayDeque(int);
    ctor public ArrayDeque(@NonNull java.util.Collection<? extends E>);
    method public void addFirst(E);
    method public void addLast(E);
    method @NonNull public java.util.ArrayDeque<E> clone();
    method @NonNull public java.util.Iterator<E> descendingIterator();
    method public E element();
    method public E getFirst();
    method public E getLast();
    method @NonNull public java.util.Iterator<E> iterator();
    method public boolean offer(E);
    method public boolean offerFirst(E);
    method public boolean offerLast(E);
    method @Nullable public E peek();
    method @Nullable public E peekFirst();
    method @Nullable public E peekLast();
    method @Nullable public E poll();
    method @Nullable public E pollFirst();
    method @Nullable public E pollLast();
    method public E pop();
    method public void push(E);
    method public E remove();
    method public E removeFirst();
    method public boolean removeFirstOccurrence(@Nullable Object);
    method public E removeLast();
    method public boolean removeLastOccurrence(@Nullable Object);
    method public int size();
  }

  public class ArrayList<E> extends java.util.AbstractList<E> implements java.lang.Cloneable java.util.List<E> java.util.RandomAccess java.io.Serializable {
    ctor public ArrayList(int);
    ctor public ArrayList();
    ctor public ArrayList(@NonNull java.util.Collection<? extends E>);
    method @NonNull public Object clone();
    method public void ensureCapacity(int);
    method public void forEach(@NonNull java.util.function.Consumer<? super E>);
    method public E get(int);
    method public int size();
    method public void trimToSize();
  }

  public class Arrays {
    method @NonNull @java.lang.SafeVarargs public static <T> java.util.List<T> asList(@NonNull T...);
    method public static int binarySearch(@NonNull long[], long);
    method public static int binarySearch(@NonNull long[], int, int, long);
    method public static int binarySearch(@NonNull int[], int);
    method public static int binarySearch(@NonNull int[], int, int, int);
    method public static int binarySearch(@NonNull short[], short);
    method public static int binarySearch(@NonNull short[], int, int, short);
    method public static int binarySearch(@NonNull char[], char);
    method public static int binarySearch(@NonNull char[], int, int, char);
    method public static int binarySearch(@NonNull byte[], byte);
    method public static int binarySearch(@NonNull byte[], int, int, byte);
    method public static int binarySearch(@NonNull double[], double);
    method public static int binarySearch(@NonNull double[], int, int, double);
    method public static int binarySearch(@NonNull float[], float);
    method public static int binarySearch(@NonNull float[], int, int, float);
    method public static int binarySearch(@NonNull Object[], @NonNull Object);
    method public static int binarySearch(@NonNull Object[], int, int, @NonNull Object);
    method public static <T> int binarySearch(@NonNull T[], T, @Nullable java.util.Comparator<? super T>);
    method public static <T> int binarySearch(@NonNull T[], int, int, T, @Nullable java.util.Comparator<? super T>);
    method @NonNull public static <T> T[] copyOf(@NonNull T[], int);
    method @NonNull public static <T, U> T[] copyOf(@NonNull U[], int, @NonNull Class<? extends T[]>);
    method @NonNull public static byte[] copyOf(@NonNull byte[], int);
    method @NonNull public static short[] copyOf(@NonNull short[], int);
    method @NonNull public static int[] copyOf(@NonNull int[], int);
    method @NonNull public static long[] copyOf(@NonNull long[], int);
    method @NonNull public static char[] copyOf(@NonNull char[], int);
    method @NonNull public static float[] copyOf(@NonNull float[], int);
    method @NonNull public static double[] copyOf(@NonNull double[], int);
    method @NonNull public static boolean[] copyOf(@NonNull boolean[], int);
    method @NonNull public static <T> T[] copyOfRange(@NonNull T[], int, int);
    method @NonNull public static <T, U> T[] copyOfRange(@NonNull U[], int, int, @NonNull Class<? extends T[]>);
    method @NonNull public static byte[] copyOfRange(@NonNull byte[], int, int);
    method @NonNull public static short[] copyOfRange(@NonNull short[], int, int);
    method @NonNull public static int[] copyOfRange(@NonNull int[], int, int);
    method @NonNull public static long[] copyOfRange(@NonNull long[], int, int);
    method @NonNull public static char[] copyOfRange(@NonNull char[], int, int);
    method @NonNull public static float[] copyOfRange(@NonNull float[], int, int);
    method @NonNull public static double[] copyOfRange(@NonNull double[], int, int);
    method @NonNull public static boolean[] copyOfRange(@NonNull boolean[], int, int);
    method public static boolean deepEquals(@Nullable Object[], @Nullable Object[]);
    method public static int deepHashCode(@Nullable Object[]);
    method @NonNull public static String deepToString(@Nullable Object[]);
    method public static boolean equals(@Nullable long[], @Nullable long[]);
    method public static boolean equals(@Nullable int[], @Nullable int[]);
    method public static boolean equals(@Nullable short[], @Nullable short[]);
    method public static boolean equals(@Nullable char[], @Nullable char[]);
    method public static boolean equals(@Nullable byte[], @Nullable byte[]);
    method public static boolean equals(@Nullable boolean[], @Nullable boolean[]);
    method public static boolean equals(@Nullable double[], @Nullable double[]);
    method public static boolean equals(@Nullable float[], @Nullable float[]);
    method public static boolean equals(@Nullable Object[], @Nullable Object[]);
    method public static void fill(@NonNull long[], long);
    method public static void fill(@NonNull long[], int, int, long);
    method public static void fill(@NonNull int[], int);
    method public static void fill(@NonNull int[], int, int, int);
    method public static void fill(@NonNull short[], short);
    method public static void fill(@NonNull short[], int, int, short);
    method public static void fill(@NonNull char[], char);
    method public static void fill(@NonNull char[], int, int, char);
    method public static void fill(@NonNull byte[], byte);
    method public static void fill(@NonNull byte[], int, int, byte);
    method public static void fill(@NonNull boolean[], boolean);
    method public static void fill(@NonNull boolean[], int, int, boolean);
    method public static void fill(@NonNull double[], double);
    method public static void fill(@NonNull double[], int, int, double);
    method public static void fill(@NonNull float[], float);
    method public static void fill(@NonNull float[], int, int, float);
    method public static void fill(@NonNull Object[], @Nullable Object);
    method public static void fill(@NonNull Object[], int, int, @Nullable Object);
    method public static int hashCode(@Nullable long[]);
    method public static int hashCode(@Nullable int[]);
    method public static int hashCode(@Nullable short[]);
    method public static int hashCode(@Nullable char[]);
    method public static int hashCode(@Nullable byte[]);
    method public static int hashCode(@Nullable boolean[]);
    method public static int hashCode(@Nullable float[]);
    method public static int hashCode(@Nullable double[]);
    method public static int hashCode(@Nullable Object[]);
    method public static <T> void parallelPrefix(@NonNull T[], @NonNull java.util.function.BinaryOperator<T>);
    method public static <T> void parallelPrefix(@NonNull T[], int, int, @NonNull java.util.function.BinaryOperator<T>);
    method public static void parallelPrefix(@NonNull long[], @NonNull java.util.function.LongBinaryOperator);
    method public static void parallelPrefix(@NonNull long[], int, int, @NonNull java.util.function.LongBinaryOperator);
    method public static void parallelPrefix(@NonNull double[], @NonNull java.util.function.DoubleBinaryOperator);
    method public static void parallelPrefix(@NonNull double[], int, int, @NonNull java.util.function.DoubleBinaryOperator);
    method public static void parallelPrefix(@NonNull int[], @NonNull java.util.function.IntBinaryOperator);
    method public static void parallelPrefix(@NonNull int[], int, int, @NonNull java.util.function.IntBinaryOperator);
    method public static <T> void parallelSetAll(@NonNull T[], @NonNull java.util.function.IntFunction<? extends T>);
    method public static void parallelSetAll(@NonNull int[], @NonNull java.util.function.IntUnaryOperator);
    method public static void parallelSetAll(@NonNull long[], @NonNull java.util.function.IntToLongFunction);
    method public static void parallelSetAll(@NonNull double[], @NonNull java.util.function.IntToDoubleFunction);
    method public static void parallelSort(@NonNull byte[]);
    method public static void parallelSort(@NonNull byte[], int, int);
    method public static void parallelSort(@NonNull char[]);
    method public static void parallelSort(@NonNull char[], int, int);
    method public static void parallelSort(@NonNull short[]);
    method public static void parallelSort(@NonNull short[], int, int);
    method public static void parallelSort(@NonNull int[]);
    method public static void parallelSort(@NonNull int[], int, int);
    method public static void parallelSort(@NonNull long[]);
    method public static void parallelSort(@NonNull long[], int, int);
    method public static void parallelSort(@NonNull float[]);
    method public static void parallelSort(@NonNull float[], int, int);
    method public static void parallelSort(@NonNull double[]);
    method public static void parallelSort(@NonNull double[], int, int);
    method public static <T extends java.lang.Comparable<? super T>> void parallelSort(@NonNull T[]);
    method public static <T extends java.lang.Comparable<? super T>> void parallelSort(@NonNull T[], int, int);
    method public static <T> void parallelSort(@NonNull T[], @Nullable java.util.Comparator<? super T>);
    method public static <T> void parallelSort(@NonNull T[], int, int, @Nullable java.util.Comparator<? super T>);
    method public static <T> void setAll(@NonNull T[], @NonNull java.util.function.IntFunction<? extends T>);
    method public static void setAll(@NonNull int[], @NonNull java.util.function.IntUnaryOperator);
    method public static void setAll(@NonNull long[], @NonNull java.util.function.IntToLongFunction);
    method public static void setAll(@NonNull double[], @NonNull java.util.function.IntToDoubleFunction);
    method public static void sort(@NonNull int[]);
    method public static void sort(@NonNull int[], int, int);
    method public static void sort(@NonNull long[]);
    method public static void sort(@NonNull long[], int, int);
    method public static void sort(@NonNull short[]);
    method public static void sort(@NonNull short[], int, int);
    method public static void sort(@NonNull char[]);
    method public static void sort(@NonNull char[], int, int);
    method public static void sort(@NonNull byte[]);
    method public static void sort(@NonNull byte[], int, int);
    method public static void sort(@NonNull float[]);
    method public static void sort(@NonNull float[], int, int);
    method public static void sort(@NonNull double[]);
    method public static void sort(@NonNull double[], int, int);
    method public static void sort(@NonNull Object[]);
    method public static void sort(@NonNull Object[], int, int);
    method public static <T> void sort(@NonNull T[], @Nullable java.util.Comparator<? super T>);
    method public static <T> void sort(@NonNull T[], int, int, @Nullable java.util.Comparator<? super T>);
    method @NonNull public static <T> java.util.Spliterator<T> spliterator(@NonNull T[]);
    method @NonNull public static <T> java.util.Spliterator<T> spliterator(@NonNull T[], int, int);
    method @NonNull public static java.util.Spliterator.OfInt spliterator(@NonNull int[]);
    method @NonNull public static java.util.Spliterator.OfInt spliterator(@NonNull int[], int, int);
    method @NonNull public static java.util.Spliterator.OfLong spliterator(@NonNull long[]);
    method @NonNull public static java.util.Spliterator.OfLong spliterator(@NonNull long[], int, int);
    method @NonNull public static java.util.Spliterator.OfDouble spliterator(@NonNull double[]);
    method @NonNull public static java.util.Spliterator.OfDouble spliterator(@NonNull double[], int, int);
    method @NonNull public static <T> java.util.stream.Stream<T> stream(@NonNull T[]);
    method @NonNull public static <T> java.util.stream.Stream<T> stream(@NonNull T[], int, int);
    method @NonNull public static java.util.stream.IntStream stream(@NonNull int[]);
    method @NonNull public static java.util.stream.IntStream stream(@NonNull int[], int, int);
    method @NonNull public static java.util.stream.LongStream stream(@NonNull long[]);
    method @NonNull public static java.util.stream.LongStream stream(@NonNull long[], int, int);
    method @NonNull public static java.util.stream.DoubleStream stream(@NonNull double[]);
    method @NonNull public static java.util.stream.DoubleStream stream(@NonNull double[], int, int);
    method @NonNull public static String toString(@Nullable long[]);
    method @NonNull public static String toString(@Nullable int[]);
    method @NonNull public static String toString(@Nullable short[]);
    method @NonNull public static String toString(@Nullable char[]);
    method @NonNull public static String toString(@Nullable byte[]);
    method @NonNull public static String toString(@Nullable boolean[]);
    method @NonNull public static String toString(@Nullable float[]);
    method @NonNull public static String toString(@Nullable double[]);
    method @NonNull public static String toString(@Nullable Object[]);
  }

  public class Base64 {
    method public static java.util.Base64.Decoder getDecoder();
    method public static java.util.Base64.Encoder getEncoder();
    method public static java.util.Base64.Decoder getMimeDecoder();
    method public static java.util.Base64.Encoder getMimeEncoder();
    method public static java.util.Base64.Encoder getMimeEncoder(int, byte[]);
    method public static java.util.Base64.Decoder getUrlDecoder();
    method public static java.util.Base64.Encoder getUrlEncoder();
  }

  public static class Base64.Decoder {
    method public byte[] decode(byte[]);
    method public byte[] decode(String);
    method public int decode(byte[], byte[]);
    method public java.nio.ByteBuffer decode(java.nio.ByteBuffer);
    method public java.io.InputStream wrap(java.io.InputStream);
  }

  public static class Base64.Encoder {
    method public byte[] encode(byte[]);
    method public int encode(byte[], byte[]);
    method public java.nio.ByteBuffer encode(java.nio.ByteBuffer);
    method public String encodeToString(byte[]);
    method public java.util.Base64.Encoder withoutPadding();
    method public java.io.OutputStream wrap(java.io.OutputStream);
  }

  public class BitSet implements java.lang.Cloneable java.io.Serializable {
    ctor public BitSet();
    ctor public BitSet(int);
    method public void and(java.util.BitSet);
    method public void andNot(java.util.BitSet);
    method public int cardinality();
    method public void clear(int);
    method public void clear(int, int);
    method public void clear();
    method public Object clone();
    method public void flip(int);
    method public void flip(int, int);
    method public boolean get(int);
    method public java.util.BitSet get(int, int);
    method public boolean intersects(java.util.BitSet);
    method public boolean isEmpty();
    method public int length();
    method public int nextClearBit(int);
    method public int nextSetBit(int);
    method public void or(java.util.BitSet);
    method public int previousClearBit(int);
    method public int previousSetBit(int);
    method public void set(int);
    method public void set(int, boolean);
    method public void set(int, int);
    method public void set(int, int, boolean);
    method public int size();
    method public java.util.stream.IntStream stream();
    method public byte[] toByteArray();
    method public long[] toLongArray();
    method public static java.util.BitSet valueOf(long[]);
    method public static java.util.BitSet valueOf(java.nio.LongBuffer);
    method public static java.util.BitSet valueOf(byte[]);
    method public static java.util.BitSet valueOf(java.nio.ByteBuffer);
    method public void xor(java.util.BitSet);
  }

  public abstract class Calendar implements java.lang.Cloneable java.lang.Comparable<java.util.Calendar> java.io.Serializable {
    ctor protected Calendar();
    ctor protected Calendar(@NonNull java.util.TimeZone, @NonNull java.util.Locale);
    method public abstract void add(int, int);
    method public boolean after(@Nullable Object);
    method public boolean before(@Nullable Object);
    method public final void clear();
    method public final void clear(int);
    method @NonNull public Object clone();
    method public int compareTo(@NonNull java.util.Calendar);
    method protected void complete();
    method protected abstract void computeFields();
    method protected abstract void computeTime();
    method public int get(int);
    method public int getActualMaximum(int);
    method public int getActualMinimum(int);
    method @NonNull public static java.util.Set<java.lang.String> getAvailableCalendarTypes();
    method @NonNull public static java.util.Locale[] getAvailableLocales();
    method @NonNull public String getCalendarType();
    method @Nullable public String getDisplayName(int, int, @NonNull java.util.Locale);
    method @Nullable public java.util.Map<java.lang.String,java.lang.Integer> getDisplayNames(int, int, @NonNull java.util.Locale);
    method public int getFirstDayOfWeek();
    method public abstract int getGreatestMinimum(int);
    method @NonNull public static java.util.Calendar getInstance();
    method @NonNull public static java.util.Calendar getInstance(@NonNull java.util.TimeZone);
    method @NonNull public static java.util.Calendar getInstance(@NonNull java.util.Locale);
    method @NonNull public static java.util.Calendar getInstance(@NonNull java.util.TimeZone, @NonNull java.util.Locale);
    method public abstract int getLeastMaximum(int);
    method public abstract int getMaximum(int);
    method public int getMinimalDaysInFirstWeek();
    method public abstract int getMinimum(int);
    method @NonNull public final java.util.Date getTime();
    method public long getTimeInMillis();
    method @NonNull public java.util.TimeZone getTimeZone();
    method public int getWeekYear();
    method public int getWeeksInWeekYear();
    method protected final int internalGet(int);
    method public boolean isLenient();
    method public final boolean isSet(int);
    method public boolean isWeekDateSupported();
    method public abstract void roll(int, boolean);
    method public void roll(int, int);
    method public void set(int, int);
    method public final void set(int, int, int);
    method public final void set(int, int, int, int, int);
    method public final void set(int, int, int, int, int, int);
    method public void setFirstDayOfWeek(int);
    method public void setLenient(boolean);
    method public void setMinimalDaysInFirstWeek(int);
    method public final void setTime(@NonNull java.util.Date);
    method public void setTimeInMillis(long);
    method public void setTimeZone(@NonNull java.util.TimeZone);
    method public void setWeekDate(int, int, int);
    method @NonNull public final java.time.Instant toInstant();
    field public static final int ALL_STYLES = 0; // 0x0
    field public static final int AM = 0; // 0x0
    field public static final int AM_PM = 9; // 0x9
    field public static final int APRIL = 3; // 0x3
    field public static final int AUGUST = 7; // 0x7
    field public static final int DATE = 5; // 0x5
    field public static final int DAY_OF_MONTH = 5; // 0x5
    field public static final int DAY_OF_WEEK = 7; // 0x7
    field public static final int DAY_OF_WEEK_IN_MONTH = 8; // 0x8
    field public static final int DAY_OF_YEAR = 6; // 0x6
    field public static final int DECEMBER = 11; // 0xb
    field public static final int DST_OFFSET = 16; // 0x10
    field public static final int ERA = 0; // 0x0
    field public static final int FEBRUARY = 1; // 0x1
    field public static final int FIELD_COUNT = 17; // 0x11
    field public static final int FRIDAY = 6; // 0x6
    field public static final int HOUR = 10; // 0xa
    field public static final int HOUR_OF_DAY = 11; // 0xb
    field public static final int JANUARY = 0; // 0x0
    field public static final int JULY = 6; // 0x6
    field public static final int JUNE = 5; // 0x5
    field public static final int LONG = 2; // 0x2
    field public static final int LONG_FORMAT = 2; // 0x2
    field public static final int LONG_STANDALONE = 32770; // 0x8002
    field public static final int MARCH = 2; // 0x2
    field public static final int MAY = 4; // 0x4
    field public static final int MILLISECOND = 14; // 0xe
    field public static final int MINUTE = 12; // 0xc
    field public static final int MONDAY = 2; // 0x2
    field public static final int MONTH = 2; // 0x2
    field public static final int NARROW_FORMAT = 4; // 0x4
    field public static final int NARROW_STANDALONE = 32772; // 0x8004
    field public static final int NOVEMBER = 10; // 0xa
    field public static final int OCTOBER = 9; // 0x9
    field public static final int PM = 1; // 0x1
    field public static final int SATURDAY = 7; // 0x7
    field public static final int SECOND = 13; // 0xd
    field public static final int SEPTEMBER = 8; // 0x8
    field public static final int SHORT = 1; // 0x1
    field public static final int SHORT_FORMAT = 1; // 0x1
    field public static final int SHORT_STANDALONE = 32769; // 0x8001
    field public static final int SUNDAY = 1; // 0x1
    field public static final int THURSDAY = 5; // 0x5
    field public static final int TUESDAY = 3; // 0x3
    field public static final int UNDECIMBER = 12; // 0xc
    field public static final int WEDNESDAY = 4; // 0x4
    field public static final int WEEK_OF_MONTH = 4; // 0x4
    field public static final int WEEK_OF_YEAR = 3; // 0x3
    field public static final int YEAR = 1; // 0x1
    field public static final int ZONE_OFFSET = 15; // 0xf
    field protected boolean areFieldsSet;
    field @NonNull protected int[] fields;
    field @NonNull protected boolean[] isSet;
    field protected boolean isTimeSet;
    field protected long time;
  }

  public static class Calendar.Builder {
    ctor public Calendar.Builder();
    method @NonNull public java.util.Calendar build();
    method @NonNull public java.util.Calendar.Builder set(int, int);
    method @NonNull public java.util.Calendar.Builder setCalendarType(@NonNull String);
    method @NonNull public java.util.Calendar.Builder setDate(int, int, int);
    method @NonNull public java.util.Calendar.Builder setFields(@NonNull int...);
    method @NonNull public java.util.Calendar.Builder setInstant(long);
    method @NonNull public java.util.Calendar.Builder setInstant(@NonNull java.util.Date);
    method @NonNull public java.util.Calendar.Builder setLenient(boolean);
    method @NonNull public java.util.Calendar.Builder setLocale(@NonNull java.util.Locale);
    method @NonNull public java.util.Calendar.Builder setTimeOfDay(int, int, int);
    method @NonNull public java.util.Calendar.Builder setTimeOfDay(int, int, int, int);
    method @NonNull public java.util.Calendar.Builder setTimeZone(@NonNull java.util.TimeZone);
    method @NonNull public java.util.Calendar.Builder setWeekDate(int, int, int);
    method @NonNull public java.util.Calendar.Builder setWeekDefinition(int, int);
  }

  public interface Collection<E> extends java.lang.Iterable<E> {
    method public boolean add(E);
    method public boolean addAll(@NonNull java.util.Collection<? extends E>);
    method public void clear();
    method public boolean contains(@Nullable Object);
    method public boolean containsAll(@NonNull java.util.Collection<?>);
    method public boolean equals(@Nullable Object);
    method public int hashCode();
    method public boolean isEmpty();
    method @NonNull public java.util.Iterator<E> iterator();
    method @NonNull public default java.util.stream.Stream<E> parallelStream();
    method public boolean remove(@Nullable Object);
    method public boolean removeAll(@NonNull java.util.Collection<?>);
    method public default boolean removeIf(@NonNull java.util.function.Predicate<? super E>);
    method public boolean retainAll(@NonNull java.util.Collection<?>);
    method public int size();
    method @NonNull public default java.util.Spliterator<E> spliterator();
    method @NonNull public default java.util.stream.Stream<E> stream();
    method @NonNull public Object[] toArray();
    method @NonNull public <T> T[] toArray(@NonNull T[]);
  }

  public class Collections {
    method @java.lang.SafeVarargs public static <T> boolean addAll(@NonNull java.util.Collection<? super T>, @NonNull T...);
    method @NonNull public static <T> java.util.Queue<T> asLifoQueue(@NonNull java.util.Deque<T>);
    method public static <T> int binarySearch(@NonNull java.util.List<? extends java.lang.Comparable<? super T>>, @NonNull T);
    method public static <T> int binarySearch(@NonNull java.util.List<? extends T>, T, @Nullable java.util.Comparator<? super T>);
    method @NonNull public static <E> java.util.Collection<E> checkedCollection(@NonNull java.util.Collection<E>, @NonNull Class<E>);
    method @NonNull public static <E> java.util.List<E> checkedList(@NonNull java.util.List<E>, @NonNull Class<E>);
    method @NonNull public static <K, V> java.util.Map<K,V> checkedMap(@NonNull java.util.Map<K,V>, @NonNull Class<K>, @NonNull Class<V>);
    method @NonNull public static <K, V> java.util.NavigableMap<K,V> checkedNavigableMap(@NonNull java.util.NavigableMap<K,V>, @NonNull Class<K>, @NonNull Class<V>);
    method @NonNull public static <E> java.util.NavigableSet<E> checkedNavigableSet(@NonNull java.util.NavigableSet<E>, @NonNull Class<E>);
    method @NonNull public static <E> java.util.Queue<E> checkedQueue(@NonNull java.util.Queue<E>, @NonNull Class<E>);
    method @NonNull public static <E> java.util.Set<E> checkedSet(@NonNull java.util.Set<E>, @NonNull Class<E>);
    method @NonNull public static <K, V> java.util.SortedMap<K,V> checkedSortedMap(@NonNull java.util.SortedMap<K,V>, @NonNull Class<K>, @NonNull Class<V>);
    method @NonNull public static <E> java.util.SortedSet<E> checkedSortedSet(@NonNull java.util.SortedSet<E>, @NonNull Class<E>);
    method public static <T> void copy(@NonNull java.util.List<? super T>, @NonNull java.util.List<? extends T>);
    method public static boolean disjoint(@NonNull java.util.Collection<?>, @NonNull java.util.Collection<?>);
    method @NonNull public static <T> java.util.Enumeration<T> emptyEnumeration();
    method @NonNull public static <T> java.util.Iterator<T> emptyIterator();
    method @NonNull public static final <T> java.util.List<T> emptyList();
    method @NonNull public static <T> java.util.ListIterator<T> emptyListIterator();
    method @NonNull public static final <K, V> java.util.Map<K,V> emptyMap();
    method @NonNull public static final <K, V> java.util.NavigableMap<K,V> emptyNavigableMap();
    method @NonNull public static <E> java.util.NavigableSet<E> emptyNavigableSet();
    method @NonNull public static final <T> java.util.Set<T> emptySet();
    method @NonNull public static final <K, V> java.util.SortedMap<K,V> emptySortedMap();
    method @NonNull public static <E> java.util.SortedSet<E> emptySortedSet();
    method @NonNull public static <T> java.util.Enumeration<T> enumeration(@NonNull java.util.Collection<T>);
    method public static <T> void fill(@NonNull java.util.List<? super T>, T);
    method public static int frequency(@NonNull java.util.Collection<?>, @Nullable Object);
    method public static int indexOfSubList(@NonNull java.util.List<?>, @NonNull java.util.List<?>);
    method public static int lastIndexOfSubList(@NonNull java.util.List<?>, @NonNull java.util.List<?>);
    method @NonNull public static <T> java.util.ArrayList<T> list(@NonNull java.util.Enumeration<T>);
    method @NonNull public static <T extends java.lang.Object & java.lang.Comparable<? super T>> T max(@NonNull java.util.Collection<? extends T>);
    method public static <T> T max(@NonNull java.util.Collection<? extends T>, @Nullable java.util.Comparator<? super T>);
    method @NonNull public static <T extends java.lang.Object & java.lang.Comparable<? super T>> T min(@NonNull java.util.Collection<? extends T>);
    method public static <T> T min(@NonNull java.util.Collection<? extends T>, @Nullable java.util.Comparator<? super T>);
    method @NonNull public static <T> java.util.List<T> nCopies(int, T);
    method @NonNull public static <E> java.util.Set<E> newSetFromMap(@NonNull java.util.Map<E,java.lang.Boolean>);
    method public static <T> boolean replaceAll(@NonNull java.util.List<T>, T, T);
    method public static void reverse(@NonNull java.util.List<?>);
    method @NonNull public static <T> java.util.Comparator<T> reverseOrder();
    method @NonNull public static <T> java.util.Comparator<T> reverseOrder(@Nullable java.util.Comparator<T>);
    method public static void rotate(@NonNull java.util.List<?>, int);
    method public static void shuffle(@NonNull java.util.List<?>);
    method public static void shuffle(@NonNull java.util.List<?>, @NonNull java.util.Random);
    method @NonNull public static <T> java.util.Set<T> singleton(T);
    method @NonNull public static <T> java.util.List<T> singletonList(T);
    method @NonNull public static <K, V> java.util.Map<K,V> singletonMap(K, V);
    method public static <T extends java.lang.Comparable<? super T>> void sort(@NonNull java.util.List<T>);
    method public static <T> void sort(@NonNull java.util.List<T>, @Nullable java.util.Comparator<? super T>);
    method public static void swap(@NonNull java.util.List<?>, int, int);
    method @NonNull public static <T> java.util.Collection<T> synchronizedCollection(@NonNull java.util.Collection<T>);
    method @NonNull public static <T> java.util.List<T> synchronizedList(@NonNull java.util.List<T>);
    method @NonNull public static <K, V> java.util.Map<K,V> synchronizedMap(@NonNull java.util.Map<K,V>);
    method @NonNull public static <K, V> java.util.NavigableMap<K,V> synchronizedNavigableMap(@NonNull java.util.NavigableMap<K,V>);
    method @NonNull public static <T> java.util.NavigableSet<T> synchronizedNavigableSet(@NonNull java.util.NavigableSet<T>);
    method @NonNull public static <T> java.util.Set<T> synchronizedSet(@NonNull java.util.Set<T>);
    method @NonNull public static <K, V> java.util.SortedMap<K,V> synchronizedSortedMap(@NonNull java.util.SortedMap<K,V>);
    method @NonNull public static <T> java.util.SortedSet<T> synchronizedSortedSet(@NonNull java.util.SortedSet<T>);
    method @NonNull public static <T> java.util.Collection<T> unmodifiableCollection(@NonNull java.util.Collection<? extends T>);
    method @NonNull public static <T> java.util.List<T> unmodifiableList(@NonNull java.util.List<? extends T>);
    method @NonNull public static <K, V> java.util.Map<K,V> unmodifiableMap(@NonNull java.util.Map<? extends K,? extends V>);
    method @NonNull public static <K, V> java.util.NavigableMap<K,V> unmodifiableNavigableMap(@NonNull java.util.NavigableMap<K,? extends V>);
    method @NonNull public static <T> java.util.NavigableSet<T> unmodifiableNavigableSet(@NonNull java.util.NavigableSet<T>);
    method @NonNull public static <T> java.util.Set<T> unmodifiableSet(@NonNull java.util.Set<? extends T>);
    method @NonNull public static <K, V> java.util.SortedMap<K,V> unmodifiableSortedMap(@NonNull java.util.SortedMap<K,? extends V>);
    method @NonNull public static <T> java.util.SortedSet<T> unmodifiableSortedSet(@NonNull java.util.SortedSet<T>);
    field @NonNull public static final java.util.List EMPTY_LIST;
    field @NonNull public static final java.util.Map EMPTY_MAP;
    field @NonNull public static final java.util.Set EMPTY_SET;
  }

  @java.lang.FunctionalInterface public interface Comparator<T> {
    method public int compare(T, T);
    method public static <T, U> java.util.Comparator<T> comparing(java.util.function.Function<? super T,? extends U>, java.util.Comparator<? super U>);
    method public static <T, U extends java.lang.Comparable<? super U>> java.util.Comparator<T> comparing(java.util.function.Function<? super T,? extends U>);
    method public static <T> java.util.Comparator<T> comparingDouble(java.util.function.ToDoubleFunction<? super T>);
    method public static <T> java.util.Comparator<T> comparingInt(java.util.function.ToIntFunction<? super T>);
    method public static <T> java.util.Comparator<T> comparingLong(java.util.function.ToLongFunction<? super T>);
    method public boolean equals(Object);
    method public static <T extends java.lang.Comparable<? super T>> java.util.Comparator<T> naturalOrder();
    method public static <T> java.util.Comparator<T> nullsFirst(java.util.Comparator<? super T>);
    method public static <T> java.util.Comparator<T> nullsLast(java.util.Comparator<? super T>);
    method public static <T extends java.lang.Comparable<? super T>> java.util.Comparator<T> reverseOrder();
    method public default java.util.Comparator<T> reversed();
    method public default java.util.Comparator<T> thenComparing(java.util.Comparator<? super T>);
    method public default <U> java.util.Comparator<T> thenComparing(java.util.function.Function<? super T,? extends U>, java.util.Comparator<? super U>);
    method public default <U extends java.lang.Comparable<? super U>> java.util.Comparator<T> thenComparing(java.util.function.Function<? super T,? extends U>);
    method public default java.util.Comparator<T> thenComparingDouble(java.util.function.ToDoubleFunction<? super T>);
    method public default java.util.Comparator<T> thenComparingInt(java.util.function.ToIntFunction<? super T>);
    method public default java.util.Comparator<T> thenComparingLong(java.util.function.ToLongFunction<? super T>);
  }

  public class ConcurrentModificationException extends java.lang.RuntimeException {
    ctor public ConcurrentModificationException();
    ctor public ConcurrentModificationException(String);
    ctor public ConcurrentModificationException(Throwable);
    ctor public ConcurrentModificationException(String, Throwable);
  }

  public final class Currency implements java.io.Serializable {
    method public static java.util.Set<java.util.Currency> getAvailableCurrencies();
    method public String getCurrencyCode();
    method public int getDefaultFractionDigits();
    method public String getDisplayName();
    method public String getDisplayName(java.util.Locale);
    method public static java.util.Currency getInstance(String);
    method public static java.util.Currency getInstance(java.util.Locale);
    method public int getNumericCode();
    method public String getSymbol();
    method public String getSymbol(java.util.Locale);
  }

  public class Date implements java.lang.Cloneable java.lang.Comparable<java.util.Date> java.io.Serializable {
    ctor public Date();
    ctor public Date(long);
    ctor @Deprecated public Date(int, int, int);
    ctor @Deprecated public Date(int, int, int, int, int);
    ctor @Deprecated public Date(int, int, int, int, int, int);
    ctor @Deprecated public Date(String);
    method @Deprecated public static long UTC(int, int, int, int, int, int);
    method public boolean after(java.util.Date);
    method public boolean before(java.util.Date);
    method public Object clone();
    method public int compareTo(java.util.Date);
    method public static java.util.Date from(java.time.Instant);
    method @Deprecated public int getDate();
    method @Deprecated public int getDay();
    method @Deprecated public int getHours();
    method @Deprecated public int getMinutes();
    method @Deprecated public int getMonth();
    method @Deprecated public int getSeconds();
    method public long getTime();
    method @Deprecated public int getTimezoneOffset();
    method @Deprecated public int getYear();
    method @Deprecated public static long parse(String);
    method @Deprecated public void setDate(int);
    method @Deprecated public void setHours(int);
    method @Deprecated public void setMinutes(int);
    method @Deprecated public void setMonth(int);
    method @Deprecated public void setSeconds(int);
    method public void setTime(long);
    method @Deprecated public void setYear(int);
    method @Deprecated public String toGMTString();
    method public java.time.Instant toInstant();
    method @Deprecated public String toLocaleString();
  }

  public interface Deque<E> extends java.util.Queue<E> {
    method public void addFirst(E);
    method public void addLast(E);
    method @NonNull public java.util.Iterator<E> descendingIterator();
    method public E getFirst();
    method public E getLast();
    method public boolean offerFirst(E);
    method public boolean offerLast(E);
    method @Nullable public E peekFirst();
    method @Nullable public E peekLast();
    method @Nullable public E pollFirst();
    method @Nullable public E pollLast();
    method public E pop();
    method public void push(E);
    method public E removeFirst();
    method public boolean removeFirstOccurrence(@Nullable Object);
    method public E removeLast();
    method public boolean removeLastOccurrence(@Nullable Object);
  }

  public abstract class Dictionary<K, V> {
    ctor public Dictionary();
    method public abstract java.util.Enumeration<V> elements();
    method public abstract V get(Object);
    method public abstract boolean isEmpty();
    method public abstract java.util.Enumeration<K> keys();
    method public abstract V put(K, V);
    method public abstract V remove(Object);
    method public abstract int size();
  }

  public class DoubleSummaryStatistics implements java.util.function.DoubleConsumer {
    ctor public DoubleSummaryStatistics();
    method public void accept(double);
    method public void combine(java.util.DoubleSummaryStatistics);
    method public final double getAverage();
    method public final long getCount();
    method public final double getMax();
    method public final double getMin();
    method public final double getSum();
  }

  public class DuplicateFormatFlagsException extends java.util.IllegalFormatException {
    ctor public DuplicateFormatFlagsException(String);
    method public String getFlags();
  }

  public class EmptyStackException extends java.lang.RuntimeException {
    ctor public EmptyStackException();
  }

  public class EnumMap<K extends java.lang.Enum<K>, V> extends java.util.AbstractMap<K,V> implements java.lang.Cloneable java.io.Serializable {
    ctor public EnumMap(Class<K>);
    ctor public EnumMap(java.util.EnumMap<K,? extends V>);
    ctor public EnumMap(java.util.Map<K,? extends V>);
    method public java.util.EnumMap<K,V> clone();
    method public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
  }

  public abstract class EnumSet<E extends java.lang.Enum<E>> extends java.util.AbstractSet<E> implements java.lang.Cloneable java.io.Serializable {
    method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> allOf(Class<E>);
    method public java.util.EnumSet<E> clone();
    method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> complementOf(java.util.EnumSet<E>);
    method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> copyOf(java.util.EnumSet<E>);
    method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> copyOf(java.util.Collection<E>);
    method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> noneOf(Class<E>);
    method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E);
    method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E, E);
    method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E, E, E);
    method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E, E, E, E);
    method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E, E, E, E, E);
    method @java.lang.SafeVarargs public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E, E...);
    method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> range(E, E);
  }

  public interface Enumeration<E> {
    method public boolean hasMoreElements();
    method public E nextElement();
  }

  public interface EventListener {
  }

  public abstract class EventListenerProxy<T extends java.util.EventListener> implements java.util.EventListener {
    ctor public EventListenerProxy(T);
    method public T getListener();
  }

  public class EventObject implements java.io.Serializable {
    ctor public EventObject(Object);
    method public Object getSource();
    field protected transient Object source;
  }

  public class FormatFlagsConversionMismatchException extends java.util.IllegalFormatException {
    ctor public FormatFlagsConversionMismatchException(String, char);
    method public char getConversion();
    method public String getFlags();
  }

  public interface Formattable {
    method public void formatTo(java.util.Formatter, int, int, int);
  }

  public class FormattableFlags {
    field public static final int ALTERNATE = 4; // 0x4
    field public static final int LEFT_JUSTIFY = 1; // 0x1
    field public static final int UPPERCASE = 2; // 0x2
  }

  public final class Formatter implements java.io.Closeable java.io.Flushable {
    ctor public Formatter();
    ctor public Formatter(Appendable);
    ctor public Formatter(java.util.Locale);
    ctor public Formatter(Appendable, java.util.Locale);
    ctor public Formatter(String) throws java.io.FileNotFoundException;
    ctor public Formatter(String, String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    ctor public Formatter(String, String, java.util.Locale) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    ctor public Formatter(java.io.File) throws java.io.FileNotFoundException;
    ctor public Formatter(java.io.File, String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    ctor public Formatter(java.io.File, String, java.util.Locale) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    ctor public Formatter(java.io.PrintStream);
    ctor public Formatter(java.io.OutputStream);
    ctor public Formatter(java.io.OutputStream, String) throws java.io.UnsupportedEncodingException;
    ctor public Formatter(java.io.OutputStream, String, java.util.Locale) throws java.io.UnsupportedEncodingException;
    method public void close();
    method public void flush();
    method public java.util.Formatter format(String, java.lang.Object...);
    method public java.util.Formatter format(java.util.Locale, String, java.lang.Object...);
    method public java.io.IOException ioException();
    method public java.util.Locale locale();
    method public Appendable out();
  }

  public enum Formatter.BigDecimalLayoutForm {
    enum_constant public static final java.util.Formatter.BigDecimalLayoutForm DECIMAL_FLOAT;
    enum_constant public static final java.util.Formatter.BigDecimalLayoutForm SCIENTIFIC;
  }

  public class FormatterClosedException extends java.lang.IllegalStateException {
    ctor public FormatterClosedException();
  }

  public class GregorianCalendar extends java.util.Calendar {
    ctor public GregorianCalendar();
    ctor public GregorianCalendar(java.util.TimeZone);
    ctor public GregorianCalendar(java.util.Locale);
    ctor public GregorianCalendar(java.util.TimeZone, java.util.Locale);
    ctor public GregorianCalendar(int, int, int);
    ctor public GregorianCalendar(int, int, int, int, int);
    ctor public GregorianCalendar(int, int, int, int, int, int);
    method public void add(int, int);
    method protected void computeFields();
    method protected void computeTime();
    method public static java.util.GregorianCalendar from(java.time.ZonedDateTime);
    method public int getGreatestMinimum(int);
    method public final java.util.Date getGregorianChange();
    method public int getLeastMaximum(int);
    method public int getMaximum(int);
    method public int getMinimum(int);
    method public boolean isLeapYear(int);
    method public final boolean isWeekDateSupported();
    method public void roll(int, boolean);
    method public void setGregorianChange(java.util.Date);
    method public java.time.ZonedDateTime toZonedDateTime();
    field public static final int AD = 1; // 0x1
    field public static final int BC = 0; // 0x0
  }

  public class HashMap<K, V> extends java.util.AbstractMap<K,V> implements java.lang.Cloneable java.util.Map<K,V> java.io.Serializable {
    ctor public HashMap(int, float);
    ctor public HashMap(int);
    ctor public HashMap();
    ctor public HashMap(@NonNull java.util.Map<? extends K,? extends V>);
    method @NonNull public Object clone();
    method @NonNull public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
  }

  public class HashSet<E> extends java.util.AbstractSet<E> implements java.lang.Cloneable java.io.Serializable java.util.Set<E> {
    ctor public HashSet();
    ctor public HashSet(@NonNull java.util.Collection<? extends E>);
    ctor public HashSet(int, float);
    ctor public HashSet(int);
    method @NonNull public Object clone();
    method @NonNull public java.util.Iterator<E> iterator();
    method public int size();
  }

  public class Hashtable<K, V> extends java.util.Dictionary<K,V> implements java.lang.Cloneable java.util.Map<K,V> java.io.Serializable {
    ctor public Hashtable(int, float);
    ctor public Hashtable(int);
    ctor public Hashtable();
    ctor public Hashtable(java.util.Map<? extends K,? extends V>);
    method public void clear();
    method public Object clone();
    method public boolean contains(Object);
    method public boolean containsKey(Object);
    method public boolean containsValue(Object);
    method public java.util.Enumeration<V> elements();
    method public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
    method public V get(Object);
    method public boolean isEmpty();
    method public java.util.Set<K> keySet();
    method public java.util.Enumeration<K> keys();
    method public V put(K, V);
    method public void putAll(java.util.Map<? extends K,? extends V>);
    method protected void rehash();
    method public V remove(Object);
    method public int size();
    method public java.util.Collection<V> values();
  }

  public class IdentityHashMap<K, V> extends java.util.AbstractMap<K,V> implements java.lang.Cloneable java.util.Map<K,V> java.io.Serializable {
    ctor public IdentityHashMap();
    ctor public IdentityHashMap(int);
    ctor public IdentityHashMap(java.util.Map<? extends K,? extends V>);
    method public Object clone();
    method public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
  }

  public class IllegalFormatCodePointException extends java.util.IllegalFormatException {
    ctor public IllegalFormatCodePointException(int);
    method public int getCodePoint();
  }

  public class IllegalFormatConversionException extends java.util.IllegalFormatException {
    ctor public IllegalFormatConversionException(char, Class<?>);
    method public Class<?> getArgumentClass();
    method public char getConversion();
  }

  public class IllegalFormatException extends java.lang.IllegalArgumentException {
  }

  public class IllegalFormatFlagsException extends java.util.IllegalFormatException {
    ctor public IllegalFormatFlagsException(String);
    method public String getFlags();
  }

  public class IllegalFormatPrecisionException extends java.util.IllegalFormatException {
    ctor public IllegalFormatPrecisionException(int);
    method public int getPrecision();
  }

  public class IllegalFormatWidthException extends java.util.IllegalFormatException {
    ctor public IllegalFormatWidthException(int);
    method public int getWidth();
  }

  public class IllformedLocaleException extends java.lang.RuntimeException {
    ctor public IllformedLocaleException();
    ctor public IllformedLocaleException(String);
    ctor public IllformedLocaleException(String, int);
    method public int getErrorIndex();
  }

  public class InputMismatchException extends java.util.NoSuchElementException {
    ctor public InputMismatchException();
    ctor public InputMismatchException(String);
  }

  public class IntSummaryStatistics implements java.util.function.IntConsumer {
    ctor public IntSummaryStatistics();
    method public void accept(int);
    method public void combine(java.util.IntSummaryStatistics);
    method public final double getAverage();
    method public final long getCount();
    method public final int getMax();
    method public final int getMin();
    method public final long getSum();
  }

  public class InvalidPropertiesFormatException extends java.io.IOException {
    ctor public InvalidPropertiesFormatException(Throwable);
    ctor public InvalidPropertiesFormatException(String);
  }

  public interface Iterator<E> {
    method public default void forEachRemaining(@NonNull java.util.function.Consumer<? super E>);
    method public boolean hasNext();
    method public E next();
    method public default void remove();
  }

  public class LinkedHashMap<K, V> extends java.util.HashMap<K,V> implements java.util.Map<K,V> {
    ctor public LinkedHashMap(int, float);
    ctor public LinkedHashMap(int);
    ctor public LinkedHashMap();
    ctor public LinkedHashMap(java.util.Map<? extends K,? extends V>);
    ctor public LinkedHashMap(int, float, boolean);
    method protected boolean removeEldestEntry(java.util.Map.Entry<K,V>);
  }

  public class LinkedHashSet<E> extends java.util.HashSet<E> implements java.lang.Cloneable java.io.Serializable java.util.Set<E> {
    ctor public LinkedHashSet(int, float);
    ctor public LinkedHashSet(int);
    ctor public LinkedHashSet();
    ctor public LinkedHashSet(java.util.Collection<? extends E>);
  }

  public class LinkedList<E> extends java.util.AbstractSequentialList<E> implements java.lang.Cloneable java.util.Deque<E> java.util.List<E> java.io.Serializable {
    ctor public LinkedList();
    ctor public LinkedList(@NonNull java.util.Collection<? extends E>);
    method public void addFirst(E);
    method public void addLast(E);
    method @NonNull public Object clone();
    method @NonNull public java.util.Iterator<E> descendingIterator();
    method public E element();
    method public E getFirst();
    method public E getLast();
    method public boolean offer(E);
    method public boolean offerFirst(E);
    method public boolean offerLast(E);
    method @Nullable public E peek();
    method @Nullable public E peekFirst();
    method @Nullable public E peekLast();
    method @Nullable public E poll();
    method @Nullable public E pollFirst();
    method @Nullable public E pollLast();
    method public E pop();
    method public void push(E);
    method public E remove();
    method public E removeFirst();
    method public boolean removeFirstOccurrence(@Nullable Object);
    method public E removeLast();
    method public boolean removeLastOccurrence(@Nullable Object);
    method public int size();
  }

  public interface List<E> extends java.util.Collection<E> {
    method public void add(int, E);
    method public boolean addAll(int, @NonNull java.util.Collection<? extends E>);
    method public E get(int);
    method public int indexOf(@Nullable Object);
    method public int lastIndexOf(@Nullable Object);
    method @NonNull public java.util.ListIterator<E> listIterator();
    method @NonNull public java.util.ListIterator<E> listIterator(int);
    method public E remove(int);
    method public default void replaceAll(@NonNull java.util.function.UnaryOperator<E>);
    method public E set(int, E);
    method public default void sort(@Nullable java.util.Comparator<? super E>);
    method @NonNull public java.util.List<E> subList(int, int);
  }

  public interface ListIterator<E> extends java.util.Iterator<E> {
    method public void add(E);
    method public boolean hasPrevious();
    method public int nextIndex();
    method public E previous();
    method public int previousIndex();
    method public void remove();
    method public void set(E);
  }

  public abstract class ListResourceBundle extends java.util.ResourceBundle {
    ctor public ListResourceBundle();
    method protected abstract Object[][] getContents();
    method public java.util.Enumeration<java.lang.String> getKeys();
    method public final Object handleGetObject(String);
  }

  public final class Locale implements java.lang.Cloneable java.io.Serializable {
    ctor public Locale(@NonNull String, @NonNull String, @NonNull String);
    ctor public Locale(@NonNull String, @NonNull String);
    ctor public Locale(@NonNull String);
    method @NonNull public Object clone();
    method @NonNull public static java.util.List<java.util.Locale> filter(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Collection<java.util.Locale>, @NonNull java.util.Locale.FilteringMode);
    method @NonNull public static java.util.List<java.util.Locale> filter(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Collection<java.util.Locale>);
    method @NonNull public static java.util.List<java.lang.String> filterTags(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Collection<java.lang.String>, @NonNull java.util.Locale.FilteringMode);
    method @NonNull public static java.util.List<java.lang.String> filterTags(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Collection<java.lang.String>);
    method @NonNull public static java.util.Locale forLanguageTag(@NonNull String);
    method @NonNull public static java.util.Locale[] getAvailableLocales();
    method @NonNull public String getCountry();
    method @NonNull public static java.util.Locale getDefault();
    method @NonNull public static java.util.Locale getDefault(@NonNull java.util.Locale.Category);
    method @NonNull public String getDisplayCountry();
    method @NonNull public String getDisplayCountry(@NonNull java.util.Locale);
    method @NonNull public String getDisplayLanguage();
    method @NonNull public String getDisplayLanguage(@NonNull java.util.Locale);
    method @NonNull public String getDisplayName();
    method @NonNull public String getDisplayName(@NonNull java.util.Locale);
    method @NonNull public String getDisplayScript();
    method @NonNull public String getDisplayScript(@NonNull java.util.Locale);
    method @NonNull public String getDisplayVariant();
    method @NonNull public String getDisplayVariant(@NonNull java.util.Locale);
    method @Nullable public String getExtension(char);
    method @NonNull public java.util.Set<java.lang.Character> getExtensionKeys();
    method @NonNull public String getISO3Country() throws java.util.MissingResourceException;
    method @NonNull public String getISO3Language() throws java.util.MissingResourceException;
    method @NonNull public static String[] getISOCountries();
    method @NonNull public static String[] getISOLanguages();
    method @NonNull public String getLanguage();
    method @NonNull public String getScript();
    method @NonNull public java.util.Set<java.lang.String> getUnicodeLocaleAttributes();
    method @NonNull public java.util.Set<java.lang.String> getUnicodeLocaleKeys();
    method @Nullable public String getUnicodeLocaleType(@NonNull String);
    method @NonNull public String getVariant();
    method public boolean hasExtensions();
    method @Nullable public static java.util.Locale lookup(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Collection<java.util.Locale>);
    method @Nullable public static String lookupTag(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Collection<java.lang.String>);
    method public static void setDefault(@NonNull java.util.Locale);
    method public static void setDefault(@NonNull java.util.Locale.Category, @NonNull java.util.Locale);
    method @NonNull public java.util.Locale stripExtensions();
    method @NonNull public String toLanguageTag();
    field @NonNull public static final java.util.Locale CANADA;
    field @NonNull public static final java.util.Locale CANADA_FRENCH;
    field @NonNull public static final java.util.Locale CHINA;
    field @NonNull public static final java.util.Locale CHINESE;
    field @NonNull public static final java.util.Locale ENGLISH;
    field @NonNull public static final java.util.Locale FRANCE;
    field @NonNull public static final java.util.Locale FRENCH;
    field @NonNull public static final java.util.Locale GERMAN;
    field @NonNull public static final java.util.Locale GERMANY;
    field @NonNull public static final java.util.Locale ITALIAN;
    field @NonNull public static final java.util.Locale ITALY;
    field @NonNull public static final java.util.Locale JAPAN;
    field @NonNull public static final java.util.Locale JAPANESE;
    field @NonNull public static final java.util.Locale KOREA;
    field @NonNull public static final java.util.Locale KOREAN;
    field @NonNull public static final java.util.Locale PRC;
    field public static final char PRIVATE_USE_EXTENSION = 120; // 0x0078 'x'
    field @NonNull public static final java.util.Locale ROOT;
    field @NonNull public static final java.util.Locale SIMPLIFIED_CHINESE;
    field @NonNull public static final java.util.Locale TAIWAN;
    field @NonNull public static final java.util.Locale TRADITIONAL_CHINESE;
    field @NonNull public static final java.util.Locale UK;
    field public static final char UNICODE_LOCALE_EXTENSION = 117; // 0x0075 'u'
    field @NonNull public static final java.util.Locale US;
  }

  public static final class Locale.Builder {
    ctor public Locale.Builder();
    method @NonNull public java.util.Locale.Builder addUnicodeLocaleAttribute(@NonNull String);
    method @NonNull public java.util.Locale build();
    method @NonNull public java.util.Locale.Builder clear();
    method @NonNull public java.util.Locale.Builder clearExtensions();
    method @NonNull public java.util.Locale.Builder removeUnicodeLocaleAttribute(@NonNull String);
    method @NonNull public java.util.Locale.Builder setExtension(char, @Nullable String);
    method @NonNull public java.util.Locale.Builder setLanguage(@Nullable String);
    method @NonNull public java.util.Locale.Builder setLanguageTag(@NonNull String);
    method @NonNull public java.util.Locale.Builder setLocale(@NonNull java.util.Locale);
    method @NonNull public java.util.Locale.Builder setRegion(@Nullable String);
    method @NonNull public java.util.Locale.Builder setScript(@Nullable String);
    method @NonNull public java.util.Locale.Builder setUnicodeLocaleKeyword(@NonNull String, @Nullable String);
    method @NonNull public java.util.Locale.Builder setVariant(@Nullable String);
  }

  public enum Locale.Category {
    enum_constant public static final java.util.Locale.Category DISPLAY;
    enum_constant public static final java.util.Locale.Category FORMAT;
  }

  public enum Locale.FilteringMode {
    enum_constant public static final java.util.Locale.FilteringMode AUTOSELECT_FILTERING;
    enum_constant public static final java.util.Locale.FilteringMode EXTENDED_FILTERING;
    enum_constant public static final java.util.Locale.FilteringMode IGNORE_EXTENDED_RANGES;
    enum_constant public static final java.util.Locale.FilteringMode MAP_EXTENDED_RANGES;
    enum_constant public static final java.util.Locale.FilteringMode REJECT_EXTENDED_RANGES;
  }

  public static final class Locale.LanguageRange {
    ctor public Locale.LanguageRange(@NonNull String);
    ctor public Locale.LanguageRange(@NonNull String, double);
    method @NonNull public String getRange();
    method public double getWeight();
    method @NonNull public static java.util.List<java.util.Locale.LanguageRange> mapEquivalents(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Map<java.lang.String,java.util.List<java.lang.String>>);
    method @NonNull public static java.util.List<java.util.Locale.LanguageRange> parse(@NonNull String);
    method @NonNull public static java.util.List<java.util.Locale.LanguageRange> parse(@NonNull String, @NonNull java.util.Map<java.lang.String,java.util.List<java.lang.String>>);
    field public static final double MAX_WEIGHT = 1.0;
    field public static final double MIN_WEIGHT = 0.0;
  }

  public class LongSummaryStatistics implements java.util.function.IntConsumer java.util.function.LongConsumer {
    ctor public LongSummaryStatistics();
    method public void accept(int);
    method public void accept(long);
    method public void combine(java.util.LongSummaryStatistics);
    method public final double getAverage();
    method public final long getCount();
    method public final long getMax();
    method public final long getMin();
    method public final long getSum();
  }

  public interface Map<K, V> {
    method public void clear();
    method @Nullable public default V compute(K, @NonNull java.util.function.BiFunction<? super K,? super V,? extends V>);
    method @Nullable public default V computeIfAbsent(K, @NonNull java.util.function.Function<? super K,? extends V>);
    method @Nullable public default V computeIfPresent(K, @NonNull java.util.function.BiFunction<? super K,? super V,? extends V>);
    method public boolean containsKey(@Nullable Object);
    method public boolean containsValue(@Nullable Object);
    method @NonNull public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
    method public boolean equals(@Nullable Object);
    method public default void forEach(@NonNull java.util.function.BiConsumer<? super K,? super V>);
    method @Nullable public V get(@Nullable Object);
    method @Nullable public default V getOrDefault(@Nullable Object, @Nullable V);
    method public int hashCode();
    method public boolean isEmpty();
    method @NonNull public java.util.Set<K> keySet();
    method @Nullable public default V merge(K, @NonNull V, @NonNull java.util.function.BiFunction<? super V,? super V,? extends V>);
    method @Nullable public V put(K, V);
    method public void putAll(@NonNull java.util.Map<? extends K,? extends V>);
    method @Nullable public default V putIfAbsent(K, V);
    method @Nullable public V remove(@Nullable Object);
    method public default boolean remove(@Nullable Object, @Nullable Object);
    method public default boolean replace(K, @Nullable V, V);
    method @Nullable public default V replace(K, V);
    method public default void replaceAll(@NonNull java.util.function.BiFunction<? super K,? super V,? extends V>);
    method public int size();
    method @NonNull public java.util.Collection<V> values();
  }

  public static interface Map.Entry<K, V> {
    method @NonNull public static <K extends java.lang.Comparable<? super K>, V> java.util.Comparator<java.util.Map.Entry<K,V>> comparingByKey();
    method @NonNull public static <K, V> java.util.Comparator<java.util.Map.Entry<K,V>> comparingByKey(@NonNull java.util.Comparator<? super K>);
    method @NonNull public static <K, V extends java.lang.Comparable<? super V>> java.util.Comparator<java.util.Map.Entry<K,V>> comparingByValue();
    method @NonNull public static <K, V> java.util.Comparator<java.util.Map.Entry<K,V>> comparingByValue(@NonNull java.util.Comparator<? super V>);
    method public boolean equals(@Nullable Object);
    method public K getKey();
    method public V getValue();
    method public int hashCode();
    method public V setValue(V);
  }

  public class MissingFormatArgumentException extends java.util.IllegalFormatException {
    ctor public MissingFormatArgumentException(String);
    method public String getFormatSpecifier();
  }

  public class MissingFormatWidthException extends java.util.IllegalFormatException {
    ctor public MissingFormatWidthException(String);
    method public String getFormatSpecifier();
  }

  public class MissingResourceException extends java.lang.RuntimeException {
    ctor public MissingResourceException(String, String, String);
    method public String getClassName();
    method public String getKey();
  }

  public interface NavigableMap<K, V> extends java.util.SortedMap<K,V> {
    method @Nullable public java.util.Map.Entry<K,V> ceilingEntry(K);
    method @Nullable public K ceilingKey(K);
    method @NonNull public java.util.NavigableSet<K> descendingKeySet();
    method @NonNull public java.util.NavigableMap<K,V> descendingMap();
    method @Nullable public java.util.Map.Entry<K,V> firstEntry();
    method @Nullable public java.util.Map.Entry<K,V> floorEntry(K);
    method @Nullable public K floorKey(K);
    method @NonNull public java.util.NavigableMap<K,V> headMap(K, boolean);
    method @Nullable public java.util.Map.Entry<K,V> higherEntry(K);
    method @Nullable public K higherKey(K);
    method @Nullable public java.util.Map.Entry<K,V> lastEntry();
    method @Nullable public java.util.Map.Entry<K,V> lowerEntry(K);
    method @Nullable public K lowerKey(K);
    method @NonNull public java.util.NavigableSet<K> navigableKeySet();
    method @Nullable public java.util.Map.Entry<K,V> pollFirstEntry();
    method @Nullable public java.util.Map.Entry<K,V> pollLastEntry();
    method @NonNull public java.util.NavigableMap<K,V> subMap(K, boolean, K, boolean);
    method @NonNull public java.util.NavigableMap<K,V> tailMap(K, boolean);
  }

  public interface NavigableSet<E> extends java.util.SortedSet<E> {
    method public E ceiling(E);
    method public java.util.Iterator<E> descendingIterator();
    method public java.util.NavigableSet<E> descendingSet();
    method public E floor(E);
    method public java.util.NavigableSet<E> headSet(E, boolean);
    method public E higher(E);
    method public E lower(E);
    method public E pollFirst();
    method public E pollLast();
    method public java.util.NavigableSet<E> subSet(E, boolean, E, boolean);
    method public java.util.NavigableSet<E> tailSet(E, boolean);
  }

  public class NoSuchElementException extends java.lang.RuntimeException {
    ctor public NoSuchElementException();
    ctor public NoSuchElementException(String);
  }

  public final class Objects {
    method public static <T> int compare(T, T, @NonNull java.util.Comparator<? super T>);
    method public static boolean deepEquals(@Nullable Object, @Nullable Object);
    method public static boolean equals(@Nullable Object, @Nullable Object);
    method public static int hash(@Nullable java.lang.Object...);
    method public static int hashCode(@Nullable Object);
    method public static boolean isNull(@Nullable Object);
    method public static boolean nonNull(@Nullable Object);
    method @NonNull public static <T> T requireNonNull(@Nullable T);
    method @NonNull public static <T> T requireNonNull(@Nullable T, @NonNull String);
    method @NonNull public static <T> T requireNonNull(@Nullable T, @NonNull java.util.function.Supplier<java.lang.String>);
    method @NonNull public static String toString(@Nullable Object);
    method @NonNull public static String toString(@Nullable Object, @NonNull String);
  }

  public class Observable {
    ctor public Observable();
    method public void addObserver(java.util.Observer);
    method protected void clearChanged();
    method public int countObservers();
    method public void deleteObserver(java.util.Observer);
    method public void deleteObservers();
    method public boolean hasChanged();
    method public void notifyObservers();
    method public void notifyObservers(Object);
    method protected void setChanged();
  }

  public interface Observer {
    method public void update(java.util.Observable, Object);
  }

  public final class Optional<T> {
    method public static <T> java.util.Optional<T> empty();
    method public java.util.Optional<T> filter(java.util.function.Predicate<? super T>);
    method public <U> java.util.Optional<U> flatMap(java.util.function.Function<? super T,java.util.Optional<U>>);
    method public T get();
    method public void ifPresent(java.util.function.Consumer<? super T>);
    method public boolean isPresent();
    method public <U> java.util.Optional<U> map(java.util.function.Function<? super T,? extends U>);
    method public static <T> java.util.Optional<T> of(T);
    method public static <T> java.util.Optional<T> ofNullable(T);
    method public T orElse(T);
    method public T orElseGet(java.util.function.Supplier<? extends T>);
    method public <X extends java.lang.Throwable> T orElseThrow(java.util.function.Supplier<? extends X>) throws X;
  }

  public final class OptionalDouble {
    method public static java.util.OptionalDouble empty();
    method public double getAsDouble();
    method public void ifPresent(java.util.function.DoubleConsumer);
    method public boolean isPresent();
    method public static java.util.OptionalDouble of(double);
    method public double orElse(double);
    method public double orElseGet(java.util.function.DoubleSupplier);
    method public <X extends java.lang.Throwable> double orElseThrow(java.util.function.Supplier<X>) throws X;
  }

  public final class OptionalInt {
    method public static java.util.OptionalInt empty();
    method public int getAsInt();
    method public void ifPresent(java.util.function.IntConsumer);
    method public boolean isPresent();
    method public static java.util.OptionalInt of(int);
    method public int orElse(int);
    method public int orElseGet(java.util.function.IntSupplier);
    method public <X extends java.lang.Throwable> int orElseThrow(java.util.function.Supplier<X>) throws X;
  }

  public final class OptionalLong {
    method public static java.util.OptionalLong empty();
    method public long getAsLong();
    method public void ifPresent(java.util.function.LongConsumer);
    method public boolean isPresent();
    method public static java.util.OptionalLong of(long);
    method public long orElse(long);
    method public long orElseGet(java.util.function.LongSupplier);
    method public <X extends java.lang.Throwable> long orElseThrow(java.util.function.Supplier<X>) throws X;
  }

  public interface PrimitiveIterator<T, T_CONS> extends java.util.Iterator<T> {
    method public void forEachRemaining(T_CONS);
  }

  public static interface PrimitiveIterator.OfDouble extends java.util.PrimitiveIterator<java.lang.Double,java.util.function.DoubleConsumer> {
    method public default void forEachRemaining(java.util.function.DoubleConsumer);
    method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Double>);
    method public default Double next();
    method public double nextDouble();
  }

  public static interface PrimitiveIterator.OfInt extends java.util.PrimitiveIterator<java.lang.Integer,java.util.function.IntConsumer> {
    method public default void forEachRemaining(java.util.function.IntConsumer);
    method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Integer>);
    method public default Integer next();
    method public int nextInt();
  }

  public static interface PrimitiveIterator.OfLong extends java.util.PrimitiveIterator<java.lang.Long,java.util.function.LongConsumer> {
    method public default void forEachRemaining(java.util.function.LongConsumer);
    method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Long>);
    method public default Long next();
    method public long nextLong();
  }

  public class PriorityQueue<E> extends java.util.AbstractQueue<E> implements java.io.Serializable {
    ctor public PriorityQueue();
    ctor public PriorityQueue(int);
    ctor public PriorityQueue(java.util.Comparator<? super E>);
    ctor public PriorityQueue(int, java.util.Comparator<? super E>);
    ctor public PriorityQueue(java.util.Collection<? extends E>);
    ctor public PriorityQueue(java.util.PriorityQueue<? extends E>);
    ctor public PriorityQueue(java.util.SortedSet<? extends E>);
    method public java.util.Comparator<? super E> comparator();
    method public java.util.Iterator<E> iterator();
    method public boolean offer(E);
    method public E peek();
    method public E poll();
    method public int size();
    method public final java.util.Spliterator<E> spliterator();
  }

  public class Properties extends java.util.Hashtable<java.lang.Object,java.lang.Object> {
    ctor public Properties();
    ctor public Properties(java.util.Properties);
    method public String getProperty(String);
    method public String getProperty(String, String);
    method public void list(java.io.PrintStream);
    method public void list(java.io.PrintWriter);
    method public void load(java.io.Reader) throws java.io.IOException;
    method public void load(java.io.InputStream) throws java.io.IOException;
    method public void loadFromXML(java.io.InputStream) throws java.io.IOException, java.util.InvalidPropertiesFormatException;
    method public java.util.Enumeration<?> propertyNames();
    method @Deprecated public void save(java.io.OutputStream, String);
    method public Object setProperty(String, String);
    method public void store(java.io.Writer, String) throws java.io.IOException;
    method public void store(java.io.OutputStream, String) throws java.io.IOException;
    method public void storeToXML(java.io.OutputStream, String) throws java.io.IOException;
    method public void storeToXML(java.io.OutputStream, String, String) throws java.io.IOException;
    method public java.util.Set<java.lang.String> stringPropertyNames();
    field protected java.util.Properties defaults;
  }

  public final class PropertyPermission extends java.security.BasicPermission {
    ctor public PropertyPermission(String, String);
  }

  public class PropertyResourceBundle extends java.util.ResourceBundle {
    ctor public PropertyResourceBundle(java.io.InputStream) throws java.io.IOException;
    ctor public PropertyResourceBundle(java.io.Reader) throws java.io.IOException;
    method public java.util.Enumeration<java.lang.String> getKeys();
    method public Object handleGetObject(String);
  }

  public interface Queue<E> extends java.util.Collection<E> {
    method public E element();
    method public boolean offer(E);
    method @Nullable public E peek();
    method @Nullable public E poll();
    method public E remove();
  }

  public class Random implements java.io.Serializable {
    ctor public Random();
    ctor public Random(long);
    method public java.util.stream.DoubleStream doubles(long);
    method public java.util.stream.DoubleStream doubles();
    method public java.util.stream.DoubleStream doubles(long, double, double);
    method public java.util.stream.DoubleStream doubles(double, double);
    method public java.util.stream.IntStream ints(long);
    method public java.util.stream.IntStream ints();
    method public java.util.stream.IntStream ints(long, int, int);
    method public java.util.stream.IntStream ints(int, int);
    method public java.util.stream.LongStream longs(long);
    method public java.util.stream.LongStream longs();
    method public java.util.stream.LongStream longs(long, long, long);
    method public java.util.stream.LongStream longs(long, long);
    method protected int next(int);
    method public boolean nextBoolean();
    method public void nextBytes(byte[]);
    method public double nextDouble();
    method public float nextFloat();
    method public double nextGaussian();
    method public int nextInt();
    method public int nextInt(int);
    method public long nextLong();
    method public void setSeed(long);
  }

  public interface RandomAccess {
  }

  public abstract class ResourceBundle {
    ctor public ResourceBundle();
    method public static final void clearCache();
    method public static final void clearCache(ClassLoader);
    method public boolean containsKey(String);
    method public String getBaseBundleName();
    method public static final java.util.ResourceBundle getBundle(String);
    method public static final java.util.ResourceBundle getBundle(String, java.util.ResourceBundle.Control);
    method public static final java.util.ResourceBundle getBundle(String, java.util.Locale);
    method public static final java.util.ResourceBundle getBundle(String, java.util.Locale, java.util.ResourceBundle.Control);
    method public static java.util.ResourceBundle getBundle(String, java.util.Locale, ClassLoader);
    method public static java.util.ResourceBundle getBundle(String, java.util.Locale, ClassLoader, java.util.ResourceBundle.Control);
    method public abstract java.util.Enumeration<java.lang.String> getKeys();
    method public java.util.Locale getLocale();
    method public final Object getObject(String);
    method public final String getString(String);
    method public final String[] getStringArray(String);
    method protected abstract Object handleGetObject(String);
    method protected java.util.Set<java.lang.String> handleKeySet();
    method public java.util.Set<java.lang.String> keySet();
    method protected void setParent(java.util.ResourceBundle);
    field protected java.util.ResourceBundle parent;
  }

  public static class ResourceBundle.Control {
    ctor protected ResourceBundle.Control();
    method public java.util.List<java.util.Locale> getCandidateLocales(String, java.util.Locale);
    method public static final java.util.ResourceBundle.Control getControl(java.util.List<java.lang.String>);
    method public java.util.Locale getFallbackLocale(String, java.util.Locale);
    method public java.util.List<java.lang.String> getFormats(String);
    method public static final java.util.ResourceBundle.Control getNoFallbackControl(java.util.List<java.lang.String>);
    method public long getTimeToLive(String, java.util.Locale);
    method public boolean needsReload(String, java.util.Locale, String, ClassLoader, java.util.ResourceBundle, long);
    method public java.util.ResourceBundle newBundle(String, java.util.Locale, String, ClassLoader, boolean) throws java.io.IOException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public String toBundleName(String, java.util.Locale);
    method public final String toResourceName(String, String);
    field public static final java.util.List<java.lang.String> FORMAT_CLASS;
    field public static final java.util.List<java.lang.String> FORMAT_DEFAULT;
    field public static final java.util.List<java.lang.String> FORMAT_PROPERTIES;
    field public static final long TTL_DONT_CACHE = -1L; // 0xffffffffffffffffL
    field public static final long TTL_NO_EXPIRATION_CONTROL = -2L; // 0xfffffffffffffffeL
  }

  public final class Scanner implements java.io.Closeable java.util.Iterator<java.lang.String> {
    ctor public Scanner(Readable);
    ctor public Scanner(java.io.InputStream);
    ctor public Scanner(java.io.InputStream, String);
    ctor public Scanner(java.io.File) throws java.io.FileNotFoundException;
    ctor public Scanner(java.io.File, String) throws java.io.FileNotFoundException;
    ctor public Scanner(java.nio.file.Path) throws java.io.IOException;
    ctor public Scanner(java.nio.file.Path, String) throws java.io.IOException;
    ctor public Scanner(String);
    ctor public Scanner(java.nio.channels.ReadableByteChannel);
    ctor public Scanner(java.nio.channels.ReadableByteChannel, String);
    method public void close();
    method public java.util.regex.Pattern delimiter();
    method public String findInLine(String);
    method public String findInLine(java.util.regex.Pattern);
    method public String findWithinHorizon(String, int);
    method public String findWithinHorizon(java.util.regex.Pattern, int);
    method public boolean hasNext();
    method public boolean hasNext(String);
    method public boolean hasNext(java.util.regex.Pattern);
    method public boolean hasNextBigDecimal();
    method public boolean hasNextBigInteger();
    method public boolean hasNextBigInteger(int);
    method public boolean hasNextBoolean();
    method public boolean hasNextByte();
    method public boolean hasNextByte(int);
    method public boolean hasNextDouble();
    method public boolean hasNextFloat();
    method public boolean hasNextInt();
    method public boolean hasNextInt(int);
    method public boolean hasNextLine();
    method public boolean hasNextLong();
    method public boolean hasNextLong(int);
    method public boolean hasNextShort();
    method public boolean hasNextShort(int);
    method public java.io.IOException ioException();
    method public java.util.Locale locale();
    method public java.util.regex.MatchResult match();
    method public String next();
    method public String next(String);
    method public String next(java.util.regex.Pattern);
    method public java.math.BigDecimal nextBigDecimal();
    method public java.math.BigInteger nextBigInteger();
    method public java.math.BigInteger nextBigInteger(int);
    method public boolean nextBoolean();
    method public byte nextByte();
    method public byte nextByte(int);
    method public double nextDouble();
    method public float nextFloat();
    method public int nextInt();
    method public int nextInt(int);
    method public String nextLine();
    method public long nextLong();
    method public long nextLong(int);
    method public short nextShort();
    method public short nextShort(int);
    method public int radix();
    method public java.util.Scanner reset();
    method public java.util.Scanner skip(java.util.regex.Pattern);
    method public java.util.Scanner skip(String);
    method public java.util.Scanner useDelimiter(java.util.regex.Pattern);
    method public java.util.Scanner useDelimiter(String);
    method public java.util.Scanner useLocale(java.util.Locale);
    method public java.util.Scanner useRadix(int);
  }

  public class ServiceConfigurationError extends java.lang.Error {
    ctor public ServiceConfigurationError(String);
    ctor public ServiceConfigurationError(String, Throwable);
  }

  public final class ServiceLoader<S> implements java.lang.Iterable<S> {
    method public java.util.Iterator<S> iterator();
    method public static <S> java.util.ServiceLoader<S> load(Class<S>, ClassLoader);
    method public static <S> java.util.ServiceLoader<S> load(Class<S>);
    method public static <S> java.util.ServiceLoader<S> loadInstalled(Class<S>);
    method public void reload();
  }

  public interface Set<E> extends java.util.Collection<E> {
  }

  public class SimpleTimeZone extends java.util.TimeZone {
    ctor public SimpleTimeZone(int, String);
    ctor public SimpleTimeZone(int, String, int, int, int, int, int, int, int, int);
    ctor public SimpleTimeZone(int, String, int, int, int, int, int, int, int, int, int);
    ctor public SimpleTimeZone(int, String, int, int, int, int, int, int, int, int, int, int, int);
    method public int getOffset(int, int, int, int, int, int);
    method public int getRawOffset();
    method public boolean inDaylightTime(java.util.Date);
    method public void setDSTSavings(int);
    method public void setEndRule(int, int, int, int);
    method public void setEndRule(int, int, int);
    method public void setEndRule(int, int, int, int, boolean);
    method public void setRawOffset(int);
    method public void setStartRule(int, int, int, int);
    method public void setStartRule(int, int, int);
    method public void setStartRule(int, int, int, int, boolean);
    method public void setStartYear(int);
    method public boolean useDaylightTime();
    field public static final int STANDARD_TIME = 1; // 0x1
    field public static final int UTC_TIME = 2; // 0x2
    field public static final int WALL_TIME = 0; // 0x0
  }

  public interface SortedMap<K, V> extends java.util.Map<K,V> {
    method @Nullable public java.util.Comparator<? super K> comparator();
    method public K firstKey();
    method @NonNull public java.util.SortedMap<K,V> headMap(K);
    method public K lastKey();
    method @NonNull public java.util.SortedMap<K,V> subMap(K, K);
    method @NonNull public java.util.SortedMap<K,V> tailMap(K);
  }

  public interface SortedSet<E> extends java.util.Set<E> {
    method public java.util.Comparator<? super E> comparator();
    method public E first();
    method public java.util.SortedSet<E> headSet(E);
    method public E last();
    method public java.util.SortedSet<E> subSet(E, E);
    method public java.util.SortedSet<E> tailSet(E);
  }

  public interface Spliterator<T> {
    method public int characteristics();
    method public long estimateSize();
    method public default void forEachRemaining(java.util.function.Consumer<? super T>);
    method public default java.util.Comparator<? super T> getComparator();
    method public default long getExactSizeIfKnown();
    method public default boolean hasCharacteristics(int);
    method public boolean tryAdvance(java.util.function.Consumer<? super T>);
    method public java.util.Spliterator<T> trySplit();
    field public static final int CONCURRENT = 4096; // 0x1000
    field public static final int DISTINCT = 1; // 0x1
    field public static final int IMMUTABLE = 1024; // 0x400
    field public static final int NONNULL = 256; // 0x100
    field public static final int ORDERED = 16; // 0x10
    field public static final int SIZED = 64; // 0x40
    field public static final int SORTED = 4; // 0x4
    field public static final int SUBSIZED = 16384; // 0x4000
  }

  public static interface Spliterator.OfDouble extends java.util.Spliterator.OfPrimitive<java.lang.Double,java.util.function.DoubleConsumer,java.util.Spliterator.OfDouble> {
    method public default void forEachRemaining(java.util.function.DoubleConsumer);
    method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Double>);
    method public boolean tryAdvance(java.util.function.DoubleConsumer);
    method public default boolean tryAdvance(java.util.function.Consumer<? super java.lang.Double>);
    method public java.util.Spliterator.OfDouble trySplit();
  }

  public static interface Spliterator.OfInt extends java.util.Spliterator.OfPrimitive<java.lang.Integer,java.util.function.IntConsumer,java.util.Spliterator.OfInt> {
    method public default void forEachRemaining(java.util.function.IntConsumer);
    method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Integer>);
    method public boolean tryAdvance(java.util.function.IntConsumer);
    method public default boolean tryAdvance(java.util.function.Consumer<? super java.lang.Integer>);
    method public java.util.Spliterator.OfInt trySplit();
  }

  public static interface Spliterator.OfLong extends java.util.Spliterator.OfPrimitive<java.lang.Long,java.util.function.LongConsumer,java.util.Spliterator.OfLong> {
    method public default void forEachRemaining(java.util.function.LongConsumer);
    method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Long>);
    method public boolean tryAdvance(java.util.function.LongConsumer);
    method public default boolean tryAdvance(java.util.function.Consumer<? super java.lang.Long>);
    method public java.util.Spliterator.OfLong trySplit();
  }

  public static interface Spliterator.OfPrimitive<T, T_CONS, T_SPLITR extends java.util.Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> extends java.util.Spliterator<T> {
    method public default void forEachRemaining(T_CONS);
    method public boolean tryAdvance(T_CONS);
    method public T_SPLITR trySplit();
  }

  public final class Spliterators {
    method public static java.util.Spliterator.OfDouble emptyDoubleSpliterator();
    method public static java.util.Spliterator.OfInt emptyIntSpliterator();
    method public static java.util.Spliterator.OfLong emptyLongSpliterator();
    method public static <T> java.util.Spliterator<T> emptySpliterator();
    method public static <T> java.util.Iterator<T> iterator(java.util.Spliterator<? extends T>);
    method public static java.util.PrimitiveIterator.OfInt iterator(java.util.Spliterator.OfInt);
    method public static java.util.PrimitiveIterator.OfLong iterator(java.util.Spliterator.OfLong);
    method public static java.util.PrimitiveIterator.OfDouble iterator(java.util.Spliterator.OfDouble);
    method public static <T> java.util.Spliterator<T> spliterator(Object[], int);
    method public static <T> java.util.Spliterator<T> spliterator(Object[], int, int, int);
    method public static java.util.Spliterator.OfInt spliterator(int[], int);
    method public static java.util.Spliterator.OfInt spliterator(int[], int, int, int);
    method public static java.util.Spliterator.OfLong spliterator(long[], int);
    method public static java.util.Spliterator.OfLong spliterator(long[], int, int, int);
    method public static java.util.Spliterator.OfDouble spliterator(double[], int);
    method public static java.util.Spliterator.OfDouble spliterator(double[], int, int, int);
    method public static <T> java.util.Spliterator<T> spliterator(java.util.Collection<? extends T>, int);
    method public static <T> java.util.Spliterator<T> spliterator(java.util.Iterator<? extends T>, long, int);
    method public static java.util.Spliterator.OfInt spliterator(java.util.PrimitiveIterator.OfInt, long, int);
    method public static java.util.Spliterator.OfLong spliterator(java.util.PrimitiveIterator.OfLong, long, int);
    method public static java.util.Spliterator.OfDouble spliterator(java.util.PrimitiveIterator.OfDouble, long, int);
    method public static <T> java.util.Spliterator<T> spliteratorUnknownSize(java.util.Iterator<? extends T>, int);
    method public static java.util.Spliterator.OfInt spliteratorUnknownSize(java.util.PrimitiveIterator.OfInt, int);
    method public static java.util.Spliterator.OfLong spliteratorUnknownSize(java.util.PrimitiveIterator.OfLong, int);
    method public static java.util.Spliterator.OfDouble spliteratorUnknownSize(java.util.PrimitiveIterator.OfDouble, int);
  }

  public abstract static class Spliterators.AbstractDoubleSpliterator implements java.util.Spliterator.OfDouble {
    ctor protected Spliterators.AbstractDoubleSpliterator(long, int);
    method public int characteristics();
    method public long estimateSize();
    method public java.util.Spliterator.OfDouble trySplit();
  }

  public abstract static class Spliterators.AbstractIntSpliterator implements java.util.Spliterator.OfInt {
    ctor protected Spliterators.AbstractIntSpliterator(long, int);
    method public int characteristics();
    method public long estimateSize();
    method public java.util.Spliterator.OfInt trySplit();
  }

  public abstract static class Spliterators.AbstractLongSpliterator implements java.util.Spliterator.OfLong {
    ctor protected Spliterators.AbstractLongSpliterator(long, int);
    method public int characteristics();
    method public long estimateSize();
    method public java.util.Spliterator.OfLong trySplit();
  }

  public abstract static class Spliterators.AbstractSpliterator<T> implements java.util.Spliterator<T> {
    ctor protected Spliterators.AbstractSpliterator(long, int);
    method public int characteristics();
    method public long estimateSize();
    method public java.util.Spliterator<T> trySplit();
  }

  public final class SplittableRandom {
    ctor public SplittableRandom(long);
    ctor public SplittableRandom();
    method public java.util.stream.DoubleStream doubles(long);
    method public java.util.stream.DoubleStream doubles();
    method public java.util.stream.DoubleStream doubles(long, double, double);
    method public java.util.stream.DoubleStream doubles(double, double);
    method public java.util.stream.IntStream ints(long);
    method public java.util.stream.IntStream ints();
    method public java.util.stream.IntStream ints(long, int, int);
    method public java.util.stream.IntStream ints(int, int);
    method public java.util.stream.LongStream longs(long);
    method public java.util.stream.LongStream longs();
    method public java.util.stream.LongStream longs(long, long, long);
    method public java.util.stream.LongStream longs(long, long);
    method public boolean nextBoolean();
    method public double nextDouble();
    method public double nextDouble(double);
    method public double nextDouble(double, double);
    method public int nextInt();
    method public int nextInt(int);
    method public int nextInt(int, int);
    method public long nextLong();
    method public long nextLong(long);
    method public long nextLong(long, long);
    method public java.util.SplittableRandom split();
  }

  public class Stack<E> extends java.util.Vector<E> {
    ctor public Stack();
    method public boolean empty();
    method public E peek();
    method public E pop();
    method public E push(E);
    method public int search(Object);
  }

  public final class StringJoiner {
    ctor public StringJoiner(CharSequence);
    ctor public StringJoiner(CharSequence, CharSequence, CharSequence);
    method public java.util.StringJoiner add(CharSequence);
    method public int length();
    method public java.util.StringJoiner merge(java.util.StringJoiner);
    method public java.util.StringJoiner setEmptyValue(CharSequence);
  }

  public class StringTokenizer implements java.util.Enumeration<java.lang.Object> {
    ctor public StringTokenizer(String, String, boolean);
    ctor public StringTokenizer(String, String);
    ctor public StringTokenizer(String);
    method public int countTokens();
    method public boolean hasMoreElements();
    method public boolean hasMoreTokens();
    method public Object nextElement();
    method public String nextToken();
    method public String nextToken(String);
  }

  public abstract class TimeZone implements java.lang.Cloneable java.io.Serializable {
    ctor public TimeZone();
    method public Object clone();
    method public static String[] getAvailableIDs(int);
    method public static String[] getAvailableIDs();
    method public int getDSTSavings();
    method public static java.util.TimeZone getDefault();
    method public final String getDisplayName();
    method public final String getDisplayName(java.util.Locale);
    method public final String getDisplayName(boolean, int);
    method public String getDisplayName(boolean, int, java.util.Locale);
    method public String getID();
    method public abstract int getOffset(int, int, int, int, int, int);
    method public int getOffset(long);
    method public abstract int getRawOffset();
    method public static java.util.TimeZone getTimeZone(String);
    method public static java.util.TimeZone getTimeZone(java.time.ZoneId);
    method public boolean hasSameRules(java.util.TimeZone);
    method public abstract boolean inDaylightTime(java.util.Date);
    method public boolean observesDaylightTime();
    method public static void setDefault(java.util.TimeZone);
    method public void setID(String);
    method public abstract void setRawOffset(int);
    method public java.time.ZoneId toZoneId();
    method public abstract boolean useDaylightTime();
    field public static final int LONG = 1; // 0x1
    field public static final int SHORT = 0; // 0x0
  }

  public class Timer {
    ctor public Timer();
    ctor public Timer(boolean);
    ctor public Timer(String);
    ctor public Timer(String, boolean);
    method public void cancel();
    method public int purge();
    method public void schedule(java.util.TimerTask, long);
    method public void schedule(java.util.TimerTask, java.util.Date);
    method public void schedule(java.util.TimerTask, long, long);
    method public void schedule(java.util.TimerTask, java.util.Date, long);
    method public void scheduleAtFixedRate(java.util.TimerTask, long, long);
    method public void scheduleAtFixedRate(java.util.TimerTask, java.util.Date, long);
  }

  public abstract class TimerTask implements java.lang.Runnable {
    ctor protected TimerTask();
    method public boolean cancel();
    method public long scheduledExecutionTime();
  }

  public class TooManyListenersException extends java.lang.Exception {
    ctor public TooManyListenersException();
    ctor public TooManyListenersException(String);
  }

  public class TreeMap<K, V> extends java.util.AbstractMap<K,V> implements java.lang.Cloneable java.util.NavigableMap<K,V> java.io.Serializable {
    ctor public TreeMap();
    ctor public TreeMap(@Nullable java.util.Comparator<? super K>);
    ctor public TreeMap(@NonNull java.util.Map<? extends K,? extends V>);
    ctor public TreeMap(@NonNull java.util.SortedMap<K,? extends V>);
    method @Nullable public java.util.Map.Entry<K,V> ceilingEntry(K);
    method @Nullable public K ceilingKey(K);
    method @NonNull public Object clone();
    method @Nullable public java.util.Comparator<? super K> comparator();
    method @NonNull public java.util.NavigableSet<K> descendingKeySet();
    method @NonNull public java.util.NavigableMap<K,V> descendingMap();
    method @NonNull public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
    method @Nullable public java.util.Map.Entry<K,V> firstEntry();
    method public K firstKey();
    method @Nullable public java.util.Map.Entry<K,V> floorEntry(K);
    method @Nullable public K floorKey(K);
    method @NonNull public java.util.NavigableMap<K,V> headMap(K, boolean);
    method @NonNull public java.util.SortedMap<K,V> headMap(K);
    method @Nullable public java.util.Map.Entry<K,V> higherEntry(K);
    method @Nullable public K higherKey(K);
    method @Nullable public java.util.Map.Entry<K,V> lastEntry();
    method public K lastKey();
    method @Nullable public java.util.Map.Entry<K,V> lowerEntry(K);
    method @Nullable public K lowerKey(K);
    method @NonNull public java.util.NavigableSet<K> navigableKeySet();
    method @Nullable public java.util.Map.Entry<K,V> pollFirstEntry();
    method @Nullable public java.util.Map.Entry<K,V> pollLastEntry();
    method @NonNull public java.util.NavigableMap<K,V> subMap(K, boolean, K, boolean);
    method @NonNull public java.util.SortedMap<K,V> subMap(K, K);
    method @NonNull public java.util.NavigableMap<K,V> tailMap(K, boolean);
    method @NonNull public java.util.SortedMap<K,V> tailMap(K);
  }

  public class TreeSet<E> extends java.util.AbstractSet<E> implements java.lang.Cloneable java.util.NavigableSet<E> java.io.Serializable {
    ctor public TreeSet();
    ctor public TreeSet(java.util.Comparator<? super E>);
    ctor public TreeSet(java.util.Collection<? extends E>);
    ctor public TreeSet(java.util.SortedSet<E>);
    method public E ceiling(E);
    method public Object clone();
    method public java.util.Comparator<? super E> comparator();
    method public java.util.Iterator<E> descendingIterator();
    method public java.util.NavigableSet<E> descendingSet();
    method public E first();
    method public E floor(E);
    method public java.util.NavigableSet<E> headSet(E, boolean);
    method public java.util.SortedSet<E> headSet(E);
    method public E higher(E);
    method public java.util.Iterator<E> iterator();
    method public E last();
    method public E lower(E);
    method public E pollFirst();
    method public E pollLast();
    method public int size();
    method public java.util.NavigableSet<E> subSet(E, boolean, E, boolean);
    method public java.util.SortedSet<E> subSet(E, E);
    method public java.util.NavigableSet<E> tailSet(E, boolean);
    method public java.util.SortedSet<E> tailSet(E);
  }

  public final class UUID implements java.lang.Comparable<java.util.UUID> java.io.Serializable {
    ctor public UUID(long, long);
    method public int clockSequence();
    method public int compareTo(java.util.UUID);
    method public static java.util.UUID fromString(String);
    method public long getLeastSignificantBits();
    method public long getMostSignificantBits();
    method public static java.util.UUID nameUUIDFromBytes(byte[]);
    method public long node();
    method public static java.util.UUID randomUUID();
    method public long timestamp();
    method public int variant();
    method public int version();
  }

  public class UnknownFormatConversionException extends java.util.IllegalFormatException {
    ctor public UnknownFormatConversionException(String);
    method public String getConversion();
  }

  public class UnknownFormatFlagsException extends java.util.IllegalFormatException {
    ctor public UnknownFormatFlagsException(String);
    method public String getFlags();
  }

  public class Vector<E> extends java.util.AbstractList<E> implements java.lang.Cloneable java.util.List<E> java.util.RandomAccess java.io.Serializable {
    ctor public Vector(int, int);
    ctor public Vector(int);
    ctor public Vector();
    ctor public Vector(@NonNull java.util.Collection<? extends E>);
    method public void addElement(E);
    method public int capacity();
    method @NonNull public Object clone();
    method public void copyInto(@NonNull Object[]);
    method public E elementAt(int);
    method @NonNull public java.util.Enumeration<E> elements();
    method public void ensureCapacity(int);
    method public E firstElement();
    method public void forEach(@NonNull java.util.function.Consumer<? super E>);
    method public E get(int);
    method public int indexOf(@Nullable Object, int);
    method public void insertElementAt(E, int);
    method public E lastElement();
    method public int lastIndexOf(@Nullable Object, int);
    method public void removeAllElements();
    method public boolean removeElement(@Nullable Object);
    method public void removeElementAt(int);
    method public void setElementAt(E, int);
    method public void setSize(int);
    method public int size();
    method public void trimToSize();
    field protected int capacityIncrement;
    field protected int elementCount;
    field @NonNull protected Object[] elementData;
  }

  public class WeakHashMap<K, V> extends java.util.AbstractMap<K,V> implements java.util.Map<K,V> {
    ctor public WeakHashMap(int, float);
    ctor public WeakHashMap(int);
    ctor public WeakHashMap();
    ctor public WeakHashMap(@NonNull java.util.Map<? extends K,? extends V>);
    method @NonNull public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
  }

}

package java.util.concurrent {

  public abstract class AbstractExecutorService implements java.util.concurrent.ExecutorService {
    ctor public AbstractExecutorService();
    method public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>>) throws java.lang.InterruptedException;
    method public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>>, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
    method public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>, long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
    method protected <T> java.util.concurrent.RunnableFuture<T> newTaskFor(Runnable, T);
    method protected <T> java.util.concurrent.RunnableFuture<T> newTaskFor(java.util.concurrent.Callable<T>);
    method public java.util.concurrent.Future<?> submit(Runnable);
    method public <T> java.util.concurrent.Future<T> submit(Runnable, T);
    method public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T>);
  }

  public class ArrayBlockingQueue<E> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingQueue<E> java.io.Serializable {
    ctor public ArrayBlockingQueue(int);
    ctor public ArrayBlockingQueue(int, boolean);
    ctor public ArrayBlockingQueue(int, boolean, java.util.Collection<? extends E>);
    method public int drainTo(java.util.Collection<? super E>);
    method public int drainTo(java.util.Collection<? super E>, int);
    method public java.util.Iterator<E> iterator();
    method public boolean offer(E);
    method public boolean offer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public E peek();
    method public E poll();
    method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public void put(E) throws java.lang.InterruptedException;
    method public int remainingCapacity();
    method public int size();
    method public E take() throws java.lang.InterruptedException;
  }

  public interface BlockingDeque<E> extends java.util.concurrent.BlockingQueue<E> java.util.Deque<E> {
    method public boolean offerFirst(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public boolean offerLast(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public E pollFirst(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public E pollLast(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public void putFirst(E) throws java.lang.InterruptedException;
    method public void putLast(E) throws java.lang.InterruptedException;
    method public E takeFirst() throws java.lang.InterruptedException;
    method public E takeLast() throws java.lang.InterruptedException;
  }

  public interface BlockingQueue<E> extends java.util.Queue<E> {
    method public int drainTo(java.util.Collection<? super E>);
    method public int drainTo(java.util.Collection<? super E>, int);
    method public boolean offer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public void put(E) throws java.lang.InterruptedException;
    method public int remainingCapacity();
    method public E take() throws java.lang.InterruptedException;
  }

  public class BrokenBarrierException extends java.lang.Exception {
    ctor public BrokenBarrierException();
    ctor public BrokenBarrierException(String);
  }

  @java.lang.FunctionalInterface public interface Callable<V> {
    method public V call() throws java.lang.Exception;
  }

  public class CancellationException extends java.lang.IllegalStateException {
    ctor public CancellationException();
    ctor public CancellationException(String);
  }

  public class CompletableFuture<T> implements java.util.concurrent.CompletionStage<T> java.util.concurrent.Future<T> {
    ctor public CompletableFuture();
    method public java.util.concurrent.CompletableFuture<java.lang.Void> acceptEither(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>, java.util.concurrent.Executor);
    method public static java.util.concurrent.CompletableFuture<java.lang.Void> allOf(java.util.concurrent.CompletableFuture<?>...);
    method public static java.util.concurrent.CompletableFuture<java.lang.Object> anyOf(java.util.concurrent.CompletableFuture<?>...);
    method public <U> java.util.concurrent.CompletableFuture<U> applyToEither(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T,U>);
    method public <U> java.util.concurrent.CompletableFuture<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T,U>);
    method public <U> java.util.concurrent.CompletableFuture<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T,U>, java.util.concurrent.Executor);
    method public boolean cancel(boolean);
    method public boolean complete(T);
    method public boolean completeExceptionally(Throwable);
    method public static <U> java.util.concurrent.CompletableFuture<U> completedFuture(U);
    method public java.util.concurrent.CompletableFuture<T> exceptionally(java.util.function.Function<java.lang.Throwable,? extends T>);
    method public T get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
    method public T get(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
    method public T getNow(T);
    method public int getNumberOfDependents();
    method public <U> java.util.concurrent.CompletableFuture<U> handle(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U>);
    method public <U> java.util.concurrent.CompletableFuture<U> handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U>);
    method public <U> java.util.concurrent.CompletableFuture<U> handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U>, java.util.concurrent.Executor);
    method public boolean isCancelled();
    method public boolean isCompletedExceptionally();
    method public boolean isDone();
    method public T join();
    method public void obtrudeException(Throwable);
    method public void obtrudeValue(T);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterBoth(java.util.concurrent.CompletionStage<?>, Runnable);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?>, Runnable);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?>, Runnable, java.util.concurrent.Executor);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterEither(java.util.concurrent.CompletionStage<?>, Runnable);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?>, Runnable);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?>, Runnable, java.util.concurrent.Executor);
    method public static java.util.concurrent.CompletableFuture<java.lang.Void> runAsync(Runnable);
    method public static java.util.concurrent.CompletableFuture<java.lang.Void> runAsync(Runnable, java.util.concurrent.Executor);
    method public static <U> java.util.concurrent.CompletableFuture<U> supplyAsync(java.util.function.Supplier<U>);
    method public static <U> java.util.concurrent.CompletableFuture<U> supplyAsync(java.util.function.Supplier<U>, java.util.concurrent.Executor);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> thenAccept(java.util.function.Consumer<? super T>);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T>);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T>, java.util.concurrent.Executor);
    method public <U> java.util.concurrent.CompletableFuture<java.lang.Void> thenAcceptBoth(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiConsumer<? super T,? super U>);
    method public <U> java.util.concurrent.CompletableFuture<java.lang.Void> thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiConsumer<? super T,? super U>);
    method public <U> java.util.concurrent.CompletableFuture<java.lang.Void> thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiConsumer<? super T,? super U>, java.util.concurrent.Executor);
    method public <U> java.util.concurrent.CompletableFuture<U> thenApply(java.util.function.Function<? super T,? extends U>);
    method public <U> java.util.concurrent.CompletableFuture<U> thenApplyAsync(java.util.function.Function<? super T,? extends U>);
    method public <U> java.util.concurrent.CompletableFuture<U> thenApplyAsync(java.util.function.Function<? super T,? extends U>, java.util.concurrent.Executor);
    method public <U, V> java.util.concurrent.CompletableFuture<V> thenCombine(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiFunction<? super T,? super U,? extends V>);
    method public <U, V> java.util.concurrent.CompletableFuture<V> thenCombineAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiFunction<? super T,? super U,? extends V>);
    method public <U, V> java.util.concurrent.CompletableFuture<V> thenCombineAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiFunction<? super T,? super U,? extends V>, java.util.concurrent.Executor);
    method public <U> java.util.concurrent.CompletableFuture<U> thenCompose(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>>);
    method public <U> java.util.concurrent.CompletableFuture<U> thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>>);
    method public <U> java.util.concurrent.CompletableFuture<U> thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>>, java.util.concurrent.Executor);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> thenRun(Runnable);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> thenRunAsync(Runnable);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> thenRunAsync(Runnable, java.util.concurrent.Executor);
    method public java.util.concurrent.CompletableFuture<T> toCompletableFuture();
    method public java.util.concurrent.CompletableFuture<T> whenComplete(java.util.function.BiConsumer<? super T,? super java.lang.Throwable>);
    method public java.util.concurrent.CompletableFuture<T> whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable>);
    method public java.util.concurrent.CompletableFuture<T> whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable>, java.util.concurrent.Executor);
  }

  public static interface CompletableFuture.AsynchronousCompletionTask {
  }

  public class CompletionException extends java.lang.RuntimeException {
    ctor protected CompletionException();
    ctor protected CompletionException(String);
    ctor public CompletionException(String, Throwable);
    ctor public CompletionException(Throwable);
  }

  public interface CompletionService<V> {
    method public java.util.concurrent.Future<V> poll();
    method public java.util.concurrent.Future<V> poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public java.util.concurrent.Future<V> submit(java.util.concurrent.Callable<V>);
    method public java.util.concurrent.Future<V> submit(Runnable, V);
    method public java.util.concurrent.Future<V> take() throws java.lang.InterruptedException;
  }

  public interface CompletionStage<T> {
    method public java.util.concurrent.CompletionStage<java.lang.Void> acceptEither(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>);
    method public java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>);
    method public java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>, java.util.concurrent.Executor);
    method public <U> java.util.concurrent.CompletionStage<U> applyToEither(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T,U>);
    method public <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T,U>);
    method public <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T,U>, java.util.concurrent.Executor);
    method public java.util.concurrent.CompletionStage<T> exceptionally(java.util.function.Function<java.lang.Throwable,? extends T>);
    method public <U> java.util.concurrent.CompletionStage<U> handle(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U>);
    method public <U> java.util.concurrent.CompletionStage<U> handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U>);
    method public <U> java.util.concurrent.CompletionStage<U> handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U>, java.util.concurrent.Executor);
    method public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBoth(java.util.concurrent.CompletionStage<?>, Runnable);
    method public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?>, Runnable);
    method public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?>, Runnable, java.util.concurrent.Executor);
    method public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEither(java.util.concurrent.CompletionStage<?>, Runnable);
    method public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?>, Runnable);
    method public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?>, Runnable, java.util.concurrent.Executor);
    method public java.util.concurrent.CompletionStage<java.lang.Void> thenAccept(java.util.function.Consumer<? super T>);
    method public java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T>);
    method public java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T>, java.util.concurrent.Executor);
    method public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBoth(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiConsumer<? super T,? super U>);
    method public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiConsumer<? super T,? super U>);
    method public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiConsumer<? super T,? super U>, java.util.concurrent.Executor);
    method public <U> java.util.concurrent.CompletionStage<U> thenApply(java.util.function.Function<? super T,? extends U>);
    method public <U> java.util.concurrent.CompletionStage<U> thenApplyAsync(java.util.function.Function<? super T,? extends U>);
    method public <U> java.util.concurrent.CompletionStage<U> thenApplyAsync(java.util.function.Function<? super T,? extends U>, java.util.concurrent.Executor);
    method public <U, V> java.util.concurrent.CompletionStage<V> thenCombine(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiFunction<? super T,? super U,? extends V>);
    method public <U, V> java.util.concurrent.CompletionStage<V> thenCombineAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiFunction<? super T,? super U,? extends V>);
    method public <U, V> java.util.concurrent.CompletionStage<V> thenCombineAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiFunction<? super T,? super U,? extends V>, java.util.concurrent.Executor);
    method public <U> java.util.concurrent.CompletionStage<U> thenCompose(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>>);
    method public <U> java.util.concurrent.CompletionStage<U> thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>>);
    method public <U> java.util.concurrent.CompletionStage<U> thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>>, java.util.concurrent.Executor);
    method public java.util.concurrent.CompletionStage<java.lang.Void> thenRun(Runnable);
    method public java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync(Runnable);
    method public java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync(Runnable, java.util.concurrent.Executor);
    method public java.util.concurrent.CompletableFuture<T> toCompletableFuture();
    method public java.util.concurrent.CompletionStage<T> whenComplete(java.util.function.BiConsumer<? super T,? super java.lang.Throwable>);
    method public java.util.concurrent.CompletionStage<T> whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable>);
    method public java.util.concurrent.CompletionStage<T> whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable>, java.util.concurrent.Executor);
  }

  public class ConcurrentHashMap<K, V> extends java.util.AbstractMap<K,V> implements java.util.concurrent.ConcurrentMap<K,V> java.io.Serializable {
    ctor public ConcurrentHashMap();
    ctor public ConcurrentHashMap(int);
    ctor public ConcurrentHashMap(@NonNull java.util.Map<? extends K,? extends V>);
    ctor public ConcurrentHashMap(int, float);
    ctor public ConcurrentHashMap(int, float, int);
    method public boolean contains(@NonNull Object);
    method @NonNull public java.util.Enumeration<V> elements();
    method @NonNull public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
    method public void forEach(long, @NonNull java.util.function.BiConsumer<? super K,? super V>);
    method public <U> void forEach(long, @NonNull java.util.function.BiFunction<? super K,? super V,? extends U>, @NonNull java.util.function.Consumer<? super U>);
    method public void forEachEntry(long, @NonNull java.util.function.Consumer<? super java.util.Map.Entry<K,V>>);
    method public <U> void forEachEntry(long, @NonNull java.util.function.Function<java.util.Map.Entry<K,V>,? extends U>, @NonNull java.util.function.Consumer<? super U>);
    method public void forEachKey(long, @NonNull java.util.function.Consumer<? super K>);
    method public <U> void forEachKey(long, @NonNull java.util.function.Function<? super K,? extends U>, @NonNull java.util.function.Consumer<? super U>);
    method public void forEachValue(long, @NonNull java.util.function.Consumer<? super V>);
    method public <U> void forEachValue(long, @NonNull java.util.function.Function<? super V,? extends U>, @NonNull java.util.function.Consumer<? super U>);
    method @NonNull public java.util.concurrent.ConcurrentHashMap.KeySetView<K,V> keySet(@NonNull V);
    method @NonNull public java.util.Enumeration<K> keys();
    method public long mappingCount();
    method @NonNull public static <K> java.util.concurrent.ConcurrentHashMap.KeySetView<K,java.lang.Boolean> newKeySet();
    method @NonNull public static <K> java.util.concurrent.ConcurrentHashMap.KeySetView<K,java.lang.Boolean> newKeySet(int);
    method @Nullable public <U> U reduce(long, @NonNull java.util.function.BiFunction<? super K,? super V,? extends U>, @NonNull java.util.function.BiFunction<? super U,? super U,? extends U>);
    method @Nullable public java.util.Map.Entry<K,V> reduceEntries(long, @NonNull java.util.function.BiFunction<java.util.Map.Entry<K,V>,java.util.Map.Entry<K,V>,? extends java.util.Map.Entry<K,V>>);
    method @Nullable public <U> U reduceEntries(long, @NonNull java.util.function.Function<java.util.Map.Entry<K,V>,? extends U>, @NonNull java.util.function.BiFunction<? super U,? super U,? extends U>);
    method public double reduceEntriesToDouble(long, @NonNull java.util.function.ToDoubleFunction<java.util.Map.Entry<K,V>>, double, @NonNull java.util.function.DoubleBinaryOperator);
    method public int reduceEntriesToInt(long, @NonNull java.util.function.ToIntFunction<java.util.Map.Entry<K,V>>, int, @NonNull java.util.function.IntBinaryOperator);
    method public long reduceEntriesToLong(long, @NonNull java.util.function.ToLongFunction<java.util.Map.Entry<K,V>>, long, @NonNull java.util.function.LongBinaryOperator);
    method @Nullable public K reduceKeys(long, @NonNull java.util.function.BiFunction<? super K,? super K,? extends K>);
    method @Nullable public <U> U reduceKeys(long, @NonNull java.util.function.Function<? super K,? extends U>, @NonNull java.util.function.BiFunction<? super U,? super U,? extends U>);
    method public double reduceKeysToDouble(long, @NonNull java.util.function.ToDoubleFunction<? super K>, double, @NonNull java.util.function.DoubleBinaryOperator);
    method public int reduceKeysToInt(long, @NonNull java.util.function.ToIntFunction<? super K>, int, @NonNull java.util.function.IntBinaryOperator);
    method public long reduceKeysToLong(long, @NonNull java.util.function.ToLongFunction<? super K>, long, @NonNull java.util.function.LongBinaryOperator);
    method public double reduceToDouble(long, @NonNull java.util.function.ToDoubleBiFunction<? super K,? super V>, double, @NonNull java.util.function.DoubleBinaryOperator);
    method public int reduceToInt(long, @NonNull java.util.function.ToIntBiFunction<? super K,? super V>, int, @NonNull java.util.function.IntBinaryOperator);
    method public long reduceToLong(long, @NonNull java.util.function.ToLongBiFunction<? super K,? super V>, long, @NonNull java.util.function.LongBinaryOperator);
    method @Nullable public V reduceValues(long, @NonNull java.util.function.BiFunction<? super V,? super V,? extends V>);
    method @Nullable public <U> U reduceValues(long, @NonNull java.util.function.Function<? super V,? extends U>, @NonNull java.util.function.BiFunction<? super U,? super U,? extends U>);
    method public double reduceValuesToDouble(long, @NonNull java.util.function.ToDoubleFunction<? super V>, double, @NonNull java.util.function.DoubleBinaryOperator);
    method public int reduceValuesToInt(long, @NonNull java.util.function.ToIntFunction<? super V>, int, @NonNull java.util.function.IntBinaryOperator);
    method public long reduceValuesToLong(long, @NonNull java.util.function.ToLongFunction<? super V>, long, @NonNull java.util.function.LongBinaryOperator);
    method @Nullable public <U> U search(long, @NonNull java.util.function.BiFunction<? super K,? super V,? extends U>);
    method @Nullable public <U> U searchEntries(long, @NonNull java.util.function.Function<java.util.Map.Entry<K,V>,? extends U>);
    method @Nullable public <U> U searchKeys(long, @NonNull java.util.function.Function<? super K,? extends U>);
    method @Nullable public <U> U searchValues(long, @NonNull java.util.function.Function<? super V,? extends U>);
  }

  public static class ConcurrentHashMap.KeySetView<K, V> implements java.util.Collection<K> java.io.Serializable java.util.Set<K> {
    method public boolean add(@NonNull K);
    method public boolean addAll(@NonNull java.util.Collection<? extends K>);
    method public final void clear();
    method public boolean contains(@NonNull Object);
    method public final boolean containsAll(java.util.Collection<?>);
    method public void forEach(@NonNull java.util.function.Consumer<? super K>);
    method public java.util.concurrent.ConcurrentHashMap<K,V> getMap();
    method @Nullable public V getMappedValue();
    method public final boolean isEmpty();
    method @NonNull public java.util.Iterator<K> iterator();
    method public boolean remove(@NonNull Object);
    method public final boolean removeAll(java.util.Collection<?>);
    method public final boolean retainAll(java.util.Collection<?>);
    method public final int size();
    method @NonNull public java.util.Spliterator<K> spliterator();
    method public final Object[] toArray();
    method public final <T> T[] toArray(T[]);
    method public final String toString();
  }

  public class ConcurrentLinkedDeque<E> extends java.util.AbstractCollection<E> implements java.util.Deque<E> java.io.Serializable {
    ctor public ConcurrentLinkedDeque();
    ctor public ConcurrentLinkedDeque(java.util.Collection<? extends E>);
    method public void addFirst(E);
    method public void addLast(E);
    method public java.util.Iterator<E> descendingIterator();
    method public E element();
    method public E getFirst();
    method public E getLast();
    method public java.util.Iterator<E> iterator();
    method public boolean offer(E);
    method public boolean offerFirst(E);
    method public boolean offerLast(E);
    method public E peek();
    method public E peekFirst();
    method public E peekLast();
    method public E poll();
    method public E pollFirst();
    method public E pollLast();
    method public E pop();
    method public void push(E);
    method public E remove();
    method public E removeFirst();
    method public boolean removeFirstOccurrence(Object);
    method public E removeLast();
    method public boolean removeLastOccurrence(Object);
    method public int size();
  }

  public class ConcurrentLinkedQueue<E> extends java.util.AbstractQueue<E> implements java.util.Queue<E> java.io.Serializable {
    ctor public ConcurrentLinkedQueue();
    ctor public ConcurrentLinkedQueue(java.util.Collection<? extends E>);
    method public java.util.Iterator<E> iterator();
    method public boolean offer(E);
    method public E peek();
    method public E poll();
    method public int size();
  }

  public interface ConcurrentMap<K, V> extends java.util.Map<K,V> {
    method public V putIfAbsent(K, V);
    method public boolean remove(Object, Object);
    method public boolean replace(K, V, V);
    method public V replace(K, V);
  }

  public interface ConcurrentNavigableMap<K, V> extends java.util.concurrent.ConcurrentMap<K,V> java.util.NavigableMap<K,V> {
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> descendingMap();
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> headMap(K, boolean);
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> headMap(K);
    method public java.util.NavigableSet<K> keySet();
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> subMap(K, boolean, K, boolean);
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> subMap(K, K);
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> tailMap(K, boolean);
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> tailMap(K);
  }

  public class ConcurrentSkipListMap<K, V> extends java.util.AbstractMap<K,V> implements java.lang.Cloneable java.util.concurrent.ConcurrentNavigableMap<K,V> java.io.Serializable {
    ctor public ConcurrentSkipListMap();
    ctor public ConcurrentSkipListMap(java.util.Comparator<? super K>);
    ctor public ConcurrentSkipListMap(java.util.Map<? extends K,? extends V>);
    ctor public ConcurrentSkipListMap(java.util.SortedMap<K,? extends V>);
    method public java.util.Map.Entry<K,V> ceilingEntry(K);
    method public K ceilingKey(K);
    method public java.util.concurrent.ConcurrentSkipListMap<K,V> clone();
    method public java.util.Comparator<? super K> comparator();
    method public java.util.NavigableSet<K> descendingKeySet();
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> descendingMap();
    method public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
    method public java.util.Map.Entry<K,V> firstEntry();
    method public K firstKey();
    method public java.util.Map.Entry<K,V> floorEntry(K);
    method public K floorKey(K);
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> headMap(K, boolean);
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> headMap(K);
    method public java.util.Map.Entry<K,V> higherEntry(K);
    method public K higherKey(K);
    method public java.util.NavigableSet<K> keySet();
    method public java.util.Map.Entry<K,V> lastEntry();
    method public K lastKey();
    method public java.util.Map.Entry<K,V> lowerEntry(K);
    method public K lowerKey(K);
    method public java.util.NavigableSet<K> navigableKeySet();
    method public java.util.Map.Entry<K,V> pollFirstEntry();
    method public java.util.Map.Entry<K,V> pollLastEntry();
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> subMap(K, boolean, K, boolean);
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> subMap(K, K);
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> tailMap(K, boolean);
    method public java.util.concurrent.ConcurrentNavigableMap<K,V> tailMap(K);
  }

  public class ConcurrentSkipListSet<E> extends java.util.AbstractSet<E> implements java.lang.Cloneable java.util.NavigableSet<E> java.io.Serializable {
    ctor public ConcurrentSkipListSet();
    ctor public ConcurrentSkipListSet(java.util.Comparator<? super E>);
    ctor public ConcurrentSkipListSet(java.util.Collection<? extends E>);
    ctor public ConcurrentSkipListSet(java.util.SortedSet<E>);
    method public E ceiling(E);
    method public java.util.concurrent.ConcurrentSkipListSet<E> clone();
    method public java.util.Comparator<? super E> comparator();
    method public java.util.Iterator<E> descendingIterator();
    method public java.util.NavigableSet<E> descendingSet();
    method public E first();
    method public E floor(E);
    method public java.util.NavigableSet<E> headSet(E, boolean);
    method public java.util.NavigableSet<E> headSet(E);
    method public E higher(E);
    method public java.util.Iterator<E> iterator();
    method public E last();
    method public E lower(E);
    method public E pollFirst();
    method public E pollLast();
    method public int size();
    method public java.util.NavigableSet<E> subSet(E, boolean, E, boolean);
    method public java.util.NavigableSet<E> subSet(E, E);
    method public java.util.NavigableSet<E> tailSet(E, boolean);
    method public java.util.NavigableSet<E> tailSet(E);
  }

  public class CopyOnWriteArrayList<E> implements java.lang.Cloneable java.util.List<E> java.util.RandomAccess java.io.Serializable {
    ctor public CopyOnWriteArrayList();
    ctor public CopyOnWriteArrayList(@NonNull java.util.Collection<? extends E>);
    ctor public CopyOnWriteArrayList(@NonNull E[]);
    method public boolean add(E);
    method public void add(int, E);
    method public boolean addAll(@NonNull java.util.Collection<? extends E>);
    method public boolean addAll(int, @NonNull java.util.Collection<? extends E>);
    method public int addAllAbsent(@NonNull java.util.Collection<? extends E>);
    method public boolean addIfAbsent(E);
    method public void clear();
    method @NonNull public Object clone();
    method public boolean contains(@Nullable Object);
    method public boolean containsAll(@NonNull java.util.Collection<?>);
    method public void forEach(@NonNull java.util.function.Consumer<? super E>);
    method public E get(int);
    method public int indexOf(@Nullable Object);
    method public int indexOf(@Nullable E, int);
    method public boolean isEmpty();
    method @NonNull public java.util.Iterator<E> iterator();
    method public int lastIndexOf(@Nullable Object);
    method public int lastIndexOf(@Nullable E, int);
    method @NonNull public java.util.ListIterator<E> listIterator();
    method @NonNull public java.util.ListIterator<E> listIterator(int);
    method public E remove(int);
    method public boolean remove(@Nullable Object);
    method public boolean removeAll(@NonNull java.util.Collection<?>);
    method public boolean retainAll(@NonNull java.util.Collection<?>);
    method public E set(int, E);
    method public int size();
    method @NonNull public java.util.List<E> subList(int, int);
    method @NonNull public Object[] toArray();
    method @NonNull public <T> T[] toArray(@NonNull T[]);
  }

  public class CopyOnWriteArraySet<E> extends java.util.AbstractSet<E> implements java.io.Serializable {
    ctor public CopyOnWriteArraySet();
    ctor public CopyOnWriteArraySet(java.util.Collection<? extends E>);
    method public void forEach(java.util.function.Consumer<? super E>);
    method public java.util.Iterator<E> iterator();
    method public int size();
  }

  public class CountDownLatch {
    ctor public CountDownLatch(int);
    method public void await() throws java.lang.InterruptedException;
    method public boolean await(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public void countDown();
    method public long getCount();
  }

  public abstract class CountedCompleter<T> extends java.util.concurrent.ForkJoinTask<T> {
    ctor protected CountedCompleter(java.util.concurrent.CountedCompleter<?>, int);
    ctor protected CountedCompleter(java.util.concurrent.CountedCompleter<?>);
    ctor protected CountedCompleter();
    method public final void addToPendingCount(int);
    method public final boolean compareAndSetPendingCount(int, int);
    method public void complete(T);
    method public abstract void compute();
    method public final int decrementPendingCountUnlessZero();
    method protected final boolean exec();
    method public final java.util.concurrent.CountedCompleter<?> firstComplete();
    method public final java.util.concurrent.CountedCompleter<?> getCompleter();
    method public final int getPendingCount();
    method public T getRawResult();
    method public final java.util.concurrent.CountedCompleter<?> getRoot();
    method public final void helpComplete(int);
    method public final java.util.concurrent.CountedCompleter<?> nextComplete();
    method public void onCompletion(java.util.concurrent.CountedCompleter<?>);
    method public boolean onExceptionalCompletion(Throwable, java.util.concurrent.CountedCompleter<?>);
    method public final void propagateCompletion();
    method public final void quietlyCompleteRoot();
    method public final void setPendingCount(int);
    method protected void setRawResult(T);
    method public final void tryComplete();
  }

  public class CyclicBarrier {
    ctor public CyclicBarrier(int, Runnable);
    ctor public CyclicBarrier(int);
    method public int await() throws java.util.concurrent.BrokenBarrierException, java.lang.InterruptedException;
    method public int await(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.BrokenBarrierException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
    method public int getNumberWaiting();
    method public int getParties();
    method public boolean isBroken();
    method public void reset();
  }

  public class DelayQueue<E extends java.util.concurrent.Delayed> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingQueue<E> {
    ctor public DelayQueue();
    ctor public DelayQueue(java.util.Collection<? extends E>);
    method public int drainTo(java.util.Collection<? super E>);
    method public int drainTo(java.util.Collection<? super E>, int);
    method public java.util.Iterator<E> iterator();
    method public boolean offer(E);
    method public boolean offer(E, long, java.util.concurrent.TimeUnit);
    method public E peek();
    method public E poll();
    method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public void put(E);
    method public int remainingCapacity();
    method public int size();
    method public E take() throws java.lang.InterruptedException;
  }

  public interface Delayed extends java.lang.Comparable<java.util.concurrent.Delayed> {
    method public long getDelay(java.util.concurrent.TimeUnit);
  }

  public class Exchanger<V> {
    ctor public Exchanger();
    method public V exchange(V) throws java.lang.InterruptedException;
    method public V exchange(V, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException;
  }

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

  public interface Executor {
    method public void execute(Runnable);
  }

  public class ExecutorCompletionService<V> implements java.util.concurrent.CompletionService<V> {
    ctor public ExecutorCompletionService(java.util.concurrent.Executor);
    ctor public ExecutorCompletionService(java.util.concurrent.Executor, java.util.concurrent.BlockingQueue<java.util.concurrent.Future<V>>);
    method public java.util.concurrent.Future<V> poll();
    method public java.util.concurrent.Future<V> poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public java.util.concurrent.Future<V> submit(java.util.concurrent.Callable<V>);
    method public java.util.concurrent.Future<V> submit(Runnable, V);
    method public java.util.concurrent.Future<V> take() throws java.lang.InterruptedException;
  }

  public interface ExecutorService extends java.util.concurrent.Executor {
    method public boolean awaitTermination(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>>) throws java.lang.InterruptedException;
    method public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>>, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
    method public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>, long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
    method public boolean isShutdown();
    method public boolean isTerminated();
    method public void shutdown();
    method public java.util.List<java.lang.Runnable> shutdownNow();
    method public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T>);
    method public <T> java.util.concurrent.Future<T> submit(Runnable, T);
    method public java.util.concurrent.Future<?> submit(Runnable);
  }

  public class Executors {
    method public static <T> java.util.concurrent.Callable<T> callable(Runnable, T);
    method public static java.util.concurrent.Callable<java.lang.Object> callable(Runnable);
    method public static java.util.concurrent.Callable<java.lang.Object> callable(java.security.PrivilegedAction<?>);
    method public static java.util.concurrent.Callable<java.lang.Object> callable(java.security.PrivilegedExceptionAction<?>);
    method public static java.util.concurrent.ThreadFactory defaultThreadFactory();
    method public static java.util.concurrent.ExecutorService newCachedThreadPool();
    method public static java.util.concurrent.ExecutorService newCachedThreadPool(java.util.concurrent.ThreadFactory);
    method public static java.util.concurrent.ExecutorService newFixedThreadPool(int);
    method public static java.util.concurrent.ExecutorService newFixedThreadPool(int, java.util.concurrent.ThreadFactory);
    method public static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool(int);
    method public static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool(int, java.util.concurrent.ThreadFactory);
    method public static java.util.concurrent.ExecutorService newSingleThreadExecutor();
    method public static java.util.concurrent.ExecutorService newSingleThreadExecutor(java.util.concurrent.ThreadFactory);
    method public static java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor();
    method public static java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor(java.util.concurrent.ThreadFactory);
    method public static java.util.concurrent.ExecutorService newWorkStealingPool(int);
    method public static java.util.concurrent.ExecutorService newWorkStealingPool();
    method public static <T> java.util.concurrent.Callable<T> privilegedCallable(java.util.concurrent.Callable<T>);
    method public static <T> java.util.concurrent.Callable<T> privilegedCallableUsingCurrentClassLoader(java.util.concurrent.Callable<T>);
    method public static java.util.concurrent.ThreadFactory privilegedThreadFactory();
    method public static java.util.concurrent.ExecutorService unconfigurableExecutorService(java.util.concurrent.ExecutorService);
    method public static java.util.concurrent.ScheduledExecutorService unconfigurableScheduledExecutorService(java.util.concurrent.ScheduledExecutorService);
  }

  public class ForkJoinPool extends java.util.concurrent.AbstractExecutorService {
    ctor public ForkJoinPool();
    ctor public ForkJoinPool(int);
    ctor public ForkJoinPool(int, java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory, java.lang.Thread.UncaughtExceptionHandler, boolean);
    method public boolean awaitQuiescence(long, java.util.concurrent.TimeUnit);
    method public boolean awaitTermination(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public static java.util.concurrent.ForkJoinPool commonPool();
    method protected int drainTasksTo(java.util.Collection<? super java.util.concurrent.ForkJoinTask<?>>);
    method public void execute(java.util.concurrent.ForkJoinTask<?>);
    method public void execute(Runnable);
    method public int getActiveThreadCount();
    method public boolean getAsyncMode();
    method public static int getCommonPoolParallelism();
    method public java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory getFactory();
    method public int getParallelism();
    method public int getPoolSize();
    method public int getQueuedSubmissionCount();
    method public long getQueuedTaskCount();
    method public int getRunningThreadCount();
    method public long getStealCount();
    method public java.lang.Thread.UncaughtExceptionHandler getUncaughtExceptionHandler();
    method public boolean hasQueuedSubmissions();
    method public <T> T invoke(java.util.concurrent.ForkJoinTask<T>);
    method public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>>);
    method public boolean isQuiescent();
    method public boolean isShutdown();
    method public boolean isTerminated();
    method public boolean isTerminating();
    method public static void managedBlock(java.util.concurrent.ForkJoinPool.ManagedBlocker) throws java.lang.InterruptedException;
    method protected java.util.concurrent.ForkJoinTask<?> pollSubmission();
    method public void shutdown();
    method public java.util.List<java.lang.Runnable> shutdownNow();
    method public <T> java.util.concurrent.ForkJoinTask<T> submit(java.util.concurrent.ForkJoinTask<T>);
    method public <T> java.util.concurrent.ForkJoinTask<T> submit(java.util.concurrent.Callable<T>);
    method public <T> java.util.concurrent.ForkJoinTask<T> submit(Runnable, T);
    method public java.util.concurrent.ForkJoinTask<?> submit(Runnable);
    field public static final java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory defaultForkJoinWorkerThreadFactory;
  }

  public static interface ForkJoinPool.ForkJoinWorkerThreadFactory {
    method public java.util.concurrent.ForkJoinWorkerThread newThread(java.util.concurrent.ForkJoinPool);
  }

  public static interface ForkJoinPool.ManagedBlocker {
    method public boolean block() throws java.lang.InterruptedException;
    method public boolean isReleasable();
  }

  public abstract class ForkJoinTask<V> implements java.util.concurrent.Future<V> java.io.Serializable {
    ctor public ForkJoinTask();
    method public static java.util.concurrent.ForkJoinTask<?> adapt(Runnable);
    method public static <T> java.util.concurrent.ForkJoinTask<T> adapt(Runnable, T);
    method public static <T> java.util.concurrent.ForkJoinTask<T> adapt(java.util.concurrent.Callable<? extends T>);
    method public boolean cancel(boolean);
    method public final boolean compareAndSetForkJoinTaskTag(short, short);
    method public void complete(V);
    method public void completeExceptionally(Throwable);
    method protected abstract boolean exec();
    method public final java.util.concurrent.ForkJoinTask<V> fork();
    method public final V get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
    method public final V get(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
    method public final Throwable getException();
    method public final short getForkJoinTaskTag();
    method public static java.util.concurrent.ForkJoinPool getPool();
    method public static int getQueuedTaskCount();
    method public abstract V getRawResult();
    method public static int getSurplusQueuedTaskCount();
    method public static void helpQuiesce();
    method public static boolean inForkJoinPool();
    method public final V invoke();
    method public static void invokeAll(java.util.concurrent.ForkJoinTask<?>, java.util.concurrent.ForkJoinTask<?>);
    method public static void invokeAll(java.util.concurrent.ForkJoinTask<?>...);
    method public static <T extends java.util.concurrent.ForkJoinTask<?>> java.util.Collection<T> invokeAll(java.util.Collection<T>);
    method public final boolean isCancelled();
    method public final boolean isCompletedAbnormally();
    method public final boolean isCompletedNormally();
    method public final boolean isDone();
    method public final V join();
    method protected static java.util.concurrent.ForkJoinTask<?> peekNextLocalTask();
    method protected static java.util.concurrent.ForkJoinTask<?> pollNextLocalTask();
    method protected static java.util.concurrent.ForkJoinTask<?> pollTask();
    method public final void quietlyComplete();
    method public final void quietlyInvoke();
    method public final void quietlyJoin();
    method public void reinitialize();
    method public final short setForkJoinTaskTag(short);
    method protected abstract void setRawResult(V);
    method public boolean tryUnfork();
  }

  public class ForkJoinWorkerThread extends java.lang.Thread {
    ctor protected ForkJoinWorkerThread(java.util.concurrent.ForkJoinPool);
    method public java.util.concurrent.ForkJoinPool getPool();
    method public int getPoolIndex();
    method protected void onStart();
    method protected void onTermination(Throwable);
  }

  public interface Future<V> {
    method public boolean cancel(boolean);
    method public V get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
    method public V get(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
    method public boolean isCancelled();
    method public boolean isDone();
  }

  public class FutureTask<V> implements java.util.concurrent.RunnableFuture<V> {
    ctor public FutureTask(java.util.concurrent.Callable<V>);
    ctor public FutureTask(Runnable, V);
    method public boolean cancel(boolean);
    method protected void done();
    method public V get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
    method public V get(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
    method public boolean isCancelled();
    method public boolean isDone();
    method public void run();
    method protected boolean runAndReset();
    method protected void set(V);
    method protected void setException(Throwable);
  }

  public class LinkedBlockingDeque<E> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingDeque<E> java.io.Serializable {
    ctor public LinkedBlockingDeque();
    ctor public LinkedBlockingDeque(int);
    ctor public LinkedBlockingDeque(java.util.Collection<? extends E>);
    method public void addFirst(E);
    method public void addLast(E);
    method public java.util.Iterator<E> descendingIterator();
    method public int drainTo(java.util.Collection<? super E>);
    method public int drainTo(java.util.Collection<? super E>, int);
    method public E getFirst();
    method public E getLast();
    method public java.util.Iterator<E> iterator();
    method public boolean offer(E);
    method public boolean offer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public boolean offerFirst(E);
    method public boolean offerFirst(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public boolean offerLast(E);
    method public boolean offerLast(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public E peek();
    method public E peekFirst();
    method public E peekLast();
    method public E poll();
    method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public E pollFirst();
    method public E pollFirst(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public E pollLast();
    method public E pollLast(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public E pop();
    method public void push(E);
    method public void put(E) throws java.lang.InterruptedException;
    method public void putFirst(E) throws java.lang.InterruptedException;
    method public void putLast(E) throws java.lang.InterruptedException;
    method public int remainingCapacity();
    method public E removeFirst();
    method public boolean removeFirstOccurrence(Object);
    method public E removeLast();
    method public boolean removeLastOccurrence(Object);
    method public int size();
    method public E take() throws java.lang.InterruptedException;
    method public E takeFirst() throws java.lang.InterruptedException;
    method public E takeLast() throws java.lang.InterruptedException;
  }

  public class LinkedBlockingQueue<E> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingQueue<E> java.io.Serializable {
    ctor public LinkedBlockingQueue();
    ctor public LinkedBlockingQueue(int);
    ctor public LinkedBlockingQueue(java.util.Collection<? extends E>);
    method public int drainTo(java.util.Collection<? super E>);
    method public int drainTo(java.util.Collection<? super E>, int);
    method public java.util.Iterator<E> iterator();
    method public boolean offer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public boolean offer(E);
    method public E peek();
    method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public E poll();
    method public void put(E) throws java.lang.InterruptedException;
    method public int remainingCapacity();
    method public int size();
    method public E take() throws java.lang.InterruptedException;
  }

  public class LinkedTransferQueue<E> extends java.util.AbstractQueue<E> implements java.io.Serializable java.util.concurrent.TransferQueue<E> {
    ctor public LinkedTransferQueue();
    ctor public LinkedTransferQueue(java.util.Collection<? extends E>);
    method public int drainTo(java.util.Collection<? super E>);
    method public int drainTo(java.util.Collection<? super E>, int);
    method public int getWaitingConsumerCount();
    method public boolean hasWaitingConsumer();
    method public java.util.Iterator<E> iterator();
    method public boolean offer(E, long, java.util.concurrent.TimeUnit);
    method public boolean offer(E);
    method public E peek();
    method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public E poll();
    method public void put(E);
    method public int remainingCapacity();
    method public int size();
    method public E take() throws java.lang.InterruptedException;
    method public void transfer(E) throws java.lang.InterruptedException;
    method public boolean tryTransfer(E);
    method public boolean tryTransfer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
  }

  public class Phaser {
    ctor public Phaser();
    ctor public Phaser(int);
    ctor public Phaser(java.util.concurrent.Phaser);
    ctor public Phaser(java.util.concurrent.Phaser, int);
    method public int arrive();
    method public int arriveAndAwaitAdvance();
    method public int arriveAndDeregister();
    method public int awaitAdvance(int);
    method public int awaitAdvanceInterruptibly(int) throws java.lang.InterruptedException;
    method public int awaitAdvanceInterruptibly(int, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException;
    method public int bulkRegister(int);
    method public void forceTermination();
    method public int getArrivedParties();
    method public java.util.concurrent.Phaser getParent();
    method public final int getPhase();
    method public int getRegisteredParties();
    method public java.util.concurrent.Phaser getRoot();
    method public int getUnarrivedParties();
    method public boolean isTerminated();
    method protected boolean onAdvance(int, int);
    method public int register();
  }

  public class PriorityBlockingQueue<E> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingQueue<E> java.io.Serializable {
    ctor public PriorityBlockingQueue();
    ctor public PriorityBlockingQueue(int);
    ctor public PriorityBlockingQueue(int, java.util.Comparator<? super E>);
    ctor public PriorityBlockingQueue(java.util.Collection<? extends E>);
    method public java.util.Comparator<? super E> comparator();
    method public int drainTo(java.util.Collection<? super E>);
    method public int drainTo(java.util.Collection<? super E>, int);
    method public java.util.Iterator<E> iterator();
    method public boolean offer(E);
    method public boolean offer(E, long, java.util.concurrent.TimeUnit);
    method public E peek();
    method public E poll();
    method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public void put(E);
    method public int remainingCapacity();
    method public int size();
    method public E take() throws java.lang.InterruptedException;
  }

  public abstract class RecursiveAction extends java.util.concurrent.ForkJoinTask<java.lang.Void> {
    ctor public RecursiveAction();
    method protected abstract void compute();
    method protected final boolean exec();
    method public final Void getRawResult();
    method protected final void setRawResult(Void);
  }

  public abstract class RecursiveTask<V> extends java.util.concurrent.ForkJoinTask<V> {
    ctor public RecursiveTask();
    method protected abstract V compute();
    method protected final boolean exec();
    method public final V getRawResult();
    method protected final void setRawResult(V);
  }

  public class RejectedExecutionException extends java.lang.RuntimeException {
    ctor public RejectedExecutionException();
    ctor public RejectedExecutionException(String);
    ctor public RejectedExecutionException(String, Throwable);
    ctor public RejectedExecutionException(Throwable);
  }

  public interface RejectedExecutionHandler {
    method public void rejectedExecution(Runnable, java.util.concurrent.ThreadPoolExecutor);
  }

  public interface RunnableFuture<V> extends java.lang.Runnable java.util.concurrent.Future<V> {
  }

  public interface RunnableScheduledFuture<V> extends java.util.concurrent.RunnableFuture<V> java.util.concurrent.ScheduledFuture<V> {
    method public boolean isPeriodic();
  }

  public interface ScheduledExecutorService extends java.util.concurrent.ExecutorService {
    method public java.util.concurrent.ScheduledFuture<?> schedule(Runnable, long, java.util.concurrent.TimeUnit);
    method public <V> java.util.concurrent.ScheduledFuture<V> schedule(java.util.concurrent.Callable<V>, long, java.util.concurrent.TimeUnit);
    method public java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(Runnable, long, long, java.util.concurrent.TimeUnit);
    method public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(Runnable, long, long, java.util.concurrent.TimeUnit);
  }

  public interface ScheduledFuture<V> extends java.util.concurrent.Delayed java.util.concurrent.Future<V> {
  }

  public class ScheduledThreadPoolExecutor extends java.util.concurrent.ThreadPoolExecutor implements java.util.concurrent.ScheduledExecutorService {
    ctor public ScheduledThreadPoolExecutor(int);
    ctor public ScheduledThreadPoolExecutor(int, java.util.concurrent.ThreadFactory);
    ctor public ScheduledThreadPoolExecutor(int, java.util.concurrent.RejectedExecutionHandler);
    ctor public ScheduledThreadPoolExecutor(int, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler);
    method protected <V> java.util.concurrent.RunnableScheduledFuture<V> decorateTask(Runnable, java.util.concurrent.RunnableScheduledFuture<V>);
    method protected <V> java.util.concurrent.RunnableScheduledFuture<V> decorateTask(java.util.concurrent.Callable<V>, java.util.concurrent.RunnableScheduledFuture<V>);
    method public boolean getContinueExistingPeriodicTasksAfterShutdownPolicy();
    method public boolean getExecuteExistingDelayedTasksAfterShutdownPolicy();
    method public boolean getRemoveOnCancelPolicy();
    method public java.util.concurrent.ScheduledFuture<?> schedule(Runnable, long, java.util.concurrent.TimeUnit);
    method public <V> java.util.concurrent.ScheduledFuture<V> schedule(java.util.concurrent.Callable<V>, long, java.util.concurrent.TimeUnit);
    method public java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(Runnable, long, long, java.util.concurrent.TimeUnit);
    method public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(Runnable, long, long, java.util.concurrent.TimeUnit);
    method public void setContinueExistingPeriodicTasksAfterShutdownPolicy(boolean);
    method public void setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean);
    method public void setRemoveOnCancelPolicy(boolean);
  }

  public class Semaphore implements java.io.Serializable {
    ctor public Semaphore(int);
    ctor public Semaphore(int, boolean);
    method public void acquire() throws java.lang.InterruptedException;
    method public void acquire(int) throws java.lang.InterruptedException;
    method public void acquireUninterruptibly();
    method public void acquireUninterruptibly(int);
    method public int availablePermits();
    method public int drainPermits();
    method public final int getQueueLength();
    method protected java.util.Collection<java.lang.Thread> getQueuedThreads();
    method public final boolean hasQueuedThreads();
    method public boolean isFair();
    method protected void reducePermits(int);
    method public void release();
    method public void release(int);
    method public boolean tryAcquire();
    method public boolean tryAcquire(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public boolean tryAcquire(int);
    method public boolean tryAcquire(int, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
  }

  public class SynchronousQueue<E> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingQueue<E> java.io.Serializable {
    ctor public SynchronousQueue();
    ctor public SynchronousQueue(boolean);
    method public int drainTo(java.util.Collection<? super E>);
    method public int drainTo(java.util.Collection<? super E>, int);
    method public java.util.Iterator<E> iterator();
    method public boolean offer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public boolean offer(E);
    method public E peek();
    method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public E poll();
    method public void put(E) throws java.lang.InterruptedException;
    method public int remainingCapacity();
    method public int size();
    method public E take() throws java.lang.InterruptedException;
  }

  public interface ThreadFactory {
    method public Thread newThread(Runnable);
  }

  public class ThreadLocalRandom extends java.util.Random {
    method public static java.util.concurrent.ThreadLocalRandom current();
    method public double nextDouble(double);
    method public double nextDouble(double, double);
    method public int nextInt(int, int);
    method public long nextLong(long);
    method public long nextLong(long, long);
  }

  public class ThreadPoolExecutor extends java.util.concurrent.AbstractExecutorService {
    ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>);
    ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.ThreadFactory);
    ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.RejectedExecutionHandler);
    ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler);
    method protected void afterExecute(Runnable, Throwable);
    method public void allowCoreThreadTimeOut(boolean);
    method public boolean allowsCoreThreadTimeOut();
    method public boolean awaitTermination(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method protected void beforeExecute(Thread, Runnable);
    method public void execute(Runnable);
    method protected void finalize();
    method public int getActiveCount();
    method public long getCompletedTaskCount();
    method public int getCorePoolSize();
    method public long getKeepAliveTime(java.util.concurrent.TimeUnit);
    method public int getLargestPoolSize();
    method public int getMaximumPoolSize();
    method public int getPoolSize();
    method public java.util.concurrent.BlockingQueue<java.lang.Runnable> getQueue();
    method public java.util.concurrent.RejectedExecutionHandler getRejectedExecutionHandler();
    method public long getTaskCount();
    method public java.util.concurrent.ThreadFactory getThreadFactory();
    method public boolean isShutdown();
    method public boolean isTerminated();
    method public boolean isTerminating();
    method public int prestartAllCoreThreads();
    method public boolean prestartCoreThread();
    method public void purge();
    method public boolean remove(Runnable);
    method public void setCorePoolSize(int);
    method public void setKeepAliveTime(long, java.util.concurrent.TimeUnit);
    method public void setMaximumPoolSize(int);
    method public void setRejectedExecutionHandler(java.util.concurrent.RejectedExecutionHandler);
    method public void setThreadFactory(java.util.concurrent.ThreadFactory);
    method public void shutdown();
    method public java.util.List<java.lang.Runnable> shutdownNow();
    method protected void terminated();
  }

  public static class ThreadPoolExecutor.AbortPolicy implements java.util.concurrent.RejectedExecutionHandler {
    ctor public ThreadPoolExecutor.AbortPolicy();
    method public void rejectedExecution(Runnable, java.util.concurrent.ThreadPoolExecutor);
  }

  public static class ThreadPoolExecutor.CallerRunsPolicy implements java.util.concurrent.RejectedExecutionHandler {
    ctor public ThreadPoolExecutor.CallerRunsPolicy();
    method public void rejectedExecution(Runnable, java.util.concurrent.ThreadPoolExecutor);
  }

  public static class ThreadPoolExecutor.DiscardOldestPolicy implements java.util.concurrent.RejectedExecutionHandler {
    ctor public ThreadPoolExecutor.DiscardOldestPolicy();
    method public void rejectedExecution(Runnable, java.util.concurrent.ThreadPoolExecutor);
  }

  public static class ThreadPoolExecutor.DiscardPolicy implements java.util.concurrent.RejectedExecutionHandler {
    ctor public ThreadPoolExecutor.DiscardPolicy();
    method public void rejectedExecution(Runnable, java.util.concurrent.ThreadPoolExecutor);
  }

  public enum TimeUnit {
    method public long convert(long, java.util.concurrent.TimeUnit);
    method public void sleep(long) throws java.lang.InterruptedException;
    method public void timedJoin(Thread, long) throws java.lang.InterruptedException;
    method public void timedWait(Object, long) throws java.lang.InterruptedException;
    method public long toDays(long);
    method public long toHours(long);
    method public long toMicros(long);
    method public long toMillis(long);
    method public long toMinutes(long);
    method public long toNanos(long);
    method public long toSeconds(long);
    enum_constant public static final java.util.concurrent.TimeUnit DAYS;
    enum_constant public static final java.util.concurrent.TimeUnit HOURS;
    enum_constant public static final java.util.concurrent.TimeUnit MICROSECONDS;
    enum_constant public static final java.util.concurrent.TimeUnit MILLISECONDS;
    enum_constant public static final java.util.concurrent.TimeUnit MINUTES;
    enum_constant public static final java.util.concurrent.TimeUnit NANOSECONDS;
    enum_constant public static final java.util.concurrent.TimeUnit SECONDS;
  }

  public class TimeoutException extends java.lang.Exception {
    ctor public TimeoutException();
    ctor public TimeoutException(String);
  }

  public interface TransferQueue<E> extends java.util.concurrent.BlockingQueue<E> {
    method public int getWaitingConsumerCount();
    method public boolean hasWaitingConsumer();
    method public void transfer(E) throws java.lang.InterruptedException;
    method public boolean tryTransfer(E);
    method public boolean tryTransfer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
  }

}

package java.util.concurrent.atomic {

  public class AtomicBoolean implements java.io.Serializable {
    ctor public AtomicBoolean(boolean);
    ctor public AtomicBoolean();
    method public final boolean compareAndSet(boolean, boolean);
    method public final boolean get();
    method public final boolean getAndSet(boolean);
    method public final void lazySet(boolean);
    method public final void set(boolean);
    method public boolean weakCompareAndSet(boolean, boolean);
  }

  public class AtomicInteger extends java.lang.Number implements java.io.Serializable {
    ctor public AtomicInteger(int);
    ctor public AtomicInteger();
    method public final int accumulateAndGet(int, java.util.function.IntBinaryOperator);
    method public final int addAndGet(int);
    method public final boolean compareAndSet(int, int);
    method public final int decrementAndGet();
    method public double doubleValue();
    method public float floatValue();
    method public final int get();
    method public final int getAndAccumulate(int, java.util.function.IntBinaryOperator);
    method public final int getAndAdd(int);
    method public final int getAndDecrement();
    method public final int getAndIncrement();
    method public final int getAndSet(int);
    method public final int getAndUpdate(java.util.function.IntUnaryOperator);
    method public final int incrementAndGet();
    method public int intValue();
    method public final void lazySet(int);
    method public long longValue();
    method public final void set(int);
    method public final int updateAndGet(java.util.function.IntUnaryOperator);
    method public final boolean weakCompareAndSet(int, int);
  }

  public class AtomicIntegerArray implements java.io.Serializable {
    ctor public AtomicIntegerArray(int);
    ctor public AtomicIntegerArray(int[]);
    method public final int accumulateAndGet(int, int, java.util.function.IntBinaryOperator);
    method public final int addAndGet(int, int);
    method public final boolean compareAndSet(int, int, int);
    method public final int decrementAndGet(int);
    method public final int get(int);
    method public final int getAndAccumulate(int, int, java.util.function.IntBinaryOperator);
    method public final int getAndAdd(int, int);
    method public final int getAndDecrement(int);
    method public final int getAndIncrement(int);
    method public final int getAndSet(int, int);
    method public final int getAndUpdate(int, java.util.function.IntUnaryOperator);
    method public final int incrementAndGet(int);
    method public final void lazySet(int, int);
    method public final int length();
    method public final void set(int, int);
    method public final int updateAndGet(int, java.util.function.IntUnaryOperator);
    method public final boolean weakCompareAndSet(int, int, int);
  }

  public abstract class AtomicIntegerFieldUpdater<T> {
    ctor protected AtomicIntegerFieldUpdater();
    method public final int accumulateAndGet(T, int, java.util.function.IntBinaryOperator);
    method public int addAndGet(T, int);
    method public abstract boolean compareAndSet(T, int, int);
    method public int decrementAndGet(T);
    method public abstract int get(T);
    method public final int getAndAccumulate(T, int, java.util.function.IntBinaryOperator);
    method public int getAndAdd(T, int);
    method public int getAndDecrement(T);
    method public int getAndIncrement(T);
    method public int getAndSet(T, int);
    method public final int getAndUpdate(T, java.util.function.IntUnaryOperator);
    method public int incrementAndGet(T);
    method public abstract void lazySet(T, int);
    method public static <U> java.util.concurrent.atomic.AtomicIntegerFieldUpdater<U> newUpdater(Class<U>, String);
    method public abstract void set(T, int);
    method public final int updateAndGet(T, java.util.function.IntUnaryOperator);
    method public abstract boolean weakCompareAndSet(T, int, int);
  }

  public class AtomicLong extends java.lang.Number implements java.io.Serializable {
    ctor public AtomicLong(long);
    ctor public AtomicLong();
    method public final long accumulateAndGet(long, java.util.function.LongBinaryOperator);
    method public final long addAndGet(long);
    method public final boolean compareAndSet(long, long);
    method public final long decrementAndGet();
    method public double doubleValue();
    method public float floatValue();
    method public final long get();
    method public final long getAndAccumulate(long, java.util.function.LongBinaryOperator);
    method public final long getAndAdd(long);
    method public final long getAndDecrement();
    method public final long getAndIncrement();
    method public final long getAndSet(long);
    method public final long getAndUpdate(java.util.function.LongUnaryOperator);
    method public final long incrementAndGet();
    method public int intValue();
    method public final void lazySet(long);
    method public long longValue();
    method public final void set(long);
    method public final long updateAndGet(java.util.function.LongUnaryOperator);
    method public final boolean weakCompareAndSet(long, long);
  }

  public class AtomicLongArray implements java.io.Serializable {
    ctor public AtomicLongArray(int);
    ctor public AtomicLongArray(long[]);
    method public final long accumulateAndGet(int, long, java.util.function.LongBinaryOperator);
    method public long addAndGet(int, long);
    method public final boolean compareAndSet(int, long, long);
    method public final long decrementAndGet(int);
    method public final long get(int);
    method public final long getAndAccumulate(int, long, java.util.function.LongBinaryOperator);
    method public final long getAndAdd(int, long);
    method public final long getAndDecrement(int);
    method public final long getAndIncrement(int);
    method public final long getAndSet(int, long);
    method public final long getAndUpdate(int, java.util.function.LongUnaryOperator);
    method public final long incrementAndGet(int);
    method public final void lazySet(int, long);
    method public final int length();
    method public final void set(int, long);
    method public final long updateAndGet(int, java.util.function.LongUnaryOperator);
    method public final boolean weakCompareAndSet(int, long, long);
  }

  public abstract class AtomicLongFieldUpdater<T> {
    ctor protected AtomicLongFieldUpdater();
    method public final long accumulateAndGet(T, long, java.util.function.LongBinaryOperator);
    method public long addAndGet(T, long);
    method public abstract boolean compareAndSet(T, long, long);
    method public long decrementAndGet(T);
    method public abstract long get(T);
    method public final long getAndAccumulate(T, long, java.util.function.LongBinaryOperator);
    method public long getAndAdd(T, long);
    method public long getAndDecrement(T);
    method public long getAndIncrement(T);
    method public long getAndSet(T, long);
    method public final long getAndUpdate(T, java.util.function.LongUnaryOperator);
    method public long incrementAndGet(T);
    method public abstract void lazySet(T, long);
    method public static <U> java.util.concurrent.atomic.AtomicLongFieldUpdater<U> newUpdater(Class<U>, String);
    method public abstract void set(T, long);
    method public final long updateAndGet(T, java.util.function.LongUnaryOperator);
    method public abstract boolean weakCompareAndSet(T, long, long);
  }

  public class AtomicMarkableReference<V> {
    ctor public AtomicMarkableReference(V, boolean);
    method public boolean attemptMark(V, boolean);
    method public boolean compareAndSet(V, V, boolean, boolean);
    method public V get(boolean[]);
    method public V getReference();
    method public boolean isMarked();
    method public void set(V, boolean);
    method public boolean weakCompareAndSet(V, V, boolean, boolean);
  }

  public class AtomicReference<V> implements java.io.Serializable {
    ctor public AtomicReference(V);
    ctor public AtomicReference();
    method public final V accumulateAndGet(V, java.util.function.BinaryOperator<V>);
    method public final boolean compareAndSet(V, V);
    method public final V get();
    method public final V getAndAccumulate(V, java.util.function.BinaryOperator<V>);
    method public final V getAndSet(V);
    method public final V getAndUpdate(java.util.function.UnaryOperator<V>);
    method public final void lazySet(V);
    method public final void set(V);
    method public final V updateAndGet(java.util.function.UnaryOperator<V>);
    method public final boolean weakCompareAndSet(V, V);
  }

  public class AtomicReferenceArray<E> implements java.io.Serializable {
    ctor public AtomicReferenceArray(int);
    ctor public AtomicReferenceArray(E[]);
    method public final E accumulateAndGet(int, E, java.util.function.BinaryOperator<E>);
    method public final boolean compareAndSet(int, E, E);
    method public final E get(int);
    method public final E getAndAccumulate(int, E, java.util.function.BinaryOperator<E>);
    method public final E getAndSet(int, E);
    method public final E getAndUpdate(int, java.util.function.UnaryOperator<E>);
    method public final void lazySet(int, E);
    method public final int length();
    method public final void set(int, E);
    method public final E updateAndGet(int, java.util.function.UnaryOperator<E>);
    method public final boolean weakCompareAndSet(int, E, E);
  }

  public abstract class AtomicReferenceFieldUpdater<T, V> {
    ctor protected AtomicReferenceFieldUpdater();
    method public final V accumulateAndGet(T, V, java.util.function.BinaryOperator<V>);
    method public abstract boolean compareAndSet(T, V, V);
    method public abstract V get(T);
    method public final V getAndAccumulate(T, V, java.util.function.BinaryOperator<V>);
    method public V getAndSet(T, V);
    method public final V getAndUpdate(T, java.util.function.UnaryOperator<V>);
    method public abstract void lazySet(T, V);
    method public static <U, W> java.util.concurrent.atomic.AtomicReferenceFieldUpdater<U,W> newUpdater(Class<U>, Class<W>, String);
    method public abstract void set(T, V);
    method public final V updateAndGet(T, java.util.function.UnaryOperator<V>);
    method public abstract boolean weakCompareAndSet(T, V, V);
  }

  public class AtomicStampedReference<V> {
    ctor public AtomicStampedReference(V, int);
    method public boolean attemptStamp(V, int);
    method public boolean compareAndSet(V, V, int, int);
    method public V get(int[]);
    method public V getReference();
    method public int getStamp();
    method public void set(V, int);
    method public boolean weakCompareAndSet(V, V, int, int);
  }

  public class DoubleAccumulator extends java.lang.Number implements java.io.Serializable {
    ctor public DoubleAccumulator(java.util.function.DoubleBinaryOperator, double);
    method public void accumulate(double);
    method public double doubleValue();
    method public float floatValue();
    method public double get();
    method public double getThenReset();
    method public int intValue();
    method public long longValue();
    method public void reset();
  }

  public class DoubleAdder extends java.lang.Number implements java.io.Serializable {
    ctor public DoubleAdder();
    method public void add(double);
    method public double doubleValue();
    method public float floatValue();
    method public int intValue();
    method public long longValue();
    method public void reset();
    method public double sum();
    method public double sumThenReset();
  }

  public class LongAccumulator extends java.lang.Number implements java.io.Serializable {
    ctor public LongAccumulator(java.util.function.LongBinaryOperator, long);
    method public void accumulate(long);
    method public double doubleValue();
    method public float floatValue();
    method public long get();
    method public long getThenReset();
    method public int intValue();
    method public long longValue();
    method public void reset();
  }

  public class LongAdder extends java.lang.Number implements java.io.Serializable {
    ctor public LongAdder();
    method public void add(long);
    method public void decrement();
    method public double doubleValue();
    method public float floatValue();
    method public void increment();
    method public int intValue();
    method public long longValue();
    method public void reset();
    method public long sum();
    method public long sumThenReset();
  }

}

package java.util.concurrent.locks {

  public abstract class AbstractOwnableSynchronizer implements java.io.Serializable {
    ctor protected AbstractOwnableSynchronizer();
    method protected final Thread getExclusiveOwnerThread();
    method protected final void setExclusiveOwnerThread(Thread);
  }

  public abstract class AbstractQueuedLongSynchronizer extends java.util.concurrent.locks.AbstractOwnableSynchronizer implements java.io.Serializable {
    ctor protected AbstractQueuedLongSynchronizer();
    method public final void acquire(long);
    method public final void acquireInterruptibly(long) throws java.lang.InterruptedException;
    method public final void acquireShared(long);
    method public final void acquireSharedInterruptibly(long) throws java.lang.InterruptedException;
    method protected final boolean compareAndSetState(long, long);
    method public final java.util.Collection<java.lang.Thread> getExclusiveQueuedThreads();
    method public final Thread getFirstQueuedThread();
    method public final int getQueueLength();
    method public final java.util.Collection<java.lang.Thread> getQueuedThreads();
    method public final java.util.Collection<java.lang.Thread> getSharedQueuedThreads();
    method protected final long getState();
    method public final int getWaitQueueLength(java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject);
    method public final java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject);
    method public final boolean hasContended();
    method public final boolean hasQueuedPredecessors();
    method public final boolean hasQueuedThreads();
    method public final boolean hasWaiters(java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject);
    method protected boolean isHeldExclusively();
    method public final boolean isQueued(Thread);
    method public final boolean owns(java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject);
    method public final boolean release(long);
    method public final boolean releaseShared(long);
    method protected final void setState(long);
    method protected boolean tryAcquire(long);
    method public final boolean tryAcquireNanos(long, long) throws java.lang.InterruptedException;
    method protected long tryAcquireShared(long);
    method public final boolean tryAcquireSharedNanos(long, long) throws java.lang.InterruptedException;
    method protected boolean tryRelease(long);
    method protected boolean tryReleaseShared(long);
  }

  public class AbstractQueuedLongSynchronizer.ConditionObject implements java.util.concurrent.locks.Condition java.io.Serializable {
    ctor public AbstractQueuedLongSynchronizer.ConditionObject();
    method public final void await() throws java.lang.InterruptedException;
    method public final boolean await(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public final long awaitNanos(long) throws java.lang.InterruptedException;
    method public final void awaitUninterruptibly();
    method public final boolean awaitUntil(java.util.Date) throws java.lang.InterruptedException;
    method protected final int getWaitQueueLength();
    method protected final java.util.Collection<java.lang.Thread> getWaitingThreads();
    method protected final boolean hasWaiters();
    method public final void signal();
    method public final void signalAll();
  }

  public abstract class AbstractQueuedSynchronizer extends java.util.concurrent.locks.AbstractOwnableSynchronizer implements java.io.Serializable {
    ctor protected AbstractQueuedSynchronizer();
    method public final void acquire(int);
    method public final void acquireInterruptibly(int) throws java.lang.InterruptedException;
    method public final void acquireShared(int);
    method public final void acquireSharedInterruptibly(int) throws java.lang.InterruptedException;
    method protected final boolean compareAndSetState(int, int);
    method public final java.util.Collection<java.lang.Thread> getExclusiveQueuedThreads();
    method public final Thread getFirstQueuedThread();
    method public final int getQueueLength();
    method public final java.util.Collection<java.lang.Thread> getQueuedThreads();
    method public final java.util.Collection<java.lang.Thread> getSharedQueuedThreads();
    method protected final int getState();
    method public final int getWaitQueueLength(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject);
    method public final java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject);
    method public final boolean hasContended();
    method public final boolean hasQueuedPredecessors();
    method public final boolean hasQueuedThreads();
    method public final boolean hasWaiters(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject);
    method protected boolean isHeldExclusively();
    method public final boolean isQueued(Thread);
    method public final boolean owns(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject);
    method public final boolean release(int);
    method public final boolean releaseShared(int);
    method protected final void setState(int);
    method protected boolean tryAcquire(int);
    method public final boolean tryAcquireNanos(int, long) throws java.lang.InterruptedException;
    method protected int tryAcquireShared(int);
    method public final boolean tryAcquireSharedNanos(int, long) throws java.lang.InterruptedException;
    method protected boolean tryRelease(int);
    method protected boolean tryReleaseShared(int);
  }

  public class AbstractQueuedSynchronizer.ConditionObject implements java.util.concurrent.locks.Condition java.io.Serializable {
    ctor public AbstractQueuedSynchronizer.ConditionObject();
    method public final void await() throws java.lang.InterruptedException;
    method public final boolean await(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public final long awaitNanos(long) throws java.lang.InterruptedException;
    method public final void awaitUninterruptibly();
    method public final boolean awaitUntil(java.util.Date) throws java.lang.InterruptedException;
    method protected final int getWaitQueueLength();
    method protected final java.util.Collection<java.lang.Thread> getWaitingThreads();
    method protected final boolean hasWaiters();
    method public final void signal();
    method public final void signalAll();
  }

  public interface Condition {
    method public void await() throws java.lang.InterruptedException;
    method public boolean await(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public long awaitNanos(long) throws java.lang.InterruptedException;
    method public void awaitUninterruptibly();
    method public boolean awaitUntil(java.util.Date) throws java.lang.InterruptedException;
    method public void signal();
    method public void signalAll();
  }

  public interface Lock {
    method public void lock();
    method public void lockInterruptibly() throws java.lang.InterruptedException;
    method public java.util.concurrent.locks.Condition newCondition();
    method public boolean tryLock();
    method public boolean tryLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public void unlock();
  }

  public class LockSupport {
    method public static Object getBlocker(Thread);
    method public static void park(Object);
    method public static void park();
    method public static void parkNanos(Object, long);
    method public static void parkNanos(long);
    method public static void parkUntil(Object, long);
    method public static void parkUntil(long);
    method public static void unpark(Thread);
  }

  public interface ReadWriteLock {
    method public java.util.concurrent.locks.Lock readLock();
    method public java.util.concurrent.locks.Lock writeLock();
  }

  public class ReentrantLock implements java.util.concurrent.locks.Lock java.io.Serializable {
    ctor public ReentrantLock();
    ctor public ReentrantLock(boolean);
    method public int getHoldCount();
    method protected Thread getOwner();
    method public final int getQueueLength();
    method protected java.util.Collection<java.lang.Thread> getQueuedThreads();
    method public int getWaitQueueLength(java.util.concurrent.locks.Condition);
    method protected java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.Condition);
    method public final boolean hasQueuedThread(Thread);
    method public final boolean hasQueuedThreads();
    method public boolean hasWaiters(java.util.concurrent.locks.Condition);
    method public final boolean isFair();
    method public boolean isHeldByCurrentThread();
    method public boolean isLocked();
    method public void lock();
    method public void lockInterruptibly() throws java.lang.InterruptedException;
    method public java.util.concurrent.locks.Condition newCondition();
    method public boolean tryLock();
    method public boolean tryLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public void unlock();
  }

  public class ReentrantReadWriteLock implements java.util.concurrent.locks.ReadWriteLock java.io.Serializable {
    ctor public ReentrantReadWriteLock();
    ctor public ReentrantReadWriteLock(boolean);
    method protected Thread getOwner();
    method public final int getQueueLength();
    method protected java.util.Collection<java.lang.Thread> getQueuedReaderThreads();
    method protected java.util.Collection<java.lang.Thread> getQueuedThreads();
    method protected java.util.Collection<java.lang.Thread> getQueuedWriterThreads();
    method public int getReadHoldCount();
    method public int getReadLockCount();
    method public int getWaitQueueLength(java.util.concurrent.locks.Condition);
    method protected java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.Condition);
    method public int getWriteHoldCount();
    method public final boolean hasQueuedThread(Thread);
    method public final boolean hasQueuedThreads();
    method public boolean hasWaiters(java.util.concurrent.locks.Condition);
    method public final boolean isFair();
    method public boolean isWriteLocked();
    method public boolean isWriteLockedByCurrentThread();
    method public java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock readLock();
    method public java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock writeLock();
  }

  public static class ReentrantReadWriteLock.ReadLock implements java.util.concurrent.locks.Lock java.io.Serializable {
    ctor protected ReentrantReadWriteLock.ReadLock(java.util.concurrent.locks.ReentrantReadWriteLock);
    method public void lock();
    method public void lockInterruptibly() throws java.lang.InterruptedException;
    method public java.util.concurrent.locks.Condition newCondition();
    method public boolean tryLock();
    method public boolean tryLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public void unlock();
  }

  public static class ReentrantReadWriteLock.WriteLock implements java.util.concurrent.locks.Lock java.io.Serializable {
    ctor protected ReentrantReadWriteLock.WriteLock(java.util.concurrent.locks.ReentrantReadWriteLock);
    method public int getHoldCount();
    method public boolean isHeldByCurrentThread();
    method public void lock();
    method public void lockInterruptibly() throws java.lang.InterruptedException;
    method public java.util.concurrent.locks.Condition newCondition();
    method public boolean tryLock();
    method public boolean tryLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public void unlock();
  }

  public class StampedLock implements java.io.Serializable {
    ctor public StampedLock();
    method public java.util.concurrent.locks.Lock asReadLock();
    method public java.util.concurrent.locks.ReadWriteLock asReadWriteLock();
    method public java.util.concurrent.locks.Lock asWriteLock();
    method public int getReadLockCount();
    method public boolean isReadLocked();
    method public boolean isWriteLocked();
    method public long readLock();
    method public long readLockInterruptibly() throws java.lang.InterruptedException;
    method public long tryConvertToOptimisticRead(long);
    method public long tryConvertToReadLock(long);
    method public long tryConvertToWriteLock(long);
    method public long tryOptimisticRead();
    method public long tryReadLock();
    method public long tryReadLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public boolean tryUnlockRead();
    method public boolean tryUnlockWrite();
    method public long tryWriteLock();
    method public long tryWriteLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public void unlock(long);
    method public void unlockRead(long);
    method public void unlockWrite(long);
    method public boolean validate(long);
    method public long writeLock();
    method public long writeLockInterruptibly() throws java.lang.InterruptedException;
  }

}

package java.util.function {

  @java.lang.FunctionalInterface public interface BiConsumer<T, U> {
    method public void accept(T, U);
    method public default java.util.function.BiConsumer<T,U> andThen(java.util.function.BiConsumer<? super T,? super U>);
  }

  @java.lang.FunctionalInterface public interface BiFunction<T, U, R> {
    method public default <V> java.util.function.BiFunction<T,U,V> andThen(java.util.function.Function<? super R,? extends V>);
    method public R apply(T, U);
  }

  @java.lang.FunctionalInterface public interface BiPredicate<T, U> {
    method public default java.util.function.BiPredicate<T,U> and(java.util.function.BiPredicate<? super T,? super U>);
    method public default java.util.function.BiPredicate<T,U> negate();
    method public default java.util.function.BiPredicate<T,U> or(java.util.function.BiPredicate<? super T,? super U>);
    method public boolean test(T, U);
  }

  @java.lang.FunctionalInterface public interface BinaryOperator<T> extends java.util.function.BiFunction<T,T,T> {
    method public static <T> java.util.function.BinaryOperator<T> maxBy(java.util.Comparator<? super T>);
    method public static <T> java.util.function.BinaryOperator<T> minBy(java.util.Comparator<? super T>);
  }

  @java.lang.FunctionalInterface public interface BooleanSupplier {
    method public boolean getAsBoolean();
  }

  @java.lang.FunctionalInterface public interface Consumer<T> {
    method public void accept(T);
    method public default java.util.function.Consumer<T> andThen(java.util.function.Consumer<? super T>);
  }

  @java.lang.FunctionalInterface public interface DoubleBinaryOperator {
    method public double applyAsDouble(double, double);
  }

  @java.lang.FunctionalInterface public interface DoubleConsumer {
    method public void accept(double);
    method public default java.util.function.DoubleConsumer andThen(java.util.function.DoubleConsumer);
  }

  @java.lang.FunctionalInterface public interface DoubleFunction<R> {
    method public R apply(double);
  }

  @java.lang.FunctionalInterface public interface DoublePredicate {
    method public default java.util.function.DoublePredicate and(java.util.function.DoublePredicate);
    method public default java.util.function.DoublePredicate negate();
    method public default java.util.function.DoublePredicate or(java.util.function.DoublePredicate);
    method public boolean test(double);
  }

  @java.lang.FunctionalInterface public interface DoubleSupplier {
    method public double getAsDouble();
  }

  @java.lang.FunctionalInterface public interface DoubleToIntFunction {
    method public int applyAsInt(double);
  }

  @java.lang.FunctionalInterface public interface DoubleToLongFunction {
    method public long applyAsLong(double);
  }

  @java.lang.FunctionalInterface public interface DoubleUnaryOperator {
    method public default java.util.function.DoubleUnaryOperator andThen(java.util.function.DoubleUnaryOperator);
    method public double applyAsDouble(double);
    method public default java.util.function.DoubleUnaryOperator compose(java.util.function.DoubleUnaryOperator);
    method public static java.util.function.DoubleUnaryOperator identity();
  }

  @java.lang.FunctionalInterface public interface Function<T, R> {
    method public default <V> java.util.function.Function<T,V> andThen(java.util.function.Function<? super R,? extends V>);
    method public R apply(T);
    method public default <V> java.util.function.Function<V,R> compose(java.util.function.Function<? super V,? extends T>);
    method public static <T> java.util.function.Function<T,T> identity();
  }

  @java.lang.FunctionalInterface public interface IntBinaryOperator {
    method public int applyAsInt(int, int);
  }

  @java.lang.FunctionalInterface public interface IntConsumer {
    method public void accept(int);
    method public default java.util.function.IntConsumer andThen(java.util.function.IntConsumer);
  }

  @java.lang.FunctionalInterface public interface IntFunction<R> {
    method public R apply(int);
  }

  @java.lang.FunctionalInterface public interface IntPredicate {
    method public default java.util.function.IntPredicate and(java.util.function.IntPredicate);
    method public default java.util.function.IntPredicate negate();
    method public default java.util.function.IntPredicate or(java.util.function.IntPredicate);
    method public boolean test(int);
  }

  @java.lang.FunctionalInterface public interface IntSupplier {
    method public int getAsInt();
  }

  @java.lang.FunctionalInterface public interface IntToDoubleFunction {
    method public double applyAsDouble(int);
  }

  @java.lang.FunctionalInterface public interface IntToLongFunction {
    method public long applyAsLong(int);
  }

  @java.lang.FunctionalInterface public interface IntUnaryOperator {
    method public default java.util.function.IntUnaryOperator andThen(java.util.function.IntUnaryOperator);
    method public int applyAsInt(int);
    method public default java.util.function.IntUnaryOperator compose(java.util.function.IntUnaryOperator);
    method public static java.util.function.IntUnaryOperator identity();
  }

  @java.lang.FunctionalInterface public interface LongBinaryOperator {
    method public long applyAsLong(long, long);
  }

  @java.lang.FunctionalInterface public interface LongConsumer {
    method public void accept(long);
    method public default java.util.function.LongConsumer andThen(java.util.function.LongConsumer);
  }

  @java.lang.FunctionalInterface public interface LongFunction<R> {
    method public R apply(long);
  }

  @java.lang.FunctionalInterface public interface LongPredicate {
    method public default java.util.function.LongPredicate and(java.util.function.LongPredicate);
    method public default java.util.function.LongPredicate negate();
    method public default java.util.function.LongPredicate or(java.util.function.LongPredicate);
    method public boolean test(long);
  }

  @java.lang.FunctionalInterface public interface LongSupplier {
    method public long getAsLong();
  }

  @java.lang.FunctionalInterface public interface LongToDoubleFunction {
    method public double applyAsDouble(long);
  }

  @java.lang.FunctionalInterface public interface LongToIntFunction {
    method public int applyAsInt(long);
  }

  @java.lang.FunctionalInterface public interface LongUnaryOperator {
    method public default java.util.function.LongUnaryOperator andThen(java.util.function.LongUnaryOperator);
    method public long applyAsLong(long);
    method public default java.util.function.LongUnaryOperator compose(java.util.function.LongUnaryOperator);
    method public static java.util.function.LongUnaryOperator identity();
  }

  @java.lang.FunctionalInterface public interface ObjDoubleConsumer<T> {
    method public void accept(T, double);
  }

  @java.lang.FunctionalInterface public interface ObjIntConsumer<T> {
    method public void accept(T, int);
  }

  @java.lang.FunctionalInterface public interface ObjLongConsumer<T> {
    method public void accept(T, long);
  }

  @java.lang.FunctionalInterface public interface Predicate<T> {
    method public default java.util.function.Predicate<T> and(java.util.function.Predicate<? super T>);
    method public static <T> java.util.function.Predicate<T> isEqual(Object);
    method public default java.util.function.Predicate<T> negate();
    method public default java.util.function.Predicate<T> or(java.util.function.Predicate<? super T>);
    method public boolean test(T);
  }

  @java.lang.FunctionalInterface public interface Supplier<T> {
    method public T get();
  }

  @java.lang.FunctionalInterface public interface ToDoubleBiFunction<T, U> {
    method public double applyAsDouble(T, U);
  }

  @java.lang.FunctionalInterface public interface ToDoubleFunction<T> {
    method public double applyAsDouble(T);
  }

  @java.lang.FunctionalInterface public interface ToIntBiFunction<T, U> {
    method public int applyAsInt(T, U);
  }

  @java.lang.FunctionalInterface public interface ToIntFunction<T> {
    method public int applyAsInt(T);
  }

  @java.lang.FunctionalInterface public interface ToLongBiFunction<T, U> {
    method public long applyAsLong(T, U);
  }

  @java.lang.FunctionalInterface public interface ToLongFunction<T> {
    method public long applyAsLong(T);
  }

  @java.lang.FunctionalInterface public interface UnaryOperator<T> extends java.util.function.Function<T,T> {
    method public static <T> java.util.function.UnaryOperator<T> identity();
  }

}

package java.util.jar {

  public class Attributes implements java.lang.Cloneable java.util.Map<java.lang.Object,java.lang.Object> {
    ctor public Attributes();
    ctor public Attributes(int);
    ctor public Attributes(java.util.jar.Attributes);
    method public void clear();
    method public Object clone();
    method public boolean containsKey(Object);
    method public boolean containsValue(Object);
    method public java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> entrySet();
    method public Object get(Object);
    method public String getValue(String);
    method public String getValue(java.util.jar.Attributes.Name);
    method public boolean isEmpty();
    method public java.util.Set<java.lang.Object> keySet();
    method public Object put(Object, Object);
    method public void putAll(java.util.Map<?,?>);
    method public String putValue(String, String);
    method public Object remove(Object);
    method public int size();
    method public java.util.Collection<java.lang.Object> values();
    field protected java.util.Map<java.lang.Object,java.lang.Object> map;
  }

  public static class Attributes.Name {
    ctor public Attributes.Name(String);
    field public static final java.util.jar.Attributes.Name CLASS_PATH;
    field public static final java.util.jar.Attributes.Name CONTENT_TYPE;
    field @Deprecated public static final java.util.jar.Attributes.Name EXTENSION_INSTALLATION;
    field public static final java.util.jar.Attributes.Name EXTENSION_LIST;
    field public static final java.util.jar.Attributes.Name EXTENSION_NAME;
    field public static final java.util.jar.Attributes.Name IMPLEMENTATION_TITLE;
    field @Deprecated public static final java.util.jar.Attributes.Name IMPLEMENTATION_URL;
    field public static final java.util.jar.Attributes.Name IMPLEMENTATION_VENDOR;
    field @Deprecated public static final java.util.jar.Attributes.Name IMPLEMENTATION_VENDOR_ID;
    field public static final java.util.jar.Attributes.Name IMPLEMENTATION_VERSION;
    field public static final java.util.jar.Attributes.Name MAIN_CLASS;
    field public static final java.util.jar.Attributes.Name MANIFEST_VERSION;
    field public static final java.util.jar.Attributes.Name SEALED;
    field public static final java.util.jar.Attributes.Name SIGNATURE_VERSION;
    field public static final java.util.jar.Attributes.Name SPECIFICATION_TITLE;
    field public static final java.util.jar.Attributes.Name SPECIFICATION_VENDOR;
    field public static final java.util.jar.Attributes.Name SPECIFICATION_VERSION;
  }

  public class JarEntry extends java.util.zip.ZipEntry {
    ctor public JarEntry(String);
    ctor public JarEntry(java.util.zip.ZipEntry);
    ctor public JarEntry(java.util.jar.JarEntry);
    method public java.util.jar.Attributes getAttributes() throws java.io.IOException;
    method public java.security.cert.Certificate[] getCertificates();
    method public java.security.CodeSigner[] getCodeSigners();
    field public static final int CENATT = 36; // 0x24
    field public static final int CENATX = 38; // 0x26
    field public static final int CENCOM = 32; // 0x20
    field public static final int CENCRC = 16; // 0x10
    field public static final int CENDSK = 34; // 0x22
    field public static final int CENEXT = 30; // 0x1e
    field public static final int CENFLG = 8; // 0x8
    field public static final int CENHDR = 46; // 0x2e
    field public static final int CENHOW = 10; // 0xa
    field public static final int CENLEN = 24; // 0x18
    field public static final int CENNAM = 28; // 0x1c
    field public static final int CENOFF = 42; // 0x2a
    field public static final long CENSIG = 33639248L; // 0x2014b50L
    field public static final int CENSIZ = 20; // 0x14
    field public static final int CENTIM = 12; // 0xc
    field public static final int CENVEM = 4; // 0x4
    field public static final int CENVER = 6; // 0x6
    field public static final int ENDCOM = 20; // 0x14
    field public static final int ENDHDR = 22; // 0x16
    field public static final int ENDOFF = 16; // 0x10
    field public static final long ENDSIG = 101010256L; // 0x6054b50L
    field public static final int ENDSIZ = 12; // 0xc
    field public static final int ENDSUB = 8; // 0x8
    field public static final int ENDTOT = 10; // 0xa
    field public static final int EXTCRC = 4; // 0x4
    field public static final int EXTHDR = 16; // 0x10
    field public static final int EXTLEN = 12; // 0xc
    field public static final long EXTSIG = 134695760L; // 0x8074b50L
    field public static final int EXTSIZ = 8; // 0x8
    field public static final int LOCCRC = 14; // 0xe
    field public static final int LOCEXT = 28; // 0x1c
    field public static final int LOCFLG = 6; // 0x6
    field public static final int LOCHDR = 30; // 0x1e
    field public static final int LOCHOW = 8; // 0x8
    field public static final int LOCLEN = 22; // 0x16
    field public static final int LOCNAM = 26; // 0x1a
    field public static final long LOCSIG = 67324752L; // 0x4034b50L
    field public static final int LOCSIZ = 18; // 0x12
    field public static final int LOCTIM = 10; // 0xa
    field public static final int LOCVER = 4; // 0x4
  }

  public class JarException extends java.util.zip.ZipException {
    ctor public JarException();
    ctor public JarException(String);
  }

  public class JarFile extends java.util.zip.ZipFile {
    ctor public JarFile(String) throws java.io.IOException;
    ctor public JarFile(String, boolean) throws java.io.IOException;
    ctor public JarFile(java.io.File) throws java.io.IOException;
    ctor public JarFile(java.io.File, boolean) throws java.io.IOException;
    ctor public JarFile(java.io.File, boolean, int) throws java.io.IOException;
    method public java.util.Enumeration<java.util.jar.JarEntry> entries();
    method public java.util.jar.JarEntry getJarEntry(String);
    method public java.util.jar.Manifest getManifest() throws java.io.IOException;
    method public java.util.stream.Stream<java.util.jar.JarEntry> stream();
    field public static final int CENATT = 36; // 0x24
    field public static final int CENATX = 38; // 0x26
    field public static final int CENCOM = 32; // 0x20
    field public static final int CENCRC = 16; // 0x10
    field public static final int CENDSK = 34; // 0x22
    field public static final int CENEXT = 30; // 0x1e
    field public static final int CENFLG = 8; // 0x8
    field public static final int CENHDR = 46; // 0x2e
    field public static final int CENHOW = 10; // 0xa
    field public static final int CENLEN = 24; // 0x18
    field public static final int CENNAM = 28; // 0x1c
    field public static final int CENOFF = 42; // 0x2a
    field public static final long CENSIG = 33639248L; // 0x2014b50L
    field public static final int CENSIZ = 20; // 0x14
    field public static final int CENTIM = 12; // 0xc
    field public static final int CENVEM = 4; // 0x4
    field public static final int CENVER = 6; // 0x6
    field public static final int ENDCOM = 20; // 0x14
    field public static final int ENDHDR = 22; // 0x16
    field public static final int ENDOFF = 16; // 0x10
    field public static final long ENDSIG = 101010256L; // 0x6054b50L
    field public static final int ENDSIZ = 12; // 0xc
    field public static final int ENDSUB = 8; // 0x8
    field public static final int ENDTOT = 10; // 0xa
    field public static final int EXTCRC = 4; // 0x4
    field public static final int EXTHDR = 16; // 0x10
    field public static final int EXTLEN = 12; // 0xc
    field public static final long EXTSIG = 134695760L; // 0x8074b50L
    field public static final int EXTSIZ = 8; // 0x8
    field public static final int LOCCRC = 14; // 0xe
    field public static final int LOCEXT = 28; // 0x1c
    field public static final int LOCFLG = 6; // 0x6
    field public static final int LOCHDR = 30; // 0x1e
    field public static final int LOCHOW = 8; // 0x8
    field public static final int LOCLEN = 22; // 0x16
    field public static final int LOCNAM = 26; // 0x1a
    field public static final long LOCSIG = 67324752L; // 0x4034b50L
    field public static final int LOCSIZ = 18; // 0x12
    field public static final int LOCTIM = 10; // 0xa
    field public static final int LOCVER = 4; // 0x4
    field public static final String MANIFEST_NAME = "META-INF/MANIFEST.MF";
  }

  public class JarInputStream extends java.util.zip.ZipInputStream {
    ctor public JarInputStream(java.io.InputStream) throws java.io.IOException;
    ctor public JarInputStream(java.io.InputStream, boolean) throws java.io.IOException;
    method public java.util.jar.Manifest getManifest();
    method public java.util.jar.JarEntry getNextJarEntry() throws java.io.IOException;
    field public static final int CENATT = 36; // 0x24
    field public static final int CENATX = 38; // 0x26
    field public static final int CENCOM = 32; // 0x20
    field public static final int CENCRC = 16; // 0x10
    field public static final int CENDSK = 34; // 0x22
    field public static final int CENEXT = 30; // 0x1e
    field public static final int CENFLG = 8; // 0x8
    field public static final int CENHDR = 46; // 0x2e
    field public static final int CENHOW = 10; // 0xa
    field public static final int CENLEN = 24; // 0x18
    field public static final int CENNAM = 28; // 0x1c
    field public static final int CENOFF = 42; // 0x2a
    field public static final long CENSIG = 33639248L; // 0x2014b50L
    field public static final int CENSIZ = 20; // 0x14
    field public static final int CENTIM = 12; // 0xc
    field public static final int CENVEM = 4; // 0x4
    field public static final int CENVER = 6; // 0x6
    field public static final int ENDCOM = 20; // 0x14
    field public static final int ENDHDR = 22; // 0x16
    field public static final int ENDOFF = 16; // 0x10
    field public static final long ENDSIG = 101010256L; // 0x6054b50L
    field public static final int ENDSIZ = 12; // 0xc
    field public static final int ENDSUB = 8; // 0x8
    field public static final int ENDTOT = 10; // 0xa
    field public static final int EXTCRC = 4; // 0x4
    field public static final int EXTHDR = 16; // 0x10
    field public static final int EXTLEN = 12; // 0xc
    field public static final long EXTSIG = 134695760L; // 0x8074b50L
    field public static final int EXTSIZ = 8; // 0x8
    field public static final int LOCCRC = 14; // 0xe
    field public static final int LOCEXT = 28; // 0x1c
    field public static final int LOCFLG = 6; // 0x6
    field public static final int LOCHDR = 30; // 0x1e
    field public static final int LOCHOW = 8; // 0x8
    field public static final int LOCLEN = 22; // 0x16
    field public static final int LOCNAM = 26; // 0x1a
    field public static final long LOCSIG = 67324752L; // 0x4034b50L
    field public static final int LOCSIZ = 18; // 0x12
    field public static final int LOCTIM = 10; // 0xa
    field public static final int LOCVER = 4; // 0x4
  }

  public class JarOutputStream extends java.util.zip.ZipOutputStream {
    ctor public JarOutputStream(java.io.OutputStream, java.util.jar.Manifest) throws java.io.IOException;
    ctor public JarOutputStream(java.io.OutputStream) throws java.io.IOException;
    field public static final int CENATT = 36; // 0x24
    field public static final int CENATX = 38; // 0x26
    field public static final int CENCOM = 32; // 0x20
    field public static final int CENCRC = 16; // 0x10
    field public static final int CENDSK = 34; // 0x22
    field public static final int CENEXT = 30; // 0x1e
    field public static final int CENFLG = 8; // 0x8
    field public static final int CENHDR = 46; // 0x2e
    field public static final int CENHOW = 10; // 0xa
    field public static final int CENLEN = 24; // 0x18
    field public static final int CENNAM = 28; // 0x1c
    field public static final int CENOFF = 42; // 0x2a
    field public static final long CENSIG = 33639248L; // 0x2014b50L
    field public static final int CENSIZ = 20; // 0x14
    field public static final int CENTIM = 12; // 0xc
    field public static final int CENVEM = 4; // 0x4
    field public static final int CENVER = 6; // 0x6
    field public static final int ENDCOM = 20; // 0x14
    field public static final int ENDHDR = 22; // 0x16
    field public static final int ENDOFF = 16; // 0x10
    field public static final long ENDSIG = 101010256L; // 0x6054b50L
    field public static final int ENDSIZ = 12; // 0xc
    field public static final int ENDSUB = 8; // 0x8
    field public static final int ENDTOT = 10; // 0xa
    field public static final int EXTCRC = 4; // 0x4
    field public static final int EXTHDR = 16; // 0x10
    field public static final int EXTLEN = 12; // 0xc
    field public static final long EXTSIG = 134695760L; // 0x8074b50L
    field public static final int EXTSIZ = 8; // 0x8
    field public static final int LOCCRC = 14; // 0xe
    field public static final int LOCEXT = 28; // 0x1c
    field public static final int LOCFLG = 6; // 0x6
    field public static final int LOCHDR = 30; // 0x1e
    field public static final int LOCHOW = 8; // 0x8
    field public static final int LOCLEN = 22; // 0x16
    field public static final int LOCNAM = 26; // 0x1a
    field public static final long LOCSIG = 67324752L; // 0x4034b50L
    field public static final int LOCSIZ = 18; // 0x12
    field public static final int LOCTIM = 10; // 0xa
    field public static final int LOCVER = 4; // 0x4
  }

  public class Manifest implements java.lang.Cloneable {
    ctor public Manifest();
    ctor public Manifest(java.io.InputStream) throws java.io.IOException;
    ctor public Manifest(java.util.jar.Manifest);
    method public void clear();
    method public Object clone();
    method public java.util.jar.Attributes getAttributes(String);
    method public java.util.Map<java.lang.String,java.util.jar.Attributes> getEntries();
    method public java.util.jar.Attributes getMainAttributes();
    method public void read(java.io.InputStream) throws java.io.IOException;
    method public void write(java.io.OutputStream) throws java.io.IOException;
  }

  public abstract class Pack200 {
    method public static java.util.jar.Pack200.Packer newPacker();
    method public static java.util.jar.Pack200.Unpacker newUnpacker();
  }

  public static interface Pack200.Packer {
    method @Deprecated public default void addPropertyChangeListener(java.beans.PropertyChangeListener);
    method public void pack(java.util.jar.JarFile, java.io.OutputStream) throws java.io.IOException;
    method public void pack(java.util.jar.JarInputStream, java.io.OutputStream) throws java.io.IOException;
    method public java.util.SortedMap<java.lang.String,java.lang.String> properties();
    method @Deprecated public default void removePropertyChangeListener(java.beans.PropertyChangeListener);
    field public static final String CLASS_ATTRIBUTE_PFX = "pack.class.attribute.";
    field public static final String CODE_ATTRIBUTE_PFX = "pack.code.attribute.";
    field public static final String DEFLATE_HINT = "pack.deflate.hint";
    field public static final String EFFORT = "pack.effort";
    field public static final String ERROR = "error";
    field public static final String FALSE = "false";
    field public static final String FIELD_ATTRIBUTE_PFX = "pack.field.attribute.";
    field public static final String KEEP = "keep";
    field public static final String KEEP_FILE_ORDER = "pack.keep.file.order";
    field public static final String LATEST = "latest";
    field public static final String METHOD_ATTRIBUTE_PFX = "pack.method.attribute.";
    field public static final String MODIFICATION_TIME = "pack.modification.time";
    field public static final String PASS = "pass";
    field public static final String PASS_FILE_PFX = "pack.pass.file.";
    field public static final String PROGRESS = "pack.progress";
    field public static final String SEGMENT_LIMIT = "pack.segment.limit";
    field public static final String STRIP = "strip";
    field public static final String TRUE = "true";
    field public static final String UNKNOWN_ATTRIBUTE = "pack.unknown.attribute";
  }

  public static interface Pack200.Unpacker {
    method @Deprecated public default void addPropertyChangeListener(java.beans.PropertyChangeListener);
    method public java.util.SortedMap<java.lang.String,java.lang.String> properties();
    method @Deprecated public default void removePropertyChangeListener(java.beans.PropertyChangeListener);
    method public void unpack(java.io.InputStream, java.util.jar.JarOutputStream) throws java.io.IOException;
    method public void unpack(java.io.File, java.util.jar.JarOutputStream) throws java.io.IOException;
    field public static final String DEFLATE_HINT = "unpack.deflate.hint";
    field public static final String FALSE = "false";
    field public static final String KEEP = "keep";
    field public static final String PROGRESS = "unpack.progress";
    field public static final String TRUE = "true";
  }

}

package java.util.logging {

  public class ConsoleHandler extends java.util.logging.StreamHandler {
    ctor public ConsoleHandler();
    method public void close();
  }

  public class ErrorManager {
    ctor public ErrorManager();
    method public void error(String, Exception, int);
    field public static final int CLOSE_FAILURE = 3; // 0x3
    field public static final int FLUSH_FAILURE = 2; // 0x2
    field public static final int FORMAT_FAILURE = 5; // 0x5
    field public static final int GENERIC_FAILURE = 0; // 0x0
    field public static final int OPEN_FAILURE = 4; // 0x4
    field public static final int WRITE_FAILURE = 1; // 0x1
  }

  public class FileHandler extends java.util.logging.StreamHandler {
    ctor public FileHandler() throws java.io.IOException, java.lang.SecurityException;
    ctor public FileHandler(String) throws java.io.IOException, java.lang.SecurityException;
    ctor public FileHandler(String, boolean) throws java.io.IOException, java.lang.SecurityException;
    ctor public FileHandler(String, int, int) throws java.io.IOException, java.lang.SecurityException;
    ctor public FileHandler(String, int, int, boolean) throws java.io.IOException, java.lang.SecurityException;
  }

  @java.lang.FunctionalInterface public interface Filter {
    method public boolean isLoggable(java.util.logging.LogRecord);
  }

  public abstract class Formatter {
    ctor protected Formatter();
    method public abstract String format(java.util.logging.LogRecord);
    method public String formatMessage(java.util.logging.LogRecord);
    method public String getHead(java.util.logging.Handler);
    method public String getTail(java.util.logging.Handler);
  }

  public abstract class Handler {
    ctor protected Handler();
    method public abstract void close() throws java.lang.SecurityException;
    method public abstract void flush();
    method public String getEncoding();
    method public java.util.logging.ErrorManager getErrorManager();
    method public java.util.logging.Filter getFilter();
    method public java.util.logging.Formatter getFormatter();
    method public java.util.logging.Level getLevel();
    method public boolean isLoggable(java.util.logging.LogRecord);
    method public abstract void publish(java.util.logging.LogRecord);
    method protected void reportError(String, Exception, int);
    method public void setEncoding(String) throws java.lang.SecurityException, java.io.UnsupportedEncodingException;
    method public void setErrorManager(java.util.logging.ErrorManager);
    method public void setFilter(java.util.logging.Filter) throws java.lang.SecurityException;
    method public void setFormatter(java.util.logging.Formatter) throws java.lang.SecurityException;
    method public void setLevel(java.util.logging.Level) throws java.lang.SecurityException;
  }

  public class Level implements java.io.Serializable {
    ctor protected Level(@NonNull String, int);
    ctor protected Level(@NonNull String, int, @Nullable String);
    method @NonNull public String getLocalizedName();
    method @NonNull public String getName();
    method @Nullable public String getResourceBundleName();
    method public final int intValue();
    method @NonNull public static java.util.logging.Level parse(@NonNull String) throws java.lang.IllegalArgumentException;
    method @NonNull public final String toString();
    field @NonNull public static final java.util.logging.Level ALL;
    field @NonNull public static final java.util.logging.Level CONFIG;
    field @NonNull public static final java.util.logging.Level FINE;
    field @NonNull public static final java.util.logging.Level FINER;
    field @NonNull public static final java.util.logging.Level FINEST;
    field @NonNull public static final java.util.logging.Level INFO;
    field @NonNull public static final java.util.logging.Level OFF;
    field @NonNull public static final java.util.logging.Level SEVERE;
    field @NonNull public static final java.util.logging.Level WARNING;
  }

  public class LogManager {
    ctor protected LogManager();
    method public boolean addLogger(java.util.logging.Logger);
    method @Deprecated public void addPropertyChangeListener(java.beans.PropertyChangeListener) throws java.lang.SecurityException;
    method public void checkAccess() throws java.lang.SecurityException;
    method public static java.util.logging.LogManager getLogManager();
    method public java.util.logging.Logger getLogger(String);
    method public java.util.Enumeration<java.lang.String> getLoggerNames();
    method public static java.util.logging.LoggingMXBean getLoggingMXBean();
    method public String getProperty(String);
    method public void readConfiguration() throws java.io.IOException, java.lang.SecurityException;
    method public void readConfiguration(java.io.InputStream) throws java.io.IOException, java.lang.SecurityException;
    method @Deprecated public void removePropertyChangeListener(java.beans.PropertyChangeListener) throws java.lang.SecurityException;
    method public void reset() throws java.lang.SecurityException;
    field public static final String LOGGING_MXBEAN_NAME = "java.util.logging:type=Logging";
  }

  public class LogRecord implements java.io.Serializable {
    ctor public LogRecord(java.util.logging.Level, String);
    method public java.util.logging.Level getLevel();
    method public String getLoggerName();
    method public String getMessage();
    method public long getMillis();
    method public Object[] getParameters();
    method public java.util.ResourceBundle getResourceBundle();
    method public String getResourceBundleName();
    method public long getSequenceNumber();
    method public String getSourceClassName();
    method public String getSourceMethodName();
    method public int getThreadID();
    method public Throwable getThrown();
    method public void setLevel(java.util.logging.Level);
    method public void setLoggerName(String);
    method public void setMessage(String);
    method public void setMillis(long);
    method public void setParameters(Object[]);
    method public void setResourceBundle(java.util.ResourceBundle);
    method public void setResourceBundleName(String);
    method public void setSequenceNumber(long);
    method public void setSourceClassName(String);
    method public void setSourceMethodName(String);
    method public void setThreadID(int);
    method public void setThrown(Throwable);
  }

  public class Logger {
    ctor protected Logger(@Nullable String, @Nullable String);
    method public void addHandler(@NonNull java.util.logging.Handler) throws java.lang.SecurityException;
    method public void config(@Nullable String);
    method public void config(@NonNull java.util.function.Supplier<java.lang.String>);
    method public void entering(@Nullable String, @Nullable String);
    method public void entering(@Nullable String, @Nullable String, @Nullable Object);
    method public void entering(@Nullable String, @Nullable String, @Nullable Object[]);
    method public void exiting(@Nullable String, @Nullable String);
    method public void exiting(@Nullable String, @Nullable String, @Nullable Object);
    method public void fine(@Nullable String);
    method public void fine(@NonNull java.util.function.Supplier<java.lang.String>);
    method public void finer(@Nullable String);
    method public void finer(@NonNull java.util.function.Supplier<java.lang.String>);
    method public void finest(@Nullable String);
    method public void finest(@NonNull java.util.function.Supplier<java.lang.String>);
    method @NonNull public static java.util.logging.Logger getAnonymousLogger();
    method @NonNull public static java.util.logging.Logger getAnonymousLogger(@Nullable String);
    method @Nullable public java.util.logging.Filter getFilter();
    method @NonNull public static final java.util.logging.Logger getGlobal();
    method @NonNull public java.util.logging.Handler[] getHandlers();
    method @Nullable public java.util.logging.Level getLevel();
    method @NonNull public static java.util.logging.Logger getLogger(@NonNull String);
    method @NonNull public static java.util.logging.Logger getLogger(@NonNull String, @Nullable String);
    method @Nullable public String getName();
    method @Nullable public java.util.logging.Logger getParent();
    method @Nullable public java.util.ResourceBundle getResourceBundle();
    method @Nullable public String getResourceBundleName();
    method public boolean getUseParentHandlers();
    method public void info(@Nullable String);
    method public void info(@NonNull java.util.function.Supplier<java.lang.String>);
    method public boolean isLoggable(@NonNull java.util.logging.Level);
    method public void log(@NonNull java.util.logging.LogRecord);
    method public void log(@NonNull java.util.logging.Level, @Nullable String);
    method public void log(@NonNull java.util.logging.Level, @NonNull java.util.function.Supplier<java.lang.String>);
    method public void log(@NonNull java.util.logging.Level, @Nullable String, @Nullable Object);
    method public void log(@NonNull java.util.logging.Level, @Nullable String, @Nullable Object[]);
    method public void log(@NonNull java.util.logging.Level, @Nullable String, @Nullable Throwable);
    method public void log(@NonNull java.util.logging.Level, @Nullable Throwable, @NonNull java.util.function.Supplier<java.lang.String>);
    method public void logp(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String);
    method public void logp(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @NonNull java.util.function.Supplier<java.lang.String>);
    method public void logp(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable Object);
    method public void logp(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, Object[]);
    method public void logp(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable Throwable);
    method public void logp(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable Throwable, @NonNull java.util.function.Supplier<java.lang.String>);
    method @Deprecated public void logrb(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable String);
    method @Deprecated public void logrb(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable String, @Nullable Object);
    method @Deprecated public void logrb(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable String, @Nullable Object[]);
    method public void logrb(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable java.util.ResourceBundle, @Nullable String, @Nullable java.lang.Object...);
    method @Deprecated public void logrb(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable String, @Nullable Throwable);
    method public void logrb(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable java.util.ResourceBundle, @Nullable String, @Nullable Throwable);
    method public void removeHandler(@Nullable java.util.logging.Handler) throws java.lang.SecurityException;
    method public void setFilter(@Nullable java.util.logging.Filter) throws java.lang.SecurityException;
    method public void setLevel(@Nullable java.util.logging.Level) throws java.lang.SecurityException;
    method public void setParent(@NonNull java.util.logging.Logger);
    method public void setResourceBundle(@NonNull java.util.ResourceBundle);
    method public void setUseParentHandlers(boolean);
    method public void severe(@Nullable String);
    method public void severe(@NonNull java.util.function.Supplier<java.lang.String>);
    method public void throwing(@Nullable String, @Nullable String, @Nullable Throwable);
    method public void warning(@Nullable String);
    method public void warning(@NonNull java.util.function.Supplier<java.lang.String>);
    field @NonNull public static final String GLOBAL_LOGGER_NAME = "global";
    field @Deprecated @NonNull public static final java.util.logging.Logger global;
  }

  public interface LoggingMXBean {
    method public String getLoggerLevel(String);
    method public java.util.List<java.lang.String> getLoggerNames();
    method public String getParentLoggerName(String);
    method public void setLoggerLevel(String, String);
  }

  public final class LoggingPermission extends java.security.BasicPermission {
    ctor public LoggingPermission(String, String) throws java.lang.IllegalArgumentException;
  }

  public class MemoryHandler extends java.util.logging.Handler {
    ctor public MemoryHandler();
    ctor public MemoryHandler(java.util.logging.Handler, int, java.util.logging.Level);
    method public void close() throws java.lang.SecurityException;
    method public void flush();
    method public java.util.logging.Level getPushLevel();
    method public void publish(java.util.logging.LogRecord);
    method public void push();
    method public void setPushLevel(java.util.logging.Level) throws java.lang.SecurityException;
  }

  public class SimpleFormatter extends java.util.logging.Formatter {
    ctor public SimpleFormatter();
    method public String format(java.util.logging.LogRecord);
  }

  public class SocketHandler extends java.util.logging.StreamHandler {
    ctor public SocketHandler() throws java.io.IOException;
    ctor public SocketHandler(String, int) throws java.io.IOException;
  }

  public class StreamHandler extends java.util.logging.Handler {
    ctor public StreamHandler();
    ctor public StreamHandler(java.io.OutputStream, java.util.logging.Formatter);
    method public void close() throws java.lang.SecurityException;
    method public void flush();
    method public void publish(java.util.logging.LogRecord);
    method protected void setOutputStream(java.io.OutputStream) throws java.lang.SecurityException;
  }

  public class XMLFormatter extends java.util.logging.Formatter {
    ctor public XMLFormatter();
    method public String format(java.util.logging.LogRecord);
  }

}

package java.util.prefs {

  public abstract class AbstractPreferences extends java.util.prefs.Preferences {
    ctor protected AbstractPreferences(java.util.prefs.AbstractPreferences, String);
    method public String absolutePath();
    method public void addNodeChangeListener(java.util.prefs.NodeChangeListener);
    method public void addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener);
    method protected final java.util.prefs.AbstractPreferences[] cachedChildren();
    method protected abstract java.util.prefs.AbstractPreferences childSpi(String);
    method public String[] childrenNames() throws java.util.prefs.BackingStoreException;
    method protected abstract String[] childrenNamesSpi() throws java.util.prefs.BackingStoreException;
    method public void clear() throws java.util.prefs.BackingStoreException;
    method public void exportNode(java.io.OutputStream) throws java.util.prefs.BackingStoreException, java.io.IOException;
    method public void exportSubtree(java.io.OutputStream) throws java.util.prefs.BackingStoreException, java.io.IOException;
    method public void flush() throws java.util.prefs.BackingStoreException;
    method protected abstract void flushSpi() throws java.util.prefs.BackingStoreException;
    method public String get(String, String);
    method public boolean getBoolean(String, boolean);
    method public byte[] getByteArray(String, byte[]);
    method protected java.util.prefs.AbstractPreferences getChild(String) throws java.util.prefs.BackingStoreException;
    method public double getDouble(String, double);
    method public float getFloat(String, float);
    method public int getInt(String, int);
    method public long getLong(String, long);
    method protected abstract String getSpi(String);
    method protected boolean isRemoved();
    method public boolean isUserNode();
    method public String[] keys() throws java.util.prefs.BackingStoreException;
    method protected abstract String[] keysSpi() throws java.util.prefs.BackingStoreException;
    method public String name();
    method public java.util.prefs.Preferences node(String);
    method public boolean nodeExists(String) throws java.util.prefs.BackingStoreException;
    method public java.util.prefs.Preferences parent();
    method public void put(String, String);
    method public void putBoolean(String, boolean);
    method public void putByteArray(String, byte[]);
    method public void putDouble(String, double);
    method public void putFloat(String, float);
    method public void putInt(String, int);
    method public void putLong(String, long);
    method protected abstract void putSpi(String, String);
    method public void remove(String);
    method public void removeNode() throws java.util.prefs.BackingStoreException;
    method public void removeNodeChangeListener(java.util.prefs.NodeChangeListener);
    method protected abstract void removeNodeSpi() throws java.util.prefs.BackingStoreException;
    method public void removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener);
    method protected abstract void removeSpi(String);
    method public void sync() throws java.util.prefs.BackingStoreException;
    method protected abstract void syncSpi() throws java.util.prefs.BackingStoreException;
    field protected final Object lock;
    field protected boolean newNode;
  }

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

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

  public class NodeChangeEvent extends java.util.EventObject {
    ctor public NodeChangeEvent(java.util.prefs.Preferences, java.util.prefs.Preferences);
    method public java.util.prefs.Preferences getChild();
    method public java.util.prefs.Preferences getParent();
  }

  public interface NodeChangeListener extends java.util.EventListener {
    method public void childAdded(java.util.prefs.NodeChangeEvent);
    method public void childRemoved(java.util.prefs.NodeChangeEvent);
  }

  public class PreferenceChangeEvent extends java.util.EventObject {
    ctor public PreferenceChangeEvent(java.util.prefs.Preferences, String, String);
    method public String getKey();
    method public String getNewValue();
    method public java.util.prefs.Preferences getNode();
  }

  @java.lang.FunctionalInterface public interface PreferenceChangeListener extends java.util.EventListener {
    method public void preferenceChange(java.util.prefs.PreferenceChangeEvent);
  }

  public abstract class Preferences {
    ctor protected Preferences();
    method public abstract String absolutePath();
    method public abstract void addNodeChangeListener(java.util.prefs.NodeChangeListener);
    method public abstract void addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener);
    method public abstract String[] childrenNames() throws java.util.prefs.BackingStoreException;
    method public abstract void clear() throws java.util.prefs.BackingStoreException;
    method public abstract void exportNode(java.io.OutputStream) throws java.util.prefs.BackingStoreException, java.io.IOException;
    method public abstract void exportSubtree(java.io.OutputStream) throws java.util.prefs.BackingStoreException, java.io.IOException;
    method public abstract void flush() throws java.util.prefs.BackingStoreException;
    method public abstract String get(String, String);
    method public abstract boolean getBoolean(String, boolean);
    method public abstract byte[] getByteArray(String, byte[]);
    method public abstract double getDouble(String, double);
    method public abstract float getFloat(String, float);
    method public abstract int getInt(String, int);
    method public abstract long getLong(String, long);
    method public static void importPreferences(java.io.InputStream) throws java.io.IOException, java.util.prefs.InvalidPreferencesFormatException;
    method public abstract boolean isUserNode();
    method public abstract String[] keys() throws java.util.prefs.BackingStoreException;
    method public abstract String name();
    method public abstract java.util.prefs.Preferences node(String);
    method public abstract boolean nodeExists(String) throws java.util.prefs.BackingStoreException;
    method public abstract java.util.prefs.Preferences parent();
    method public abstract void put(String, String);
    method public abstract void putBoolean(String, boolean);
    method public abstract void putByteArray(String, byte[]);
    method public abstract void putDouble(String, double);
    method public abstract void putFloat(String, float);
    method public abstract void putInt(String, int);
    method public abstract void putLong(String, long);
    method public abstract void remove(String);
    method public abstract void removeNode() throws java.util.prefs.BackingStoreException;
    method public abstract void removeNodeChangeListener(java.util.prefs.NodeChangeListener);
    method public abstract void removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener);
    method public abstract void sync() throws java.util.prefs.BackingStoreException;
    method public static java.util.prefs.Preferences systemNodeForPackage(Class<?>);
    method public static java.util.prefs.Preferences systemRoot();
    method public abstract String toString();
    method public static java.util.prefs.Preferences userNodeForPackage(Class<?>);
    method public static java.util.prefs.Preferences userRoot();
    field public static final int MAX_KEY_LENGTH = 80; // 0x50
    field public static final int MAX_NAME_LENGTH = 80; // 0x50
    field public static final int MAX_VALUE_LENGTH = 8192; // 0x2000
  }

  public interface PreferencesFactory {
    method public java.util.prefs.Preferences systemRoot();
    method public java.util.prefs.Preferences userRoot();
  }

}

package java.util.regex {

  public interface MatchResult {
    method public int end();
    method public int end(int);
    method public String group();
    method public String group(int);
    method public int groupCount();
    method public int start();
    method public int start(int);
  }

  public final class Matcher implements java.util.regex.MatchResult {
    method @NonNull public java.util.regex.Matcher appendReplacement(@NonNull StringBuffer, @NonNull String);
    method @NonNull public StringBuffer appendTail(@NonNull StringBuffer);
    method public int end();
    method public int end(int);
    method public int end(@NonNull String);
    method public boolean find();
    method public boolean find(int);
    method @NonNull public String group();
    method @Nullable public String group(int);
    method @Nullable public String group(@NonNull String);
    method public int groupCount();
    method public boolean hasAnchoringBounds();
    method public boolean hasTransparentBounds();
    method public boolean hitEnd();
    method public boolean lookingAt();
    method public boolean matches();
    method @NonNull public java.util.regex.Pattern pattern();
    method @NonNull public static String quoteReplacement(@NonNull String);
    method @NonNull public java.util.regex.Matcher region(int, int);
    method public int regionEnd();
    method public int regionStart();
    method @NonNull public String replaceAll(@NonNull String);
    method @NonNull public String replaceFirst(@NonNull String);
    method public boolean requireEnd();
    method @NonNull public java.util.regex.Matcher reset();
    method @NonNull public java.util.regex.Matcher reset(@NonNull CharSequence);
    method public int start();
    method public int start(int);
    method public int start(@NonNull String);
    method @NonNull public java.util.regex.MatchResult toMatchResult();
    method @NonNull public java.util.regex.Matcher useAnchoringBounds(boolean);
    method @NonNull public java.util.regex.Matcher usePattern(@NonNull java.util.regex.Pattern);
    method @NonNull public java.util.regex.Matcher useTransparentBounds(boolean);
  }

  public final class Pattern implements java.io.Serializable {
    method @NonNull public java.util.function.Predicate<java.lang.String> asPredicate();
    method @NonNull public static java.util.regex.Pattern compile(@NonNull String);
    method @NonNull public static java.util.regex.Pattern compile(@NonNull String, int);
    method public int flags();
    method @NonNull public java.util.regex.Matcher matcher(@NonNull CharSequence);
    method public static boolean matches(@NonNull String, @NonNull CharSequence);
    method @NonNull public String pattern();
    method @NonNull public static String quote(@NonNull String);
    method @NonNull public String[] split(@NonNull CharSequence, int);
    method @NonNull public String[] split(@NonNull CharSequence);
    method @NonNull public java.util.stream.Stream<java.lang.String> splitAsStream(@NonNull CharSequence);
    field public static final int CANON_EQ = 128; // 0x80
    field public static final int CASE_INSENSITIVE = 2; // 0x2
    field public static final int COMMENTS = 4; // 0x4
    field public static final int DOTALL = 32; // 0x20
    field public static final int LITERAL = 16; // 0x10
    field public static final int MULTILINE = 8; // 0x8
    field public static final int UNICODE_CASE = 64; // 0x40
    field public static final int UNICODE_CHARACTER_CLASS = 256; // 0x100
    field public static final int UNIX_LINES = 1; // 0x1
  }

  public class PatternSyntaxException extends java.lang.IllegalArgumentException {
    ctor public PatternSyntaxException(String, String, int);
    method public String getDescription();
    method public int getIndex();
    method public String getPattern();
  }

}

package java.util.stream {

  public interface BaseStream<T, S extends java.util.stream.BaseStream<T, S>> extends java.lang.AutoCloseable {
    method public void close();
    method public boolean isParallel();
    method public java.util.Iterator<T> iterator();
    method public S onClose(Runnable);
    method public S parallel();
    method public S sequential();
    method public java.util.Spliterator<T> spliterator();
    method public S unordered();
  }

  public interface Collector<T, A, R> {
    method public java.util.function.BiConsumer<A,T> accumulator();
    method public java.util.Set<java.util.stream.Collector.Characteristics> characteristics();
    method public java.util.function.BinaryOperator<A> combiner();
    method public java.util.function.Function<A,R> finisher();
    method public static <T, R> java.util.stream.Collector<T,R,R> of(java.util.function.Supplier<R>, java.util.function.BiConsumer<R,T>, java.util.function.BinaryOperator<R>, java.util.stream.Collector.Characteristics...);
    method public static <T, A, R> java.util.stream.Collector<T,A,R> of(java.util.function.Supplier<A>, java.util.function.BiConsumer<A,T>, java.util.function.BinaryOperator<A>, java.util.function.Function<A,R>, java.util.stream.Collector.Characteristics...);
    method public java.util.function.Supplier<A> supplier();
  }

  public enum Collector.Characteristics {
    enum_constant public static final java.util.stream.Collector.Characteristics CONCURRENT;
    enum_constant public static final java.util.stream.Collector.Characteristics IDENTITY_FINISH;
    enum_constant public static final java.util.stream.Collector.Characteristics UNORDERED;
  }

  public final class Collectors {
    method public static <T> java.util.stream.Collector<T,?,java.lang.Double> averagingDouble(java.util.function.ToDoubleFunction<? super T>);
    method public static <T> java.util.stream.Collector<T,?,java.lang.Double> averagingInt(java.util.function.ToIntFunction<? super T>);
    method public static <T> java.util.stream.Collector<T,?,java.lang.Double> averagingLong(java.util.function.ToLongFunction<? super T>);
    method public static <T, A, R, RR> java.util.stream.Collector<T,A,RR> collectingAndThen(java.util.stream.Collector<T,A,R>, java.util.function.Function<R,RR>);
    method public static <T> java.util.stream.Collector<T,?,java.lang.Long> counting();
    method public static <T, K> java.util.stream.Collector<T,?,java.util.Map<K,java.util.List<T>>> groupingBy(java.util.function.Function<? super T,? extends K>);
    method public static <T, K, A, D> java.util.stream.Collector<T,?,java.util.Map<K,D>> groupingBy(java.util.function.Function<? super T,? extends K>, java.util.stream.Collector<? super T,A,D>);
    method public static <T, K, D, A, M extends java.util.Map<K, D>> java.util.stream.Collector<T,?,M> groupingBy(java.util.function.Function<? super T,? extends K>, java.util.function.Supplier<M>, java.util.stream.Collector<? super T,A,D>);
    method public static <T, K> java.util.stream.Collector<T,?,java.util.concurrent.ConcurrentMap<K,java.util.List<T>>> groupingByConcurrent(java.util.function.Function<? super T,? extends K>);
    method public static <T, K, A, D> java.util.stream.Collector<T,?,java.util.concurrent.ConcurrentMap<K,D>> groupingByConcurrent(java.util.function.Function<? super T,? extends K>, java.util.stream.Collector<? super T,A,D>);
    method public static <T, K, A, D, M extends java.util.concurrent.ConcurrentMap<K, D>> java.util.stream.Collector<T,?,M> groupingByConcurrent(java.util.function.Function<? super T,? extends K>, java.util.function.Supplier<M>, java.util.stream.Collector<? super T,A,D>);
    method public static java.util.stream.Collector<java.lang.CharSequence,?,java.lang.String> joining();
    method public static java.util.stream.Collector<java.lang.CharSequence,?,java.lang.String> joining(CharSequence);
    method public static java.util.stream.Collector<java.lang.CharSequence,?,java.lang.String> joining(CharSequence, CharSequence, CharSequence);
    method public static <T, U, A, R> java.util.stream.Collector<T,?,R> mapping(java.util.function.Function<? super T,? extends U>, java.util.stream.Collector<? super U,A,R>);
    method public static <T> java.util.stream.Collector<T,?,java.util.Optional<T>> maxBy(java.util.Comparator<? super T>);
    method public static <T> java.util.stream.Collector<T,?,java.util.Optional<T>> minBy(java.util.Comparator<? super T>);
    method public static <T> java.util.stream.Collector<T,?,java.util.Map<java.lang.Boolean,java.util.List<T>>> partitioningBy(java.util.function.Predicate<? super T>);
    method public static <T, D, A> java.util.stream.Collector<T,?,java.util.Map<java.lang.Boolean,D>> partitioningBy(java.util.function.Predicate<? super T>, java.util.stream.Collector<? super T,A,D>);
    method public static <T> java.util.stream.Collector<T,?,T> reducing(T, java.util.function.BinaryOperator<T>);
    method public static <T> java.util.stream.Collector<T,?,java.util.Optional<T>> reducing(java.util.function.BinaryOperator<T>);
    method public static <T, U> java.util.stream.Collector<T,?,U> reducing(U, java.util.function.Function<? super T,? extends U>, java.util.function.BinaryOperator<U>);
    method public static <T> java.util.stream.Collector<T,?,java.util.DoubleSummaryStatistics> summarizingDouble(java.util.function.ToDoubleFunction<? super T>);
    method public static <T> java.util.stream.Collector<T,?,java.util.IntSummaryStatistics> summarizingInt(java.util.function.ToIntFunction<? super T>);
    method public static <T> java.util.stream.Collector<T,?,java.util.LongSummaryStatistics> summarizingLong(java.util.function.ToLongFunction<? super T>);
    method public static <T> java.util.stream.Collector<T,?,java.lang.Double> summingDouble(java.util.function.ToDoubleFunction<? super T>);
    method public static <T> java.util.stream.Collector<T,?,java.lang.Integer> summingInt(java.util.function.ToIntFunction<? super T>);
    method public static <T> java.util.stream.Collector<T,?,java.lang.Long> summingLong(java.util.function.ToLongFunction<? super T>);
    method public static <T, C extends java.util.Collection<T>> java.util.stream.Collector<T,?,C> toCollection(java.util.function.Supplier<C>);
    method public static <T, K, U> java.util.stream.Collector<T,?,java.util.concurrent.ConcurrentMap<K,U>> toConcurrentMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>);
    method public static <T, K, U> java.util.stream.Collector<T,?,java.util.concurrent.ConcurrentMap<K,U>> toConcurrentMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>, java.util.function.BinaryOperator<U>);
    method public static <T, K, U, M extends java.util.concurrent.ConcurrentMap<K, U>> java.util.stream.Collector<T,?,M> toConcurrentMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>, java.util.function.BinaryOperator<U>, java.util.function.Supplier<M>);
    method public static <T> java.util.stream.Collector<T,?,java.util.List<T>> toList();
    method public static <T, K, U> java.util.stream.Collector<T,?,java.util.Map<K,U>> toMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>);
    method public static <T, K, U> java.util.stream.Collector<T,?,java.util.Map<K,U>> toMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>, java.util.function.BinaryOperator<U>);
    method public static <T, K, U, M extends java.util.Map<K, U>> java.util.stream.Collector<T,?,M> toMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>, java.util.function.BinaryOperator<U>, java.util.function.Supplier<M>);
    method public static <T> java.util.stream.Collector<T,?,java.util.Set<T>> toSet();
  }

  public interface DoubleStream extends java.util.stream.BaseStream<java.lang.Double,java.util.stream.DoubleStream> {
    method public boolean allMatch(java.util.function.DoublePredicate);
    method public boolean anyMatch(java.util.function.DoublePredicate);
    method public java.util.OptionalDouble average();
    method public java.util.stream.Stream<java.lang.Double> boxed();
    method public static java.util.stream.DoubleStream.Builder builder();
    method public <R> R collect(java.util.function.Supplier<R>, java.util.function.ObjDoubleConsumer<R>, java.util.function.BiConsumer<R,R>);
    method public static java.util.stream.DoubleStream concat(java.util.stream.DoubleStream, java.util.stream.DoubleStream);
    method public long count();
    method public java.util.stream.DoubleStream distinct();
    method public static java.util.stream.DoubleStream empty();
    method public java.util.stream.DoubleStream filter(java.util.function.DoublePredicate);
    method public java.util.OptionalDouble findAny();
    method public java.util.OptionalDouble findFirst();
    method public java.util.stream.DoubleStream flatMap(java.util.function.DoubleFunction<? extends java.util.stream.DoubleStream>);
    method public void forEach(java.util.function.DoubleConsumer);
    method public void forEachOrdered(java.util.function.DoubleConsumer);
    method public static java.util.stream.DoubleStream generate(java.util.function.DoubleSupplier);
    method public static java.util.stream.DoubleStream iterate(double, java.util.function.DoubleUnaryOperator);
    method public java.util.PrimitiveIterator.OfDouble iterator();
    method public java.util.stream.DoubleStream limit(long);
    method public java.util.stream.DoubleStream map(java.util.function.DoubleUnaryOperator);
    method public java.util.stream.IntStream mapToInt(java.util.function.DoubleToIntFunction);
    method public java.util.stream.LongStream mapToLong(java.util.function.DoubleToLongFunction);
    method public <U> java.util.stream.Stream<U> mapToObj(java.util.function.DoubleFunction<? extends U>);
    method public java.util.OptionalDouble max();
    method public java.util.OptionalDouble min();
    method public boolean noneMatch(java.util.function.DoublePredicate);
    method public static java.util.stream.DoubleStream of(double);
    method public static java.util.stream.DoubleStream of(double...);
    method public java.util.stream.DoubleStream parallel();
    method public java.util.stream.DoubleStream peek(java.util.function.DoubleConsumer);
    method public double reduce(double, java.util.function.DoubleBinaryOperator);
    method public java.util.OptionalDouble reduce(java.util.function.DoubleBinaryOperator);
    method public java.util.stream.DoubleStream sequential();
    method public java.util.stream.DoubleStream skip(long);
    method public java.util.stream.DoubleStream sorted();
    method public java.util.Spliterator.OfDouble spliterator();
    method public double sum();
    method public java.util.DoubleSummaryStatistics summaryStatistics();
    method public double[] toArray();
  }

  public static interface DoubleStream.Builder extends java.util.function.DoubleConsumer {
    method public default java.util.stream.DoubleStream.Builder add(double);
    method public java.util.stream.DoubleStream build();
  }

  public interface IntStream extends java.util.stream.BaseStream<java.lang.Integer,java.util.stream.IntStream> {
    method public boolean allMatch(java.util.function.IntPredicate);
    method public boolean anyMatch(java.util.function.IntPredicate);
    method public java.util.stream.DoubleStream asDoubleStream();
    method public java.util.stream.LongStream asLongStream();
    method public java.util.OptionalDouble average();
    method public java.util.stream.Stream<java.lang.Integer> boxed();
    method public static java.util.stream.IntStream.Builder builder();
    method public <R> R collect(java.util.function.Supplier<R>, java.util.function.ObjIntConsumer<R>, java.util.function.BiConsumer<R,R>);
    method public static java.util.stream.IntStream concat(java.util.stream.IntStream, java.util.stream.IntStream);
    method public long count();
    method public java.util.stream.IntStream distinct();
    method public static java.util.stream.IntStream empty();
    method public java.util.stream.IntStream filter(java.util.function.IntPredicate);
    method public java.util.OptionalInt findAny();
    method public java.util.OptionalInt findFirst();
    method public java.util.stream.IntStream flatMap(java.util.function.IntFunction<? extends java.util.stream.IntStream>);
    method public void forEach(java.util.function.IntConsumer);
    method public void forEachOrdered(java.util.function.IntConsumer);
    method public static java.util.stream.IntStream generate(java.util.function.IntSupplier);
    method public static java.util.stream.IntStream iterate(int, java.util.function.IntUnaryOperator);
    method public java.util.PrimitiveIterator.OfInt iterator();
    method public java.util.stream.IntStream limit(long);
    method public java.util.stream.IntStream map(java.util.function.IntUnaryOperator);
    method public java.util.stream.DoubleStream mapToDouble(java.util.function.IntToDoubleFunction);
    method public java.util.stream.LongStream mapToLong(java.util.function.IntToLongFunction);
    method public <U> java.util.stream.Stream<U> mapToObj(java.util.function.IntFunction<? extends U>);
    method public java.util.OptionalInt max();
    method public java.util.OptionalInt min();
    method public boolean noneMatch(java.util.function.IntPredicate);
    method public static java.util.stream.IntStream of(int);
    method public static java.util.stream.IntStream of(int...);
    method public java.util.stream.IntStream parallel();
    method public java.util.stream.IntStream peek(java.util.function.IntConsumer);
    method public static java.util.stream.IntStream range(int, int);
    method public static java.util.stream.IntStream rangeClosed(int, int);
    method public int reduce(int, java.util.function.IntBinaryOperator);
    method public java.util.OptionalInt reduce(java.util.function.IntBinaryOperator);
    method public java.util.stream.IntStream sequential();
    method public java.util.stream.IntStream skip(long);
    method public java.util.stream.IntStream sorted();
    method public java.util.Spliterator.OfInt spliterator();
    method public int sum();
    method public java.util.IntSummaryStatistics summaryStatistics();
    method public int[] toArray();
  }

  public static interface IntStream.Builder extends java.util.function.IntConsumer {
    method public default java.util.stream.IntStream.Builder add(int);
    method public java.util.stream.IntStream build();
  }

  public interface LongStream extends java.util.stream.BaseStream<java.lang.Long,java.util.stream.LongStream> {
    method public boolean allMatch(java.util.function.LongPredicate);
    method public boolean anyMatch(java.util.function.LongPredicate);
    method public java.util.stream.DoubleStream asDoubleStream();
    method public java.util.OptionalDouble average();
    method public java.util.stream.Stream<java.lang.Long> boxed();
    method public static java.util.stream.LongStream.Builder builder();
    method public <R> R collect(java.util.function.Supplier<R>, java.util.function.ObjLongConsumer<R>, java.util.function.BiConsumer<R,R>);
    method public static java.util.stream.LongStream concat(java.util.stream.LongStream, java.util.stream.LongStream);
    method public long count();
    method public java.util.stream.LongStream distinct();
    method public static java.util.stream.LongStream empty();
    method public java.util.stream.LongStream filter(java.util.function.LongPredicate);
    method public java.util.OptionalLong findAny();
    method public java.util.OptionalLong findFirst();
    method public java.util.stream.LongStream flatMap(java.util.function.LongFunction<? extends java.util.stream.LongStream>);
    method public void forEach(java.util.function.LongConsumer);
    method public void forEachOrdered(java.util.function.LongConsumer);
    method public static java.util.stream.LongStream generate(java.util.function.LongSupplier);
    method public static java.util.stream.LongStream iterate(long, java.util.function.LongUnaryOperator);
    method public java.util.PrimitiveIterator.OfLong iterator();
    method public java.util.stream.LongStream limit(long);
    method public java.util.stream.LongStream map(java.util.function.LongUnaryOperator);
    method public java.util.stream.DoubleStream mapToDouble(java.util.function.LongToDoubleFunction);
    method public java.util.stream.IntStream mapToInt(java.util.function.LongToIntFunction);
    method public <U> java.util.stream.Stream<U> mapToObj(java.util.function.LongFunction<? extends U>);
    method public java.util.OptionalLong max();
    method public java.util.OptionalLong min();
    method public boolean noneMatch(java.util.function.LongPredicate);
    method public static java.util.stream.LongStream of(long);
    method public static java.util.stream.LongStream of(long...);
    method public java.util.stream.LongStream parallel();
    method public java.util.stream.LongStream peek(java.util.function.LongConsumer);
    method public static java.util.stream.LongStream range(long, long);
    method public static java.util.stream.LongStream rangeClosed(long, long);
    method public long reduce(long, java.util.function.LongBinaryOperator);
    method public java.util.OptionalLong reduce(java.util.function.LongBinaryOperator);
    method public java.util.stream.LongStream sequential();
    method public java.util.stream.LongStream skip(long);
    method public java.util.stream.LongStream sorted();
    method public java.util.Spliterator.OfLong spliterator();
    method public long sum();
    method public java.util.LongSummaryStatistics summaryStatistics();
    method public long[] toArray();
  }

  public static interface LongStream.Builder extends java.util.function.LongConsumer {
    method public default java.util.stream.LongStream.Builder add(long);
    method public java.util.stream.LongStream build();
  }

  public interface Stream<T> extends java.util.stream.BaseStream<T,java.util.stream.Stream<T>> {
    method public boolean allMatch(java.util.function.Predicate<? super T>);
    method public boolean anyMatch(java.util.function.Predicate<? super T>);
    method public static <T> java.util.stream.Stream.Builder<T> builder();
    method public <R> R collect(java.util.function.Supplier<R>, java.util.function.BiConsumer<R,? super T>, java.util.function.BiConsumer<R,R>);
    method public <R, A> R collect(java.util.stream.Collector<? super T,A,R>);
    method public static <T> java.util.stream.Stream<T> concat(java.util.stream.Stream<? extends T>, java.util.stream.Stream<? extends T>);
    method public long count();
    method public java.util.stream.Stream<T> distinct();
    method public static <T> java.util.stream.Stream<T> empty();
    method public java.util.stream.Stream<T> filter(java.util.function.Predicate<? super T>);
    method public java.util.Optional<T> findAny();
    method public java.util.Optional<T> findFirst();
    method public <R> java.util.stream.Stream<R> flatMap(java.util.function.Function<? super T,? extends java.util.stream.Stream<? extends R>>);
    method public java.util.stream.DoubleStream flatMapToDouble(java.util.function.Function<? super T,? extends java.util.stream.DoubleStream>);
    method public java.util.stream.IntStream flatMapToInt(java.util.function.Function<? super T,? extends java.util.stream.IntStream>);
    method public java.util.stream.LongStream flatMapToLong(java.util.function.Function<? super T,? extends java.util.stream.LongStream>);
    method public void forEach(java.util.function.Consumer<? super T>);
    method public void forEachOrdered(java.util.function.Consumer<? super T>);
    method public static <T> java.util.stream.Stream<T> generate(java.util.function.Supplier<T>);
    method public static <T> java.util.stream.Stream<T> iterate(T, java.util.function.UnaryOperator<T>);
    method public java.util.stream.Stream<T> limit(long);
    method public <R> java.util.stream.Stream<R> map(java.util.function.Function<? super T,? extends R>);
    method public java.util.stream.DoubleStream mapToDouble(java.util.function.ToDoubleFunction<? super T>);
    method public java.util.stream.IntStream mapToInt(java.util.function.ToIntFunction<? super T>);
    method public java.util.stream.LongStream mapToLong(java.util.function.ToLongFunction<? super T>);
    method public java.util.Optional<T> max(java.util.Comparator<? super T>);
    method public java.util.Optional<T> min(java.util.Comparator<? super T>);
    method public boolean noneMatch(java.util.function.Predicate<? super T>);
    method public static <T> java.util.stream.Stream<T> of(T);
    method @java.lang.SafeVarargs public static <T> java.util.stream.Stream<T> of(T...);
    method public java.util.stream.Stream<T> peek(java.util.function.Consumer<? super T>);
    method public T reduce(T, java.util.function.BinaryOperator<T>);
    method public java.util.Optional<T> reduce(java.util.function.BinaryOperator<T>);
    method public <U> U reduce(U, java.util.function.BiFunction<U,? super T,U>, java.util.function.BinaryOperator<U>);
    method public java.util.stream.Stream<T> skip(long);
    method public java.util.stream.Stream<T> sorted();
    method public java.util.stream.Stream<T> sorted(java.util.Comparator<? super T>);
    method public Object[] toArray();
    method public <A> A[] toArray(java.util.function.IntFunction<A[]>);
  }

  public static interface Stream.Builder<T> extends java.util.function.Consumer<T> {
    method public default java.util.stream.Stream.Builder<T> add(T);
    method public java.util.stream.Stream<T> build();
  }

  public final class StreamSupport {
    method public static java.util.stream.DoubleStream doubleStream(java.util.Spliterator.OfDouble, boolean);
    method public static java.util.stream.DoubleStream doubleStream(java.util.function.Supplier<? extends java.util.Spliterator.OfDouble>, int, boolean);
    method public static java.util.stream.IntStream intStream(java.util.Spliterator.OfInt, boolean);
    method public static java.util.stream.IntStream intStream(java.util.function.Supplier<? extends java.util.Spliterator.OfInt>, int, boolean);
    method public static java.util.stream.LongStream longStream(java.util.Spliterator.OfLong, boolean);
    method public static java.util.stream.LongStream longStream(java.util.function.Supplier<? extends java.util.Spliterator.OfLong>, int, boolean);
    method public static <T> java.util.stream.Stream<T> stream(java.util.Spliterator<T>, boolean);
    method public static <T> java.util.stream.Stream<T> stream(java.util.function.Supplier<? extends java.util.Spliterator<T>>, int, boolean);
  }

}

package java.util.zip {

  public class Adler32 implements java.util.zip.Checksum {
    ctor public Adler32();
    method public long getValue();
    method public void reset();
    method public void update(int);
    method public void update(byte[], int, int);
    method public void update(byte[]);
    method public void update(java.nio.ByteBuffer);
  }

  public class CRC32 implements java.util.zip.Checksum {
    ctor public CRC32();
    method public long getValue();
    method public void reset();
    method public void update(int);
    method public void update(byte[], int, int);
    method public void update(byte[]);
    method public void update(java.nio.ByteBuffer);
  }

  public class CheckedInputStream extends java.io.FilterInputStream {
    ctor public CheckedInputStream(java.io.InputStream, java.util.zip.Checksum);
    method public java.util.zip.Checksum getChecksum();
  }

  public class CheckedOutputStream extends java.io.FilterOutputStream {
    ctor public CheckedOutputStream(java.io.OutputStream, java.util.zip.Checksum);
    method public java.util.zip.Checksum getChecksum();
  }

  public interface Checksum {
    method public long getValue();
    method public void reset();
    method public void update(int);
    method public void update(byte[], int, int);
  }

  public class DataFormatException extends java.lang.Exception {
    ctor public DataFormatException();
    ctor public DataFormatException(String);
  }

  public class Deflater {
    ctor public Deflater(int, boolean);
    ctor public Deflater(int);
    ctor public Deflater();
    method public int deflate(byte[], int, int);
    method public int deflate(byte[]);
    method public int deflate(byte[], int, int, int);
    method public void end();
    method protected void finalize();
    method public void finish();
    method public boolean finished();
    method public int getAdler();
    method public long getBytesRead();
    method public long getBytesWritten();
    method public int getTotalIn();
    method public int getTotalOut();
    method public boolean needsInput();
    method public void reset();
    method public void setDictionary(byte[], int, int);
    method public void setDictionary(byte[]);
    method public void setInput(byte[], int, int);
    method public void setInput(byte[]);
    method public void setLevel(int);
    method public void setStrategy(int);
    field public static final int BEST_COMPRESSION = 9; // 0x9
    field public static final int BEST_SPEED = 1; // 0x1
    field public static final int DEFAULT_COMPRESSION = -1; // 0xffffffff
    field public static final int DEFAULT_STRATEGY = 0; // 0x0
    field public static final int DEFLATED = 8; // 0x8
    field public static final int FILTERED = 1; // 0x1
    field public static final int FULL_FLUSH = 3; // 0x3
    field public static final int HUFFMAN_ONLY = 2; // 0x2
    field public static final int NO_COMPRESSION = 0; // 0x0
    field public static final int NO_FLUSH = 0; // 0x0
    field public static final int SYNC_FLUSH = 2; // 0x2
  }

  public class DeflaterInputStream extends java.io.FilterInputStream {
    ctor public DeflaterInputStream(java.io.InputStream);
    ctor public DeflaterInputStream(java.io.InputStream, java.util.zip.Deflater);
    ctor public DeflaterInputStream(java.io.InputStream, java.util.zip.Deflater, int);
    field protected final byte[] buf;
    field protected final java.util.zip.Deflater def;
  }

  public class DeflaterOutputStream extends java.io.FilterOutputStream {
    ctor public DeflaterOutputStream(java.io.OutputStream, java.util.zip.Deflater, int, boolean);
    ctor public DeflaterOutputStream(java.io.OutputStream, java.util.zip.Deflater, int);
    ctor public DeflaterOutputStream(java.io.OutputStream, java.util.zip.Deflater, boolean);
    ctor public DeflaterOutputStream(java.io.OutputStream, java.util.zip.Deflater);
    ctor public DeflaterOutputStream(java.io.OutputStream, boolean);
    ctor public DeflaterOutputStream(java.io.OutputStream);
    method protected void deflate() throws java.io.IOException;
    method public void finish() throws java.io.IOException;
    field protected byte[] buf;
    field protected java.util.zip.Deflater def;
  }

  public class GZIPInputStream extends java.util.zip.InflaterInputStream {
    ctor public GZIPInputStream(java.io.InputStream, int) throws java.io.IOException;
    ctor public GZIPInputStream(java.io.InputStream) throws java.io.IOException;
    field public static final int GZIP_MAGIC = 35615; // 0x8b1f
    field protected java.util.zip.CRC32 crc;
    field protected boolean eos;
  }

  public class GZIPOutputStream extends java.util.zip.DeflaterOutputStream {
    ctor public GZIPOutputStream(java.io.OutputStream, int) throws java.io.IOException;
    ctor public GZIPOutputStream(java.io.OutputStream, int, boolean) throws java.io.IOException;
    ctor public GZIPOutputStream(java.io.OutputStream) throws java.io.IOException;
    ctor public GZIPOutputStream(java.io.OutputStream, boolean) throws java.io.IOException;
    field protected java.util.zip.CRC32 crc;
  }

  public class Inflater {
    ctor public Inflater(boolean);
    ctor public Inflater();
    method public void end();
    method protected void finalize();
    method public boolean finished();
    method public int getAdler();
    method public long getBytesRead();
    method public long getBytesWritten();
    method public int getRemaining();
    method public int getTotalIn();
    method public int getTotalOut();
    method public int inflate(byte[], int, int) throws java.util.zip.DataFormatException;
    method public int inflate(byte[]) throws java.util.zip.DataFormatException;
    method public boolean needsDictionary();
    method public boolean needsInput();
    method public void reset();
    method public void setDictionary(byte[], int, int);
    method public void setDictionary(byte[]);
    method public void setInput(byte[], int, int);
    method public void setInput(byte[]);
  }

  public class InflaterInputStream extends java.io.FilterInputStream {
    ctor public InflaterInputStream(java.io.InputStream, java.util.zip.Inflater, int);
    ctor public InflaterInputStream(java.io.InputStream, java.util.zip.Inflater);
    ctor public InflaterInputStream(java.io.InputStream);
    method protected void fill() throws java.io.IOException;
    field protected byte[] buf;
    field @Deprecated protected boolean closed;
    field protected java.util.zip.Inflater inf;
    field protected int len;
  }

  public class InflaterOutputStream extends java.io.FilterOutputStream {
    ctor public InflaterOutputStream(java.io.OutputStream);
    ctor public InflaterOutputStream(java.io.OutputStream, java.util.zip.Inflater);
    ctor public InflaterOutputStream(java.io.OutputStream, java.util.zip.Inflater, int);
    method public void finish() throws java.io.IOException;
    field protected final byte[] buf;
    field protected final java.util.zip.Inflater inf;
  }

  public class ZipEntry implements java.lang.Cloneable {
    ctor public ZipEntry(String);
    ctor public ZipEntry(java.util.zip.ZipEntry);
    method public Object clone();
    method public String getComment();
    method public long getCompressedSize();
    method public long getCrc();
    method public java.nio.file.attribute.FileTime getCreationTime();
    method public byte[] getExtra();
    method public java.nio.file.attribute.FileTime getLastAccessTime();
    method public java.nio.file.attribute.FileTime getLastModifiedTime();
    method public int getMethod();
    method public String getName();
    method public long getSize();
    method public long getTime();
    method public boolean isDirectory();
    method public void setComment(String);
    method public void setCompressedSize(long);
    method public void setCrc(long);
    method public java.util.zip.ZipEntry setCreationTime(java.nio.file.attribute.FileTime);
    method public void setExtra(byte[]);
    method public java.util.zip.ZipEntry setLastAccessTime(java.nio.file.attribute.FileTime);
    method public java.util.zip.ZipEntry setLastModifiedTime(java.nio.file.attribute.FileTime);
    method public void setMethod(int);
    method public void setSize(long);
    method public void setTime(long);
    field public static final int CENATT = 36; // 0x24
    field public static final int CENATX = 38; // 0x26
    field public static final int CENCOM = 32; // 0x20
    field public static final int CENCRC = 16; // 0x10
    field public static final int CENDSK = 34; // 0x22
    field public static final int CENEXT = 30; // 0x1e
    field public static final int CENFLG = 8; // 0x8
    field public static final int CENHDR = 46; // 0x2e
    field public static final int CENHOW = 10; // 0xa
    field public static final int CENLEN = 24; // 0x18
    field public static final int CENNAM = 28; // 0x1c
    field public static final int CENOFF = 42; // 0x2a
    field public static final long CENSIG = 33639248L; // 0x2014b50L
    field public static final int CENSIZ = 20; // 0x14
    field public static final int CENTIM = 12; // 0xc
    field public static final int CENVEM = 4; // 0x4
    field public static final int CENVER = 6; // 0x6
    field public static final int DEFLATED = 8; // 0x8
    field public static final int ENDCOM = 20; // 0x14
    field public static final int ENDHDR = 22; // 0x16
    field public static final int ENDOFF = 16; // 0x10
    field public static final long ENDSIG = 101010256L; // 0x6054b50L
    field public static final int ENDSIZ = 12; // 0xc
    field public static final int ENDSUB = 8; // 0x8
    field public static final int ENDTOT = 10; // 0xa
    field public static final int EXTCRC = 4; // 0x4
    field public static final int EXTHDR = 16; // 0x10
    field public static final int EXTLEN = 12; // 0xc
    field public static final long EXTSIG = 134695760L; // 0x8074b50L
    field public static final int EXTSIZ = 8; // 0x8
    field public static final int LOCCRC = 14; // 0xe
    field public static final int LOCEXT = 28; // 0x1c
    field public static final int LOCFLG = 6; // 0x6
    field public static final int LOCHDR = 30; // 0x1e
    field public static final int LOCHOW = 8; // 0x8
    field public static final int LOCLEN = 22; // 0x16
    field public static final int LOCNAM = 26; // 0x1a
    field public static final long LOCSIG = 67324752L; // 0x4034b50L
    field public static final int LOCSIZ = 18; // 0x12
    field public static final int LOCTIM = 10; // 0xa
    field public static final int LOCVER = 4; // 0x4
    field public static final int STORED = 0; // 0x0
  }

  public class ZipError extends java.lang.InternalError {
    ctor public ZipError(String);
  }

  public class ZipException extends java.io.IOException {
    ctor public ZipException();
    ctor public ZipException(String);
  }

  public class ZipFile implements java.io.Closeable {
    ctor public ZipFile(String) throws java.io.IOException;
    ctor public ZipFile(java.io.File, int) throws java.io.IOException;
    ctor public ZipFile(java.io.File) throws java.io.IOException, java.util.zip.ZipException;
    ctor public ZipFile(java.io.File, int, java.nio.charset.Charset) throws java.io.IOException;
    ctor public ZipFile(String, java.nio.charset.Charset) throws java.io.IOException;
    ctor public ZipFile(java.io.File, java.nio.charset.Charset) throws java.io.IOException;
    method public void close() throws java.io.IOException;
    method public java.util.Enumeration<? extends java.util.zip.ZipEntry> entries();
    method protected void finalize() throws java.io.IOException;
    method public String getComment();
    method public java.util.zip.ZipEntry getEntry(String);
    method public java.io.InputStream getInputStream(java.util.zip.ZipEntry) throws java.io.IOException;
    method public String getName();
    method public int size();
    method public java.util.stream.Stream<? extends java.util.zip.ZipEntry> stream();
    field public static final int CENATT = 36; // 0x24
    field public static final int CENATX = 38; // 0x26
    field public static final int CENCOM = 32; // 0x20
    field public static final int CENCRC = 16; // 0x10
    field public static final int CENDSK = 34; // 0x22
    field public static final int CENEXT = 30; // 0x1e
    field public static final int CENFLG = 8; // 0x8
    field public static final int CENHDR = 46; // 0x2e
    field public static final int CENHOW = 10; // 0xa
    field public static final int CENLEN = 24; // 0x18
    field public static final int CENNAM = 28; // 0x1c
    field public static final int CENOFF = 42; // 0x2a
    field public static final long CENSIG = 33639248L; // 0x2014b50L
    field public static final int CENSIZ = 20; // 0x14
    field public static final int CENTIM = 12; // 0xc
    field public static final int CENVEM = 4; // 0x4
    field public static final int CENVER = 6; // 0x6
    field public static final int ENDCOM = 20; // 0x14
    field public static final int ENDHDR = 22; // 0x16
    field public static final int ENDOFF = 16; // 0x10
    field public static final long ENDSIG = 101010256L; // 0x6054b50L
    field public static final int ENDSIZ = 12; // 0xc
    field public static final int ENDSUB = 8; // 0x8
    field public static final int ENDTOT = 10; // 0xa
    field public static final int EXTCRC = 4; // 0x4
    field public static final int EXTHDR = 16; // 0x10
    field public static final int EXTLEN = 12; // 0xc
    field public static final long EXTSIG = 134695760L; // 0x8074b50L
    field public static final int EXTSIZ = 8; // 0x8
    field public static final int LOCCRC = 14; // 0xe
    field public static final int LOCEXT = 28; // 0x1c
    field public static final int LOCFLG = 6; // 0x6
    field public static final int LOCHDR = 30; // 0x1e
    field public static final int LOCHOW = 8; // 0x8
    field public static final int LOCLEN = 22; // 0x16
    field public static final int LOCNAM = 26; // 0x1a
    field public static final long LOCSIG = 67324752L; // 0x4034b50L
    field public static final int LOCSIZ = 18; // 0x12
    field public static final int LOCTIM = 10; // 0xa
    field public static final int LOCVER = 4; // 0x4
    field public static final int OPEN_DELETE = 4; // 0x4
    field public static final int OPEN_READ = 1; // 0x1
  }

  public class ZipInputStream extends java.util.zip.InflaterInputStream {
    ctor public ZipInputStream(java.io.InputStream);
    ctor public ZipInputStream(java.io.InputStream, java.nio.charset.Charset);
    method public void closeEntry() throws java.io.IOException;
    method protected java.util.zip.ZipEntry createZipEntry(String);
    method public java.util.zip.ZipEntry getNextEntry() throws java.io.IOException;
    field public static final int CENATT = 36; // 0x24
    field public static final int CENATX = 38; // 0x26
    field public static final int CENCOM = 32; // 0x20
    field public static final int CENCRC = 16; // 0x10
    field public static final int CENDSK = 34; // 0x22
    field public static final int CENEXT = 30; // 0x1e
    field public static final int CENFLG = 8; // 0x8
    field public static final int CENHDR = 46; // 0x2e
    field public static final int CENHOW = 10; // 0xa
    field public static final int CENLEN = 24; // 0x18
    field public static final int CENNAM = 28; // 0x1c
    field public static final int CENOFF = 42; // 0x2a
    field public static final long CENSIG = 33639248L; // 0x2014b50L
    field public static final int CENSIZ = 20; // 0x14
    field public static final int CENTIM = 12; // 0xc
    field public static final int CENVEM = 4; // 0x4
    field public static final int CENVER = 6; // 0x6
    field public static final int ENDCOM = 20; // 0x14
    field public static final int ENDHDR = 22; // 0x16
    field public static final int ENDOFF = 16; // 0x10
    field public static final long ENDSIG = 101010256L; // 0x6054b50L
    field public static final int ENDSIZ = 12; // 0xc
    field public static final int ENDSUB = 8; // 0x8
    field public static final int ENDTOT = 10; // 0xa
    field public static final int EXTCRC = 4; // 0x4
    field public static final int EXTHDR = 16; // 0x10
    field public static final int EXTLEN = 12; // 0xc
    field public static final long EXTSIG = 134695760L; // 0x8074b50L
    field public static final int EXTSIZ = 8; // 0x8
    field public static final int LOCCRC = 14; // 0xe
    field public static final int LOCEXT = 28; // 0x1c
    field public static final int LOCFLG = 6; // 0x6
    field public static final int LOCHDR = 30; // 0x1e
    field public static final int LOCHOW = 8; // 0x8
    field public static final int LOCLEN = 22; // 0x16
    field public static final int LOCNAM = 26; // 0x1a
    field public static final long LOCSIG = 67324752L; // 0x4034b50L
    field public static final int LOCSIZ = 18; // 0x12
    field public static final int LOCTIM = 10; // 0xa
    field public static final int LOCVER = 4; // 0x4
  }

  public class ZipOutputStream extends java.util.zip.DeflaterOutputStream {
    ctor public ZipOutputStream(java.io.OutputStream);
    ctor public ZipOutputStream(java.io.OutputStream, java.nio.charset.Charset);
    method public void closeEntry() throws java.io.IOException;
    method public void putNextEntry(java.util.zip.ZipEntry) throws java.io.IOException;
    method public void setComment(String);
    method public void setLevel(int);
    method public void setMethod(int);
    field public static final int CENATT = 36; // 0x24
    field public static final int CENATX = 38; // 0x26
    field public static final int CENCOM = 32; // 0x20
    field public static final int CENCRC = 16; // 0x10
    field public static final int CENDSK = 34; // 0x22
    field public static final int CENEXT = 30; // 0x1e
    field public static final int CENFLG = 8; // 0x8
    field public static final int CENHDR = 46; // 0x2e
    field public static final int CENHOW = 10; // 0xa
    field public static final int CENLEN = 24; // 0x18
    field public static final int CENNAM = 28; // 0x1c
    field public static final int CENOFF = 42; // 0x2a
    field public static final long CENSIG = 33639248L; // 0x2014b50L
    field public static final int CENSIZ = 20; // 0x14
    field public static final int CENTIM = 12; // 0xc
    field public static final int CENVEM = 4; // 0x4
    field public static final int CENVER = 6; // 0x6
    field public static final int DEFLATED = 8; // 0x8
    field public static final int ENDCOM = 20; // 0x14
    field public static final int ENDHDR = 22; // 0x16
    field public static final int ENDOFF = 16; // 0x10
    field public static final long ENDSIG = 101010256L; // 0x6054b50L
    field public static final int ENDSIZ = 12; // 0xc
    field public static final int ENDSUB = 8; // 0x8
    field public static final int ENDTOT = 10; // 0xa
    field public static final int EXTCRC = 4; // 0x4
    field public static final int EXTHDR = 16; // 0x10
    field public static final int EXTLEN = 12; // 0xc
    field public static final long EXTSIG = 134695760L; // 0x8074b50L
    field public static final int EXTSIZ = 8; // 0x8
    field public static final int LOCCRC = 14; // 0xe
    field public static final int LOCEXT = 28; // 0x1c
    field public static final int LOCFLG = 6; // 0x6
    field public static final int LOCHDR = 30; // 0x1e
    field public static final int LOCHOW = 8; // 0x8
    field public static final int LOCLEN = 22; // 0x16
    field public static final int LOCNAM = 26; // 0x1a
    field public static final long LOCSIG = 67324752L; // 0x4034b50L
    field public static final int LOCSIZ = 18; // 0x12
    field public static final int LOCTIM = 10; // 0xa
    field public static final int LOCVER = 4; // 0x4
    field public static final int STORED = 0; // 0x0
  }

}

package javax.crypto {

  public class AEADBadTagException extends javax.crypto.BadPaddingException {
    ctor public AEADBadTagException();
    ctor public AEADBadTagException(String);
  }

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

  public class Cipher {
    ctor protected Cipher(javax.crypto.CipherSpi, java.security.Provider, String);
    method public final byte[] doFinal() throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException;
    method public final int doFinal(byte[], int) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException;
    method public final byte[] doFinal(byte[]) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException;
    method public final byte[] doFinal(byte[], int, int) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException;
    method public final int doFinal(byte[], int, int, byte[]) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException;
    method public final int doFinal(byte[], int, int, byte[], int) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException;
    method public final int doFinal(java.nio.ByteBuffer, java.nio.ByteBuffer) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException;
    method public final String getAlgorithm();
    method public final int getBlockSize();
    method public final javax.crypto.ExemptionMechanism getExemptionMechanism();
    method public final byte[] getIV();
    method public static final javax.crypto.Cipher getInstance(String) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException;
    method public static final javax.crypto.Cipher getInstance(String, String) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException, java.security.NoSuchProviderException;
    method public static final javax.crypto.Cipher getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException;
    method public static final int getMaxAllowedKeyLength(String) throws java.security.NoSuchAlgorithmException;
    method public static final java.security.spec.AlgorithmParameterSpec getMaxAllowedParameterSpec(String) throws java.security.NoSuchAlgorithmException;
    method public final int getOutputSize(int);
    method public final java.security.AlgorithmParameters getParameters();
    method public final java.security.Provider getProvider();
    method public final void init(int, java.security.Key) throws java.security.InvalidKeyException;
    method public final void init(int, java.security.Key, java.security.SecureRandom) throws java.security.InvalidKeyException;
    method public final void init(int, java.security.Key, java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
    method public final void init(int, java.security.Key, java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
    method public final void init(int, java.security.Key, java.security.AlgorithmParameters) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
    method public final void init(int, java.security.Key, java.security.AlgorithmParameters, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
    method public final void init(int, java.security.cert.Certificate) throws java.security.InvalidKeyException;
    method public final void init(int, java.security.cert.Certificate, java.security.SecureRandom) throws java.security.InvalidKeyException;
    method public final java.security.Key unwrap(byte[], String, int) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
    method public final byte[] update(byte[]);
    method public final byte[] update(byte[], int, int);
    method public final int update(byte[], int, int, byte[]) throws javax.crypto.ShortBufferException;
    method public final int update(byte[], int, int, byte[], int) throws javax.crypto.ShortBufferException;
    method public final int update(java.nio.ByteBuffer, java.nio.ByteBuffer) throws javax.crypto.ShortBufferException;
    method public final void updateAAD(byte[]);
    method public final void updateAAD(byte[], int, int);
    method public final void updateAAD(java.nio.ByteBuffer);
    method public final byte[] wrap(java.security.Key) throws javax.crypto.IllegalBlockSizeException, java.security.InvalidKeyException;
    field public static final int DECRYPT_MODE = 2; // 0x2
    field public static final int ENCRYPT_MODE = 1; // 0x1
    field public static final int PRIVATE_KEY = 2; // 0x2
    field public static final int PUBLIC_KEY = 1; // 0x1
    field public static final int SECRET_KEY = 3; // 0x3
    field public static final int UNWRAP_MODE = 4; // 0x4
    field public static final int WRAP_MODE = 3; // 0x3
  }

  public class CipherInputStream extends java.io.FilterInputStream {
    ctor public CipherInputStream(java.io.InputStream, javax.crypto.Cipher);
    ctor protected CipherInputStream(java.io.InputStream);
  }

  public class CipherOutputStream extends java.io.FilterOutputStream {
    ctor public CipherOutputStream(java.io.OutputStream, javax.crypto.Cipher);
    ctor protected CipherOutputStream(java.io.OutputStream);
  }

  public abstract class CipherSpi {
    ctor public CipherSpi();
    method protected abstract byte[] engineDoFinal(byte[], int, int) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException;
    method protected abstract int engineDoFinal(byte[], int, int, byte[], int) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException;
    method protected int engineDoFinal(java.nio.ByteBuffer, java.nio.ByteBuffer) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException;
    method protected abstract int engineGetBlockSize();
    method protected abstract byte[] engineGetIV();
    method protected int engineGetKeySize(java.security.Key) throws java.security.InvalidKeyException;
    method protected abstract int engineGetOutputSize(int);
    method protected abstract java.security.AlgorithmParameters engineGetParameters();
    method protected abstract void engineInit(int, java.security.Key, java.security.SecureRandom) throws java.security.InvalidKeyException;
    method protected abstract void engineInit(int, java.security.Key, java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
    method protected abstract void engineInit(int, java.security.Key, java.security.AlgorithmParameters, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
    method protected abstract void engineSetMode(String) throws java.security.NoSuchAlgorithmException;
    method protected abstract void engineSetPadding(String) throws javax.crypto.NoSuchPaddingException;
    method protected java.security.Key engineUnwrap(byte[], String, int) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
    method protected abstract byte[] engineUpdate(byte[], int, int);
    method protected abstract int engineUpdate(byte[], int, int, byte[], int) throws javax.crypto.ShortBufferException;
    method protected int engineUpdate(java.nio.ByteBuffer, java.nio.ByteBuffer) throws javax.crypto.ShortBufferException;
    method protected void engineUpdateAAD(byte[], int, int);
    method protected void engineUpdateAAD(java.nio.ByteBuffer);
    method protected byte[] engineWrap(java.security.Key) throws javax.crypto.IllegalBlockSizeException, java.security.InvalidKeyException;
  }

  public class EncryptedPrivateKeyInfo {
    ctor public EncryptedPrivateKeyInfo(byte[]) throws java.io.IOException;
    ctor public EncryptedPrivateKeyInfo(String, byte[]) throws java.security.NoSuchAlgorithmException;
    ctor public EncryptedPrivateKeyInfo(java.security.AlgorithmParameters, byte[]) throws java.security.NoSuchAlgorithmException;
    method public String getAlgName();
    method public java.security.AlgorithmParameters getAlgParameters();
    method public byte[] getEncoded() throws java.io.IOException;
    method public byte[] getEncryptedData();
    method public java.security.spec.PKCS8EncodedKeySpec getKeySpec(javax.crypto.Cipher) throws java.security.spec.InvalidKeySpecException;
    method public java.security.spec.PKCS8EncodedKeySpec getKeySpec(java.security.Key) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
    method public java.security.spec.PKCS8EncodedKeySpec getKeySpec(java.security.Key, String) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public java.security.spec.PKCS8EncodedKeySpec getKeySpec(java.security.Key, java.security.Provider) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
  }

  public class ExemptionMechanism {
    ctor protected ExemptionMechanism(javax.crypto.ExemptionMechanismSpi, java.security.Provider, String);
    method public final byte[] genExemptionBlob() throws javax.crypto.ExemptionMechanismException, java.lang.IllegalStateException;
    method public final int genExemptionBlob(byte[]) throws javax.crypto.ExemptionMechanismException, java.lang.IllegalStateException, javax.crypto.ShortBufferException;
    method public final int genExemptionBlob(byte[], int) throws javax.crypto.ExemptionMechanismException, java.lang.IllegalStateException, javax.crypto.ShortBufferException;
    method public static final javax.crypto.ExemptionMechanism getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.crypto.ExemptionMechanism getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.crypto.ExemptionMechanism getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final String getName();
    method public final int getOutputSize(int) throws java.lang.IllegalStateException;
    method public final java.security.Provider getProvider();
    method public final void init(java.security.Key) throws javax.crypto.ExemptionMechanismException, java.security.InvalidKeyException;
    method public final void init(java.security.Key, java.security.spec.AlgorithmParameterSpec) throws javax.crypto.ExemptionMechanismException, java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
    method public final void init(java.security.Key, java.security.AlgorithmParameters) throws javax.crypto.ExemptionMechanismException, java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
    method public final boolean isCryptoAllowed(java.security.Key) throws javax.crypto.ExemptionMechanismException;
  }

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

  public abstract class ExemptionMechanismSpi {
    ctor public ExemptionMechanismSpi();
    method protected abstract byte[] engineGenExemptionBlob() throws javax.crypto.ExemptionMechanismException;
    method protected abstract int engineGenExemptionBlob(byte[], int) throws javax.crypto.ExemptionMechanismException, javax.crypto.ShortBufferException;
    method protected abstract int engineGetOutputSize(int);
    method protected abstract void engineInit(java.security.Key) throws javax.crypto.ExemptionMechanismException, java.security.InvalidKeyException;
    method protected abstract void engineInit(java.security.Key, java.security.spec.AlgorithmParameterSpec) throws javax.crypto.ExemptionMechanismException, java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
    method protected abstract void engineInit(java.security.Key, java.security.AlgorithmParameters) throws javax.crypto.ExemptionMechanismException, java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
  }

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

  public class KeyAgreement {
    ctor protected KeyAgreement(javax.crypto.KeyAgreementSpi, java.security.Provider, String);
    method public final java.security.Key doPhase(java.security.Key, boolean) throws java.lang.IllegalStateException, java.security.InvalidKeyException;
    method public final byte[] generateSecret() throws java.lang.IllegalStateException;
    method public final int generateSecret(byte[], int) throws java.lang.IllegalStateException, javax.crypto.ShortBufferException;
    method public final javax.crypto.SecretKey generateSecret(String) throws java.lang.IllegalStateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
    method public final String getAlgorithm();
    method public static final javax.crypto.KeyAgreement getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.crypto.KeyAgreement getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.crypto.KeyAgreement getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final java.security.Provider getProvider();
    method public final void init(java.security.Key) throws java.security.InvalidKeyException;
    method public final void init(java.security.Key, java.security.SecureRandom) throws java.security.InvalidKeyException;
    method public final void init(java.security.Key, java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
    method public final void init(java.security.Key, java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
  }

  public abstract class KeyAgreementSpi {
    ctor public KeyAgreementSpi();
    method protected abstract java.security.Key engineDoPhase(java.security.Key, boolean) throws java.lang.IllegalStateException, java.security.InvalidKeyException;
    method protected abstract byte[] engineGenerateSecret() throws java.lang.IllegalStateException;
    method protected abstract int engineGenerateSecret(byte[], int) throws java.lang.IllegalStateException, javax.crypto.ShortBufferException;
    method protected abstract javax.crypto.SecretKey engineGenerateSecret(String) throws java.lang.IllegalStateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
    method protected abstract void engineInit(java.security.Key, java.security.SecureRandom) throws java.security.InvalidKeyException;
    method protected abstract void engineInit(java.security.Key, java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
  }

  public class KeyGenerator {
    ctor protected KeyGenerator(javax.crypto.KeyGeneratorSpi, java.security.Provider, String);
    method public final javax.crypto.SecretKey generateKey();
    method public final String getAlgorithm();
    method public static final javax.crypto.KeyGenerator getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.crypto.KeyGenerator getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.crypto.KeyGenerator getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final java.security.Provider getProvider();
    method public final void init(java.security.SecureRandom);
    method public final void init(java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException;
    method public final void init(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException;
    method public final void init(int);
    method public final void init(int, java.security.SecureRandom);
  }

  public abstract class KeyGeneratorSpi {
    ctor public KeyGeneratorSpi();
    method protected abstract javax.crypto.SecretKey engineGenerateKey();
    method protected abstract void engineInit(java.security.SecureRandom);
    method protected abstract void engineInit(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException;
    method protected abstract void engineInit(int, java.security.SecureRandom);
  }

  public class Mac implements java.lang.Cloneable {
    ctor protected Mac(javax.crypto.MacSpi, java.security.Provider, String);
    method public final Object clone() throws java.lang.CloneNotSupportedException;
    method public final byte[] doFinal() throws java.lang.IllegalStateException;
    method public final void doFinal(byte[], int) throws java.lang.IllegalStateException, javax.crypto.ShortBufferException;
    method public final byte[] doFinal(byte[]) throws java.lang.IllegalStateException;
    method public final String getAlgorithm();
    method public static final javax.crypto.Mac getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.crypto.Mac getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.crypto.Mac getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final int getMacLength();
    method public final java.security.Provider getProvider();
    method public final void init(java.security.Key) throws java.security.InvalidKeyException;
    method public final void init(java.security.Key, java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
    method public final void reset();
    method public final void update(byte) throws java.lang.IllegalStateException;
    method public final void update(byte[]) throws java.lang.IllegalStateException;
    method public final void update(byte[], int, int) throws java.lang.IllegalStateException;
    method public final void update(java.nio.ByteBuffer);
  }

  public abstract class MacSpi {
    ctor public MacSpi();
    method public Object clone() throws java.lang.CloneNotSupportedException;
    method protected abstract byte[] engineDoFinal();
    method protected abstract int engineGetMacLength();
    method protected abstract void engineInit(java.security.Key, java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
    method protected abstract void engineReset();
    method protected abstract void engineUpdate(byte);
    method protected abstract void engineUpdate(byte[], int, int);
    method protected void engineUpdate(java.nio.ByteBuffer);
  }

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

  public class NullCipher extends javax.crypto.Cipher {
    ctor public NullCipher();
  }

  public class SealedObject implements java.io.Serializable {
    ctor public SealedObject(java.io.Serializable, javax.crypto.Cipher) throws java.io.IOException, javax.crypto.IllegalBlockSizeException;
    ctor protected SealedObject(javax.crypto.SealedObject);
    method public final String getAlgorithm();
    method public final Object getObject(java.security.Key) throws java.lang.ClassNotFoundException, java.io.IOException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
    method public final Object getObject(javax.crypto.Cipher) throws javax.crypto.BadPaddingException, java.lang.ClassNotFoundException, java.io.IOException, javax.crypto.IllegalBlockSizeException;
    method public final Object getObject(java.security.Key, String) throws java.lang.ClassNotFoundException, java.io.IOException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    field protected byte[] encodedParams;
  }

  public interface SecretKey extends java.security.Key javax.security.auth.Destroyable {
    field public static final long serialVersionUID = -4795878709595146952L; // 0xbd719db928b8f538L
  }

  public class SecretKeyFactory {
    ctor protected SecretKeyFactory(javax.crypto.SecretKeyFactorySpi, java.security.Provider, String);
    method public final javax.crypto.SecretKey generateSecret(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
    method public final String getAlgorithm();
    method public static final javax.crypto.SecretKeyFactory getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.crypto.SecretKeyFactory getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.crypto.SecretKeyFactory getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final java.security.spec.KeySpec getKeySpec(javax.crypto.SecretKey, Class<?>) throws java.security.spec.InvalidKeySpecException;
    method public final java.security.Provider getProvider();
    method public final javax.crypto.SecretKey translateKey(javax.crypto.SecretKey) throws java.security.InvalidKeyException;
  }

  public abstract class SecretKeyFactorySpi {
    ctor public SecretKeyFactorySpi();
    method protected abstract javax.crypto.SecretKey engineGenerateSecret(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
    method protected abstract java.security.spec.KeySpec engineGetKeySpec(javax.crypto.SecretKey, Class<?>) throws java.security.spec.InvalidKeySpecException;
    method protected abstract javax.crypto.SecretKey engineTranslateKey(javax.crypto.SecretKey) throws java.security.InvalidKeyException;
  }

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

}

package javax.crypto.interfaces {

  public interface DHKey {
    method public javax.crypto.spec.DHParameterSpec getParams();
  }

  public interface DHPrivateKey extends javax.crypto.interfaces.DHKey java.security.PrivateKey {
    method public java.math.BigInteger getX();
    field public static final long serialVersionUID = 2211791113380396553L; // 0x1eb1dc4c8e677e09L
  }

  public interface DHPublicKey extends javax.crypto.interfaces.DHKey java.security.PublicKey {
    method public java.math.BigInteger getY();
    field public static final long serialVersionUID = -6628103563352519193L; // 0xa4043eed23df4de7L
  }

  public interface PBEKey extends javax.crypto.SecretKey {
    method public int getIterationCount();
    method public char[] getPassword();
    method public byte[] getSalt();
    field public static final long serialVersionUID = -1430015993304333921L; // 0xec279007d7f7c19fL
  }

}

package javax.crypto.spec {

  public class DESKeySpec implements java.security.spec.KeySpec {
    ctor public DESKeySpec(byte[]) throws java.security.InvalidKeyException;
    ctor public DESKeySpec(byte[], int) throws java.security.InvalidKeyException;
    method public byte[] getKey();
    method public static boolean isParityAdjusted(byte[], int) throws java.security.InvalidKeyException;
    method public static boolean isWeak(byte[], int) throws java.security.InvalidKeyException;
    field public static final int DES_KEY_LEN = 8; // 0x8
  }

  public class DESedeKeySpec implements java.security.spec.KeySpec {
    ctor public DESedeKeySpec(byte[]) throws java.security.InvalidKeyException;
    ctor public DESedeKeySpec(byte[], int) throws java.security.InvalidKeyException;
    method public byte[] getKey();
    method public static boolean isParityAdjusted(byte[], int) throws java.security.InvalidKeyException;
    field public static final int DES_EDE_KEY_LEN = 24; // 0x18
  }

  public class DHGenParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public DHGenParameterSpec(int, int);
    method public int getExponentSize();
    method public int getPrimeSize();
  }

  public class DHParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public DHParameterSpec(java.math.BigInteger, java.math.BigInteger);
    ctor public DHParameterSpec(java.math.BigInteger, java.math.BigInteger, int);
    method public java.math.BigInteger getG();
    method public int getL();
    method public java.math.BigInteger getP();
  }

  public class DHPrivateKeySpec implements java.security.spec.KeySpec {
    ctor public DHPrivateKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
    method public java.math.BigInteger getG();
    method public java.math.BigInteger getP();
    method public java.math.BigInteger getX();
  }

  public class DHPublicKeySpec implements java.security.spec.KeySpec {
    ctor public DHPublicKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
    method public java.math.BigInteger getG();
    method public java.math.BigInteger getP();
    method public java.math.BigInteger getY();
  }

  public class GCMParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public GCMParameterSpec(int, byte[]);
    ctor public GCMParameterSpec(int, byte[], int, int);
    method public byte[] getIV();
    method public int getTLen();
  }

  public class IvParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public IvParameterSpec(byte[]);
    ctor public IvParameterSpec(byte[], int, int);
    method public byte[] getIV();
  }

  public class OAEPParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public OAEPParameterSpec(String, String, java.security.spec.AlgorithmParameterSpec, javax.crypto.spec.PSource);
    method public String getDigestAlgorithm();
    method public String getMGFAlgorithm();
    method public java.security.spec.AlgorithmParameterSpec getMGFParameters();
    method public javax.crypto.spec.PSource getPSource();
    field public static final javax.crypto.spec.OAEPParameterSpec DEFAULT;
  }

  public class PBEKeySpec implements java.security.spec.KeySpec {
    ctor public PBEKeySpec(char[]);
    ctor public PBEKeySpec(char[], byte[], int, int);
    ctor public PBEKeySpec(char[], byte[], int);
    method public final void clearPassword();
    method public final int getIterationCount();
    method public final int getKeyLength();
    method public final char[] getPassword();
    method public final byte[] getSalt();
  }

  public class PBEParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public PBEParameterSpec(byte[], int);
    ctor public PBEParameterSpec(byte[], int, java.security.spec.AlgorithmParameterSpec);
    method public int getIterationCount();
    method public java.security.spec.AlgorithmParameterSpec getParameterSpec();
    method public byte[] getSalt();
  }

  public class PSource {
    ctor protected PSource(String);
    method public String getAlgorithm();
  }

  public static final class PSource.PSpecified extends javax.crypto.spec.PSource {
    ctor public PSource.PSpecified(byte[]);
    method public byte[] getValue();
    field public static final javax.crypto.spec.PSource.PSpecified DEFAULT;
  }

  public class RC2ParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public RC2ParameterSpec(int);
    ctor public RC2ParameterSpec(int, byte[]);
    ctor public RC2ParameterSpec(int, byte[], int);
    method public int getEffectiveKeyBits();
    method public byte[] getIV();
  }

  public class RC5ParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public RC5ParameterSpec(int, int, int);
    ctor public RC5ParameterSpec(int, int, int, byte[]);
    ctor public RC5ParameterSpec(int, int, int, byte[], int);
    method public byte[] getIV();
    method public int getRounds();
    method public int getVersion();
    method public int getWordSize();
  }

  public class SecretKeySpec implements java.security.spec.KeySpec javax.crypto.SecretKey {
    ctor public SecretKeySpec(byte[], String);
    ctor public SecretKeySpec(byte[], int, int, String);
    method public String getAlgorithm();
    method public byte[] getEncoded();
    method public String getFormat();
  }

}

package javax.microedition.khronos.egl {

  public interface EGL {
  }

  public interface EGL10 extends javax.microedition.khronos.egl.EGL {
    method public boolean eglChooseConfig(javax.microedition.khronos.egl.EGLDisplay, int[], javax.microedition.khronos.egl.EGLConfig[], int, int[]);
    method public boolean eglCopyBuffers(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLSurface, Object);
    method public javax.microedition.khronos.egl.EGLContext eglCreateContext(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig, javax.microedition.khronos.egl.EGLContext, int[]);
    method public javax.microedition.khronos.egl.EGLSurface eglCreatePbufferSurface(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig, int[]);
    method @Deprecated public javax.microedition.khronos.egl.EGLSurface eglCreatePixmapSurface(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig, Object, int[]);
    method public javax.microedition.khronos.egl.EGLSurface eglCreateWindowSurface(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig, Object, int[]);
    method public boolean eglDestroyContext(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLContext);
    method public boolean eglDestroySurface(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLSurface);
    method public boolean eglGetConfigAttrib(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig, int, int[]);
    method public boolean eglGetConfigs(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig[], int, int[]);
    method public javax.microedition.khronos.egl.EGLContext eglGetCurrentContext();
    method public javax.microedition.khronos.egl.EGLDisplay eglGetCurrentDisplay();
    method public javax.microedition.khronos.egl.EGLSurface eglGetCurrentSurface(int);
    method public javax.microedition.khronos.egl.EGLDisplay eglGetDisplay(Object);
    method public int eglGetError();
    method public boolean eglInitialize(javax.microedition.khronos.egl.EGLDisplay, int[]);
    method public boolean eglMakeCurrent(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLSurface, javax.microedition.khronos.egl.EGLSurface, javax.microedition.khronos.egl.EGLContext);
    method public boolean eglQueryContext(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLContext, int, int[]);
    method public String eglQueryString(javax.microedition.khronos.egl.EGLDisplay, int);
    method public boolean eglQuerySurface(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLSurface, int, int[]);
    method public boolean eglSwapBuffers(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLSurface);
    method public boolean eglTerminate(javax.microedition.khronos.egl.EGLDisplay);
    method public boolean eglWaitGL();
    method public boolean eglWaitNative(int, Object);
    field public static final int EGL_ALPHA_FORMAT = 12424; // 0x3088
    field public static final int EGL_ALPHA_MASK_SIZE = 12350; // 0x303e
    field public static final int EGL_ALPHA_SIZE = 12321; // 0x3021
    field public static final int EGL_BAD_ACCESS = 12290; // 0x3002
    field public static final int EGL_BAD_ALLOC = 12291; // 0x3003
    field public static final int EGL_BAD_ATTRIBUTE = 12292; // 0x3004
    field public static final int EGL_BAD_CONFIG = 12293; // 0x3005
    field public static final int EGL_BAD_CONTEXT = 12294; // 0x3006
    field public static final int EGL_BAD_CURRENT_SURFACE = 12295; // 0x3007
    field public static final int EGL_BAD_DISPLAY = 12296; // 0x3008
    field public static final int EGL_BAD_MATCH = 12297; // 0x3009
    field public static final int EGL_BAD_NATIVE_PIXMAP = 12298; // 0x300a
    field public static final int EGL_BAD_NATIVE_WINDOW = 12299; // 0x300b
    field public static final int EGL_BAD_PARAMETER = 12300; // 0x300c
    field public static final int EGL_BAD_SURFACE = 12301; // 0x300d
    field public static final int EGL_BLUE_SIZE = 12322; // 0x3022
    field public static final int EGL_BUFFER_SIZE = 12320; // 0x3020
    field public static final int EGL_COLORSPACE = 12423; // 0x3087
    field public static final int EGL_COLOR_BUFFER_TYPE = 12351; // 0x303f
    field public static final int EGL_CONFIG_CAVEAT = 12327; // 0x3027
    field public static final int EGL_CONFIG_ID = 12328; // 0x3028
    field public static final int EGL_CORE_NATIVE_ENGINE = 12379; // 0x305b
    field public static final Object EGL_DEFAULT_DISPLAY;
    field public static final int EGL_DEPTH_SIZE = 12325; // 0x3025
    field public static final int EGL_DONT_CARE = -1; // 0xffffffff
    field public static final int EGL_DRAW = 12377; // 0x3059
    field public static final int EGL_EXTENSIONS = 12373; // 0x3055
    field public static final int EGL_GREEN_SIZE = 12323; // 0x3023
    field public static final int EGL_HEIGHT = 12374; // 0x3056
    field public static final int EGL_HORIZONTAL_RESOLUTION = 12432; // 0x3090
    field public static final int EGL_LARGEST_PBUFFER = 12376; // 0x3058
    field public static final int EGL_LEVEL = 12329; // 0x3029
    field public static final int EGL_LUMINANCE_BUFFER = 12431; // 0x308f
    field public static final int EGL_LUMINANCE_SIZE = 12349; // 0x303d
    field public static final int EGL_MAX_PBUFFER_HEIGHT = 12330; // 0x302a
    field public static final int EGL_MAX_PBUFFER_PIXELS = 12331; // 0x302b
    field public static final int EGL_MAX_PBUFFER_WIDTH = 12332; // 0x302c
    field public static final int EGL_NATIVE_RENDERABLE = 12333; // 0x302d
    field public static final int EGL_NATIVE_VISUAL_ID = 12334; // 0x302e
    field public static final int EGL_NATIVE_VISUAL_TYPE = 12335; // 0x302f
    field public static final int EGL_NONE = 12344; // 0x3038
    field public static final int EGL_NON_CONFORMANT_CONFIG = 12369; // 0x3051
    field public static final int EGL_NOT_INITIALIZED = 12289; // 0x3001
    field public static final javax.microedition.khronos.egl.EGLContext EGL_NO_CONTEXT;
    field public static final javax.microedition.khronos.egl.EGLDisplay EGL_NO_DISPLAY;
    field public static final javax.microedition.khronos.egl.EGLSurface EGL_NO_SURFACE;
    field public static final int EGL_PBUFFER_BIT = 1; // 0x1
    field public static final int EGL_PIXEL_ASPECT_RATIO = 12434; // 0x3092
    field public static final int EGL_PIXMAP_BIT = 2; // 0x2
    field public static final int EGL_READ = 12378; // 0x305a
    field public static final int EGL_RED_SIZE = 12324; // 0x3024
    field public static final int EGL_RENDERABLE_TYPE = 12352; // 0x3040
    field public static final int EGL_RENDER_BUFFER = 12422; // 0x3086
    field public static final int EGL_RGB_BUFFER = 12430; // 0x308e
    field public static final int EGL_SAMPLES = 12337; // 0x3031
    field public static final int EGL_SAMPLE_BUFFERS = 12338; // 0x3032
    field public static final int EGL_SINGLE_BUFFER = 12421; // 0x3085
    field public static final int EGL_SLOW_CONFIG = 12368; // 0x3050
    field public static final int EGL_STENCIL_SIZE = 12326; // 0x3026
    field public static final int EGL_SUCCESS = 12288; // 0x3000
    field public static final int EGL_SURFACE_TYPE = 12339; // 0x3033
    field public static final int EGL_TRANSPARENT_BLUE_VALUE = 12341; // 0x3035
    field public static final int EGL_TRANSPARENT_GREEN_VALUE = 12342; // 0x3036
    field public static final int EGL_TRANSPARENT_RED_VALUE = 12343; // 0x3037
    field public static final int EGL_TRANSPARENT_RGB = 12370; // 0x3052
    field public static final int EGL_TRANSPARENT_TYPE = 12340; // 0x3034
    field public static final int EGL_VENDOR = 12371; // 0x3053
    field public static final int EGL_VERSION = 12372; // 0x3054
    field public static final int EGL_VERTICAL_RESOLUTION = 12433; // 0x3091
    field public static final int EGL_WIDTH = 12375; // 0x3057
    field public static final int EGL_WINDOW_BIT = 4; // 0x4
  }

  public interface EGL11 extends javax.microedition.khronos.egl.EGL10 {
    field public static final int EGL_CONTEXT_LOST = 12302; // 0x300e
  }

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

  public abstract class EGLContext {
    ctor public EGLContext();
    method public static javax.microedition.khronos.egl.EGL getEGL();
    method public abstract javax.microedition.khronos.opengles.GL getGL();
  }

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

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

}

package javax.microedition.khronos.opengles {

  public interface GL {
  }

  public interface GL10 extends javax.microedition.khronos.opengles.GL {
    method public void glActiveTexture(int);
    method public void glAlphaFunc(int, float);
    method public void glAlphaFuncx(int, int);
    method public void glBindTexture(int, int);
    method public void glBlendFunc(int, int);
    method public void glClear(int);
    method public void glClearColor(float, float, float, float);
    method public void glClearColorx(int, int, int, int);
    method public void glClearDepthf(float);
    method public void glClearDepthx(int);
    method public void glClearStencil(int);
    method public void glClientActiveTexture(int);
    method public void glColor4f(float, float, float, float);
    method public void glColor4x(int, int, int, int);
    method public void glColorMask(boolean, boolean, boolean, boolean);
    method public void glColorPointer(int, int, int, java.nio.Buffer);
    method public void glCompressedTexImage2D(int, int, int, int, int, int, int, java.nio.Buffer);
    method public void glCompressedTexSubImage2D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public void glCopyTexImage2D(int, int, int, int, int, int, int, int);
    method public void glCopyTexSubImage2D(int, int, int, int, int, int, int, int);
    method public void glCullFace(int);
    method public void glDeleteTextures(int, int[], int);
    method public void glDeleteTextures(int, java.nio.IntBuffer);
    method public void glDepthFunc(int);
    method public void glDepthMask(boolean);
    method public void glDepthRangef(float, float);
    method public void glDepthRangex(int, int);
    method public void glDisable(int);
    method public void glDisableClientState(int);
    method public void glDrawArrays(int, int, int);
    method public void glDrawElements(int, int, int, java.nio.Buffer);
    method public void glEnable(int);
    method public void glEnableClientState(int);
    method public void glFinish();
    method public void glFlush();
    method public void glFogf(int, float);
    method public void glFogfv(int, float[], int);
    method public void glFogfv(int, java.nio.FloatBuffer);
    method public void glFogx(int, int);
    method public void glFogxv(int, int[], int);
    method public void glFogxv(int, java.nio.IntBuffer);
    method public void glFrontFace(int);
    method public void glFrustumf(float, float, float, float, float, float);
    method public void glFrustumx(int, int, int, int, int, int);
    method public void glGenTextures(int, int[], int);
    method public void glGenTextures(int, java.nio.IntBuffer);
    method public int glGetError();
    method public void glGetIntegerv(int, int[], int);
    method public void glGetIntegerv(int, java.nio.IntBuffer);
    method public String glGetString(int);
    method public void glHint(int, int);
    method public void glLightModelf(int, float);
    method public void glLightModelfv(int, float[], int);
    method public void glLightModelfv(int, java.nio.FloatBuffer);
    method public void glLightModelx(int, int);
    method public void glLightModelxv(int, int[], int);
    method public void glLightModelxv(int, java.nio.IntBuffer);
    method public void glLightf(int, int, float);
    method public void glLightfv(int, int, float[], int);
    method public void glLightfv(int, int, java.nio.FloatBuffer);
    method public void glLightx(int, int, int);
    method public void glLightxv(int, int, int[], int);
    method public void glLightxv(int, int, java.nio.IntBuffer);
    method public void glLineWidth(float);
    method public void glLineWidthx(int);
    method public void glLoadIdentity();
    method public void glLoadMatrixf(float[], int);
    method public void glLoadMatrixf(java.nio.FloatBuffer);
    method public void glLoadMatrixx(int[], int);
    method public void glLoadMatrixx(java.nio.IntBuffer);
    method public void glLogicOp(int);
    method public void glMaterialf(int, int, float);
    method public void glMaterialfv(int, int, float[], int);
    method public void glMaterialfv(int, int, java.nio.FloatBuffer);
    method public void glMaterialx(int, int, int);
    method public void glMaterialxv(int, int, int[], int);
    method public void glMaterialxv(int, int, java.nio.IntBuffer);
    method public void glMatrixMode(int);
    method public void glMultMatrixf(float[], int);
    method public void glMultMatrixf(java.nio.FloatBuffer);
    method public void glMultMatrixx(int[], int);
    method public void glMultMatrixx(java.nio.IntBuffer);
    method public void glMultiTexCoord4f(int, float, float, float, float);
    method public void glMultiTexCoord4x(int, int, int, int, int);
    method public void glNormal3f(float, float, float);
    method public void glNormal3x(int, int, int);
    method public void glNormalPointer(int, int, java.nio.Buffer);
    method public void glOrthof(float, float, float, float, float, float);
    method public void glOrthox(int, int, int, int, int, int);
    method public void glPixelStorei(int, int);
    method public void glPointSize(float);
    method public void glPointSizex(int);
    method public void glPolygonOffset(float, float);
    method public void glPolygonOffsetx(int, int);
    method public void glPopMatrix();
    method public void glPushMatrix();
    method public void glReadPixels(int, int, int, int, int, int, java.nio.Buffer);
    method public void glRotatef(float, float, float, float);
    method public void glRotatex(int, int, int, int);
    method public void glSampleCoverage(float, boolean);
    method public void glSampleCoveragex(int, boolean);
    method public void glScalef(float, float, float);
    method public void glScalex(int, int, int);
    method public void glScissor(int, int, int, int);
    method public void glShadeModel(int);
    method public void glStencilFunc(int, int, int);
    method public void glStencilMask(int);
    method public void glStencilOp(int, int, int);
    method public void glTexCoordPointer(int, int, int, java.nio.Buffer);
    method public void glTexEnvf(int, int, float);
    method public void glTexEnvfv(int, int, float[], int);
    method public void glTexEnvfv(int, int, java.nio.FloatBuffer);
    method public void glTexEnvx(int, int, int);
    method public void glTexEnvxv(int, int, int[], int);
    method public void glTexEnvxv(int, int, java.nio.IntBuffer);
    method public void glTexImage2D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public void glTexParameterf(int, int, float);
    method public void glTexParameterx(int, int, int);
    method public void glTexSubImage2D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public void glTranslatef(float, float, float);
    method public void glTranslatex(int, int, int);
    method public void glVertexPointer(int, int, int, java.nio.Buffer);
    method public void glViewport(int, int, int, int);
    field public static final int GL_ADD = 260; // 0x104
    field public static final int GL_ALIASED_LINE_WIDTH_RANGE = 33902; // 0x846e
    field public static final int GL_ALIASED_POINT_SIZE_RANGE = 33901; // 0x846d
    field public static final int GL_ALPHA = 6406; // 0x1906
    field public static final int GL_ALPHA_BITS = 3413; // 0xd55
    field public static final int GL_ALPHA_TEST = 3008; // 0xbc0
    field public static final int GL_ALWAYS = 519; // 0x207
    field public static final int GL_AMBIENT = 4608; // 0x1200
    field public static final int GL_AMBIENT_AND_DIFFUSE = 5634; // 0x1602
    field public static final int GL_AND = 5377; // 0x1501
    field public static final int GL_AND_INVERTED = 5380; // 0x1504
    field public static final int GL_AND_REVERSE = 5378; // 0x1502
    field public static final int GL_BACK = 1029; // 0x405
    field public static final int GL_BLEND = 3042; // 0xbe2
    field public static final int GL_BLUE_BITS = 3412; // 0xd54
    field public static final int GL_BYTE = 5120; // 0x1400
    field public static final int GL_CCW = 2305; // 0x901
    field public static final int GL_CLAMP_TO_EDGE = 33071; // 0x812f
    field public static final int GL_CLEAR = 5376; // 0x1500
    field public static final int GL_COLOR_ARRAY = 32886; // 0x8076
    field public static final int GL_COLOR_BUFFER_BIT = 16384; // 0x4000
    field public static final int GL_COLOR_LOGIC_OP = 3058; // 0xbf2
    field public static final int GL_COLOR_MATERIAL = 2903; // 0xb57
    field public static final int GL_COMPRESSED_TEXTURE_FORMATS = 34467; // 0x86a3
    field public static final int GL_CONSTANT_ATTENUATION = 4615; // 0x1207
    field public static final int GL_COPY = 5379; // 0x1503
    field public static final int GL_COPY_INVERTED = 5388; // 0x150c
    field public static final int GL_CULL_FACE = 2884; // 0xb44
    field public static final int GL_CW = 2304; // 0x900
    field public static final int GL_DECAL = 8449; // 0x2101
    field public static final int GL_DECR = 7683; // 0x1e03
    field public static final int GL_DEPTH_BITS = 3414; // 0xd56
    field public static final int GL_DEPTH_BUFFER_BIT = 256; // 0x100
    field public static final int GL_DEPTH_TEST = 2929; // 0xb71
    field public static final int GL_DIFFUSE = 4609; // 0x1201
    field public static final int GL_DITHER = 3024; // 0xbd0
    field public static final int GL_DONT_CARE = 4352; // 0x1100
    field public static final int GL_DST_ALPHA = 772; // 0x304
    field public static final int GL_DST_COLOR = 774; // 0x306
    field public static final int GL_EMISSION = 5632; // 0x1600
    field public static final int GL_EQUAL = 514; // 0x202
    field public static final int GL_EQUIV = 5385; // 0x1509
    field public static final int GL_EXP = 2048; // 0x800
    field public static final int GL_EXP2 = 2049; // 0x801
    field public static final int GL_EXTENSIONS = 7939; // 0x1f03
    field public static final int GL_FALSE = 0; // 0x0
    field public static final int GL_FASTEST = 4353; // 0x1101
    field public static final int GL_FIXED = 5132; // 0x140c
    field public static final int GL_FLAT = 7424; // 0x1d00
    field public static final int GL_FLOAT = 5126; // 0x1406
    field public static final int GL_FOG = 2912; // 0xb60
    field public static final int GL_FOG_COLOR = 2918; // 0xb66
    field public static final int GL_FOG_DENSITY = 2914; // 0xb62
    field public static final int GL_FOG_END = 2916; // 0xb64
    field public static final int GL_FOG_HINT = 3156; // 0xc54
    field public static final int GL_FOG_MODE = 2917; // 0xb65
    field public static final int GL_FOG_START = 2915; // 0xb63
    field public static final int GL_FRONT = 1028; // 0x404
    field public static final int GL_FRONT_AND_BACK = 1032; // 0x408
    field public static final int GL_GEQUAL = 518; // 0x206
    field public static final int GL_GREATER = 516; // 0x204
    field public static final int GL_GREEN_BITS = 3411; // 0xd53
    field public static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = 35739; // 0x8b9b
    field public static final int GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = 35738; // 0x8b9a
    field public static final int GL_INCR = 7682; // 0x1e02
    field public static final int GL_INVALID_ENUM = 1280; // 0x500
    field public static final int GL_INVALID_OPERATION = 1282; // 0x502
    field public static final int GL_INVALID_VALUE = 1281; // 0x501
    field public static final int GL_INVERT = 5386; // 0x150a
    field public static final int GL_KEEP = 7680; // 0x1e00
    field public static final int GL_LEQUAL = 515; // 0x203
    field public static final int GL_LESS = 513; // 0x201
    field public static final int GL_LIGHT0 = 16384; // 0x4000
    field public static final int GL_LIGHT1 = 16385; // 0x4001
    field public static final int GL_LIGHT2 = 16386; // 0x4002
    field public static final int GL_LIGHT3 = 16387; // 0x4003
    field public static final int GL_LIGHT4 = 16388; // 0x4004
    field public static final int GL_LIGHT5 = 16389; // 0x4005
    field public static final int GL_LIGHT6 = 16390; // 0x4006
    field public static final int GL_LIGHT7 = 16391; // 0x4007
    field public static final int GL_LIGHTING = 2896; // 0xb50
    field public static final int GL_LIGHT_MODEL_AMBIENT = 2899; // 0xb53
    field public static final int GL_LIGHT_MODEL_TWO_SIDE = 2898; // 0xb52
    field public static final int GL_LINEAR = 9729; // 0x2601
    field public static final int GL_LINEAR_ATTENUATION = 4616; // 0x1208
    field public static final int GL_LINEAR_MIPMAP_LINEAR = 9987; // 0x2703
    field public static final int GL_LINEAR_MIPMAP_NEAREST = 9985; // 0x2701
    field public static final int GL_LINES = 1; // 0x1
    field public static final int GL_LINE_LOOP = 2; // 0x2
    field public static final int GL_LINE_SMOOTH = 2848; // 0xb20
    field public static final int GL_LINE_SMOOTH_HINT = 3154; // 0xc52
    field public static final int GL_LINE_STRIP = 3; // 0x3
    field public static final int GL_LUMINANCE = 6409; // 0x1909
    field public static final int GL_LUMINANCE_ALPHA = 6410; // 0x190a
    field public static final int GL_MAX_ELEMENTS_INDICES = 33001; // 0x80e9
    field public static final int GL_MAX_ELEMENTS_VERTICES = 33000; // 0x80e8
    field public static final int GL_MAX_LIGHTS = 3377; // 0xd31
    field public static final int GL_MAX_MODELVIEW_STACK_DEPTH = 3382; // 0xd36
    field public static final int GL_MAX_PROJECTION_STACK_DEPTH = 3384; // 0xd38
    field public static final int GL_MAX_TEXTURE_SIZE = 3379; // 0xd33
    field public static final int GL_MAX_TEXTURE_STACK_DEPTH = 3385; // 0xd39
    field public static final int GL_MAX_TEXTURE_UNITS = 34018; // 0x84e2
    field public static final int GL_MAX_VIEWPORT_DIMS = 3386; // 0xd3a
    field public static final int GL_MODELVIEW = 5888; // 0x1700
    field public static final int GL_MODULATE = 8448; // 0x2100
    field public static final int GL_MULTISAMPLE = 32925; // 0x809d
    field public static final int GL_NAND = 5390; // 0x150e
    field public static final int GL_NEAREST = 9728; // 0x2600
    field public static final int GL_NEAREST_MIPMAP_LINEAR = 9986; // 0x2702
    field public static final int GL_NEAREST_MIPMAP_NEAREST = 9984; // 0x2700
    field public static final int GL_NEVER = 512; // 0x200
    field public static final int GL_NICEST = 4354; // 0x1102
    field public static final int GL_NOOP = 5381; // 0x1505
    field public static final int GL_NOR = 5384; // 0x1508
    field public static final int GL_NORMALIZE = 2977; // 0xba1
    field public static final int GL_NORMAL_ARRAY = 32885; // 0x8075
    field public static final int GL_NOTEQUAL = 517; // 0x205
    field public static final int GL_NO_ERROR = 0; // 0x0
    field public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 34466; // 0x86a2
    field public static final int GL_ONE = 1; // 0x1
    field public static final int GL_ONE_MINUS_DST_ALPHA = 773; // 0x305
    field public static final int GL_ONE_MINUS_DST_COLOR = 775; // 0x307
    field public static final int GL_ONE_MINUS_SRC_ALPHA = 771; // 0x303
    field public static final int GL_ONE_MINUS_SRC_COLOR = 769; // 0x301
    field public static final int GL_OR = 5383; // 0x1507
    field public static final int GL_OR_INVERTED = 5389; // 0x150d
    field public static final int GL_OR_REVERSE = 5387; // 0x150b
    field public static final int GL_OUT_OF_MEMORY = 1285; // 0x505
    field public static final int GL_PACK_ALIGNMENT = 3333; // 0xd05
    field public static final int GL_PALETTE4_R5_G6_B5_OES = 35730; // 0x8b92
    field public static final int GL_PALETTE4_RGB5_A1_OES = 35732; // 0x8b94
    field public static final int GL_PALETTE4_RGB8_OES = 35728; // 0x8b90
    field public static final int GL_PALETTE4_RGBA4_OES = 35731; // 0x8b93
    field public static final int GL_PALETTE4_RGBA8_OES = 35729; // 0x8b91
    field public static final int GL_PALETTE8_R5_G6_B5_OES = 35735; // 0x8b97
    field public static final int GL_PALETTE8_RGB5_A1_OES = 35737; // 0x8b99
    field public static final int GL_PALETTE8_RGB8_OES = 35733; // 0x8b95
    field public static final int GL_PALETTE8_RGBA4_OES = 35736; // 0x8b98
    field public static final int GL_PALETTE8_RGBA8_OES = 35734; // 0x8b96
    field public static final int GL_PERSPECTIVE_CORRECTION_HINT = 3152; // 0xc50
    field public static final int GL_POINTS = 0; // 0x0
    field public static final int GL_POINT_FADE_THRESHOLD_SIZE = 33064; // 0x8128
    field public static final int GL_POINT_SIZE = 2833; // 0xb11
    field public static final int GL_POINT_SMOOTH = 2832; // 0xb10
    field public static final int GL_POINT_SMOOTH_HINT = 3153; // 0xc51
    field public static final int GL_POLYGON_OFFSET_FILL = 32823; // 0x8037
    field public static final int GL_POLYGON_SMOOTH_HINT = 3155; // 0xc53
    field public static final int GL_POSITION = 4611; // 0x1203
    field public static final int GL_PROJECTION = 5889; // 0x1701
    field public static final int GL_QUADRATIC_ATTENUATION = 4617; // 0x1209
    field public static final int GL_RED_BITS = 3410; // 0xd52
    field public static final int GL_RENDERER = 7937; // 0x1f01
    field public static final int GL_REPEAT = 10497; // 0x2901
    field public static final int GL_REPLACE = 7681; // 0x1e01
    field public static final int GL_RESCALE_NORMAL = 32826; // 0x803a
    field public static final int GL_RGB = 6407; // 0x1907
    field public static final int GL_RGBA = 6408; // 0x1908
    field public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 32926; // 0x809e
    field public static final int GL_SAMPLE_ALPHA_TO_ONE = 32927; // 0x809f
    field public static final int GL_SAMPLE_COVERAGE = 32928; // 0x80a0
    field public static final int GL_SCISSOR_TEST = 3089; // 0xc11
    field public static final int GL_SET = 5391; // 0x150f
    field public static final int GL_SHININESS = 5633; // 0x1601
    field public static final int GL_SHORT = 5122; // 0x1402
    field public static final int GL_SMOOTH = 7425; // 0x1d01
    field public static final int GL_SMOOTH_LINE_WIDTH_RANGE = 2850; // 0xb22
    field public static final int GL_SMOOTH_POINT_SIZE_RANGE = 2834; // 0xb12
    field public static final int GL_SPECULAR = 4610; // 0x1202
    field public static final int GL_SPOT_CUTOFF = 4614; // 0x1206
    field public static final int GL_SPOT_DIRECTION = 4612; // 0x1204
    field public static final int GL_SPOT_EXPONENT = 4613; // 0x1205
    field public static final int GL_SRC_ALPHA = 770; // 0x302
    field public static final int GL_SRC_ALPHA_SATURATE = 776; // 0x308
    field public static final int GL_SRC_COLOR = 768; // 0x300
    field public static final int GL_STACK_OVERFLOW = 1283; // 0x503
    field public static final int GL_STACK_UNDERFLOW = 1284; // 0x504
    field public static final int GL_STENCIL_BITS = 3415; // 0xd57
    field public static final int GL_STENCIL_BUFFER_BIT = 1024; // 0x400
    field public static final int GL_STENCIL_TEST = 2960; // 0xb90
    field public static final int GL_SUBPIXEL_BITS = 3408; // 0xd50
    field public static final int GL_TEXTURE = 5890; // 0x1702
    field public static final int GL_TEXTURE0 = 33984; // 0x84c0
    field public static final int GL_TEXTURE1 = 33985; // 0x84c1
    field public static final int GL_TEXTURE10 = 33994; // 0x84ca
    field public static final int GL_TEXTURE11 = 33995; // 0x84cb
    field public static final int GL_TEXTURE12 = 33996; // 0x84cc
    field public static final int GL_TEXTURE13 = 33997; // 0x84cd
    field public static final int GL_TEXTURE14 = 33998; // 0x84ce
    field public static final int GL_TEXTURE15 = 33999; // 0x84cf
    field public static final int GL_TEXTURE16 = 34000; // 0x84d0
    field public static final int GL_TEXTURE17 = 34001; // 0x84d1
    field public static final int GL_TEXTURE18 = 34002; // 0x84d2
    field public static final int GL_TEXTURE19 = 34003; // 0x84d3
    field public static final int GL_TEXTURE2 = 33986; // 0x84c2
    field public static final int GL_TEXTURE20 = 34004; // 0x84d4
    field public static final int GL_TEXTURE21 = 34005; // 0x84d5
    field public static final int GL_TEXTURE22 = 34006; // 0x84d6
    field public static final int GL_TEXTURE23 = 34007; // 0x84d7
    field public static final int GL_TEXTURE24 = 34008; // 0x84d8
    field public static final int GL_TEXTURE25 = 34009; // 0x84d9
    field public static final int GL_TEXTURE26 = 34010; // 0x84da
    field public static final int GL_TEXTURE27 = 34011; // 0x84db
    field public static final int GL_TEXTURE28 = 34012; // 0x84dc
    field public static final int GL_TEXTURE29 = 34013; // 0x84dd
    field public static final int GL_TEXTURE3 = 33987; // 0x84c3
    field public static final int GL_TEXTURE30 = 34014; // 0x84de
    field public static final int GL_TEXTURE31 = 34015; // 0x84df
    field public static final int GL_TEXTURE4 = 33988; // 0x84c4
    field public static final int GL_TEXTURE5 = 33989; // 0x84c5
    field public static final int GL_TEXTURE6 = 33990; // 0x84c6
    field public static final int GL_TEXTURE7 = 33991; // 0x84c7
    field public static final int GL_TEXTURE8 = 33992; // 0x84c8
    field public static final int GL_TEXTURE9 = 33993; // 0x84c9
    field public static final int GL_TEXTURE_2D = 3553; // 0xde1
    field public static final int GL_TEXTURE_COORD_ARRAY = 32888; // 0x8078
    field public static final int GL_TEXTURE_ENV = 8960; // 0x2300
    field public static final int GL_TEXTURE_ENV_COLOR = 8705; // 0x2201
    field public static final int GL_TEXTURE_ENV_MODE = 8704; // 0x2200
    field public static final int GL_TEXTURE_MAG_FILTER = 10240; // 0x2800
    field public static final int GL_TEXTURE_MIN_FILTER = 10241; // 0x2801
    field public static final int GL_TEXTURE_WRAP_S = 10242; // 0x2802
    field public static final int GL_TEXTURE_WRAP_T = 10243; // 0x2803
    field public static final int GL_TRIANGLES = 4; // 0x4
    field public static final int GL_TRIANGLE_FAN = 6; // 0x6
    field public static final int GL_TRIANGLE_STRIP = 5; // 0x5
    field public static final int GL_TRUE = 1; // 0x1
    field public static final int GL_UNPACK_ALIGNMENT = 3317; // 0xcf5
    field public static final int GL_UNSIGNED_BYTE = 5121; // 0x1401
    field public static final int GL_UNSIGNED_SHORT = 5123; // 0x1403
    field public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 32819; // 0x8033
    field public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 32820; // 0x8034
    field public static final int GL_UNSIGNED_SHORT_5_6_5 = 33635; // 0x8363
    field public static final int GL_VENDOR = 7936; // 0x1f00
    field public static final int GL_VERSION = 7938; // 0x1f02
    field public static final int GL_VERTEX_ARRAY = 32884; // 0x8074
    field public static final int GL_XOR = 5382; // 0x1506
    field public static final int GL_ZERO = 0; // 0x0
  }

  public interface GL10Ext extends javax.microedition.khronos.opengles.GL {
    method public int glQueryMatrixxOES(int[], int, int[], int);
    method public int glQueryMatrixxOES(java.nio.IntBuffer, java.nio.IntBuffer);
  }

  public interface GL11 extends javax.microedition.khronos.opengles.GL10 {
    method public void glBindBuffer(int, int);
    method public void glBufferData(int, int, java.nio.Buffer, int);
    method public void glBufferSubData(int, int, int, java.nio.Buffer);
    method public void glClipPlanef(int, float[], int);
    method public void glClipPlanef(int, java.nio.FloatBuffer);
    method public void glClipPlanex(int, int[], int);
    method public void glClipPlanex(int, java.nio.IntBuffer);
    method public void glColor4ub(byte, byte, byte, byte);
    method public void glColorPointer(int, int, int, int);
    method public void glDeleteBuffers(int, int[], int);
    method public void glDeleteBuffers(int, java.nio.IntBuffer);
    method public void glDrawElements(int, int, int, int);
    method public void glGenBuffers(int, int[], int);
    method public void glGenBuffers(int, java.nio.IntBuffer);
    method public void glGetBooleanv(int, boolean[], int);
    method public void glGetBooleanv(int, java.nio.IntBuffer);
    method public void glGetBufferParameteriv(int, int, int[], int);
    method public void glGetBufferParameteriv(int, int, java.nio.IntBuffer);
    method public void glGetClipPlanef(int, float[], int);
    method public void glGetClipPlanef(int, java.nio.FloatBuffer);
    method public void glGetClipPlanex(int, int[], int);
    method public void glGetClipPlanex(int, java.nio.IntBuffer);
    method public void glGetFixedv(int, int[], int);
    method public void glGetFixedv(int, java.nio.IntBuffer);
    method public void glGetFloatv(int, float[], int);
    method public void glGetFloatv(int, java.nio.FloatBuffer);
    method public void glGetLightfv(int, int, float[], int);
    method public void glGetLightfv(int, int, java.nio.FloatBuffer);
    method public void glGetLightxv(int, int, int[], int);
    method public void glGetLightxv(int, int, java.nio.IntBuffer);
    method public void glGetMaterialfv(int, int, float[], int);
    method public void glGetMaterialfv(int, int, java.nio.FloatBuffer);
    method public void glGetMaterialxv(int, int, int[], int);
    method public void glGetMaterialxv(int, int, java.nio.IntBuffer);
    method public void glGetPointerv(int, java.nio.Buffer[]);
    method public void glGetTexEnviv(int, int, int[], int);
    method public void glGetTexEnviv(int, int, java.nio.IntBuffer);
    method public void glGetTexEnvxv(int, int, int[], int);
    method public void glGetTexEnvxv(int, int, java.nio.IntBuffer);
    method public void glGetTexParameterfv(int, int, float[], int);
    method public void glGetTexParameterfv(int, int, java.nio.FloatBuffer);
    method public void glGetTexParameteriv(int, int, int[], int);
    method public void glGetTexParameteriv(int, int, java.nio.IntBuffer);
    method public void glGetTexParameterxv(int, int, int[], int);
    method public void glGetTexParameterxv(int, int, java.nio.IntBuffer);
    method public boolean glIsBuffer(int);
    method public boolean glIsEnabled(int);
    method public boolean glIsTexture(int);
    method public void glNormalPointer(int, int, int);
    method public void glPointParameterf(int, float);
    method public void glPointParameterfv(int, float[], int);
    method public void glPointParameterfv(int, java.nio.FloatBuffer);
    method public void glPointParameterx(int, int);
    method public void glPointParameterxv(int, int[], int);
    method public void glPointParameterxv(int, java.nio.IntBuffer);
    method public void glPointSizePointerOES(int, int, java.nio.Buffer);
    method public void glTexCoordPointer(int, int, int, int);
    method public void glTexEnvi(int, int, int);
    method public void glTexEnviv(int, int, int[], int);
    method public void glTexEnviv(int, int, java.nio.IntBuffer);
    method public void glTexParameterfv(int, int, float[], int);
    method public void glTexParameterfv(int, int, java.nio.FloatBuffer);
    method public void glTexParameteri(int, int, int);
    method public void glTexParameteriv(int, int, int[], int);
    method public void glTexParameteriv(int, int, java.nio.IntBuffer);
    method public void glTexParameterxv(int, int, int[], int);
    method public void glTexParameterxv(int, int, java.nio.IntBuffer);
    method public void glVertexPointer(int, int, int, int);
    field public static final int GL_ACTIVE_TEXTURE = 34016; // 0x84e0
    field public static final int GL_ADD_SIGNED = 34164; // 0x8574
    field public static final int GL_ALPHA_SCALE = 3356; // 0xd1c
    field public static final int GL_ALPHA_TEST_FUNC = 3009; // 0xbc1
    field public static final int GL_ALPHA_TEST_REF = 3010; // 0xbc2
    field public static final int GL_ARRAY_BUFFER = 34962; // 0x8892
    field public static final int GL_ARRAY_BUFFER_BINDING = 34964; // 0x8894
    field public static final int GL_BLEND_DST = 3040; // 0xbe0
    field public static final int GL_BLEND_SRC = 3041; // 0xbe1
    field public static final int GL_BUFFER_ACCESS = 35003; // 0x88bb
    field public static final int GL_BUFFER_SIZE = 34660; // 0x8764
    field public static final int GL_BUFFER_USAGE = 34661; // 0x8765
    field public static final int GL_CLIENT_ACTIVE_TEXTURE = 34017; // 0x84e1
    field public static final int GL_CLIP_PLANE0 = 12288; // 0x3000
    field public static final int GL_CLIP_PLANE1 = 12289; // 0x3001
    field public static final int GL_CLIP_PLANE2 = 12290; // 0x3002
    field public static final int GL_CLIP_PLANE3 = 12291; // 0x3003
    field public static final int GL_CLIP_PLANE4 = 12292; // 0x3004
    field public static final int GL_CLIP_PLANE5 = 12293; // 0x3005
    field public static final int GL_COLOR_ARRAY_BUFFER_BINDING = 34968; // 0x8898
    field public static final int GL_COLOR_ARRAY_POINTER = 32912; // 0x8090
    field public static final int GL_COLOR_ARRAY_SIZE = 32897; // 0x8081
    field public static final int GL_COLOR_ARRAY_STRIDE = 32899; // 0x8083
    field public static final int GL_COLOR_ARRAY_TYPE = 32898; // 0x8082
    field public static final int GL_COLOR_CLEAR_VALUE = 3106; // 0xc22
    field public static final int GL_COLOR_WRITEMASK = 3107; // 0xc23
    field public static final int GL_COMBINE = 34160; // 0x8570
    field public static final int GL_COMBINE_ALPHA = 34162; // 0x8572
    field public static final int GL_COMBINE_RGB = 34161; // 0x8571
    field public static final int GL_CONSTANT = 34166; // 0x8576
    field public static final int GL_COORD_REPLACE_OES = 34914; // 0x8862
    field public static final int GL_CULL_FACE_MODE = 2885; // 0xb45
    field public static final int GL_CURRENT_COLOR = 2816; // 0xb00
    field public static final int GL_CURRENT_NORMAL = 2818; // 0xb02
    field public static final int GL_CURRENT_TEXTURE_COORDS = 2819; // 0xb03
    field public static final int GL_DEPTH_CLEAR_VALUE = 2931; // 0xb73
    field public static final int GL_DEPTH_FUNC = 2932; // 0xb74
    field public static final int GL_DEPTH_RANGE = 2928; // 0xb70
    field public static final int GL_DEPTH_WRITEMASK = 2930; // 0xb72
    field public static final int GL_DOT3_RGB = 34478; // 0x86ae
    field public static final int GL_DOT3_RGBA = 34479; // 0x86af
    field public static final int GL_DYNAMIC_DRAW = 35048; // 0x88e8
    field public static final int GL_ELEMENT_ARRAY_BUFFER = 34963; // 0x8893
    field public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING = 34965; // 0x8895
    field public static final int GL_FRONT_FACE = 2886; // 0xb46
    field public static final int GL_GENERATE_MIPMAP = 33169; // 0x8191
    field public static final int GL_GENERATE_MIPMAP_HINT = 33170; // 0x8192
    field public static final int GL_INTERPOLATE = 34165; // 0x8575
    field public static final int GL_LINE_WIDTH = 2849; // 0xb21
    field public static final int GL_LOGIC_OP_MODE = 3056; // 0xbf0
    field public static final int GL_MATRIX_MODE = 2976; // 0xba0
    field public static final int GL_MAX_CLIP_PLANES = 3378; // 0xd32
    field public static final int GL_MODELVIEW_MATRIX = 2982; // 0xba6
    field public static final int GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES = 35213; // 0x898d
    field public static final int GL_MODELVIEW_STACK_DEPTH = 2979; // 0xba3
    field public static final int GL_NORMAL_ARRAY_BUFFER_BINDING = 34967; // 0x8897
    field public static final int GL_NORMAL_ARRAY_POINTER = 32911; // 0x808f
    field public static final int GL_NORMAL_ARRAY_STRIDE = 32895; // 0x807f
    field public static final int GL_NORMAL_ARRAY_TYPE = 32894; // 0x807e
    field public static final int GL_OPERAND0_ALPHA = 34200; // 0x8598
    field public static final int GL_OPERAND0_RGB = 34192; // 0x8590
    field public static final int GL_OPERAND1_ALPHA = 34201; // 0x8599
    field public static final int GL_OPERAND1_RGB = 34193; // 0x8591
    field public static final int GL_OPERAND2_ALPHA = 34202; // 0x859a
    field public static final int GL_OPERAND2_RGB = 34194; // 0x8592
    field public static final int GL_POINT_DISTANCE_ATTENUATION = 33065; // 0x8129
    field public static final int GL_POINT_FADE_THRESHOLD_SIZE = 33064; // 0x8128
    field public static final int GL_POINT_SIZE = 2833; // 0xb11
    field public static final int GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES = 35743; // 0x8b9f
    field public static final int GL_POINT_SIZE_ARRAY_OES = 35740; // 0x8b9c
    field public static final int GL_POINT_SIZE_ARRAY_POINTER_OES = 35212; // 0x898c
    field public static final int GL_POINT_SIZE_ARRAY_STRIDE_OES = 35211; // 0x898b
    field public static final int GL_POINT_SIZE_ARRAY_TYPE_OES = 35210; // 0x898a
    field public static final int GL_POINT_SIZE_MAX = 33063; // 0x8127
    field public static final int GL_POINT_SIZE_MIN = 33062; // 0x8126
    field public static final int GL_POINT_SPRITE_OES = 34913; // 0x8861
    field public static final int GL_POLYGON_OFFSET_FACTOR = 32824; // 0x8038
    field public static final int GL_POLYGON_OFFSET_UNITS = 10752; // 0x2a00
    field public static final int GL_PREVIOUS = 34168; // 0x8578
    field public static final int GL_PRIMARY_COLOR = 34167; // 0x8577
    field public static final int GL_PROJECTION_MATRIX = 2983; // 0xba7
    field public static final int GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES = 35214; // 0x898e
    field public static final int GL_PROJECTION_STACK_DEPTH = 2980; // 0xba4
    field public static final int GL_RGB_SCALE = 34163; // 0x8573
    field public static final int GL_SAMPLES = 32937; // 0x80a9
    field public static final int GL_SAMPLE_BUFFERS = 32936; // 0x80a8
    field public static final int GL_SAMPLE_COVERAGE_INVERT = 32939; // 0x80ab
    field public static final int GL_SAMPLE_COVERAGE_VALUE = 32938; // 0x80aa
    field public static final int GL_SCISSOR_BOX = 3088; // 0xc10
    field public static final int GL_SHADE_MODEL = 2900; // 0xb54
    field public static final int GL_SRC0_ALPHA = 34184; // 0x8588
    field public static final int GL_SRC0_RGB = 34176; // 0x8580
    field public static final int GL_SRC1_ALPHA = 34185; // 0x8589
    field public static final int GL_SRC1_RGB = 34177; // 0x8581
    field public static final int GL_SRC2_ALPHA = 34186; // 0x858a
    field public static final int GL_SRC2_RGB = 34178; // 0x8582
    field public static final int GL_STATIC_DRAW = 35044; // 0x88e4
    field public static final int GL_STENCIL_CLEAR_VALUE = 2961; // 0xb91
    field public static final int GL_STENCIL_FAIL = 2964; // 0xb94
    field public static final int GL_STENCIL_FUNC = 2962; // 0xb92
    field public static final int GL_STENCIL_PASS_DEPTH_FAIL = 2965; // 0xb95
    field public static final int GL_STENCIL_PASS_DEPTH_PASS = 2966; // 0xb96
    field public static final int GL_STENCIL_REF = 2967; // 0xb97
    field public static final int GL_STENCIL_VALUE_MASK = 2963; // 0xb93
    field public static final int GL_STENCIL_WRITEMASK = 2968; // 0xb98
    field public static final int GL_SUBTRACT = 34023; // 0x84e7
    field public static final int GL_TEXTURE_BINDING_2D = 32873; // 0x8069
    field public static final int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 34970; // 0x889a
    field public static final int GL_TEXTURE_COORD_ARRAY_POINTER = 32914; // 0x8092
    field public static final int GL_TEXTURE_COORD_ARRAY_SIZE = 32904; // 0x8088
    field public static final int GL_TEXTURE_COORD_ARRAY_STRIDE = 32906; // 0x808a
    field public static final int GL_TEXTURE_COORD_ARRAY_TYPE = 32905; // 0x8089
    field public static final int GL_TEXTURE_MATRIX = 2984; // 0xba8
    field public static final int GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES = 35215; // 0x898f
    field public static final int GL_TEXTURE_STACK_DEPTH = 2981; // 0xba5
    field public static final int GL_VERTEX_ARRAY_BUFFER_BINDING = 34966; // 0x8896
    field public static final int GL_VERTEX_ARRAY_POINTER = 32910; // 0x808e
    field public static final int GL_VERTEX_ARRAY_SIZE = 32890; // 0x807a
    field public static final int GL_VERTEX_ARRAY_STRIDE = 32892; // 0x807c
    field public static final int GL_VERTEX_ARRAY_TYPE = 32891; // 0x807b
    field public static final int GL_VIEWPORT = 2978; // 0xba2
    field public static final int GL_WRITE_ONLY = 35001; // 0x88b9
  }

  public interface GL11Ext extends javax.microedition.khronos.opengles.GL {
    method public void glCurrentPaletteMatrixOES(int);
    method public void glDrawTexfOES(float, float, float, float, float);
    method public void glDrawTexfvOES(float[], int);
    method public void glDrawTexfvOES(java.nio.FloatBuffer);
    method public void glDrawTexiOES(int, int, int, int, int);
    method public void glDrawTexivOES(int[], int);
    method public void glDrawTexivOES(java.nio.IntBuffer);
    method public void glDrawTexsOES(short, short, short, short, short);
    method public void glDrawTexsvOES(short[], int);
    method public void glDrawTexsvOES(java.nio.ShortBuffer);
    method public void glDrawTexxOES(int, int, int, int, int);
    method public void glDrawTexxvOES(int[], int);
    method public void glDrawTexxvOES(java.nio.IntBuffer);
    method public void glEnable(int);
    method public void glEnableClientState(int);
    method public void glLoadPaletteFromModelViewMatrixOES();
    method public void glMatrixIndexPointerOES(int, int, int, java.nio.Buffer);
    method public void glMatrixIndexPointerOES(int, int, int, int);
    method public void glTexParameterfv(int, int, float[], int);
    method public void glWeightPointerOES(int, int, int, java.nio.Buffer);
    method public void glWeightPointerOES(int, int, int, int);
    field public static final int GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES = 35742; // 0x8b9e
    field public static final int GL_MATRIX_INDEX_ARRAY_OES = 34884; // 0x8844
    field public static final int GL_MATRIX_INDEX_ARRAY_POINTER_OES = 34889; // 0x8849
    field public static final int GL_MATRIX_INDEX_ARRAY_SIZE_OES = 34886; // 0x8846
    field public static final int GL_MATRIX_INDEX_ARRAY_STRIDE_OES = 34888; // 0x8848
    field public static final int GL_MATRIX_INDEX_ARRAY_TYPE_OES = 34887; // 0x8847
    field public static final int GL_MATRIX_PALETTE_OES = 34880; // 0x8840
    field public static final int GL_MAX_PALETTE_MATRICES_OES = 34882; // 0x8842
    field public static final int GL_MAX_VERTEX_UNITS_OES = 34468; // 0x86a4
    field public static final int GL_TEXTURE_CROP_RECT_OES = 35741; // 0x8b9d
    field public static final int GL_WEIGHT_ARRAY_BUFFER_BINDING_OES = 34974; // 0x889e
    field public static final int GL_WEIGHT_ARRAY_OES = 34477; // 0x86ad
    field public static final int GL_WEIGHT_ARRAY_POINTER_OES = 34476; // 0x86ac
    field public static final int GL_WEIGHT_ARRAY_SIZE_OES = 34475; // 0x86ab
    field public static final int GL_WEIGHT_ARRAY_STRIDE_OES = 34474; // 0x86aa
    field public static final int GL_WEIGHT_ARRAY_TYPE_OES = 34473; // 0x86a9
  }

  public interface GL11ExtensionPack extends javax.microedition.khronos.opengles.GL {
    method public void glBindFramebufferOES(int, int);
    method public void glBindRenderbufferOES(int, int);
    method public void glBindTexture(int, int);
    method public void glBlendEquation(int);
    method public void glBlendEquationSeparate(int, int);
    method public void glBlendFuncSeparate(int, int, int, int);
    method public int glCheckFramebufferStatusOES(int);
    method public void glCompressedTexImage2D(int, int, int, int, int, int, int, java.nio.Buffer);
    method public void glCopyTexImage2D(int, int, int, int, int, int, int, int);
    method public void glDeleteFramebuffersOES(int, int[], int);
    method public void glDeleteFramebuffersOES(int, java.nio.IntBuffer);
    method public void glDeleteRenderbuffersOES(int, int[], int);
    method public void glDeleteRenderbuffersOES(int, java.nio.IntBuffer);
    method public void glEnable(int);
    method public void glFramebufferRenderbufferOES(int, int, int, int);
    method public void glFramebufferTexture2DOES(int, int, int, int, int);
    method public void glGenFramebuffersOES(int, int[], int);
    method public void glGenFramebuffersOES(int, java.nio.IntBuffer);
    method public void glGenRenderbuffersOES(int, int[], int);
    method public void glGenRenderbuffersOES(int, java.nio.IntBuffer);
    method public void glGenerateMipmapOES(int);
    method public void glGetFramebufferAttachmentParameterivOES(int, int, int, int[], int);
    method public void glGetFramebufferAttachmentParameterivOES(int, int, int, java.nio.IntBuffer);
    method public void glGetIntegerv(int, int[], int);
    method public void glGetIntegerv(int, java.nio.IntBuffer);
    method public void glGetRenderbufferParameterivOES(int, int, int[], int);
    method public void glGetRenderbufferParameterivOES(int, int, java.nio.IntBuffer);
    method public void glGetTexGenfv(int, int, float[], int);
    method public void glGetTexGenfv(int, int, java.nio.FloatBuffer);
    method public void glGetTexGeniv(int, int, int[], int);
    method public void glGetTexGeniv(int, int, java.nio.IntBuffer);
    method public void glGetTexGenxv(int, int, int[], int);
    method public void glGetTexGenxv(int, int, java.nio.IntBuffer);
    method public boolean glIsFramebufferOES(int);
    method public boolean glIsRenderbufferOES(int);
    method public void glRenderbufferStorageOES(int, int, int, int);
    method public void glStencilOp(int, int, int);
    method public void glTexEnvf(int, int, float);
    method public void glTexEnvfv(int, int, float[], int);
    method public void glTexEnvfv(int, int, java.nio.FloatBuffer);
    method public void glTexEnvx(int, int, int);
    method public void glTexEnvxv(int, int, int[], int);
    method public void glTexEnvxv(int, int, java.nio.IntBuffer);
    method public void glTexGenf(int, int, float);
    method public void glTexGenfv(int, int, float[], int);
    method public void glTexGenfv(int, int, java.nio.FloatBuffer);
    method public void glTexGeni(int, int, int);
    method public void glTexGeniv(int, int, int[], int);
    method public void glTexGeniv(int, int, java.nio.IntBuffer);
    method public void glTexGenx(int, int, int);
    method public void glTexGenxv(int, int, int[], int);
    method public void glTexGenxv(int, int, java.nio.IntBuffer);
    method public void glTexParameterf(int, int, float);
    field public static final int GL_BLEND_DST_ALPHA = 32970; // 0x80ca
    field public static final int GL_BLEND_DST_RGB = 32968; // 0x80c8
    field public static final int GL_BLEND_EQUATION = 32777; // 0x8009
    field public static final int GL_BLEND_EQUATION_ALPHA = 34877; // 0x883d
    field public static final int GL_BLEND_EQUATION_RGB = 32777; // 0x8009
    field public static final int GL_BLEND_SRC_ALPHA = 32971; // 0x80cb
    field public static final int GL_BLEND_SRC_RGB = 32969; // 0x80c9
    field public static final int GL_COLOR_ATTACHMENT0_OES = 36064; // 0x8ce0
    field public static final int GL_COLOR_ATTACHMENT10_OES = 36074; // 0x8cea
    field public static final int GL_COLOR_ATTACHMENT11_OES = 36075; // 0x8ceb
    field public static final int GL_COLOR_ATTACHMENT12_OES = 36076; // 0x8cec
    field public static final int GL_COLOR_ATTACHMENT13_OES = 36077; // 0x8ced
    field public static final int GL_COLOR_ATTACHMENT14_OES = 36078; // 0x8cee
    field public static final int GL_COLOR_ATTACHMENT15_OES = 36079; // 0x8cef
    field public static final int GL_COLOR_ATTACHMENT1_OES = 36065; // 0x8ce1
    field public static final int GL_COLOR_ATTACHMENT2_OES = 36066; // 0x8ce2
    field public static final int GL_COLOR_ATTACHMENT3_OES = 36067; // 0x8ce3
    field public static final int GL_COLOR_ATTACHMENT4_OES = 36068; // 0x8ce4
    field public static final int GL_COLOR_ATTACHMENT5_OES = 36069; // 0x8ce5
    field public static final int GL_COLOR_ATTACHMENT6_OES = 36070; // 0x8ce6
    field public static final int GL_COLOR_ATTACHMENT7_OES = 36071; // 0x8ce7
    field public static final int GL_COLOR_ATTACHMENT8_OES = 36072; // 0x8ce8
    field public static final int GL_COLOR_ATTACHMENT9_OES = 36073; // 0x8ce9
    field public static final int GL_DECR_WRAP = 34056; // 0x8508
    field public static final int GL_DEPTH_ATTACHMENT_OES = 36096; // 0x8d00
    field public static final int GL_DEPTH_COMPONENT = 6402; // 0x1902
    field public static final int GL_DEPTH_COMPONENT16 = 33189; // 0x81a5
    field public static final int GL_DEPTH_COMPONENT24 = 33190; // 0x81a6
    field public static final int GL_DEPTH_COMPONENT32 = 33191; // 0x81a7
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES = 36049; // 0x8cd1
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES = 36048; // 0x8cd0
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES = 36051; // 0x8cd3
    field public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES = 36050; // 0x8cd2
    field public static final int GL_FRAMEBUFFER_BINDING_OES = 36006; // 0x8ca6
    field public static final int GL_FRAMEBUFFER_COMPLETE_OES = 36053; // 0x8cd5
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES = 36054; // 0x8cd6
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES = 36057; // 0x8cd9
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES = 36059; // 0x8cdb
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES = 36058; // 0x8cda
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES = 36055; // 0x8cd7
    field public static final int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES = 36060; // 0x8cdc
    field public static final int GL_FRAMEBUFFER_OES = 36160; // 0x8d40
    field public static final int GL_FRAMEBUFFER_UNSUPPORTED_OES = 36061; // 0x8cdd
    field public static final int GL_FUNC_ADD = 32774; // 0x8006
    field public static final int GL_FUNC_REVERSE_SUBTRACT = 32779; // 0x800b
    field public static final int GL_FUNC_SUBTRACT = 32778; // 0x800a
    field public static final int GL_INCR_WRAP = 34055; // 0x8507
    field public static final int GL_INVALID_FRAMEBUFFER_OPERATION_OES = 1286; // 0x506
    field public static final int GL_MAX_COLOR_ATTACHMENTS_OES = 36063; // 0x8cdf
    field public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 34076; // 0x851c
    field public static final int GL_MAX_RENDERBUFFER_SIZE_OES = 34024; // 0x84e8
    field public static final int GL_MIRRORED_REPEAT = 33648; // 0x8370
    field public static final int GL_NORMAL_MAP = 34065; // 0x8511
    field public static final int GL_REFLECTION_MAP = 34066; // 0x8512
    field public static final int GL_RENDERBUFFER_ALPHA_SIZE_OES = 36179; // 0x8d53
    field public static final int GL_RENDERBUFFER_BINDING_OES = 36007; // 0x8ca7
    field public static final int GL_RENDERBUFFER_BLUE_SIZE_OES = 36178; // 0x8d52
    field public static final int GL_RENDERBUFFER_DEPTH_SIZE_OES = 36180; // 0x8d54
    field public static final int GL_RENDERBUFFER_GREEN_SIZE_OES = 36177; // 0x8d51
    field public static final int GL_RENDERBUFFER_HEIGHT_OES = 36163; // 0x8d43
    field public static final int GL_RENDERBUFFER_INTERNAL_FORMAT_OES = 36164; // 0x8d44
    field public static final int GL_RENDERBUFFER_OES = 36161; // 0x8d41
    field public static final int GL_RENDERBUFFER_RED_SIZE_OES = 36176; // 0x8d50
    field public static final int GL_RENDERBUFFER_STENCIL_SIZE_OES = 36181; // 0x8d55
    field public static final int GL_RENDERBUFFER_WIDTH_OES = 36162; // 0x8d42
    field public static final int GL_RGB565_OES = 36194; // 0x8d62
    field public static final int GL_RGB5_A1 = 32855; // 0x8057
    field public static final int GL_RGB8 = 32849; // 0x8051
    field public static final int GL_RGBA4 = 32854; // 0x8056
    field public static final int GL_RGBA8 = 32856; // 0x8058
    field public static final int GL_STENCIL_ATTACHMENT_OES = 36128; // 0x8d20
    field public static final int GL_STENCIL_INDEX = 6401; // 0x1901
    field public static final int GL_STENCIL_INDEX1_OES = 36166; // 0x8d46
    field public static final int GL_STENCIL_INDEX4_OES = 36167; // 0x8d47
    field public static final int GL_STENCIL_INDEX8_OES = 36168; // 0x8d48
    field public static final int GL_STR = -1; // 0xffffffff
    field public static final int GL_TEXTURE_BINDING_CUBE_MAP = 34068; // 0x8514
    field public static final int GL_TEXTURE_CUBE_MAP = 34067; // 0x8513
    field public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 34070; // 0x8516
    field public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072; // 0x8518
    field public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074; // 0x851a
    field public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 34069; // 0x8515
    field public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 34071; // 0x8517
    field public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 34073; // 0x8519
    field public static final int GL_TEXTURE_GEN_MODE = 9472; // 0x2500
    field public static final int GL_TEXTURE_GEN_STR = 36192; // 0x8d60
  }

}

package javax.net {

  public abstract class ServerSocketFactory {
    ctor protected ServerSocketFactory();
    method public java.net.ServerSocket createServerSocket() throws java.io.IOException;
    method public abstract java.net.ServerSocket createServerSocket(int) throws java.io.IOException;
    method public abstract java.net.ServerSocket createServerSocket(int, int) throws java.io.IOException;
    method public abstract java.net.ServerSocket createServerSocket(int, int, java.net.InetAddress) throws java.io.IOException;
    method public static javax.net.ServerSocketFactory getDefault();
  }

  public abstract class SocketFactory {
    ctor protected SocketFactory();
    method public java.net.Socket createSocket() throws java.io.IOException;
    method public abstract java.net.Socket createSocket(String, int) throws java.io.IOException, java.net.UnknownHostException;
    method public abstract java.net.Socket createSocket(String, int, java.net.InetAddress, int) throws java.io.IOException, java.net.UnknownHostException;
    method public abstract java.net.Socket createSocket(java.net.InetAddress, int) throws java.io.IOException;
    method public abstract java.net.Socket createSocket(java.net.InetAddress, int, java.net.InetAddress, int) throws java.io.IOException;
    method public static javax.net.SocketFactory getDefault();
  }

}

package javax.net.ssl {

  public class CertPathTrustManagerParameters implements javax.net.ssl.ManagerFactoryParameters {
    ctor public CertPathTrustManagerParameters(java.security.cert.CertPathParameters);
    method public java.security.cert.CertPathParameters getParameters();
  }

  public abstract class ExtendedSSLSession implements javax.net.ssl.SSLSession {
    ctor public ExtendedSSLSession();
    method public abstract String[] getLocalSupportedSignatureAlgorithms();
    method public abstract String[] getPeerSupportedSignatureAlgorithms();
    method public java.util.List<javax.net.ssl.SNIServerName> getRequestedServerNames();
  }

  public class HandshakeCompletedEvent extends java.util.EventObject {
    ctor public HandshakeCompletedEvent(javax.net.ssl.SSLSocket, javax.net.ssl.SSLSession);
    method public String getCipherSuite();
    method public java.security.cert.Certificate[] getLocalCertificates();
    method public java.security.Principal getLocalPrincipal();
    method public javax.security.cert.X509Certificate[] getPeerCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedException;
    method public java.security.cert.Certificate[] getPeerCertificates() throws javax.net.ssl.SSLPeerUnverifiedException;
    method public java.security.Principal getPeerPrincipal() throws javax.net.ssl.SSLPeerUnverifiedException;
    method public javax.net.ssl.SSLSession getSession();
    method public javax.net.ssl.SSLSocket getSocket();
  }

  public interface HandshakeCompletedListener extends java.util.EventListener {
    method public void handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent);
  }

  public interface HostnameVerifier {
    method public boolean verify(String, javax.net.ssl.SSLSession);
  }

  public abstract class HttpsURLConnection extends java.net.HttpURLConnection {
    ctor protected HttpsURLConnection(java.net.URL);
    method public abstract String getCipherSuite();
    method public static javax.net.ssl.HostnameVerifier getDefaultHostnameVerifier();
    method public static javax.net.ssl.SSLSocketFactory getDefaultSSLSocketFactory();
    method public javax.net.ssl.HostnameVerifier getHostnameVerifier();
    method public abstract java.security.cert.Certificate[] getLocalCertificates();
    method public java.security.Principal getLocalPrincipal();
    method public java.security.Principal getPeerPrincipal() throws javax.net.ssl.SSLPeerUnverifiedException;
    method public javax.net.ssl.SSLSocketFactory getSSLSocketFactory();
    method public abstract java.security.cert.Certificate[] getServerCertificates() throws javax.net.ssl.SSLPeerUnverifiedException;
    method public static void setDefaultHostnameVerifier(javax.net.ssl.HostnameVerifier);
    method public static void setDefaultSSLSocketFactory(javax.net.ssl.SSLSocketFactory);
    method public void setHostnameVerifier(javax.net.ssl.HostnameVerifier);
    method public void setSSLSocketFactory(javax.net.ssl.SSLSocketFactory);
    field protected javax.net.ssl.HostnameVerifier hostnameVerifier;
  }

  public interface KeyManager {
  }

  public class KeyManagerFactory {
    ctor protected KeyManagerFactory(javax.net.ssl.KeyManagerFactorySpi, java.security.Provider, String);
    method public final String getAlgorithm();
    method public static final String getDefaultAlgorithm();
    method public static final javax.net.ssl.KeyManagerFactory getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.net.ssl.KeyManagerFactory getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.net.ssl.KeyManagerFactory getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final javax.net.ssl.KeyManager[] getKeyManagers();
    method public final java.security.Provider getProvider();
    method public final void init(java.security.KeyStore, char[]) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    method public final void init(javax.net.ssl.ManagerFactoryParameters) throws java.security.InvalidAlgorithmParameterException;
  }

  public abstract class KeyManagerFactorySpi {
    ctor public KeyManagerFactorySpi();
    method protected abstract javax.net.ssl.KeyManager[] engineGetKeyManagers();
    method protected abstract void engineInit(java.security.KeyStore, char[]) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    method protected abstract void engineInit(javax.net.ssl.ManagerFactoryParameters) throws java.security.InvalidAlgorithmParameterException;
  }

  public class KeyStoreBuilderParameters implements javax.net.ssl.ManagerFactoryParameters {
    ctor public KeyStoreBuilderParameters(java.security.KeyStore.Builder);
    ctor public KeyStoreBuilderParameters(java.util.List<java.security.KeyStore.Builder>);
    method public java.util.List<java.security.KeyStore.Builder> getParameters();
  }

  public interface ManagerFactoryParameters {
  }

  public final class SNIHostName extends javax.net.ssl.SNIServerName {
    ctor public SNIHostName(String);
    ctor public SNIHostName(byte[]);
    method public static javax.net.ssl.SNIMatcher createSNIMatcher(String);
    method public String getAsciiName();
  }

  public abstract class SNIMatcher {
    ctor protected SNIMatcher(int);
    method public final int getType();
    method public abstract boolean matches(javax.net.ssl.SNIServerName);
  }

  public abstract class SNIServerName {
    ctor protected SNIServerName(int, byte[]);
    method public final byte[] getEncoded();
    method public final int getType();
  }

  public class SSLContext {
    ctor protected SSLContext(javax.net.ssl.SSLContextSpi, java.security.Provider, String);
    method public final javax.net.ssl.SSLEngine createSSLEngine();
    method public final javax.net.ssl.SSLEngine createSSLEngine(String, int);
    method public final javax.net.ssl.SSLSessionContext getClientSessionContext();
    method public static javax.net.ssl.SSLContext getDefault() throws java.security.NoSuchAlgorithmException;
    method public final javax.net.ssl.SSLParameters getDefaultSSLParameters();
    method public static javax.net.ssl.SSLContext getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static javax.net.ssl.SSLContext getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static javax.net.ssl.SSLContext getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final String getProtocol();
    method public final java.security.Provider getProvider();
    method public final javax.net.ssl.SSLSessionContext getServerSessionContext();
    method public final javax.net.ssl.SSLServerSocketFactory getServerSocketFactory();
    method public final javax.net.ssl.SSLSocketFactory getSocketFactory();
    method public final javax.net.ssl.SSLParameters getSupportedSSLParameters();
    method public final void init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], java.security.SecureRandom) throws java.security.KeyManagementException;
    method public static void setDefault(javax.net.ssl.SSLContext);
  }

  public abstract class SSLContextSpi {
    ctor public SSLContextSpi();
    method protected abstract javax.net.ssl.SSLEngine engineCreateSSLEngine();
    method protected abstract javax.net.ssl.SSLEngine engineCreateSSLEngine(String, int);
    method protected abstract javax.net.ssl.SSLSessionContext engineGetClientSessionContext();
    method protected javax.net.ssl.SSLParameters engineGetDefaultSSLParameters();
    method protected abstract javax.net.ssl.SSLSessionContext engineGetServerSessionContext();
    method protected abstract javax.net.ssl.SSLServerSocketFactory engineGetServerSocketFactory();
    method protected abstract javax.net.ssl.SSLSocketFactory engineGetSocketFactory();
    method protected javax.net.ssl.SSLParameters engineGetSupportedSSLParameters();
    method protected abstract void engineInit(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], java.security.SecureRandom) throws java.security.KeyManagementException;
  }

  public abstract class SSLEngine {
    ctor protected SSLEngine();
    ctor protected SSLEngine(String, int);
    method public abstract void beginHandshake() throws javax.net.ssl.SSLException;
    method public abstract void closeInbound() throws javax.net.ssl.SSLException;
    method public abstract void closeOutbound();
    method public String getApplicationProtocol();
    method public abstract Runnable getDelegatedTask();
    method public abstract boolean getEnableSessionCreation();
    method public abstract String[] getEnabledCipherSuites();
    method public abstract String[] getEnabledProtocols();
    method public String getHandshakeApplicationProtocol();
    method public java.util.function.BiFunction<javax.net.ssl.SSLEngine,java.util.List<java.lang.String>,java.lang.String> getHandshakeApplicationProtocolSelector();
    method public javax.net.ssl.SSLSession getHandshakeSession();
    method public abstract javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus();
    method public abstract boolean getNeedClientAuth();
    method public String getPeerHost();
    method public int getPeerPort();
    method public javax.net.ssl.SSLParameters getSSLParameters();
    method public abstract javax.net.ssl.SSLSession getSession();
    method public abstract String[] getSupportedCipherSuites();
    method public abstract String[] getSupportedProtocols();
    method public abstract boolean getUseClientMode();
    method public abstract boolean getWantClientAuth();
    method public abstract boolean isInboundDone();
    method public abstract boolean isOutboundDone();
    method public abstract void setEnableSessionCreation(boolean);
    method public abstract void setEnabledCipherSuites(String[]);
    method public abstract void setEnabledProtocols(String[]);
    method public void setHandshakeApplicationProtocolSelector(java.util.function.BiFunction<javax.net.ssl.SSLEngine,java.util.List<java.lang.String>,java.lang.String>);
    method public abstract void setNeedClientAuth(boolean);
    method public void setSSLParameters(javax.net.ssl.SSLParameters);
    method public abstract void setUseClientMode(boolean);
    method public abstract void setWantClientAuth(boolean);
    method public javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer, java.nio.ByteBuffer) throws javax.net.ssl.SSLException;
    method public javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer, java.nio.ByteBuffer[]) throws javax.net.ssl.SSLException;
    method public abstract javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer, java.nio.ByteBuffer[], int, int) throws javax.net.ssl.SSLException;
    method public javax.net.ssl.SSLEngineResult wrap(java.nio.ByteBuffer, java.nio.ByteBuffer) throws javax.net.ssl.SSLException;
    method public javax.net.ssl.SSLEngineResult wrap(java.nio.ByteBuffer[], java.nio.ByteBuffer) throws javax.net.ssl.SSLException;
    method public abstract javax.net.ssl.SSLEngineResult wrap(java.nio.ByteBuffer[], int, int, java.nio.ByteBuffer) throws javax.net.ssl.SSLException;
  }

  public class SSLEngineResult {
    ctor public SSLEngineResult(javax.net.ssl.SSLEngineResult.Status, javax.net.ssl.SSLEngineResult.HandshakeStatus, int, int);
    method public final int bytesConsumed();
    method public final int bytesProduced();
    method public final javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus();
    method public final javax.net.ssl.SSLEngineResult.Status getStatus();
  }

  public enum SSLEngineResult.HandshakeStatus {
    enum_constant public static final javax.net.ssl.SSLEngineResult.HandshakeStatus FINISHED;
    enum_constant public static final javax.net.ssl.SSLEngineResult.HandshakeStatus NEED_TASK;
    enum_constant public static final javax.net.ssl.SSLEngineResult.HandshakeStatus NEED_UNWRAP;
    enum_constant public static final javax.net.ssl.SSLEngineResult.HandshakeStatus NEED_WRAP;
    enum_constant public static final javax.net.ssl.SSLEngineResult.HandshakeStatus NOT_HANDSHAKING;
  }

  public enum SSLEngineResult.Status {
    enum_constant public static final javax.net.ssl.SSLEngineResult.Status BUFFER_OVERFLOW;
    enum_constant public static final javax.net.ssl.SSLEngineResult.Status BUFFER_UNDERFLOW;
    enum_constant public static final javax.net.ssl.SSLEngineResult.Status CLOSED;
    enum_constant public static final javax.net.ssl.SSLEngineResult.Status OK;
  }

  public class SSLException extends java.io.IOException {
    ctor public SSLException(String);
    ctor public SSLException(String, Throwable);
    ctor public SSLException(Throwable);
  }

  public class SSLHandshakeException extends javax.net.ssl.SSLException {
    ctor public SSLHandshakeException(String);
  }

  public class SSLKeyException extends javax.net.ssl.SSLException {
    ctor public SSLKeyException(String);
  }

  public class SSLParameters {
    ctor public SSLParameters();
    ctor public SSLParameters(String[]);
    ctor public SSLParameters(String[], String[]);
    method public java.security.AlgorithmConstraints getAlgorithmConstraints();
    method public String[] getApplicationProtocols();
    method public String[] getCipherSuites();
    method public String getEndpointIdentificationAlgorithm();
    method public boolean getNeedClientAuth();
    method public String[] getProtocols();
    method public final java.util.Collection<javax.net.ssl.SNIMatcher> getSNIMatchers();
    method public final java.util.List<javax.net.ssl.SNIServerName> getServerNames();
    method public final boolean getUseCipherSuitesOrder();
    method public boolean getWantClientAuth();
    method public void setAlgorithmConstraints(java.security.AlgorithmConstraints);
    method public void setApplicationProtocols(String[]);
    method public void setCipherSuites(String[]);
    method public void setEndpointIdentificationAlgorithm(String);
    method public void setNeedClientAuth(boolean);
    method public void setProtocols(String[]);
    method public final void setSNIMatchers(java.util.Collection<javax.net.ssl.SNIMatcher>);
    method public final void setServerNames(java.util.List<javax.net.ssl.SNIServerName>);
    method public final void setUseCipherSuitesOrder(boolean);
    method public void setWantClientAuth(boolean);
  }

  public class SSLPeerUnverifiedException extends javax.net.ssl.SSLException {
    ctor public SSLPeerUnverifiedException(String);
  }

  public final class SSLPermission extends java.security.BasicPermission {
    ctor public SSLPermission(String);
    ctor public SSLPermission(String, String);
  }

  public class SSLProtocolException extends javax.net.ssl.SSLException {
    ctor public SSLProtocolException(String);
  }

  public abstract class SSLServerSocket extends java.net.ServerSocket {
    ctor protected SSLServerSocket() throws java.io.IOException;
    ctor protected SSLServerSocket(int) throws java.io.IOException;
    ctor protected SSLServerSocket(int, int) throws java.io.IOException;
    ctor protected SSLServerSocket(int, int, java.net.InetAddress) throws java.io.IOException;
    method public abstract boolean getEnableSessionCreation();
    method public abstract String[] getEnabledCipherSuites();
    method public abstract String[] getEnabledProtocols();
    method public abstract boolean getNeedClientAuth();
    method public javax.net.ssl.SSLParameters getSSLParameters();
    method public abstract String[] getSupportedCipherSuites();
    method public abstract String[] getSupportedProtocols();
    method public abstract boolean getUseClientMode();
    method public abstract boolean getWantClientAuth();
    method public abstract void setEnableSessionCreation(boolean);
    method public abstract void setEnabledCipherSuites(String[]);
    method public abstract void setEnabledProtocols(String[]);
    method public abstract void setNeedClientAuth(boolean);
    method public void setSSLParameters(javax.net.ssl.SSLParameters);
    method public abstract void setUseClientMode(boolean);
    method public abstract void setWantClientAuth(boolean);
  }

  public abstract class SSLServerSocketFactory extends javax.net.ServerSocketFactory {
    ctor protected SSLServerSocketFactory();
    method public static javax.net.ServerSocketFactory getDefault();
    method public abstract String[] getDefaultCipherSuites();
    method public abstract String[] getSupportedCipherSuites();
  }

  public interface SSLSession {
    method public int getApplicationBufferSize();
    method public String getCipherSuite();
    method public long getCreationTime();
    method public byte[] getId();
    method public long getLastAccessedTime();
    method public java.security.cert.Certificate[] getLocalCertificates();
    method public java.security.Principal getLocalPrincipal();
    method public int getPacketBufferSize();
    method public javax.security.cert.X509Certificate[] getPeerCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedException;
    method public java.security.cert.Certificate[] getPeerCertificates() throws javax.net.ssl.SSLPeerUnverifiedException;
    method public String getPeerHost();
    method public int getPeerPort();
    method public java.security.Principal getPeerPrincipal() throws javax.net.ssl.SSLPeerUnverifiedException;
    method public String getProtocol();
    method public javax.net.ssl.SSLSessionContext getSessionContext();
    method public Object getValue(String);
    method public String[] getValueNames();
    method public void invalidate();
    method public boolean isValid();
    method public void putValue(String, Object);
    method public void removeValue(String);
  }

  public class SSLSessionBindingEvent extends java.util.EventObject {
    ctor public SSLSessionBindingEvent(javax.net.ssl.SSLSession, String);
    method public String getName();
    method public javax.net.ssl.SSLSession getSession();
  }

  public interface SSLSessionBindingListener extends java.util.EventListener {
    method public void valueBound(javax.net.ssl.SSLSessionBindingEvent);
    method public void valueUnbound(javax.net.ssl.SSLSessionBindingEvent);
  }

  public interface SSLSessionContext {
    method public java.util.Enumeration<byte[]> getIds();
    method public javax.net.ssl.SSLSession getSession(byte[]);
    method public int getSessionCacheSize();
    method public int getSessionTimeout();
    method public void setSessionCacheSize(int) throws java.lang.IllegalArgumentException;
    method public void setSessionTimeout(int) throws java.lang.IllegalArgumentException;
  }

  public abstract class SSLSocket extends java.net.Socket {
    ctor protected SSLSocket();
    ctor protected SSLSocket(String, int) throws java.io.IOException, java.net.UnknownHostException;
    ctor protected SSLSocket(java.net.InetAddress, int) throws java.io.IOException;
    ctor protected SSLSocket(String, int, java.net.InetAddress, int) throws java.io.IOException, java.net.UnknownHostException;
    ctor protected SSLSocket(java.net.InetAddress, int, java.net.InetAddress, int) throws java.io.IOException;
    method public abstract void addHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener);
    method public String getApplicationProtocol();
    method public abstract boolean getEnableSessionCreation();
    method public abstract String[] getEnabledCipherSuites();
    method public abstract String[] getEnabledProtocols();
    method public String getHandshakeApplicationProtocol();
    method public java.util.function.BiFunction<javax.net.ssl.SSLSocket,java.util.List<java.lang.String>,java.lang.String> getHandshakeApplicationProtocolSelector();
    method public javax.net.ssl.SSLSession getHandshakeSession();
    method public abstract boolean getNeedClientAuth();
    method public javax.net.ssl.SSLParameters getSSLParameters();
    method public abstract javax.net.ssl.SSLSession getSession();
    method public abstract String[] getSupportedCipherSuites();
    method public abstract String[] getSupportedProtocols();
    method public abstract boolean getUseClientMode();
    method public abstract boolean getWantClientAuth();
    method public abstract void removeHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener);
    method public abstract void setEnableSessionCreation(boolean);
    method public abstract void setEnabledCipherSuites(String[]);
    method public abstract void setEnabledProtocols(String[]);
    method public void setHandshakeApplicationProtocolSelector(java.util.function.BiFunction<javax.net.ssl.SSLSocket,java.util.List<java.lang.String>,java.lang.String>);
    method public abstract void setNeedClientAuth(boolean);
    method public void setSSLParameters(javax.net.ssl.SSLParameters);
    method public abstract void setUseClientMode(boolean);
    method public abstract void setWantClientAuth(boolean);
    method public abstract void startHandshake() throws java.io.IOException;
  }

  public abstract class SSLSocketFactory extends javax.net.SocketFactory {
    ctor public SSLSocketFactory();
    method public abstract java.net.Socket createSocket(java.net.Socket, String, int, boolean) throws java.io.IOException;
    method public static javax.net.SocketFactory getDefault();
    method public abstract String[] getDefaultCipherSuites();
    method public abstract String[] getSupportedCipherSuites();
  }

  public final class StandardConstants {
    field public static final int SNI_HOST_NAME = 0; // 0x0
  }

  public interface TrustManager {
  }

  public class TrustManagerFactory {
    ctor protected TrustManagerFactory(javax.net.ssl.TrustManagerFactorySpi, java.security.Provider, String);
    method public final String getAlgorithm();
    method public static final String getDefaultAlgorithm();
    method public static final javax.net.ssl.TrustManagerFactory getInstance(String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.net.ssl.TrustManagerFactory getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.net.ssl.TrustManagerFactory getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final java.security.Provider getProvider();
    method public final javax.net.ssl.TrustManager[] getTrustManagers();
    method public final void init(java.security.KeyStore) throws java.security.KeyStoreException;
    method public final void init(javax.net.ssl.ManagerFactoryParameters) throws java.security.InvalidAlgorithmParameterException;
  }

  public abstract class TrustManagerFactorySpi {
    ctor public TrustManagerFactorySpi();
    method protected abstract javax.net.ssl.TrustManager[] engineGetTrustManagers();
    method protected abstract void engineInit(java.security.KeyStore) throws java.security.KeyStoreException;
    method protected abstract void engineInit(javax.net.ssl.ManagerFactoryParameters) throws java.security.InvalidAlgorithmParameterException;
  }

  public abstract class X509ExtendedKeyManager implements javax.net.ssl.X509KeyManager {
    ctor protected X509ExtendedKeyManager();
    method public String chooseEngineClientAlias(String[], java.security.Principal[], javax.net.ssl.SSLEngine);
    method public String chooseEngineServerAlias(String, java.security.Principal[], javax.net.ssl.SSLEngine);
  }

  public abstract class X509ExtendedTrustManager implements javax.net.ssl.X509TrustManager {
    ctor public X509ExtendedTrustManager();
    method public abstract void checkClientTrusted(java.security.cert.X509Certificate[], String, java.net.Socket) throws java.security.cert.CertificateException;
    method public abstract void checkClientTrusted(java.security.cert.X509Certificate[], String, javax.net.ssl.SSLEngine) throws java.security.cert.CertificateException;
    method public abstract void checkServerTrusted(java.security.cert.X509Certificate[], String, java.net.Socket) throws java.security.cert.CertificateException;
    method public abstract void checkServerTrusted(java.security.cert.X509Certificate[], String, javax.net.ssl.SSLEngine) throws java.security.cert.CertificateException;
  }

  public interface X509KeyManager extends javax.net.ssl.KeyManager {
    method public String chooseClientAlias(String[], java.security.Principal[], java.net.Socket);
    method public String chooseServerAlias(String, java.security.Principal[], java.net.Socket);
    method public java.security.cert.X509Certificate[] getCertificateChain(String);
    method public String[] getClientAliases(String, java.security.Principal[]);
    method public java.security.PrivateKey getPrivateKey(String);
    method public String[] getServerAliases(String, java.security.Principal[]);
  }

  public interface X509TrustManager extends javax.net.ssl.TrustManager {
    method public void checkClientTrusted(java.security.cert.X509Certificate[], String) throws java.security.cert.CertificateException;
    method public void checkServerTrusted(java.security.cert.X509Certificate[], String) throws java.security.cert.CertificateException;
    method public java.security.cert.X509Certificate[] getAcceptedIssuers();
  }

}

package javax.security.auth {

  public final class AuthPermission extends java.security.BasicPermission {
    ctor public AuthPermission(String);
    ctor public AuthPermission(String, String);
  }

  public class DestroyFailedException extends java.lang.Exception {
    ctor public DestroyFailedException();
    ctor public DestroyFailedException(String);
  }

  public interface Destroyable {
    method public default void destroy() throws javax.security.auth.DestroyFailedException;
    method public default boolean isDestroyed();
  }

  public final class PrivateCredentialPermission extends java.security.Permission {
    ctor public PrivateCredentialPermission(String, String);
    method public String getActions();
    method public String getCredentialClass();
    method public String[][] getPrincipals();
    method public boolean implies(java.security.Permission);
  }

  public final class Subject implements java.io.Serializable {
    ctor public Subject();
    ctor public Subject(boolean, java.util.Set<? extends java.security.Principal>, java.util.Set<?>, java.util.Set<?>);
    method public static <T> T doAs(javax.security.auth.Subject, java.security.PrivilegedAction<T>);
    method public static <T> T doAs(javax.security.auth.Subject, java.security.PrivilegedExceptionAction<T>) throws java.security.PrivilegedActionException;
    method public static <T> T doAsPrivileged(javax.security.auth.Subject, java.security.PrivilegedAction<T>, java.security.AccessControlContext);
    method public static <T> T doAsPrivileged(javax.security.auth.Subject, java.security.PrivilegedExceptionAction<T>, java.security.AccessControlContext) throws java.security.PrivilegedActionException;
    method public java.util.Set<java.security.Principal> getPrincipals();
    method public <T extends java.security.Principal> java.util.Set<T> getPrincipals(Class<T>);
    method public java.util.Set<java.lang.Object> getPrivateCredentials();
    method public <T> java.util.Set<T> getPrivateCredentials(Class<T>);
    method public java.util.Set<java.lang.Object> getPublicCredentials();
    method public <T> java.util.Set<T> getPublicCredentials(Class<T>);
    method public static javax.security.auth.Subject getSubject(java.security.AccessControlContext);
    method public boolean isReadOnly();
    method public void setReadOnly();
  }

  public class SubjectDomainCombiner implements java.security.DomainCombiner {
    ctor public SubjectDomainCombiner(javax.security.auth.Subject);
    method public java.security.ProtectionDomain[] combine(java.security.ProtectionDomain[], java.security.ProtectionDomain[]);
    method public javax.security.auth.Subject getSubject();
  }

}

package javax.security.auth.callback {

  public interface Callback {
  }

  public interface CallbackHandler {
    method public void handle(javax.security.auth.callback.Callback[]) throws java.io.IOException, javax.security.auth.callback.UnsupportedCallbackException;
  }

  public class PasswordCallback implements javax.security.auth.callback.Callback java.io.Serializable {
    ctor public PasswordCallback(String, boolean);
    method public void clearPassword();
    method public char[] getPassword();
    method public String getPrompt();
    method public boolean isEchoOn();
    method public void setPassword(char[]);
  }

  public class UnsupportedCallbackException extends java.lang.Exception {
    ctor public UnsupportedCallbackException(javax.security.auth.callback.Callback);
    ctor public UnsupportedCallbackException(javax.security.auth.callback.Callback, String);
    method public javax.security.auth.callback.Callback getCallback();
  }

}

package javax.security.auth.login {

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

}

package javax.security.auth.x500 {

  public final class X500Principal implements java.security.Principal java.io.Serializable {
    ctor public X500Principal(String);
    ctor public X500Principal(String, java.util.Map<java.lang.String,java.lang.String>);
    ctor public X500Principal(byte[]);
    ctor public X500Principal(java.io.InputStream);
    method public byte[] getEncoded();
    method public String getName();
    method public String getName(String);
    method public String getName(String, java.util.Map<java.lang.String,java.lang.String>);
    field public static final String CANONICAL = "CANONICAL";
    field public static final String RFC1779 = "RFC1779";
    field public static final String RFC2253 = "RFC2253";
  }

}

package javax.security.cert {

  public abstract class Certificate {
    ctor public Certificate();
    method public abstract byte[] getEncoded() throws javax.security.cert.CertificateEncodingException;
    method public abstract java.security.PublicKey getPublicKey();
    method public abstract String toString();
    method public abstract void verify(java.security.PublicKey) throws javax.security.cert.CertificateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException;
    method public abstract void verify(java.security.PublicKey, String) throws javax.security.cert.CertificateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException;
  }

  public class CertificateEncodingException extends javax.security.cert.CertificateException {
    ctor public CertificateEncodingException();
    ctor public CertificateEncodingException(String);
  }

  public class CertificateException extends java.lang.Exception {
    ctor public CertificateException();
    ctor public CertificateException(String);
  }

  public class CertificateExpiredException extends javax.security.cert.CertificateException {
    ctor public CertificateExpiredException();
    ctor public CertificateExpiredException(String);
  }

  public class CertificateNotYetValidException extends javax.security.cert.CertificateException {
    ctor public CertificateNotYetValidException();
    ctor public CertificateNotYetValidException(String);
  }

  public class CertificateParsingException extends javax.security.cert.CertificateException {
    ctor public CertificateParsingException();
    ctor public CertificateParsingException(String);
  }

  public abstract class X509Certificate extends javax.security.cert.Certificate {
    ctor public X509Certificate();
    method public abstract void checkValidity() throws javax.security.cert.CertificateExpiredException, javax.security.cert.CertificateNotYetValidException;
    method public abstract void checkValidity(java.util.Date) throws javax.security.cert.CertificateExpiredException, javax.security.cert.CertificateNotYetValidException;
    method public static final javax.security.cert.X509Certificate getInstance(java.io.InputStream) throws javax.security.cert.CertificateException;
    method public static final javax.security.cert.X509Certificate getInstance(byte[]) throws javax.security.cert.CertificateException;
    method public abstract java.security.Principal getIssuerDN();
    method public abstract java.util.Date getNotAfter();
    method public abstract java.util.Date getNotBefore();
    method public abstract java.math.BigInteger getSerialNumber();
    method public abstract String getSigAlgName();
    method public abstract String getSigAlgOID();
    method public abstract byte[] getSigAlgParams();
    method public abstract java.security.Principal getSubjectDN();
    method public abstract int getVersion();
  }

}

package javax.sql {

  public interface CommonDataSource {
    method public java.io.PrintWriter getLogWriter() throws java.sql.SQLException;
    method public int getLoginTimeout() throws java.sql.SQLException;
    method public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException;
    method public void setLogWriter(java.io.PrintWriter) throws java.sql.SQLException;
    method public void setLoginTimeout(int) throws java.sql.SQLException;
  }

  public class ConnectionEvent extends java.util.EventObject {
    ctor public ConnectionEvent(javax.sql.PooledConnection);
    ctor public ConnectionEvent(javax.sql.PooledConnection, java.sql.SQLException);
    method public java.sql.SQLException getSQLException();
  }

  public interface ConnectionEventListener extends java.util.EventListener {
    method public void connectionClosed(javax.sql.ConnectionEvent);
    method public void connectionErrorOccurred(javax.sql.ConnectionEvent);
  }

  public interface ConnectionPoolDataSource extends javax.sql.CommonDataSource {
    method public javax.sql.PooledConnection getPooledConnection() throws java.sql.SQLException;
    method public javax.sql.PooledConnection getPooledConnection(String, String) throws java.sql.SQLException;
  }

  public interface DataSource extends javax.sql.CommonDataSource java.sql.Wrapper {
    method public java.sql.Connection getConnection() throws java.sql.SQLException;
    method public java.sql.Connection getConnection(String, String) throws java.sql.SQLException;
  }

  public interface PooledConnection {
    method public void addConnectionEventListener(javax.sql.ConnectionEventListener);
    method public void addStatementEventListener(javax.sql.StatementEventListener);
    method public void close() throws java.sql.SQLException;
    method public java.sql.Connection getConnection() throws java.sql.SQLException;
    method public void removeConnectionEventListener(javax.sql.ConnectionEventListener);
    method public void removeStatementEventListener(javax.sql.StatementEventListener);
  }

  public interface RowSet extends java.sql.ResultSet {
    method public void addRowSetListener(javax.sql.RowSetListener);
    method public void clearParameters() throws java.sql.SQLException;
    method public void execute() throws java.sql.SQLException;
    method public String getCommand();
    method public String getDataSourceName();
    method public boolean getEscapeProcessing() throws java.sql.SQLException;
    method public int getMaxFieldSize() throws java.sql.SQLException;
    method public int getMaxRows() throws java.sql.SQLException;
    method public String getPassword();
    method public int getQueryTimeout() throws java.sql.SQLException;
    method public int getTransactionIsolation();
    method public java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap() throws java.sql.SQLException;
    method public String getUrl() throws java.sql.SQLException;
    method public String getUsername();
    method public boolean isReadOnly();
    method public void removeRowSetListener(javax.sql.RowSetListener);
    method public void setArray(int, java.sql.Array) throws java.sql.SQLException;
    method public void setAsciiStream(int, java.io.InputStream, int) throws java.sql.SQLException;
    method public void setAsciiStream(String, java.io.InputStream, int) throws java.sql.SQLException;
    method public void setAsciiStream(int, java.io.InputStream) throws java.sql.SQLException;
    method public void setAsciiStream(String, java.io.InputStream) throws java.sql.SQLException;
    method public void setBigDecimal(int, java.math.BigDecimal) throws java.sql.SQLException;
    method public void setBigDecimal(String, java.math.BigDecimal) throws java.sql.SQLException;
    method public void setBinaryStream(int, java.io.InputStream, int) throws java.sql.SQLException;
    method public void setBinaryStream(String, java.io.InputStream, int) throws java.sql.SQLException;
    method public void setBinaryStream(int, java.io.InputStream) throws java.sql.SQLException;
    method public void setBinaryStream(String, java.io.InputStream) throws java.sql.SQLException;
    method public void setBlob(int, java.sql.Blob) throws java.sql.SQLException;
    method public void setBlob(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public void setBlob(int, java.io.InputStream) throws java.sql.SQLException;
    method public void setBlob(String, java.io.InputStream, long) throws java.sql.SQLException;
    method public void setBlob(String, java.sql.Blob) throws java.sql.SQLException;
    method public void setBlob(String, java.io.InputStream) throws java.sql.SQLException;
    method public void setBoolean(int, boolean) throws java.sql.SQLException;
    method public void setBoolean(String, boolean) throws java.sql.SQLException;
    method public void setByte(int, byte) throws java.sql.SQLException;
    method public void setByte(String, byte) throws java.sql.SQLException;
    method public void setBytes(int, byte[]) throws java.sql.SQLException;
    method public void setBytes(String, byte[]) throws java.sql.SQLException;
    method public void setCharacterStream(int, java.io.Reader, int) throws java.sql.SQLException;
    method public void setCharacterStream(String, java.io.Reader, int) throws java.sql.SQLException;
    method public void setCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
    method public void setCharacterStream(String, java.io.Reader) throws java.sql.SQLException;
    method public void setClob(int, java.sql.Clob) throws java.sql.SQLException;
    method public void setClob(int, java.io.Reader, long) throws java.sql.SQLException;
    method public void setClob(int, java.io.Reader) throws java.sql.SQLException;
    method public void setClob(String, java.io.Reader, long) throws java.sql.SQLException;
    method public void setClob(String, java.sql.Clob) throws java.sql.SQLException;
    method public void setClob(String, java.io.Reader) throws java.sql.SQLException;
    method public void setCommand(String) throws java.sql.SQLException;
    method public void setConcurrency(int) throws java.sql.SQLException;
    method public void setDataSourceName(String) throws java.sql.SQLException;
    method public void setDate(int, java.sql.Date) throws java.sql.SQLException;
    method public void setDate(int, java.sql.Date, java.util.Calendar) throws java.sql.SQLException;
    method public void setDate(String, java.sql.Date) throws java.sql.SQLException;
    method public void setDate(String, java.sql.Date, java.util.Calendar) throws java.sql.SQLException;
    method public void setDouble(int, double) throws java.sql.SQLException;
    method public void setDouble(String, double) throws java.sql.SQLException;
    method public void setEscapeProcessing(boolean) throws java.sql.SQLException;
    method public void setFloat(int, float) throws java.sql.SQLException;
    method public void setFloat(String, float) throws java.sql.SQLException;
    method public void setInt(int, int) throws java.sql.SQLException;
    method public void setInt(String, int) throws java.sql.SQLException;
    method public void setLong(int, long) throws java.sql.SQLException;
    method public void setLong(String, long) throws java.sql.SQLException;
    method public void setMaxFieldSize(int) throws java.sql.SQLException;
    method public void setMaxRows(int) throws java.sql.SQLException;
    method public void setNCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
    method public void setNCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
    method public void setNCharacterStream(String, java.io.Reader, long) throws java.sql.SQLException;
    method public void setNCharacterStream(String, java.io.Reader) throws java.sql.SQLException;
    method public void setNClob(String, java.sql.NClob) throws java.sql.SQLException;
    method public void setNClob(String, java.io.Reader, long) throws java.sql.SQLException;
    method public void setNClob(String, java.io.Reader) throws java.sql.SQLException;
    method public void setNClob(int, java.io.Reader, long) throws java.sql.SQLException;
    method public void setNClob(int, java.sql.NClob) throws java.sql.SQLException;
    method public void setNClob(int, java.io.Reader) throws java.sql.SQLException;
    method public void setNString(int, String) throws java.sql.SQLException;
    method public void setNString(String, String) throws java.sql.SQLException;
    method public void setNull(int, int) throws java.sql.SQLException;
    method public void setNull(String, int) throws java.sql.SQLException;
    method public void setNull(int, int, String) throws java.sql.SQLException;
    method public void setNull(String, int, String) throws java.sql.SQLException;
    method public void setObject(int, Object, int, int) throws java.sql.SQLException;
    method public void setObject(String, Object, int, int) throws java.sql.SQLException;
    method public void setObject(int, Object, int) throws java.sql.SQLException;
    method public void setObject(String, Object, int) throws java.sql.SQLException;
    method public void setObject(String, Object) throws java.sql.SQLException;
    method public void setObject(int, Object) throws java.sql.SQLException;
    method public void setPassword(String) throws java.sql.SQLException;
    method public void setQueryTimeout(int) throws java.sql.SQLException;
    method public void setReadOnly(boolean) throws java.sql.SQLException;
    method public void setRef(int, java.sql.Ref) throws java.sql.SQLException;
    method public void setRowId(int, java.sql.RowId) throws java.sql.SQLException;
    method public void setRowId(String, java.sql.RowId) throws java.sql.SQLException;
    method public void setSQLXML(int, java.sql.SQLXML) throws java.sql.SQLException;
    method public void setSQLXML(String, java.sql.SQLXML) throws java.sql.SQLException;
    method public void setShort(int, short) throws java.sql.SQLException;
    method public void setShort(String, short) throws java.sql.SQLException;
    method public void setString(int, String) throws java.sql.SQLException;
    method public void setString(String, String) throws java.sql.SQLException;
    method public void setTime(int, java.sql.Time) throws java.sql.SQLException;
    method public void setTime(int, java.sql.Time, java.util.Calendar) throws java.sql.SQLException;
    method public void setTime(String, java.sql.Time) throws java.sql.SQLException;
    method public void setTime(String, java.sql.Time, java.util.Calendar) throws java.sql.SQLException;
    method public void setTimestamp(int, java.sql.Timestamp) throws java.sql.SQLException;
    method public void setTimestamp(String, java.sql.Timestamp) throws java.sql.SQLException;
    method public void setTimestamp(int, java.sql.Timestamp, java.util.Calendar) throws java.sql.SQLException;
    method public void setTimestamp(String, java.sql.Timestamp, java.util.Calendar) throws java.sql.SQLException;
    method public void setTransactionIsolation(int) throws java.sql.SQLException;
    method public void setType(int) throws java.sql.SQLException;
    method public void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
    method public void setURL(int, java.net.URL) throws java.sql.SQLException;
    method public void setUrl(String) throws java.sql.SQLException;
    method public void setUsername(String) throws java.sql.SQLException;
  }

  public class RowSetEvent extends java.util.EventObject {
    ctor public RowSetEvent(javax.sql.RowSet);
  }

  public interface RowSetInternal {
    method public java.sql.Connection getConnection() throws java.sql.SQLException;
    method public java.sql.ResultSet getOriginal() throws java.sql.SQLException;
    method public java.sql.ResultSet getOriginalRow() throws java.sql.SQLException;
    method public Object[] getParams() throws java.sql.SQLException;
    method public void setMetaData(javax.sql.RowSetMetaData) throws java.sql.SQLException;
  }

  public interface RowSetListener extends java.util.EventListener {
    method public void cursorMoved(javax.sql.RowSetEvent);
    method public void rowChanged(javax.sql.RowSetEvent);
    method public void rowSetChanged(javax.sql.RowSetEvent);
  }

  public interface RowSetMetaData extends java.sql.ResultSetMetaData {
    method public void setAutoIncrement(int, boolean) throws java.sql.SQLException;
    method public void setCaseSensitive(int, boolean) throws java.sql.SQLException;
    method public void setCatalogName(int, String) throws java.sql.SQLException;
    method public void setColumnCount(int) throws java.sql.SQLException;
    method public void setColumnDisplaySize(int, int) throws java.sql.SQLException;
    method public void setColumnLabel(int, String) throws java.sql.SQLException;
    method public void setColumnName(int, String) throws java.sql.SQLException;
    method public void setColumnType(int, int) throws java.sql.SQLException;
    method public void setColumnTypeName(int, String) throws java.sql.SQLException;
    method public void setCurrency(int, boolean) throws java.sql.SQLException;
    method public void setNullable(int, int) throws java.sql.SQLException;
    method public void setPrecision(int, int) throws java.sql.SQLException;
    method public void setScale(int, int) throws java.sql.SQLException;
    method public void setSchemaName(int, String) throws java.sql.SQLException;
    method public void setSearchable(int, boolean) throws java.sql.SQLException;
    method public void setSigned(int, boolean) throws java.sql.SQLException;
    method public void setTableName(int, String) throws java.sql.SQLException;
  }

  public interface RowSetReader {
    method public void readData(javax.sql.RowSetInternal) throws java.sql.SQLException;
  }

  public interface RowSetWriter {
    method public boolean writeData(javax.sql.RowSetInternal) throws java.sql.SQLException;
  }

  public class StatementEvent extends java.util.EventObject {
    ctor public StatementEvent(javax.sql.PooledConnection, java.sql.PreparedStatement);
    ctor public StatementEvent(javax.sql.PooledConnection, java.sql.PreparedStatement, java.sql.SQLException);
    method public java.sql.SQLException getSQLException();
    method public java.sql.PreparedStatement getStatement();
  }

  public interface StatementEventListener extends java.util.EventListener {
    method public void statementClosed(javax.sql.StatementEvent);
    method public void statementErrorOccurred(javax.sql.StatementEvent);
  }

}

package javax.xml {

  public final class XMLConstants {
    field public static final String DEFAULT_NS_PREFIX = "";
    field public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing";
    field public static final String NULL_NS_URI = "";
    field public static final String RELAXNG_NS_URI = "http://relaxng.org/ns/structure/1.0";
    field public static final String W3C_XML_SCHEMA_INSTANCE_NS_URI = "http://www.w3.org/2001/XMLSchema-instance";
    field public static final String W3C_XML_SCHEMA_NS_URI = "http://www.w3.org/2001/XMLSchema";
    field public static final String W3C_XPATH_DATATYPE_NS_URI = "http://www.w3.org/2003/11/xpath-datatypes";
    field public static final String XMLNS_ATTRIBUTE = "xmlns";
    field public static final String XMLNS_ATTRIBUTE_NS_URI = "http://www.w3.org/2000/xmlns/";
    field public static final String XML_DTD_NS_URI = "http://www.w3.org/TR/REC-xml";
    field public static final String XML_NS_PREFIX = "xml";
    field public static final String XML_NS_URI = "http://www.w3.org/XML/1998/namespace";
  }

}

package javax.xml.datatype {

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

  public final class DatatypeConstants {
    field public static final int APRIL = 4; // 0x4
    field public static final int AUGUST = 8; // 0x8
    field public static final javax.xml.namespace.QName DATE;
    field public static final javax.xml.namespace.QName DATETIME;
    field public static final javax.xml.datatype.DatatypeConstants.Field DAYS;
    field public static final int DECEMBER = 12; // 0xc
    field public static final javax.xml.namespace.QName DURATION;
    field public static final javax.xml.namespace.QName DURATION_DAYTIME;
    field public static final javax.xml.namespace.QName DURATION_YEARMONTH;
    field public static final int EQUAL = 0; // 0x0
    field public static final int FEBRUARY = 2; // 0x2
    field public static final int FIELD_UNDEFINED = -2147483648; // 0x80000000
    field public static final javax.xml.namespace.QName GDAY;
    field public static final javax.xml.namespace.QName GMONTH;
    field public static final javax.xml.namespace.QName GMONTHDAY;
    field public static final int GREATER = 1; // 0x1
    field public static final javax.xml.namespace.QName GYEAR;
    field public static final javax.xml.namespace.QName GYEARMONTH;
    field public static final javax.xml.datatype.DatatypeConstants.Field HOURS;
    field public static final int INDETERMINATE = 2; // 0x2
    field public static final int JANUARY = 1; // 0x1
    field public static final int JULY = 7; // 0x7
    field public static final int JUNE = 6; // 0x6
    field public static final int LESSER = -1; // 0xffffffff
    field public static final int MARCH = 3; // 0x3
    field public static final int MAX_TIMEZONE_OFFSET = -840; // 0xfffffcb8
    field public static final int MAY = 5; // 0x5
    field public static final javax.xml.datatype.DatatypeConstants.Field MINUTES;
    field public static final int MIN_TIMEZONE_OFFSET = 840; // 0x348
    field public static final javax.xml.datatype.DatatypeConstants.Field MONTHS;
    field public static final int NOVEMBER = 11; // 0xb
    field public static final int OCTOBER = 10; // 0xa
    field public static final javax.xml.datatype.DatatypeConstants.Field SECONDS;
    field public static final int SEPTEMBER = 9; // 0x9
    field public static final javax.xml.namespace.QName TIME;
    field public static final javax.xml.datatype.DatatypeConstants.Field YEARS;
  }

  public static final class DatatypeConstants.Field {
    method public int getId();
  }

  public abstract class DatatypeFactory {
    ctor protected DatatypeFactory();
    method public abstract javax.xml.datatype.Duration newDuration(String);
    method public abstract javax.xml.datatype.Duration newDuration(long);
    method public abstract javax.xml.datatype.Duration newDuration(boolean, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigDecimal);
    method public javax.xml.datatype.Duration newDuration(boolean, int, int, int, int, int, int);
    method public javax.xml.datatype.Duration newDurationDayTime(String);
    method public javax.xml.datatype.Duration newDurationDayTime(long);
    method public javax.xml.datatype.Duration newDurationDayTime(boolean, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
    method public javax.xml.datatype.Duration newDurationDayTime(boolean, int, int, int, int);
    method public javax.xml.datatype.Duration newDurationYearMonth(String);
    method public javax.xml.datatype.Duration newDurationYearMonth(long);
    method public javax.xml.datatype.Duration newDurationYearMonth(boolean, java.math.BigInteger, java.math.BigInteger);
    method public javax.xml.datatype.Duration newDurationYearMonth(boolean, int, int);
    method public static javax.xml.datatype.DatatypeFactory newInstance() throws javax.xml.datatype.DatatypeConfigurationException;
    method public static javax.xml.datatype.DatatypeFactory newInstance(String, ClassLoader) throws javax.xml.datatype.DatatypeConfigurationException;
    method public abstract javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar();
    method public abstract javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(String);
    method public abstract javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(java.util.GregorianCalendar);
    method public abstract javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(java.math.BigInteger, int, int, int, int, int, java.math.BigDecimal, int);
    method public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(int, int, int, int, int, int, int, int);
    method public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendarDate(int, int, int, int);
    method public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendarTime(int, int, int, int);
    method public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendarTime(int, int, int, java.math.BigDecimal, int);
    method public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendarTime(int, int, int, int, int);
    field public static final String DATATYPEFACTORY_IMPLEMENTATION_CLASS;
    field public static final String DATATYPEFACTORY_PROPERTY = "javax.xml.datatype.DatatypeFactory";
  }

  public abstract class Duration {
    ctor public Duration();
    method public abstract javax.xml.datatype.Duration add(javax.xml.datatype.Duration);
    method public abstract void addTo(java.util.Calendar);
    method public void addTo(java.util.Date);
    method public abstract int compare(javax.xml.datatype.Duration);
    method public int getDays();
    method public abstract Number getField(javax.xml.datatype.DatatypeConstants.Field);
    method public int getHours();
    method public int getMinutes();
    method public int getMonths();
    method public int getSeconds();
    method public abstract int getSign();
    method public long getTimeInMillis(java.util.Calendar);
    method public long getTimeInMillis(java.util.Date);
    method public javax.xml.namespace.QName getXMLSchemaType();
    method public int getYears();
    method public abstract int hashCode();
    method public boolean isLongerThan(javax.xml.datatype.Duration);
    method public abstract boolean isSet(javax.xml.datatype.DatatypeConstants.Field);
    method public boolean isShorterThan(javax.xml.datatype.Duration);
    method public javax.xml.datatype.Duration multiply(int);
    method public abstract javax.xml.datatype.Duration multiply(java.math.BigDecimal);
    method public abstract javax.xml.datatype.Duration negate();
    method public abstract javax.xml.datatype.Duration normalizeWith(java.util.Calendar);
    method public javax.xml.datatype.Duration subtract(javax.xml.datatype.Duration);
  }

  public abstract class XMLGregorianCalendar implements java.lang.Cloneable {
    ctor public XMLGregorianCalendar();
    method public abstract void add(javax.xml.datatype.Duration);
    method public abstract void clear();
    method public abstract Object clone();
    method public abstract int compare(javax.xml.datatype.XMLGregorianCalendar);
    method public abstract int getDay();
    method public abstract java.math.BigInteger getEon();
    method public abstract java.math.BigInteger getEonAndYear();
    method public abstract java.math.BigDecimal getFractionalSecond();
    method public abstract int getHour();
    method public int getMillisecond();
    method public abstract int getMinute();
    method public abstract int getMonth();
    method public abstract int getSecond();
    method public abstract java.util.TimeZone getTimeZone(int);
    method public abstract int getTimezone();
    method public abstract javax.xml.namespace.QName getXMLSchemaType();
    method public abstract int getYear();
    method public abstract boolean isValid();
    method public abstract javax.xml.datatype.XMLGregorianCalendar normalize();
    method public abstract void reset();
    method public abstract void setDay(int);
    method public abstract void setFractionalSecond(java.math.BigDecimal);
    method public abstract void setHour(int);
    method public abstract void setMillisecond(int);
    method public abstract void setMinute(int);
    method public abstract void setMonth(int);
    method public abstract void setSecond(int);
    method public void setTime(int, int, int);
    method public void setTime(int, int, int, java.math.BigDecimal);
    method public void setTime(int, int, int, int);
    method public abstract void setTimezone(int);
    method public abstract void setYear(java.math.BigInteger);
    method public abstract void setYear(int);
    method public abstract java.util.GregorianCalendar toGregorianCalendar();
    method public abstract java.util.GregorianCalendar toGregorianCalendar(java.util.TimeZone, java.util.Locale, javax.xml.datatype.XMLGregorianCalendar);
    method public abstract String toXMLFormat();
  }

}

package javax.xml.namespace {

  public interface NamespaceContext {
    method public String getNamespaceURI(String);
    method public String getPrefix(String);
    method public java.util.Iterator getPrefixes(String);
  }

  public class QName implements java.io.Serializable {
    ctor public QName(String, String);
    ctor public QName(String, String, String);
    ctor public QName(String);
    method public final boolean equals(Object);
    method public String getLocalPart();
    method public String getNamespaceURI();
    method public String getPrefix();
    method public final int hashCode();
    method public static javax.xml.namespace.QName valueOf(String);
  }

}

package javax.xml.parsers {

  public abstract class DocumentBuilder {
    ctor protected DocumentBuilder();
    method public abstract org.w3c.dom.DOMImplementation getDOMImplementation();
    method public javax.xml.validation.Schema getSchema();
    method public abstract boolean isNamespaceAware();
    method public abstract boolean isValidating();
    method public boolean isXIncludeAware();
    method public abstract org.w3c.dom.Document newDocument();
    method public org.w3c.dom.Document parse(java.io.InputStream) throws java.io.IOException, org.xml.sax.SAXException;
    method public org.w3c.dom.Document parse(java.io.InputStream, String) throws java.io.IOException, org.xml.sax.SAXException;
    method public org.w3c.dom.Document parse(String) throws java.io.IOException, org.xml.sax.SAXException;
    method public org.w3c.dom.Document parse(java.io.File) throws java.io.IOException, org.xml.sax.SAXException;
    method public abstract org.w3c.dom.Document parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
    method public void reset();
    method public abstract void setEntityResolver(org.xml.sax.EntityResolver);
    method public abstract void setErrorHandler(org.xml.sax.ErrorHandler);
  }

  public abstract class DocumentBuilderFactory {
    ctor protected DocumentBuilderFactory();
    method public abstract Object getAttribute(String) throws java.lang.IllegalArgumentException;
    method public abstract boolean getFeature(String) throws javax.xml.parsers.ParserConfigurationException;
    method public javax.xml.validation.Schema getSchema();
    method public boolean isCoalescing();
    method public boolean isExpandEntityReferences();
    method public boolean isIgnoringComments();
    method public boolean isIgnoringElementContentWhitespace();
    method public boolean isNamespaceAware();
    method public boolean isValidating();
    method public boolean isXIncludeAware();
    method public abstract javax.xml.parsers.DocumentBuilder newDocumentBuilder() throws javax.xml.parsers.ParserConfigurationException;
    method public static javax.xml.parsers.DocumentBuilderFactory newInstance();
    method public static javax.xml.parsers.DocumentBuilderFactory newInstance(String, ClassLoader);
    method public abstract void setAttribute(String, Object) throws java.lang.IllegalArgumentException;
    method public void setCoalescing(boolean);
    method public void setExpandEntityReferences(boolean);
    method public abstract void setFeature(String, boolean) throws javax.xml.parsers.ParserConfigurationException;
    method public void setIgnoringComments(boolean);
    method public void setIgnoringElementContentWhitespace(boolean);
    method public void setNamespaceAware(boolean);
    method public void setSchema(javax.xml.validation.Schema);
    method public void setValidating(boolean);
    method public void setXIncludeAware(boolean);
  }

  public class FactoryConfigurationError extends java.lang.Error {
    ctor public FactoryConfigurationError();
    ctor public FactoryConfigurationError(String);
    ctor public FactoryConfigurationError(Exception);
    ctor public FactoryConfigurationError(Exception, String);
    method public Exception getException();
  }

  public class ParserConfigurationException extends java.lang.Exception {
    ctor public ParserConfigurationException();
    ctor public ParserConfigurationException(String);
  }

  public abstract class SAXParser {
    ctor protected SAXParser();
    method public abstract org.xml.sax.Parser getParser() throws org.xml.sax.SAXException;
    method public abstract Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public javax.xml.validation.Schema getSchema();
    method public abstract org.xml.sax.XMLReader getXMLReader() throws org.xml.sax.SAXException;
    method public abstract boolean isNamespaceAware();
    method public abstract boolean isValidating();
    method public boolean isXIncludeAware();
    method public void parse(java.io.InputStream, org.xml.sax.HandlerBase) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(java.io.InputStream, org.xml.sax.HandlerBase, String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(java.io.InputStream, org.xml.sax.helpers.DefaultHandler) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(java.io.InputStream, org.xml.sax.helpers.DefaultHandler, String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(String, org.xml.sax.HandlerBase) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(String, org.xml.sax.helpers.DefaultHandler) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(java.io.File, org.xml.sax.HandlerBase) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(java.io.File, org.xml.sax.helpers.DefaultHandler) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(org.xml.sax.InputSource, org.xml.sax.HandlerBase) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(org.xml.sax.InputSource, org.xml.sax.helpers.DefaultHandler) throws java.io.IOException, org.xml.sax.SAXException;
    method public void reset();
    method public abstract void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
  }

  public abstract class SAXParserFactory {
    ctor protected SAXParserFactory();
    method public abstract boolean getFeature(String) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public javax.xml.validation.Schema getSchema();
    method public boolean isNamespaceAware();
    method public boolean isValidating();
    method public boolean isXIncludeAware();
    method public static javax.xml.parsers.SAXParserFactory newInstance();
    method public static javax.xml.parsers.SAXParserFactory newInstance(String, ClassLoader);
    method public abstract javax.xml.parsers.SAXParser newSAXParser() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException;
    method public abstract void setFeature(String, boolean) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setNamespaceAware(boolean);
    method public void setSchema(javax.xml.validation.Schema);
    method public void setValidating(boolean);
    method public void setXIncludeAware(boolean);
  }

}

package javax.xml.transform {

  public interface ErrorListener {
    method public void error(javax.xml.transform.TransformerException) throws javax.xml.transform.TransformerException;
    method public void fatalError(javax.xml.transform.TransformerException) throws javax.xml.transform.TransformerException;
    method public void warning(javax.xml.transform.TransformerException) throws javax.xml.transform.TransformerException;
  }

  public class OutputKeys {
    field public static final String CDATA_SECTION_ELEMENTS = "cdata-section-elements";
    field public static final String DOCTYPE_PUBLIC = "doctype-public";
    field public static final String DOCTYPE_SYSTEM = "doctype-system";
    field public static final String ENCODING = "encoding";
    field public static final String INDENT = "indent";
    field public static final String MEDIA_TYPE = "media-type";
    field public static final String METHOD = "method";
    field public static final String OMIT_XML_DECLARATION = "omit-xml-declaration";
    field public static final String STANDALONE = "standalone";
    field public static final String VERSION = "version";
  }

  public interface Result {
    method public String getSystemId();
    method public void setSystemId(String);
    field public static final String PI_DISABLE_OUTPUT_ESCAPING = "javax.xml.transform.disable-output-escaping";
    field public static final String PI_ENABLE_OUTPUT_ESCAPING = "javax.xml.transform.enable-output-escaping";
  }

  public interface Source {
    method public String getSystemId();
    method public void setSystemId(String);
  }

  public interface SourceLocator {
    method public int getColumnNumber();
    method public int getLineNumber();
    method public String getPublicId();
    method public String getSystemId();
  }

  public interface Templates {
    method public java.util.Properties getOutputProperties();
    method public javax.xml.transform.Transformer newTransformer() throws javax.xml.transform.TransformerConfigurationException;
  }

  public abstract class Transformer {
    ctor protected Transformer();
    method public abstract void clearParameters();
    method public abstract javax.xml.transform.ErrorListener getErrorListener();
    method public abstract java.util.Properties getOutputProperties();
    method public abstract String getOutputProperty(String) throws java.lang.IllegalArgumentException;
    method public abstract Object getParameter(String);
    method public abstract javax.xml.transform.URIResolver getURIResolver();
    method public void reset();
    method public abstract void setErrorListener(javax.xml.transform.ErrorListener) throws java.lang.IllegalArgumentException;
    method public abstract void setOutputProperties(java.util.Properties);
    method public abstract void setOutputProperty(String, String) throws java.lang.IllegalArgumentException;
    method public abstract void setParameter(String, Object);
    method public abstract void setURIResolver(javax.xml.transform.URIResolver);
    method public abstract void transform(javax.xml.transform.Source, javax.xml.transform.Result) throws javax.xml.transform.TransformerException;
  }

  public class TransformerConfigurationException extends javax.xml.transform.TransformerException {
    ctor public TransformerConfigurationException();
    ctor public TransformerConfigurationException(String);
    ctor public TransformerConfigurationException(Throwable);
    ctor public TransformerConfigurationException(String, Throwable);
    ctor public TransformerConfigurationException(String, javax.xml.transform.SourceLocator);
    ctor public TransformerConfigurationException(String, javax.xml.transform.SourceLocator, Throwable);
  }

  public class TransformerException extends java.lang.Exception {
    ctor public TransformerException(String);
    ctor public TransformerException(Throwable);
    ctor public TransformerException(String, Throwable);
    ctor public TransformerException(String, javax.xml.transform.SourceLocator);
    ctor public TransformerException(String, javax.xml.transform.SourceLocator, Throwable);
    method public Throwable getException();
    method public String getLocationAsString();
    method public javax.xml.transform.SourceLocator getLocator();
    method public String getMessageAndLocation();
    method public void setLocator(javax.xml.transform.SourceLocator);
  }

  public abstract class TransformerFactory {
    ctor protected TransformerFactory();
    method public abstract javax.xml.transform.Source getAssociatedStylesheet(javax.xml.transform.Source, String, String, String) throws javax.xml.transform.TransformerConfigurationException;
    method public abstract Object getAttribute(String);
    method public abstract javax.xml.transform.ErrorListener getErrorListener();
    method public abstract boolean getFeature(String);
    method public abstract javax.xml.transform.URIResolver getURIResolver();
    method public static javax.xml.transform.TransformerFactory newInstance() throws javax.xml.transform.TransformerFactoryConfigurationError;
    method public static javax.xml.transform.TransformerFactory newInstance(String, ClassLoader) throws javax.xml.transform.TransformerFactoryConfigurationError;
    method public abstract javax.xml.transform.Templates newTemplates(javax.xml.transform.Source) throws javax.xml.transform.TransformerConfigurationException;
    method public abstract javax.xml.transform.Transformer newTransformer(javax.xml.transform.Source) throws javax.xml.transform.TransformerConfigurationException;
    method public abstract javax.xml.transform.Transformer newTransformer() throws javax.xml.transform.TransformerConfigurationException;
    method public abstract void setAttribute(String, Object);
    method public abstract void setErrorListener(javax.xml.transform.ErrorListener);
    method public abstract void setFeature(String, boolean) throws javax.xml.transform.TransformerConfigurationException;
    method public abstract void setURIResolver(javax.xml.transform.URIResolver);
  }

  public class TransformerFactoryConfigurationError extends java.lang.Error {
    ctor public TransformerFactoryConfigurationError();
    ctor public TransformerFactoryConfigurationError(String);
    ctor public TransformerFactoryConfigurationError(Exception);
    ctor public TransformerFactoryConfigurationError(Exception, String);
    method public Exception getException();
  }

  public interface URIResolver {
    method public javax.xml.transform.Source resolve(String, String) throws javax.xml.transform.TransformerException;
  }

}

package javax.xml.transform.dom {

  public interface DOMLocator extends javax.xml.transform.SourceLocator {
    method public org.w3c.dom.Node getOriginatingNode();
  }

  public class DOMResult implements javax.xml.transform.Result {
    ctor public DOMResult();
    ctor public DOMResult(org.w3c.dom.Node);
    ctor public DOMResult(org.w3c.dom.Node, String);
    ctor public DOMResult(org.w3c.dom.Node, org.w3c.dom.Node);
    ctor public DOMResult(org.w3c.dom.Node, org.w3c.dom.Node, String);
    method public org.w3c.dom.Node getNextSibling();
    method public org.w3c.dom.Node getNode();
    method public String getSystemId();
    method public void setNextSibling(org.w3c.dom.Node);
    method public void setNode(org.w3c.dom.Node);
    method public void setSystemId(String);
    field public static final String FEATURE = "http://javax.xml.transform.dom.DOMResult/feature";
  }

  public class DOMSource implements javax.xml.transform.Source {
    ctor public DOMSource();
    ctor public DOMSource(org.w3c.dom.Node);
    ctor public DOMSource(org.w3c.dom.Node, String);
    method public org.w3c.dom.Node getNode();
    method public String getSystemId();
    method public void setNode(org.w3c.dom.Node);
    method public void setSystemId(String);
    field public static final String FEATURE = "http://javax.xml.transform.dom.DOMSource/feature";
  }

}

package javax.xml.transform.sax {

  public class SAXResult implements javax.xml.transform.Result {
    ctor public SAXResult();
    ctor public SAXResult(org.xml.sax.ContentHandler);
    method public org.xml.sax.ContentHandler getHandler();
    method public org.xml.sax.ext.LexicalHandler getLexicalHandler();
    method public String getSystemId();
    method public void setHandler(org.xml.sax.ContentHandler);
    method public void setLexicalHandler(org.xml.sax.ext.LexicalHandler);
    method public void setSystemId(String);
    field public static final String FEATURE = "http://javax.xml.transform.sax.SAXResult/feature";
  }

  public class SAXSource implements javax.xml.transform.Source {
    ctor public SAXSource();
    ctor public SAXSource(org.xml.sax.XMLReader, org.xml.sax.InputSource);
    ctor public SAXSource(org.xml.sax.InputSource);
    method public org.xml.sax.InputSource getInputSource();
    method public String getSystemId();
    method public org.xml.sax.XMLReader getXMLReader();
    method public void setInputSource(org.xml.sax.InputSource);
    method public void setSystemId(String);
    method public void setXMLReader(org.xml.sax.XMLReader);
    method public static org.xml.sax.InputSource sourceToInputSource(javax.xml.transform.Source);
    field public static final String FEATURE = "http://javax.xml.transform.sax.SAXSource/feature";
  }

  public abstract class SAXTransformerFactory extends javax.xml.transform.TransformerFactory {
    ctor protected SAXTransformerFactory();
    method public abstract javax.xml.transform.sax.TemplatesHandler newTemplatesHandler() throws javax.xml.transform.TransformerConfigurationException;
    method public abstract javax.xml.transform.sax.TransformerHandler newTransformerHandler(javax.xml.transform.Source) throws javax.xml.transform.TransformerConfigurationException;
    method public abstract javax.xml.transform.sax.TransformerHandler newTransformerHandler(javax.xml.transform.Templates) throws javax.xml.transform.TransformerConfigurationException;
    method public abstract javax.xml.transform.sax.TransformerHandler newTransformerHandler() throws javax.xml.transform.TransformerConfigurationException;
    method public abstract org.xml.sax.XMLFilter newXMLFilter(javax.xml.transform.Source) throws javax.xml.transform.TransformerConfigurationException;
    method public abstract org.xml.sax.XMLFilter newXMLFilter(javax.xml.transform.Templates) throws javax.xml.transform.TransformerConfigurationException;
    field public static final String FEATURE = "http://javax.xml.transform.sax.SAXTransformerFactory/feature";
    field public static final String FEATURE_XMLFILTER = "http://javax.xml.transform.sax.SAXTransformerFactory/feature/xmlfilter";
  }

  public interface TemplatesHandler extends org.xml.sax.ContentHandler {
    method public String getSystemId();
    method public javax.xml.transform.Templates getTemplates();
    method public void setSystemId(String);
  }

  public interface TransformerHandler extends org.xml.sax.ContentHandler org.xml.sax.DTDHandler org.xml.sax.ext.LexicalHandler {
    method public String getSystemId();
    method public javax.xml.transform.Transformer getTransformer();
    method public void setResult(javax.xml.transform.Result) throws java.lang.IllegalArgumentException;
    method public void setSystemId(String);
  }

}

package javax.xml.transform.stream {

  public class StreamResult implements javax.xml.transform.Result {
    ctor public StreamResult();
    ctor public StreamResult(java.io.OutputStream);
    ctor public StreamResult(java.io.Writer);
    ctor public StreamResult(String);
    ctor public StreamResult(java.io.File);
    method public java.io.OutputStream getOutputStream();
    method public String getSystemId();
    method public java.io.Writer getWriter();
    method public void setOutputStream(java.io.OutputStream);
    method public void setSystemId(String);
    method public void setSystemId(java.io.File);
    method public void setWriter(java.io.Writer);
    field public static final String FEATURE = "http://javax.xml.transform.stream.StreamResult/feature";
  }

  public class StreamSource implements javax.xml.transform.Source {
    ctor public StreamSource();
    ctor public StreamSource(java.io.InputStream);
    ctor public StreamSource(java.io.InputStream, String);
    ctor public StreamSource(java.io.Reader);
    ctor public StreamSource(java.io.Reader, String);
    ctor public StreamSource(String);
    ctor public StreamSource(java.io.File);
    method public java.io.InputStream getInputStream();
    method public String getPublicId();
    method public java.io.Reader getReader();
    method public String getSystemId();
    method public void setInputStream(java.io.InputStream);
    method public void setPublicId(String);
    method public void setReader(java.io.Reader);
    method public void setSystemId(String);
    method public void setSystemId(java.io.File);
    field public static final String FEATURE = "http://javax.xml.transform.stream.StreamSource/feature";
  }

}

package javax.xml.validation {

  public abstract class Schema {
    ctor protected Schema();
    method public abstract javax.xml.validation.Validator newValidator();
    method public abstract javax.xml.validation.ValidatorHandler newValidatorHandler();
  }

  public abstract class SchemaFactory {
    ctor protected SchemaFactory();
    method public abstract org.xml.sax.ErrorHandler getErrorHandler();
    method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public abstract org.w3c.dom.ls.LSResourceResolver getResourceResolver();
    method public abstract boolean isSchemaLanguageSupported(String);
    method public static javax.xml.validation.SchemaFactory newInstance(String);
    method public static javax.xml.validation.SchemaFactory newInstance(String, String, ClassLoader);
    method public javax.xml.validation.Schema newSchema(javax.xml.transform.Source) throws org.xml.sax.SAXException;
    method public javax.xml.validation.Schema newSchema(java.io.File) throws org.xml.sax.SAXException;
    method public javax.xml.validation.Schema newSchema(java.net.URL) throws org.xml.sax.SAXException;
    method public abstract javax.xml.validation.Schema newSchema(javax.xml.transform.Source[]) throws org.xml.sax.SAXException;
    method public abstract javax.xml.validation.Schema newSchema() throws org.xml.sax.SAXException;
    method public abstract void setErrorHandler(org.xml.sax.ErrorHandler);
    method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public abstract void setResourceResolver(org.w3c.dom.ls.LSResourceResolver);
  }

  public abstract class SchemaFactoryLoader {
    ctor protected SchemaFactoryLoader();
    method public abstract javax.xml.validation.SchemaFactory newFactory(String);
  }

  public abstract class TypeInfoProvider {
    ctor protected TypeInfoProvider();
    method public abstract org.w3c.dom.TypeInfo getAttributeTypeInfo(int);
    method public abstract org.w3c.dom.TypeInfo getElementTypeInfo();
    method public abstract boolean isIdAttribute(int);
    method public abstract boolean isSpecified(int);
  }

  public abstract class Validator {
    ctor protected Validator();
    method public abstract org.xml.sax.ErrorHandler getErrorHandler();
    method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public abstract org.w3c.dom.ls.LSResourceResolver getResourceResolver();
    method public abstract void reset();
    method public abstract void setErrorHandler(org.xml.sax.ErrorHandler);
    method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public abstract void setResourceResolver(org.w3c.dom.ls.LSResourceResolver);
    method public void validate(javax.xml.transform.Source) throws java.io.IOException, org.xml.sax.SAXException;
    method public abstract void validate(javax.xml.transform.Source, javax.xml.transform.Result) throws java.io.IOException, org.xml.sax.SAXException;
  }

  public abstract class ValidatorHandler implements org.xml.sax.ContentHandler {
    ctor protected ValidatorHandler();
    method public abstract org.xml.sax.ContentHandler getContentHandler();
    method public abstract org.xml.sax.ErrorHandler getErrorHandler();
    method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public abstract org.w3c.dom.ls.LSResourceResolver getResourceResolver();
    method public abstract javax.xml.validation.TypeInfoProvider getTypeInfoProvider();
    method public abstract void setContentHandler(org.xml.sax.ContentHandler);
    method public abstract void setErrorHandler(org.xml.sax.ErrorHandler);
    method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public abstract void setResourceResolver(org.w3c.dom.ls.LSResourceResolver);
  }

}

package javax.xml.xpath {

  public interface XPath {
    method public javax.xml.xpath.XPathExpression compile(String) throws javax.xml.xpath.XPathExpressionException;
    method public Object evaluate(String, Object, javax.xml.namespace.QName) throws javax.xml.xpath.XPathExpressionException;
    method public String evaluate(String, Object) throws javax.xml.xpath.XPathExpressionException;
    method public Object evaluate(String, org.xml.sax.InputSource, javax.xml.namespace.QName) throws javax.xml.xpath.XPathExpressionException;
    method public String evaluate(String, org.xml.sax.InputSource) throws javax.xml.xpath.XPathExpressionException;
    method public javax.xml.namespace.NamespaceContext getNamespaceContext();
    method public javax.xml.xpath.XPathFunctionResolver getXPathFunctionResolver();
    method public javax.xml.xpath.XPathVariableResolver getXPathVariableResolver();
    method public void reset();
    method public void setNamespaceContext(javax.xml.namespace.NamespaceContext);
    method public void setXPathFunctionResolver(javax.xml.xpath.XPathFunctionResolver);
    method public void setXPathVariableResolver(javax.xml.xpath.XPathVariableResolver);
  }

  public class XPathConstants {
    field public static final javax.xml.namespace.QName BOOLEAN;
    field public static final String DOM_OBJECT_MODEL = "http://java.sun.com/jaxp/xpath/dom";
    field public static final javax.xml.namespace.QName NODE;
    field public static final javax.xml.namespace.QName NODESET;
    field public static final javax.xml.namespace.QName NUMBER;
    field public static final javax.xml.namespace.QName STRING;
  }

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

  public interface XPathExpression {
    method public Object evaluate(Object, javax.xml.namespace.QName) throws javax.xml.xpath.XPathExpressionException;
    method public String evaluate(Object) throws javax.xml.xpath.XPathExpressionException;
    method public Object evaluate(org.xml.sax.InputSource, javax.xml.namespace.QName) throws javax.xml.xpath.XPathExpressionException;
    method public String evaluate(org.xml.sax.InputSource) throws javax.xml.xpath.XPathExpressionException;
  }

  public class XPathExpressionException extends javax.xml.xpath.XPathException {
    ctor public XPathExpressionException(String);
    ctor public XPathExpressionException(Throwable);
  }

  public abstract class XPathFactory {
    ctor protected XPathFactory();
    method public abstract boolean getFeature(String) throws javax.xml.xpath.XPathFactoryConfigurationException;
    method public abstract boolean isObjectModelSupported(String);
    method public static final javax.xml.xpath.XPathFactory newInstance();
    method public static final javax.xml.xpath.XPathFactory newInstance(String) throws javax.xml.xpath.XPathFactoryConfigurationException;
    method public static javax.xml.xpath.XPathFactory newInstance(String, String, ClassLoader) throws javax.xml.xpath.XPathFactoryConfigurationException;
    method public abstract javax.xml.xpath.XPath newXPath();
    method public abstract void setFeature(String, boolean) throws javax.xml.xpath.XPathFactoryConfigurationException;
    method public abstract void setXPathFunctionResolver(javax.xml.xpath.XPathFunctionResolver);
    method public abstract void setXPathVariableResolver(javax.xml.xpath.XPathVariableResolver);
    field public static final String DEFAULT_OBJECT_MODEL_URI = "http://java.sun.com/jaxp/xpath/dom";
    field public static final String DEFAULT_PROPERTY_NAME = "javax.xml.xpath.XPathFactory";
  }

  public class XPathFactoryConfigurationException extends javax.xml.xpath.XPathException {
    ctor public XPathFactoryConfigurationException(String);
    ctor public XPathFactoryConfigurationException(Throwable);
  }

  public interface XPathFunction {
    method public Object evaluate(java.util.List) throws javax.xml.xpath.XPathFunctionException;
  }

  public class XPathFunctionException extends javax.xml.xpath.XPathExpressionException {
    ctor public XPathFunctionException(String);
    ctor public XPathFunctionException(Throwable);
  }

  public interface XPathFunctionResolver {
    method public javax.xml.xpath.XPathFunction resolveFunction(javax.xml.namespace.QName, int);
  }

  public interface XPathVariableResolver {
    method public Object resolveVariable(javax.xml.namespace.QName);
  }

}

package org.apache.http.conn {

  @Deprecated public class ConnectTimeoutException extends java.io.InterruptedIOException {
    ctor @Deprecated public ConnectTimeoutException();
    ctor @Deprecated public ConnectTimeoutException(String);
  }

}

package org.apache.http.conn.scheme {

  @Deprecated public interface HostNameResolver {
    method @Deprecated public java.net.InetAddress resolve(String) throws java.io.IOException;
  }

  @Deprecated public interface LayeredSocketFactory extends org.apache.http.conn.scheme.SocketFactory {
    method @Deprecated public java.net.Socket createSocket(java.net.Socket, String, int, boolean) throws java.io.IOException, java.net.UnknownHostException;
  }

  @Deprecated public interface SocketFactory {
    method @Deprecated public java.net.Socket connectSocket(java.net.Socket, String, int, java.net.InetAddress, int, org.apache.http.params.HttpParams) throws org.apache.http.conn.ConnectTimeoutException, java.io.IOException, java.net.UnknownHostException;
    method @Deprecated public java.net.Socket createSocket() throws java.io.IOException;
    method @Deprecated public boolean isSecure(java.net.Socket) throws java.lang.IllegalArgumentException;
  }

}

package org.apache.http.conn.ssl {

  @Deprecated public abstract class AbstractVerifier implements org.apache.http.conn.ssl.X509HostnameVerifier {
    ctor @Deprecated public AbstractVerifier();
    method @Deprecated public static boolean acceptableCountryWildcard(String);
    method @Deprecated public static int countDots(String);
    method @Deprecated public static String[] getCNs(java.security.cert.X509Certificate);
    method @Deprecated public static String[] getDNSSubjectAlts(java.security.cert.X509Certificate);
    method @Deprecated public final void verify(String, javax.net.ssl.SSLSocket) throws java.io.IOException;
    method @Deprecated public final boolean verify(String, javax.net.ssl.SSLSession);
    method @Deprecated public final void verify(String, java.security.cert.X509Certificate) throws javax.net.ssl.SSLException;
    method @Deprecated public final void verify(String, String[], String[], boolean) throws javax.net.ssl.SSLException;
  }

  @Deprecated public class AllowAllHostnameVerifier extends org.apache.http.conn.ssl.AbstractVerifier {
    ctor @Deprecated public AllowAllHostnameVerifier();
    method @Deprecated public final String toString();
    method @Deprecated public final void verify(String, String[], String[]);
  }

  @Deprecated public class BrowserCompatHostnameVerifier extends org.apache.http.conn.ssl.AbstractVerifier {
    ctor @Deprecated public BrowserCompatHostnameVerifier();
    method @Deprecated public final String toString();
    method @Deprecated public final void verify(String, String[], String[]) throws javax.net.ssl.SSLException;
  }

  @Deprecated public class SSLSocketFactory implements org.apache.http.conn.scheme.LayeredSocketFactory {
    ctor @Deprecated public SSLSocketFactory(String, java.security.KeyStore, String, java.security.KeyStore, java.security.SecureRandom, org.apache.http.conn.scheme.HostNameResolver) throws java.security.KeyManagementException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    ctor @Deprecated public SSLSocketFactory(java.security.KeyStore, String, java.security.KeyStore) throws java.security.KeyManagementException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    ctor @Deprecated public SSLSocketFactory(java.security.KeyStore, String) throws java.security.KeyManagementException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    ctor @Deprecated public SSLSocketFactory(java.security.KeyStore) throws java.security.KeyManagementException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    method @Deprecated public java.net.Socket connectSocket(java.net.Socket, String, int, java.net.InetAddress, int, org.apache.http.params.HttpParams) throws java.io.IOException;
    method @Deprecated public java.net.Socket createSocket() throws java.io.IOException;
    method @Deprecated public java.net.Socket createSocket(java.net.Socket, String, int, boolean) throws java.io.IOException, java.net.UnknownHostException;
    method @Deprecated public org.apache.http.conn.ssl.X509HostnameVerifier getHostnameVerifier();
    method @Deprecated public static org.apache.http.conn.ssl.SSLSocketFactory getSocketFactory();
    method @Deprecated public boolean isSecure(java.net.Socket) throws java.lang.IllegalArgumentException;
    method @Deprecated public void setHostnameVerifier(org.apache.http.conn.ssl.X509HostnameVerifier);
    field @Deprecated public static final org.apache.http.conn.ssl.X509HostnameVerifier ALLOW_ALL_HOSTNAME_VERIFIER;
    field @Deprecated public static final org.apache.http.conn.ssl.X509HostnameVerifier BROWSER_COMPATIBLE_HOSTNAME_VERIFIER;
    field @Deprecated public static final String SSL = "SSL";
    field @Deprecated public static final String SSLV2 = "SSLv2";
    field @Deprecated public static final org.apache.http.conn.ssl.X509HostnameVerifier STRICT_HOSTNAME_VERIFIER;
    field @Deprecated public static final String TLS = "TLS";
  }

  @Deprecated public class StrictHostnameVerifier extends org.apache.http.conn.ssl.AbstractVerifier {
    ctor @Deprecated public StrictHostnameVerifier();
    method @Deprecated public final String toString();
    method @Deprecated public final void verify(String, String[], String[]) throws javax.net.ssl.SSLException;
  }

  @Deprecated public interface X509HostnameVerifier extends javax.net.ssl.HostnameVerifier {
    method @Deprecated public void verify(String, javax.net.ssl.SSLSocket) throws java.io.IOException;
    method @Deprecated public void verify(String, java.security.cert.X509Certificate) throws javax.net.ssl.SSLException;
    method @Deprecated public void verify(String, String[], String[]) throws javax.net.ssl.SSLException;
  }

}

package org.apache.http.params {

  @Deprecated public interface CoreConnectionPNames {
    field @Deprecated public static final String CONNECTION_TIMEOUT = "http.connection.timeout";
    field @Deprecated public static final String MAX_HEADER_COUNT = "http.connection.max-header-count";
    field @Deprecated public static final String MAX_LINE_LENGTH = "http.connection.max-line-length";
    field @Deprecated public static final String SOCKET_BUFFER_SIZE = "http.socket.buffer-size";
    field @Deprecated public static final String SO_LINGER = "http.socket.linger";
    field @Deprecated public static final String SO_TIMEOUT = "http.socket.timeout";
    field @Deprecated public static final String STALE_CONNECTION_CHECK = "http.connection.stalecheck";
    field @Deprecated public static final String TCP_NODELAY = "http.tcp.nodelay";
  }

  @Deprecated public final class HttpConnectionParams implements org.apache.http.params.CoreConnectionPNames {
    method @Deprecated public static int getConnectionTimeout(org.apache.http.params.HttpParams);
    method @Deprecated public static int getLinger(org.apache.http.params.HttpParams);
    method @Deprecated public static int getSoTimeout(org.apache.http.params.HttpParams);
    method @Deprecated public static int getSocketBufferSize(org.apache.http.params.HttpParams);
    method @Deprecated public static boolean getTcpNoDelay(org.apache.http.params.HttpParams);
    method @Deprecated public static boolean isStaleCheckingEnabled(org.apache.http.params.HttpParams);
    method @Deprecated public static void setConnectionTimeout(org.apache.http.params.HttpParams, int);
    method @Deprecated public static void setLinger(org.apache.http.params.HttpParams, int);
    method @Deprecated public static void setSoTimeout(org.apache.http.params.HttpParams, int);
    method @Deprecated public static void setSocketBufferSize(org.apache.http.params.HttpParams, int);
    method @Deprecated public static void setStaleCheckingEnabled(org.apache.http.params.HttpParams, boolean);
    method @Deprecated public static void setTcpNoDelay(org.apache.http.params.HttpParams, boolean);
  }

  @Deprecated public interface HttpParams {
    method @Deprecated public org.apache.http.params.HttpParams copy();
    method @Deprecated public boolean getBooleanParameter(String, boolean);
    method @Deprecated public double getDoubleParameter(String, double);
    method @Deprecated public int getIntParameter(String, int);
    method @Deprecated public long getLongParameter(String, long);
    method @Deprecated public Object getParameter(String);
    method @Deprecated public boolean isParameterFalse(String);
    method @Deprecated public boolean isParameterTrue(String);
    method @Deprecated public boolean removeParameter(String);
    method @Deprecated public org.apache.http.params.HttpParams setBooleanParameter(String, boolean);
    method @Deprecated public org.apache.http.params.HttpParams setDoubleParameter(String, double);
    method @Deprecated public org.apache.http.params.HttpParams setIntParameter(String, int);
    method @Deprecated public org.apache.http.params.HttpParams setLongParameter(String, long);
    method @Deprecated public org.apache.http.params.HttpParams setParameter(String, Object);
  }

}

package org.json {

  public class JSONArray {
    ctor public JSONArray();
    ctor public JSONArray(java.util.Collection);
    ctor public JSONArray(org.json.JSONTokener) throws org.json.JSONException;
    ctor public JSONArray(String) throws org.json.JSONException;
    ctor public JSONArray(Object) throws org.json.JSONException;
    method public Object get(int) throws org.json.JSONException;
    method public boolean getBoolean(int) throws org.json.JSONException;
    method public double getDouble(int) throws org.json.JSONException;
    method public int getInt(int) throws org.json.JSONException;
    method public org.json.JSONArray getJSONArray(int) throws org.json.JSONException;
    method public org.json.JSONObject getJSONObject(int) throws org.json.JSONException;
    method public long getLong(int) throws org.json.JSONException;
    method public String getString(int) throws org.json.JSONException;
    method public boolean isNull(int);
    method public String join(String) throws org.json.JSONException;
    method public int length();
    method public Object opt(int);
    method public boolean optBoolean(int);
    method public boolean optBoolean(int, boolean);
    method public double optDouble(int);
    method public double optDouble(int, double);
    method public int optInt(int);
    method public int optInt(int, int);
    method public org.json.JSONArray optJSONArray(int);
    method public org.json.JSONObject optJSONObject(int);
    method public long optLong(int);
    method public long optLong(int, long);
    method public String optString(int);
    method public String optString(int, String);
    method public org.json.JSONArray put(boolean);
    method public org.json.JSONArray put(double) throws org.json.JSONException;
    method public org.json.JSONArray put(int);
    method public org.json.JSONArray put(long);
    method public org.json.JSONArray put(Object);
    method public org.json.JSONArray put(int, boolean) throws org.json.JSONException;
    method public org.json.JSONArray put(int, double) throws org.json.JSONException;
    method public org.json.JSONArray put(int, int) throws org.json.JSONException;
    method public org.json.JSONArray put(int, long) throws org.json.JSONException;
    method public org.json.JSONArray put(int, Object) throws org.json.JSONException;
    method public Object remove(int);
    method public org.json.JSONObject toJSONObject(org.json.JSONArray) throws org.json.JSONException;
    method public String toString(int) throws org.json.JSONException;
  }

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

  public class JSONObject {
    ctor public JSONObject();
    ctor public JSONObject(@NonNull java.util.Map);
    ctor public JSONObject(@NonNull org.json.JSONTokener) throws org.json.JSONException;
    ctor public JSONObject(@NonNull String) throws org.json.JSONException;
    ctor public JSONObject(@NonNull org.json.JSONObject, @NonNull String[]) throws org.json.JSONException;
    method @NonNull public org.json.JSONObject accumulate(@NonNull String, @Nullable Object) throws org.json.JSONException;
    method @NonNull public Object get(@NonNull String) throws org.json.JSONException;
    method public boolean getBoolean(@NonNull String) throws org.json.JSONException;
    method public double getDouble(@NonNull String) throws org.json.JSONException;
    method public int getInt(@NonNull String) throws org.json.JSONException;
    method @NonNull public org.json.JSONArray getJSONArray(@NonNull String) throws org.json.JSONException;
    method @NonNull public org.json.JSONObject getJSONObject(@NonNull String) throws org.json.JSONException;
    method public long getLong(@NonNull String) throws org.json.JSONException;
    method @NonNull public String getString(@NonNull String) throws org.json.JSONException;
    method public boolean has(@Nullable String);
    method public boolean isNull(@Nullable String);
    method @NonNull public java.util.Iterator<java.lang.String> keys();
    method public int length();
    method @Nullable public org.json.JSONArray names();
    method @NonNull public static String numberToString(@NonNull Number) throws org.json.JSONException;
    method @Nullable public Object opt(@Nullable String);
    method public boolean optBoolean(@Nullable String);
    method public boolean optBoolean(@Nullable String, boolean);
    method public double optDouble(@Nullable String);
    method public double optDouble(@Nullable String, double);
    method public int optInt(@Nullable String);
    method public int optInt(@Nullable String, int);
    method @Nullable public org.json.JSONArray optJSONArray(@Nullable String);
    method @Nullable public org.json.JSONObject optJSONObject(@Nullable String);
    method public long optLong(@Nullable String);
    method public long optLong(@Nullable String, long);
    method @NonNull public String optString(@Nullable String);
    method @NonNull public String optString(@Nullable String, @NonNull String);
    method @NonNull public org.json.JSONObject put(@NonNull String, boolean) throws org.json.JSONException;
    method @NonNull public org.json.JSONObject put(@NonNull String, double) throws org.json.JSONException;
    method @NonNull public org.json.JSONObject put(@NonNull String, int) throws org.json.JSONException;
    method @NonNull public org.json.JSONObject put(@NonNull String, long) throws org.json.JSONException;
    method @NonNull public org.json.JSONObject put(@NonNull String, @Nullable Object) throws org.json.JSONException;
    method @NonNull public org.json.JSONObject putOpt(@Nullable String, @Nullable Object) throws org.json.JSONException;
    method @NonNull public static String quote(@Nullable String);
    method @Nullable public Object remove(@Nullable String);
    method @Nullable public org.json.JSONArray toJSONArray(@Nullable org.json.JSONArray) throws org.json.JSONException;
    method @NonNull public String toString(int) throws org.json.JSONException;
    method @Nullable public static Object wrap(@Nullable Object);
    field @NonNull public static final Object NULL;
  }

  public class JSONStringer {
    ctor public JSONStringer();
    method public org.json.JSONStringer array() throws org.json.JSONException;
    method public org.json.JSONStringer endArray() throws org.json.JSONException;
    method public org.json.JSONStringer endObject() throws org.json.JSONException;
    method public org.json.JSONStringer key(String) throws org.json.JSONException;
    method public org.json.JSONStringer object() throws org.json.JSONException;
    method public org.json.JSONStringer value(Object) throws org.json.JSONException;
    method public org.json.JSONStringer value(boolean) throws org.json.JSONException;
    method public org.json.JSONStringer value(double) throws org.json.JSONException;
    method public org.json.JSONStringer value(long) throws org.json.JSONException;
  }

  public class JSONTokener {
    ctor public JSONTokener(String);
    method public void back();
    method public static int dehexchar(char);
    method public boolean more();
    method public char next();
    method public char next(char) throws org.json.JSONException;
    method public String next(int) throws org.json.JSONException;
    method public char nextClean() throws org.json.JSONException;
    method public String nextString(char) throws org.json.JSONException;
    method public String nextTo(String);
    method public String nextTo(char);
    method public Object nextValue() throws org.json.JSONException;
    method public void skipPast(String);
    method public char skipTo(char);
    method public org.json.JSONException syntaxError(String);
  }

}

package org.w3c.dom {

  public interface Attr extends org.w3c.dom.Node {
    method public String getName();
    method public org.w3c.dom.Element getOwnerElement();
    method public org.w3c.dom.TypeInfo getSchemaTypeInfo();
    method public boolean getSpecified();
    method public String getValue();
    method public boolean isId();
    method public void setValue(String) throws org.w3c.dom.DOMException;
  }

  public interface CDATASection extends org.w3c.dom.Text {
  }

  public interface CharacterData extends org.w3c.dom.Node {
    method public void appendData(String) throws org.w3c.dom.DOMException;
    method public void deleteData(int, int) throws org.w3c.dom.DOMException;
    method public String getData() throws org.w3c.dom.DOMException;
    method public int getLength();
    method public void insertData(int, String) throws org.w3c.dom.DOMException;
    method public void replaceData(int, int, String) throws org.w3c.dom.DOMException;
    method public void setData(String) throws org.w3c.dom.DOMException;
    method public String substringData(int, int) throws org.w3c.dom.DOMException;
  }

  public interface Comment extends org.w3c.dom.CharacterData {
  }

  public interface DOMConfiguration {
    method public boolean canSetParameter(String, Object);
    method public Object getParameter(String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.DOMStringList getParameterNames();
    method public void setParameter(String, Object) throws org.w3c.dom.DOMException;
  }

  public interface DOMError {
    method public org.w3c.dom.DOMLocator getLocation();
    method public String getMessage();
    method public Object getRelatedData();
    method public Object getRelatedException();
    method public short getSeverity();
    method public String getType();
    field public static final short SEVERITY_ERROR = 2; // 0x2
    field public static final short SEVERITY_FATAL_ERROR = 3; // 0x3
    field public static final short SEVERITY_WARNING = 1; // 0x1
  }

  public interface DOMErrorHandler {
    method public boolean handleError(org.w3c.dom.DOMError);
  }

  public class DOMException extends java.lang.RuntimeException {
    ctor public DOMException(short, String);
    field public static final short DOMSTRING_SIZE_ERR = 2; // 0x2
    field public static final short HIERARCHY_REQUEST_ERR = 3; // 0x3
    field public static final short INDEX_SIZE_ERR = 1; // 0x1
    field public static final short INUSE_ATTRIBUTE_ERR = 10; // 0xa
    field public static final short INVALID_ACCESS_ERR = 15; // 0xf
    field public static final short INVALID_CHARACTER_ERR = 5; // 0x5
    field public static final short INVALID_MODIFICATION_ERR = 13; // 0xd
    field public static final short INVALID_STATE_ERR = 11; // 0xb
    field public static final short NAMESPACE_ERR = 14; // 0xe
    field public static final short NOT_FOUND_ERR = 8; // 0x8
    field public static final short NOT_SUPPORTED_ERR = 9; // 0x9
    field public static final short NO_DATA_ALLOWED_ERR = 6; // 0x6
    field public static final short NO_MODIFICATION_ALLOWED_ERR = 7; // 0x7
    field public static final short SYNTAX_ERR = 12; // 0xc
    field public static final short TYPE_MISMATCH_ERR = 17; // 0x11
    field public static final short VALIDATION_ERR = 16; // 0x10
    field public static final short WRONG_DOCUMENT_ERR = 4; // 0x4
    field public short code;
  }

  public interface DOMImplementation {
    method public org.w3c.dom.Document createDocument(String, String, org.w3c.dom.DocumentType) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.DocumentType createDocumentType(String, String, String) throws org.w3c.dom.DOMException;
    method public Object getFeature(String, String);
    method public boolean hasFeature(String, String);
  }

  public interface DOMImplementationList {
    method public int getLength();
    method public org.w3c.dom.DOMImplementation item(int);
  }

  public interface DOMImplementationSource {
    method public org.w3c.dom.DOMImplementation getDOMImplementation(String);
    method public org.w3c.dom.DOMImplementationList getDOMImplementationList(String);
  }

  public interface DOMLocator {
    method public int getByteOffset();
    method public int getColumnNumber();
    method public int getLineNumber();
    method public org.w3c.dom.Node getRelatedNode();
    method public String getUri();
    method public int getUtf16Offset();
  }

  public interface DOMStringList {
    method public boolean contains(String);
    method public int getLength();
    method public String item(int);
  }

  public interface Document extends org.w3c.dom.Node {
    method public org.w3c.dom.Node adoptNode(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Attr createAttribute(String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Attr createAttributeNS(String, String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.CDATASection createCDATASection(String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Comment createComment(String);
    method public org.w3c.dom.DocumentFragment createDocumentFragment();
    method public org.w3c.dom.Element createElement(String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Element createElementNS(String, String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.EntityReference createEntityReference(String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.ProcessingInstruction createProcessingInstruction(String, String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Text createTextNode(String);
    method public org.w3c.dom.DocumentType getDoctype();
    method public org.w3c.dom.Element getDocumentElement();
    method public String getDocumentURI();
    method public org.w3c.dom.DOMConfiguration getDomConfig();
    method public org.w3c.dom.Element getElementById(String);
    method public org.w3c.dom.NodeList getElementsByTagName(String);
    method public org.w3c.dom.NodeList getElementsByTagNameNS(String, String);
    method public org.w3c.dom.DOMImplementation getImplementation();
    method public String getInputEncoding();
    method public boolean getStrictErrorChecking();
    method public String getXmlEncoding();
    method public boolean getXmlStandalone();
    method public String getXmlVersion();
    method public org.w3c.dom.Node importNode(org.w3c.dom.Node, boolean) throws org.w3c.dom.DOMException;
    method public void normalizeDocument();
    method public org.w3c.dom.Node renameNode(org.w3c.dom.Node, String, String) throws org.w3c.dom.DOMException;
    method public void setDocumentURI(String);
    method public void setStrictErrorChecking(boolean);
    method public void setXmlStandalone(boolean) throws org.w3c.dom.DOMException;
    method public void setXmlVersion(String) throws org.w3c.dom.DOMException;
  }

  public interface DocumentFragment extends org.w3c.dom.Node {
  }

  public interface DocumentType extends org.w3c.dom.Node {
    method public org.w3c.dom.NamedNodeMap getEntities();
    method public String getInternalSubset();
    method public String getName();
    method public org.w3c.dom.NamedNodeMap getNotations();
    method public String getPublicId();
    method public String getSystemId();
  }

  public interface Element extends org.w3c.dom.Node {
    method public String getAttribute(String);
    method public String getAttributeNS(String, String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Attr getAttributeNode(String);
    method public org.w3c.dom.Attr getAttributeNodeNS(String, String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.NodeList getElementsByTagName(String);
    method public org.w3c.dom.NodeList getElementsByTagNameNS(String, String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.TypeInfo getSchemaTypeInfo();
    method public String getTagName();
    method public boolean hasAttribute(String);
    method public boolean hasAttributeNS(String, String) throws org.w3c.dom.DOMException;
    method public void removeAttribute(String) throws org.w3c.dom.DOMException;
    method public void removeAttributeNS(String, String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr) throws org.w3c.dom.DOMException;
    method public void setAttribute(String, String) throws org.w3c.dom.DOMException;
    method public void setAttributeNS(String, String, String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr) throws org.w3c.dom.DOMException;
    method public void setIdAttribute(String, boolean) throws org.w3c.dom.DOMException;
    method public void setIdAttributeNS(String, String, boolean) throws org.w3c.dom.DOMException;
    method public void setIdAttributeNode(org.w3c.dom.Attr, boolean) throws org.w3c.dom.DOMException;
  }

  public interface Entity extends org.w3c.dom.Node {
    method public String getInputEncoding();
    method public String getNotationName();
    method public String getPublicId();
    method public String getSystemId();
    method public String getXmlEncoding();
    method public String getXmlVersion();
  }

  public interface EntityReference extends org.w3c.dom.Node {
  }

  public interface NameList {
    method public boolean contains(String);
    method public boolean containsNS(String, String);
    method public int getLength();
    method public String getName(int);
    method public String getNamespaceURI(int);
  }

  public interface NamedNodeMap {
    method public int getLength();
    method public org.w3c.dom.Node getNamedItem(String);
    method public org.w3c.dom.Node getNamedItemNS(String, String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Node item(int);
    method public org.w3c.dom.Node removeNamedItem(String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Node removeNamedItemNS(String, String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Node setNamedItem(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Node setNamedItemNS(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
  }

  public interface Node {
    method public org.w3c.dom.Node appendChild(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Node cloneNode(boolean);
    method public short compareDocumentPosition(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.NamedNodeMap getAttributes();
    method public String getBaseURI();
    method public org.w3c.dom.NodeList getChildNodes();
    method public Object getFeature(String, String);
    method public org.w3c.dom.Node getFirstChild();
    method public org.w3c.dom.Node getLastChild();
    method public String getLocalName();
    method public String getNamespaceURI();
    method public org.w3c.dom.Node getNextSibling();
    method public String getNodeName();
    method public short getNodeType();
    method public String getNodeValue() throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Document getOwnerDocument();
    method public org.w3c.dom.Node getParentNode();
    method public String getPrefix();
    method public org.w3c.dom.Node getPreviousSibling();
    method public String getTextContent() throws org.w3c.dom.DOMException;
    method public Object getUserData(String);
    method public boolean hasAttributes();
    method public boolean hasChildNodes();
    method public org.w3c.dom.Node insertBefore(org.w3c.dom.Node, org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public boolean isDefaultNamespace(String);
    method public boolean isEqualNode(org.w3c.dom.Node);
    method public boolean isSameNode(org.w3c.dom.Node);
    method public boolean isSupported(String, String);
    method public String lookupNamespaceURI(String);
    method public String lookupPrefix(String);
    method public void normalize();
    method public org.w3c.dom.Node removeChild(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Node replaceChild(org.w3c.dom.Node, org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public void setNodeValue(String) throws org.w3c.dom.DOMException;
    method public void setPrefix(String) throws org.w3c.dom.DOMException;
    method public void setTextContent(String) throws org.w3c.dom.DOMException;
    method public Object setUserData(String, Object, org.w3c.dom.UserDataHandler);
    field public static final short ATTRIBUTE_NODE = 2; // 0x2
    field public static final short CDATA_SECTION_NODE = 4; // 0x4
    field public static final short COMMENT_NODE = 8; // 0x8
    field public static final short DOCUMENT_FRAGMENT_NODE = 11; // 0xb
    field public static final short DOCUMENT_NODE = 9; // 0x9
    field public static final short DOCUMENT_POSITION_CONTAINED_BY = 16; // 0x10
    field public static final short DOCUMENT_POSITION_CONTAINS = 8; // 0x8
    field public static final short DOCUMENT_POSITION_DISCONNECTED = 1; // 0x1
    field public static final short DOCUMENT_POSITION_FOLLOWING = 4; // 0x4
    field public static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32; // 0x20
    field public static final short DOCUMENT_POSITION_PRECEDING = 2; // 0x2
    field public static final short DOCUMENT_TYPE_NODE = 10; // 0xa
    field public static final short ELEMENT_NODE = 1; // 0x1
    field public static final short ENTITY_NODE = 6; // 0x6
    field public static final short ENTITY_REFERENCE_NODE = 5; // 0x5
    field public static final short NOTATION_NODE = 12; // 0xc
    field public static final short PROCESSING_INSTRUCTION_NODE = 7; // 0x7
    field public static final short TEXT_NODE = 3; // 0x3
  }

  public interface NodeList {
    method public int getLength();
    method public org.w3c.dom.Node item(int);
  }

  public interface Notation extends org.w3c.dom.Node {
    method public String getPublicId();
    method public String getSystemId();
  }

  public interface ProcessingInstruction extends org.w3c.dom.Node {
    method public String getData();
    method public String getTarget();
    method public void setData(String) throws org.w3c.dom.DOMException;
  }

  public interface Text extends org.w3c.dom.CharacterData {
    method public String getWholeText();
    method public boolean isElementContentWhitespace();
    method public org.w3c.dom.Text replaceWholeText(String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.Text splitText(int) throws org.w3c.dom.DOMException;
  }

  public interface TypeInfo {
    method public String getTypeName();
    method public String getTypeNamespace();
    method public boolean isDerivedFrom(String, String, int);
    field public static final int DERIVATION_EXTENSION = 2; // 0x2
    field public static final int DERIVATION_LIST = 8; // 0x8
    field public static final int DERIVATION_RESTRICTION = 1; // 0x1
    field public static final int DERIVATION_UNION = 4; // 0x4
  }

  public interface UserDataHandler {
    method public void handle(short, String, Object, org.w3c.dom.Node, org.w3c.dom.Node);
    field public static final short NODE_ADOPTED = 5; // 0x5
    field public static final short NODE_CLONED = 1; // 0x1
    field public static final short NODE_DELETED = 3; // 0x3
    field public static final short NODE_IMPORTED = 2; // 0x2
    field public static final short NODE_RENAMED = 4; // 0x4
  }

}

package org.w3c.dom.ls {

  public interface DOMImplementationLS {
    method public org.w3c.dom.ls.LSInput createLSInput();
    method public org.w3c.dom.ls.LSOutput createLSOutput();
    method public org.w3c.dom.ls.LSParser createLSParser(short, String) throws org.w3c.dom.DOMException;
    method public org.w3c.dom.ls.LSSerializer createLSSerializer();
    field public static final short MODE_ASYNCHRONOUS = 2; // 0x2
    field public static final short MODE_SYNCHRONOUS = 1; // 0x1
  }

  public class LSException extends java.lang.RuntimeException {
    ctor public LSException(short, String);
    field public static final short PARSE_ERR = 81; // 0x51
    field public static final short SERIALIZE_ERR = 82; // 0x52
    field public short code;
  }

  public interface LSInput {
    method public String getBaseURI();
    method public java.io.InputStream getByteStream();
    method public boolean getCertifiedText();
    method public java.io.Reader getCharacterStream();
    method public String getEncoding();
    method public String getPublicId();
    method public String getStringData();
    method public String getSystemId();
    method public void setBaseURI(String);
    method public void setByteStream(java.io.InputStream);
    method public void setCertifiedText(boolean);
    method public void setCharacterStream(java.io.Reader);
    method public void setEncoding(String);
    method public void setPublicId(String);
    method public void setStringData(String);
    method public void setSystemId(String);
  }

  public interface LSOutput {
    method public java.io.OutputStream getByteStream();
    method public java.io.Writer getCharacterStream();
    method public String getEncoding();
    method public String getSystemId();
    method public void setByteStream(java.io.OutputStream);
    method public void setCharacterStream(java.io.Writer);
    method public void setEncoding(String);
    method public void setSystemId(String);
  }

  public interface LSParser {
    method public void abort();
    method public boolean getAsync();
    method public boolean getBusy();
    method public org.w3c.dom.DOMConfiguration getDomConfig();
    method public org.w3c.dom.ls.LSParserFilter getFilter();
    method public org.w3c.dom.Document parse(org.w3c.dom.ls.LSInput) throws org.w3c.dom.DOMException, org.w3c.dom.ls.LSException;
    method public org.w3c.dom.Document parseURI(String) throws org.w3c.dom.DOMException, org.w3c.dom.ls.LSException;
    method public org.w3c.dom.Node parseWithContext(org.w3c.dom.ls.LSInput, org.w3c.dom.Node, short) throws org.w3c.dom.DOMException, org.w3c.dom.ls.LSException;
    method public void setFilter(org.w3c.dom.ls.LSParserFilter);
    field public static final short ACTION_APPEND_AS_CHILDREN = 1; // 0x1
    field public static final short ACTION_INSERT_AFTER = 4; // 0x4
    field public static final short ACTION_INSERT_BEFORE = 3; // 0x3
    field public static final short ACTION_REPLACE = 5; // 0x5
    field public static final short ACTION_REPLACE_CHILDREN = 2; // 0x2
  }

  public interface LSParserFilter {
    method public short acceptNode(org.w3c.dom.Node);
    method public int getWhatToShow();
    method public short startElement(org.w3c.dom.Element);
    field public static final short FILTER_ACCEPT = 1; // 0x1
    field public static final short FILTER_INTERRUPT = 4; // 0x4
    field public static final short FILTER_REJECT = 2; // 0x2
    field public static final short FILTER_SKIP = 3; // 0x3
  }

  public interface LSResourceResolver {
    method public org.w3c.dom.ls.LSInput resolveResource(String, String, String, String, String);
  }

  public interface LSSerializer {
    method public org.w3c.dom.DOMConfiguration getDomConfig();
    method public String getNewLine();
    method public void setNewLine(String);
    method public boolean write(org.w3c.dom.Node, org.w3c.dom.ls.LSOutput) throws org.w3c.dom.ls.LSException;
    method public String writeToString(org.w3c.dom.Node) throws org.w3c.dom.DOMException, org.w3c.dom.ls.LSException;
    method public boolean writeToURI(org.w3c.dom.Node, String) throws org.w3c.dom.ls.LSException;
  }

}

package org.xml.sax {

  @Deprecated public interface AttributeList {
    method @Deprecated public int getLength();
    method @Deprecated public String getName(int);
    method @Deprecated public String getType(int);
    method @Deprecated public String getType(String);
    method @Deprecated public String getValue(int);
    method @Deprecated public String getValue(String);
  }

  public interface Attributes {
    method public int getIndex(String, String);
    method public int getIndex(String);
    method public int getLength();
    method public String getLocalName(int);
    method public String getQName(int);
    method public String getType(int);
    method public String getType(String, String);
    method public String getType(String);
    method public String getURI(int);
    method public String getValue(int);
    method public String getValue(String, String);
    method public String getValue(String);
  }

  public interface ContentHandler {
    method public void characters(char[], int, int) throws org.xml.sax.SAXException;
    method public void endDocument() throws org.xml.sax.SAXException;
    method public void endElement(String, String, String) throws org.xml.sax.SAXException;
    method public void endPrefixMapping(String) throws org.xml.sax.SAXException;
    method public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
    method public void processingInstruction(String, String) throws org.xml.sax.SAXException;
    method public void setDocumentLocator(org.xml.sax.Locator);
    method public void skippedEntity(String) throws org.xml.sax.SAXException;
    method public void startDocument() throws org.xml.sax.SAXException;
    method public void startElement(String, String, String, org.xml.sax.Attributes) throws org.xml.sax.SAXException;
    method public void startPrefixMapping(String, String) throws org.xml.sax.SAXException;
  }

  public interface DTDHandler {
    method public void notationDecl(String, String, String) throws org.xml.sax.SAXException;
    method public void unparsedEntityDecl(String, String, String, String) throws org.xml.sax.SAXException;
  }

  @Deprecated public interface DocumentHandler {
    method @Deprecated public void characters(char[], int, int) throws org.xml.sax.SAXException;
    method @Deprecated public void endDocument() throws org.xml.sax.SAXException;
    method @Deprecated public void endElement(String) throws org.xml.sax.SAXException;
    method @Deprecated public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
    method @Deprecated public void processingInstruction(String, String) throws org.xml.sax.SAXException;
    method @Deprecated public void setDocumentLocator(org.xml.sax.Locator);
    method @Deprecated public void startDocument() throws org.xml.sax.SAXException;
    method @Deprecated public void startElement(String, org.xml.sax.AttributeList) throws org.xml.sax.SAXException;
  }

  public interface EntityResolver {
    method public org.xml.sax.InputSource resolveEntity(String, String) throws java.io.IOException, org.xml.sax.SAXException;
  }

  public interface ErrorHandler {
    method public void error(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
    method public void fatalError(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
    method public void warning(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
  }

  @Deprecated public class HandlerBase implements org.xml.sax.DTDHandler org.xml.sax.DocumentHandler org.xml.sax.EntityResolver org.xml.sax.ErrorHandler {
    ctor @Deprecated public HandlerBase();
    method @Deprecated public void characters(char[], int, int) throws org.xml.sax.SAXException;
    method @Deprecated public void endDocument() throws org.xml.sax.SAXException;
    method @Deprecated public void endElement(String) throws org.xml.sax.SAXException;
    method @Deprecated public void error(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
    method @Deprecated public void fatalError(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
    method @Deprecated public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
    method @Deprecated public void notationDecl(String, String, String);
    method @Deprecated public void processingInstruction(String, String) throws org.xml.sax.SAXException;
    method @Deprecated public org.xml.sax.InputSource resolveEntity(String, String) throws org.xml.sax.SAXException;
    method @Deprecated public void setDocumentLocator(org.xml.sax.Locator);
    method @Deprecated public void startDocument() throws org.xml.sax.SAXException;
    method @Deprecated public void startElement(String, org.xml.sax.AttributeList) throws org.xml.sax.SAXException;
    method @Deprecated public void unparsedEntityDecl(String, String, String, String);
    method @Deprecated public void warning(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
  }

  public class InputSource {
    ctor public InputSource();
    ctor public InputSource(String);
    ctor public InputSource(java.io.InputStream);
    ctor public InputSource(java.io.Reader);
    method public java.io.InputStream getByteStream();
    method public java.io.Reader getCharacterStream();
    method public String getEncoding();
    method public String getPublicId();
    method public String getSystemId();
    method public void setByteStream(java.io.InputStream);
    method public void setCharacterStream(java.io.Reader);
    method public void setEncoding(String);
    method public void setPublicId(String);
    method public void setSystemId(String);
  }

  public interface Locator {
    method public int getColumnNumber();
    method public int getLineNumber();
    method public String getPublicId();
    method public String getSystemId();
  }

  @Deprecated public interface Parser {
    method @Deprecated public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
    method @Deprecated public void parse(String) throws java.io.IOException, org.xml.sax.SAXException;
    method @Deprecated public void setDTDHandler(org.xml.sax.DTDHandler);
    method @Deprecated public void setDocumentHandler(org.xml.sax.DocumentHandler);
    method @Deprecated public void setEntityResolver(org.xml.sax.EntityResolver);
    method @Deprecated public void setErrorHandler(org.xml.sax.ErrorHandler);
    method @Deprecated public void setLocale(java.util.Locale) throws org.xml.sax.SAXException;
  }

  public class SAXException extends java.lang.Exception {
    ctor public SAXException();
    ctor public SAXException(String);
    ctor public SAXException(Exception);
    ctor public SAXException(String, Exception);
    method public Exception getException();
  }

  public class SAXNotRecognizedException extends org.xml.sax.SAXException {
    ctor public SAXNotRecognizedException();
    ctor public SAXNotRecognizedException(String);
  }

  public class SAXNotSupportedException extends org.xml.sax.SAXException {
    ctor public SAXNotSupportedException();
    ctor public SAXNotSupportedException(String);
  }

  public class SAXParseException extends org.xml.sax.SAXException {
    ctor public SAXParseException(String, org.xml.sax.Locator);
    ctor public SAXParseException(String, org.xml.sax.Locator, Exception);
    ctor public SAXParseException(String, String, String, int, int);
    ctor public SAXParseException(String, String, String, int, int, Exception);
    method public int getColumnNumber();
    method public int getLineNumber();
    method public String getPublicId();
    method public String getSystemId();
  }

  public interface XMLFilter extends org.xml.sax.XMLReader {
    method public org.xml.sax.XMLReader getParent();
    method public void setParent(org.xml.sax.XMLReader);
  }

  public interface XMLReader {
    method public org.xml.sax.ContentHandler getContentHandler();
    method public org.xml.sax.DTDHandler getDTDHandler();
    method public org.xml.sax.EntityResolver getEntityResolver();
    method public org.xml.sax.ErrorHandler getErrorHandler();
    method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void setContentHandler(org.xml.sax.ContentHandler);
    method public void setDTDHandler(org.xml.sax.DTDHandler);
    method public void setEntityResolver(org.xml.sax.EntityResolver);
    method public void setErrorHandler(org.xml.sax.ErrorHandler);
    method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
  }

}

package org.xml.sax.ext {

  public interface Attributes2 extends org.xml.sax.Attributes {
    method public boolean isDeclared(int);
    method public boolean isDeclared(String);
    method public boolean isDeclared(String, String);
    method public boolean isSpecified(int);
    method public boolean isSpecified(String, String);
    method public boolean isSpecified(String);
  }

  public class Attributes2Impl extends org.xml.sax.helpers.AttributesImpl implements org.xml.sax.ext.Attributes2 {
    ctor public Attributes2Impl();
    ctor public Attributes2Impl(org.xml.sax.Attributes);
    method public boolean isDeclared(int);
    method public boolean isDeclared(String, String);
    method public boolean isDeclared(String);
    method public boolean isSpecified(int);
    method public boolean isSpecified(String, String);
    method public boolean isSpecified(String);
    method public void setDeclared(int, boolean);
    method public void setSpecified(int, boolean);
  }

  public interface DeclHandler {
    method public void attributeDecl(String, String, String, String, String) throws org.xml.sax.SAXException;
    method public void elementDecl(String, String) throws org.xml.sax.SAXException;
    method public void externalEntityDecl(String, String, String) throws org.xml.sax.SAXException;
    method public void internalEntityDecl(String, String) throws org.xml.sax.SAXException;
  }

  public class DefaultHandler2 extends org.xml.sax.helpers.DefaultHandler implements org.xml.sax.ext.DeclHandler org.xml.sax.ext.EntityResolver2 org.xml.sax.ext.LexicalHandler {
    ctor public DefaultHandler2();
    method public void attributeDecl(String, String, String, String, String) throws org.xml.sax.SAXException;
    method public void comment(char[], int, int) throws org.xml.sax.SAXException;
    method public void elementDecl(String, String) throws org.xml.sax.SAXException;
    method public void endCDATA() throws org.xml.sax.SAXException;
    method public void endDTD() throws org.xml.sax.SAXException;
    method public void endEntity(String) throws org.xml.sax.SAXException;
    method public void externalEntityDecl(String, String, String) throws org.xml.sax.SAXException;
    method public org.xml.sax.InputSource getExternalSubset(String, String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void internalEntityDecl(String, String) throws org.xml.sax.SAXException;
    method public org.xml.sax.InputSource resolveEntity(String, String, String, String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void startCDATA() throws org.xml.sax.SAXException;
    method public void startDTD(String, String, String) throws org.xml.sax.SAXException;
    method public void startEntity(String) throws org.xml.sax.SAXException;
  }

  public interface EntityResolver2 extends org.xml.sax.EntityResolver {
    method public org.xml.sax.InputSource getExternalSubset(String, String) throws java.io.IOException, org.xml.sax.SAXException;
    method public org.xml.sax.InputSource resolveEntity(String, String, String, String) throws java.io.IOException, org.xml.sax.SAXException;
  }

  public interface LexicalHandler {
    method public void comment(char[], int, int) throws org.xml.sax.SAXException;
    method public void endCDATA() throws org.xml.sax.SAXException;
    method public void endDTD() throws org.xml.sax.SAXException;
    method public void endEntity(String) throws org.xml.sax.SAXException;
    method public void startCDATA() throws org.xml.sax.SAXException;
    method public void startDTD(String, String, String) throws org.xml.sax.SAXException;
    method public void startEntity(String) throws org.xml.sax.SAXException;
  }

  public interface Locator2 extends org.xml.sax.Locator {
    method public String getEncoding();
    method public String getXMLVersion();
  }

  public class Locator2Impl extends org.xml.sax.helpers.LocatorImpl implements org.xml.sax.ext.Locator2 {
    ctor public Locator2Impl();
    ctor public Locator2Impl(org.xml.sax.Locator);
    method public String getEncoding();
    method public String getXMLVersion();
    method public void setEncoding(String);
    method public void setXMLVersion(String);
  }

}

package org.xml.sax.helpers {

  @Deprecated public class AttributeListImpl implements org.xml.sax.AttributeList {
    ctor @Deprecated public AttributeListImpl();
    ctor @Deprecated public AttributeListImpl(org.xml.sax.AttributeList);
    method @Deprecated public void addAttribute(String, String, String);
    method @Deprecated public void clear();
    method @Deprecated public int getLength();
    method @Deprecated public String getName(int);
    method @Deprecated public String getType(int);
    method @Deprecated public String getType(String);
    method @Deprecated public String getValue(int);
    method @Deprecated public String getValue(String);
    method @Deprecated public void removeAttribute(String);
    method @Deprecated public void setAttributeList(org.xml.sax.AttributeList);
  }

  public class AttributesImpl implements org.xml.sax.Attributes {
    ctor public AttributesImpl();
    ctor public AttributesImpl(org.xml.sax.Attributes);
    method public void addAttribute(String, String, String, String, String);
    method public void clear();
    method public int getIndex(String, String);
    method public int getIndex(String);
    method public int getLength();
    method public String getLocalName(int);
    method public String getQName(int);
    method public String getType(int);
    method public String getType(String, String);
    method public String getType(String);
    method public String getURI(int);
    method public String getValue(int);
    method public String getValue(String, String);
    method public String getValue(String);
    method public void removeAttribute(int);
    method public void setAttribute(int, String, String, String, String, String);
    method public void setAttributes(org.xml.sax.Attributes);
    method public void setLocalName(int, String);
    method public void setQName(int, String);
    method public void setType(int, String);
    method public void setURI(int, String);
    method public void setValue(int, String);
  }

  public class DefaultHandler implements org.xml.sax.ContentHandler org.xml.sax.DTDHandler org.xml.sax.EntityResolver org.xml.sax.ErrorHandler {
    ctor public DefaultHandler();
    method public void characters(char[], int, int) throws org.xml.sax.SAXException;
    method public void endDocument() throws org.xml.sax.SAXException;
    method public void endElement(String, String, String) throws org.xml.sax.SAXException;
    method public void endPrefixMapping(String) throws org.xml.sax.SAXException;
    method public void error(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
    method public void fatalError(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
    method public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
    method public void notationDecl(String, String, String) throws org.xml.sax.SAXException;
    method public void processingInstruction(String, String) throws org.xml.sax.SAXException;
    method public org.xml.sax.InputSource resolveEntity(String, String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void setDocumentLocator(org.xml.sax.Locator);
    method public void skippedEntity(String) throws org.xml.sax.SAXException;
    method public void startDocument() throws org.xml.sax.SAXException;
    method public void startElement(String, String, String, org.xml.sax.Attributes) throws org.xml.sax.SAXException;
    method public void startPrefixMapping(String, String) throws org.xml.sax.SAXException;
    method public void unparsedEntityDecl(String, String, String, String) throws org.xml.sax.SAXException;
    method public void warning(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
  }

  public class LocatorImpl implements org.xml.sax.Locator {
    ctor public LocatorImpl();
    ctor public LocatorImpl(org.xml.sax.Locator);
    method public int getColumnNumber();
    method public int getLineNumber();
    method public String getPublicId();
    method public String getSystemId();
    method public void setColumnNumber(int);
    method public void setLineNumber(int);
    method public void setPublicId(String);
    method public void setSystemId(String);
  }

  public class NamespaceSupport {
    ctor public NamespaceSupport();
    method public boolean declarePrefix(String, String);
    method public java.util.Enumeration getDeclaredPrefixes();
    method public String getPrefix(String);
    method public java.util.Enumeration getPrefixes();
    method public java.util.Enumeration getPrefixes(String);
    method public String getURI(String);
    method public boolean isNamespaceDeclUris();
    method public void popContext();
    method public String[] processName(String, String[], boolean);
    method public void pushContext();
    method public void reset();
    method public void setNamespaceDeclUris(boolean);
    field public static final String NSDECL = "http://www.w3.org/xmlns/2000/";
    field public static final String XMLNS = "http://www.w3.org/XML/1998/namespace";
  }

  public class ParserAdapter implements org.xml.sax.DocumentHandler org.xml.sax.XMLReader {
    ctor public ParserAdapter() throws org.xml.sax.SAXException;
    ctor public ParserAdapter(org.xml.sax.Parser);
    method public void characters(char[], int, int) throws org.xml.sax.SAXException;
    method public void endDocument() throws org.xml.sax.SAXException;
    method public void endElement(String) throws org.xml.sax.SAXException;
    method public org.xml.sax.ContentHandler getContentHandler();
    method public org.xml.sax.DTDHandler getDTDHandler();
    method public org.xml.sax.EntityResolver getEntityResolver();
    method public org.xml.sax.ErrorHandler getErrorHandler();
    method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
    method public void parse(String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
    method public void processingInstruction(String, String) throws org.xml.sax.SAXException;
    method public void setContentHandler(org.xml.sax.ContentHandler);
    method public void setDTDHandler(org.xml.sax.DTDHandler);
    method public void setDocumentLocator(org.xml.sax.Locator);
    method public void setEntityResolver(org.xml.sax.EntityResolver);
    method public void setErrorHandler(org.xml.sax.ErrorHandler);
    method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void startDocument() throws org.xml.sax.SAXException;
    method public void startElement(String, org.xml.sax.AttributeList) throws org.xml.sax.SAXException;
  }

  @Deprecated public class ParserFactory {
    method @Deprecated public static org.xml.sax.Parser makeParser() throws java.lang.ClassCastException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.NullPointerException;
    method @Deprecated public static org.xml.sax.Parser makeParser(String) throws java.lang.ClassCastException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
  }

  public class XMLFilterImpl implements org.xml.sax.ContentHandler org.xml.sax.DTDHandler org.xml.sax.EntityResolver org.xml.sax.ErrorHandler org.xml.sax.XMLFilter {
    ctor public XMLFilterImpl();
    ctor public XMLFilterImpl(org.xml.sax.XMLReader);
    method public void characters(char[], int, int) throws org.xml.sax.SAXException;
    method public void endDocument() throws org.xml.sax.SAXException;
    method public void endElement(String, String, String) throws org.xml.sax.SAXException;
    method public void endPrefixMapping(String) throws org.xml.sax.SAXException;
    method public void error(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
    method public void fatalError(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
    method public org.xml.sax.ContentHandler getContentHandler();
    method public org.xml.sax.DTDHandler getDTDHandler();
    method public org.xml.sax.EntityResolver getEntityResolver();
    method public org.xml.sax.ErrorHandler getErrorHandler();
    method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public org.xml.sax.XMLReader getParent();
    method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
    method public void notationDecl(String, String, String) throws org.xml.sax.SAXException;
    method public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void processingInstruction(String, String) throws org.xml.sax.SAXException;
    method public org.xml.sax.InputSource resolveEntity(String, String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void setContentHandler(org.xml.sax.ContentHandler);
    method public void setDTDHandler(org.xml.sax.DTDHandler);
    method public void setDocumentLocator(org.xml.sax.Locator);
    method public void setEntityResolver(org.xml.sax.EntityResolver);
    method public void setErrorHandler(org.xml.sax.ErrorHandler);
    method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setParent(org.xml.sax.XMLReader);
    method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void skippedEntity(String) throws org.xml.sax.SAXException;
    method public void startDocument() throws org.xml.sax.SAXException;
    method public void startElement(String, String, String, org.xml.sax.Attributes) throws org.xml.sax.SAXException;
    method public void startPrefixMapping(String, String) throws org.xml.sax.SAXException;
    method public void unparsedEntityDecl(String, String, String, String) throws org.xml.sax.SAXException;
    method public void warning(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
  }

  public class XMLReaderAdapter implements org.xml.sax.ContentHandler org.xml.sax.Parser {
    ctor public XMLReaderAdapter() throws org.xml.sax.SAXException;
    ctor public XMLReaderAdapter(org.xml.sax.XMLReader);
    method public void characters(char[], int, int) throws org.xml.sax.SAXException;
    method public void endDocument() throws org.xml.sax.SAXException;
    method public void endElement(String, String, String) throws org.xml.sax.SAXException;
    method public void endPrefixMapping(String);
    method public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
    method public void parse(String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
    method public void processingInstruction(String, String) throws org.xml.sax.SAXException;
    method public void setDTDHandler(org.xml.sax.DTDHandler);
    method public void setDocumentHandler(org.xml.sax.DocumentHandler);
    method public void setDocumentLocator(org.xml.sax.Locator);
    method public void setEntityResolver(org.xml.sax.EntityResolver);
    method public void setErrorHandler(org.xml.sax.ErrorHandler);
    method public void setLocale(java.util.Locale) throws org.xml.sax.SAXException;
    method public void skippedEntity(String) throws org.xml.sax.SAXException;
    method public void startDocument() throws org.xml.sax.SAXException;
    method public void startElement(String, String, String, org.xml.sax.Attributes) throws org.xml.sax.SAXException;
    method public void startPrefixMapping(String, String);
  }

  public final class XMLReaderFactory {
    method public static org.xml.sax.XMLReader createXMLReader() throws org.xml.sax.SAXException;
    method public static org.xml.sax.XMLReader createXMLReader(String) throws org.xml.sax.SAXException;
  }

}

package org.xmlpull.v1 {

  public interface XmlPullParser {
    method public void defineEntityReplacementText(String, String) throws org.xmlpull.v1.XmlPullParserException;
    method public int getAttributeCount();
    method public String getAttributeName(int);
    method public String getAttributeNamespace(int);
    method public String getAttributePrefix(int);
    method public String getAttributeType(int);
    method public String getAttributeValue(int);
    method public String getAttributeValue(String, String);
    method public int getColumnNumber();
    method public int getDepth();
    method public int getEventType() throws org.xmlpull.v1.XmlPullParserException;
    method public boolean getFeature(String);
    method public String getInputEncoding();
    method public int getLineNumber();
    method public String getName();
    method public String getNamespace(String);
    method public String getNamespace();
    method public int getNamespaceCount(int) throws org.xmlpull.v1.XmlPullParserException;
    method public String getNamespacePrefix(int) throws org.xmlpull.v1.XmlPullParserException;
    method public String getNamespaceUri(int) throws org.xmlpull.v1.XmlPullParserException;
    method public String getPositionDescription();
    method public String getPrefix();
    method public Object getProperty(String);
    method public String getText();
    method public char[] getTextCharacters(int[]);
    method public boolean isAttributeDefault(int);
    method public boolean isEmptyElementTag() throws org.xmlpull.v1.XmlPullParserException;
    method public boolean isWhitespace() throws org.xmlpull.v1.XmlPullParserException;
    method public int next() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public int nextTag() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public String nextText() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public int nextToken() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public void require(int, String, String) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public void setFeature(String, boolean) throws org.xmlpull.v1.XmlPullParserException;
    method public void setInput(java.io.Reader) throws org.xmlpull.v1.XmlPullParserException;
    method public void setInput(java.io.InputStream, String) throws org.xmlpull.v1.XmlPullParserException;
    method public void setProperty(String, Object) throws org.xmlpull.v1.XmlPullParserException;
    field public static final int CDSECT = 5; // 0x5
    field public static final int COMMENT = 9; // 0x9
    field public static final int DOCDECL = 10; // 0xa
    field public static final int END_DOCUMENT = 1; // 0x1
    field public static final int END_TAG = 3; // 0x3
    field public static final int ENTITY_REF = 6; // 0x6
    field public static final String FEATURE_PROCESS_DOCDECL = "http://xmlpull.org/v1/doc/features.html#process-docdecl";
    field public static final String FEATURE_PROCESS_NAMESPACES = "http://xmlpull.org/v1/doc/features.html#process-namespaces";
    field public static final String FEATURE_REPORT_NAMESPACE_ATTRIBUTES = "http://xmlpull.org/v1/doc/features.html#report-namespace-prefixes";
    field public static final String FEATURE_VALIDATION = "http://xmlpull.org/v1/doc/features.html#validation";
    field public static final int IGNORABLE_WHITESPACE = 7; // 0x7
    field public static final String NO_NAMESPACE = "";
    field public static final int PROCESSING_INSTRUCTION = 8; // 0x8
    field public static final int START_DOCUMENT = 0; // 0x0
    field public static final int START_TAG = 2; // 0x2
    field public static final int TEXT = 4; // 0x4
    field public static final String[] TYPES;
  }

  public class XmlPullParserException extends java.lang.Exception {
    ctor public XmlPullParserException(String);
    ctor public XmlPullParserException(String, org.xmlpull.v1.XmlPullParser, Throwable);
    method public int getColumnNumber();
    method public Throwable getDetail();
    method public int getLineNumber();
    field protected int column;
    field protected Throwable detail;
    field protected int row;
  }

  public class XmlPullParserFactory {
    ctor protected XmlPullParserFactory();
    method public boolean getFeature(String);
    method public boolean isNamespaceAware();
    method public boolean isValidating();
    method public static org.xmlpull.v1.XmlPullParserFactory newInstance() throws org.xmlpull.v1.XmlPullParserException;
    method public static org.xmlpull.v1.XmlPullParserFactory newInstance(String, Class) throws org.xmlpull.v1.XmlPullParserException;
    method public org.xmlpull.v1.XmlPullParser newPullParser() throws org.xmlpull.v1.XmlPullParserException;
    method public org.xmlpull.v1.XmlSerializer newSerializer() throws org.xmlpull.v1.XmlPullParserException;
    method public void setFeature(String, boolean) throws org.xmlpull.v1.XmlPullParserException;
    method public void setNamespaceAware(boolean);
    method public void setValidating(boolean);
    field public static final String PROPERTY_NAME = "org.xmlpull.v1.XmlPullParserFactory";
    field protected String classNamesLocation;
    field protected java.util.HashMap<java.lang.String,java.lang.Boolean> features;
    field protected java.util.ArrayList parserClasses;
    field protected java.util.ArrayList serializerClasses;
  }

  public interface XmlSerializer {
    method public org.xmlpull.v1.XmlSerializer attribute(String, String, String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void cdsect(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void comment(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void docdecl(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void endDocument() throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public org.xmlpull.v1.XmlSerializer endTag(String, String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void entityRef(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void flush() throws java.io.IOException;
    method public int getDepth();
    method public boolean getFeature(String);
    method public String getName();
    method public String getNamespace();
    method public String getPrefix(String, boolean) throws java.lang.IllegalArgumentException;
    method public Object getProperty(String);
    method public void ignorableWhitespace(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void processingInstruction(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void setFeature(String, boolean) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void setOutput(java.io.OutputStream, String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void setOutput(java.io.Writer) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void setPrefix(String, String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void setProperty(String, Object) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void startDocument(String, Boolean) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public org.xmlpull.v1.XmlSerializer startTag(String, String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public org.xmlpull.v1.XmlSerializer text(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public org.xmlpull.v1.XmlSerializer text(char[], int, int) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
  }

}

package org.xmlpull.v1.sax2 {

  public class Driver implements org.xml.sax.Attributes org.xml.sax.Locator org.xml.sax.XMLReader {
    ctor public Driver() throws org.xmlpull.v1.XmlPullParserException;
    ctor public Driver(org.xmlpull.v1.XmlPullParser) throws org.xmlpull.v1.XmlPullParserException;
    method public int getColumnNumber();
    method public org.xml.sax.ContentHandler getContentHandler();
    method public org.xml.sax.DTDHandler getDTDHandler();
    method public org.xml.sax.EntityResolver getEntityResolver();
    method public org.xml.sax.ErrorHandler getErrorHandler();
    method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public int getIndex(String, String);
    method public int getIndex(String);
    method public int getLength();
    method public int getLineNumber();
    method public String getLocalName(int);
    method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public String getPublicId();
    method public String getQName(int);
    method public String getSystemId();
    method public String getType(int);
    method public String getType(String, String);
    method public String getType(String);
    method public String getURI(int);
    method public String getValue(int);
    method public String getValue(String, String);
    method public String getValue(String);
    method public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parseSubTree(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xml.sax.SAXException;
    method public void setContentHandler(org.xml.sax.ContentHandler);
    method public void setDTDHandler(org.xml.sax.DTDHandler);
    method public void setEntityResolver(org.xml.sax.EntityResolver);
    method public void setErrorHandler(org.xml.sax.ErrorHandler);
    method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method protected void startElement(String, String, String) throws org.xml.sax.SAXException;
    field protected static final String APACHE_DYNAMIC_VALIDATION_FEATURE = "http://apache.org/xml/features/validation/dynamic";
    field protected static final String APACHE_SCHEMA_VALIDATION_FEATURE = "http://apache.org/xml/features/validation/schema";
    field protected static final String DECLARATION_HANDLER_PROPERTY = "http://xml.org/sax/properties/declaration-handler";
    field protected static final String LEXICAL_HANDLER_PROPERTY = "http://xml.org/sax/properties/lexical-handler";
    field protected static final String NAMESPACES_FEATURE = "http://xml.org/sax/features/namespaces";
    field protected static final String NAMESPACE_PREFIXES_FEATURE = "http://xml.org/sax/features/namespace-prefixes";
    field protected static final String VALIDATION_FEATURE = "http://xml.org/sax/features/validation";
    field protected org.xml.sax.ContentHandler contentHandler;
    field protected org.xml.sax.ErrorHandler errorHandler;
    field protected org.xmlpull.v1.XmlPullParser pp;
    field protected String systemId;
  }

}

