package android {

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

  public static final class Manifest.permission {
    ctor public Manifest.permission();
    field public static final java.lang.String ACCEPT_HANDOVER = "android.permission.ACCEPT_HANDOVER";
    field public static final java.lang.String ACCESS_CHECKIN_PROPERTIES = "android.permission.ACCESS_CHECKIN_PROPERTIES";
    field public static final java.lang.String ACCESS_COARSE_LOCATION = "android.permission.ACCESS_COARSE_LOCATION";
    field public static final java.lang.String ACCESS_FINE_LOCATION = "android.permission.ACCESS_FINE_LOCATION";
    field public static final java.lang.String ACCESS_LOCATION_EXTRA_COMMANDS = "android.permission.ACCESS_LOCATION_EXTRA_COMMANDS";
    field public static final java.lang.String ACCESS_NETWORK_STATE = "android.permission.ACCESS_NETWORK_STATE";
    field public static final java.lang.String ACCESS_NOTIFICATION_POLICY = "android.permission.ACCESS_NOTIFICATION_POLICY";
    field public static final java.lang.String ACCESS_WIFI_STATE = "android.permission.ACCESS_WIFI_STATE";
    field public static final java.lang.String ACCOUNT_MANAGER = "android.permission.ACCOUNT_MANAGER";
    field public static final java.lang.String ADD_VOICEMAIL = "com.android.voicemail.permission.ADD_VOICEMAIL";
    field public static final java.lang.String ANSWER_PHONE_CALLS = "android.permission.ANSWER_PHONE_CALLS";
    field public static final java.lang.String BATTERY_STATS = "android.permission.BATTERY_STATS";
    field public static final java.lang.String BIND_ACCESSIBILITY_SERVICE = "android.permission.BIND_ACCESSIBILITY_SERVICE";
    field public static final java.lang.String BIND_APPWIDGET = "android.permission.BIND_APPWIDGET";
    field public static final java.lang.String BIND_AUTOFILL_SERVICE = "android.permission.BIND_AUTOFILL_SERVICE";
    field public static final deprecated java.lang.String BIND_CARRIER_MESSAGING_SERVICE = "android.permission.BIND_CARRIER_MESSAGING_SERVICE";
    field public static final java.lang.String BIND_CARRIER_SERVICES = "android.permission.BIND_CARRIER_SERVICES";
    field public static final java.lang.String BIND_CHOOSER_TARGET_SERVICE = "android.permission.BIND_CHOOSER_TARGET_SERVICE";
    field public static final java.lang.String BIND_CONDITION_PROVIDER_SERVICE = "android.permission.BIND_CONDITION_PROVIDER_SERVICE";
    field public static final java.lang.String BIND_DEVICE_ADMIN = "android.permission.BIND_DEVICE_ADMIN";
    field public static final java.lang.String BIND_DREAM_SERVICE = "android.permission.BIND_DREAM_SERVICE";
    field public static final java.lang.String BIND_INCALL_SERVICE = "android.permission.BIND_INCALL_SERVICE";
    field public static final java.lang.String BIND_INPUT_METHOD = "android.permission.BIND_INPUT_METHOD";
    field public static final java.lang.String BIND_MIDI_DEVICE_SERVICE = "android.permission.BIND_MIDI_DEVICE_SERVICE";
    field public static final java.lang.String BIND_NFC_SERVICE = "android.permission.BIND_NFC_SERVICE";
    field public static final java.lang.String BIND_NOTIFICATION_LISTENER_SERVICE = "android.permission.BIND_NOTIFICATION_LISTENER_SERVICE";
    field public static final java.lang.String BIND_PRINT_SERVICE = "android.permission.BIND_PRINT_SERVICE";
    field public static final java.lang.String BIND_QUICK_SETTINGS_TILE = "android.permission.BIND_QUICK_SETTINGS_TILE";
    field public static final java.lang.String BIND_REMOTEVIEWS = "android.permission.BIND_REMOTEVIEWS";
    field public static final java.lang.String BIND_SCREENING_SERVICE = "android.permission.BIND_SCREENING_SERVICE";
    field public static final java.lang.String BIND_TELECOM_CONNECTION_SERVICE = "android.permission.BIND_TELECOM_CONNECTION_SERVICE";
    field public static final java.lang.String BIND_TEXT_SERVICE = "android.permission.BIND_TEXT_SERVICE";
    field public static final java.lang.String BIND_TV_INPUT = "android.permission.BIND_TV_INPUT";
    field public static final java.lang.String BIND_VISUAL_VOICEMAIL_SERVICE = "android.permission.BIND_VISUAL_VOICEMAIL_SERVICE";
    field public static final java.lang.String BIND_VOICE_INTERACTION = "android.permission.BIND_VOICE_INTERACTION";
    field public static final java.lang.String BIND_VPN_SERVICE = "android.permission.BIND_VPN_SERVICE";
    field public static final java.lang.String BIND_VR_LISTENER_SERVICE = "android.permission.BIND_VR_LISTENER_SERVICE";
    field public static final java.lang.String BIND_WALLPAPER = "android.permission.BIND_WALLPAPER";
    field public static final java.lang.String BLUETOOTH = "android.permission.BLUETOOTH";
    field public static final java.lang.String BLUETOOTH_ADMIN = "android.permission.BLUETOOTH_ADMIN";
    field public static final java.lang.String BLUETOOTH_PRIVILEGED = "android.permission.BLUETOOTH_PRIVILEGED";
    field public static final java.lang.String BODY_SENSORS = "android.permission.BODY_SENSORS";
    field public static final java.lang.String BROADCAST_PACKAGE_REMOVED = "android.permission.BROADCAST_PACKAGE_REMOVED";
    field public static final java.lang.String BROADCAST_SMS = "android.permission.BROADCAST_SMS";
    field public static final java.lang.String BROADCAST_STICKY = "android.permission.BROADCAST_STICKY";
    field public static final java.lang.String BROADCAST_WAP_PUSH = "android.permission.BROADCAST_WAP_PUSH";
    field public static final java.lang.String CALL_PHONE = "android.permission.CALL_PHONE";
    field public static final java.lang.String CALL_PRIVILEGED = "android.permission.CALL_PRIVILEGED";
    field public static final java.lang.String CAMERA = "android.permission.CAMERA";
    field public static final java.lang.String CAPTURE_AUDIO_OUTPUT = "android.permission.CAPTURE_AUDIO_OUTPUT";
    field public static final java.lang.String CAPTURE_SECURE_VIDEO_OUTPUT = "android.permission.CAPTURE_SECURE_VIDEO_OUTPUT";
    field public static final java.lang.String CAPTURE_VIDEO_OUTPUT = "android.permission.CAPTURE_VIDEO_OUTPUT";
    field public static final java.lang.String CHANGE_COMPONENT_ENABLED_STATE = "android.permission.CHANGE_COMPONENT_ENABLED_STATE";
    field public static final java.lang.String CHANGE_CONFIGURATION = "android.permission.CHANGE_CONFIGURATION";
    field public static final java.lang.String CHANGE_NETWORK_STATE = "android.permission.CHANGE_NETWORK_STATE";
    field public static final java.lang.String CHANGE_WIFI_MULTICAST_STATE = "android.permission.CHANGE_WIFI_MULTICAST_STATE";
    field public static final java.lang.String CHANGE_WIFI_STATE = "android.permission.CHANGE_WIFI_STATE";
    field public static final java.lang.String CLEAR_APP_CACHE = "android.permission.CLEAR_APP_CACHE";
    field public static final java.lang.String CONTROL_LOCATION_UPDATES = "android.permission.CONTROL_LOCATION_UPDATES";
    field public static final java.lang.String DELETE_CACHE_FILES = "android.permission.DELETE_CACHE_FILES";
    field public static final java.lang.String DELETE_PACKAGES = "android.permission.DELETE_PACKAGES";
    field public static final java.lang.String DIAGNOSTIC = "android.permission.DIAGNOSTIC";
    field public static final java.lang.String DISABLE_KEYGUARD = "android.permission.DISABLE_KEYGUARD";
    field public static final java.lang.String DUMP = "android.permission.DUMP";
    field public static final java.lang.String EXPAND_STATUS_BAR = "android.permission.EXPAND_STATUS_BAR";
    field public static final java.lang.String FACTORY_TEST = "android.permission.FACTORY_TEST";
    field public static final java.lang.String FOREGROUND_SERVICE = "android.permission.FOREGROUND_SERVICE";
    field public static final java.lang.String GET_ACCOUNTS = "android.permission.GET_ACCOUNTS";
    field public static final java.lang.String GET_ACCOUNTS_PRIVILEGED = "android.permission.GET_ACCOUNTS_PRIVILEGED";
    field public static final java.lang.String GET_PACKAGE_SIZE = "android.permission.GET_PACKAGE_SIZE";
    field public static final deprecated java.lang.String GET_TASKS = "android.permission.GET_TASKS";
    field public static final java.lang.String GLOBAL_SEARCH = "android.permission.GLOBAL_SEARCH";
    field public static final java.lang.String INSTALL_LOCATION_PROVIDER = "android.permission.INSTALL_LOCATION_PROVIDER";
    field public static final java.lang.String INSTALL_PACKAGES = "android.permission.INSTALL_PACKAGES";
    field public static final java.lang.String INSTALL_SHORTCUT = "com.android.launcher.permission.INSTALL_SHORTCUT";
    field public static final java.lang.String INSTANT_APP_FOREGROUND_SERVICE = "android.permission.INSTANT_APP_FOREGROUND_SERVICE";
    field public static final java.lang.String INTERNET = "android.permission.INTERNET";
    field public static final java.lang.String KILL_BACKGROUND_PROCESSES = "android.permission.KILL_BACKGROUND_PROCESSES";
    field public static final java.lang.String LOCATION_HARDWARE = "android.permission.LOCATION_HARDWARE";
    field public static final java.lang.String MANAGE_DOCUMENTS = "android.permission.MANAGE_DOCUMENTS";
    field public static final java.lang.String MANAGE_OWN_CALLS = "android.permission.MANAGE_OWN_CALLS";
    field public static final java.lang.String MASTER_CLEAR = "android.permission.MASTER_CLEAR";
    field public static final java.lang.String MEDIA_CONTENT_CONTROL = "android.permission.MEDIA_CONTENT_CONTROL";
    field public static final java.lang.String MODIFY_AUDIO_SETTINGS = "android.permission.MODIFY_AUDIO_SETTINGS";
    field public static final java.lang.String MODIFY_PHONE_STATE = "android.permission.MODIFY_PHONE_STATE";
    field public static final java.lang.String MOUNT_FORMAT_FILESYSTEMS = "android.permission.MOUNT_FORMAT_FILESYSTEMS";
    field public static final java.lang.String MOUNT_UNMOUNT_FILESYSTEMS = "android.permission.MOUNT_UNMOUNT_FILESYSTEMS";
    field public static final java.lang.String NFC = "android.permission.NFC";
    field public static final java.lang.String NFC_TRANSACTION_EVENT = "android.permission.NFC_TRANSACTION_EVENT";
    field public static final java.lang.String PACKAGE_USAGE_STATS = "android.permission.PACKAGE_USAGE_STATS";
    field public static final deprecated java.lang.String PERSISTENT_ACTIVITY = "android.permission.PERSISTENT_ACTIVITY";
    field public static final java.lang.String PROCESS_OUTGOING_CALLS = "android.permission.PROCESS_OUTGOING_CALLS";
    field public static final java.lang.String READ_CALENDAR = "android.permission.READ_CALENDAR";
    field public static final java.lang.String READ_CALL_LOG = "android.permission.READ_CALL_LOG";
    field public static final java.lang.String READ_CONTACTS = "android.permission.READ_CONTACTS";
    field public static final java.lang.String READ_EXTERNAL_STORAGE = "android.permission.READ_EXTERNAL_STORAGE";
    field public static final java.lang.String READ_FRAME_BUFFER = "android.permission.READ_FRAME_BUFFER";
    field public static final deprecated java.lang.String READ_INPUT_STATE = "android.permission.READ_INPUT_STATE";
    field public static final java.lang.String READ_LOGS = "android.permission.READ_LOGS";
    field public static final java.lang.String READ_PHONE_NUMBERS = "android.permission.READ_PHONE_NUMBERS";
    field public static final java.lang.String READ_PHONE_STATE = "android.permission.READ_PHONE_STATE";
    field public static final java.lang.String READ_SMS = "android.permission.READ_SMS";
    field public static final java.lang.String READ_SYNC_SETTINGS = "android.permission.READ_SYNC_SETTINGS";
    field public static final java.lang.String READ_SYNC_STATS = "android.permission.READ_SYNC_STATS";
    field public static final java.lang.String READ_VOICEMAIL = "com.android.voicemail.permission.READ_VOICEMAIL";
    field public static final java.lang.String REBOOT = "android.permission.REBOOT";
    field public static final java.lang.String RECEIVE_BOOT_COMPLETED = "android.permission.RECEIVE_BOOT_COMPLETED";
    field public static final java.lang.String RECEIVE_MMS = "android.permission.RECEIVE_MMS";
    field public static final java.lang.String RECEIVE_SMS = "android.permission.RECEIVE_SMS";
    field public static final java.lang.String RECEIVE_WAP_PUSH = "android.permission.RECEIVE_WAP_PUSH";
    field public static final java.lang.String RECORD_AUDIO = "android.permission.RECORD_AUDIO";
    field public static final java.lang.String REORDER_TASKS = "android.permission.REORDER_TASKS";
    field public static final java.lang.String REQUEST_COMPANION_RUN_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND";
    field public static final java.lang.String REQUEST_COMPANION_USE_DATA_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND";
    field public static final java.lang.String REQUEST_DELETE_PACKAGES = "android.permission.REQUEST_DELETE_PACKAGES";
    field public static final java.lang.String REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
    field public static final java.lang.String REQUEST_INSTALL_PACKAGES = "android.permission.REQUEST_INSTALL_PACKAGES";
    field public static final deprecated java.lang.String RESTART_PACKAGES = "android.permission.RESTART_PACKAGES";
    field public static final java.lang.String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE";
    field public static final java.lang.String SEND_SMS = "android.permission.SEND_SMS";
    field public static final java.lang.String SET_ALARM = "com.android.alarm.permission.SET_ALARM";
    field public static final java.lang.String SET_ALWAYS_FINISH = "android.permission.SET_ALWAYS_FINISH";
    field public static final java.lang.String SET_ANIMATION_SCALE = "android.permission.SET_ANIMATION_SCALE";
    field public static final java.lang.String SET_DEBUG_APP = "android.permission.SET_DEBUG_APP";
    field public static final deprecated java.lang.String SET_PREFERRED_APPLICATIONS = "android.permission.SET_PREFERRED_APPLICATIONS";
    field public static final java.lang.String SET_PROCESS_LIMIT = "android.permission.SET_PROCESS_LIMIT";
    field public static final java.lang.String SET_TIME = "android.permission.SET_TIME";
    field public static final java.lang.String SET_TIME_ZONE = "android.permission.SET_TIME_ZONE";
    field public static final java.lang.String SET_WALLPAPER = "android.permission.SET_WALLPAPER";
    field public static final java.lang.String SET_WALLPAPER_HINTS = "android.permission.SET_WALLPAPER_HINTS";
    field public static final java.lang.String SIGNAL_PERSISTENT_PROCESSES = "android.permission.SIGNAL_PERSISTENT_PROCESSES";
    field public static final java.lang.String STATUS_BAR = "android.permission.STATUS_BAR";
    field public static final java.lang.String SYSTEM_ALERT_WINDOW = "android.permission.SYSTEM_ALERT_WINDOW";
    field public static final java.lang.String TRANSMIT_IR = "android.permission.TRANSMIT_IR";
    field public static final java.lang.String UNINSTALL_SHORTCUT = "com.android.launcher.permission.UNINSTALL_SHORTCUT";
    field public static final java.lang.String UPDATE_DEVICE_STATS = "android.permission.UPDATE_DEVICE_STATS";
    field public static final java.lang.String USE_BIOMETRIC = "android.permission.USE_BIOMETRIC";
    field public static final deprecated java.lang.String USE_FINGERPRINT = "android.permission.USE_FINGERPRINT";
    field public static final java.lang.String USE_SIP = "android.permission.USE_SIP";
    field public static final java.lang.String VIBRATE = "android.permission.VIBRATE";
    field public static final java.lang.String WAKE_LOCK = "android.permission.WAKE_LOCK";
    field public static final java.lang.String WRITE_APN_SETTINGS = "android.permission.WRITE_APN_SETTINGS";
    field public static final java.lang.String WRITE_CALENDAR = "android.permission.WRITE_CALENDAR";
    field public static final java.lang.String WRITE_CALL_LOG = "android.permission.WRITE_CALL_LOG";
    field public static final java.lang.String WRITE_CONTACTS = "android.permission.WRITE_CONTACTS";
    field public static final java.lang.String WRITE_EXTERNAL_STORAGE = "android.permission.WRITE_EXTERNAL_STORAGE";
    field public static final java.lang.String WRITE_GSERVICES = "android.permission.WRITE_GSERVICES";
    field public static final java.lang.String WRITE_SECURE_SETTINGS = "android.permission.WRITE_SECURE_SETTINGS";
    field public static final java.lang.String WRITE_SETTINGS = "android.permission.WRITE_SETTINGS";
    field public static final java.lang.String WRITE_SYNC_SETTINGS = "android.permission.WRITE_SYNC_SETTINGS";
    field public static final java.lang.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 java.lang.String CALENDAR = "android.permission-group.CALENDAR";
    field public static final java.lang.String CALL_LOG = "android.permission-group.CALL_LOG";
    field public static final java.lang.String CAMERA = "android.permission-group.CAMERA";
    field public static final java.lang.String CONTACTS = "android.permission-group.CONTACTS";
    field public static final java.lang.String LOCATION = "android.permission-group.LOCATION";
    field public static final java.lang.String MICROPHONE = "android.permission-group.MICROPHONE";
    field public static final java.lang.String PHONE = "android.permission-group.PHONE";
    field public static final java.lang.String SENSORS = "android.permission-group.SENSORS";
    field public static final java.lang.String SMS = "android.permission-group.SMS";
    field public static final java.lang.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 public static final deprecated int amPmBackgroundColor = 16843941; // 0x10104a5
    field public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated int dayOfWeekBackground = 16843924; // 0x1010494
    field public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated int headerAmPmTextAppearance = 16843936; // 0x10104a0
    field public static final int headerBackground = 16843055; // 0x101012f
    field public static final deprecated int headerDayOfMonthTextAppearance = 16843927; // 0x1010497
    field public static final int headerDividersEnabled = 16843310; // 0x101022e
    field public static final deprecated int headerMonthTextAppearance = 16843926; // 0x1010496
    field public static final deprecated int headerTimeTextAppearance = 16843935; // 0x101049f
    field public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated int selectedDateVerticalBar = 16843591; // 0x1010347
    field public static final deprecated 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 public static final deprecated int showOnLockScreen = 16843721; // 0x10103c9
    field public static final int showSilent = 16843259; // 0x10101fb
    field public static final int showText = 16843949; // 0x10104ad
    field public static final deprecated int showWeekNumber = 16843582; // 0x101033e
    field public static final int showWhenLocked = 16844137; // 0x1010569
    field public static final deprecated int shownWeekCount = 16843585; // 0x1010341
    field public static final int shrinkColumns = 16843082; // 0x101014a
    field public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated int weekNumberColor = 16843589; // 0x1010345
    field public static final deprecated 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 public static final deprecated int yearListItemTextAppearance = 16843929; // 0x1010499
    field public static final deprecated 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 public static final deprecated int primary_text_dark = 17170433; // 0x1060001
    field public static final deprecated int primary_text_dark_nodisable = 17170434; // 0x1060002
    field public static final deprecated int primary_text_light = 17170435; // 0x1060003
    field public static final deprecated int primary_text_light_nodisable = 17170436; // 0x1060004
    field public static final deprecated int secondary_text_dark = 17170437; // 0x1060005
    field public static final deprecated int secondary_text_dark_nodisable = 17170438; // 0x1060006
    field public static final deprecated int secondary_text_light = 17170439; // 0x1060007
    field public static final deprecated int secondary_text_light_nodisable = 17170440; // 0x1060008
    field public static final int tab_indicator_text = 17170441; // 0x1060009
    field public static final deprecated int tertiary_text_dark = 17170448; // 0x1060010
    field public static final deprecated 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 public static final deprecated int stat_sys_phone_call = 17301636; // 0x1080084
    field public static final deprecated int stat_sys_phone_call_forward = 17301637; // 0x1080085
    field public static final deprecated 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 public static final deprecated int stat_sys_vp_phone_call = 17301671; // 0x10800a7
    field public static final deprecated 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 public static final deprecated int TextAppearance_DeviceDefault_Widget_ActionBar_Subtitle_Inverse = 16974283; // 0x10301cb
    field public static final int TextAppearance_DeviceDefault_Widget_ActionBar_Title = 16974278; // 0x10301c6
    field public static final deprecated int TextAppearance_DeviceDefault_Widget_ActionBar_Title_Inverse = 16974282; // 0x10301ca
    field public static final int TextAppearance_DeviceDefault_Widget_ActionMode_Subtitle = 16974281; // 0x10301c9
    field public static final deprecated int TextAppearance_DeviceDefault_Widget_ActionMode_Subtitle_Inverse = 16974285; // 0x10301cd
    field public static final int TextAppearance_DeviceDefault_Widget_ActionMode_Title = 16974280; // 0x10301c8
    field public static final deprecated 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 public static final deprecated int Theme_Holo = 16973931; // 0x103006b
    field public static final deprecated int Theme_Holo_Dialog = 16973935; // 0x103006f
    field public static final deprecated int Theme_Holo_DialogWhenLarge = 16973943; // 0x1030077
    field public static final deprecated int Theme_Holo_DialogWhenLarge_NoActionBar = 16973944; // 0x1030078
    field public static final deprecated int Theme_Holo_Dialog_MinWidth = 16973936; // 0x1030070
    field public static final deprecated int Theme_Holo_Dialog_NoActionBar = 16973937; // 0x1030071
    field public static final deprecated int Theme_Holo_Dialog_NoActionBar_MinWidth = 16973938; // 0x1030072
    field public static final deprecated int Theme_Holo_InputMethod = 16973951; // 0x103007f
    field public static final deprecated int Theme_Holo_Light = 16973934; // 0x103006e
    field public static final deprecated int Theme_Holo_Light_DarkActionBar = 16974105; // 0x1030119
    field public static final deprecated int Theme_Holo_Light_Dialog = 16973939; // 0x1030073
    field public static final deprecated int Theme_Holo_Light_DialogWhenLarge = 16973945; // 0x1030079
    field public static final deprecated int Theme_Holo_Light_DialogWhenLarge_NoActionBar = 16973946; // 0x103007a
    field public static final deprecated int Theme_Holo_Light_Dialog_MinWidth = 16973940; // 0x1030074
    field public static final deprecated int Theme_Holo_Light_Dialog_NoActionBar = 16973941; // 0x1030075
    field public static final deprecated int Theme_Holo_Light_Dialog_NoActionBar_MinWidth = 16973942; // 0x1030076
    field public static final deprecated int Theme_Holo_Light_NoActionBar = 16974064; // 0x10300f0
    field public static final deprecated int Theme_Holo_Light_NoActionBar_Fullscreen = 16974065; // 0x10300f1
    field public static final deprecated int Theme_Holo_Light_NoActionBar_Overscan = 16974302; // 0x10301de
    field public static final deprecated int Theme_Holo_Light_NoActionBar_TranslucentDecor = 16974306; // 0x10301e2
    field public static final deprecated int Theme_Holo_Light_Panel = 16973948; // 0x103007c
    field public static final deprecated int Theme_Holo_NoActionBar = 16973932; // 0x103006c
    field public static final deprecated int Theme_Holo_NoActionBar_Fullscreen = 16973933; // 0x103006d
    field public static final deprecated int Theme_Holo_NoActionBar_Overscan = 16974301; // 0x10301dd
    field public static final deprecated int Theme_Holo_NoActionBar_TranslucentDecor = 16974305; // 0x10301e1
    field public static final deprecated int Theme_Holo_Panel = 16973947; // 0x103007b
    field public static final deprecated int Theme_Holo_Wallpaper = 16973949; // 0x103007d
    field public static final deprecated 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 public static final deprecated int Widget_DeviceDefault_Light_ActionBar_Solid_Inverse = 16974248; // 0x10301a8
    field public static final int Widget_DeviceDefault_Light_ActionBar_TabBar = 16974246; // 0x10301a6
    field public static final deprecated int Widget_DeviceDefault_Light_ActionBar_TabBar_Inverse = 16974249; // 0x10301a9
    field public static final int Widget_DeviceDefault_Light_ActionBar_TabText = 16974245; // 0x10301a5
    field public static final deprecated int Widget_DeviceDefault_Light_ActionBar_TabText_Inverse = 16974251; // 0x10301ab
    field public static final int Widget_DeviceDefault_Light_ActionBar_TabView = 16974244; // 0x10301a4
    field public static final deprecated 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 public static final deprecated 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(android.accessibilityservice.AccessibilityButtonController.AccessibilityButtonCallback);
    method public void registerAccessibilityButtonCallback(android.accessibilityservice.AccessibilityButtonController.AccessibilityButtonCallback, android.os.Handler);
    method public void unregisterAccessibilityButtonCallback(android.accessibilityservice.AccessibilityButtonController.AccessibilityButtonCallback);
  }

  public static abstract 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(android.accessibilityservice.GestureDescription, android.accessibilityservice.AccessibilityService.GestureResultCallback, android.os.Handler);
    method public android.view.accessibility.AccessibilityNodeInfo findFocus(int);
    method public final android.accessibilityservice.AccessibilityButtonController getAccessibilityButtonController();
    method public final android.accessibilityservice.FingerprintGestureController getFingerprintGestureController();
    method public final android.accessibilityservice.AccessibilityService.MagnificationController getMagnificationController();
    method public android.view.accessibility.AccessibilityNodeInfo getRootInActiveWindow();
    method public final android.accessibilityservice.AccessibilityServiceInfo getServiceInfo();
    method 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 java.lang.String SERVICE_INTERFACE = "android.accessibilityservice.AccessibilityService";
    field public static final java.lang.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 static abstract 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(android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener);
    method public void addListener(android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener, android.os.Handler);
    method public float getCenterX();
    method public float getCenterY();
    method public android.graphics.Region getMagnificationRegion();
    method public float getScale();
    method public boolean removeListener(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 abstract interface AccessibilityService.MagnificationController.OnMagnificationChangedListener {
    method public abstract void onMagnificationChanged(android.accessibilityservice.AccessibilityService.MagnificationController, android.graphics.Region, float, float, float);
  }

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

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

  public class AccessibilityServiceInfo implements android.os.Parcelable {
    ctor public AccessibilityServiceInfo();
    method public static java.lang.String capabilityToString(int);
    method public int describeContents();
    method public static java.lang.String feedbackTypeToString(int);
    method public static java.lang.String flagToString(int);
    method public deprecated boolean getCanRetrieveWindowContent();
    method public int getCapabilities();
    method public deprecated java.lang.String getDescription();
    method public java.lang.String getId();
    method public android.content.pm.ResolveInfo getResolveInfo();
    method public java.lang.String getSettingsActivityName();
    method public java.lang.String loadDescription(android.content.pm.PackageManager);
    method public java.lang.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 public static final deprecated 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 public static final deprecated 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 java.lang.String[] packageNames;
  }

  public final class FingerprintGestureController {
    method public boolean isGestureDetectionAvailable();
    method public void registerFingerprintGestureCallback(android.accessibilityservice.FingerprintGestureController.FingerprintGestureCallback, 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 static abstract 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(int);
    method public int getStrokeCount();
  }

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

  public static class GestureDescription.StrokeDescription {
    ctor public GestureDescription.StrokeDescription(android.graphics.Path, long, long);
    ctor public GestureDescription.StrokeDescription(android.graphics.Path, long, 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, java.lang.String, java.lang.String, java.lang.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, java.lang.String);
    method public android.os.Bundle finishSession(android.accounts.AccountAuthenticatorResponse, java.lang.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, java.lang.String, android.os.Bundle) throws android.accounts.NetworkErrorException;
    method public abstract java.lang.String getAuthTokenLabel(java.lang.String);
    method public final android.os.IBinder getIBinder();
    method public abstract android.os.Bundle hasFeatures(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, java.lang.String[]) throws android.accounts.NetworkErrorException;
    method public android.os.Bundle isCredentialsUpdateSuggested(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, java.lang.String) throws android.accounts.NetworkErrorException;
    method public android.os.Bundle startAddAccountSession(android.accounts.AccountAuthenticatorResponse, java.lang.String, java.lang.String, java.lang.String[], android.os.Bundle) throws android.accounts.NetworkErrorException;
    method public android.os.Bundle startUpdateCredentialsSession(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, java.lang.String, android.os.Bundle) throws android.accounts.NetworkErrorException;
    method public abstract android.os.Bundle updateCredentials(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, java.lang.String, android.os.Bundle) throws android.accounts.NetworkErrorException;
    field public static final java.lang.String KEY_CUSTOM_TOKEN_EXPIRY = "android.accounts.expiry";
  }

  public class Account implements android.os.Parcelable {
    ctor public Account(java.lang.String, java.lang.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 java.lang.String name;
    field public final java.lang.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, java.lang.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 public android.accounts.AccountManagerFuture<android.os.Bundle> addAccount(java.lang.String, java.lang.String, java.lang.String[], android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method public boolean addAccountExplicitly(android.accounts.Account, java.lang.String, android.os.Bundle);
    method public boolean addAccountExplicitly(android.accounts.Account, java.lang.String, android.os.Bundle, java.util.Map<java.lang.String, java.lang.Integer>);
    method public void addOnAccountsUpdatedListener(android.accounts.OnAccountsUpdateListener, android.os.Handler, boolean);
    method public void addOnAccountsUpdatedListener(android.accounts.OnAccountsUpdateListener, android.os.Handler, boolean, java.lang.String[]);
    method public java.lang.String blockingGetAuthToken(android.accounts.Account, java.lang.String, boolean) throws android.accounts.AuthenticatorException, java.io.IOException, android.accounts.OperationCanceledException;
    method public void clearPassword(android.accounts.Account);
    method 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 public android.accounts.AccountManagerFuture<android.os.Bundle> editProperties(java.lang.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, java.lang.String);
    method public android.accounts.Account[] getAccounts();
    method public java.util.Map<android.accounts.Account, java.lang.Integer> getAccountsAndVisibilityForPackage(java.lang.String, java.lang.String);
    method public android.accounts.Account[] getAccountsByType(java.lang.String);
    method public android.accounts.AccountManagerFuture<android.accounts.Account[]> getAccountsByTypeAndFeatures(java.lang.String, java.lang.String[], android.accounts.AccountManagerCallback<android.accounts.Account[]>, android.os.Handler);
    method public android.accounts.Account[] getAccountsByTypeForPackage(java.lang.String, java.lang.String);
    method public android.accounts.AccountManagerFuture<android.os.Bundle> getAuthToken(android.accounts.Account, java.lang.String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method public deprecated android.accounts.AccountManagerFuture<android.os.Bundle> getAuthToken(android.accounts.Account, java.lang.String, boolean, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method public android.accounts.AccountManagerFuture<android.os.Bundle> getAuthToken(android.accounts.Account, java.lang.String, android.os.Bundle, boolean, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method public android.accounts.AccountManagerFuture<android.os.Bundle> getAuthTokenByFeatures(java.lang.String, java.lang.String, java.lang.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 public java.lang.String getPassword(android.accounts.Account);
    method public java.lang.String getPreviousName(android.accounts.Account);
    method public java.lang.String getUserData(android.accounts.Account, java.lang.String);
    method public android.accounts.AccountManagerFuture<java.lang.Boolean> hasFeatures(android.accounts.Account, java.lang.String[], android.accounts.AccountManagerCallback<java.lang.Boolean>, android.os.Handler);
    method public void invalidateAuthToken(java.lang.String, java.lang.String);
    method public android.accounts.AccountManagerFuture<java.lang.Boolean> isCredentialsUpdateSuggested(android.accounts.Account, java.lang.String, android.accounts.AccountManagerCallback<java.lang.Boolean>, android.os.Handler);
    method public static deprecated android.content.Intent newChooseAccountIntent(android.accounts.Account, java.util.ArrayList<android.accounts.Account>, java.lang.String[], boolean, java.lang.String, java.lang.String, java.lang.String[], android.os.Bundle);
    method public static android.content.Intent newChooseAccountIntent(android.accounts.Account, java.util.List<android.accounts.Account>, java.lang.String[], java.lang.String, java.lang.String, java.lang.String[], android.os.Bundle);
    method public boolean notifyAccountAuthenticated(android.accounts.Account);
    method public java.lang.String peekAuthToken(android.accounts.Account, java.lang.String);
    method public deprecated android.accounts.AccountManagerFuture<java.lang.Boolean> removeAccount(android.accounts.Account, android.accounts.AccountManagerCallback<java.lang.Boolean>, android.os.Handler);
    method public android.accounts.AccountManagerFuture<android.os.Bundle> removeAccount(android.accounts.Account, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method public boolean removeAccountExplicitly(android.accounts.Account);
    method public void removeOnAccountsUpdatedListener(android.accounts.OnAccountsUpdateListener);
    method public android.accounts.AccountManagerFuture<android.accounts.Account> renameAccount(android.accounts.Account, java.lang.String, android.accounts.AccountManagerCallback<android.accounts.Account>, android.os.Handler);
    method public boolean setAccountVisibility(android.accounts.Account, java.lang.String, int);
    method public void setAuthToken(android.accounts.Account, java.lang.String, java.lang.String);
    method public void setPassword(android.accounts.Account, java.lang.String);
    method public void setUserData(android.accounts.Account, java.lang.String, java.lang.String);
    method public android.accounts.AccountManagerFuture<android.os.Bundle> startAddAccountSession(java.lang.String, java.lang.String, java.lang.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, java.lang.String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    method public android.accounts.AccountManagerFuture<android.os.Bundle> updateCredentials(android.accounts.Account, java.lang.String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
    field public static final java.lang.String ACTION_ACCOUNT_REMOVED = "android.accounts.action.ACCOUNT_REMOVED";
    field public static final java.lang.String ACTION_AUTHENTICATOR_INTENT = "android.accounts.AccountAuthenticator";
    field public static final java.lang.String AUTHENTICATOR_ATTRIBUTES_NAME = "account-authenticator";
    field public static final java.lang.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 java.lang.String KEY_ACCOUNTS = "accounts";
    field public static final java.lang.String KEY_ACCOUNT_AUTHENTICATOR_RESPONSE = "accountAuthenticatorResponse";
    field public static final java.lang.String KEY_ACCOUNT_MANAGER_RESPONSE = "accountManagerResponse";
    field public static final java.lang.String KEY_ACCOUNT_NAME = "authAccount";
    field public static final java.lang.String KEY_ACCOUNT_SESSION_BUNDLE = "accountSessionBundle";
    field public static final java.lang.String KEY_ACCOUNT_STATUS_TOKEN = "accountStatusToken";
    field public static final java.lang.String KEY_ACCOUNT_TYPE = "accountType";
    field public static final java.lang.String KEY_ANDROID_PACKAGE_NAME = "androidPackageName";
    field public static final java.lang.String KEY_AUTHENTICATOR_TYPES = "authenticator_types";
    field public static final java.lang.String KEY_AUTHTOKEN = "authtoken";
    field public static final java.lang.String KEY_AUTH_FAILED_MESSAGE = "authFailedMessage";
    field public static final java.lang.String KEY_AUTH_TOKEN_LABEL = "authTokenLabelKey";
    field public static final java.lang.String KEY_BOOLEAN_RESULT = "booleanResult";
    field public static final java.lang.String KEY_CALLER_PID = "callerPid";
    field public static final java.lang.String KEY_CALLER_UID = "callerUid";
    field public static final java.lang.String KEY_ERROR_CODE = "errorCode";
    field public static final java.lang.String KEY_ERROR_MESSAGE = "errorMessage";
    field public static final java.lang.String KEY_INTENT = "intent";
    field public static final java.lang.String KEY_LAST_AUTHENTICATED_TIME = "lastAuthenticatedTime";
    field public static final java.lang.String KEY_PASSWORD = "password";
    field public static final java.lang.String KEY_USERDATA = "userdata";
    field public static final deprecated java.lang.String LOGIN_ACCOUNTS_CHANGED_ACTION = "android.accounts.LOGIN_ACCOUNTS_CHANGED";
    field public static final java.lang.String PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE = "android:accounts:key_legacy_not_visible";
    field public static final java.lang.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 abstract interface AccountManagerCallback<V> {
    method public abstract void run(android.accounts.AccountManagerFuture<V>);
  }

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

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

  public class AuthenticatorDescription implements android.os.Parcelable {
    ctor public AuthenticatorDescription(java.lang.String, java.lang.String, int, int, int, int, boolean);
    ctor public AuthenticatorDescription(java.lang.String, java.lang.String, int, int, int, int);
    method public int describeContents();
    method public static android.accounts.AuthenticatorDescription newKey(java.lang.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 java.lang.String packageName;
    field public final int smallIconId;
    field public final java.lang.String type;
  }

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

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

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

  public class OperationCanceledException extends android.accounts.AccountsException {
    ctor public OperationCanceledException();
    ctor public OperationCanceledException(java.lang.String);
    ctor public OperationCanceledException(java.lang.String, java.lang.Throwable);
    ctor public OperationCanceledException(java.lang.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(java.lang.Object);
    method public void setupEndValues();
    method public void setupStartValues();
    method public void start();
    field public static final long DURATION_INFINITE = -1L; // 0xffffffffffffffffL
  }

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

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

  public class AnimatorInflater {
    ctor public AnimatorInflater();
    method public static android.animation.Animator loadAnimator(android.content.Context, 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 java.lang.Object evaluate(float, java.lang.Object, java.lang.Object);
  }

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

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

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

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

  public class IntEvaluator implements android.animation.TypeEvaluator {
    ctor public IntEvaluator();
    method public java.lang.Integer evaluate(float, java.lang.Integer, java.lang.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 java.lang.Class getType();
    method public abstract java.lang.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, java.lang.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(java.lang.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 public deprecated 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 public deprecated 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 abstract interface LayoutTransition.TransitionListener {
    method public abstract void endTransition(android.animation.LayoutTransition, android.view.ViewGroup, android.view.View, int);
    method public abstract 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 public java.lang.String getPropertyName();
    method public java.lang.Object getTarget();
    method public static android.animation.ObjectAnimator ofArgb(java.lang.Object, java.lang.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(java.lang.Object, java.lang.String, float...);
    method public static android.animation.ObjectAnimator ofFloat(java.lang.Object, java.lang.String, java.lang.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(java.lang.Object, java.lang.String, int...);
    method public static android.animation.ObjectAnimator ofInt(java.lang.Object, java.lang.String, java.lang.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(java.lang.Object, java.lang.String, float[][]);
    method public static android.animation.ObjectAnimator ofMultiFloat(java.lang.Object, java.lang.String, android.graphics.Path);
    method public static <T> android.animation.ObjectAnimator ofMultiFloat(java.lang.Object, java.lang.String, android.animation.TypeConverter<T, float[]>, android.animation.TypeEvaluator<T>, T...);
    method public static android.animation.ObjectAnimator ofMultiInt(java.lang.Object, java.lang.String, int[][]);
    method public static android.animation.ObjectAnimator ofMultiInt(java.lang.Object, java.lang.String, android.graphics.Path);
    method public static <T> android.animation.ObjectAnimator ofMultiInt(java.lang.Object, java.lang.String, android.animation.TypeConverter<T, int[]>, android.animation.TypeEvaluator<T>, T...);
    method public static android.animation.ObjectAnimator ofObject(java.lang.Object, java.lang.String, android.animation.TypeEvaluator, java.lang.Object...);
    method public static android.animation.ObjectAnimator ofObject(java.lang.Object, java.lang.String, android.animation.TypeConverter<android.graphics.PointF, ?>, android.graphics.Path);
    method public static <T, V> android.animation.ObjectAnimator ofObject(T, android.util.Property<T, V>, android.animation.TypeEvaluator<V>, V...);
    method 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 public static <T, V> android.animation.ObjectAnimator ofObject(T, android.util.Property<T, V>, android.animation.TypeConverter<android.graphics.PointF, V>, android.graphics.Path);
    method public static android.animation.ObjectAnimator ofPropertyValuesHolder(java.lang.Object, android.animation.PropertyValuesHolder...);
    method public void setAutoCancel(boolean);
    method public android.animation.ObjectAnimator setDuration(long);
    method public void setProperty(android.util.Property);
    method public void setPropertyName(java.lang.String);
  }

  public class PointFEvaluator implements android.animation.TypeEvaluator {
    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 java.lang.String getPropertyName();
    method public static android.animation.PropertyValuesHolder ofFloat(java.lang.String, float...);
    method public static android.animation.PropertyValuesHolder ofFloat(android.util.Property<?, java.lang.Float>, float...);
    method public static android.animation.PropertyValuesHolder ofInt(java.lang.String, int...);
    method public static android.animation.PropertyValuesHolder ofInt(android.util.Property<?, java.lang.Integer>, int...);
    method public static android.animation.PropertyValuesHolder ofKeyframe(java.lang.String, android.animation.Keyframe...);
    method public static android.animation.PropertyValuesHolder ofKeyframe(android.util.Property, android.animation.Keyframe...);
    method public static android.animation.PropertyValuesHolder ofMultiFloat(java.lang.String, float[][]);
    method public static android.animation.PropertyValuesHolder ofMultiFloat(java.lang.String, android.graphics.Path);
    method public static <V> android.animation.PropertyValuesHolder ofMultiFloat(java.lang.String, android.animation.TypeConverter<V, float[]>, android.animation.TypeEvaluator<V>, V...);
    method public static <T> android.animation.PropertyValuesHolder ofMultiFloat(java.lang.String, android.animation.TypeConverter<T, float[]>, android.animation.TypeEvaluator<T>, android.animation.Keyframe...);
    method public static android.animation.PropertyValuesHolder ofMultiInt(java.lang.String, int[][]);
    method public static android.animation.PropertyValuesHolder ofMultiInt(java.lang.String, android.graphics.Path);
    method public static <V> android.animation.PropertyValuesHolder ofMultiInt(java.lang.String, android.animation.TypeConverter<V, int[]>, android.animation.TypeEvaluator<V>, V...);
    method public static <T> android.animation.PropertyValuesHolder ofMultiInt(java.lang.String, android.animation.TypeConverter<T, int[]>, android.animation.TypeEvaluator<T>, android.animation.Keyframe...);
    method public static android.animation.PropertyValuesHolder ofObject(java.lang.String, android.animation.TypeEvaluator, java.lang.Object...);
    method public static android.animation.PropertyValuesHolder ofObject(java.lang.String, android.animation.TypeConverter<android.graphics.PointF, ?>, android.graphics.Path);
    method public static <V> android.animation.PropertyValuesHolder ofObject(android.util.Property, android.animation.TypeEvaluator<V>, V...);
    method 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(java.lang.String);
  }

  public class RectEvaluator implements android.animation.TypeEvaluator {
    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 abstract interface TimeAnimator.TimeListener {
    method public abstract void onTimeUpdate(android.animation.TimeAnimator, long, long);
  }

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

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

  public abstract interface TypeEvaluator<T> {
    method public abstract 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 java.lang.Object getAnimatedValue();
    method public java.lang.Object getAnimatedValue(java.lang.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 abstract interface ValueAnimator.AnimatorUpdateListener {
    method public abstract void onAnimationUpdate(android.animation.ValueAnimator);
  }

}

package android.annotation {

  public abstract class SuppressLint implements java.lang.annotation.Annotation {
  }

  public abstract class TargetApi implements java.lang.annotation.Annotation {
  }

}

package android.app {

  public abstract class ActionBar {
    ctor public ActionBar();
    method public abstract void addOnMenuVisibilityListener(android.app.ActionBar.OnMenuVisibilityListener);
    method public abstract deprecated void addTab(android.app.ActionBar.Tab);
    method public abstract deprecated void addTab(android.app.ActionBar.Tab, boolean);
    method public abstract deprecated void addTab(android.app.ActionBar.Tab, int);
    method public abstract deprecated 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 public abstract deprecated int getNavigationItemCount();
    method public abstract deprecated int getNavigationMode();
    method public abstract deprecated int getSelectedNavigationIndex();
    method public abstract deprecated android.app.ActionBar.Tab getSelectedTab();
    method public abstract java.lang.CharSequence getSubtitle();
    method public abstract deprecated android.app.ActionBar.Tab getTabAt(int);
    method public abstract deprecated int getTabCount();
    method public android.content.Context getThemedContext();
    method public abstract java.lang.CharSequence getTitle();
    method public abstract void hide();
    method public boolean isHideOnContentScrollEnabled();
    method public abstract boolean isShowing();
    method public abstract deprecated android.app.ActionBar.Tab newTab();
    method public abstract deprecated void removeAllTabs();
    method public abstract void removeOnMenuVisibilityListener(android.app.ActionBar.OnMenuVisibilityListener);
    method public abstract deprecated void removeTab(android.app.ActionBar.Tab);
    method public abstract deprecated void removeTabAt(int);
    method public abstract deprecated void selectTab(android.app.ActionBar.Tab);
    method public abstract void setBackgroundDrawable(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(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(java.lang.CharSequence);
    method public void setHomeActionContentDescription(int);
    method public void setHomeAsUpIndicator(android.graphics.drawable.Drawable);
    method public void setHomeAsUpIndicator(int);
    method public void setHomeButtonEnabled(boolean);
    method public abstract void setIcon(int);
    method public abstract void setIcon(android.graphics.drawable.Drawable);
    method public abstract deprecated void setListNavigationCallbacks(android.widget.SpinnerAdapter, android.app.ActionBar.OnNavigationListener);
    method public abstract void setLogo(int);
    method public abstract void setLogo(android.graphics.drawable.Drawable);
    method public abstract deprecated void setNavigationMode(int);
    method public abstract deprecated void setSelectedNavigationItem(int);
    method public void setSplitBackgroundDrawable(android.graphics.drawable.Drawable);
    method public void setStackedBackgroundDrawable(android.graphics.drawable.Drawable);
    method public abstract void setSubtitle(java.lang.CharSequence);
    method public abstract void setSubtitle(int);
    method public abstract void setTitle(java.lang.CharSequence);
    method public abstract void setTitle(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 public static final deprecated int NAVIGATION_MODE_LIST = 1; // 0x1
    field public static final deprecated int NAVIGATION_MODE_STANDARD = 0; // 0x0
    field public static final deprecated int NAVIGATION_MODE_TABS = 2; // 0x2
  }

  public static class ActionBar.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
    ctor public ActionBar.LayoutParams(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 public int gravity;
  }

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

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

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

  public static abstract deprecated interface ActionBar.TabListener {
    method public abstract void onTabReselected(android.app.ActionBar.Tab, android.app.FragmentTransaction);
    method public abstract void onTabSelected(android.app.ActionBar.Tab, android.app.FragmentTransaction);
    method public abstract 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, android.content.Intent, int);
    method public final deprecated 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(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
    method public deprecated void enterPictureInPictureMode();
    method public boolean enterPictureInPictureMode(android.app.PictureInPictureParams);
    method public <T extends android.view.View> T findViewById(int);
    method public void finish();
    method public void finishActivity(int);
    method public void finishActivityFromChild(android.app.Activity, int);
    method public void finishAffinity();
    method public void finishAfterTransition();
    method public void finishAndRemoveTask();
    method public void finishFromChild(android.app.Activity);
    method public android.app.ActionBar getActionBar();
    method public final android.app.Application getApplication();
    method public android.content.ComponentName getCallingActivity();
    method public java.lang.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 public android.view.View getCurrentFocus();
    method public deprecated android.app.FragmentManager getFragmentManager();
    method public android.content.Intent getIntent();
    method public java.lang.Object getLastNonConfigurationInstance();
    method public android.view.LayoutInflater getLayoutInflater();
    method public deprecated android.app.LoaderManager getLoaderManager();
    method public java.lang.String getLocalClassName();
    method public int getMaxNumPictureInPictureActions();
    method public final android.media.session.MediaController getMediaController();
    method public android.view.MenuInflater getMenuInflater();
    method public final android.app.Activity getParent();
    method public android.content.Intent getParentActivityIntent();
    method public android.content.SharedPreferences getPreferences(int);
    method public android.net.Uri getReferrer();
    method public int getRequestedOrientation();
    method public final android.view.SearchEvent getSearchEvent();
    method public int getTaskId();
    method public final java.lang.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 public final deprecated android.database.Cursor managedQuery(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
    method public boolean moveTaskToBack(boolean);
    method public boolean navigateUpTo(android.content.Intent);
    method public boolean navigateUpToFromChild(android.app.Activity, android.content.Intent);
    method public void onActionModeFinished(android.view.ActionMode);
    method public void onActionModeStarted(android.view.ActionMode);
    method public void onActivityReenter(int, android.content.Intent);
    method protected void onActivityResult(int, int, android.content.Intent);
    method public deprecated void onAttachFragment(android.app.Fragment);
    method public void onAttachedToWindow();
    method public void onBackPressed();
    method protected void onChildTitleChanged(android.app.Activity, java.lang.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 protected void onCreate(android.os.Bundle);
    method public void onCreate(android.os.Bundle, android.os.PersistableBundle);
    method public void onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo);
    method public java.lang.CharSequence onCreateDescription();
    method protected deprecated android.app.Dialog onCreateDialog(int);
    method protected deprecated 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 public android.view.View onCreatePanelView(int);
    method public deprecated boolean onCreateThumbnail(android.graphics.Bitmap, android.graphics.Canvas);
    method public android.view.View onCreateView(java.lang.String, android.content.Context, android.util.AttributeSet);
    method public android.view.View onCreateView(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet);
    method 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 public deprecated 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 protected void onPause();
    method public void onPictureInPictureModeChanged(boolean, android.content.res.Configuration);
    method public deprecated void onPictureInPictureModeChanged(boolean);
    method protected void onPostCreate(android.os.Bundle);
    method public void onPostCreate(android.os.Bundle, android.os.PersistableBundle);
    method protected void onPostResume();
    method protected deprecated void onPrepareDialog(int, android.app.Dialog);
    method protected deprecated 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, java.lang.String[], int[]);
    method protected void onRestart();
    method protected void onRestoreInstanceState(android.os.Bundle);
    method public void onRestoreInstanceState(android.os.Bundle, android.os.PersistableBundle);
    method protected void onResume();
    method public java.lang.Object onRetainNonConfigurationInstance();
    method protected void onSaveInstanceState(android.os.Bundle);
    method public void onSaveInstanceState(android.os.Bundle, android.os.PersistableBundle);
    method public boolean onSearchRequested(android.view.SearchEvent);
    method public boolean onSearchRequested();
    method protected void onStart();
    method public void onStateNotSaved();
    method protected void onStop();
    method protected void onTitleChanged(java.lang.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 public deprecated void onVisibleBehindCanceled();
    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(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 public final deprecated void removeDialog(int);
    method public void reportFullyDrawn();
    method public android.view.DragAndDropPermissions requestDragAndDropPermissions(android.view.DragEvent);
    method public final void requestPermissions(java.lang.String[], int);
    method public final void requestShowKeyboardShortcuts();
    method public deprecated boolean requestVisibleBehind(boolean);
    method public final boolean requestWindowFeature(int);
    method public final <T extends android.view.View> T requireViewById(int);
    method public final void runOnUiThread(java.lang.Runnable);
    method public void setActionBar(android.widget.Toolbar);
    method public void setContentTransitionManager(android.transition.TransitionManager);
    method public void setContentView(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, 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(android.app.PictureInPictureParams);
    method public final deprecated void setProgress(int);
    method public final deprecated void setProgressBarIndeterminate(boolean);
    method public final deprecated void setProgressBarIndeterminateVisibility(boolean);
    method public final deprecated void setProgressBarVisibility(boolean);
    method public void setRequestedOrientation(int);
    method public final void setResult(int);
    method public final void setResult(int, android.content.Intent);
    method public final deprecated void setSecondaryProgress(int);
    method public void setShowWhenLocked(boolean);
    method public void setTaskDescription(android.app.ActivityManager.TaskDescription);
    method public void setTitle(java.lang.CharSequence);
    method public void setTitle(int);
    method public deprecated void setTitleColor(int);
    method public void setTurnScreenOn(boolean);
    method public void setVisible(boolean);
    method public final void setVolumeControlStream(int);
    method public void setVrModeEnabled(boolean, android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public boolean shouldShowRequestPermissionRationale(java.lang.String);
    method public boolean shouldUpRecreateTask(android.content.Intent);
    method public boolean showAssist(android.os.Bundle);
    method public final deprecated void showDialog(int);
    method public final deprecated boolean showDialog(int, android.os.Bundle);
    method public void showLockTaskEscapeMessage();
    method public android.view.ActionMode startActionMode(android.view.ActionMode.Callback);
    method public android.view.ActionMode startActionMode(android.view.ActionMode.Callback, int);
    method public void startActivityForResult(android.content.Intent, int);
    method public void startActivityForResult(android.content.Intent, int, android.os.Bundle);
    method public void startActivityFromChild(android.app.Activity, android.content.Intent, int);
    method public void startActivityFromChild(android.app.Activity, android.content.Intent, int, android.os.Bundle);
    method public deprecated void startActivityFromFragment(android.app.Fragment, android.content.Intent, int);
    method public deprecated void startActivityFromFragment(android.app.Fragment, android.content.Intent, int, android.os.Bundle);
    method public boolean startActivityIfNeeded(android.content.Intent, int);
    method public boolean startActivityIfNeeded(android.content.Intent, int, android.os.Bundle);
    method public void startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSenderForResult(android.content.IntentSender, int, 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, android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method public void startLocalVoiceInteraction(android.os.Bundle);
    method public void startLockTask();
    method public deprecated void startManagingCursor(android.database.Cursor);
    method public boolean startNextMatchingActivity(android.content.Intent);
    method public boolean startNextMatchingActivity(android.content.Intent, android.os.Bundle);
    method public void startPostponedEnterTransition();
    method public void startSearch(java.lang.String, boolean, android.os.Bundle, boolean);
    method public void stopLocalVoiceInteraction();
    method public void stopLockTask();
    method public deprecated void stopManagingCursor(android.database.Cursor);
    method public void takeKeyEvents(boolean);
    method public void triggerSearch(java.lang.String, 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
  }

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

  public class ActivityManager {
    method public int addAppTask(android.app.Activity, android.content.Intent, android.app.ActivityManager.TaskDescription, android.graphics.Bitmap);
    method public boolean clearApplicationUserData();
    method public void clearWatchHeapLimit();
    method public void dumpPackageState(java.io.FileDescriptor, java.lang.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 public deprecated 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 public deprecated java.util.List<android.app.ActivityManager.RunningServiceInfo> getRunningServices(int) throws java.lang.SecurityException;
    method public deprecated java.util.List<android.app.ActivityManager.RunningTaskInfo> getRunningTasks(int) throws java.lang.SecurityException;
    method public boolean isBackgroundRestricted();
    method public deprecated boolean isInLockTaskMode();
    method public boolean isLowRamDevice();
    method public static boolean isRunningInTestHarness();
    method public static boolean isUserAMonkey();
    method public void killBackgroundProcesses(java.lang.String);
    method public void moveTaskToFront(int, int);
    method public void moveTaskToFront(int, int, android.os.Bundle);
    method public deprecated void restartPackage(java.lang.String);
    method public static void setVrThread(int);
    method public void setWatchHeapLimit(long);
    field public static final java.lang.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 java.lang.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 java.lang.String longMsg;
    field public int pid;
    field public java.lang.String processName;
    field public java.lang.String shortMsg;
    field public java.lang.String stackTrace;
    field public java.lang.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 java.lang.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(java.lang.String, int, java.lang.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 public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 java.lang.String[] pkgList;
    field public java.lang.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 java.lang.String clientPackage;
    field public int crashCount;
    field public int flags;
    field public boolean foreground;
    field public long lastActivityTime;
    field public int pid;
    field public java.lang.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 java.lang.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 public deprecated ActivityManager.TaskDescription(java.lang.String, android.graphics.Bitmap, int);
    ctor public ActivityManager.TaskDescription(java.lang.String, int, int);
    ctor public deprecated ActivityManager.TaskDescription(java.lang.String, android.graphics.Bitmap);
    ctor public ActivityManager.TaskDescription(java.lang.String, int);
    ctor public ActivityManager.TaskDescription(java.lang.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 java.lang.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 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, java.lang.String);
    method 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(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 java.lang.String EXTRA_USAGE_TIME_REPORT = "android.activity.usage_time";
    field public static final java.lang.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, java.lang.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, java.lang.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(java.lang.String);
    method public void setWindow(int, long, long, android.app.PendingIntent);
    method public void setWindow(int, long, long, java.lang.String, android.app.AlarmManager.OnAlarmListener, android.os.Handler);
    field public static final java.lang.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 abstract interface AlarmManager.OnAlarmListener {
    method public abstract 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, int);
    method public android.widget.Button getButton(int);
    method public android.widget.ListView getListView();
    method public void setButton(int, java.lang.CharSequence, android.os.Message);
    method public void setButton(int, java.lang.CharSequence, android.content.DialogInterface.OnClickListener);
    method public deprecated void setButton(java.lang.CharSequence, android.os.Message);
    method public deprecated void setButton(java.lang.CharSequence, android.content.DialogInterface.OnClickListener);
    method public deprecated void setButton2(java.lang.CharSequence, android.os.Message);
    method public deprecated void setButton2(java.lang.CharSequence, android.content.DialogInterface.OnClickListener);
    method public deprecated void setButton3(java.lang.CharSequence, android.os.Message);
    method public deprecated void setButton3(java.lang.CharSequence, android.content.DialogInterface.OnClickListener);
    method public void setCustomTitle(android.view.View);
    method public void setIcon(int);
    method public void setIcon(android.graphics.drawable.Drawable);
    method public void setIconAttribute(int);
    method public void setInverseBackgroundForced(boolean);
    method public void setMessage(java.lang.CharSequence);
    method public void setView(android.view.View);
    method public void setView(android.view.View, int, int, int, int);
    field public static final deprecated int THEME_DEVICE_DEFAULT_DARK = 4; // 0x4
    field public static final deprecated int THEME_DEVICE_DEFAULT_LIGHT = 5; // 0x5
    field public static final deprecated int THEME_HOLO_DARK = 2; // 0x2
    field public static final deprecated int THEME_HOLO_LIGHT = 3; // 0x3
    field public static final deprecated 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, java.lang.String);
    method public android.app.AlertDialog.Builder setCustomTitle(android.view.View);
    method public android.app.AlertDialog.Builder setIcon(int);
    method public android.app.AlertDialog.Builder setIcon(android.graphics.drawable.Drawable);
    method public android.app.AlertDialog.Builder setIconAttribute(int);
    method public deprecated android.app.AlertDialog.Builder setInverseBackgroundForced(boolean);
    method public android.app.AlertDialog.Builder setItems(int, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setItems(java.lang.CharSequence[], android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setMessage(int);
    method public android.app.AlertDialog.Builder setMessage(java.lang.CharSequence);
    method public android.app.AlertDialog.Builder setMultiChoiceItems(int, boolean[], android.content.DialogInterface.OnMultiChoiceClickListener);
    method public android.app.AlertDialog.Builder setMultiChoiceItems(java.lang.CharSequence[], boolean[], android.content.DialogInterface.OnMultiChoiceClickListener);
    method public android.app.AlertDialog.Builder setMultiChoiceItems(android.database.Cursor, java.lang.String, java.lang.String, android.content.DialogInterface.OnMultiChoiceClickListener);
    method public android.app.AlertDialog.Builder setNegativeButton(int, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setNegativeButton(java.lang.CharSequence, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setNeutralButton(int, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setNeutralButton(java.lang.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(int, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setPositiveButton(java.lang.CharSequence, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setSingleChoiceItems(int, int, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setSingleChoiceItems(android.database.Cursor, int, java.lang.String, android.content.DialogInterface.OnClickListener);
    method public android.app.AlertDialog.Builder setSingleChoiceItems(java.lang.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(int);
    method public android.app.AlertDialog.Builder setTitle(java.lang.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.app.Activity instantiateActivity(java.lang.ClassLoader, java.lang.String, android.content.Intent) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public android.app.Application instantiateApplication(java.lang.ClassLoader, java.lang.String) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public android.content.ContentProvider instantiateProvider(java.lang.ClassLoader, java.lang.String) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public android.content.BroadcastReceiver instantiateReceiver(java.lang.ClassLoader, java.lang.String, android.content.Intent) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public android.app.Service instantiateService(java.lang.ClassLoader, java.lang.String, android.content.Intent) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
  }

  public class AppOpsManager {
    method public int checkOp(java.lang.String, int, java.lang.String);
    method public int checkOpNoThrow(java.lang.String, int, java.lang.String);
    method public void checkPackage(int, java.lang.String);
    method public void finishOp(java.lang.String, int, java.lang.String);
    method public int noteOp(java.lang.String, int, java.lang.String);
    method public int noteOpNoThrow(java.lang.String, int, java.lang.String);
    method public int noteProxyOp(java.lang.String, java.lang.String);
    method public int noteProxyOpNoThrow(java.lang.String, java.lang.String);
    method public static java.lang.String permissionToOp(java.lang.String);
    method public int startOp(java.lang.String, int, java.lang.String);
    method public int startOpNoThrow(java.lang.String, int, java.lang.String);
    method public void startWatchingMode(java.lang.String, java.lang.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 java.lang.String OPSTR_ADD_VOICEMAIL = "android:add_voicemail";
    field public static final java.lang.String OPSTR_ANSWER_PHONE_CALLS = "android:answer_phone_calls";
    field public static final java.lang.String OPSTR_BODY_SENSORS = "android:body_sensors";
    field public static final java.lang.String OPSTR_CALL_PHONE = "android:call_phone";
    field public static final java.lang.String OPSTR_CAMERA = "android:camera";
    field public static final java.lang.String OPSTR_COARSE_LOCATION = "android:coarse_location";
    field public static final java.lang.String OPSTR_FINE_LOCATION = "android:fine_location";
    field public static final java.lang.String OPSTR_GET_USAGE_STATS = "android:get_usage_stats";
    field public static final java.lang.String OPSTR_MOCK_LOCATION = "android:mock_location";
    field public static final java.lang.String OPSTR_MONITOR_HIGH_POWER_LOCATION = "android:monitor_location_high_power";
    field public static final java.lang.String OPSTR_MONITOR_LOCATION = "android:monitor_location";
    field public static final java.lang.String OPSTR_PICTURE_IN_PICTURE = "android:picture_in_picture";
    field public static final java.lang.String OPSTR_PROCESS_OUTGOING_CALLS = "android:process_outgoing_calls";
    field public static final java.lang.String OPSTR_READ_CALENDAR = "android:read_calendar";
    field public static final java.lang.String OPSTR_READ_CALL_LOG = "android:read_call_log";
    field public static final java.lang.String OPSTR_READ_CELL_BROADCASTS = "android:read_cell_broadcasts";
    field public static final java.lang.String OPSTR_READ_CONTACTS = "android:read_contacts";
    field public static final java.lang.String OPSTR_READ_EXTERNAL_STORAGE = "android:read_external_storage";
    field public static final java.lang.String OPSTR_READ_PHONE_NUMBERS = "android:read_phone_numbers";
    field public static final java.lang.String OPSTR_READ_PHONE_STATE = "android:read_phone_state";
    field public static final java.lang.String OPSTR_READ_SMS = "android:read_sms";
    field public static final java.lang.String OPSTR_RECEIVE_MMS = "android:receive_mms";
    field public static final java.lang.String OPSTR_RECEIVE_SMS = "android:receive_sms";
    field public static final java.lang.String OPSTR_RECEIVE_WAP_PUSH = "android:receive_wap_push";
    field public static final java.lang.String OPSTR_RECORD_AUDIO = "android:record_audio";
    field public static final java.lang.String OPSTR_SEND_SMS = "android:send_sms";
    field public static final java.lang.String OPSTR_SYSTEM_ALERT_WINDOW = "android:system_alert_window";
    field public static final java.lang.String OPSTR_USE_FINGERPRINT = "android:use_fingerprint";
    field public static final java.lang.String OPSTR_USE_SIP = "android:use_sip";
    field public static final java.lang.String OPSTR_WRITE_CALENDAR = "android:write_calendar";
    field public static final java.lang.String OPSTR_WRITE_CALL_LOG = "android:write_call_log";
    field public static final java.lang.String OPSTR_WRITE_CONTACTS = "android:write_contacts";
    field public static final java.lang.String OPSTR_WRITE_EXTERNAL_STORAGE = "android:write_external_storage";
    field public static final java.lang.String OPSTR_WRITE_SETTINGS = "android:write_settings";
  }

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

  public class Application extends android.content.ContextWrapper implements android.content.ComponentCallbacks2 {
    ctor public Application();
    method public static java.lang.String getProcessName();
    method public void onConfigurationChanged(android.content.res.Configuration);
    method public void onCreate();
    method public void onLowMemory();
    method public void onTerminate();
    method 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 abstract interface Application.ActivityLifecycleCallbacks {
    method public abstract void onActivityCreated(android.app.Activity, android.os.Bundle);
    method public abstract void onActivityDestroyed(android.app.Activity);
    method public abstract void onActivityPaused(android.app.Activity);
    method public abstract void onActivityResumed(android.app.Activity);
    method public abstract void onActivitySaveInstanceState(android.app.Activity, android.os.Bundle);
    method public abstract void onActivityStarted(android.app.Activity);
    method public abstract void onActivityStopped(android.app.Activity);
  }

  public static abstract interface Application.OnProvideAssistDataListener {
    method public abstract 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, java.lang.String);
    method public static android.content.ComponentName getErrorReportReceiver(android.content.Context, java.lang.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 java.lang.String installerPackageName;
    field public java.lang.String packageName;
    field public java.lang.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, java.lang.String);
    method public void writeToParcel(android.os.Parcel, int);
    field public java.lang.String activity;
    field public java.lang.String cause;
    field public java.lang.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, java.lang.String);
    method public void writeToParcel(android.os.Parcel, int);
    field public java.lang.String checkinDetails;
    field public long durationMicros;
    field public java.lang.String usageDetails;
    field public int usagePercent;
  }

  public static class ApplicationErrorReport.CrashInfo {
    ctor public ApplicationErrorReport.CrashInfo();
    ctor public ApplicationErrorReport.CrashInfo(java.lang.Throwable);
    ctor public ApplicationErrorReport.CrashInfo(android.os.Parcel);
    method public void dump(android.util.Printer, java.lang.String);
    method public void writeToParcel(android.os.Parcel, int);
    field public java.lang.String exceptionClassName;
    field public java.lang.String exceptionMessage;
    field public java.lang.String stackTrace;
    field public java.lang.String throwClassName;
    field public java.lang.String throwFileName;
    field public int throwLineNumber;
    field public java.lang.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, java.lang.String);
    method public void writeToParcel(android.os.Parcel, int);
    field public long durationMillis;
    field public java.lang.String serviceDetails;
  }

  public final class AuthenticationRequiredException extends java.lang.SecurityException implements android.os.Parcelable {
    ctor public AuthenticationRequiredException(java.lang.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(java.lang.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 java.lang.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(java.lang.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(android.content.Context);
    ctor public DatePickerDialog(android.content.Context, int);
    ctor public DatePickerDialog(android.content.Context, android.app.DatePickerDialog.OnDateSetListener, int, int, int);
    ctor public DatePickerDialog(android.content.Context, int, android.app.DatePickerDialog.OnDateSetListener, int, int, int);
    method public android.widget.DatePicker getDatePicker();
    method public void onClick(android.content.DialogInterface, int);
    method public void onDateChanged(android.widget.DatePicker, int, int, int);
    method public void setOnDateSetListener(android.app.DatePickerDialog.OnDateSetListener);
    method public void updateDate(int, int, int);
  }

  public static abstract interface DatePickerDialog.OnDateSetListener {
    method public abstract 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(android.content.Context);
    ctor public Dialog(android.content.Context, int);
    ctor protected Dialog(android.content.Context, boolean, android.content.DialogInterface.OnCancelListener);
    method public void addContentView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public void cancel();
    method public void closeOptionsMenu();
    method public void create();
    method public void dismiss();
    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(int);
    method public android.app.ActionBar getActionBar();
    method public final android.content.Context getContext();
    method public android.view.View getCurrentFocus();
    method public android.view.LayoutInflater getLayoutInflater();
    method public final android.app.Activity getOwnerActivity();
    method public final android.view.SearchEvent getSearchEvent();
    method public final int getVolumeControlStream();
    method public android.view.Window getWindow();
    method public void hide();
    method public void invalidateOptionsMenu();
    method public boolean isShowing();
    method public void onActionModeFinished(android.view.ActionMode);
    method public void onActionModeStarted(android.view.ActionMode);
    method public void onAttachedToWindow();
    method public void onBackPressed();
    method public void onContentChanged();
    method public boolean onContextItemSelected(android.view.MenuItem);
    method public void onContextMenuClosed(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(android.view.Menu);
    method public boolean onCreatePanelMenu(int, android.view.Menu);
    method public android.view.View onCreatePanelView(int);
    method public void onDetachedFromWindow();
    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 boolean onMenuItemSelected(int, android.view.MenuItem);
    method public boolean onMenuOpened(int, android.view.Menu);
    method public boolean onOptionsItemSelected(android.view.MenuItem);
    method public void onOptionsMenuClosed(android.view.Menu);
    method public void onPanelClosed(int, android.view.Menu);
    method public boolean onPrepareOptionsMenu(android.view.Menu);
    method public boolean onPreparePanel(int, android.view.View, android.view.Menu);
    method public void onRestoreInstanceState(android.os.Bundle);
    method public android.os.Bundle onSaveInstanceState();
    method public boolean onSearchRequested(android.view.SearchEvent);
    method public boolean onSearchRequested();
    method protected void onStart();
    method protected void onStop();
    method public boolean onTouchEvent(android.view.MotionEvent);
    method public boolean onTrackballEvent(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(android.view.View);
    method public void openOptionsMenu();
    method public void registerForContextMenu(android.view.View);
    method public final boolean requestWindowFeature(int);
    method public final <T extends android.view.View> T requireViewById(int);
    method public void setCancelMessage(android.os.Message);
    method public void setCancelable(boolean);
    method public void setCanceledOnTouchOutside(boolean);
    method public void setContentView(int);
    method public void setContentView(android.view.View);
    method public void setContentView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public void setDismissMessage(android.os.Message);
    method public final void setFeatureDrawable(int, android.graphics.drawable.Drawable);
    method public final void setFeatureDrawableAlpha(int, int);
    method public final void setFeatureDrawableResource(int, int);
    method public final void setFeatureDrawableUri(int, android.net.Uri);
    method public void setOnCancelListener(android.content.DialogInterface.OnCancelListener);
    method public void setOnDismissListener(android.content.DialogInterface.OnDismissListener);
    method public void setOnKeyListener(android.content.DialogInterface.OnKeyListener);
    method public void setOnShowListener(android.content.DialogInterface.OnShowListener);
    method public final void setOwnerActivity(android.app.Activity);
    method public void setTitle(java.lang.CharSequence);
    method public void setTitle(int);
    method public final void setVolumeControlStream(int);
    method public void show();
    method public void takeKeyEvents(boolean);
    method public void unregisterForContextMenu(android.view.View);
  }

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

  public class DownloadManager {
    method public long addCompletedDownload(java.lang.String, java.lang.String, boolean, java.lang.String, java.lang.String, long, boolean);
    method public long addCompletedDownload(java.lang.String, java.lang.String, boolean, java.lang.String, java.lang.String, long, boolean, android.net.Uri, android.net.Uri);
    method public long enqueue(android.app.DownloadManager.Request);
    method public static java.lang.Long getMaxBytesOverMobile(android.content.Context);
    method public java.lang.String getMimeTypeForDownloadedFile(long);
    method public static java.lang.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 java.lang.String ACTION_DOWNLOAD_COMPLETE = "android.intent.action.DOWNLOAD_COMPLETE";
    field public static final java.lang.String ACTION_NOTIFICATION_CLICKED = "android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED";
    field public static final java.lang.String ACTION_VIEW_DOWNLOADS = "android.intent.action.VIEW_DOWNLOADS";
    field public static final java.lang.String COLUMN_BYTES_DOWNLOADED_SO_FAR = "bytes_so_far";
    field public static final java.lang.String COLUMN_DESCRIPTION = "description";
    field public static final java.lang.String COLUMN_ID = "_id";
    field public static final java.lang.String COLUMN_LAST_MODIFIED_TIMESTAMP = "last_modified_timestamp";
    field public static final deprecated java.lang.String COLUMN_LOCAL_FILENAME = "local_filename";
    field public static final java.lang.String COLUMN_LOCAL_URI = "local_uri";
    field public static final java.lang.String COLUMN_MEDIAPROVIDER_URI = "mediaprovider_uri";
    field public static final java.lang.String COLUMN_MEDIA_TYPE = "media_type";
    field public static final java.lang.String COLUMN_REASON = "reason";
    field public static final java.lang.String COLUMN_STATUS = "status";
    field public static final java.lang.String COLUMN_TITLE = "title";
    field public static final java.lang.String COLUMN_TOTAL_SIZE_BYTES = "total_size";
    field public static final java.lang.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 java.lang.String EXTRA_DOWNLOAD_ID = "extra_download_id";
    field public static final java.lang.String EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS = "extra_click_download_ids";
    field public static final java.lang.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(java.lang.String, java.lang.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(java.lang.CharSequence);
    method public android.app.DownloadManager.Request setDestinationInExternalFilesDir(android.content.Context, java.lang.String, java.lang.String);
    method public android.app.DownloadManager.Request setDestinationInExternalPublicDir(java.lang.String, java.lang.String);
    method public android.app.DownloadManager.Request setDestinationUri(android.net.Uri);
    method public android.app.DownloadManager.Request setMimeType(java.lang.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 public deprecated android.app.DownloadManager.Request setShowRunningNotification(boolean);
    method public android.app.DownloadManager.Request setTitle(java.lang.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);
  }

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

  public static deprecated class Fragment.InstantiationException extends android.util.AndroidRuntimeException {
    ctor public Fragment.InstantiationException(java.lang.String, java.lang.Exception);
  }

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

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

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

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

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

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

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

  public static abstract deprecated interface FragmentManager.BackStackEntry {
    method public abstract java.lang.CharSequence getBreadCrumbShortTitle();
    method public abstract int getBreadCrumbShortTitleRes();
    method public abstract java.lang.CharSequence getBreadCrumbTitle();
    method public abstract int getBreadCrumbTitleRes();
    method public abstract int getId();
    method public abstract java.lang.String getName();
  }

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

  public static abstract deprecated interface FragmentManager.OnBackStackChangedListener {
    method public abstract void onBackStackChanged();
  }

  public deprecated class FragmentManagerNonConfig {
  }

  public abstract deprecated class FragmentTransaction {
    ctor public FragmentTransaction();
    method public abstract android.app.FragmentTransaction add(android.app.Fragment, java.lang.String);
    method public abstract android.app.FragmentTransaction add(int, android.app.Fragment);
    method public abstract android.app.FragmentTransaction add(int, android.app.Fragment, java.lang.String);
    method public abstract android.app.FragmentTransaction addSharedElement(android.view.View, java.lang.String);
    method public abstract android.app.FragmentTransaction addToBackStack(java.lang.String);
    method public abstract android.app.FragmentTransaction attach(android.app.Fragment);
    method public abstract int commit();
    method public abstract int commitAllowingStateLoss();
    method public abstract void commitNow();
    method public abstract void commitNowAllowingStateLoss();
    method public abstract android.app.FragmentTransaction detach(android.app.Fragment);
    method public abstract android.app.FragmentTransaction disallowAddToBackStack();
    method public abstract android.app.FragmentTransaction hide(android.app.Fragment);
    method public abstract boolean isAddToBackStackAllowed();
    method public abstract boolean isEmpty();
    method public abstract android.app.FragmentTransaction remove(android.app.Fragment);
    method public abstract android.app.FragmentTransaction replace(int, android.app.Fragment);
    method public abstract android.app.FragmentTransaction replace(int, android.app.Fragment, java.lang.String);
    method public abstract android.app.FragmentTransaction runOnCommit(java.lang.Runnable);
    method public abstract android.app.FragmentTransaction setBreadCrumbShortTitle(int);
    method public abstract android.app.FragmentTransaction setBreadCrumbShortTitle(java.lang.CharSequence);
    method public abstract android.app.FragmentTransaction setBreadCrumbTitle(int);
    method public abstract android.app.FragmentTransaction setBreadCrumbTitle(java.lang.CharSequence);
    method public abstract android.app.FragmentTransaction setCustomAnimations(int, int);
    method public abstract android.app.FragmentTransaction setCustomAnimations(int, int, int, int);
    method public abstract android.app.FragmentTransaction setPrimaryNavigationFragment(android.app.Fragment);
    method public abstract android.app.FragmentTransaction setReorderingAllowed(boolean);
    method public abstract android.app.FragmentTransaction setTransition(int);
    method public abstract android.app.FragmentTransaction setTransitionStyle(int);
    method public abstract android.app.FragmentTransaction show(android.app.Fragment);
    field public static final int TRANSIT_ENTER_MASK = 4096; // 0x1000
    field public static final int TRANSIT_EXIT_MASK = 8192; // 0x2000
    field public static final int TRANSIT_FRAGMENT_CLOSE = 8194; // 0x2002
    field public static final int TRANSIT_FRAGMENT_FADE = 4099; // 0x1003
    field public static final int TRANSIT_FRAGMENT_OPEN = 4097; // 0x1001
    field public static final int TRANSIT_NONE = 0; // 0x0
    field 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(java.lang.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 java.lang.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(java.lang.Class<?>, android.content.Context, android.os.IBinder, android.app.Application, android.content.Intent, android.content.pm.ActivityInfo, java.lang.CharSequence, android.app.Activity, java.lang.String, java.lang.Object) throws java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public android.app.Activity newActivity(java.lang.ClassLoader, java.lang.String, android.content.Intent) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public android.app.Application newApplication(java.lang.ClassLoader, java.lang.String, android.content.Context) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public static android.app.Application newApplication(java.lang.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(java.lang.Object, java.lang.Throwable);
    method public void onStart();
    method public void removeMonitor(android.app.Instrumentation.ActivityMonitor);
    method public void runOnMainSync(java.lang.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(java.lang.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 public android.app.Activity startActivitySync(android.content.Intent, android.os.Bundle);
    method public deprecated void startAllocCounting();
    method public void startPerformanceSnapshot();
    method public void startProfiling();
    method public deprecated void stopAllocCounting();
    method public void stopProfiling();
    method public void waitForIdle(java.lang.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 java.lang.String REPORT_KEY_IDENTIFIER = "id";
    field public static final java.lang.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(java.lang.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(java.lang.String);
    method public android.os.IBinder onBind(android.content.Intent);
    method protected abstract void onHandleIntent(android.content.Intent);
    method public void onStart(android.content.Intent, int);
    method public void setIntentRedelivery(boolean);
  }

  public class KeyguardManager {
    method public android.content.Intent createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence);
    method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult);
    method public deprecated boolean inKeyguardRestrictedInputMode();
    method public boolean isDeviceLocked();
    method public boolean isDeviceSecure();
    method public boolean isKeyguardLocked();
    method public boolean isKeyguardSecure();
    method public deprecated android.app.KeyguardManager.KeyguardLock newKeyguardLock(java.lang.String);
    method public void requestDismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback);
  }

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

  public deprecated class KeyguardManager.KeyguardLock {
    method public void disableKeyguard();
    method public void reenableKeyguard();
  }

  public static abstract deprecated interface KeyguardManager.OnKeyguardExitResult {
    method public abstract 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 java.lang.String className;
    field public android.os.Bundle extras;
    field public android.graphics.drawable.Drawable icon;
    field public java.lang.CharSequence label;
    field public java.lang.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);
  }

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

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

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

  public deprecated class LocalActivityManager {
    ctor public LocalActivityManager(android.app.Activity, boolean);
    method public android.view.Window destroyActivity(java.lang.String, boolean);
    method public void dispatchCreate(android.os.Bundle);
    method public void dispatchDestroy(boolean);
    method public void dispatchPause(boolean);
    method public void dispatchResume();
    method public void dispatchStop();
    method public android.app.Activity getActivity(java.lang.String);
    method public android.app.Activity getCurrentActivity();
    method public java.lang.String getCurrentId();
    method public void removeAllActivities();
    method public android.os.Bundle saveInstanceState();
    method public android.view.Window startActivity(java.lang.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 java.lang.String META_DATA_FUNC_NAME = "android.app.func_name";
    field public static final java.lang.String META_DATA_LIB_NAME = "android.app.lib_name";
  }

  public class Notification implements android.os.Parcelable {
    ctor public Notification();
    ctor public deprecated Notification(int, java.lang.CharSequence, long);
    ctor public Notification(android.os.Parcel);
    method public android.app.Notification clone();
    method public int describeContents();
    method public int getBadgeIconType();
    method public java.lang.String getChannelId();
    method public java.lang.String getGroup();
    method public int getGroupAlertBehavior();
    method public android.graphics.drawable.Icon getLargeIcon();
    method public java.lang.CharSequence getSettingsText();
    method public java.lang.String getShortcutId();
    method public android.graphics.drawable.Icon getSmallIcon();
    method public java.lang.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 java.lang.String CATEGORY_ALARM = "alarm";
    field public static final java.lang.String CATEGORY_CALL = "call";
    field public static final java.lang.String CATEGORY_EMAIL = "email";
    field public static final java.lang.String CATEGORY_ERROR = "err";
    field public static final java.lang.String CATEGORY_EVENT = "event";
    field public static final java.lang.String CATEGORY_MESSAGE = "msg";
    field public static final java.lang.String CATEGORY_NAVIGATION = "navigation";
    field public static final java.lang.String CATEGORY_PROGRESS = "progress";
    field public static final java.lang.String CATEGORY_PROMO = "promo";
    field public static final java.lang.String CATEGORY_RECOMMENDATION = "recommendation";
    field public static final java.lang.String CATEGORY_REMINDER = "reminder";
    field public static final java.lang.String CATEGORY_SERVICE = "service";
    field public static final java.lang.String CATEGORY_SOCIAL = "social";
    field public static final java.lang.String CATEGORY_STATUS = "status";
    field public static final java.lang.String CATEGORY_SYSTEM = "sys";
    field public static final java.lang.String CATEGORY_TRANSPORT = "transport";
    field 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 java.lang.String EXTRA_AUDIO_CONTENTS_URI = "android.audioContents";
    field public static final java.lang.String EXTRA_BACKGROUND_IMAGE_URI = "android.backgroundImageUri";
    field public static final java.lang.String EXTRA_BIG_TEXT = "android.bigText";
    field public static final java.lang.String EXTRA_CHANNEL_GROUP_ID = "android.intent.extra.CHANNEL_GROUP_ID";
    field public static final java.lang.String EXTRA_CHANNEL_ID = "android.intent.extra.CHANNEL_ID";
    field public static final java.lang.String EXTRA_CHRONOMETER_COUNT_DOWN = "android.chronometerCountDown";
    field public static final java.lang.String EXTRA_COLORIZED = "android.colorized";
    field public static final java.lang.String EXTRA_COMPACT_ACTIONS = "android.compactActions";
    field public static final java.lang.String EXTRA_CONVERSATION_TITLE = "android.conversationTitle";
    field public static final java.lang.String EXTRA_HISTORIC_MESSAGES = "android.messages.historic";
    field public static final java.lang.String EXTRA_INFO_TEXT = "android.infoText";
    field public static final java.lang.String EXTRA_IS_GROUP_CONVERSATION = "android.isGroupConversation";
    field public static final deprecated java.lang.String EXTRA_LARGE_ICON = "android.largeIcon";
    field public static final java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big";
    field public static final java.lang.String EXTRA_MEDIA_SESSION = "android.mediaSession";
    field public static final java.lang.String EXTRA_MESSAGES = "android.messages";
    field public static final java.lang.String EXTRA_MESSAGING_PERSON = "android.messagingUser";
    field public static final java.lang.String EXTRA_NOTIFICATION_ID = "android.intent.extra.NOTIFICATION_ID";
    field public static final java.lang.String EXTRA_NOTIFICATION_TAG = "android.intent.extra.NOTIFICATION_TAG";
    field public static final deprecated java.lang.String EXTRA_PEOPLE = "android.people";
    field public static final java.lang.String EXTRA_PEOPLE_LIST = "android.people.list";
    field public static final java.lang.String EXTRA_PICTURE = "android.picture";
    field public static final java.lang.String EXTRA_PROGRESS = "android.progress";
    field public static final java.lang.String EXTRA_PROGRESS_INDETERMINATE = "android.progressIndeterminate";
    field public static final java.lang.String EXTRA_PROGRESS_MAX = "android.progressMax";
    field public static final java.lang.String EXTRA_REMOTE_INPUT_DRAFT = "android.remoteInputDraft";
    field public static final java.lang.String EXTRA_REMOTE_INPUT_HISTORY = "android.remoteInputHistory";
    field public static final deprecated java.lang.String EXTRA_SELF_DISPLAY_NAME = "android.selfDisplayName";
    field public static final java.lang.String EXTRA_SHOW_CHRONOMETER = "android.showChronometer";
    field public static final java.lang.String EXTRA_SHOW_WHEN = "android.showWhen";
    field public static final deprecated java.lang.String EXTRA_SMALL_ICON = "android.icon";
    field public static final java.lang.String EXTRA_SUB_TEXT = "android.subText";
    field public static final java.lang.String EXTRA_SUMMARY_TEXT = "android.summaryText";
    field public static final java.lang.String EXTRA_TEMPLATE = "android.template";
    field public static final java.lang.String EXTRA_TEXT = "android.text";
    field public static final java.lang.String EXTRA_TEXT_LINES = "android.textLines";
    field public static final java.lang.String EXTRA_TITLE = "android.title";
    field public static final java.lang.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 public static final deprecated 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 public static final deprecated 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 java.lang.String INTENT_CATEGORY_NOTIFICATION_PREFERENCES = "android.intent.category.NOTIFICATION_PREFERENCES";
    field public static final deprecated int PRIORITY_DEFAULT = 0; // 0x0
    field public static final deprecated int PRIORITY_HIGH = 1; // 0x1
    field public static final deprecated int PRIORITY_LOW = -1; // 0xffffffff
    field public static final deprecated int PRIORITY_MAX = 2; // 0x2
    field public static final deprecated int PRIORITY_MIN = -2; // 0xfffffffe
    field public static final deprecated 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 public deprecated android.media.AudioAttributes audioAttributes;
    field public deprecated int audioStreamType;
    field public deprecated android.widget.RemoteViews bigContentView;
    field public java.lang.String category;
    field public int color;
    field public android.app.PendingIntent contentIntent;
    field public deprecated android.widget.RemoteViews contentView;
    field public deprecated 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 public deprecated android.widget.RemoteViews headsUpContentView;
    field public deprecated int icon;
    field public int iconLevel;
    field public deprecated android.graphics.Bitmap largeIcon;
    field public deprecated int ledARGB;
    field public deprecated int ledOffMS;
    field public deprecated int ledOnMS;
    field public int number;
    field public deprecated int priority;
    field public android.app.Notification publicVersion;
    field public deprecated android.net.Uri sound;
    field public java.lang.CharSequence tickerText;
    field public deprecated android.widget.RemoteViews tickerView;
    field public deprecated long[] vibrate;
    field public int visibility;
    field public long when;
  }

  public static class Notification.Action implements android.os.Parcelable {
    ctor public deprecated Notification.Action(int, java.lang.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 public deprecated int icon;
    field public java.lang.CharSequence title;
  }

  public static final class Notification.Action.Builder {
    ctor public deprecated Notification.Action.Builder(int, java.lang.CharSequence, android.app.PendingIntent);
    ctor public Notification.Action.Builder(android.graphics.drawable.Icon, java.lang.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 abstract interface Notification.Action.Extender {
    method public abstract 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 public deprecated java.lang.CharSequence getCancelLabel();
    method public deprecated java.lang.CharSequence getConfirmLabel();
    method public boolean getHintDisplayActionInline();
    method public boolean getHintLaunchesActivity();
    method public deprecated java.lang.CharSequence getInProgressLabel();
    method public boolean isAvailableOffline();
    method public android.app.Notification.Action.WearableExtender setAvailableOffline(boolean);
    method public deprecated android.app.Notification.Action.WearableExtender setCancelLabel(java.lang.CharSequence);
    method public deprecated android.app.Notification.Action.WearableExtender setConfirmLabel(java.lang.CharSequence);
    method public android.app.Notification.Action.WearableExtender setHintDisplayActionInline(boolean);
    method public android.app.Notification.Action.WearableExtender setHintLaunchesActivity(boolean);
    method public deprecated android.app.Notification.Action.WearableExtender setInProgressLabel(java.lang.CharSequence);
  }

  public static class Notification.BigPictureStyle extends android.app.Notification.Style {
    ctor public Notification.BigPictureStyle();
    ctor public deprecated 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(java.lang.CharSequence);
    method public android.app.Notification.BigPictureStyle setSummaryText(java.lang.CharSequence);
  }

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

  public static class Notification.Builder {
    ctor public Notification.Builder(android.content.Context, java.lang.String);
    ctor public deprecated Notification.Builder(android.content.Context);
    method public deprecated android.app.Notification.Builder addAction(int, java.lang.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 public deprecated android.app.Notification.Builder addPerson(java.lang.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 public deprecated 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(java.lang.String);
    method public android.app.Notification.Builder setChannelId(java.lang.String);
    method public android.app.Notification.Builder setChronometerCountDown(boolean);
    method public android.app.Notification.Builder setColor(int);
    method public android.app.Notification.Builder setColorized(boolean);
    method public deprecated android.app.Notification.Builder setContent(android.widget.RemoteViews);
    method public deprecated android.app.Notification.Builder setContentInfo(java.lang.CharSequence);
    method public android.app.Notification.Builder setContentIntent(android.app.PendingIntent);
    method public android.app.Notification.Builder setContentText(java.lang.CharSequence);
    method public android.app.Notification.Builder setContentTitle(java.lang.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 public deprecated 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(java.lang.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 public deprecated android.app.Notification.Builder setLights(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 public deprecated 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(java.lang.CharSequence[]);
    method public android.app.Notification.Builder setSettingsText(java.lang.CharSequence);
    method public android.app.Notification.Builder setShortcutId(java.lang.String);
    method public android.app.Notification.Builder setShowWhen(boolean);
    method public android.app.Notification.Builder setSmallIcon(int);
    method public android.app.Notification.Builder setSmallIcon(int, int);
    method public android.app.Notification.Builder setSmallIcon(android.graphics.drawable.Icon);
    method public android.app.Notification.Builder setSortKey(java.lang.String);
    method public deprecated android.app.Notification.Builder setSound(android.net.Uri);
    method public deprecated android.app.Notification.Builder setSound(android.net.Uri, int);
    method public deprecated 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(java.lang.CharSequence);
    method public android.app.Notification.Builder setTicker(java.lang.CharSequence);
    method public deprecated android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews);
    method public android.app.Notification.Builder setTimeoutAfter(long);
    method public android.app.Notification.Builder setUsesChronometer(boolean);
    method public deprecated 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 public int getColor();
    method public android.graphics.Bitmap getLargeIcon();
    method public android.app.Notification.CarExtender.UnreadConversation getUnreadConversation();
    method public android.app.Notification.CarExtender setColor(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(java.lang.String);
    method public android.app.Notification.CarExtender.Builder addMessage(java.lang.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 java.lang.String[] getMessages();
    method public java.lang.String getParticipant();
    method public java.lang.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 abstract interface Notification.Extender {
    method public abstract android.app.Notification.Builder extend(android.app.Notification.Builder);
  }

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

  public static class Notification.MediaStyle extends android.app.Notification.Style {
    ctor public Notification.MediaStyle();
    ctor public deprecated 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 public deprecated Notification.MessagingStyle(java.lang.CharSequence);
    ctor public Notification.MessagingStyle(android.app.Person);
    method public android.app.Notification.MessagingStyle addHistoricMessage(android.app.Notification.MessagingStyle.Message);
    method public deprecated android.app.Notification.MessagingStyle addMessage(java.lang.CharSequence, long, java.lang.CharSequence);
    method public android.app.Notification.MessagingStyle addMessage(java.lang.CharSequence, long, android.app.Person);
    method public android.app.Notification.MessagingStyle addMessage(android.app.Notification.MessagingStyle.Message);
    method public java.lang.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 public android.app.Person getUser();
    method public deprecated java.lang.CharSequence getUserDisplayName();
    method public boolean isGroupConversation();
    method public android.app.Notification.MessagingStyle setConversationTitle(java.lang.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 public deprecated Notification.MessagingStyle.Message(java.lang.CharSequence, long, java.lang.CharSequence);
    ctor public Notification.MessagingStyle.Message(java.lang.CharSequence, long, android.app.Person);
    method public java.lang.String getDataMimeType();
    method public android.net.Uri getDataUri();
    method public android.os.Bundle getExtras();
    method public deprecated java.lang.CharSequence getSender();
    method public android.app.Person getSenderPerson();
    method public java.lang.CharSequence getText();
    method public long getTimestamp();
    method public android.app.Notification.MessagingStyle.Message setData(java.lang.String, android.net.Uri);
  }

  public static abstract 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(java.lang.CharSequence);
    method protected void internalSetSummaryText(java.lang.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 java.lang.String getBridgeTag();
    method public int getContentAction();
    method public deprecated int getContentIcon();
    method public deprecated int getContentIconGravity();
    method public boolean getContentIntentAvailableOffline();
    method public deprecated int getCustomContentHeight();
    method public deprecated int getCustomSizePreset();
    method public java.lang.String getDismissalId();
    method public android.app.PendingIntent getDisplayIntent();
    method public deprecated int getGravity();
    method public boolean getHintAmbientBigPicture();
    method public deprecated boolean getHintAvoidBackgroundClipping();
    method public boolean getHintContentIntentLaunchesActivity();
    method public deprecated boolean getHintHideIcon();
    method public deprecated int getHintScreenTimeout();
    method public deprecated 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(java.lang.String);
    method public android.app.Notification.WearableExtender setContentAction(int);
    method public deprecated android.app.Notification.WearableExtender setContentIcon(int);
    method public deprecated android.app.Notification.WearableExtender setContentIconGravity(int);
    method public android.app.Notification.WearableExtender setContentIntentAvailableOffline(boolean);
    method public deprecated android.app.Notification.WearableExtender setCustomContentHeight(int);
    method public deprecated android.app.Notification.WearableExtender setCustomSizePreset(int);
    method public android.app.Notification.WearableExtender setDismissalId(java.lang.String);
    method public android.app.Notification.WearableExtender setDisplayIntent(android.app.PendingIntent);
    method public deprecated android.app.Notification.WearableExtender setGravity(int);
    method public android.app.Notification.WearableExtender setHintAmbientBigPicture(boolean);
    method public deprecated android.app.Notification.WearableExtender setHintAvoidBackgroundClipping(boolean);
    method public android.app.Notification.WearableExtender setHintContentIntentLaunchesActivity(boolean);
    method public deprecated android.app.Notification.WearableExtender setHintHideIcon(boolean);
    method public deprecated android.app.Notification.WearableExtender setHintScreenTimeout(int);
    method public deprecated 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(java.lang.String, java.lang.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 java.lang.String getDescription();
    method public java.lang.String getGroup();
    method public java.lang.String getId();
    method public int getImportance();
    method public int getLightColor();
    method public int getLockscreenVisibility();
    method public java.lang.CharSequence getName();
    method public android.net.Uri getSound();
    method public long[] getVibrationPattern();
    method public void setBypassDnd(boolean);
    method public void setDescription(java.lang.String);
    method public void setGroup(java.lang.String);
    method public void setImportance(int);
    method public void setLightColor(int);
    method public void setLockscreenVisibility(int);
    method public void setName(java.lang.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 java.lang.String DEFAULT_CHANNEL_ID = "miscellaneous";
  }

  public final class NotificationChannelGroup implements android.os.Parcelable {
    ctor public NotificationChannelGroup(java.lang.String, java.lang.CharSequence);
    method public android.app.NotificationChannelGroup clone();
    method public int describeContents();
    method public java.util.List<android.app.NotificationChannel> getChannels();
    method public java.lang.String getDescription();
    method public java.lang.String getId();
    method public java.lang.CharSequence getName();
    method public boolean isBlocked();
    method public void setDescription(java.lang.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 java.lang.String addAutomaticZenRule(android.app.AutomaticZenRule);
    method public boolean areNotificationsEnabled();
    method public void cancel(int);
    method public void cancel(java.lang.String, int);
    method public void cancelAll();
    method public void createNotificationChannel(android.app.NotificationChannel);
    method public void createNotificationChannelGroup(android.app.NotificationChannelGroup);
    method public void createNotificationChannelGroups(java.util.List<android.app.NotificationChannelGroup>);
    method public void createNotificationChannels(java.util.List<android.app.NotificationChannel>);
    method public void deleteNotificationChannel(java.lang.String);
    method public void deleteNotificationChannelGroup(java.lang.String);
    method public android.service.notification.StatusBarNotification[] getActiveNotifications();
    method public android.app.AutomaticZenRule getAutomaticZenRule(java.lang.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(java.lang.String);
    method public android.app.NotificationChannelGroup getNotificationChannelGroup(java.lang.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(java.lang.String, int, android.app.Notification);
    method public boolean removeAutomaticZenRule(java.lang.String);
    method public final void setInterruptionFilter(int);
    method public void setNotificationPolicy(android.app.NotificationManager.Policy);
    method public boolean updateAutomaticZenRule(java.lang.String, android.app.AutomaticZenRule);
    field public static final java.lang.String ACTION_APP_BLOCK_STATE_CHANGED = "android.app.action.APP_BLOCK_STATE_CHANGED";
    field public static final java.lang.String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED";
    field public static final java.lang.String ACTION_NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED = "android.app.action.NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED";
    field public static final java.lang.String ACTION_NOTIFICATION_CHANNEL_GROUP_BLOCK_STATE_CHANGED = "android.app.action.NOTIFICATION_CHANNEL_GROUP_BLOCK_STATE_CHANGED";
    field public static final java.lang.String ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED = "android.app.action.NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED";
    field public static final java.lang.String ACTION_NOTIFICATION_POLICY_CHANGED = "android.app.action.NOTIFICATION_POLICY_CHANGED";
    field public static final java.lang.String EXTRA_BLOCKED_STATE = "android.app.extra.BLOCKED_STATE";
    field public static final java.lang.String EXTRA_NOTIFICATION_CHANNEL_GROUP_ID = "android.app.extra.NOTIFICATION_CHANNEL_GROUP_ID";
    field public static final java.lang.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 java.lang.String priorityCategoriesToString(int);
    method public static java.lang.String prioritySendersToString(int);
    method public static java.lang.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 public static final deprecated int SUPPRESSED_EFFECT_SCREEN_OFF = 1; // 0x1
    field public static final deprecated 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, android.content.Intent[], int);
    method public static android.app.PendingIntent getActivities(android.content.Context, int, android.content.Intent[], int, 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, android.content.Intent, int, android.os.Bundle);
    method public static android.app.PendingIntent getBroadcast(android.content.Context, int, android.content.Intent, int);
    method public java.lang.String getCreatorPackage();
    method public int getCreatorUid();
    method public android.os.UserHandle getCreatorUserHandle();
    method public static android.app.PendingIntent getForegroundService(android.content.Context, int, android.content.Intent, int);
    method public android.content.IntentSender getIntentSender();
    method public static android.app.PendingIntent getService(android.content.Context, int, android.content.Intent, int);
    method public deprecated java.lang.String getTargetPackage();
    method public static android.app.PendingIntent readPendingIntentOrNullFromParcel(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, android.content.Intent) throws android.app.PendingIntent.CanceledException;
    method public void send(int, android.app.PendingIntent.OnFinished, android.os.Handler) throws android.app.PendingIntent.CanceledException;
    method public void send(android.content.Context, int, android.content.Intent, android.app.PendingIntent.OnFinished, android.os.Handler) throws android.app.PendingIntent.CanceledException;
    method public void send(android.content.Context, int, android.content.Intent, android.app.PendingIntent.OnFinished, android.os.Handler, java.lang.String) throws android.app.PendingIntent.CanceledException;
    method public void send(android.content.Context, int, android.content.Intent, android.app.PendingIntent.OnFinished, android.os.Handler, java.lang.String, android.os.Bundle) throws android.app.PendingIntent.CanceledException;
    method public static void writePendingIntentOrNullToParcel(android.app.PendingIntent, 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(java.lang.String);
    ctor public PendingIntent.CanceledException(java.lang.Exception);
  }

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

  public final class Person implements android.os.Parcelable {
    method public int describeContents();
    method public android.graphics.drawable.Icon getIcon();
    method public java.lang.String getKey();
    method public java.lang.CharSequence getName();
    method public java.lang.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 public android.app.Person build();
    method public android.app.Person.Builder setBot(boolean);
    method public android.app.Person.Builder setIcon(android.graphics.drawable.Icon);
    method public android.app.Person.Builder setImportant(boolean);
    method public android.app.Person.Builder setKey(java.lang.String);
    method public android.app.Person.Builder setName(java.lang.CharSequence);
    method public android.app.Person.Builder setUri(java.lang.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();
  }

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

  public final class RemoteAction implements android.os.Parcelable {
    ctor public RemoteAction(android.graphics.drawable.Icon, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent);
    method public android.app.RemoteAction clone();
    method public int describeContents();
    method public void dump(java.lang.String, java.io.PrintWriter);
    method public android.app.PendingIntent getActionIntent();
    method public java.lang.CharSequence getContentDescription();
    method public android.graphics.drawable.Icon getIcon();
    method public java.lang.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 java.lang.CharSequence[] getChoices();
    method public static java.util.Map<java.lang.String, android.net.Uri> getDataResultsFromIntent(android.content.Intent, java.lang.String);
    method public android.os.Bundle getExtras();
    method public java.lang.CharSequence getLabel();
    method public java.lang.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 java.lang.String EXTRA_RESULTS_DATA = "android.remoteinput.resultsData";
    field public static final java.lang.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(java.lang.String);
    method public android.app.RemoteInput.Builder addExtras(android.os.Bundle);
    method public android.app.RemoteInput build();
    method public android.os.Bundle getExtras();
    method public android.app.RemoteInput.Builder setAllowDataType(java.lang.String, boolean);
    method public android.app.RemoteInput.Builder setAllowFreeFormInput(boolean);
    method public android.app.RemoteInput.Builder setChoices(java.lang.CharSequence[]);
    method public android.app.RemoteInput.Builder setLabel(java.lang.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 public deprecated void onCancel(android.content.DialogInterface);
    method public deprecated 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(java.lang.String, boolean, android.content.ComponentName, android.os.Bundle, boolean);
    method public void stopSearch();
    method public void triggerSearch(java.lang.String, android.content.ComponentName, android.os.Bundle);
    field public static final java.lang.String ACTION_KEY = "action_key";
    field public static final java.lang.String ACTION_MSG = "action_msg";
    field public static final java.lang.String APP_DATA = "app_data";
    field public static final java.lang.String CURSOR_EXTRA_KEY_IN_PROGRESS = "in_progress";
    field public static final java.lang.String EXTRA_DATA_KEY = "intent_extra_data_key";
    field public static final java.lang.String EXTRA_NEW_SEARCH = "new_search";
    field public static final java.lang.String EXTRA_SELECT_QUERY = "select_query";
    field public static final java.lang.String EXTRA_WEB_SEARCH_PENDINGINTENT = "web_search_pendingintent";
    field public static final int FLAG_QUERY_REFINEMENT = 1; // 0x1
    field public static final java.lang.String INTENT_ACTION_GLOBAL_SEARCH = "android.search.action.GLOBAL_SEARCH";
    field public static final java.lang.String INTENT_ACTION_SEARCHABLES_CHANGED = "android.search.action.SEARCHABLES_CHANGED";
    field public static final java.lang.String INTENT_ACTION_SEARCH_SETTINGS = "android.search.action.SEARCH_SETTINGS";
    field public static final java.lang.String INTENT_ACTION_SEARCH_SETTINGS_CHANGED = "android.search.action.SETTINGS_CHANGED";
    field public static final java.lang.String INTENT_ACTION_WEB_SEARCH_SETTINGS = "android.search.action.WEB_SEARCH_SETTINGS";
    field public static final java.lang.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 java.lang.String QUERY = "query";
    field public static final java.lang.String SHORTCUT_MIME_TYPE = "vnd.android.cursor.item/vnd.android.search.suggest";
    field public static final java.lang.String SUGGEST_COLUMN_AUDIO_CHANNEL_CONFIG = "suggest_audio_channel_config";
    field public static final java.lang.String SUGGEST_COLUMN_CONTENT_TYPE = "suggest_content_type";
    field public static final java.lang.String SUGGEST_COLUMN_DURATION = "suggest_duration";
    field public static final java.lang.String SUGGEST_COLUMN_FLAGS = "suggest_flags";
    field public static final java.lang.String SUGGEST_COLUMN_FORMAT = "suggest_format";
    field public static final java.lang.String SUGGEST_COLUMN_ICON_1 = "suggest_icon_1";
    field public static final java.lang.String SUGGEST_COLUMN_ICON_2 = "suggest_icon_2";
    field public static final java.lang.String SUGGEST_COLUMN_INTENT_ACTION = "suggest_intent_action";
    field public static final java.lang.String SUGGEST_COLUMN_INTENT_DATA = "suggest_intent_data";
    field public static final java.lang.String SUGGEST_COLUMN_INTENT_DATA_ID = "suggest_intent_data_id";
    field public static final java.lang.String SUGGEST_COLUMN_INTENT_EXTRA_DATA = "suggest_intent_extra_data";
    field public static final java.lang.String SUGGEST_COLUMN_IS_LIVE = "suggest_is_live";
    field public static final java.lang.String SUGGEST_COLUMN_LAST_ACCESS_HINT = "suggest_last_access_hint";
    field public static final java.lang.String SUGGEST_COLUMN_PRODUCTION_YEAR = "suggest_production_year";
    field public static final java.lang.String SUGGEST_COLUMN_PURCHASE_PRICE = "suggest_purchase_price";
    field public static final java.lang.String SUGGEST_COLUMN_QUERY = "suggest_intent_query";
    field public static final java.lang.String SUGGEST_COLUMN_RATING_SCORE = "suggest_rating_score";
    field public static final java.lang.String SUGGEST_COLUMN_RATING_STYLE = "suggest_rating_style";
    field public static final java.lang.String SUGGEST_COLUMN_RENTAL_PRICE = "suggest_rental_price";
    field public static final java.lang.String SUGGEST_COLUMN_RESULT_CARD_IMAGE = "suggest_result_card_image";
    field public static final java.lang.String SUGGEST_COLUMN_SHORTCUT_ID = "suggest_shortcut_id";
    field public static final java.lang.String SUGGEST_COLUMN_SPINNER_WHILE_REFRESHING = "suggest_spinner_while_refreshing";
    field public static final java.lang.String SUGGEST_COLUMN_TEXT_1 = "suggest_text_1";
    field public static final java.lang.String SUGGEST_COLUMN_TEXT_2 = "suggest_text_2";
    field public static final java.lang.String SUGGEST_COLUMN_TEXT_2_URL = "suggest_text_2_url";
    field public static final java.lang.String SUGGEST_COLUMN_VIDEO_HEIGHT = "suggest_video_height";
    field public static final java.lang.String SUGGEST_COLUMN_VIDEO_WIDTH = "suggest_video_width";
    field public static final java.lang.String SUGGEST_MIME_TYPE = "vnd.android.cursor.dir/vnd.android.search.suggest";
    field public static final java.lang.String SUGGEST_NEVER_MAKE_SHORTCUT = "_-1";
    field public static final java.lang.String SUGGEST_PARAMETER_LIMIT = "limit";
    field public static final java.lang.String SUGGEST_URI_PATH_QUERY = "search_suggest_query";
    field public static final java.lang.String SUGGEST_URI_PATH_SHORTCUT = "search_suggest_shortcut";
    field public static final java.lang.String USER_QUERY = "user_query";
  }

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

  public static abstract interface SearchManager.OnDismissListener {
    method public abstract 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 java.lang.String getSuggestAuthority();
    method public java.lang.String getSuggestIntentAction();
    method public java.lang.String getSuggestIntentData();
    method public java.lang.String getSuggestPackage();
    method public java.lang.String getSuggestPath();
    method public java.lang.String getSuggestSelection();
    method public int getSuggestThreshold();
    method public int getVoiceLanguageId();
    method public int getVoiceLanguageModeId();
    method public int getVoiceMaxResults();
    method 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, java.lang.String[]);
    method public final android.app.Application getApplication();
    method 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 public deprecated 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 abstract interface SharedElementCallback.OnSharedElementsReadyListener {
    method public abstract void onSharedElementsReady();
  }

  public deprecated class TabActivity extends android.app.ActivityGroup {
    ctor public TabActivity();
    method public android.widget.TabHost getTabHost();
    method public android.widget.TabWidget getTabWidget();
    method public void setDefaultTab(java.lang.String);
    method 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(java.lang.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 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 abstract interface TimePickerDialog.OnTimeSetListener {
    method public abstract 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(java.lang.Runnable, android.app.UiAutomation.AccessibilityEventFilter, long) throws java.util.concurrent.TimeoutException;
    method public android.os.ParcelFileDescriptor executeShellCommand(java.lang.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(java.lang.String, java.lang.String);
    method public void grantRuntimePermissionAsUser(java.lang.String, java.lang.String, android.os.UserHandle);
    method public boolean injectInputEvent(android.view.InputEvent, boolean);
    method public boolean performGlobalAction(int);
    method public void revokeRuntimePermission(java.lang.String, java.lang.String);
    method public void revokeRuntimePermissionAsUser(java.lang.String, java.lang.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 abstract interface UiAutomation.AccessibilityEventFilter {
    method public abstract boolean accept(android.view.accessibility.AccessibilityEvent);
  }

  public static abstract interface UiAutomation.OnAccessibilityEventListener {
    method public abstract 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 java.lang.String ACTION_ENTER_CAR_MODE;
    field public static java.lang.String ACTION_ENTER_DESK_MODE;
    field public static java.lang.String ACTION_EXIT_CAR_MODE;
    field public static java.lang.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(java.lang.String);
    method public android.app.VoiceInteractor.Request[] getActiveRequests();
    method public boolean submitRequest(android.app.VoiceInteractor.Request);
    method public boolean submitRequest(android.app.VoiceInteractor.Request, java.lang.String);
    method public boolean[] supportsCommands(java.lang.String[]);
  }

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

  public static class VoiceInteractor.CommandRequest extends android.app.VoiceInteractor.Request {
    ctor public VoiceInteractor.CommandRequest(java.lang.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(android.app.VoiceInteractor.Prompt, android.os.Bundle);
    method public void onCompleteResult(android.os.Bundle);
  }

  public static class VoiceInteractor.ConfirmationRequest extends android.app.VoiceInteractor.Request {
    ctor public VoiceInteractor.ConfirmationRequest(android.app.VoiceInteractor.Prompt, 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(android.app.VoiceInteractor.Prompt, android.app.VoiceInteractor.PickOptionRequest.Option[], 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(java.lang.CharSequence, int);
    method public android.app.VoiceInteractor.PickOptionRequest.Option addSynonym(java.lang.CharSequence);
    method public int countSynonyms();
    method public int describeContents();
    method public android.os.Bundle getExtras();
    method public int getIndex();
    method public java.lang.CharSequence getLabel();
    method public java.lang.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(java.lang.CharSequence[], java.lang.CharSequence);
    ctor public VoiceInteractor.Prompt(java.lang.CharSequence);
    method public int countVoicePrompts();
    method public int describeContents();
    method public java.lang.CharSequence getVisualPrompt();
    method public java.lang.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 static abstract class VoiceInteractor.Request {
    method public void cancel();
    method public android.app.Activity getActivity();
    method public android.content.Context getContext();
    method public java.lang.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(android.graphics.Color, android.graphics.Color, android.graphics.Color);
    method public int describeContents();
    method public static android.app.WallpaperColors fromBitmap(android.graphics.Bitmap);
    method public static android.app.WallpaperColors fromDrawable(android.graphics.drawable.Drawable);
    method public android.graphics.Color getPrimaryColor();
    method public android.graphics.Color getSecondaryColor();
    method 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, java.lang.String);
    method public android.content.ComponentName getComponent();
    method public java.lang.String getPackageName();
    method public android.content.pm.ServiceInfo getServiceInfo();
    method public java.lang.String getServiceName();
    method public java.lang.String getSettingsActivity();
    method public boolean getShowMetadataInPreview();
    method public java.lang.CharSequence loadAuthor(android.content.pm.PackageManager) throws android.content.res.Resources.NotFoundException;
    method public java.lang.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 java.lang.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 java.lang.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(android.app.WallpaperManager.OnColorsChangedListener, android.os.Handler);
    method public void clear() throws java.io.IOException;
    method public void clear(int) throws java.io.IOException;
    method 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 public android.graphics.drawable.Drawable getFastDrawable();
    method public static android.app.WallpaperManager getInstance(android.content.Context);
    method public android.app.WallpaperColors getWallpaperColors(int);
    method public android.os.ParcelFileDescriptor getWallpaperFile(int);
    method public int getWallpaperId(int);
    method public android.app.WallpaperInfo getWallpaperInfo();
    method public boolean hasResourceWallpaper(int);
    method public boolean isSetWallpaperAllowed();
    method public boolean isWallpaperSupported();
    method public android.graphics.drawable.Drawable peekDrawable();
    method public android.graphics.drawable.Drawable peekFastDrawable();
    method public void removeOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
    method public void sendWallpaperCommand(android.os.IBinder, java.lang.String, int, int, int, android.os.Bundle);
    method public void setBitmap(android.graphics.Bitmap) throws java.io.IOException;
    method public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean) throws java.io.IOException;
    method public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean, int) throws java.io.IOException;
    method public void setDisplayPadding(android.graphics.Rect);
    method public void setResource(int) throws java.io.IOException;
    method public int setResource(int, int) throws java.io.IOException;
    method public void setStream(java.io.InputStream) throws java.io.IOException;
    method public int setStream(java.io.InputStream, android.graphics.Rect, boolean) throws java.io.IOException;
    method 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 java.lang.String ACTION_CHANGE_LIVE_WALLPAPER = "android.service.wallpaper.CHANGE_LIVE_WALLPAPER";
    field public static final java.lang.String ACTION_CROP_AND_SET_WALLPAPER = "android.service.wallpaper.CROP_AND_SET_WALLPAPER";
    field public static final java.lang.String ACTION_LIVE_WALLPAPER_CHOOSER = "android.service.wallpaper.LIVE_WALLPAPER_CHOOSER";
    field public static final java.lang.String COMMAND_DROP = "android.home.drop";
    field public static final java.lang.String COMMAND_SECONDARY_TAP = "android.wallpaper.secondaryTap";
    field public static final java.lang.String COMMAND_TAP = "android.wallpaper.tap";
    field public static final java.lang.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 java.lang.String WALLPAPER_PREVIEW_META_DATA = "android.wallpaper.preview";
  }

  public static abstract interface WallpaperManager.OnColorsChangedListener {
    method public abstract 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, java.lang.String);
    method public android.content.pm.ActivityInfo getActivityInfo();
    method public android.content.ComponentName getComponent();
    method public java.lang.String getPackageName();
    method public java.lang.String getReceiverName();
    method public java.lang.String getTagForPolicy(int);
    method public boolean isVisible();
    method public java.lang.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 java.lang.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, java.lang.String);
    method public void onBugreportSharingDeclined(android.content.Context, android.content.Intent);
    method public java.lang.String onChoosePrivateKeyAlias(android.content.Context, android.content.Intent, int, android.net.Uri, java.lang.String);
    method public java.lang.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, java.lang.String);
    method public void onLockTaskModeExiting(android.content.Context, android.content.Intent);
    method public void onNetworkLogsAvailable(android.content.Context, android.content.Intent, long, int);
    method public deprecated void onPasswordChanged(android.content.Context, android.content.Intent);
    method public void onPasswordChanged(android.content.Context, android.content.Intent, android.os.UserHandle);
    method public deprecated void onPasswordExpiring(android.content.Context, android.content.Intent);
    method public void onPasswordExpiring(android.content.Context, android.content.Intent, android.os.UserHandle);
    method public deprecated void onPasswordFailed(android.content.Context, android.content.Intent);
    method public void onPasswordFailed(android.content.Context, android.content.Intent, android.os.UserHandle);
    method public deprecated 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 public deprecated 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(android.content.Context, android.os.PersistableBundle);
    method public void onUserAdded(android.content.Context, android.content.Intent, android.os.UserHandle);
    method public void onUserRemoved(android.content.Context, android.content.Intent, android.os.UserHandle);
    method public void onUserStarted(android.content.Context, android.content.Intent, android.os.UserHandle);
    method public void onUserStopped(android.content.Context, android.content.Intent, android.os.UserHandle);
    method public void onUserSwitched(android.content.Context, android.content.Intent, android.os.UserHandle);
    field public static final java.lang.String ACTION_DEVICE_ADMIN_DISABLED = "android.app.action.DEVICE_ADMIN_DISABLED";
    field public static final java.lang.String ACTION_DEVICE_ADMIN_DISABLE_REQUESTED = "android.app.action.DEVICE_ADMIN_DISABLE_REQUESTED";
    field public static final java.lang.String ACTION_DEVICE_ADMIN_ENABLED = "android.app.action.DEVICE_ADMIN_ENABLED";
    field public static final java.lang.String ACTION_LOCK_TASK_ENTERING = "android.app.action.LOCK_TASK_ENTERING";
    field public static final java.lang.String ACTION_LOCK_TASK_EXITING = "android.app.action.LOCK_TASK_EXITING";
    field public static final java.lang.String ACTION_PASSWORD_CHANGED = "android.app.action.ACTION_PASSWORD_CHANGED";
    field public static final java.lang.String ACTION_PASSWORD_EXPIRING = "android.app.action.ACTION_PASSWORD_EXPIRING";
    field public static final java.lang.String ACTION_PASSWORD_FAILED = "android.app.action.ACTION_PASSWORD_FAILED";
    field public static final java.lang.String ACTION_PASSWORD_SUCCEEDED = "android.app.action.ACTION_PASSWORD_SUCCEEDED";
    field public static final java.lang.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 java.lang.String DEVICE_ADMIN_META_DATA = "android.app.device_admin";
    field public static final java.lang.String EXTRA_DISABLE_WARNING = "android.app.extra.DISABLE_WARNING";
    field public static final java.lang.String EXTRA_LOCK_TASK_PACKAGE = "android.app.extra.LOCK_TASK_PACKAGE";
    field public static final java.lang.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(android.content.ComponentName, android.content.IntentFilter, int);
    method public boolean addCrossProfileWidgetProvider(android.content.ComponentName, java.lang.String);
    method public int addOverrideApn(android.content.ComponentName, android.telephony.data.ApnSetting);
    method public void addPersistentPreferredActivity(android.content.ComponentName, android.content.IntentFilter, android.content.ComponentName);
    method public void addUserRestriction(android.content.ComponentName, java.lang.String);
    method public boolean bindDeviceAdminServiceAsUser(android.content.ComponentName, android.content.Intent, android.content.ServiceConnection, int, android.os.UserHandle);
    method public void clearApplicationUserData(android.content.ComponentName, java.lang.String, java.util.concurrent.Executor, android.app.admin.DevicePolicyManager.OnClearApplicationUserDataListener);
    method public void clearCrossProfileIntentFilters(android.content.ComponentName);
    method public deprecated void clearDeviceOwnerApp(java.lang.String);
    method public void clearPackagePersistentPreferredActivities(android.content.ComponentName, java.lang.String);
    method public deprecated void clearProfileOwner(android.content.ComponentName);
    method public boolean clearResetPasswordToken(android.content.ComponentName);
    method public void clearUserRestriction(android.content.ComponentName, java.lang.String);
    method public android.content.Intent createAdminSupportIntent(java.lang.String);
    method public android.os.UserHandle createAndManageUser(android.content.ComponentName, java.lang.String, android.content.ComponentName, android.os.PersistableBundle, int);
    method public void enableSystemApp(android.content.ComponentName, java.lang.String);
    method public int enableSystemApp(android.content.ComponentName, android.content.Intent);
    method public android.security.AttestedKeyPair generateKeyPair(android.content.ComponentName, java.lang.String, android.security.keystore.KeyGenParameterSpec, int);
    method public java.lang.String[] getAccountTypesWithManagementDisabled();
    method public java.util.List<android.content.ComponentName> getActiveAdmins();
    method public java.util.Set<java.lang.String> getAffiliationIds(android.content.ComponentName);
    method public java.lang.String getAlwaysOnVpnPackage(android.content.ComponentName);
    method public android.os.Bundle getApplicationRestrictions(android.content.ComponentName, java.lang.String);
    method public deprecated java.lang.String getApplicationRestrictionsManagingPackage(android.content.ComponentName);
    method public boolean getAutoTimeRequired();
    method public java.util.List<android.os.UserHandle> getBindDeviceAdminTargetUsers(android.content.ComponentName);
    method public boolean getBluetoothContactSharingDisabled(android.content.ComponentName);
    method public boolean getCameraDisabled(android.content.ComponentName);
    method public deprecated java.lang.String getCertInstallerPackage(android.content.ComponentName) throws java.lang.SecurityException;
    method public boolean getCrossProfileCallerIdDisabled(android.content.ComponentName);
    method public boolean getCrossProfileContactsSearchDisabled(android.content.ComponentName);
    method public java.util.List<java.lang.String> getCrossProfileWidgetProviders(android.content.ComponentName);
    method public int getCurrentFailedPasswordAttempts();
    method public java.util.List<java.lang.String> getDelegatePackages(android.content.ComponentName, java.lang.String);
    method public java.util.List<java.lang.String> getDelegatedScopes(android.content.ComponentName, java.lang.String);
    method public java.lang.CharSequence getDeviceOwnerLockScreenInfo();
    method public java.lang.CharSequence getEndUserSessionMessage(android.content.ComponentName);
    method public java.util.List<byte[]> getInstalledCaCerts(android.content.ComponentName);
    method public java.util.List<java.lang.String> getKeepUninstalledPackages(android.content.ComponentName);
    method public int getKeyguardDisabledFeatures(android.content.ComponentName);
    method public int getLockTaskFeatures(android.content.ComponentName);
    method public java.lang.String[] getLockTaskPackages(android.content.ComponentName);
    method public java.lang.CharSequence getLongSupportMessage(android.content.ComponentName);
    method public int getMaximumFailedPasswordsForWipe(android.content.ComponentName);
    method public long getMaximumTimeToLock(android.content.ComponentName);
    method public java.util.List<java.lang.String> getMeteredDataDisabledPackages(android.content.ComponentName);
    method public int getOrganizationColor(android.content.ComponentName);
    method public java.lang.CharSequence getOrganizationName(android.content.ComponentName);
    method public java.util.List<android.telephony.data.ApnSetting> getOverrideApns(android.content.ComponentName);
    method public android.app.admin.DevicePolicyManager getParentProfileInstance(android.content.ComponentName);
    method public long getPasswordExpiration(android.content.ComponentName);
    method public long getPasswordExpirationTimeout(android.content.ComponentName);
    method public int getPasswordHistoryLength(android.content.ComponentName);
    method public int getPasswordMaximumLength(int);
    method public int getPasswordMinimumLength(android.content.ComponentName);
    method public int getPasswordMinimumLetters(android.content.ComponentName);
    method public int getPasswordMinimumLowerCase(android.content.ComponentName);
    method public int getPasswordMinimumNonLetter(android.content.ComponentName);
    method public int getPasswordMinimumNumeric(android.content.ComponentName);
    method public int getPasswordMinimumSymbols(android.content.ComponentName);
    method public int getPasswordMinimumUpperCase(android.content.ComponentName);
    method public int getPasswordQuality(android.content.ComponentName);
    method public android.app.admin.SystemUpdateInfo getPendingSystemUpdate(android.content.ComponentName);
    method public int getPermissionGrantState(android.content.ComponentName, java.lang.String, java.lang.String);
    method public int getPermissionPolicy(android.content.ComponentName);
    method public java.util.List<java.lang.String> getPermittedAccessibilityServices(android.content.ComponentName);
    method public java.util.List<java.lang.String> getPermittedCrossProfileNotificationListeners(android.content.ComponentName);
    method public java.util.List<java.lang.String> getPermittedInputMethods(android.content.ComponentName);
    method public long getRequiredStrongAuthTimeout(android.content.ComponentName);
    method public boolean getScreenCaptureDisabled(android.content.ComponentName);
    method public java.util.List<android.os.UserHandle> getSecondaryUsers(android.content.ComponentName);
    method public java.lang.CharSequence getShortSupportMessage(android.content.ComponentName);
    method public java.lang.CharSequence getStartUserSessionMessage(android.content.ComponentName);
    method public boolean getStorageEncryption(android.content.ComponentName);
    method public int getStorageEncryptionStatus();
    method public android.app.admin.SystemUpdatePolicy getSystemUpdatePolicy();
    method public android.os.PersistableBundle getTransferOwnershipBundle();
    method public java.util.List<android.os.PersistableBundle> getTrustAgentConfiguration(android.content.ComponentName, android.content.ComponentName);
    method public android.os.Bundle getUserRestrictions(android.content.ComponentName);
    method public java.lang.String getWifiMacAddress(android.content.ComponentName);
    method public boolean hasCaCertInstalled(android.content.ComponentName, byte[]);
    method public boolean hasGrantedPolicy(android.content.ComponentName, int);
    method public boolean installCaCert(android.content.ComponentName, byte[]);
    method public boolean installExistingPackage(android.content.ComponentName, java.lang.String);
    method public boolean installKeyPair(android.content.ComponentName, java.security.PrivateKey, java.security.cert.Certificate, java.lang.String);
    method public boolean installKeyPair(android.content.ComponentName, java.security.PrivateKey, java.security.cert.Certificate[], java.lang.String, boolean);
    method public boolean installKeyPair(android.content.ComponentName, java.security.PrivateKey, java.security.cert.Certificate[], java.lang.String, int);
    method public boolean isActivePasswordSufficient();
    method public boolean isAdminActive(android.content.ComponentName);
    method public boolean isAffiliatedUser();
    method public boolean isApplicationHidden(android.content.ComponentName, java.lang.String);
    method public boolean isBackupServiceEnabled(android.content.ComponentName);
    method public deprecated boolean isCallerApplicationRestrictionsManagingPackage();
    method public boolean isDeviceIdAttestationSupported();
    method public boolean isDeviceOwnerApp(java.lang.String);
    method public boolean isEphemeralUser(android.content.ComponentName);
    method public boolean isLockTaskPermitted(java.lang.String);
    method public boolean isLogoutEnabled();
    method public boolean isManagedProfile(android.content.ComponentName);
    method public boolean isMasterVolumeMuted(android.content.ComponentName);
    method public boolean isNetworkLoggingEnabled(android.content.ComponentName);
    method public boolean isOverrideApnEnabled(android.content.ComponentName);
    method public boolean isPackageSuspended(android.content.ComponentName, java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public boolean isProfileOwnerApp(java.lang.String);
    method public boolean isProvisioningAllowed(java.lang.String);
    method public boolean isResetPasswordTokenActive(android.content.ComponentName);
    method public boolean isSecurityLoggingEnabled(android.content.ComponentName);
    method public boolean isUninstallBlocked(android.content.ComponentName, java.lang.String);
    method public boolean isUsingUnifiedPassword(android.content.ComponentName);
    method public void lockNow();
    method public void lockNow(int);
    method public int logoutUser(android.content.ComponentName);
    method public void reboot(android.content.ComponentName);
    method public void removeActiveAdmin(android.content.ComponentName);
    method public boolean removeCrossProfileWidgetProvider(android.content.ComponentName, java.lang.String);
    method public boolean removeKeyPair(android.content.ComponentName, java.lang.String);
    method public boolean removeOverrideApn(android.content.ComponentName, int);
    method public boolean removeUser(android.content.ComponentName, android.os.UserHandle);
    method public boolean requestBugreport(android.content.ComponentName);
    method public boolean resetPassword(java.lang.String, int);
    method public boolean resetPasswordWithToken(android.content.ComponentName, java.lang.String, byte[], int);
    method public java.util.List<android.app.admin.NetworkEvent> retrieveNetworkLogs(android.content.ComponentName, long);
    method public java.util.List<android.app.admin.SecurityLog.SecurityEvent> retrievePreRebootSecurityLogs(android.content.ComponentName);
    method public java.util.List<android.app.admin.SecurityLog.SecurityEvent> retrieveSecurityLogs(android.content.ComponentName);
    method public void setAccountManagementDisabled(android.content.ComponentName, java.lang.String, boolean);
    method public void setAffiliationIds(android.content.ComponentName, java.util.Set<java.lang.String>);
    method public void setAlwaysOnVpnPackage(android.content.ComponentName, java.lang.String, boolean) throws android.content.pm.PackageManager.NameNotFoundException, java.lang.UnsupportedOperationException;
    method public boolean setApplicationHidden(android.content.ComponentName, java.lang.String, boolean);
    method public void setApplicationRestrictions(android.content.ComponentName, java.lang.String, android.os.Bundle);
    method public deprecated void setApplicationRestrictionsManagingPackage(android.content.ComponentName, java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public void setAutoTimeRequired(android.content.ComponentName, boolean);
    method public void setBackupServiceEnabled(android.content.ComponentName, boolean);
    method public void setBluetoothContactSharingDisabled(android.content.ComponentName, boolean);
    method public void setCameraDisabled(android.content.ComponentName, boolean);
    method public deprecated void setCertInstallerPackage(android.content.ComponentName, java.lang.String) throws java.lang.SecurityException;
    method public void setCrossProfileCallerIdDisabled(android.content.ComponentName, boolean);
    method public void setCrossProfileContactsSearchDisabled(android.content.ComponentName, boolean);
    method public void setDelegatedScopes(android.content.ComponentName, java.lang.String, java.util.List<java.lang.String>);
    method public void setDeviceOwnerLockScreenInfo(android.content.ComponentName, java.lang.CharSequence);
    method public void setEndUserSessionMessage(android.content.ComponentName, java.lang.CharSequence);
    method public void setGlobalSetting(android.content.ComponentName, java.lang.String, java.lang.String);
    method public void setKeepUninstalledPackages(android.content.ComponentName, java.util.List<java.lang.String>);
    method public boolean setKeyPairCertificate(android.content.ComponentName, java.lang.String, java.util.List<java.security.cert.Certificate>, boolean);
    method public boolean setKeyguardDisabled(android.content.ComponentName, boolean);
    method public void setKeyguardDisabledFeatures(android.content.ComponentName, int);
    method public void setLockTaskFeatures(android.content.ComponentName, int);
    method public void setLockTaskPackages(android.content.ComponentName, java.lang.String[]) throws java.lang.SecurityException;
    method public void setLogoutEnabled(android.content.ComponentName, boolean);
    method public void setLongSupportMessage(android.content.ComponentName, java.lang.CharSequence);
    method public void setMasterVolumeMuted(android.content.ComponentName, boolean);
    method public void setMaximumFailedPasswordsForWipe(android.content.ComponentName, int);
    method public void setMaximumTimeToLock(android.content.ComponentName, long);
    method public java.util.List<java.lang.String> setMeteredDataDisabledPackages(android.content.ComponentName, java.util.List<java.lang.String>);
    method public void setNetworkLoggingEnabled(android.content.ComponentName, boolean);
    method public void setOrganizationColor(android.content.ComponentName, int);
    method public void setOrganizationName(android.content.ComponentName, java.lang.CharSequence);
    method public void setOverrideApnsEnabled(android.content.ComponentName, boolean);
    method public java.lang.String[] setPackagesSuspended(android.content.ComponentName, java.lang.String[], boolean);
    method public void setPasswordExpirationTimeout(android.content.ComponentName, long);
    method public void setPasswordHistoryLength(android.content.ComponentName, int);
    method public void setPasswordMinimumLength(android.content.ComponentName, int);
    method public void setPasswordMinimumLetters(android.content.ComponentName, int);
    method public void setPasswordMinimumLowerCase(android.content.ComponentName, int);
    method public void setPasswordMinimumNonLetter(android.content.ComponentName, int);
    method public void setPasswordMinimumNumeric(android.content.ComponentName, int);
    method public void setPasswordMinimumSymbols(android.content.ComponentName, int);
    method public void setPasswordMinimumUpperCase(android.content.ComponentName, int);
    method public void setPasswordQuality(android.content.ComponentName, int);
    method public boolean setPermissionGrantState(android.content.ComponentName, java.lang.String, java.lang.String, int);
    method public void setPermissionPolicy(android.content.ComponentName, int);
    method public boolean setPermittedAccessibilityServices(android.content.ComponentName, java.util.List<java.lang.String>);
    method public boolean setPermittedCrossProfileNotificationListeners(android.content.ComponentName, java.util.List<java.lang.String>);
    method public boolean setPermittedInputMethods(android.content.ComponentName, java.util.List<java.lang.String>);
    method public void setProfileEnabled(android.content.ComponentName);
    method public void setProfileName(android.content.ComponentName, java.lang.String);
    method public void setRecommendedGlobalProxy(android.content.ComponentName, android.net.ProxyInfo);
    method public void setRequiredStrongAuthTimeout(android.content.ComponentName, long);
    method public boolean setResetPasswordToken(android.content.ComponentName, byte[]);
    method public void setRestrictionsProvider(android.content.ComponentName, android.content.ComponentName);
    method public void setScreenCaptureDisabled(android.content.ComponentName, boolean);
    method public void setSecureSetting(android.content.ComponentName, java.lang.String, java.lang.String);
    method public void setSecurityLoggingEnabled(android.content.ComponentName, boolean);
    method public void setShortSupportMessage(android.content.ComponentName, java.lang.CharSequence);
    method public void setStartUserSessionMessage(android.content.ComponentName, java.lang.CharSequence);
    method public boolean setStatusBarDisabled(android.content.ComponentName, boolean);
    method public int setStorageEncryption(android.content.ComponentName, boolean);
    method public void setSystemSetting(android.content.ComponentName, java.lang.String, java.lang.String);
    method public void setSystemUpdatePolicy(android.content.ComponentName, android.app.admin.SystemUpdatePolicy);
    method public boolean setTime(android.content.ComponentName, long);
    method public boolean setTimeZone(android.content.ComponentName, java.lang.String);
    method public void setTrustAgentConfiguration(android.content.ComponentName, android.content.ComponentName, android.os.PersistableBundle);
    method public void setUninstallBlocked(android.content.ComponentName, java.lang.String, boolean);
    method public void setUserIcon(android.content.ComponentName, android.graphics.Bitmap);
    method public int startUserInBackground(android.content.ComponentName, android.os.UserHandle);
    method public int stopUser(android.content.ComponentName, android.os.UserHandle);
    method public boolean switchUser(android.content.ComponentName, android.os.UserHandle);
    method public void transferOwnership(android.content.ComponentName, android.content.ComponentName, android.os.PersistableBundle);
    method public void uninstallAllUserCaCerts(android.content.ComponentName);
    method public void uninstallCaCert(android.content.ComponentName, byte[]);
    method public boolean updateOverrideApn(android.content.ComponentName, int, android.telephony.data.ApnSetting);
    method public void wipeData(int);
    method public void wipeData(int, java.lang.CharSequence);
    field public static final java.lang.String ACTION_ADD_DEVICE_ADMIN = "android.app.action.ADD_DEVICE_ADMIN";
    field public static final java.lang.String ACTION_APPLICATION_DELEGATION_SCOPES_CHANGED = "android.app.action.APPLICATION_DELEGATION_SCOPES_CHANGED";
    field public static final java.lang.String ACTION_DEVICE_ADMIN_SERVICE = "android.app.action.DEVICE_ADMIN_SERVICE";
    field public static final java.lang.String ACTION_DEVICE_OWNER_CHANGED = "android.app.action.DEVICE_OWNER_CHANGED";
    field public static final java.lang.String ACTION_MANAGED_PROFILE_PROVISIONED = "android.app.action.MANAGED_PROFILE_PROVISIONED";
    field public static final java.lang.String ACTION_PROFILE_OWNER_CHANGED = "android.app.action.PROFILE_OWNER_CHANGED";
    field public static final java.lang.String ACTION_PROVISIONING_SUCCESSFUL = "android.app.action.PROVISIONING_SUCCESSFUL";
    field public static final java.lang.String ACTION_PROVISION_MANAGED_DEVICE = "android.app.action.PROVISION_MANAGED_DEVICE";
    field public static final java.lang.String ACTION_PROVISION_MANAGED_PROFILE = "android.app.action.PROVISION_MANAGED_PROFILE";
    field public static final java.lang.String ACTION_SET_NEW_PARENT_PROFILE_PASSWORD = "android.app.action.SET_NEW_PARENT_PROFILE_PASSWORD";
    field public static final java.lang.String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD";
    field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION";
    field public static final java.lang.String ACTION_SYSTEM_UPDATE_POLICY_CHANGED = "android.app.action.SYSTEM_UPDATE_POLICY_CHANGED";
    field public static final java.lang.String DELEGATION_APP_RESTRICTIONS = "delegation-app-restrictions";
    field public static final java.lang.String DELEGATION_BLOCK_UNINSTALL = "delegation-block-uninstall";
    field public static final java.lang.String DELEGATION_CERT_INSTALL = "delegation-cert-install";
    field public static final java.lang.String DELEGATION_ENABLE_SYSTEM_APP = "delegation-enable-system-app";
    field public static final java.lang.String DELEGATION_INSTALL_EXISTING_PACKAGE = "delegation-install-existing-package";
    field public static final java.lang.String DELEGATION_KEEP_UNINSTALLED_PACKAGES = "delegation-keep-uninstalled-packages";
    field public static final java.lang.String DELEGATION_PACKAGE_ACCESS = "delegation-package-access";
    field public static final java.lang.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 java.lang.String EXTRA_ADD_EXPLANATION = "android.app.extra.ADD_EXPLANATION";
    field public static final java.lang.String EXTRA_DELEGATION_SCOPES = "android.app.extra.DELEGATION_SCOPES";
    field public static final java.lang.String EXTRA_DEVICE_ADMIN = "android.app.extra.DEVICE_ADMIN";
    field public static final java.lang.String EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE = "android.app.extra.PROVISIONING_ACCOUNT_TO_MIGRATE";
    field public static final java.lang.String EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE = "android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE";
    field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME = "android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME";
    field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_MINIMUM_VERSION_CODE = "android.app.extra.PROVISIONING_DEVICE_ADMIN_MINIMUM_VERSION_CODE";
    field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM";
    field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER";
    field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION";
    field public static final deprecated java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME";
    field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM = "android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM";
    field public static final java.lang.String EXTRA_PROVISIONING_DISCLAIMERS = "android.app.extra.PROVISIONING_DISCLAIMERS";
    field public static final java.lang.String EXTRA_PROVISIONING_DISCLAIMER_CONTENT = "android.app.extra.PROVISIONING_DISCLAIMER_CONTENT";
    field public static final java.lang.String EXTRA_PROVISIONING_DISCLAIMER_HEADER = "android.app.extra.PROVISIONING_DISCLAIMER_HEADER";
    field public static final deprecated java.lang.String EXTRA_PROVISIONING_EMAIL_ADDRESS = "android.app.extra.PROVISIONING_EMAIL_ADDRESS";
    field public static final java.lang.String EXTRA_PROVISIONING_KEEP_ACCOUNT_ON_MIGRATION = "android.app.extra.PROVISIONING_KEEP_ACCOUNT_ON_MIGRATION";
    field public static final java.lang.String EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED = "android.app.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED";
    field public static final java.lang.String EXTRA_PROVISIONING_LOCALE = "android.app.extra.PROVISIONING_LOCALE";
    field public static final java.lang.String EXTRA_PROVISIONING_LOCAL_TIME = "android.app.extra.PROVISIONING_LOCAL_TIME";
    field public static final java.lang.String EXTRA_PROVISIONING_LOGO_URI = "android.app.extra.PROVISIONING_LOGO_URI";
    field public static final java.lang.String EXTRA_PROVISIONING_MAIN_COLOR = "android.app.extra.PROVISIONING_MAIN_COLOR";
    field public static final java.lang.String EXTRA_PROVISIONING_SKIP_ENCRYPTION = "android.app.extra.PROVISIONING_SKIP_ENCRYPTION";
    field public static final java.lang.String EXTRA_PROVISIONING_SKIP_USER_CONSENT = "android.app.extra.PROVISIONING_SKIP_USER_CONSENT";
    field public static final java.lang.String EXTRA_PROVISIONING_TIME_ZONE = "android.app.extra.PROVISIONING_TIME_ZONE";
    field public static final java.lang.String EXTRA_PROVISIONING_WIFI_HIDDEN = "android.app.extra.PROVISIONING_WIFI_HIDDEN";
    field public static final java.lang.String EXTRA_PROVISIONING_WIFI_PAC_URL = "android.app.extra.PROVISIONING_WIFI_PAC_URL";
    field public static final java.lang.String EXTRA_PROVISIONING_WIFI_PASSWORD = "android.app.extra.PROVISIONING_WIFI_PASSWORD";
    field public static final java.lang.String EXTRA_PROVISIONING_WIFI_PROXY_BYPASS = "android.app.extra.PROVISIONING_WIFI_PROXY_BYPASS";
    field public static final java.lang.String EXTRA_PROVISIONING_WIFI_PROXY_HOST = "android.app.extra.PROVISIONING_WIFI_PROXY_HOST";
    field public static final java.lang.String EXTRA_PROVISIONING_WIFI_PROXY_PORT = "android.app.extra.PROVISIONING_WIFI_PROXY_PORT";
    field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE";
    field public static final java.lang.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 java.lang.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 java.lang.String POLICY_DISABLE_CAMERA = "policy_disable_camera";
    field public static final java.lang.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 abstract interface DevicePolicyManager.OnClearApplicationUserDataListener {
    method public abstract void onApplicationUserDataCleared(java.lang.String, boolean);
  }

  public final class DnsEvent extends android.app.admin.NetworkEvent implements android.os.Parcelable {
    method public java.lang.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 java.lang.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 java.lang.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 java.lang.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(java.lang.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 public java.lang.String[] getAutofillHints();
    method public android.view.autofill.AutofillId getAutofillId();
    method public java.lang.CharSequence[] getAutofillOptions();
    method public int getAutofillType();
    method public android.view.autofill.AutofillValue getAutofillValue();
    method public android.app.assist.AssistStructure.ViewNode getChildAt(int);
    method public int getChildCount();
    method public java.lang.String getClassName();
    method public java.lang.CharSequence getContentDescription();
    method public float getElevation();
    method public android.os.Bundle getExtras();
    method public int getHeight();
    method public java.lang.String getHint();
    method public android.view.ViewStructure.HtmlInfo getHtmlInfo();
    method public int getId();
    method public java.lang.String getIdEntry();
    method public java.lang.String getIdPackage();
    method public java.lang.String getIdType();
    method public int getImportantForAutofill();
    method public int getInputType();
    method public int getLeft();
    method 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 java.lang.CharSequence getText();
    method public int getTextBackgroundColor();
    method public int getTextColor();
    method public java.lang.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 public java.lang.String getWebDomain();
    method public java.lang.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 java.lang.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(java.lang.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 java.lang.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 java.lang.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(java.lang.String, int) throws java.io.IOException;
  }

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

  public class BackupManager {
    ctor public BackupManager(android.content.Context);
    method public void dataChanged();
    method public static void dataChanged(java.lang.String);
    method public deprecated 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);
  }

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

  public abstract class RestoreObserver {
    ctor public RestoreObserver();
    method public void onUpdate(int, java.lang.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);
  }

}

package android.app.job {

  public class JobInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getBackoffPolicy();
    method public android.content.ClipData getClipData();
    method public int getClipGrantFlags();
    method public long getEstimatedNetworkDownloadBytes();
    method public long getEstimatedNetworkUploadBytes();
    method 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 public deprecated int getNetworkType();
    method public android.net.NetworkRequest getRequiredNetwork();
    method public android.content.ComponentName getService();
    method public android.os.Bundle getTransientExtras();
    method public long getTriggerContentMaxDelay();
    method public long getTriggerContentUpdateDelay();
    method 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 public static final deprecated 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, android.content.ComponentName);
    method public android.app.job.JobInfo.Builder addTriggerContentUri(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(android.content.ClipData, int);
    method public android.app.job.JobInfo.Builder setEstimatedNetworkBytes(long, long);
    method public android.app.job.JobInfo.Builder setExtras(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 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(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(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(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(android.app.job.JobWorkItem);
    method public android.app.job.JobWorkItem dequeueWork();
    method public int describeContents();
    method public android.content.ClipData getClipData();
    method public int getClipGrantFlags();
    method public android.os.PersistableBundle getExtras();
    method public int getJobId();
    method public android.net.Network getNetwork();
    method public android.os.Bundle getTransientExtras();
    method public java.lang.String[] getTriggeredContentAuthorities();
    method 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(android.app.job.JobInfo, android.app.job.JobWorkItem);
    method public abstract java.util.List<android.app.job.JobInfo> getAllPendingJobs();
    method public abstract android.app.job.JobInfo getPendingJob(int);
    method public abstract int schedule(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 java.lang.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 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 java.lang.String EXTRA_RANGE_VALUE = "android.app.slice.extra.RANGE_VALUE";
    field public static final java.lang.String EXTRA_TOGGLE_STATE = "android.app.slice.extra.TOGGLE_STATE";
    field public static final java.lang.String HINT_ACTIONS = "actions";
    field public static final java.lang.String HINT_ERROR = "error";
    field public static final java.lang.String HINT_HORIZONTAL = "horizontal";
    field public static final java.lang.String HINT_KEYWORDS = "keywords";
    field public static final java.lang.String HINT_LARGE = "large";
    field public static final java.lang.String HINT_LAST_UPDATED = "last_updated";
    field public static final java.lang.String HINT_LIST = "list";
    field public static final java.lang.String HINT_LIST_ITEM = "list_item";
    field public static final java.lang.String HINT_NO_TINT = "no_tint";
    field public static final java.lang.String HINT_PARTIAL = "partial";
    field public static final java.lang.String HINT_PERMISSION_REQUEST = "permission_request";
    field public static final java.lang.String HINT_SEE_MORE = "see_more";
    field public static final java.lang.String HINT_SELECTED = "selected";
    field public static final java.lang.String HINT_SHORTCUT = "shortcut";
    field public static final java.lang.String HINT_SUMMARY = "summary";
    field public static final java.lang.String HINT_TITLE = "title";
    field public static final java.lang.String HINT_TTL = "ttl";
    field public static final java.lang.String SUBTYPE_COLOR = "color";
    field public static final java.lang.String SUBTYPE_CONTENT_DESCRIPTION = "content_description";
    field public static final java.lang.String SUBTYPE_LAYOUT_DIRECTION = "layout_direction";
    field public static final java.lang.String SUBTYPE_MAX = "max";
    field public static final java.lang.String SUBTYPE_MESSAGE = "message";
    field public static final java.lang.String SUBTYPE_MILLIS = "millis";
    field public static final java.lang.String SUBTYPE_PRIORITY = "priority";
    field public static final java.lang.String SUBTYPE_RANGE = "range";
    field public static final java.lang.String SUBTYPE_SOURCE = "source";
    field public static final java.lang.String SUBTYPE_TOGGLE = "toggle";
    field public static final java.lang.String SUBTYPE_VALUE = "value";
  }

  public static class Slice.Builder {
    ctor public Slice.Builder(android.net.Uri, android.app.slice.SliceSpec);
    ctor public Slice.Builder(android.app.slice.Slice.Builder);
    method public android.app.slice.Slice.Builder addAction(android.app.PendingIntent, android.app.slice.Slice, java.lang.String);
    method public android.app.slice.Slice.Builder addBundle(android.os.Bundle, java.lang.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, java.lang.String, java.util.List<java.lang.String>);
    method public android.app.slice.Slice.Builder addInt(int, java.lang.String, java.util.List<java.lang.String>);
    method public android.app.slice.Slice.Builder addLong(long, java.lang.String, java.util.List<java.lang.String>);
    method public android.app.slice.Slice.Builder addRemoteInput(android.app.RemoteInput, java.lang.String, java.util.List<java.lang.String>);
    method public android.app.slice.Slice.Builder addSubSlice(android.app.slice.Slice, java.lang.String);
    method public android.app.slice.Slice.Builder addText(java.lang.CharSequence, java.lang.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 java.lang.String getFormat();
    method 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 java.lang.String getSubType();
    method public java.lang.CharSequence getText();
    method public boolean hasHint(java.lang.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 java.lang.String FORMAT_ACTION = "action";
    field public static final java.lang.String FORMAT_BUNDLE = "bundle";
    field public static final java.lang.String FORMAT_IMAGE = "image";
    field public static final java.lang.String FORMAT_INT = "int";
    field public static final java.lang.String FORMAT_LONG = "long";
    field public static final java.lang.String FORMAT_REMOTE_INPUT = "input";
    field public static final java.lang.String FORMAT_SLICE = "slice";
    field public static final java.lang.String FORMAT_TEXT = "text";
  }

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

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

  public abstract class SliceProvider extends android.content.ContentProvider {
    ctor public SliceProvider(java.lang.String...);
    ctor public SliceProvider();
    method public final int delete(android.net.Uri, java.lang.String, java.lang.String[]);
    method public final java.lang.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 public android.app.PendingIntent onCreatePermissionRequest(android.net.Uri);
    method public java.util.Collection<android.net.Uri> onGetSliceDescendants(android.net.Uri);
    method 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, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
    method public final android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, android.os.CancellationSignal);
    method public final android.database.Cursor query(android.net.Uri, java.lang.String[], android.os.Bundle, android.os.CancellationSignal);
    method public final int update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]);
    field public static final java.lang.String SLICE_TYPE = "vnd.android.slice";
  }

  public final class SliceSpec implements android.os.Parcelable {
    ctor public SliceSpec(java.lang.String, int);
    method public boolean canRender(android.app.slice.SliceSpec);
    method public int describeContents();
    method public int getRevision();
    method public java.lang.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, java.lang.String, long, long) throws android.os.RemoteException, java.lang.SecurityException;
    method public android.app.usage.NetworkStats queryDetailsForUid(int, java.lang.String, long, long, int) throws java.lang.SecurityException;
    method public android.app.usage.NetworkStats queryDetailsForUidTag(int, java.lang.String, long, long, int, int) throws java.lang.SecurityException;
    method public android.app.usage.NetworkStats queryDetailsForUidTagState(int, java.lang.String, long, long, int, int, int) throws java.lang.SecurityException;
    method public android.app.usage.NetworkStats querySummary(int, java.lang.String, long, long) throws android.os.RemoteException, java.lang.SecurityException;
    method public android.app.usage.NetworkStats.Bucket querySummaryForDevice(int, java.lang.String, long, long) throws android.os.RemoteException, java.lang.SecurityException;
    method public android.app.usage.NetworkStats.Bucket querySummaryForUser(int, java.lang.String, long, long) throws android.os.RemoteException, java.lang.SecurityException;
    method public void registerUsageCallback(int, java.lang.String, long, android.app.usage.NetworkStatsManager.UsageCallback);
    method public void registerUsageCallback(int, java.lang.String, long, android.app.usage.NetworkStatsManager.UsageCallback, android.os.Handler);
    method public void unregisterUsageCallback(android.app.usage.NetworkStatsManager.UsageCallback);
  }

  public static abstract class NetworkStatsManager.UsageCallback {
    ctor public NetworkStatsManager.UsageCallback();
    method public abstract void onThresholdReached(int, java.lang.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 public long getFreeBytes(java.util.UUID) throws java.io.IOException;
    method public long getTotalBytes(java.util.UUID) throws java.io.IOException;
    method public android.app.usage.ExternalStorageStats queryExternalStatsForUser(java.util.UUID, android.os.UserHandle) throws java.io.IOException;
    method public android.app.usage.StorageStats queryStatsForPackage(java.util.UUID, java.lang.String, android.os.UserHandle) throws java.io.IOException, android.content.pm.PackageManager.NameNotFoundException;
    method public android.app.usage.StorageStats queryStatsForUid(java.util.UUID, int) throws java.io.IOException;
    method public android.app.usage.StorageStats queryStatsForUser(java.util.UUID, 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 java.lang.String getClassName();
    method public android.content.res.Configuration getConfiguration();
    method public int getEventType();
    method public java.lang.String getPackageName();
    method public java.lang.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 java.lang.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(java.lang.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(android.app.Activity, int, int, int, 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 public java.util.List<android.appwidget.AppWidgetProviderInfo> getInstalledProvidersForPackage(java.lang.String, android.os.UserHandle);
    method public java.util.List<android.appwidget.AppWidgetProviderInfo> getInstalledProvidersForProfile(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(android.content.ComponentName, android.os.Bundle, 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, java.lang.String);
    field public static final java.lang.String ACTION_APPWIDGET_BIND = "android.appwidget.action.APPWIDGET_BIND";
    field public static final java.lang.String ACTION_APPWIDGET_CONFIGURE = "android.appwidget.action.APPWIDGET_CONFIGURE";
    field public static final java.lang.String ACTION_APPWIDGET_DELETED = "android.appwidget.action.APPWIDGET_DELETED";
    field public static final java.lang.String ACTION_APPWIDGET_DISABLED = "android.appwidget.action.APPWIDGET_DISABLED";
    field public static final java.lang.String ACTION_APPWIDGET_ENABLED = "android.appwidget.action.APPWIDGET_ENABLED";
    field public static final java.lang.String ACTION_APPWIDGET_HOST_RESTORED = "android.appwidget.action.APPWIDGET_HOST_RESTORED";
    field public static final java.lang.String ACTION_APPWIDGET_OPTIONS_CHANGED = "android.appwidget.action.APPWIDGET_UPDATE_OPTIONS";
    field public static final java.lang.String ACTION_APPWIDGET_PICK = "android.appwidget.action.APPWIDGET_PICK";
    field public static final java.lang.String ACTION_APPWIDGET_RESTORED = "android.appwidget.action.APPWIDGET_RESTORED";
    field public static final java.lang.String ACTION_APPWIDGET_UPDATE = "android.appwidget.action.APPWIDGET_UPDATE";
    field public static final java.lang.String EXTRA_APPWIDGET_ID = "appWidgetId";
    field public static final java.lang.String EXTRA_APPWIDGET_IDS = "appWidgetIds";
    field public static final java.lang.String EXTRA_APPWIDGET_OLD_IDS = "appWidgetOldIds";
    field public static final java.lang.String EXTRA_APPWIDGET_OPTIONS = "appWidgetOptions";
    field public static final java.lang.String EXTRA_APPWIDGET_PREVIEW = "appWidgetPreview";
    field public static final java.lang.String EXTRA_APPWIDGET_PROVIDER = "appWidgetProvider";
    field public static final java.lang.String EXTRA_APPWIDGET_PROVIDER_PROFILE = "appWidgetProviderProfile";
    field public static final java.lang.String EXTRA_CUSTOM_EXTRAS = "customExtras";
    field public static final java.lang.String EXTRA_CUSTOM_INFO = "customInfo";
    field public static final java.lang.String EXTRA_HOST_ID = "hostId";
    field public static final int INVALID_APPWIDGET_ID = 0; // 0x0
    field public static final java.lang.String META_DATA_APPWIDGET_PROVIDER = "android.appwidget.provider";
    field public static final java.lang.String OPTION_APPWIDGET_HOST_CATEGORY = "appWidgetCategory";
    field public static final java.lang.String OPTION_APPWIDGET_MAX_HEIGHT = "appWidgetMaxHeight";
    field public static final java.lang.String OPTION_APPWIDGET_MAX_WIDTH = "appWidgetMaxWidth";
    field public static final java.lang.String OPTION_APPWIDGET_MIN_HEIGHT = "appWidgetMinHeight";
    field public static final java.lang.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(android.content.Context, int);
    method public final java.lang.String loadLabel(android.content.pm.PackageManager);
    method public final android.graphics.drawable.Drawable loadPreviewImage(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 public deprecated java.lang.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 java.lang.String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.a2dp.profile.action.CONNECTION_STATE_CHANGED";
    field public static final java.lang.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 public boolean cancelDiscovery();
    method public static boolean checkBluetoothAddress(java.lang.String);
    method public void closeProfileProxy(int, android.bluetooth.BluetoothProfile);
    method public boolean disable();
    method public boolean enable();
    method public java.lang.String getAddress();
    method public android.bluetooth.le.BluetoothLeAdvertiser getBluetoothLeAdvertiser();
    method public android.bluetooth.le.BluetoothLeScanner getBluetoothLeScanner();
    method public java.util.Set<android.bluetooth.BluetoothDevice> getBondedDevices();
    method public static synchronized android.bluetooth.BluetoothAdapter getDefaultAdapter();
    method public int getLeMaximumAdvertisingDataLength();
    method public java.lang.String getName();
    method public int getProfileConnectionState(int);
    method public boolean getProfileProxy(android.content.Context, android.bluetooth.BluetoothProfile.ServiceListener, int);
    method public android.bluetooth.BluetoothDevice getRemoteDevice(java.lang.String);
    method public android.bluetooth.BluetoothDevice getRemoteDevice(byte[]);
    method public int getScanMode();
    method public int getState();
    method public boolean isDiscovering();
    method 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 public android.bluetooth.BluetoothServerSocket listenUsingInsecureRfcommWithServiceRecord(java.lang.String, java.util.UUID) throws java.io.IOException;
    method public android.bluetooth.BluetoothServerSocket listenUsingRfcommWithServiceRecord(java.lang.String, java.util.UUID) throws java.io.IOException;
    method public boolean setName(java.lang.String);
    method public boolean startDiscovery();
    method public deprecated boolean startLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback);
    method public deprecated boolean startLeScan(java.util.UUID[], android.bluetooth.BluetoothAdapter.LeScanCallback);
    method public deprecated void stopLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback);
    field public static final java.lang.String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.adapter.action.CONNECTION_STATE_CHANGED";
    field public static final java.lang.String ACTION_DISCOVERY_FINISHED = "android.bluetooth.adapter.action.DISCOVERY_FINISHED";
    field public static final java.lang.String ACTION_DISCOVERY_STARTED = "android.bluetooth.adapter.action.DISCOVERY_STARTED";
    field public static final java.lang.String ACTION_LOCAL_NAME_CHANGED = "android.bluetooth.adapter.action.LOCAL_NAME_CHANGED";
    field public static final java.lang.String ACTION_REQUEST_DISCOVERABLE = "android.bluetooth.adapter.action.REQUEST_DISCOVERABLE";
    field public static final java.lang.String ACTION_REQUEST_ENABLE = "android.bluetooth.adapter.action.REQUEST_ENABLE";
    field public static final java.lang.String ACTION_SCAN_MODE_CHANGED = "android.bluetooth.adapter.action.SCAN_MODE_CHANGED";
    field public static final java.lang.String ACTION_STATE_CHANGED = "android.bluetooth.adapter.action.STATE_CHANGED";
    field public static final int ERROR = -2147483648; // 0x80000000
    field public static final java.lang.String EXTRA_CONNECTION_STATE = "android.bluetooth.adapter.extra.CONNECTION_STATE";
    field public static final java.lang.String EXTRA_DISCOVERABLE_DURATION = "android.bluetooth.adapter.extra.DISCOVERABLE_DURATION";
    field public static final java.lang.String EXTRA_LOCAL_NAME = "android.bluetooth.adapter.extra.LOCAL_NAME";
    field public static final java.lang.String EXTRA_PREVIOUS_CONNECTION_STATE = "android.bluetooth.adapter.extra.PREVIOUS_CONNECTION_STATE";
    field public static final java.lang.String EXTRA_PREVIOUS_SCAN_MODE = "android.bluetooth.adapter.extra.PREVIOUS_SCAN_MODE";
    field public static final java.lang.String EXTRA_PREVIOUS_STATE = "android.bluetooth.adapter.extra.PREVIOUS_STATE";
    field public static final java.lang.String EXTRA_SCAN_MODE = "android.bluetooth.adapter.extra.SCAN_MODE";
    field public static final java.lang.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 abstract interface BluetoothAdapter.LeScanCallback {
    method public abstract 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 public boolean createBond();
    method public android.bluetooth.BluetoothSocket createInsecureRfcommSocketToServiceRecord(java.util.UUID) throws java.io.IOException;
    method public android.bluetooth.BluetoothSocket createRfcommSocketToServiceRecord(java.util.UUID) throws java.io.IOException;
    method public int describeContents();
    method public boolean fetchUuidsWithSdp();
    method public java.lang.String getAddress();
    method public android.bluetooth.BluetoothClass getBluetoothClass();
    method public int getBondState();
    method public java.lang.String getName();
    method public int getType();
    method public android.os.ParcelUuid[] getUuids();
    method public boolean setPairingConfirmation(boolean);
    method public boolean setPin(byte[]);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final java.lang.String ACTION_ACL_CONNECTED = "android.bluetooth.device.action.ACL_CONNECTED";
    field public static final java.lang.String ACTION_ACL_DISCONNECTED = "android.bluetooth.device.action.ACL_DISCONNECTED";
    field public static final java.lang.String ACTION_ACL_DISCONNECT_REQUESTED = "android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED";
    field public static final java.lang.String ACTION_BOND_STATE_CHANGED = "android.bluetooth.device.action.BOND_STATE_CHANGED";
    field public static final java.lang.String ACTION_CLASS_CHANGED = "android.bluetooth.device.action.CLASS_CHANGED";
    field public static final java.lang.String ACTION_FOUND = "android.bluetooth.device.action.FOUND";
    field public static final java.lang.String ACTION_NAME_CHANGED = "android.bluetooth.device.action.NAME_CHANGED";
    field public static final java.lang.String ACTION_PAIRING_REQUEST = "android.bluetooth.device.action.PAIRING_REQUEST";
    field public static final java.lang.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 java.lang.String EXTRA_BOND_STATE = "android.bluetooth.device.extra.BOND_STATE";
    field public static final java.lang.String EXTRA_CLASS = "android.bluetooth.device.extra.CLASS";
    field public static final java.lang.String EXTRA_DEVICE = "android.bluetooth.device.extra.DEVICE";
    field public static final java.lang.String EXTRA_NAME = "android.bluetooth.device.extra.NAME";
    field public static final java.lang.String EXTRA_PAIRING_KEY = "android.bluetooth.device.extra.PAIRING_KEY";
    field public static final java.lang.String EXTRA_PAIRING_VARIANT = "android.bluetooth.device.extra.PAIRING_VARIANT";
    field public static final java.lang.String EXTRA_PREVIOUS_BOND_STATE = "android.bluetooth.device.extra.PREVIOUS_BOND_STATE";
    field public static final java.lang.String EXTRA_RSSI = "android.bluetooth.device.extra.RSSI";
    field public static final java.lang.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 public deprecated 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 java.lang.Float getFloatValue(int, int);
    method public int getInstanceId();
    method public java.lang.Integer getIntValue(int, int);
    method public int getPermissions();
    method public int getProperties();
    method public android.bluetooth.BluetoothGattService getService();
    method public java.lang.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(java.lang.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, java.lang.String, java.lang.String);
    method public boolean startVoiceRecognition(android.bluetooth.BluetoothDevice);
    method public boolean stopVoiceRecognition(android.bluetooth.BluetoothDevice);
    field public static final java.lang.String ACTION_AUDIO_STATE_CHANGED = "android.bluetooth.headset.profile.action.AUDIO_STATE_CHANGED";
    field public static final java.lang.String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED";
    field public static final java.lang.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 java.lang.String EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_ARGS = "android.bluetooth.headset.extra.VENDOR_SPECIFIC_HEADSET_EVENT_ARGS";
    field public static final java.lang.String EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD = "android.bluetooth.headset.extra.VENDOR_SPECIFIC_HEADSET_EVENT_CMD";
    field public static final java.lang.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 java.lang.String VENDOR_RESULT_CODE_COMMAND_ANDROID = "+ANDROID";
    field public static final java.lang.String VENDOR_SPECIFIC_HEADSET_EVENT_COMPANY_ID_CATEGORY = "android.bluetooth.headset.intent.category.companyid";
  }

  public final class BluetoothHealth implements android.bluetooth.BluetoothProfile {
    method public boolean connectChannelToSource(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothHealthAppConfiguration);
    method public boolean disconnectChannel(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothHealthAppConfiguration, int);
    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.os.ParcelFileDescriptor getMainChannelFd(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothHealthAppConfiguration);
    method public boolean registerSinkAppConfiguration(java.lang.String, int, android.bluetooth.BluetoothHealthCallback);
    method public boolean unregisterAppConfiguration(android.bluetooth.BluetoothHealthAppConfiguration);
    field public static final int APP_CONFIG_REGISTRATION_FAILURE = 1; // 0x1
    field public static final int APP_CONFIG_REGISTRATION_SUCCESS = 0; // 0x0
    field public static final int APP_CONFIG_UNREGISTRATION_FAILURE = 3; // 0x3
    field public static final int APP_CONFIG_UNREGISTRATION_SUCCESS = 2; // 0x2
    field public static final int CHANNEL_TYPE_RELIABLE = 10; // 0xa
    field public static final int CHANNEL_TYPE_STREAMING = 11; // 0xb
    field public static final int SINK_ROLE = 2; // 0x2
    field public static final int SOURCE_ROLE = 1; // 0x1
    field public static final int STATE_CHANNEL_CONNECTED = 2; // 0x2
    field public static final int STATE_CHANNEL_CONNECTING = 1; // 0x1
    field public static final int STATE_CHANNEL_DISCONNECTED = 0; // 0x0
    field public static final int STATE_CHANNEL_DISCONNECTING = 3; // 0x3
  }

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

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

  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 java.lang.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 static abstract 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(java.lang.String, java.lang.String, java.lang.String, byte, byte[]);
    method public int describeContents();
    method public java.lang.String getDescription();
    method public byte[] getDescriptors();
    method public java.lang.String getName();
    method public java.lang.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 public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices(int);
    method public int getConnectionState(android.bluetooth.BluetoothDevice, int);
    method public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int, int[]);
    method public android.bluetooth.BluetoothGattServer openGattServer(android.content.Context, android.bluetooth.BluetoothGattServerCallback);
  }

  public abstract interface BluetoothProfile {
    method public abstract java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method public abstract int getConnectionState(android.bluetooth.BluetoothDevice);
    method public abstract java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    field public static final int A2DP = 2; // 0x2
    field public static final java.lang.String EXTRA_PREVIOUS_STATE = "android.bluetooth.profile.extra.PREVIOUS_STATE";
    field public static final java.lang.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 public static final int HEALTH = 3; // 0x3
    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 abstract interface BluetoothProfile.ServiceListener {
    method public abstract void onServiceConnected(int, android.bluetooth.BluetoothProfile);
    method public abstract 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;
  }

  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 public void startScan(android.bluetooth.le.ScanCallback);
    method public void startScan(java.util.List<android.bluetooth.le.ScanFilter>, android.bluetooth.le.ScanSettings, android.bluetooth.le.ScanCallback);
    method public int startScan(java.util.List<android.bluetooth.le.ScanFilter>, android.bluetooth.le.ScanSettings, android.app.PendingIntent);
    method public void stopScan(android.bluetooth.le.ScanCallback);
    method public void stopScan(android.app.PendingIntent);
    field public static final java.lang.String EXTRA_CALLBACK_TYPE = "android.bluetooth.le.extra.CALLBACK_TYPE";
    field public static final java.lang.String EXTRA_ERROR_CODE = "android.bluetooth.le.extra.ERROR_CODE";
    field public static final java.lang.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 public java.lang.String getDeviceAddress();
    method public java.lang.String getDeviceName();
    method public byte[] getManufacturerData();
    method public byte[] getManufacturerDataMask();
    method public int getManufacturerId();
    method public byte[] getServiceData();
    method public byte[] getServiceDataMask();
    method public android.os.ParcelUuid getServiceDataUuid();
    method public android.os.ParcelUuid getServiceSolicitationUuid();
    method public android.os.ParcelUuid getServiceSolicitationUuidMask();
    method public android.os.ParcelUuid getServiceUuid();
    method 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(java.lang.String);
    method public android.bluetooth.le.ScanFilter.Builder setDeviceName(java.lang.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 public java.lang.String getDeviceName();
    method public android.util.SparseArray<byte[]> getManufacturerSpecificData();
    method public byte[] getManufacturerSpecificData(int);
    method public java.util.Map<android.os.ParcelUuid, byte[]> getServiceData();
    method public byte[] getServiceData(android.os.ParcelUuid);
    method 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 public deprecated 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 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 public android.companion.AssociationRequest.Builder addDeviceFilter(android.companion.DeviceFilter<?>);
    method public android.companion.AssociationRequest build();
    method public android.companion.AssociationRequest.Builder setSingleDevice(boolean);
  }

  public final class BluetoothDeviceFilter implements android.companion.DeviceFilter {
    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 public android.companion.BluetoothDeviceFilter.Builder addServiceUuid(android.os.ParcelUuid, android.os.ParcelUuid);
    method public android.companion.BluetoothDeviceFilter build();
    method public android.companion.BluetoothDeviceFilter.Builder setAddress(java.lang.String);
    method public android.companion.BluetoothDeviceFilter.Builder setNamePattern(java.util.regex.Pattern);
  }

  public final class BluetoothLeDeviceFilter implements android.companion.DeviceFilter {
    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 public android.companion.BluetoothLeDeviceFilter build();
    method public android.companion.BluetoothLeDeviceFilter.Builder setNamePattern(java.util.regex.Pattern);
    method public android.companion.BluetoothLeDeviceFilter.Builder setRawDataFilter(byte[], byte[]);
    method public android.companion.BluetoothLeDeviceFilter.Builder setRenameFromBytes(java.lang.String, java.lang.String, int, int, java.nio.ByteOrder);
    method public android.companion.BluetoothLeDeviceFilter.Builder setRenameFromName(java.lang.String, java.lang.String, int, int);
    method public android.companion.BluetoothLeDeviceFilter.Builder setScanFilter(android.bluetooth.le.ScanFilter);
  }

  public final class CompanionDeviceManager {
    method public void associate(android.companion.AssociationRequest, android.companion.CompanionDeviceManager.Callback, android.os.Handler);
    method public void disassociate(java.lang.String);
    method 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 java.lang.String EXTRA_DEVICE = "android.companion.extra.DEVICE";
  }

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

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

  public final class WifiDeviceFilter implements android.companion.DeviceFilter {
    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 public android.companion.WifiDeviceFilter build();
    method public android.companion.WifiDeviceFilter.Builder setNamePattern(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, java.lang.String, android.content.ContentProviderClient, android.content.SyncResult);
    method public void onSecurityException(android.accounts.Account, android.os.Bundle, java.lang.String, android.content.SyncResult);
    method public void onSyncCanceled();
    method public void onSyncCanceled(java.lang.Thread);
    method public boolean onUnsyncableAccount();
    field public static final deprecated int LOG_SYNC_DETAILS = 2743; // 0xab7
  }

  public class ActivityNotFoundException extends java.lang.RuntimeException {
    ctor public ActivityNotFoundException();
    ctor public ActivityNotFoundException(java.lang.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, java.lang.Object, int);
    method protected void onInsertComplete(int, java.lang.Object, android.net.Uri);
    method protected void onQueryComplete(int, java.lang.Object, android.database.Cursor);
    method protected void onUpdateComplete(int, java.lang.Object, int);
    method public final void startDelete(int, java.lang.Object, android.net.Uri, java.lang.String, java.lang.String[]);
    method public final void startInsert(int, java.lang.Object, android.net.Uri, android.content.ContentValues);
    method public void startQuery(int, java.lang.Object, android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
    method public final void startUpdate(int, java.lang.Object, android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]);
  }

  protected static final class AsyncQueryHandler.WorkerArgs {
    ctor protected AsyncQueryHandler.WorkerArgs();
    field public java.lang.Object cookie;
    field public android.os.Handler handler;
    field public java.lang.String orderBy;
    field public java.lang.String[] projection;
    field public java.lang.Object result;
    field public java.lang.String selection;
    field public java.lang.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);
  }

  public abstract deprecated class AsyncTaskLoader<D> extends android.content.Loader {
    ctor public AsyncTaskLoader(android.content.Context);
    method public void cancelLoadInBackground();
    method public boolean isLoadInBackgroundCanceled();
    method public abstract D loadInBackground();
    method public void onCanceled(D);
    method protected D onLoadInBackground();
    method 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 java.lang.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, java.lang.String, android.os.Bundle);
    method public final void setResultCode(int);
    method public final void setResultData(java.lang.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 java.lang.String getResultData();
    method public final android.os.Bundle getResultExtras(boolean);
    method public final void setResult(int, java.lang.String, android.os.Bundle);
    method public final void setResultCode(int);
    method public final void setResultData(java.lang.String);
    method public final void setResultExtras(android.os.Bundle);
  }

  public class ClipData implements android.os.Parcelable {
    ctor public ClipData(java.lang.CharSequence, java.lang.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(java.lang.CharSequence, java.lang.CharSequence, java.lang.String);
    method public static android.content.ClipData newIntent(java.lang.CharSequence, android.content.Intent);
    method public static android.content.ClipData newPlainText(java.lang.CharSequence, java.lang.CharSequence);
    method public static android.content.ClipData newRawUri(java.lang.CharSequence, android.net.Uri);
    method public static android.content.ClipData newUri(android.content.ContentResolver, java.lang.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(java.lang.CharSequence);
    ctor public ClipData.Item(java.lang.CharSequence, java.lang.String);
    ctor public ClipData.Item(android.content.Intent);
    ctor public ClipData.Item(android.net.Uri);
    ctor public ClipData.Item(java.lang.CharSequence, android.content.Intent, android.net.Uri);
    ctor public ClipData.Item(java.lang.CharSequence, java.lang.String, android.content.Intent, android.net.Uri);
    method public java.lang.String coerceToHtmlText(android.content.Context);
    method public java.lang.CharSequence coerceToStyledText(android.content.Context);
    method public java.lang.CharSequence coerceToText(android.content.Context);
    method public java.lang.String getHtmlText();
    method public android.content.Intent getIntent();
    method public java.lang.CharSequence getText();
    method public android.net.Uri getUri();
  }

  public class ClipDescription implements android.os.Parcelable {
    ctor public ClipDescription(java.lang.CharSequence, java.lang.String[]);
    ctor public ClipDescription(android.content.ClipDescription);
    method public static boolean compareMimeTypes(java.lang.String, java.lang.String);
    method public int describeContents();
    method public java.lang.String[] filterMimeTypes(java.lang.String);
    method public android.os.PersistableBundle getExtras();
    method public java.lang.CharSequence getLabel();
    method public java.lang.String getMimeType(int);
    method public int getMimeTypeCount();
    method public long getTimestamp();
    method public boolean hasMimeType(java.lang.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 java.lang.String MIMETYPE_TEXT_HTML = "text/html";
    field public static final java.lang.String MIMETYPE_TEXT_INTENT = "text/vnd.android.intent";
    field public static final java.lang.String MIMETYPE_TEXT_PLAIN = "text/plain";
    field public static final java.lang.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 public android.content.ClipData getPrimaryClip();
    method public android.content.ClipDescription getPrimaryClipDescription();
    method public deprecated java.lang.CharSequence getText();
    method public boolean hasPrimaryClip();
    method public deprecated boolean hasText();
    method public void removePrimaryClipChangedListener(android.content.ClipboardManager.OnPrimaryClipChangedListener);
    method public void setPrimaryClip(android.content.ClipData);
    method public deprecated void setText(java.lang.CharSequence);
  }

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

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

  public abstract interface ComponentCallbacks2 implements android.content.ComponentCallbacks {
    method public abstract 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.os.Parcelable {
    ctor public ComponentName(java.lang.String, java.lang.String);
    ctor public ComponentName(android.content.Context, java.lang.String);
    ctor public ComponentName(android.content.Context, java.lang.Class<?>);
    ctor public ComponentName(android.os.Parcel);
    method public android.content.ComponentName clone();
    method public int compareTo(android.content.ComponentName);
    method public static android.content.ComponentName createRelative(java.lang.String, java.lang.String);
    method public static android.content.ComponentName createRelative(android.content.Context, java.lang.String);
    method public int describeContents();
    method public java.lang.String flattenToShortString();
    method public java.lang.String flattenToString();
    method public java.lang.String getClassName();
    method public java.lang.String getPackageName();
    method public java.lang.String getShortClassName();
    method public static android.content.ComponentName readFromParcel(android.os.Parcel);
    method public java.lang.String toShortString();
    method public static android.content.ComponentName unflattenFromString(java.lang.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 public android.content.ContentProviderResult[] applyBatch(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(android.net.Uri, android.content.ContentValues[]);
    method public android.os.Bundle call(java.lang.String, java.lang.String, android.os.Bundle);
    method public android.net.Uri canonicalize(android.net.Uri);
    method public abstract int delete(android.net.Uri, java.lang.String, java.lang.String[]);
    method public void dump(java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
    method public final java.lang.String getCallingPackage();
    method public final android.content.Context getContext();
    method public final android.content.pm.PathPermission[] getPathPermissions();
    method public final java.lang.String getReadPermission();
    method public java.lang.String[] getStreamTypes(android.net.Uri, java.lang.String);
    method public abstract java.lang.String getType(android.net.Uri);
    method public final java.lang.String getWritePermission();
    method public abstract android.net.Uri insert(android.net.Uri, 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 public android.content.res.AssetFileDescriptor openAssetFile(android.net.Uri, java.lang.String) throws java.io.FileNotFoundException;
    method public android.content.res.AssetFileDescriptor openAssetFile(android.net.Uri, java.lang.String, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public android.os.ParcelFileDescriptor openFile(android.net.Uri, java.lang.String) throws java.io.FileNotFoundException;
    method public android.os.ParcelFileDescriptor openFile(android.net.Uri, java.lang.String, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method protected final android.os.ParcelFileDescriptor openFileHelper(android.net.Uri, java.lang.String) throws java.io.FileNotFoundException;
    method public <T> android.os.ParcelFileDescriptor openPipeHelper(android.net.Uri, java.lang.String, android.os.Bundle, T, android.content.ContentProvider.PipeDataWriter<T>) throws java.io.FileNotFoundException;
    method public android.content.res.AssetFileDescriptor openTypedAssetFile(android.net.Uri, java.lang.String, android.os.Bundle) throws java.io.FileNotFoundException;
    method public android.content.res.AssetFileDescriptor openTypedAssetFile(android.net.Uri, java.lang.String, android.os.Bundle, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public abstract android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
    method public android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, android.os.CancellationSignal);
    method public android.database.Cursor query(android.net.Uri, java.lang.String[], android.os.Bundle, android.os.CancellationSignal);
    method public boolean refresh(android.net.Uri, android.os.Bundle, android.os.CancellationSignal);
    method protected final void setPathPermissions(android.content.pm.PathPermission[]);
    method protected final void setReadPermission(java.lang.String);
    method protected final void setWritePermission(java.lang.String);
    method public void shutdown();
    method public android.net.Uri uncanonicalize(android.net.Uri);
    method public abstract int update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]);
  }

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

  public class ContentProviderClient implements java.lang.AutoCloseable {
    method public android.content.ContentProviderResult[] applyBatch(java.util.ArrayList<android.content.ContentProviderOperation>) throws android.content.OperationApplicationException, android.os.RemoteException;
    method public int bulkInsert(android.net.Uri, android.content.ContentValues[]) throws android.os.RemoteException;
    method public android.os.Bundle call(java.lang.String, java.lang.String, android.os.Bundle) throws android.os.RemoteException;
    method public final android.net.Uri canonicalize(android.net.Uri) throws android.os.RemoteException;
    method public void close();
    method public int delete(android.net.Uri, java.lang.String, java.lang.String[]) throws android.os.RemoteException;
    method public android.content.ContentProvider getLocalContentProvider();
    method public java.lang.String[] getStreamTypes(android.net.Uri, java.lang.String) throws android.os.RemoteException;
    method public java.lang.String getType(android.net.Uri) throws android.os.RemoteException;
    method public android.net.Uri insert(android.net.Uri, android.content.ContentValues) throws android.os.RemoteException;
    method public android.content.res.AssetFileDescriptor openAssetFile(android.net.Uri, java.lang.String) throws java.io.FileNotFoundException, android.os.RemoteException;
    method public android.content.res.AssetFileDescriptor openAssetFile(android.net.Uri, java.lang.String, android.os.CancellationSignal) throws java.io.FileNotFoundException, android.os.RemoteException;
    method public android.os.ParcelFileDescriptor openFile(android.net.Uri, java.lang.String) throws java.io.FileNotFoundException, android.os.RemoteException;
    method public android.os.ParcelFileDescriptor openFile(android.net.Uri, java.lang.String, android.os.CancellationSignal) throws java.io.FileNotFoundException, android.os.RemoteException;
    method public final android.content.res.AssetFileDescriptor openTypedAssetFileDescriptor(android.net.Uri, java.lang.String, android.os.Bundle) throws java.io.FileNotFoundException, android.os.RemoteException;
    method public final android.content.res.AssetFileDescriptor openTypedAssetFileDescriptor(android.net.Uri, java.lang.String, android.os.Bundle, android.os.CancellationSignal) throws java.io.FileNotFoundException, android.os.RemoteException;
    method public android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String) throws android.os.RemoteException;
    method public android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, android.os.CancellationSignal) throws android.os.RemoteException;
    method public android.database.Cursor query(android.net.Uri, java.lang.String[], android.os.Bundle, android.os.CancellationSignal) throws android.os.RemoteException;
    method public boolean refresh(android.net.Uri, android.os.Bundle, android.os.CancellationSignal) throws android.os.RemoteException;
    method public deprecated boolean release();
    method public final android.net.Uri uncanonicalize(android.net.Uri) throws android.os.RemoteException;
    method public int update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.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 java.lang.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(java.lang.String, java.lang.String[]);
    method public android.content.ContentProviderOperation.Builder withSelectionBackReference(int, int);
    method public android.content.ContentProviderOperation.Builder withValue(java.lang.String, java.lang.Object);
    method public android.content.ContentProviderOperation.Builder withValueBackReference(java.lang.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 java.lang.Integer count;
    field public final android.net.Uri uri;
  }

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

  public abstract class ContentResolver {
    ctor public ContentResolver(android.content.Context);
    method public final android.content.ContentProviderClient acquireContentProviderClient(android.net.Uri);
    method public final android.content.ContentProviderClient acquireContentProviderClient(java.lang.String);
    method public final android.content.ContentProviderClient acquireUnstableContentProviderClient(android.net.Uri);
    method public final android.content.ContentProviderClient acquireUnstableContentProviderClient(java.lang.String);
    method public static void addPeriodicSync(android.accounts.Account, java.lang.String, android.os.Bundle, long);
    method public static java.lang.Object addStatusChangeListener(int, android.content.SyncStatusObserver);
    method public android.content.ContentProviderResult[] applyBatch(java.lang.String, java.util.ArrayList<android.content.ContentProviderOperation>) throws android.content.OperationApplicationException, android.os.RemoteException;
    method public final int bulkInsert(android.net.Uri, android.content.ContentValues[]);
    method public final android.os.Bundle call(android.net.Uri, java.lang.String, java.lang.String, android.os.Bundle);
    method public deprecated void cancelSync(android.net.Uri);
    method public static void cancelSync(android.accounts.Account, java.lang.String);
    method public static void cancelSync(android.content.SyncRequest);
    method public final android.net.Uri canonicalize(android.net.Uri);
    method public final int delete(android.net.Uri, java.lang.String, java.lang.String[]);
    method public static deprecated android.content.SyncInfo getCurrentSync();
    method public static java.util.List<android.content.SyncInfo> getCurrentSyncs();
    method public static int getIsSyncable(android.accounts.Account, java.lang.String);
    method public static boolean getMasterSyncAutomatically();
    method public java.util.List<android.content.UriPermission> getOutgoingPersistedUriPermissions();
    method public static java.util.List<android.content.PeriodicSync> getPeriodicSyncs(android.accounts.Account, java.lang.String);
    method public java.util.List<android.content.UriPermission> getPersistedUriPermissions();
    method public java.lang.String[] getStreamTypes(android.net.Uri, java.lang.String);
    method public static android.content.SyncAdapterType[] getSyncAdapterTypes();
    method public static boolean getSyncAutomatically(android.accounts.Account, java.lang.String);
    method public final java.lang.String getType(android.net.Uri);
    method public final android.net.Uri insert(android.net.Uri, android.content.ContentValues);
    method public static boolean isSyncActive(android.accounts.Account, java.lang.String);
    method public static boolean isSyncPending(android.accounts.Account, java.lang.String);
    method public void notifyChange(android.net.Uri, android.database.ContentObserver);
    method public void notifyChange(android.net.Uri, android.database.ContentObserver, boolean);
    method public void notifyChange(android.net.Uri, android.database.ContentObserver, int);
    method public final android.content.res.AssetFileDescriptor openAssetFileDescriptor(android.net.Uri, java.lang.String) throws java.io.FileNotFoundException;
    method public final android.content.res.AssetFileDescriptor openAssetFileDescriptor(android.net.Uri, java.lang.String, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public final android.os.ParcelFileDescriptor openFileDescriptor(android.net.Uri, java.lang.String) throws java.io.FileNotFoundException;
    method public final android.os.ParcelFileDescriptor openFileDescriptor(android.net.Uri, java.lang.String, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public final java.io.InputStream openInputStream(android.net.Uri) throws java.io.FileNotFoundException;
    method public final java.io.OutputStream openOutputStream(android.net.Uri) throws java.io.FileNotFoundException;
    method public final java.io.OutputStream openOutputStream(android.net.Uri, java.lang.String) throws java.io.FileNotFoundException;
    method public final android.content.res.AssetFileDescriptor openTypedAssetFileDescriptor(android.net.Uri, java.lang.String, android.os.Bundle) throws java.io.FileNotFoundException;
    method public final android.content.res.AssetFileDescriptor openTypedAssetFileDescriptor(android.net.Uri, java.lang.String, android.os.Bundle, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public final android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
    method public final android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, android.os.CancellationSignal);
    method public final android.database.Cursor query(android.net.Uri, java.lang.String[], android.os.Bundle, android.os.CancellationSignal);
    method public final boolean refresh(android.net.Uri, android.os.Bundle, android.os.CancellationSignal);
    method public final void registerContentObserver(android.net.Uri, boolean, android.database.ContentObserver);
    method public void releasePersistableUriPermission(android.net.Uri, int);
    method public static void removePeriodicSync(android.accounts.Account, java.lang.String, android.os.Bundle);
    method public static void removeStatusChangeListener(java.lang.Object);
    method public static void requestSync(android.accounts.Account, java.lang.String, android.os.Bundle);
    method public static void requestSync(android.content.SyncRequest);
    method public static void setIsSyncable(android.accounts.Account, java.lang.String, int);
    method public static void setMasterSyncAutomatically(boolean);
    method public static void setSyncAutomatically(android.accounts.Account, java.lang.String, boolean);
    method public deprecated void startSync(android.net.Uri, android.os.Bundle);
    method public void takePersistableUriPermission(android.net.Uri, int);
    method public final android.net.Uri uncanonicalize(android.net.Uri);
    method public final void unregisterContentObserver(android.database.ContentObserver);
    method public final int update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]);
    method public static void validateSyncExtrasBundle(android.os.Bundle);
    field public static final java.lang.String ANY_CURSOR_ITEM_TYPE = "vnd.android.cursor.item/*";
    field public static final java.lang.String CURSOR_DIR_BASE_TYPE = "vnd.android.cursor.dir";
    field public static final java.lang.String CURSOR_ITEM_BASE_TYPE = "vnd.android.cursor.item";
    field public static final java.lang.String EXTRA_HONORED_ARGS = "android.content.extra.HONORED_ARGS";
    field public static final java.lang.String EXTRA_REFRESH_SUPPORTED = "android.content.extra.REFRESH_SUPPORTED";
    field public static final java.lang.String EXTRA_SIZE = "android.content.extra.SIZE";
    field public static final java.lang.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 java.lang.String QUERY_ARG_LIMIT = "android:query-arg-limit";
    field public static final java.lang.String QUERY_ARG_OFFSET = "android:query-arg-offset";
    field public static final java.lang.String QUERY_ARG_SORT_COLLATION = "android:query-arg-sort-collation";
    field public static final java.lang.String QUERY_ARG_SORT_COLUMNS = "android:query-arg-sort-columns";
    field public static final java.lang.String QUERY_ARG_SORT_DIRECTION = "android:query-arg-sort-direction";
    field public static final java.lang.String QUERY_ARG_SQL_SELECTION = "android:query-arg-sql-selection";
    field public static final java.lang.String QUERY_ARG_SQL_SELECTION_ARGS = "android:query-arg-sql-selection-args";
    field public static final java.lang.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 java.lang.String SCHEME_ANDROID_RESOURCE = "android.resource";
    field public static final java.lang.String SCHEME_CONTENT = "content";
    field public static final java.lang.String SCHEME_FILE = "file";
    field public static final deprecated java.lang.String SYNC_EXTRAS_ACCOUNT = "account";
    field public static final java.lang.String SYNC_EXTRAS_DISCARD_LOCAL_DELETIONS = "discard_deletions";
    field public static final java.lang.String SYNC_EXTRAS_DO_NOT_RETRY = "do_not_retry";
    field public static final java.lang.String SYNC_EXTRAS_EXPEDITED = "expedited";
    field public static final deprecated java.lang.String SYNC_EXTRAS_FORCE = "force";
    field public static final java.lang.String SYNC_EXTRAS_IGNORE_BACKOFF = "ignore_backoff";
    field public static final java.lang.String SYNC_EXTRAS_IGNORE_SETTINGS = "ignore_settings";
    field public static final java.lang.String SYNC_EXTRAS_INITIALIZE = "initialize";
    field public static final java.lang.String SYNC_EXTRAS_MANUAL = "force";
    field public static final java.lang.String SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS = "deletions_override";
    field public static final java.lang.String SYNC_EXTRAS_REQUIRE_CHARGING = "require_charging";
    field public static final java.lang.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(java.lang.String);
    method public int describeContents();
    method public java.lang.Object get(java.lang.String);
    method public java.lang.Boolean getAsBoolean(java.lang.String);
    method public java.lang.Byte getAsByte(java.lang.String);
    method public byte[] getAsByteArray(java.lang.String);
    method public java.lang.Double getAsDouble(java.lang.String);
    method public java.lang.Float getAsFloat(java.lang.String);
    method public java.lang.Integer getAsInteger(java.lang.String);
    method public java.lang.Long getAsLong(java.lang.String);
    method public java.lang.Short getAsShort(java.lang.String);
    method public java.lang.String getAsString(java.lang.String);
    method public java.util.Set<java.lang.String> keySet();
    method public void put(java.lang.String, java.lang.String);
    method public void put(java.lang.String, java.lang.Byte);
    method public void put(java.lang.String, java.lang.Short);
    method public void put(java.lang.String, java.lang.Integer);
    method public void put(java.lang.String, java.lang.Long);
    method public void put(java.lang.String, java.lang.Float);
    method public void put(java.lang.String, java.lang.Double);
    method public void put(java.lang.String, java.lang.Boolean);
    method public void put(java.lang.String, byte[]);
    method public void putAll(android.content.ContentValues);
    method public void putNull(java.lang.String);
    method public void remove(java.lang.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 java.lang.String TAG = "ContentValues";
  }

  public abstract class Context {
    ctor public Context();
    method public abstract boolean bindService(android.content.Intent, android.content.ServiceConnection, int);
    method public abstract int checkCallingOrSelfPermission(java.lang.String);
    method public abstract int checkCallingOrSelfUriPermission(android.net.Uri, int);
    method public abstract int checkCallingPermission(java.lang.String);
    method public abstract int checkCallingUriPermission(android.net.Uri, int);
    method public abstract int checkPermission(java.lang.String, int, int);
    method public abstract int checkSelfPermission(java.lang.String);
    method public abstract int checkUriPermission(android.net.Uri, int, int, int);
    method public abstract int checkUriPermission(android.net.Uri, java.lang.String, java.lang.String, int, int, int);
    method public abstract deprecated void clearWallpaper() throws java.io.IOException;
    method public abstract android.content.Context createConfigurationContext(android.content.res.Configuration);
    method public abstract android.content.Context createContextForSplit(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.Context createDeviceProtectedStorageContext();
    method public abstract android.content.Context createDisplayContext(android.view.Display);
    method public abstract android.content.Context createPackageContext(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract java.lang.String[] databaseList();
    method public abstract boolean deleteDatabase(java.lang.String);
    method public abstract boolean deleteFile(java.lang.String);
    method public abstract boolean deleteSharedPreferences(java.lang.String);
    method public abstract void enforceCallingOrSelfPermission(java.lang.String, java.lang.String);
    method public abstract void enforceCallingOrSelfUriPermission(android.net.Uri, int, java.lang.String);
    method public abstract void enforceCallingPermission(java.lang.String, java.lang.String);
    method public abstract void enforceCallingUriPermission(android.net.Uri, int, java.lang.String);
    method public abstract void enforcePermission(java.lang.String, int, int, java.lang.String);
    method public abstract void enforceUriPermission(android.net.Uri, int, int, int, java.lang.String);
    method public abstract void enforceUriPermission(android.net.Uri, java.lang.String, java.lang.String, int, int, int, java.lang.String);
    method public abstract java.lang.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 java.lang.ClassLoader getClassLoader();
    method public abstract java.io.File getCodeCacheDir();
    method public final int getColor(int);
    method public final android.content.res.ColorStateList getColorStateList(int);
    method public abstract android.content.ContentResolver getContentResolver();
    method public abstract java.io.File getDataDir();
    method public abstract java.io.File getDatabasePath(java.lang.String);
    method public abstract java.io.File getDir(java.lang.String, int);
    method public final android.graphics.drawable.Drawable getDrawable(int);
    method public abstract java.io.File getExternalCacheDir();
    method public abstract java.io.File[] getExternalCacheDirs();
    method public abstract java.io.File getExternalFilesDir(java.lang.String);
    method public abstract java.io.File[] getExternalFilesDirs(java.lang.String);
    method public abstract java.io.File[] getExternalMediaDirs();
    method public abstract java.io.File getFileStreamPath(java.lang.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 java.lang.String getPackageCodePath();
    method public abstract android.content.pm.PackageManager getPackageManager();
    method public abstract java.lang.String getPackageName();
    method public abstract java.lang.String getPackageResourcePath();
    method public abstract android.content.res.Resources getResources();
    method public abstract android.content.SharedPreferences getSharedPreferences(java.lang.String, int);
    method public final java.lang.String getString(int);
    method public final java.lang.String getString(int, java.lang.Object...);
    method public abstract java.lang.Object getSystemService(java.lang.String);
    method public final <T> T getSystemService(java.lang.Class<T>);
    method public abstract java.lang.String getSystemServiceName(java.lang.Class<?>);
    method public final java.lang.CharSequence getText(int);
    method public abstract android.content.res.Resources.Theme getTheme();
    method public abstract deprecated android.graphics.drawable.Drawable getWallpaper();
    method public abstract deprecated int getWallpaperDesiredMinimumHeight();
    method public abstract deprecated int getWallpaperDesiredMinimumWidth();
    method public abstract void grantUriPermission(java.lang.String, android.net.Uri, int);
    method public abstract boolean isDeviceProtectedStorage();
    method public boolean isRestricted();
    method public abstract boolean moveDatabaseFrom(android.content.Context, java.lang.String);
    method public abstract boolean moveSharedPreferencesFrom(android.content.Context, java.lang.String);
    method public final android.content.res.TypedArray obtainStyledAttributes(int[]);
    method public final android.content.res.TypedArray obtainStyledAttributes(int, int[]) throws android.content.res.Resources.NotFoundException;
    method public final android.content.res.TypedArray obtainStyledAttributes(android.util.AttributeSet, int[]);
    method public final android.content.res.TypedArray obtainStyledAttributes(android.util.AttributeSet, int[], int, int);
    method public abstract java.io.FileInputStream openFileInput(java.lang.String) throws java.io.FileNotFoundException;
    method public abstract java.io.FileOutputStream openFileOutput(java.lang.String, int) throws java.io.FileNotFoundException;
    method public abstract android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase.CursorFactory);
    method public abstract android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase.CursorFactory, android.database.DatabaseErrorHandler);
    method public abstract deprecated android.graphics.drawable.Drawable peekWallpaper();
    method public void registerComponentCallbacks(android.content.ComponentCallbacks);
    method public abstract android.content.Intent registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter);
    method public abstract android.content.Intent registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, int);
    method public abstract android.content.Intent registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, java.lang.String, android.os.Handler);
    method public abstract android.content.Intent registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, java.lang.String, android.os.Handler, int);
    method public abstract deprecated void removeStickyBroadcast(android.content.Intent);
    method public abstract deprecated void removeStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle);
    method public abstract void revokeUriPermission(android.net.Uri, int);
    method public abstract void revokeUriPermission(java.lang.String, android.net.Uri, int);
    method public abstract void sendBroadcast(android.content.Intent);
    method public abstract void sendBroadcast(android.content.Intent, java.lang.String);
    method public abstract void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle);
    method public abstract void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String);
    method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String);
    method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
    method public abstract void sendOrderedBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
    method public abstract deprecated void sendStickyBroadcast(android.content.Intent);
    method public abstract deprecated void sendStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle);
    method public abstract deprecated void sendStickyOrderedBroadcast(android.content.Intent, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
    method public abstract deprecated void sendStickyOrderedBroadcastAsUser(android.content.Intent, android.os.UserHandle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
    method public abstract void setTheme(int);
    method public abstract deprecated void setWallpaper(android.graphics.Bitmap) throws java.io.IOException;
    method public abstract deprecated void setWallpaper(java.io.InputStream) throws java.io.IOException;
    method public abstract void startActivities(android.content.Intent[]);
    method public abstract void startActivities(android.content.Intent[], android.os.Bundle);
    method public abstract void startActivity(android.content.Intent);
    method public abstract void startActivity(android.content.Intent, android.os.Bundle);
    method public abstract android.content.ComponentName startForegroundService(android.content.Intent);
    method public abstract boolean startInstrumentation(android.content.ComponentName, java.lang.String, android.os.Bundle);
    method public abstract void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException;
    method public abstract void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method public abstract android.content.ComponentName startService(android.content.Intent);
    method public abstract boolean stopService(android.content.Intent);
    method public abstract void unbindService(android.content.ServiceConnection);
    method public void unregisterComponentCallbacks(android.content.ComponentCallbacks);
    method public abstract void unregisterReceiver(android.content.BroadcastReceiver);
    field public static final java.lang.String ACCESSIBILITY_SERVICE = "accessibility";
    field public static final java.lang.String ACCOUNT_SERVICE = "account";
    field public static final java.lang.String ACTIVITY_SERVICE = "activity";
    field public static final java.lang.String ALARM_SERVICE = "alarm";
    field public static final java.lang.String APPWIDGET_SERVICE = "appwidget";
    field public static final java.lang.String APP_OPS_SERVICE = "appops";
    field public static final java.lang.String AUDIO_SERVICE = "audio";
    field public static final java.lang.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 java.lang.String BLUETOOTH_SERVICE = "bluetooth";
    field public static final java.lang.String CAMERA_SERVICE = "camera";
    field public static final java.lang.String CAPTIONING_SERVICE = "captioning";
    field public static final java.lang.String CARRIER_CONFIG_SERVICE = "carrier_config";
    field public static final java.lang.String CLIPBOARD_SERVICE = "clipboard";
    field public static final java.lang.String COMPANION_DEVICE_SERVICE = "companiondevice";
    field public static final java.lang.String CONNECTIVITY_SERVICE = "connectivity";
    field public static final java.lang.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 java.lang.String CROSS_PROFILE_APPS_SERVICE = "crossprofileapps";
    field public static final java.lang.String DEVICE_POLICY_SERVICE = "device_policy";
    field public static final java.lang.String DISPLAY_SERVICE = "display";
    field public static final java.lang.String DOWNLOAD_SERVICE = "download";
    field public static final java.lang.String DROPBOX_SERVICE = "dropbox";
    field public static final java.lang.String EUICC_SERVICE = "euicc";
    field public static final java.lang.String FINGERPRINT_SERVICE = "fingerprint";
    field public static final java.lang.String HARDWARE_PROPERTIES_SERVICE = "hardware_properties";
    field public static final java.lang.String INPUT_METHOD_SERVICE = "input_method";
    field public static final java.lang.String INPUT_SERVICE = "input";
    field public static final java.lang.String IPSEC_SERVICE = "ipsec";
    field public static final java.lang.String JOB_SCHEDULER_SERVICE = "jobscheduler";
    field public static final java.lang.String KEYGUARD_SERVICE = "keyguard";
    field public static final java.lang.String LAUNCHER_APPS_SERVICE = "launcherapps";
    field public static final java.lang.String LAYOUT_INFLATER_SERVICE = "layout_inflater";
    field public static final java.lang.String LOCATION_SERVICE = "location";
    field public static final java.lang.String MEDIA_PROJECTION_SERVICE = "media_projection";
    field public static final java.lang.String MEDIA_ROUTER_SERVICE = "media_router";
    field public static final java.lang.String MEDIA_SESSION_SERVICE = "media_session";
    field public static final java.lang.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 public static final deprecated 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 public static final deprecated int MODE_WORLD_READABLE = 1; // 0x1
    field public static final deprecated int MODE_WORLD_WRITEABLE = 2; // 0x2
    field public static final java.lang.String NETWORK_STATS_SERVICE = "netstats";
    field public static final java.lang.String NFC_SERVICE = "nfc";
    field public static final java.lang.String NOTIFICATION_SERVICE = "notification";
    field public static final java.lang.String NSD_SERVICE = "servicediscovery";
    field public static final java.lang.String POWER_SERVICE = "power";
    field public static final java.lang.String PRINT_SERVICE = "print";
    field public static final int RECEIVER_VISIBLE_TO_INSTANT_APPS = 1; // 0x1
    field public static final java.lang.String RESTRICTIONS_SERVICE = "restrictions";
    field public static final java.lang.String SEARCH_SERVICE = "search";
    field public static final java.lang.String SENSOR_SERVICE = "sensor";
    field public static final java.lang.String SHORTCUT_SERVICE = "shortcut";
    field public static final java.lang.String STORAGE_SERVICE = "storage";
    field public static final java.lang.String STORAGE_STATS_SERVICE = "storagestats";
    field public static final java.lang.String SYSTEM_HEALTH_SERVICE = "systemhealth";
    field public static final java.lang.String TELECOM_SERVICE = "telecom";
    field public static final java.lang.String TELEPHONY_SERVICE = "phone";
    field public static final java.lang.String TELEPHONY_SUBSCRIPTION_SERVICE = "telephony_subscription_service";
    field public static final java.lang.String TEXT_CLASSIFICATION_SERVICE = "textclassification";
    field public static final java.lang.String TEXT_SERVICES_MANAGER_SERVICE = "textservices";
    field public static final java.lang.String TV_INPUT_SERVICE = "tv_input";
    field public static final java.lang.String UI_MODE_SERVICE = "uimode";
    field public static final java.lang.String USAGE_STATS_SERVICE = "usagestats";
    field public static final java.lang.String USB_SERVICE = "usb";
    field public static final java.lang.String USER_SERVICE = "user";
    field public static final java.lang.String VIBRATOR_SERVICE = "vibrator";
    field public static final java.lang.String WALLPAPER_SERVICE = "wallpaper";
    field public static final java.lang.String WIFI_AWARE_SERVICE = "wifiaware";
    field public static final java.lang.String WIFI_P2P_SERVICE = "wifip2p";
    field public static final java.lang.String WIFI_RTT_RANGING_SERVICE = "wifirtt";
    field public static final java.lang.String WIFI_SERVICE = "wifi";
    field public static final java.lang.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(java.lang.String);
    method public int checkCallingOrSelfUriPermission(android.net.Uri, int);
    method public int checkCallingPermission(java.lang.String);
    method public int checkCallingUriPermission(android.net.Uri, int);
    method public int checkPermission(java.lang.String, int, int);
    method public int checkSelfPermission(java.lang.String);
    method public int checkUriPermission(android.net.Uri, int, int, int);
    method public int checkUriPermission(android.net.Uri, java.lang.String, java.lang.String, int, int, int);
    method public deprecated void clearWallpaper() throws java.io.IOException;
    method public android.content.Context createConfigurationContext(android.content.res.Configuration);
    method public android.content.Context createContextForSplit(java.lang.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(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public java.lang.String[] databaseList();
    method public boolean deleteDatabase(java.lang.String);
    method public boolean deleteFile(java.lang.String);
    method public boolean deleteSharedPreferences(java.lang.String);
    method public void enforceCallingOrSelfPermission(java.lang.String, java.lang.String);
    method public void enforceCallingOrSelfUriPermission(android.net.Uri, int, java.lang.String);
    method public void enforceCallingPermission(java.lang.String, java.lang.String);
    method public void enforceCallingUriPermission(android.net.Uri, int, java.lang.String);
    method public void enforcePermission(java.lang.String, int, int, java.lang.String);
    method public void enforceUriPermission(android.net.Uri, int, int, int, java.lang.String);
    method public void enforceUriPermission(android.net.Uri, java.lang.String, java.lang.String, int, int, int, java.lang.String);
    method public java.lang.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 java.lang.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(java.lang.String);
    method public java.io.File getDir(java.lang.String, int);
    method public java.io.File getExternalCacheDir();
    method public java.io.File[] getExternalCacheDirs();
    method public java.io.File getExternalFilesDir(java.lang.String);
    method public java.io.File[] getExternalFilesDirs(java.lang.String);
    method public java.io.File[] getExternalMediaDirs();
    method public java.io.File getFileStreamPath(java.lang.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 java.lang.String getPackageCodePath();
    method public android.content.pm.PackageManager getPackageManager();
    method public java.lang.String getPackageName();
    method public java.lang.String getPackageResourcePath();
    method public android.content.res.Resources getResources();
    method public android.content.SharedPreferences getSharedPreferences(java.lang.String, int);
    method public java.lang.Object getSystemService(java.lang.String);
    method public java.lang.String getSystemServiceName(java.lang.Class<?>);
    method public android.content.res.Resources.Theme getTheme();
    method public deprecated android.graphics.drawable.Drawable getWallpaper();
    method public deprecated int getWallpaperDesiredMinimumHeight();
    method public deprecated int getWallpaperDesiredMinimumWidth();
    method public void grantUriPermission(java.lang.String, android.net.Uri, int);
    method public boolean isDeviceProtectedStorage();
    method public boolean moveDatabaseFrom(android.content.Context, java.lang.String);
    method public boolean moveSharedPreferencesFrom(android.content.Context, java.lang.String);
    method public java.io.FileInputStream openFileInput(java.lang.String) throws java.io.FileNotFoundException;
    method public java.io.FileOutputStream openFileOutput(java.lang.String, int) throws java.io.FileNotFoundException;
    method public android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase.CursorFactory);
    method public android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase.CursorFactory, android.database.DatabaseErrorHandler);
    method public deprecated 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, java.lang.String, android.os.Handler);
    method public android.content.Intent registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, java.lang.String, android.os.Handler, int);
    method public deprecated void removeStickyBroadcast(android.content.Intent);
    method public deprecated void removeStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle);
    method public void revokeUriPermission(android.net.Uri, int);
    method public void revokeUriPermission(java.lang.String, android.net.Uri, int);
    method public void sendBroadcast(android.content.Intent);
    method public void sendBroadcast(android.content.Intent, java.lang.String);
    method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle);
    method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String);
    method public void sendOrderedBroadcast(android.content.Intent, java.lang.String);
    method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
    method public void sendOrderedBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
    method public deprecated void sendStickyBroadcast(android.content.Intent);
    method public deprecated void sendStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle);
    method public deprecated void sendStickyOrderedBroadcast(android.content.Intent, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
    method public deprecated void sendStickyOrderedBroadcastAsUser(android.content.Intent, android.os.UserHandle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
    method public void setTheme(int);
    method public deprecated void setWallpaper(android.graphics.Bitmap) throws java.io.IOException;
    method public deprecated 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, java.lang.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);
  }

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

  public abstract interface DialogInterface {
    method public abstract void cancel();
    method public abstract void dismiss();
    field public static final deprecated int BUTTON1 = -1; // 0xffffffff
    field public static final deprecated int BUTTON2 = -2; // 0xfffffffe
    field public static final deprecated 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 abstract interface DialogInterface.OnCancelListener {
    method public abstract void onCancel(android.content.DialogInterface);
  }

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

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

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

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

  public static abstract interface DialogInterface.OnShowListener {
    method public abstract 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 abstract interface EntityIterator implements java.util.Iterator {
    method public abstract void close();
    method public abstract void reset();
  }

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

  public class IntentFilter implements android.os.Parcelable {
    ctor public IntentFilter();
    ctor public IntentFilter(java.lang.String);
    ctor public IntentFilter(java.lang.String, java.lang.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(java.lang.String);
    method public final void addCategory(java.lang.String);
    method public final void addDataAuthority(java.lang.String, java.lang.String);
    method public final void addDataPath(java.lang.String, int);
    method public final void addDataScheme(java.lang.String);
    method public final void addDataSchemeSpecificPart(java.lang.String, int);
    method public final void addDataType(java.lang.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(java.lang.String, java.lang.String);
    method public final int describeContents();
    method public void dump(android.util.Printer, java.lang.String);
    method public final java.lang.String getAction(int);
    method public final java.lang.String getCategory(int);
    method public final android.content.IntentFilter.AuthorityEntry getDataAuthority(int);
    method public final android.os.PatternMatcher getDataPath(int);
    method public final java.lang.String getDataScheme(int);
    method public final android.os.PatternMatcher getDataSchemeSpecificPart(int);
    method public final java.lang.String getDataType(int);
    method public final int getPriority();
    method public final boolean hasAction(java.lang.String);
    method public final boolean hasCategory(java.lang.String);
    method public final boolean hasDataAuthority(android.net.Uri);
    method public final boolean hasDataPath(java.lang.String);
    method public final boolean hasDataScheme(java.lang.String);
    method public final boolean hasDataSchemeSpecificPart(java.lang.String);
    method public final boolean hasDataType(java.lang.String);
    method public final int match(android.content.ContentResolver, android.content.Intent, boolean, java.lang.String);
    method public final int match(java.lang.String, java.lang.String, java.lang.String, android.net.Uri, java.util.Set<java.lang.String>, java.lang.String);
    method public final boolean matchAction(java.lang.String);
    method public final java.lang.String matchCategories(java.util.Set<java.lang.String>);
    method public final int matchData(java.lang.String, java.lang.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(java.lang.String, java.lang.String);
    method public java.lang.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(java.lang.String);
  }

  public class IntentSender implements android.os.Parcelable {
    method public int describeContents();
    method public java.lang.String getCreatorPackage();
    method public int getCreatorUid();
    method public android.os.UserHandle getCreatorUserHandle();
    method public deprecated java.lang.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, java.lang.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 abstract interface IntentSender.OnFinished {
    method public abstract void onSendFinished(android.content.IntentSender, android.content.Intent, int, java.lang.String, android.os.Bundle);
  }

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

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

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

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

  public static abstract deprecated interface Loader.OnLoadCompleteListener<D> {
    method public abstract 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(java.lang.String);
    ctor public OperationApplicationException(java.lang.String, java.lang.Throwable);
    ctor public OperationApplicationException(java.lang.Throwable);
    ctor public OperationApplicationException(int);
    ctor public OperationApplicationException(java.lang.String, int);
    method public int getNumSuccessfulYieldPoints();
  }

  public class PeriodicSync implements android.os.Parcelable {
    ctor public PeriodicSync(android.accounts.Account, java.lang.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 java.lang.String authority;
    field public final android.os.Bundle extras;
    field public final long period;
  }

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

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

  public class RestrictionEntry implements android.os.Parcelable {
    ctor public RestrictionEntry(int, java.lang.String);
    ctor public RestrictionEntry(java.lang.String, java.lang.String);
    ctor public RestrictionEntry(java.lang.String, boolean);
    ctor public RestrictionEntry(java.lang.String, java.lang.String[]);
    ctor public RestrictionEntry(java.lang.String, int);
    ctor public RestrictionEntry(android.os.Parcel);
    method public static android.content.RestrictionEntry createBundleArrayEntry(java.lang.String, android.content.RestrictionEntry[]);
    method public static android.content.RestrictionEntry createBundleEntry(java.lang.String, android.content.RestrictionEntry[]);
    method public int describeContents();
    method public java.lang.String[] getAllSelectedStrings();
    method public java.lang.String[] getChoiceEntries();
    method public java.lang.String[] getChoiceValues();
    method public java.lang.String getDescription();
    method public int getIntValue();
    method public java.lang.String getKey();
    method public android.content.RestrictionEntry[] getRestrictions();
    method public boolean getSelectedState();
    method public java.lang.String getSelectedString();
    method public java.lang.String getTitle();
    method public int getType();
    method public void setAllSelectedStrings(java.lang.String[]);
    method public void setChoiceEntries(java.lang.String[]);
    method public void setChoiceEntries(android.content.Context, int);
    method public void setChoiceValues(java.lang.String[]);
    method public void setChoiceValues(android.content.Context, int);
    method public void setDescription(java.lang.String);
    method public void setIntValue(int);
    method public void setRestrictions(android.content.RestrictionEntry[]);
    method public void setSelectedState(boolean);
    method public void setSelectedString(java.lang.String);
    method public void setTitle(java.lang.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(java.lang.String);
    method public boolean hasRestrictionsProvider();
    method public void notifyPermissionResponse(java.lang.String, android.os.PersistableBundle);
    method public void requestPermission(java.lang.String, java.lang.String, android.os.PersistableBundle);
    field public static final java.lang.String ACTION_PERMISSION_RESPONSE_RECEIVED = "android.content.action.PERMISSION_RESPONSE_RECEIVED";
    field public static final java.lang.String ACTION_REQUEST_LOCAL_APPROVAL = "android.content.action.REQUEST_LOCAL_APPROVAL";
    field public static final java.lang.String ACTION_REQUEST_PERMISSION = "android.content.action.REQUEST_PERMISSION";
    field public static final java.lang.String EXTRA_PACKAGE_NAME = "android.content.extra.PACKAGE_NAME";
    field public static final java.lang.String EXTRA_REQUEST_BUNDLE = "android.content.extra.REQUEST_BUNDLE";
    field public static final java.lang.String EXTRA_REQUEST_ID = "android.content.extra.REQUEST_ID";
    field public static final java.lang.String EXTRA_REQUEST_TYPE = "android.content.extra.REQUEST_TYPE";
    field public static final java.lang.String EXTRA_RESPONSE_BUNDLE = "android.content.extra.RESPONSE_BUNDLE";
    field public static final java.lang.String META_DATA_APP_RESTRICTIONS = "android.content.APP_RESTRICTIONS";
    field public static final java.lang.String REQUEST_KEY_APPROVE_LABEL = "android.request.approve_label";
    field public static final java.lang.String REQUEST_KEY_DATA = "android.request.data";
    field public static final java.lang.String REQUEST_KEY_DENY_LABEL = "android.request.deny_label";
    field public static final java.lang.String REQUEST_KEY_ICON = "android.request.icon";
    field public static final java.lang.String REQUEST_KEY_ID = "android.request.id";
    field public static final java.lang.String REQUEST_KEY_MESSAGE = "android.request.mesg";
    field public static final java.lang.String REQUEST_KEY_NEW_REQUEST = "android.request.new_request";
    field public static final java.lang.String REQUEST_KEY_TITLE = "android.request.title";
    field public static final java.lang.String REQUEST_TYPE_APPROVAL = "android.request.type.approval";
    field public static final java.lang.String RESPONSE_KEY_ERROR_CODE = "android.response.errorcode";
    field public static final java.lang.String RESPONSE_KEY_MESSAGE = "android.response.msg";
    field public static final java.lang.String RESPONSE_KEY_RESPONSE_TIMESTAMP = "android.response.timestamp";
    field public static final java.lang.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, java.lang.String, java.lang.String[]);
    method public java.lang.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, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
    method protected void setupSuggestions(java.lang.String, int);
    method public int update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]);
    field public static final int DATABASE_MODE_2LINES = 2; // 0x2
    field public static final int DATABASE_MODE_QUERIES = 1; // 0x1
  }

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

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

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

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

  public class SyncAdapterType implements android.os.Parcelable {
    ctor public SyncAdapterType(java.lang.String, java.lang.String, boolean, boolean);
    ctor public SyncAdapterType(android.os.Parcel);
    method public boolean allowParallelSyncs();
    method public int describeContents();
    method public java.lang.String getSettingsActivity();
    method public boolean isAlwaysSyncable();
    method public boolean isUserVisible();
    method public static android.content.SyncAdapterType newKey(java.lang.String, java.lang.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 java.lang.String accountType;
    field public final java.lang.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 java.lang.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, java.lang.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 java.lang.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 abstract interface SyncStatusObserver {
    method public abstract void onStatusChanged(int);
  }

  public class UriMatcher {
    ctor public UriMatcher(int);
    method public void addURI(java.lang.String, java.lang.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, java.lang.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 java.lang.String parentActivityName;
    field public java.lang.String permission;
    field public int persistableMode;
    field public int screenOrientation;
    field public int softInputMode;
    field public java.lang.String targetActivity;
    field public java.lang.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, java.lang.String);
    method public static java.lang.CharSequence getCategoryTitle(android.content.Context, int);
    method public boolean isVirtualPreload();
    method public java.lang.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 public static final deprecated 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 java.lang.String appComponentFactory;
    field public java.lang.String backupAgentName;
    field public int category;
    field public java.lang.String className;
    field public int compatibleWidthLimitDp;
    field public java.lang.String dataDir;
    field public int descriptionRes;
    field public java.lang.String deviceProtectedDataDir;
    field public boolean enabled;
    field public int flags;
    field public int largestWidthLimitDp;
    field public java.lang.String manageSpaceActivityName;
    field public int minSdkVersion;
    field public java.lang.String nativeLibraryDir;
    field public java.lang.String permission;
    field public java.lang.String processName;
    field public java.lang.String publicSourceDir;
    field public int requiresSmallestWidthDp;
    field public java.lang.String[] sharedLibraryFiles;
    field public java.lang.String sourceDir;
    field public java.lang.String[] splitNames;
    field public java.lang.String[] splitPublicSourceDirs;
    field public java.lang.String[] splitSourceDirs;
    field public java.util.UUID storageUuid;
    field public int targetSdkVersion;
    field public java.lang.String taskAffinity;
    field public int theme;
    field public int uiOptions;
    field public int uid;
  }

  public static class ApplicationInfo.DisplayNameComparator implements java.util.Comparator {
    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, java.util.List<java.lang.String>);
    method public int describeContents();
    method 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 java.lang.String processName;
    field public java.lang.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 java.lang.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 public android.graphics.drawable.Drawable getProfileSwitchingIconDrawable(android.os.UserHandle);
    method public java.lang.CharSequence getProfileSwitchingLabel(android.os.UserHandle);
    method public java.util.List<android.os.UserHandle> getTargetUserProfiles();
    method public void startMainActivity(android.content.ComponentName, 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 java.lang.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 java.lang.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 java.lang.String dataDir;
    field public boolean functionalTest;
    field public boolean handleProfiling;
    field public java.lang.String publicSourceDir;
    field public java.lang.String sourceDir;
    field public java.lang.String[] splitNames;
    field public java.lang.String[] splitPublicSourceDirs;
    field public java.lang.String[] splitSourceDirs;
    field public java.lang.String targetPackage;
    field public java.lang.String targetProcesses;
  }

  public class LabeledIntent extends android.content.Intent {
    ctor public LabeledIntent(android.content.Intent, java.lang.String, int, int);
    ctor public LabeledIntent(android.content.Intent, java.lang.String, java.lang.CharSequence, int);
    ctor public LabeledIntent(java.lang.String, int, int);
    ctor public LabeledIntent(java.lang.String, java.lang.CharSequence, int);
    method public int getIconResource();
    method public int getLabelResource();
    method public java.lang.CharSequence getNonLocalizedLabel();
    method public java.lang.String getSourcePackage();
    method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager);
    method public java.lang.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 java.lang.CharSequence getLabel();
    method public java.lang.String getName();
    method public android.os.UserHandle getUser();
  }

  public class LauncherApps {
    method public java.util.List<android.content.pm.LauncherActivityInfo> getActivityList(java.lang.String, android.os.UserHandle);
    method public android.content.pm.ApplicationInfo getApplicationInfo(java.lang.String, int, 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 public android.content.IntentSender getShortcutConfigActivityIntent(android.content.pm.LauncherActivityInfo);
    method public java.util.List<android.content.pm.LauncherActivityInfo> getShortcutConfigActivityList(java.lang.String, android.os.UserHandle);
    method public android.graphics.drawable.Drawable getShortcutIconDrawable(android.content.pm.ShortcutInfo, int);
    method public java.util.List<android.content.pm.ShortcutInfo> getShortcuts(android.content.pm.LauncherApps.ShortcutQuery, android.os.UserHandle);
    method public android.os.Bundle getSuspendedPackageLauncherExtras(java.lang.String, android.os.UserHandle);
    method public boolean hasShortcutHostPermission();
    method public boolean isActivityEnabled(android.content.ComponentName, android.os.UserHandle);
    method public boolean isPackageEnabled(java.lang.String, android.os.UserHandle);
    method public void pinShortcuts(java.lang.String, java.util.List<java.lang.String>, 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(java.lang.String, java.lang.String, android.graphics.Rect, android.os.Bundle, android.os.UserHandle);
    method public void startShortcut(android.content.pm.ShortcutInfo, android.graphics.Rect, android.os.Bundle);
    method public void unregisterCallback(android.content.pm.LauncherApps.Callback);
    field public static final java.lang.String ACTION_CONFIRM_PIN_APPWIDGET = "android.content.pm.action.CONFIRM_PIN_APPWIDGET";
    field public static final java.lang.String ACTION_CONFIRM_PIN_SHORTCUT = "android.content.pm.action.CONFIRM_PIN_SHORTCUT";
    field public static final java.lang.String EXTRA_PIN_ITEM_REQUEST = "android.content.pm.extra.PIN_ITEM_REQUEST";
  }

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

  public static final class LauncherApps.PinItemRequest implements android.os.Parcelable {
    method public boolean accept(android.os.Bundle);
    method public boolean accept();
    method public int describeContents();
    method public android.appwidget.AppWidgetProviderInfo getAppWidgetProviderInfo(android.content.Context);
    method public android.os.Bundle getExtras();
    method public int getRequestType();
    method 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(android.content.ComponentName);
    method public android.content.pm.LauncherApps.ShortcutQuery setChangedSince(long);
    method public android.content.pm.LauncherApps.ShortcutQuery setPackage(java.lang.String);
    method public android.content.pm.LauncherApps.ShortcutQuery setQueryFlags(int);
    method public android.content.pm.LauncherApps.ShortcutQuery setShortcutIds(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 long lastUpdateTime;
    field public java.lang.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 java.lang.String[] requestedPermissions;
    field public int[] requestedPermissionsFlags;
    field public android.content.pm.ServiceInfo[] services;
    field public java.lang.String sharedUserId;
    field public int sharedUserLabel;
    field public deprecated android.content.pm.Signature[] signatures;
    field public android.content.pm.SigningInfo signingInfo;
    field public java.lang.String[] splitNames;
    field public int[] splitRevisionCodes;
    field public deprecated int versionCode;
    field public java.lang.String versionName;
  }

  public class PackageInstaller {
    method public void abandonSession(int);
    method public int createSession(android.content.pm.PackageInstaller.SessionParams) throws java.io.IOException;
    method public java.util.List<android.content.pm.PackageInstaller.SessionInfo> getAllSessions();
    method public java.util.List<android.content.pm.PackageInstaller.SessionInfo> getMySessions();
    method public android.content.pm.PackageInstaller.SessionInfo getSessionInfo(int);
    method public android.content.pm.PackageInstaller.Session openSession(int) throws java.io.IOException;
    method public void registerSessionCallback(android.content.pm.PackageInstaller.SessionCallback);
    method public void registerSessionCallback(android.content.pm.PackageInstaller.SessionCallback, android.os.Handler);
    method public void uninstall(java.lang.String, android.content.IntentSender);
    method public void uninstall(android.content.pm.VersionedPackage, android.content.IntentSender);
    method public void unregisterSessionCallback(android.content.pm.PackageInstaller.SessionCallback);
    method public void updateSessionAppIcon(int, android.graphics.Bitmap);
    method public void updateSessionAppLabel(int, java.lang.CharSequence);
    field public static final java.lang.String ACTION_SESSION_COMMITTED = "android.content.pm.action.SESSION_COMMITTED";
    field public static final java.lang.String ACTION_SESSION_DETAILS = "android.content.pm.action.SESSION_DETAILS";
    field public static final java.lang.String EXTRA_OTHER_PACKAGE_NAME = "android.content.pm.extra.OTHER_PACKAGE_NAME";
    field public static final java.lang.String EXTRA_PACKAGE_NAME = "android.content.pm.extra.PACKAGE_NAME";
    field public static final java.lang.String EXTRA_SESSION = "android.content.pm.extra.SESSION";
    field public static final java.lang.String EXTRA_SESSION_ID = "android.content.pm.extra.SESSION_ID";
    field public static final java.lang.String EXTRA_STATUS = "android.content.pm.extra.STATUS";
    field public static final java.lang.String EXTRA_STATUS_MESSAGE = "android.content.pm.extra.STATUS_MESSAGE";
    field public static final java.lang.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(android.content.IntentSender);
    method public void fsync(java.io.OutputStream) throws java.io.IOException;
    method public java.lang.String[] getNames() throws java.io.IOException;
    method public java.io.InputStream openRead(java.lang.String) throws java.io.IOException;
    method public java.io.OutputStream openWrite(java.lang.String, long, long) throws java.io.IOException;
    method public void removeSplit(java.lang.String) throws java.io.IOException;
    method public void setStagingProgress(float);
    method public void transfer(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
  }

  public static abstract 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 public android.content.Intent createDetailsIntent();
    method public int describeContents();
    method public android.graphics.Bitmap getAppIcon();
    method public java.lang.CharSequence getAppLabel();
    method public java.lang.String getAppPackageName();
    method public int getInstallLocation();
    method public int getInstallReason();
    method public java.lang.String getInstallerPackageName();
    method public int getMode();
    method public int getOriginatingUid();
    method public android.net.Uri getOriginatingUri();
    method public float getProgress();
    method 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(android.graphics.Bitmap);
    method public void setAppLabel(java.lang.CharSequence);
    method public void setAppPackageName(java.lang.String);
    method public void setInstallLocation(int);
    method public void setInstallReason(int);
    method public void setOriginatingUid(int);
    method public void setOriginatingUri(android.net.Uri);
    method public void setReferrerUri(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, java.lang.String);
    method protected void dumpFront(android.util.Printer, java.lang.String);
    method public android.graphics.drawable.Drawable loadBanner(android.content.pm.PackageManager);
    method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager);
    method public java.lang.CharSequence loadLabel(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, java.lang.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 java.lang.String name;
    field public java.lang.CharSequence nonLocalizedLabel;
    field public java.lang.String packageName;
  }

  public static class PackageItemInfo.DisplayNameComparator implements java.util.Comparator {
    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 public abstract deprecated void addPackageToPreferred(java.lang.String);
    method public abstract boolean addPermission(android.content.pm.PermissionInfo);
    method public abstract boolean addPermissionAsync(android.content.pm.PermissionInfo);
    method public abstract deprecated void addPreferredActivity(android.content.IntentFilter, int, android.content.ComponentName[], android.content.ComponentName);
    method public abstract boolean canRequestPackageInstalls();
    method public abstract java.lang.String[] canonicalToCurrentPackageNames(java.lang.String[]);
    method public abstract int checkPermission(java.lang.String, java.lang.String);
    method public abstract int checkSignatures(java.lang.String, java.lang.String);
    method public abstract int checkSignatures(int, int);
    method public abstract void clearInstantAppCookie();
    method public abstract void clearPackagePreferredActivities(java.lang.String);
    method public abstract java.lang.String[] currentToCanonicalPackageNames(java.lang.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(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract int getApplicationEnabledSetting(java.lang.String);
    method public abstract android.graphics.drawable.Drawable getApplicationIcon(android.content.pm.ApplicationInfo);
    method public abstract android.graphics.drawable.Drawable getApplicationIcon(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.pm.ApplicationInfo getApplicationInfo(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract java.lang.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(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.pm.ChangedPackages getChangedPackages(int);
    method public abstract int getComponentEnabledSetting(android.content.ComponentName);
    method public abstract android.graphics.drawable.Drawable getDefaultActivityIcon();
    method public abstract android.graphics.drawable.Drawable getDrawable(java.lang.String, 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 public abstract java.lang.String getInstallerPackageName(java.lang.String);
    method 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 public abstract android.content.Intent getLaunchIntentForPackage(java.lang.String);
    method public abstract android.content.Intent getLeanbackLaunchIntentForPackage(java.lang.String);
    method public abstract java.lang.String getNameForUid(int);
    method public android.content.pm.PackageInfo getPackageArchiveInfo(java.lang.String, int);
    method public abstract int[] getPackageGids(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract int[] getPackageGids(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.pm.PackageInfo getPackageInfo(java.lang.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 public abstract android.content.pm.PackageInstaller getPackageInstaller();
    method public abstract int getPackageUid(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract java.lang.String[] getPackagesForUid(int);
    method public abstract java.util.List<android.content.pm.PackageInfo> getPackagesHoldingPermissions(java.lang.String[], int);
    method public abstract android.content.pm.PermissionGroupInfo getPermissionGroupInfo(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.pm.PermissionInfo getPermissionInfo(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract int getPreferredActivities(java.util.List<android.content.IntentFilter>, java.util.List<android.content.ComponentName>, java.lang.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(java.lang.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 public abstract java.util.List<android.content.pm.SharedLibraryInfo> getSharedLibraries(int);
    method public android.os.Bundle getSuspendedPackageAppExtras();
    method public abstract android.content.pm.FeatureInfo[] getSystemAvailableFeatures();
    method public abstract java.lang.String[] getSystemSharedLibraryNames();
    method public abstract java.lang.CharSequence getText(java.lang.String, 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 java.lang.CharSequence getUserBadgedLabel(java.lang.CharSequence, android.os.UserHandle);
    method public abstract android.content.res.XmlResourceParser getXml(java.lang.String, int, android.content.pm.ApplicationInfo);
    method public boolean hasSigningCertificate(java.lang.String, byte[], int);
    method public boolean hasSigningCertificate(int, byte[], int);
    method public abstract boolean hasSystemFeature(java.lang.String);
    method public abstract boolean hasSystemFeature(java.lang.String, int);
    method public abstract boolean isInstantApp();
    method public abstract boolean isInstantApp(java.lang.String);
    method public boolean isPackageSuspended();
    method public abstract boolean isPermissionRevokedByPolicy(java.lang.String, java.lang.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(java.lang.String, int, int);
    method public abstract java.util.List<android.content.pm.InstrumentationInfo> queryInstrumentation(java.lang.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(android.content.ComponentName, 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(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract deprecated void removePackageFromPreferred(java.lang.String);
    method public abstract void removePermission(java.lang.String);
    method public abstract android.content.pm.ResolveInfo resolveActivity(android.content.Intent, int);
    method public abstract android.content.pm.ProviderInfo resolveContentProvider(java.lang.String, int);
    method public abstract android.content.pm.ResolveInfo resolveService(android.content.Intent, int);
    method public abstract void setApplicationCategoryHint(java.lang.String, int);
    method public abstract void setApplicationEnabledSetting(java.lang.String, int, int);
    method public abstract void setComponentEnabledSetting(android.content.ComponentName, int, int);
    method public abstract void setInstallerPackageName(java.lang.String, java.lang.String);
    method public abstract void updateInstantAppCookie(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 java.lang.String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID";
    field public static final java.lang.String EXTRA_VERIFICATION_RESULT = "android.content.pm.extra.VERIFICATION_RESULT";
    field public static final java.lang.String FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS = "android.software.activities_on_secondary_displays";
    field public static final java.lang.String FEATURE_APP_WIDGETS = "android.software.app_widgets";
    field public static final java.lang.String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency";
    field public static final java.lang.String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output";
    field public static final java.lang.String FEATURE_AUDIO_PRO = "android.hardware.audio.pro";
    field public static final java.lang.String FEATURE_AUTOFILL = "android.software.autofill";
    field public static final java.lang.String FEATURE_AUTOMOTIVE = "android.hardware.type.automotive";
    field public static final java.lang.String FEATURE_BACKUP = "android.software.backup";
    field public static final java.lang.String FEATURE_BLUETOOTH = "android.hardware.bluetooth";
    field public static final java.lang.String FEATURE_BLUETOOTH_LE = "android.hardware.bluetooth_le";
    field public static final java.lang.String FEATURE_CAMERA = "android.hardware.camera";
    field public static final java.lang.String FEATURE_CAMERA_ANY = "android.hardware.camera.any";
    field public static final java.lang.String FEATURE_CAMERA_AR = "android.hardware.camera.ar";
    field public static final java.lang.String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus";
    field public static final java.lang.String FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING = "android.hardware.camera.capability.manual_post_processing";
    field public static final java.lang.String FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR = "android.hardware.camera.capability.manual_sensor";
    field public static final java.lang.String FEATURE_CAMERA_CAPABILITY_RAW = "android.hardware.camera.capability.raw";
    field public static final java.lang.String FEATURE_CAMERA_EXTERNAL = "android.hardware.camera.external";
    field public static final java.lang.String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash";
    field public static final java.lang.String FEATURE_CAMERA_FRONT = "android.hardware.camera.front";
    field public static final java.lang.String FEATURE_CAMERA_LEVEL_FULL = "android.hardware.camera.level.full";
    field public static final java.lang.String FEATURE_CANT_SAVE_STATE = "android.software.cant_save_state";
    field public static final java.lang.String FEATURE_COMPANION_DEVICE_SETUP = "android.software.companion_device_setup";
    field public static final java.lang.String FEATURE_CONNECTION_SERVICE = "android.software.connectionservice";
    field public static final java.lang.String FEATURE_CONSUMER_IR = "android.hardware.consumerir";
    field public static final java.lang.String FEATURE_DEVICE_ADMIN = "android.software.device_admin";
    field public static final java.lang.String FEATURE_EMBEDDED = "android.hardware.type.embedded";
    field public static final java.lang.String FEATURE_ETHERNET = "android.hardware.ethernet";
    field public static final java.lang.String FEATURE_FAKETOUCH = "android.hardware.faketouch";
    field public static final java.lang.String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT = "android.hardware.faketouch.multitouch.distinct";
    field public static final java.lang.String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND = "android.hardware.faketouch.multitouch.jazzhand";
    field public static final java.lang.String FEATURE_FINGERPRINT = "android.hardware.fingerprint";
    field public static final java.lang.String FEATURE_FREEFORM_WINDOW_MANAGEMENT = "android.software.freeform_window_management";
    field public static final java.lang.String FEATURE_GAMEPAD = "android.hardware.gamepad";
    field public static final java.lang.String FEATURE_HIFI_SENSORS = "android.hardware.sensor.hifi_sensors";
    field public static final java.lang.String FEATURE_HOME_SCREEN = "android.software.home_screen";
    field public static final java.lang.String FEATURE_INPUT_METHODS = "android.software.input_methods";
    field public static final java.lang.String FEATURE_LEANBACK = "android.software.leanback";
    field public static final java.lang.String FEATURE_LEANBACK_ONLY = "android.software.leanback_only";
    field public static final java.lang.String FEATURE_LIVE_TV = "android.software.live_tv";
    field public static final java.lang.String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper";
    field public static final java.lang.String FEATURE_LOCATION = "android.hardware.location";
    field public static final java.lang.String FEATURE_LOCATION_GPS = "android.hardware.location.gps";
    field public static final java.lang.String FEATURE_LOCATION_NETWORK = "android.hardware.location.network";
    field public static final java.lang.String FEATURE_MANAGED_USERS = "android.software.managed_users";
    field public static final java.lang.String FEATURE_MICROPHONE = "android.hardware.microphone";
    field public static final java.lang.String FEATURE_MIDI = "android.software.midi";
    field public static final java.lang.String FEATURE_NFC = "android.hardware.nfc";
    field public static final java.lang.String FEATURE_NFC_HOST_CARD_EMULATION = "android.hardware.nfc.hce";
    field public static final java.lang.String FEATURE_NFC_HOST_CARD_EMULATION_NFCF = "android.hardware.nfc.hcef";
    field public static final java.lang.String FEATURE_OPENGLES_EXTENSION_PACK = "android.hardware.opengles.aep";
    field public static final java.lang.String FEATURE_PC = "android.hardware.type.pc";
    field public static final java.lang.String FEATURE_PICTURE_IN_PICTURE = "android.software.picture_in_picture";
    field public static final java.lang.String FEATURE_PRINTING = "android.software.print";
    field public static final java.lang.String FEATURE_RAM_LOW = "android.hardware.ram.low";
    field public static final java.lang.String FEATURE_RAM_NORMAL = "android.hardware.ram.normal";
    field public static final java.lang.String FEATURE_SCREEN_LANDSCAPE = "android.hardware.screen.landscape";
    field public static final java.lang.String FEATURE_SCREEN_PORTRAIT = "android.hardware.screen.portrait";
    field public static final java.lang.String FEATURE_SECURELY_REMOVES_USERS = "android.software.securely_removes_users";
    field public static final java.lang.String FEATURE_SENSOR_ACCELEROMETER = "android.hardware.sensor.accelerometer";
    field public static final java.lang.String FEATURE_SENSOR_AMBIENT_TEMPERATURE = "android.hardware.sensor.ambient_temperature";
    field public static final java.lang.String FEATURE_SENSOR_BAROMETER = "android.hardware.sensor.barometer";
    field public static final java.lang.String FEATURE_SENSOR_COMPASS = "android.hardware.sensor.compass";
    field public static final java.lang.String FEATURE_SENSOR_GYROSCOPE = "android.hardware.sensor.gyroscope";
    field public static final java.lang.String FEATURE_SENSOR_HEART_RATE = "android.hardware.sensor.heartrate";
    field public static final java.lang.String FEATURE_SENSOR_HEART_RATE_ECG = "android.hardware.sensor.heartrate.ecg";
    field public static final java.lang.String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light";
    field public static final java.lang.String FEATURE_SENSOR_PROXIMITY = "android.hardware.sensor.proximity";
    field public static final java.lang.String FEATURE_SENSOR_RELATIVE_HUMIDITY = "android.hardware.sensor.relative_humidity";
    field public static final java.lang.String FEATURE_SENSOR_STEP_COUNTER = "android.hardware.sensor.stepcounter";
    field public static final java.lang.String FEATURE_SENSOR_STEP_DETECTOR = "android.hardware.sensor.stepdetector";
    field public static final java.lang.String FEATURE_SIP = "android.software.sip";
    field public static final java.lang.String FEATURE_SIP_VOIP = "android.software.sip.voip";
    field public static final java.lang.String FEATURE_STRONGBOX_KEYSTORE = "android.hardware.strongbox_keystore";
    field public static final java.lang.String FEATURE_TELEPHONY = "android.hardware.telephony";
    field public static final java.lang.String FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma";
    field public static final java.lang.String FEATURE_TELEPHONY_EUICC = "android.hardware.telephony.euicc";
    field public static final java.lang.String FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm";
    field public static final java.lang.String FEATURE_TELEPHONY_MBMS = "android.hardware.telephony.mbms";
    field public static final deprecated java.lang.String FEATURE_TELEVISION = "android.hardware.type.television";
    field public static final java.lang.String FEATURE_TOUCHSCREEN = "android.hardware.touchscreen";
    field public static final java.lang.String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch";
    field public static final java.lang.String FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT = "android.hardware.touchscreen.multitouch.distinct";
    field public static final java.lang.String FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND = "android.hardware.touchscreen.multitouch.jazzhand";
    field public static final java.lang.String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory";
    field public static final java.lang.String FEATURE_USB_HOST = "android.hardware.usb.host";
    field public static final java.lang.String FEATURE_VERIFIED_BOOT = "android.software.verified_boot";
    field public static final java.lang.String FEATURE_VR_HEADTRACKING = "android.hardware.vr.headtracking";
    field public static final deprecated java.lang.String FEATURE_VR_MODE = "android.software.vr.mode";
    field public static final java.lang.String FEATURE_VR_MODE_HIGH_PERFORMANCE = "android.hardware.vr.high_performance";
    field public static final java.lang.String FEATURE_VULKAN_HARDWARE_COMPUTE = "android.hardware.vulkan.compute";
    field public static final java.lang.String FEATURE_VULKAN_HARDWARE_LEVEL = "android.hardware.vulkan.level";
    field public static final java.lang.String FEATURE_VULKAN_HARDWARE_VERSION = "android.hardware.vulkan.version";
    field public static final java.lang.String FEATURE_WATCH = "android.hardware.type.watch";
    field public static final java.lang.String FEATURE_WEBVIEW = "android.software.webview";
    field public static final java.lang.String FEATURE_WIFI = "android.hardware.wifi";
    field public static final java.lang.String FEATURE_WIFI_AWARE = "android.hardware.wifi.aware";
    field public static final java.lang.String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct";
    field public static final java.lang.String FEATURE_WIFI_PASSPOINT = "android.hardware.wifi.passpoint";
    field public static final java.lang.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 public static final deprecated int GET_DISABLED_COMPONENTS = 512; // 0x200
    field public static final deprecated 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 public static final deprecated int GET_SIGNATURES = 64; // 0x40
    field public static final int GET_SIGNING_CERTIFICATES = 134217728; // 0x8000000
    field public static final deprecated 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_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(java.lang.String);
  }

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

  public class PathPermission extends android.os.PatternMatcher {
    ctor public PathPermission(java.lang.String, int, java.lang.String, java.lang.String);
    ctor public PathPermission(android.os.Parcel);
    method public java.lang.String getReadPermission();
    method public java.lang.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 java.lang.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 java.lang.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 java.lang.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 public static final deprecated int PROTECTION_FLAG_SYSTEM = 16; // 0x10
    field public static final int PROTECTION_FLAG_VERIFIER = 512; // 0x200
    field public static final deprecated int PROTECTION_MASK_BASE = 15; // 0xf
    field public static final deprecated 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 public static final deprecated int PROTECTION_SIGNATURE_OR_SYSTEM = 3; // 0x3
    field public int descriptionRes;
    field public int flags;
    field public java.lang.String group;
    field public java.lang.CharSequence nonLocalizedDescription;
    field public deprecated 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, java.lang.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 java.lang.String authority;
    field public int flags;
    field public boolean grantUriPermissions;
    field public int initOrder;
    field public deprecated boolean isSyncable;
    field public boolean multiprocess;
    field public android.content.pm.PathPermission[] pathPermissions;
    field public java.lang.String readPermission;
    field public android.os.PatternMatcher[] uriPermissionPatterns;
    field public java.lang.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, java.lang.String);
    method public final int getIconResource();
    method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager);
    method public java.lang.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 java.lang.CharSequence nonLocalizedLabel;
    field public int preferredOrder;
    field public int priority;
    field public android.content.pm.ProviderInfo providerInfo;
    field public java.lang.String resolvePackageName;
    field public android.content.pm.ServiceInfo serviceInfo;
    field public int specificIndex;
  }

  public static class ResolveInfo.DisplayNameComparator implements java.util.Comparator {
    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, java.lang.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 java.lang.String permission;
  }

  public final class SharedLibraryInfo implements android.os.Parcelable {
    method public int describeContents();
    method public android.content.pm.VersionedPackage getDeclaringPackage();
    method public java.util.List<android.content.pm.VersionedPackage> getDependentPackages();
    method public long getLongVersion();
    method public java.lang.String getName();
    method public int getType();
    method public deprecated 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 public android.content.ComponentName getActivity();
    method public java.util.Set<java.lang.String> getCategories();
    method public java.lang.CharSequence getDisabledMessage();
    method public int getDisabledReason();
    method public android.os.PersistableBundle getExtras();
    method public java.lang.String getId();
    method public android.content.Intent getIntent();
    method public android.content.Intent[] getIntents();
    method public long getLastChangedTimestamp();
    method public java.lang.CharSequence getLongLabel();
    method public java.lang.String getPackage();
    method public int getRank();
    method public java.lang.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 java.lang.String SHORTCUT_CATEGORY_CONVERSATION = "android.shortcut.conversation";
  }

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

  public class ShortcutManager {
    method public boolean addDynamicShortcuts(java.util.List<android.content.pm.ShortcutInfo>);
    method public android.content.Intent createShortcutResultIntent(android.content.pm.ShortcutInfo);
    method public void disableShortcuts(java.util.List<java.lang.String>);
    method public void disableShortcuts(java.util.List<java.lang.String>, java.lang.CharSequence);
    method public void enableShortcuts(java.util.List<java.lang.String>);
    method public java.util.List<android.content.pm.ShortcutInfo> getDynamicShortcuts();
    method public int getIconMaxHeight();
    method public int getIconMaxWidth();
    method public java.util.List<android.content.pm.ShortcutInfo> getManifestShortcuts();
    method public int getMaxShortcutCountPerActivity();
    method 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(java.util.List<java.lang.String>);
    method public void reportShortcutUsed(java.lang.String);
    method public boolean requestPinShortcut(android.content.pm.ShortcutInfo, android.content.IntentSender);
    method public boolean setDynamicShortcuts(java.util.List<android.content.pm.ShortcutInfo>);
    method public boolean updateShortcuts(java.util.List<android.content.pm.ShortcutInfo>);
  }

  public class Signature implements android.os.Parcelable {
    ctor public Signature(byte[]);
    ctor public Signature(java.lang.String);
    method public int describeContents();
    method public byte[] toByteArray();
    method public char[] toChars();
    method public char[] toChars(char[], int[]);
    method public java.lang.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(java.lang.String, int);
    ctor public VersionedPackage(java.lang.String, long);
    method public int describeContents();
    method public long getLongVersionCode();
    method public java.lang.String getPackageName();
    method public deprecated 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;
    method public void mark(int);
  }

  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 java.lang.String[] getLocales();
    method public java.lang.String[] list(java.lang.String) throws java.io.IOException;
    method public java.io.InputStream open(java.lang.String) throws java.io.IOException;
    method public java.io.InputStream open(java.lang.String, int) throws java.io.IOException;
    method public android.content.res.AssetFileDescriptor openFd(java.lang.String) throws java.io.IOException;
    method public android.content.res.AssetFileDescriptor openNonAssetFd(java.lang.String) throws java.io.IOException;
    method public android.content.res.AssetFileDescriptor openNonAssetFd(int, java.lang.String) throws java.io.IOException;
    method public android.content.res.XmlResourceParser openXmlResourceParser(java.lang.String) throws java.io.IOException;
    method public android.content.res.XmlResourceParser openXmlResourceParser(int, java.lang.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 void mark(int);
    method public int read() throws java.io.IOException;
    method public void reset() throws java.io.IOException;
  }

  public class ColorStateList implements android.os.Parcelable {
    ctor public ColorStateList(int[][], int[]);
    method public static deprecated android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, 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(int[], int);
    method public int getDefaultColor();
    method public boolean isOpaque();
    method public boolean isStateful();
    method public static android.content.res.ColorStateList valueOf(int);
    method 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.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 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(java.util.Locale);
    method public void setLocales(android.os.LocaleList);
    method public void setTo(android.content.res.Configuration);
    method public void setToDefaults();
    method public int updateFrom(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 public static final deprecated 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 public static final deprecated 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 public deprecated 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 java.lang.String filename;
    field public int flags;
    field public java.lang.String packageName;
    field public int version;
  }

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

  public class Resources {
    ctor public deprecated Resources(android.content.res.AssetManager, android.util.DisplayMetrics, android.content.res.Configuration);
    method public final void finishPreloading();
    method public final void flushLayoutCache();
    method public android.content.res.XmlResourceParser getAnimation(int) throws android.content.res.Resources.NotFoundException;
    method public final android.content.res.AssetManager getAssets();
    method public boolean getBoolean(int) throws android.content.res.Resources.NotFoundException;
    method public deprecated int getColor(int) throws android.content.res.Resources.NotFoundException;
    method public int getColor(int, android.content.res.Resources.Theme) throws android.content.res.Resources.NotFoundException;
    method public deprecated android.content.res.ColorStateList getColorStateList(int) throws android.content.res.Resources.NotFoundException;
    method public android.content.res.ColorStateList getColorStateList(int, android.content.res.Resources.Theme) throws android.content.res.Resources.NotFoundException;
    method public android.content.res.Configuration getConfiguration();
    method public float getDimension(int) throws android.content.res.Resources.NotFoundException;
    method public int getDimensionPixelOffset(int) throws android.content.res.Resources.NotFoundException;
    method public int getDimensionPixelSize(int) throws android.content.res.Resources.NotFoundException;
    method public android.util.DisplayMetrics getDisplayMetrics();
    method public deprecated android.graphics.drawable.Drawable getDrawable(int) throws android.content.res.Resources.NotFoundException;
    method public android.graphics.drawable.Drawable getDrawable(int, android.content.res.Resources.Theme) throws android.content.res.Resources.NotFoundException;
    method public deprecated android.graphics.drawable.Drawable getDrawableForDensity(int, int) throws android.content.res.Resources.NotFoundException;
    method public android.graphics.drawable.Drawable getDrawableForDensity(int, int, android.content.res.Resources.Theme);
    method public android.graphics.Typeface getFont(int) throws android.content.res.Resources.NotFoundException;
    method public float getFraction(int, int, int);
    method public int getIdentifier(java.lang.String, java.lang.String, java.lang.String);
    method public int[] getIntArray(int) throws android.content.res.Resources.NotFoundException;
    method public int getInteger(int) throws android.content.res.Resources.NotFoundException;
    method public android.content.res.XmlResourceParser getLayout(int) throws android.content.res.Resources.NotFoundException;
    method public android.graphics.Movie getMovie(int) throws android.content.res.Resources.NotFoundException;
    method public java.lang.String getQuantityString(int, int, java.lang.Object...) throws android.content.res.Resources.NotFoundException;
    method public java.lang.String getQuantityString(int, int) throws android.content.res.Resources.NotFoundException;
    method public java.lang.CharSequence getQuantityText(int, int) throws android.content.res.Resources.NotFoundException;
    method public java.lang.String getResourceEntryName(int) throws android.content.res.Resources.NotFoundException;
    method public java.lang.String getResourceName(int) throws android.content.res.Resources.NotFoundException;
    method public java.lang.String getResourcePackageName(int) throws android.content.res.Resources.NotFoundException;
    method public java.lang.String getResourceTypeName(int) throws android.content.res.Resources.NotFoundException;
    method public java.lang.String getString(int) throws android.content.res.Resources.NotFoundException;
    method public java.lang.String getString(int, java.lang.Object...) throws android.content.res.Resources.NotFoundException;
    method public java.lang.String[] getStringArray(int) throws android.content.res.Resources.NotFoundException;
    method public static android.content.res.Resources getSystem();
    method public java.lang.CharSequence getText(int) throws android.content.res.Resources.NotFoundException;
    method public java.lang.CharSequence getText(int, java.lang.CharSequence);
    method public java.lang.CharSequence[] getTextArray(int) throws android.content.res.Resources.NotFoundException;
    method public void getValue(int, android.util.TypedValue, boolean) throws android.content.res.Resources.NotFoundException;
    method public void getValue(java.lang.String, android.util.TypedValue, boolean) throws android.content.res.Resources.NotFoundException;
    method public void getValueForDensity(int, int, android.util.TypedValue, boolean) throws android.content.res.Resources.NotFoundException;
    method public android.content.res.XmlResourceParser getXml(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, int[]);
    method public android.content.res.TypedArray obtainTypedArray(int) throws android.content.res.Resources.NotFoundException;
    method public java.io.InputStream openRawResource(int) throws android.content.res.Resources.NotFoundException;
    method public java.io.InputStream openRawResource(int, android.util.TypedValue) throws android.content.res.Resources.NotFoundException;
    method public android.content.res.AssetFileDescriptor openRawResourceFd(int) throws android.content.res.Resources.NotFoundException;
    method public void parseBundleExtra(java.lang.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 public deprecated 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(java.lang.String);
    ctor public Resources.NotFoundException(java.lang.String, java.lang.Exception);
  }

  public final class Resources.Theme {
    method public void applyStyle(int, boolean);
    method public void dump(int, java.lang.String, java.lang.String);
    method public int getChangingConfigurations();
    method public android.graphics.drawable.Drawable getDrawable(int) throws android.content.res.Resources.NotFoundException;
    method public android.content.res.Resources getResources();
    method public android.content.res.TypedArray obtainStyledAttributes(int[]);
    method public android.content.res.TypedArray obtainStyledAttributes(int, int[]) throws android.content.res.Resources.NotFoundException;
    method public android.content.res.TypedArray obtainStyledAttributes(android.util.AttributeSet, int[], int, 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(int, boolean);
    method public int getChangingConfigurations();
    method public int getColor(int, int);
    method public android.content.res.ColorStateList getColorStateList(int);
    method public float getDimension(int, float);
    method public int getDimensionPixelOffset(int, int);
    method public int getDimensionPixelSize(int, int);
    method public android.graphics.drawable.Drawable getDrawable(int);
    method public float getFloat(int, float);
    method public android.graphics.Typeface getFont(int);
    method public float getFraction(int, int, int, float);
    method public int getIndex(int);
    method public int getIndexCount();
    method public int getInt(int, int);
    method public int getInteger(int, int);
    method public int getLayoutDimension(int, java.lang.String);
    method public int getLayoutDimension(int, int);
    method public java.lang.String getNonResourceString(int);
    method public java.lang.String getPositionDescription();
    method public int getResourceId(int, int);
    method public android.content.res.Resources getResources();
    method public java.lang.String getString(int);
    method public java.lang.CharSequence getText(int);
    method public java.lang.CharSequence[] getTextArray(int);
    method public int getType(int);
    method public boolean getValue(int, android.util.TypedValue);
    method public boolean hasValue(int);
    method public boolean hasValueOrEmpty(int);
    method public int length();
    method public android.util.TypedValue peekValue(int);
    method public void recycle();
  }

  public abstract interface XmlResourceParser implements android.util.AttributeSet java.lang.AutoCloseable org.xmlpull.v1.XmlPullParser {
    method public abstract 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(java.lang.String);
    method public int getColumnIndexOrThrow(java.lang.String);
    method public java.lang.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 protected deprecated java.lang.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 protected deprecated 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 protected deprecated boolean mClosed;
    field protected deprecated android.content.ContentResolver mContentResolver;
    field protected deprecated 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 java.lang.String getString(int);
    method public boolean hasWindow();
    method public deprecated boolean isBlob(int);
    method public deprecated boolean isFloat(int);
    method public deprecated boolean isLong(int);
    method public boolean isNull(int);
    method public deprecated 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 {
    ctor public ContentObservable();
    method public deprecated void dispatchChange(boolean);
    method public void dispatchChange(boolean, android.net.Uri);
    method public deprecated 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 public final deprecated 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 abstract interface CrossProcessCursor implements android.database.Cursor {
    method public abstract void fillWindow(int, android.database.CursorWindow);
    method public abstract android.database.CursorWindow getWindow();
    method public abstract 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 abstract interface Cursor implements java.io.Closeable {
    method public abstract void close();
    method public abstract void copyStringToBuffer(int, android.database.CharArrayBuffer);
    method public abstract deprecated void deactivate();
    method public abstract byte[] getBlob(int);
    method public abstract int getColumnCount();
    method public abstract int getColumnIndex(java.lang.String);
    method public abstract int getColumnIndexOrThrow(java.lang.String) throws java.lang.IllegalArgumentException;
    method public abstract java.lang.String getColumnName(int);
    method public abstract java.lang.String[] getColumnNames();
    method public abstract int getCount();
    method public abstract double getDouble(int);
    method public abstract android.os.Bundle getExtras();
    method public abstract float getFloat(int);
    method public abstract int getInt(int);
    method public abstract long getLong(int);
    method public abstract android.net.Uri getNotificationUri();
    method public abstract int getPosition();
    method public abstract short getShort(int);
    method public abstract java.lang.String getString(int);
    method public abstract int getType(int);
    method public abstract boolean getWantsAllOnMoveCalls();
    method public abstract boolean isAfterLast();
    method public abstract boolean isBeforeFirst();
    method public abstract boolean isClosed();
    method public abstract boolean isFirst();
    method public abstract boolean isLast();
    method public abstract boolean isNull(int);
    method public abstract boolean move(int);
    method public abstract boolean moveToFirst();
    method public abstract boolean moveToLast();
    method public abstract boolean moveToNext();
    method public abstract boolean moveToPosition(int);
    method public abstract boolean moveToPrevious();
    method public abstract void registerContentObserver(android.database.ContentObserver);
    method public abstract void registerDataSetObserver(android.database.DataSetObserver);
    method public abstract deprecated boolean requery();
    method public abstract android.os.Bundle respond(android.os.Bundle);
    method public abstract void setExtras(android.os.Bundle);
    method public abstract void setNotificationUri(android.content.ContentResolver, android.net.Uri);
    method public abstract void unregisterContentObserver(android.database.ContentObserver);
    method public abstract 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(java.lang.String);
  }

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

  public static final class CursorJoiner.Result extends java.lang.Enum {
    method public static android.database.CursorJoiner.Result valueOf(java.lang.String);
    method public static final android.database.CursorJoiner.Result[] values();
    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(java.lang.String);
    ctor public CursorWindow(java.lang.String, long);
    ctor public deprecated 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 java.lang.String getString(int, int);
    method public int getType(int, int);
    method public deprecated boolean isBlob(int, int);
    method public deprecated boolean isFloat(int, int);
    method public deprecated boolean isLong(int, int);
    method public deprecated boolean isNull(int, int);
    method public deprecated 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(java.lang.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 public deprecated void deactivate();
    method public byte[] getBlob(int);
    method public int getColumnCount();
    method public int getColumnIndex(java.lang.String);
    method public int getColumnIndexOrThrow(java.lang.String) throws java.lang.IllegalArgumentException;
    method public java.lang.String getColumnName(int);
    method public java.lang.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 java.lang.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 public deprecated 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 {
    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 abstract interface DatabaseErrorHandler {
    method public abstract void onCorruption(android.database.sqlite.SQLiteDatabase);
  }

  public class DatabaseUtils {
    ctor public DatabaseUtils();
    method public static void appendEscapedSQLString(java.lang.StringBuilder, java.lang.String);
    method public static java.lang.String[] appendSelectionArgs(java.lang.String[], java.lang.String[]);
    method public static final void appendValueToSql(java.lang.StringBuilder, java.lang.Object);
    method public static void bindObjectToProgram(android.database.sqlite.SQLiteProgram, int, java.lang.Object);
    method public static android.os.ParcelFileDescriptor blobFileDescriptorForQuery(android.database.sqlite.SQLiteDatabase, java.lang.String, java.lang.String[]);
    method public static android.os.ParcelFileDescriptor blobFileDescriptorForQuery(android.database.sqlite.SQLiteStatement, java.lang.String[]);
    method public static java.lang.String concatenateWhere(java.lang.String, java.lang.String);
    method public static void createDbFromSqlStatements(android.content.Context, java.lang.String, int, java.lang.String);
    method public static void cursorDoubleToContentValues(android.database.Cursor, java.lang.String, android.content.ContentValues, java.lang.String);
    method public static void cursorDoubleToContentValuesIfPresent(android.database.Cursor, android.content.ContentValues, java.lang.String);
    method public static void cursorDoubleToCursorValues(android.database.Cursor, java.lang.String, android.content.ContentValues);
    method public static void cursorFloatToContentValuesIfPresent(android.database.Cursor, android.content.ContentValues, java.lang.String);
    method public static void cursorIntToContentValues(android.database.Cursor, java.lang.String, android.content.ContentValues);
    method public static void cursorIntToContentValues(android.database.Cursor, java.lang.String, android.content.ContentValues, java.lang.String);
    method public static void cursorIntToContentValuesIfPresent(android.database.Cursor, android.content.ContentValues, java.lang.String);
    method public static void cursorLongToContentValues(android.database.Cursor, java.lang.String, android.content.ContentValues);
    method public static void cursorLongToContentValues(android.database.Cursor, java.lang.String, android.content.ContentValues, java.lang.String);
    method public static void cursorLongToContentValuesIfPresent(android.database.Cursor, android.content.ContentValues, java.lang.String);
    method public static void cursorRowToContentValues(android.database.Cursor, android.content.ContentValues);
    method public static void cursorShortToContentValuesIfPresent(android.database.Cursor, android.content.ContentValues, java.lang.String);
    method public static void cursorStringToContentValues(android.database.Cursor, java.lang.String, android.content.ContentValues);
    method public static void cursorStringToContentValues(android.database.Cursor, java.lang.String, android.content.ContentValues, java.lang.String);
    method public static void cursorStringToContentValuesIfPresent(android.database.Cursor, android.content.ContentValues, java.lang.String);
    method public static void cursorStringToInsertHelper(android.database.Cursor, java.lang.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, java.lang.StringBuilder);
    method public static java.lang.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, java.lang.StringBuilder);
    method public static java.lang.String dumpCursorToString(android.database.Cursor);
    method public static java.lang.String getCollationKey(java.lang.String);
    method public static java.lang.String getHexCollationKey(java.lang.String);
    method public static int getSqlStatementType(java.lang.String);
    method public static long longForQuery(android.database.sqlite.SQLiteDatabase, java.lang.String, java.lang.String[]);
    method public static long longForQuery(android.database.sqlite.SQLiteStatement, java.lang.String[]);
    method public static long queryNumEntries(android.database.sqlite.SQLiteDatabase, java.lang.String);
    method public static long queryNumEntries(android.database.sqlite.SQLiteDatabase, java.lang.String, java.lang.String);
    method public static long queryNumEntries(android.database.sqlite.SQLiteDatabase, java.lang.String, java.lang.String, java.lang.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 java.lang.String sqlEscapeString(java.lang.String);
    method public static java.lang.String stringForQuery(android.database.sqlite.SQLiteDatabase, java.lang.String, java.lang.String[]);
    method public static java.lang.String stringForQuery(android.database.sqlite.SQLiteStatement, java.lang.String[]);
    method public static final void writeExceptionToParcel(android.os.Parcel, java.lang.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
  }

  public static deprecated class DatabaseUtils.InsertHelper {
    ctor public DatabaseUtils.InsertHelper(android.database.sqlite.SQLiteDatabase, java.lang.String);
    method public void bind(int, double);
    method public void bind(int, float);
    method public void bind(int, long);
    method public void bind(int, int);
    method public void bind(int, boolean);
    method public void bind(int, byte[]);
    method public void bind(int, java.lang.String);
    method public void bindNull(int);
    method public void close();
    method public long execute();
    method public int getColumnIndex(java.lang.String);
    method public long insert(android.content.ContentValues);
    method public void prepareForInsert();
    method public void prepareForReplace();
    method 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(java.lang.String[], int);
    ctor public MatrixCursor(java.lang.String[]);
    method public void addRow(java.lang.Object[]);
    method public void addRow(java.lang.Iterable<?>);
    method public java.lang.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 java.lang.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(java.lang.Object);
    method public android.database.MatrixCursor.RowBuilder add(java.lang.String, java.lang.Object);
  }

  public class MergeCursor extends android.database.AbstractCursor {
    ctor public MergeCursor(android.database.Cursor[]);
    method public java.lang.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 java.lang.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(java.lang.String);
    ctor public SQLException(java.lang.String, java.lang.Throwable);
  }

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

}

package android.database.sqlite {

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

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

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

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

  public class SQLiteCantOpenDatabaseException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteCantOpenDatabaseException();
    ctor public SQLiteCantOpenDatabaseException(java.lang.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 protected deprecated void onAllReferencesReleasedFromContainer();
    method public void releaseReference();
    method public deprecated void releaseReferenceFromContainer();
  }

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

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

  public abstract interface SQLiteCursorDriver {
    method public abstract void cursorClosed();
    method public abstract void cursorDeactivated();
    method public abstract void cursorRequeried(android.database.Cursor);
    method public abstract android.database.Cursor query(android.database.sqlite.SQLiteDatabase.CursorFactory, java.lang.String[]);
    method public abstract void setBindArguments(java.lang.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(java.lang.String) throws android.database.SQLException;
    method public static android.database.sqlite.SQLiteDatabase create(android.database.sqlite.SQLiteDatabase.CursorFactory);
    method public static android.database.sqlite.SQLiteDatabase createInMemory(android.database.sqlite.SQLiteDatabase.OpenParams);
    method public int delete(java.lang.String, java.lang.String, java.lang.String[]);
    method public static boolean deleteDatabase(java.io.File);
    method public void disableWriteAheadLogging();
    method public boolean enableWriteAheadLogging();
    method public void endTransaction();
    method public void execSQL(java.lang.String) throws android.database.SQLException;
    method public void execSQL(java.lang.String, java.lang.Object[]) throws android.database.SQLException;
    method public static java.lang.String findEditTable(java.lang.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 java.lang.String getPath();
    method public deprecated java.util.Map<java.lang.String, java.lang.String> getSyncedTables();
    method public int getVersion();
    method public boolean inTransaction();
    method public long insert(java.lang.String, java.lang.String, android.content.ContentValues);
    method public long insertOrThrow(java.lang.String, java.lang.String, android.content.ContentValues) throws android.database.SQLException;
    method public long insertWithOnConflict(java.lang.String, java.lang.String, android.content.ContentValues, int);
    method public boolean isDatabaseIntegrityOk();
    method public boolean isDbLockedByCurrentThread();
    method public deprecated boolean isDbLockedByOtherThreads();
    method public boolean isOpen();
    method public boolean isReadOnly();
    method public boolean isWriteAheadLoggingEnabled();
    method public deprecated void markTableSyncable(java.lang.String, java.lang.String);
    method public deprecated void markTableSyncable(java.lang.String, java.lang.String, java.lang.String);
    method public boolean needUpgrade(int);
    method protected void onAllReferencesReleased();
    method public static android.database.sqlite.SQLiteDatabase openDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, int);
    method public static android.database.sqlite.SQLiteDatabase openDatabase(java.io.File, android.database.sqlite.SQLiteDatabase.OpenParams);
    method public static android.database.sqlite.SQLiteDatabase openDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, int, android.database.DatabaseErrorHandler);
    method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.io.File, android.database.sqlite.SQLiteDatabase.CursorFactory);
    method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory);
    method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, android.database.DatabaseErrorHandler);
    method public android.database.Cursor query(boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public android.database.Cursor query(boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String, android.os.CancellationSignal);
    method public android.database.Cursor query(java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String);
    method public android.database.Cursor query(java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public android.database.Cursor queryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public android.database.Cursor queryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String, android.os.CancellationSignal);
    method public android.database.Cursor rawQuery(java.lang.String, java.lang.String[]);
    method public android.database.Cursor rawQuery(java.lang.String, java.lang.String[], android.os.CancellationSignal);
    method public android.database.Cursor rawQueryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, java.lang.String, java.lang.String[], java.lang.String);
    method public android.database.Cursor rawQueryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, java.lang.String, java.lang.String[], java.lang.String, android.os.CancellationSignal);
    method public static int releaseMemory();
    method public long replace(java.lang.String, java.lang.String, android.content.ContentValues);
    method public long replaceOrThrow(java.lang.String, java.lang.String, android.content.ContentValues) throws android.database.SQLException;
    method public void setForeignKeyConstraintsEnabled(boolean);
    method public void setLocale(java.util.Locale);
    method public deprecated 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(java.lang.String, android.content.ContentValues, java.lang.String, java.lang.String[]);
    method public int updateWithOnConflict(java.lang.String, android.content.ContentValues, java.lang.String, java.lang.String[], int);
    method public void validateSql(java.lang.String, android.os.CancellationSignal);
    method public deprecated 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 abstract interface SQLiteDatabase.CursorFactory {
    method public abstract android.database.Cursor newCursor(android.database.sqlite.SQLiteDatabase, android.database.sqlite.SQLiteCursorDriver, java.lang.String, android.database.sqlite.SQLiteQuery);
  }

  public static final class SQLiteDatabase.OpenParams {
    method public android.database.sqlite.SQLiteDatabase.CursorFactory getCursorFactory();
    method public android.database.DatabaseErrorHandler getErrorHandler();
    method public long getIdleConnectionTimeout();
    method public java.lang.String getJournalMode();
    method public int getLookasideSlotCount();
    method public int getLookasideSlotSize();
    method public int getOpenFlags();
    method public java.lang.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 public android.database.sqlite.SQLiteDatabase.OpenParams.Builder addOpenFlags(int);
    method public android.database.sqlite.SQLiteDatabase.OpenParams build();
    method public android.database.sqlite.SQLiteDatabase.OpenParams.Builder removeOpenFlags(int);
    method public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setCursorFactory(android.database.sqlite.SQLiteDatabase.CursorFactory);
    method public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setErrorHandler(android.database.DatabaseErrorHandler);
    method public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setIdleConnectionTimeout(long);
    method public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setJournalMode(java.lang.String);
    method public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setLookasideConfig(int, int);
    method public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setOpenFlags(int);
    method public android.database.sqlite.SQLiteDatabase.OpenParams.Builder setSynchronousMode(java.lang.String);
  }

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

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

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

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

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

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

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

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

  public abstract class SQLiteOpenHelper {
    ctor public SQLiteOpenHelper(android.content.Context, java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, int);
    ctor public SQLiteOpenHelper(android.content.Context, java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, int, android.database.DatabaseErrorHandler);
    ctor public SQLiteOpenHelper(android.content.Context, java.lang.String, int, android.database.sqlite.SQLiteDatabase.OpenParams);
    method public synchronized void close();
    method public java.lang.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(long);
    method public void setLookasideConfig(int, int);
    method public void setOpenParams(android.database.sqlite.SQLiteDatabase.OpenParams);
    method public void setWriteAheadLoggingEnabled(boolean);
  }

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

  public abstract class SQLiteProgram extends android.database.sqlite.SQLiteClosable {
    method public void bindAllArgsAsStrings(java.lang.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, java.lang.String);
    method public void clearBindings();
    method public final deprecated 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(java.lang.StringBuilder, java.lang.String[]);
    method public void appendWhere(java.lang.CharSequence);
    method public void appendWhereEscapeString(java.lang.String);
    method public java.lang.String buildQuery(java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public deprecated java.lang.String buildQuery(java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public static java.lang.String buildQueryString(boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public java.lang.String buildUnionQuery(java.lang.String[], java.lang.String, java.lang.String);
    method public java.lang.String buildUnionSubQuery(java.lang.String, java.lang.String[], java.util.Set<java.lang.String>, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public deprecated java.lang.String buildUnionSubQuery(java.lang.String, java.lang.String[], java.util.Set<java.lang.String>, int, java.lang.String, java.lang.String, java.lang.String[], java.lang.String, java.lang.String);
    method public java.lang.String getTables();
    method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String);
    method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.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(java.lang.String);
  }

  public class SQLiteReadOnlyDatabaseException extends android.database.sqlite.SQLiteException {
    ctor public SQLiteReadOnlyDatabaseException();
    ctor public SQLiteReadOnlyDatabaseException(java.lang.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 java.lang.String simpleQueryForString();
  }

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

  public abstract interface SQLiteTransactionListener {
    method public abstract void onBegin();
    method public abstract void onCommit();
    method public abstract 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, java.lang.String);
    ctor public DrmErrorEvent(int, int, java.lang.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, java.lang.String, java.util.HashMap<java.lang.String, java.lang.Object>);
    ctor protected DrmEvent(int, int, java.lang.String);
    method public java.lang.Object getAttribute(java.lang.String);
    method public java.lang.String getMessage();
    method public int getType();
    method public int getUniqueId();
    field public static final java.lang.String DRM_INFO_OBJECT = "drm_info_object";
    field public static final java.lang.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[], java.lang.String);
    ctor public DrmInfo(int, java.lang.String, java.lang.String);
    method public java.lang.Object get(java.lang.String);
    method public byte[] getData();
    method public int getInfoType();
    method public java.lang.String getMimeType();
    method public java.util.Iterator<java.lang.Object> iterator();
    method public java.util.Iterator<java.lang.String> keyIterator();
    method public void put(java.lang.String, java.lang.Object);
  }

  public class DrmInfoEvent extends android.drm.DrmEvent {
    ctor public DrmInfoEvent(int, int, java.lang.String);
    ctor public DrmInfoEvent(int, int, java.lang.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, java.lang.String);
    method public java.lang.Object get(java.lang.String);
    method public int getInfoType();
    method public java.lang.String getMimeType();
    method public java.util.Iterator<java.lang.Object> iterator();
    method public java.util.Iterator<java.lang.String> keyIterator();
    method public void put(java.lang.String, java.lang.Object);
    field public static final java.lang.String ACCOUNT_ID = "account_id";
    field public static final java.lang.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, java.lang.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 java.lang.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(java.lang.String, java.lang.String);
    method public boolean canHandle(android.net.Uri, java.lang.String);
    method public int checkRightsStatus(java.lang.String);
    method public int checkRightsStatus(android.net.Uri);
    method public int checkRightsStatus(java.lang.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 java.lang.String[] getAvailableDrmEngines();
    method public android.content.ContentValues getConstraints(java.lang.String, int);
    method public android.content.ContentValues getConstraints(android.net.Uri, int);
    method public int getDrmObjectType(java.lang.String, java.lang.String);
    method public int getDrmObjectType(android.net.Uri, java.lang.String);
    method public android.content.ContentValues getMetadata(java.lang.String);
    method public android.content.ContentValues getMetadata(android.net.Uri);
    method public java.lang.String getOriginalMimeType(java.lang.String);
    method public java.lang.String getOriginalMimeType(android.net.Uri);
    method public int openConvertSession(java.lang.String);
    method public int processDrmInfo(android.drm.DrmInfo);
    method public deprecated void release();
    method public int removeAllRights();
    method public int removeRights(java.lang.String);
    method public int removeRights(android.net.Uri);
    method public int saveRights(android.drm.DrmRights, java.lang.String, java.lang.String) throws java.io.IOException;
    method public synchronized void setOnErrorListener(android.drm.DrmManagerClient.OnErrorListener);
    method public synchronized void setOnEventListener(android.drm.DrmManagerClient.OnEventListener);
    method public synchronized 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 abstract interface DrmManagerClient.OnErrorListener {
    method public abstract void onError(android.drm.DrmManagerClient, android.drm.DrmErrorEvent);
  }

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

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

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

  public class DrmStore {
    ctor public deprecated DrmStore();
  }

  public static class DrmStore.Action {
    ctor public deprecated 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 abstract interface DrmStore.ConstraintsColumns {
    field public static final java.lang.String EXTENDED_METADATA = "extended_metadata";
    field public static final java.lang.String LICENSE_AVAILABLE_TIME = "license_available_time";
    field public static final java.lang.String LICENSE_EXPIRY_TIME = "license_expiry_time";
    field public static final java.lang.String LICENSE_START_TIME = "license_start_time";
    field public static final java.lang.String MAX_REPEAT_COUNT = "max_repeat_count";
    field public static final java.lang.String REMAINING_REPEAT_COUNT = "remaining_repeat_count";
  }

  public static class DrmStore.DrmObjectType {
    ctor public deprecated 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 public deprecated 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 public deprecated 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(java.lang.String);
    method public void addMimeType(java.lang.String);
    method public deprecated java.lang.String getDescriprition();
    method public java.lang.String getDescription();
    method public java.util.Iterator<java.lang.String> getFileSuffixIterator();
    method public java.util.Iterator<java.lang.String> getMimeTypeIterator();
    method public void setDescription(java.lang.String);
  }

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

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

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

}

package android.gesture {

  public class Gesture implements android.os.Parcelable {
    ctor public Gesture();
    method public void addStroke(android.gesture.GestureStroke);
    method public java.lang.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(java.lang.String);
    method public static android.gesture.GestureLibrary fromFile(java.io.File);
    method public static android.gesture.GestureLibrary fromPrivateFile(android.content.Context, java.lang.String);
    method public static android.gesture.GestureLibrary fromRawResource(android.content.Context, int);
  }

  public abstract class GestureLibrary {
    ctor protected GestureLibrary();
    method public void addGesture(java.lang.String, android.gesture.Gesture);
    method public java.util.Set<java.lang.String> getGestureEntries();
    method public java.util.ArrayList<android.gesture.Gesture> getGestures(java.lang.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(java.lang.String);
    method public void removeGesture(java.lang.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 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 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(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(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 abstract interface GestureOverlayView.OnGestureListener {
    method public abstract void onGesture(android.gesture.GestureOverlayView, android.view.MotionEvent);
    method public abstract void onGestureCancelled(android.gesture.GestureOverlayView, android.view.MotionEvent);
    method public abstract void onGestureEnded(android.gesture.GestureOverlayView, android.view.MotionEvent);
    method public abstract void onGestureStarted(android.gesture.GestureOverlayView, android.view.MotionEvent);
  }

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

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

  public class GesturePoint {
    ctor public GesturePoint(float, float, long);
    method public java.lang.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(java.lang.String, android.gesture.Gesture);
    method public java.util.Set<java.lang.String> getGestureEntries();
    method public java.util.ArrayList<android.gesture.Gesture> getGestures(java.lang.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(java.lang.String);
    method public void removeGesture(java.lang.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 java.lang.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 java.lang.String name;
    field public double score;
  }

}

package android.graphics {

  public final class Bitmap implements android.os.Parcelable {
    method 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(android.graphics.Bitmap);
    method public static android.graphics.Bitmap createBitmap(android.graphics.Bitmap, int, int, int, int);
    method public static android.graphics.Bitmap createBitmap(android.graphics.Bitmap, int, int, int, int, android.graphics.Matrix, boolean);
    method public static android.graphics.Bitmap createBitmap(int, int, android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createBitmap(android.util.DisplayMetrics, int, int, android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createBitmap(int, int, android.graphics.Bitmap.Config, boolean);
    method public static android.graphics.Bitmap createBitmap(int, int, android.graphics.Bitmap.Config, boolean, android.graphics.ColorSpace);
    method public static android.graphics.Bitmap createBitmap(android.util.DisplayMetrics, int, int, android.graphics.Bitmap.Config, boolean);
    method public static android.graphics.Bitmap createBitmap(android.util.DisplayMetrics, int, int, android.graphics.Bitmap.Config, boolean, android.graphics.ColorSpace);
    method public static android.graphics.Bitmap createBitmap(int[], int, int, int, int, android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createBitmap(android.util.DisplayMetrics, int[], int, int, int, int, android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createBitmap(int[], int, int, android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createBitmap(android.util.DisplayMetrics, int[], int, int, android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createBitmap(android.graphics.Picture);
    method public static android.graphics.Bitmap createBitmap(android.graphics.Picture, int, int, android.graphics.Bitmap.Config);
    method public static android.graphics.Bitmap createScaledBitmap(android.graphics.Bitmap, int, int, boolean);
    method public int describeContents();
    method public void eraseColor(int);
    method public android.graphics.Bitmap extractAlpha();
    method public android.graphics.Bitmap extractAlpha(android.graphics.Paint, int[]);
    method public int getAllocationByteCount();
    method public int getByteCount();
    method 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 public int getPixel(int, int);
    method public void getPixels(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, int);
    method public void setPixels(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 static final class Bitmap.CompressFormat extends java.lang.Enum {
    method public static android.graphics.Bitmap.CompressFormat valueOf(java.lang.String);
    method public static final android.graphics.Bitmap.CompressFormat[] values();
    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 static final class Bitmap.Config extends java.lang.Enum {
    method public static android.graphics.Bitmap.Config valueOf(java.lang.String);
    method public static final android.graphics.Bitmap.Config[] values();
    enum_constant public static final android.graphics.Bitmap.Config ALPHA_8;
    enum_constant public static final deprecated 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(java.lang.String, android.graphics.BitmapFactory.Options);
    method public static android.graphics.Bitmap decodeFile(java.lang.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 public static android.graphics.Bitmap decodeResourceStream(android.content.res.Resources, android.util.TypedValue, java.io.InputStream, android.graphics.Rect, android.graphics.BitmapFactory.Options);
    method public static android.graphics.Bitmap decodeStream(java.io.InputStream, android.graphics.Rect, android.graphics.BitmapFactory.Options);
    method public static android.graphics.Bitmap decodeStream(java.io.InputStream);
  }

  public static class BitmapFactory.Options {
    ctor public BitmapFactory.Options();
    method public deprecated void requestCancelDecode();
    field public android.graphics.Bitmap inBitmap;
    field public int inDensity;
    field public deprecated boolean inDither;
    field public deprecated boolean inInputShareable;
    field public boolean inJustDecodeBounds;
    field public boolean inMutable;
    field public deprecated boolean inPreferQualityOverSpeed;
    field public android.graphics.ColorSpace inPreferredColorSpace;
    field public android.graphics.Bitmap.Config inPreferredConfig;
    field public boolean inPremultiplied;
    field public deprecated boolean inPurgeable;
    field public int inSampleSize;
    field public boolean inScaled;
    field public int inScreenDensity;
    field public int inTargetDensity;
    field public byte[] inTempStorage;
    field public deprecated boolean mCancel;
    field public android.graphics.ColorSpace outColorSpace;
    field public android.graphics.Bitmap.Config outConfig;
    field public int outHeight;
    field public java.lang.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(java.lang.String, boolean) throws java.io.IOException;
    method public void recycle();
  }

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

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

  public static final class BlurMaskFilter.Blur extends java.lang.Enum {
    method public static android.graphics.BlurMaskFilter.Blur valueOf(java.lang.String);
    method public static final android.graphics.BlurMaskFilter.Blur[] values();
    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(android.graphics.Bitmap);
    method public boolean clipOutPath(android.graphics.Path);
    method public boolean clipOutRect(android.graphics.RectF);
    method public boolean clipOutRect(android.graphics.Rect);
    method public boolean clipOutRect(float, float, float, float);
    method public boolean clipOutRect(int, int, int, int);
    method public deprecated boolean clipPath(android.graphics.Path, android.graphics.Region.Op);
    method public boolean clipPath(android.graphics.Path);
    method public deprecated boolean clipRect(android.graphics.RectF, android.graphics.Region.Op);
    method public deprecated boolean clipRect(android.graphics.Rect, android.graphics.Region.Op);
    method public boolean clipRect(android.graphics.RectF);
    method public boolean clipRect(android.graphics.Rect);
    method public deprecated boolean clipRect(float, float, float, float, android.graphics.Region.Op);
    method public boolean clipRect(float, float, float, float);
    method public boolean clipRect(int, int, int, int);
    method public void concat(android.graphics.Matrix);
    method public void drawARGB(int, int, int, int);
    method public void drawArc(android.graphics.RectF, float, float, boolean, android.graphics.Paint);
    method public void drawArc(float, float, float, float, float, float, boolean, android.graphics.Paint);
    method public void drawBitmap(android.graphics.Bitmap, float, float, android.graphics.Paint);
    method public void drawBitmap(android.graphics.Bitmap, android.graphics.Rect, android.graphics.RectF, android.graphics.Paint);
    method public void drawBitmap(android.graphics.Bitmap, android.graphics.Rect, android.graphics.Rect, android.graphics.Paint);
    method public deprecated void drawBitmap(int[], int, int, float, float, int, int, boolean, android.graphics.Paint);
    method public deprecated void drawBitmap(int[], int, int, int, int, int, int, boolean, android.graphics.Paint);
    method public void drawBitmap(android.graphics.Bitmap, android.graphics.Matrix, android.graphics.Paint);
    method public void drawBitmapMesh(android.graphics.Bitmap, int, int, float[], int, int[], int, android.graphics.Paint);
    method public void drawCircle(float, float, float, android.graphics.Paint);
    method public void drawColor(int);
    method public void drawColor(int, android.graphics.PorterDuff.Mode);
    method public void drawLine(float, float, float, float, android.graphics.Paint);
    method public void drawLines(float[], int, int, android.graphics.Paint);
    method public void drawLines(float[], android.graphics.Paint);
    method public void drawOval(android.graphics.RectF, android.graphics.Paint);
    method public void drawOval(float, float, float, float, android.graphics.Paint);
    method public void drawPaint(android.graphics.Paint);
    method public void drawPath(android.graphics.Path, android.graphics.Paint);
    method public void drawPicture(android.graphics.Picture);
    method public void drawPicture(android.graphics.Picture, android.graphics.RectF);
    method public void drawPicture(android.graphics.Picture, android.graphics.Rect);
    method public void drawPoint(float, float, android.graphics.Paint);
    method public void drawPoints(float[], int, int, android.graphics.Paint);
    method public void drawPoints(float[], android.graphics.Paint);
    method public deprecated void drawPosText(char[], int, int, float[], android.graphics.Paint);
    method public deprecated void drawPosText(java.lang.String, float[], android.graphics.Paint);
    method public void drawRGB(int, int, int);
    method public void drawRect(android.graphics.RectF, android.graphics.Paint);
    method public void drawRect(android.graphics.Rect, android.graphics.Paint);
    method public void drawRect(float, float, float, float, android.graphics.Paint);
    method public void drawRoundRect(android.graphics.RectF, float, float, android.graphics.Paint);
    method public void drawRoundRect(float, float, float, float, float, float, android.graphics.Paint);
    method public void drawText(char[], int, int, float, float, android.graphics.Paint);
    method public void drawText(java.lang.String, float, float, android.graphics.Paint);
    method public void drawText(java.lang.String, int, int, float, float, android.graphics.Paint);
    method public void drawText(java.lang.CharSequence, int, int, float, float, android.graphics.Paint);
    method public void drawTextOnPath(char[], int, int, android.graphics.Path, float, float, android.graphics.Paint);
    method public void drawTextOnPath(java.lang.String, android.graphics.Path, float, float, android.graphics.Paint);
    method public void drawTextRun(char[], int, int, int, int, float, float, boolean, android.graphics.Paint);
    method public void drawTextRun(java.lang.CharSequence, int, int, int, int, float, float, boolean, android.graphics.Paint);
    method public void drawVertices(android.graphics.Canvas.VertexMode, int, float[], int, float[], int, int[], int, short[], int, int, android.graphics.Paint);
    method public boolean getClipBounds(android.graphics.Rect);
    method public final android.graphics.Rect getClipBounds();
    method public int getDensity();
    method public android.graphics.DrawFilter getDrawFilter();
    method public int getHeight();
    method public deprecated void getMatrix(android.graphics.Matrix);
    method public final deprecated 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(android.graphics.RectF, android.graphics.Canvas.EdgeType);
    method public boolean quickReject(android.graphics.Path, android.graphics.Canvas.EdgeType);
    method public boolean quickReject(float, float, float, float, 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 public deprecated int saveLayer(android.graphics.RectF, android.graphics.Paint, int);
    method public int saveLayer(android.graphics.RectF, android.graphics.Paint);
    method public deprecated int saveLayer(float, float, float, float, android.graphics.Paint, int);
    method public int saveLayer(float, float, float, float, android.graphics.Paint);
    method public deprecated int saveLayerAlpha(android.graphics.RectF, int, int);
    method public int saveLayerAlpha(android.graphics.RectF, int);
    method public deprecated 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(android.graphics.Bitmap);
    method public void setDensity(int);
    method public void setDrawFilter(android.graphics.DrawFilter);
    method public void setMatrix(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 static final class Canvas.EdgeType extends java.lang.Enum {
    method public static android.graphics.Canvas.EdgeType valueOf(java.lang.String);
    method public static final android.graphics.Canvas.EdgeType[] values();
    enum_constant public static final android.graphics.Canvas.EdgeType AA;
    enum_constant public static final android.graphics.Canvas.EdgeType BW;
  }

  public static final class Canvas.VertexMode extends java.lang.Enum {
    method public static android.graphics.Canvas.VertexMode valueOf(java.lang.String);
    method public static final android.graphics.Canvas.VertexMode[] values();
    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;
  }

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

  public class ColorFilter {
    ctor public deprecated 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(android.graphics.ColorMatrix);
    ctor public ColorMatrixColorFilter(float[]);
    method public void getColorMatrix(android.graphics.ColorMatrix);
  }

  public abstract class ColorSpace {
    method public static android.graphics.ColorSpace adapt(android.graphics.ColorSpace, float[]);
    method public static android.graphics.ColorSpace adapt(android.graphics.ColorSpace, float[], android.graphics.ColorSpace.Adaptation);
    method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace, android.graphics.ColorSpace);
    method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace, android.graphics.ColorSpace, android.graphics.ColorSpace.RenderIntent);
    method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace);
    method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace, android.graphics.ColorSpace.RenderIntent);
    method public float[] fromXyz(float, float, float);
    method public abstract float[] fromXyz(float[]);
    method public static android.graphics.ColorSpace get(android.graphics.ColorSpace.Named);
    method public int getComponentCount();
    method public int getId();
    method public abstract float getMaxValue(int);
    method public abstract float getMinValue(int);
    method public android.graphics.ColorSpace.Model getModel();
    method public java.lang.String getName();
    method public boolean isSrgb();
    method public abstract boolean isWideGamut();
    method public static android.graphics.ColorSpace match(float[], android.graphics.ColorSpace.Rgb.TransferParameters);
    method public float[] toXyz(float, float, float);
    method public abstract float[] toXyz(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 static final class ColorSpace.Adaptation extends java.lang.Enum {
    method public static android.graphics.ColorSpace.Adaptation valueOf(java.lang.String);
    method public static final android.graphics.ColorSpace.Adaptation[] values();
    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;
  }

  public static class ColorSpace.Connector {
    method public android.graphics.ColorSpace getDestination();
    method public android.graphics.ColorSpace.RenderIntent getRenderIntent();
    method public android.graphics.ColorSpace getSource();
    method public float[] transform(float, float, float);
    method public float[] transform(float[]);
  }

  public static final class ColorSpace.Model extends java.lang.Enum {
    method public int getComponentCount();
    method public static android.graphics.ColorSpace.Model valueOf(java.lang.String);
    method public static final android.graphics.ColorSpace.Model[] values();
    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 static final class ColorSpace.Named extends java.lang.Enum {
    method public static android.graphics.ColorSpace.Named valueOf(java.lang.String);
    method public static final android.graphics.ColorSpace.Named[] values();
    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 static final class ColorSpace.RenderIntent extends java.lang.Enum {
    method public static android.graphics.ColorSpace.RenderIntent valueOf(java.lang.String);
    method public static final android.graphics.ColorSpace.RenderIntent[] values();
    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;
  }

  public static class ColorSpace.Rgb extends android.graphics.ColorSpace {
    ctor public ColorSpace.Rgb(java.lang.String, float[], java.util.function.DoubleUnaryOperator, java.util.function.DoubleUnaryOperator);
    ctor public ColorSpace.Rgb(java.lang.String, float[], float[], java.util.function.DoubleUnaryOperator, java.util.function.DoubleUnaryOperator, float, float);
    ctor public ColorSpace.Rgb(java.lang.String, float[], android.graphics.ColorSpace.Rgb.TransferParameters);
    ctor public ColorSpace.Rgb(java.lang.String, float[], float[], android.graphics.ColorSpace.Rgb.TransferParameters);
    ctor public ColorSpace.Rgb(java.lang.String, float[], double);
    ctor public ColorSpace.Rgb(java.lang.String, float[], float[], double);
    method public float[] fromLinear(float, float, float);
    method public float[] fromLinear(float[]);
    method public float[] fromXyz(float[]);
    method public java.util.function.DoubleUnaryOperator getEotf();
    method public float[] getInverseTransform(float[]);
    method public float[] getInverseTransform();
    method public float getMaxValue(int);
    method public float getMinValue(int);
    method public java.util.function.DoubleUnaryOperator getOetf();
    method public float[] getPrimaries(float[]);
    method public float[] getPrimaries();
    method public android.graphics.ColorSpace.Rgb.TransferParameters getTransferParameters();
    method public float[] getTransform(float[]);
    method public float[] getTransform();
    method public float[] getWhitePoint(float[]);
    method public float[] getWhitePoint();
    method public boolean isWideGamut();
    method public float[] toLinear(float, float, float);
    method public float[] toLinear(float[]);
    method public float[] toXyz(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(android.graphics.Shader, android.graphics.Shader, android.graphics.Xfermode);
    ctor public ComposeShader(android.graphics.Shader, android.graphics.Shader, 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 public deprecated EmbossMaskFilter(float[], float, float, float);
  }

  public final class ImageDecoder implements java.lang.AutoCloseable {
    method public void close();
    method public static android.graphics.ImageDecoder.Source createSource(android.content.res.Resources, int);
    method public static android.graphics.ImageDecoder.Source createSource(android.content.ContentResolver, android.net.Uri);
    method public static android.graphics.ImageDecoder.Source createSource(android.content.res.AssetManager, java.lang.String);
    method public static android.graphics.ImageDecoder.Source createSource(java.nio.ByteBuffer);
    method public static android.graphics.ImageDecoder.Source createSource(java.io.File);
    method public static android.graphics.Bitmap decodeBitmap(android.graphics.ImageDecoder.Source, android.graphics.ImageDecoder.OnHeaderDecodedListener) throws java.io.IOException;
    method public static android.graphics.Bitmap decodeBitmap(android.graphics.ImageDecoder.Source) throws java.io.IOException;
    method public static android.graphics.drawable.Drawable decodeDrawable(android.graphics.ImageDecoder.Source, android.graphics.ImageDecoder.OnHeaderDecodedListener) throws java.io.IOException;
    method public static android.graphics.drawable.Drawable decodeDrawable(android.graphics.ImageDecoder.Source) throws java.io.IOException;
    method public int getAllocator();
    method public android.graphics.Rect getCrop();
    method public int getMemorySizePolicy();
    method public android.graphics.ImageDecoder.OnPartialImageListener getOnPartialImageListener();
    method 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(android.graphics.Rect);
    method public void setDecodeAsAlphaMaskEnabled(boolean);
    method public void setMemorySizePolicy(int);
    method public void setMutableRequired(boolean);
    method public void setOnPartialImageListener(android.graphics.ImageDecoder.OnPartialImageListener);
    method public void setPostProcessor(android.graphics.PostProcessor);
    method public void setTargetColorSpace(android.graphics.ColorSpace);
    method public void setTargetSampleSize(int);
    method public void setTargetSize(int, 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 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 public android.graphics.ColorSpace getColorSpace();
    method public java.lang.String getMimeType();
    method public android.util.Size getSize();
    method public boolean isAnimated();
  }

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

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

  public static abstract 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 static final class Interpolator.Result extends java.lang.Enum {
    method public static android.graphics.Interpolator.Result valueOf(java.lang.String);
    method public static final android.graphics.Interpolator.Result[] values();
    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(int, int);
    method public int getColorAdd();
    method public int getColorMultiply();
  }

  public class LinearGradient extends android.graphics.Shader {
    ctor public LinearGradient(float, float, float, float, int[], float[], android.graphics.Shader.TileMode);
    ctor public LinearGradient(float, float, float, float, int, int, 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 java.lang.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 static final class Matrix.ScaleToFit extends java.lang.Enum {
    method public static android.graphics.Matrix.ScaleToFit valueOf(java.lang.String);
    method public static final android.graphics.Matrix.ScaleToFit[] values();
    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;
  }

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

  public class NinePatch {
    ctor public NinePatch(android.graphics.Bitmap, byte[]);
    ctor public NinePatch(android.graphics.Bitmap, byte[], java.lang.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 java.lang.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(android.graphics.Outline);
    method public boolean canClip();
    method public float getAlpha();
    method public float getRadius();
    method public boolean getRect(android.graphics.Rect);
    method public boolean isEmpty();
    method public void offset(int, int);
    method public void set(android.graphics.Outline);
    method public void setAlpha(float);
    method public void setConvexPath(android.graphics.Path);
    method public void setEmpty();
    method public void setOval(int, int, int, int);
    method public void setOval(android.graphics.Rect);
    method public void setRect(int, int, int, int);
    method public void setRect(android.graphics.Rect);
    method public void setRoundRect(int, int, int, int, float);
    method public void setRoundRect(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(java.lang.CharSequence, int, int, boolean, float, float[]);
    method public int breakText(java.lang.String, boolean, float, float[]);
    method public void clearShadowLayer();
    method public float descent();
    method public boolean equalsForTextMeasurement(android.graphics.Paint);
    method public int getAlpha();
    method 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 java.lang.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 java.lang.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(java.lang.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(java.lang.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(java.lang.String, int, int, android.graphics.Rect);
    method public void getTextBounds(char[], int, int, android.graphics.Rect);
    method public java.util.Locale getTextLocale();
    method public android.os.LocaleList getTextLocales();
    method public void getTextPath(char[], int, int, float, float, android.graphics.Path);
    method public void getTextPath(java.lang.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(java.lang.CharSequence, int, int, float[]);
    method public int getTextWidths(java.lang.String, int, int, float[]);
    method public int getTextWidths(java.lang.String, float[]);
    method public android.graphics.Typeface getTypeface();
    method public android.graphics.Xfermode getXfermode();
    method public boolean hasGlyph(java.lang.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(java.lang.String, int, int);
    method public float measureText(java.lang.String);
    method public float measureText(java.lang.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(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(java.lang.String);
    method public boolean setFontVariationSettings(java.lang.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(java.util.Locale);
    method public void setTextLocales(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 static final class Paint.Align extends java.lang.Enum {
    method public static android.graphics.Paint.Align valueOf(java.lang.String);
    method public static final android.graphics.Paint.Align[] values();
    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 static final class Paint.Cap extends java.lang.Enum {
    method public static android.graphics.Paint.Cap valueOf(java.lang.String);
    method public static final android.graphics.Paint.Cap[] values();
    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 static final class Paint.Join extends java.lang.Enum {
    method public static android.graphics.Paint.Join valueOf(java.lang.String);
    method public static final android.graphics.Paint.Join[] values();
    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 static final class Paint.Style extends java.lang.Enum {
    method public static android.graphics.Paint.Style valueOf(java.lang.String);
    method public static final android.graphics.Paint.Style[] values();
    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 public float[] approximate(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 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(android.graphics.RectF);
    method public void lineTo(float, float);
    method public void moveTo(float, float);
    method public void offset(float, float, 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(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 static final class Path.Direction extends java.lang.Enum {
    method public static android.graphics.Path.Direction valueOf(java.lang.String);
    method public static final android.graphics.Path.Direction[] values();
    enum_constant public static final android.graphics.Path.Direction CCW;
    enum_constant public static final android.graphics.Path.Direction CW;
  }

  public static final class Path.FillType extends java.lang.Enum {
    method public static android.graphics.Path.FillType valueOf(java.lang.String);
    method public static final android.graphics.Path.FillType[] values();
    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 static final class Path.Op extends java.lang.Enum {
    method public static android.graphics.Path.Op valueOf(java.lang.String);
    method public static final android.graphics.Path.Op[] values();
    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 static final class PathDashPathEffect.Style extends java.lang.Enum {
    method public static android.graphics.PathDashPathEffect.Style valueOf(java.lang.String);
    method public static final android.graphics.PathDashPathEffect.Style[] values();
    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 public static deprecated 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 public deprecated 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 public static final deprecated int A_8 = 8; // 0x8
    field public static final deprecated int JPEG = 256; // 0x100
    field public static final deprecated int LA_88 = 10; // 0xa
    field public static final deprecated int L_8 = 9; // 0x9
    field public static final int OPAQUE = -1; // 0xffffffff
    field public static final int RGBA_1010102 = 43; // 0x2b
    field public static final deprecated int RGBA_4444 = 7; // 0x7
    field public static final deprecated 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 public static final deprecated 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 public static final deprecated int YCbCr_420_SP = 17; // 0x11
    field public static final deprecated int YCbCr_422_I = 20; // 0x14
    field public static final deprecated 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 static final class PorterDuff.Mode extends java.lang.Enum {
    method public static android.graphics.PorterDuff.Mode valueOf(java.lang.String);
    method public static final android.graphics.PorterDuff.Mode[] values();
    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(int, android.graphics.PorterDuff.Mode);
  }

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

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

  public class RadialGradient extends android.graphics.Shader {
    ctor public RadialGradient(float, float, float, int[], float[], android.graphics.Shader.TileMode);
    ctor public RadialGradient(float, float, float, int, int, 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 public java.lang.String flattenToString();
    method public int height();
    method public void inset(int, int);
    method public boolean intersect(int, int, int, int);
    method 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 public boolean setIntersect(android.graphics.Rect, android.graphics.Rect);
    method public void sort();
    method public java.lang.String toShortString();
    method public static android.graphics.Rect unflattenFromString(java.lang.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 public java.lang.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 static final class Region.Op extends java.lang.Enum {
    method public static android.graphics.Region.Op valueOf(java.lang.String);
    method public static final android.graphics.Region.Op[] values();
    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 public deprecated Shader();
    method public boolean getLocalMatrix(android.graphics.Matrix);
    method public void setLocalMatrix(android.graphics.Matrix);
  }

  public static final class Shader.TileMode extends java.lang.Enum {
    method public static android.graphics.Shader.TileMode valueOf(java.lang.String);
    method public static final android.graphics.Shader.TileMode[] values();
    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(android.graphics.SurfaceTexture.OnFrameAvailableListener);
    method public void setOnFrameAvailableListener(android.graphics.SurfaceTexture.OnFrameAvailableListener, android.os.Handler);
    method public void updateTexImage();
  }

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

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

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

  public class Typeface {
    method public static android.graphics.Typeface create(java.lang.String, int);
    method public static android.graphics.Typeface create(android.graphics.Typeface, int);
    method public static android.graphics.Typeface create(android.graphics.Typeface, int, boolean);
    method public static android.graphics.Typeface createFromAsset(android.content.res.AssetManager, java.lang.String);
    method public static android.graphics.Typeface createFromFile(java.io.File);
    method public static android.graphics.Typeface createFromFile(java.lang.String);
    method public static android.graphics.Typeface defaultFromStyle(int);
    method public int getStyle();
    method 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(java.io.File);
    ctor public Typeface.Builder(java.io.FileDescriptor);
    ctor public Typeface.Builder(java.lang.String);
    ctor public Typeface.Builder(android.content.res.AssetManager, java.lang.String);
    method public android.graphics.Typeface build();
    method public android.graphics.Typeface.Builder setFallback(java.lang.String);
    method public android.graphics.Typeface.Builder setFontVariationSettings(java.lang.String);
    method public android.graphics.Typeface.Builder setFontVariationSettings(android.graphics.fonts.FontVariationAxis[]);
    method public android.graphics.Typeface.Builder setItalic(boolean);
    method public android.graphics.Typeface.Builder setTtcIndex(int);
    method public android.graphics.Typeface.Builder setWeight(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(android.graphics.drawable.Drawable);
    method public void scheduleDrawable(android.graphics.drawable.Drawable, java.lang.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(android.graphics.drawable.Drawable, java.lang.Runnable);
  }

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

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

  public static abstract 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(android.graphics.Canvas);
    method public int getOpacity();
    method public int getRepeatCount();
    method public final boolean isAutoMirrored();
    method public boolean isRunning();
    method public void registerAnimationCallback(android.graphics.drawable.Animatable2.AnimationCallback);
    method public void setAlpha(int);
    method public void setColorFilter(android.graphics.ColorFilter);
    method public void setRepeatCount(int);
    method public void start();
    method public void stop();
    method public boolean unregisterAnimationCallback(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(int[], android.graphics.drawable.Drawable, int);
    method public <T extends android.graphics.drawable.Drawable & android.graphics.drawable.Animatable> void addTransition(int, int, 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(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(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(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 public deprecated BitmapDrawable();
    ctor public deprecated BitmapDrawable(android.content.res.Resources);
    ctor public deprecated BitmapDrawable(android.graphics.Bitmap);
    ctor public BitmapDrawable(android.content.res.Resources, android.graphics.Bitmap);
    ctor public deprecated BitmapDrawable(java.lang.String);
    ctor public BitmapDrawable(android.content.res.Resources, java.lang.String);
    ctor public deprecated 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(int);
    method public void draw(android.graphics.Canvas);
    method public int getColor();
    method public int getOpacity();
    method public void setAlpha(int);
    method public void setColor(int);
    method public void setColorFilter(android.graphics.ColorFilter);
  }

  public abstract class Drawable {
    ctor public Drawable();
    method public void applyTheme(android.content.res.Resources.Theme);
    method public boolean canApplyTheme();
    method public void clearColorFilter();
    method public final void copyBounds(android.graphics.Rect);
    method public final android.graphics.Rect copyBounds();
    method public static android.graphics.drawable.Drawable createFromPath(java.lang.String);
    method public static android.graphics.drawable.Drawable createFromResourceStream(android.content.res.Resources, android.util.TypedValue, java.io.InputStream, java.lang.String);
    method public static deprecated android.graphics.drawable.Drawable createFromResourceStream(android.content.res.Resources, android.util.TypedValue, java.io.InputStream, java.lang.String, android.graphics.BitmapFactory.Options);
    method public static android.graphics.drawable.Drawable createFromStream(java.io.InputStream, java.lang.String);
    method public static android.graphics.drawable.Drawable createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static android.graphics.drawable.Drawable createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static android.graphics.drawable.Drawable createFromXmlInner(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static android.graphics.drawable.Drawable createFromXmlInner(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public abstract void draw(android.graphics.Canvas);
    method public int getAlpha();
    method public final android.graphics.Rect getBounds();
    method public android.graphics.drawable.Drawable.Callback getCallback();
    method public int getChangingConfigurations();
    method public android.graphics.ColorFilter getColorFilter();
    method public android.graphics.drawable.Drawable.ConstantState getConstantState();
    method public android.graphics.drawable.Drawable getCurrent();
    method public android.graphics.Rect getDirtyBounds();
    method public void getHotspotBounds(android.graphics.Rect);
    method public int getIntrinsicHeight();
    method public int getIntrinsicWidth();
    method public int getLayoutDirection();
    method public final int getLevel();
    method public int getMinimumHeight();
    method public int getMinimumWidth();
    method public abstract int getOpacity();
    method public void getOutline(android.graphics.Outline);
    method public boolean getPadding(android.graphics.Rect);
    method public int[] getState();
    method public android.graphics.Region getTransparentRegion();
    method public void inflate(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public void inflate(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, 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 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(java.lang.Runnable, long);
    method public abstract void setAlpha(int);
    method public void setAutoMirrored(boolean);
    method public void setBounds(int, int, int, int);
    method public void setBounds(android.graphics.Rect);
    method public final void setCallback(android.graphics.drawable.Drawable.Callback);
    method public void setChangingConfigurations(int);
    method public abstract void setColorFilter(android.graphics.ColorFilter);
    method public void setColorFilter(int, android.graphics.PorterDuff.Mode);
    method public deprecated 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(int);
    method public boolean setState(int[]);
    method public void setTint(int);
    method public void setTintList(android.content.res.ColorStateList);
    method public void setTintMode(android.graphics.PorterDuff.Mode);
    method public boolean setVisible(boolean, boolean);
    method public void unscheduleSelf(java.lang.Runnable);
  }

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

  public static abstract class Drawable.ConstantState {
    ctor public Drawable.ConstantState();
    method public boolean canApplyTheme();
    method public abstract int getChangingConfigurations();
    method public abstract android.graphics.drawable.Drawable newDrawable();
    method public android.graphics.drawable.Drawable newDrawable(android.content.res.Resources);
    method public android.graphics.drawable.Drawable newDrawable(android.content.res.Resources, 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(android.graphics.drawable.Drawable);
    method public void scheduleDrawable(android.graphics.drawable.Drawable, java.lang.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(android.graphics.drawable.Drawable, java.lang.Runnable);
  }

  public static abstract class DrawableContainer.DrawableContainerState extends android.graphics.drawable.Drawable.ConstantState {
    method public final int addChild(android.graphics.drawable.Drawable);
    method public synchronized 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(android.graphics.drawable.Drawable);
    method public void draw(android.graphics.Canvas);
    method public android.graphics.drawable.Drawable getDrawable();
    method public int getOpacity();
    method public void invalidateDrawable(android.graphics.drawable.Drawable);
    method public void scheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable, long);
    method public void setAlpha(int);
    method public void setColorFilter(android.graphics.ColorFilter);
    method public void setDrawable(android.graphics.drawable.Drawable);
    method public void unscheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable);
  }

  public class GradientDrawable extends android.graphics.drawable.Drawable {
    ctor public GradientDrawable();
    ctor public GradientDrawable(android.graphics.drawable.GradientDrawable.Orientation, int[]);
    method public void draw(android.graphics.Canvas);
    method public android.content.res.ColorStateList getColor();
    method public int[] getColors();
    method 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(int);
    method public void setColor(android.content.res.ColorStateList);
    method public void setColorFilter(android.graphics.ColorFilter);
    method public void setColors(int[]);
    method public void setCornerRadii(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, int);
    method public void setStroke(int, android.content.res.ColorStateList);
    method public void setStroke(int, 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 static final class GradientDrawable.Orientation extends java.lang.Enum {
    method public static android.graphics.drawable.GradientDrawable.Orientation valueOf(java.lang.String);
    method public static final android.graphics.drawable.GradientDrawable.Orientation[] values();
    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(java.lang.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(java.lang.String);
    method public static android.graphics.drawable.Icon createWithResource(android.content.Context, int);
    method public static android.graphics.drawable.Icon createWithResource(java.lang.String, int);
    method public int describeContents();
    method public int getResId();
    method public java.lang.String getResPackage();
    method public int getType();
    method 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(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 abstract interface Icon.OnDrawableLoadedListener {
    method public abstract void onDrawableLoaded(android.graphics.drawable.Drawable);
  }

  public class InsetDrawable extends android.graphics.drawable.DrawableWrapper {
    ctor public InsetDrawable(android.graphics.drawable.Drawable, int);
    ctor public InsetDrawable(android.graphics.drawable.Drawable, float);
    ctor public InsetDrawable(android.graphics.drawable.Drawable, int, int, int, int);
    ctor public InsetDrawable(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(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(android.graphics.drawable.Drawable);
    method public void scheduleDrawable(android.graphics.drawable.Drawable, java.lang.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(android.graphics.drawable.Drawable, java.lang.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 public deprecated NinePatchDrawable(android.graphics.Bitmap, byte[], android.graphics.Rect, java.lang.String);
    ctor public NinePatchDrawable(android.content.res.Resources, android.graphics.Bitmap, byte[], android.graphics.Rect, java.lang.String);
    ctor public deprecated NinePatchDrawable(android.graphics.NinePatch);
    ctor public NinePatchDrawable(android.content.res.Resources, android.graphics.NinePatch);
    method public void draw(android.graphics.Canvas);
    method public int getOpacity();
    method public android.graphics.Paint getPaint();
    method public void setAlpha(int);
    method public void setColorFilter(android.graphics.ColorFilter);
    method public void setDither(boolean);
    method public void setTargetDensity(android.graphics.Canvas);
    method public void setTargetDensity(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(android.content.res.ColorStateList, android.graphics.drawable.Drawable, 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(java.lang.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 static abstract 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(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(float[], android.graphics.RectF, 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(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(java.lang.String, float);
    method public static android.graphics.fonts.FontVariationAxis[] fromFontVariationSettings(java.lang.String);
    method public float getStyleValue();
    method public java.lang.String getTag();
    method public static java.lang.String toFontVariationSettings(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(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(android.graphics.Bitmap, android.graphics.Rect, 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 {

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

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

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

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

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

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

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

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

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

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

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

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

  public static abstract deprecated interface Camera.ShutterCallback {
    method public abstract void onShutter();
  }

  public deprecated class Camera.Size {
    ctor public Camera.Size(int, int);
    field public int height;
    field 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 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 java.lang.String getName();
    method public float getPower();
    method public int getReportingMode();
    method public float getResolution();
    method public java.lang.String getStringType();
    method public int getType();
    method public java.lang.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 java.lang.String STRING_TYPE_ACCELEROMETER = "android.sensor.accelerometer";
    field public static final java.lang.String STRING_TYPE_ACCELEROMETER_UNCALIBRATED = "android.sensor.accelerometer_uncalibrated";
    field public static final java.lang.String STRING_TYPE_AMBIENT_TEMPERATURE = "android.sensor.ambient_temperature";
    field public static final java.lang.String STRING_TYPE_GAME_ROTATION_VECTOR = "android.sensor.game_rotation_vector";
    field public static final java.lang.String STRING_TYPE_GEOMAGNETIC_ROTATION_VECTOR = "android.sensor.geomagnetic_rotation_vector";
    field public static final java.lang.String STRING_TYPE_GRAVITY = "android.sensor.gravity";
    field public static final java.lang.String STRING_TYPE_GYROSCOPE = "android.sensor.gyroscope";
    field public static final java.lang.String STRING_TYPE_GYROSCOPE_UNCALIBRATED = "android.sensor.gyroscope_uncalibrated";
    field public static final java.lang.String STRING_TYPE_HEART_BEAT = "android.sensor.heart_beat";
    field public static final java.lang.String STRING_TYPE_HEART_RATE = "android.sensor.heart_rate";
    field public static final java.lang.String STRING_TYPE_LIGHT = "android.sensor.light";
    field public static final java.lang.String STRING_TYPE_LINEAR_ACCELERATION = "android.sensor.linear_acceleration";
    field public static final java.lang.String STRING_TYPE_LOW_LATENCY_OFFBODY_DETECT = "android.sensor.low_latency_offbody_detect";
    field public static final java.lang.String STRING_TYPE_MAGNETIC_FIELD = "android.sensor.magnetic_field";
    field public static final java.lang.String STRING_TYPE_MAGNETIC_FIELD_UNCALIBRATED = "android.sensor.magnetic_field_uncalibrated";
    field public static final java.lang.String STRING_TYPE_MOTION_DETECT = "android.sensor.motion_detect";
    field public static final deprecated java.lang.String STRING_TYPE_ORIENTATION = "android.sensor.orientation";
    field public static final java.lang.String STRING_TYPE_POSE_6DOF = "android.sensor.pose_6dof";
    field public static final java.lang.String STRING_TYPE_PRESSURE = "android.sensor.pressure";
    field public static final java.lang.String STRING_TYPE_PROXIMITY = "android.sensor.proximity";
    field public static final java.lang.String STRING_TYPE_RELATIVE_HUMIDITY = "android.sensor.relative_humidity";
    field public static final java.lang.String STRING_TYPE_ROTATION_VECTOR = "android.sensor.rotation_vector";
    field public static final java.lang.String STRING_TYPE_SIGNIFICANT_MOTION = "android.sensor.significant_motion";
    field public static final java.lang.String STRING_TYPE_STATIONARY_DETECT = "android.sensor.stationary_detect";
    field public static final java.lang.String STRING_TYPE_STEP_COUNTER = "android.sensor.step_counter";
    field public static final java.lang.String STRING_TYPE_STEP_DETECTOR = "android.sensor.step_detector";
    field public static final deprecated java.lang.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 public static final deprecated 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 public static final deprecated 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 abstract interface SensorEventListener {
    method public abstract void onAccuracyChanged(android.hardware.Sensor, int);
    method public abstract void onSensorChanged(android.hardware.SensorEvent);
  }

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

  public abstract deprecated interface SensorListener {
    method public abstract void onAccuracyChanged(int, int);
    method public abstract 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 public deprecated 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 public deprecated boolean registerListener(android.hardware.SensorListener, int);
    method public deprecated 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 public deprecated void unregisterListener(android.hardware.SensorListener);
    method public deprecated 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 public static final deprecated int DATA_X = 0; // 0x0
    field public static final deprecated int DATA_Y = 1; // 0x1
    field public static final deprecated 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 public static final deprecated int RAW_DATA_INDEX = 3; // 0x3
    field public static final deprecated int RAW_DATA_X = 3; // 0x3
    field public static final deprecated int RAW_DATA_Y = 4; // 0x4
    field public static final deprecated int RAW_DATA_Z = 5; // 0x5
    field public static final deprecated int SENSOR_ACCELEROMETER = 2; // 0x2
    field public static final deprecated 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 public static final deprecated int SENSOR_LIGHT = 16; // 0x10
    field public static final deprecated int SENSOR_MAGNETIC_FIELD = 8; // 0x8
    field public static final deprecated int SENSOR_MAX = 64; // 0x40
    field public static final deprecated int SENSOR_MIN = 1; // 0x1
    field public static final deprecated int SENSOR_ORIENTATION = 1; // 0x1
    field public static final deprecated int SENSOR_ORIENTATION_RAW = 128; // 0x80
    field public static final deprecated 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 public static final deprecated int SENSOR_TEMPERATURE = 4; // 0x4
    field public static final deprecated int SENSOR_TRICORDER = 64; // 0x40
    field public static final float STANDARD_GRAVITY = 9.80665f;
  }

  public static abstract 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 public void authenticate(android.hardware.biometrics.BiometricPrompt.CryptoObject, android.os.CancellationSignal, java.util.concurrent.Executor, android.hardware.biometrics.BiometricPrompt.AuthenticationCallback);
    method public void authenticate(android.os.CancellationSignal, java.util.concurrent.Executor, 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 static abstract class BiometricPrompt.AuthenticationCallback {
    ctor public BiometricPrompt.AuthenticationCallback();
    method public void onAuthenticationError(int, java.lang.CharSequence);
    method public void onAuthenticationFailed();
    method public void onAuthenticationHelp(int, java.lang.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(java.lang.CharSequence);
    method public android.hardware.biometrics.BiometricPrompt.Builder setNegativeButton(java.lang.CharSequence, java.util.concurrent.Executor, android.content.DialogInterface.OnClickListener);
    method public android.hardware.biometrics.BiometricPrompt.Builder setSubtitle(java.lang.CharSequence);
    method public android.hardware.biometrics.BiometricPrompt.Builder setTitle(java.lang.CharSequence);
  }

  public static final class BiometricPrompt.CryptoObject {
    ctor public BiometricPrompt.CryptoObject(java.security.Signature);
    ctor public BiometricPrompt.CryptoObject(javax.crypto.Cipher);
    ctor public BiometricPrompt.CryptoObject(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, java.lang.String);
    ctor public CameraAccessException(int, java.lang.String, java.lang.Throwable);
    ctor public CameraAccessException(int, java.lang.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(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract int captureBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public int captureBurstRequests(java.util.List<android.hardware.camera2.CaptureRequest>, java.util.concurrent.Executor, android.hardware.camera2.CameraCaptureSession.CaptureCallback) throws android.hardware.camera2.CameraAccessException;
    method public int captureSingleRequest(android.hardware.camera2.CaptureRequest, java.util.concurrent.Executor, 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 public abstract android.hardware.camera2.CameraDevice getDevice();
    method public abstract android.view.Surface getInputSurface();
    method public abstract boolean isReprocessable();
    method public abstract void prepare(android.view.Surface) throws android.hardware.camera2.CameraAccessException;
    method public abstract int setRepeatingBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public int setRepeatingBurstRequests(java.util.List<android.hardware.camera2.CaptureRequest>, java.util.concurrent.Executor, android.hardware.camera2.CameraCaptureSession.CaptureCallback) throws android.hardware.camera2.CameraAccessException;
    method public abstract int setRepeatingRequest(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public int setSingleRepeatingRequest(android.hardware.camera2.CaptureRequest, java.util.concurrent.Executor, 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 static abstract class CameraCaptureSession.CaptureCallback {
    ctor public CameraCaptureSession.CaptureCallback();
    method public void onCaptureBufferLost(android.hardware.camera2.CameraCaptureSession, android.hardware.camera2.CaptureRequest, android.view.Surface, long);
    method public void onCaptureCompleted(android.hardware.camera2.CameraCaptureSession, android.hardware.camera2.CaptureRequest, android.hardware.camera2.TotalCaptureResult);
    method public void onCaptureFailed(android.hardware.camera2.CameraCaptureSession, android.hardware.camera2.CaptureRequest, android.hardware.camera2.CaptureFailure);
    method public void onCaptureProgressed(android.hardware.camera2.CameraCaptureSession, android.hardware.camera2.CaptureRequest, android.hardware.camera2.CaptureResult);
    method public void onCaptureSequenceAborted(android.hardware.camera2.CameraCaptureSession, int);
    method public void onCaptureSequenceCompleted(android.hardware.camera2.CameraCaptureSession, int, long);
    method public void onCaptureStarted(android.hardware.camera2.CameraCaptureSession, android.hardware.camera2.CaptureRequest, long, long);
  }

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

  public final class CameraCharacteristics extends android.hardware.camera2.CameraMetadata {
    method public <T> T get(android.hardware.camera2.CameraCharacteristics.Key<T>);
    method public java.util.List<android.hardware.camera2.CaptureRequest.Key<?>> getAvailableCaptureRequestKeys();
    method 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 public java.util.List<android.hardware.camera2.CameraCharacteristics.Key<?>> getKeys();
    method 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 public static final deprecated 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 public java.lang.String getName();
  }

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

  public abstract class CameraDevice implements java.lang.AutoCloseable {
    method public abstract void close();
    method public abstract android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(int) throws android.hardware.camera2.CameraAccessException;
    method public android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(int, java.util.Set<java.lang.String>) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createCaptureSession(java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, 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, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createConstrainedHighSpeedCaptureSession(java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract android.hardware.camera2.CaptureRequest.Builder createReprocessCaptureRequest(android.hardware.camera2.TotalCaptureResult) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createReprocessableCaptureSession(android.hardware.camera2.params.InputConfiguration, java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createReprocessableCaptureSessionByConfigurations(android.hardware.camera2.params.InputConfiguration, java.util.List<android.hardware.camera2.params.OutputConfiguration>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract java.lang.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 static abstract class CameraDevice.StateCallback {
    ctor public CameraDevice.StateCallback();
    method public void onClosed(android.hardware.camera2.CameraDevice);
    method public abstract void onDisconnected(android.hardware.camera2.CameraDevice);
    method public abstract void onError(android.hardware.camera2.CameraDevice, int);
    method public abstract void onOpened(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 public android.hardware.camera2.CameraCharacteristics getCameraCharacteristics(java.lang.String) throws android.hardware.camera2.CameraAccessException;
    method public java.lang.String[] getCameraIdList() throws android.hardware.camera2.CameraAccessException;
    method public void openCamera(java.lang.String, android.hardware.camera2.CameraDevice.StateCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public void openCamera(java.lang.String, java.util.concurrent.Executor, android.hardware.camera2.CameraDevice.StateCallback) throws android.hardware.camera2.CameraAccessException;
    method public void registerAvailabilityCallback(android.hardware.camera2.CameraManager.AvailabilityCallback, android.os.Handler);
    method public void registerAvailabilityCallback(java.util.concurrent.Executor, android.hardware.camera2.CameraManager.AvailabilityCallback);
    method public void registerTorchCallback(android.hardware.camera2.CameraManager.TorchCallback, android.os.Handler);
    method public void registerTorchCallback(java.util.concurrent.Executor, android.hardware.camera2.CameraManager.TorchCallback);
    method public void setTorchMode(java.lang.String, boolean) throws android.hardware.camera2.CameraAccessException;
    method public void unregisterAvailabilityCallback(android.hardware.camera2.CameraManager.AvailabilityCallback);
    method public void unregisterTorchCallback(android.hardware.camera2.CameraManager.TorchCallback);
  }

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

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

  public abstract class CameraMetadata<TKey> {
    method 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 public static final deprecated 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 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 implements android.os.Parcelable {
    method public int describeContents();
    method public <T> T get(android.hardware.camera2.CaptureRequest.Key<T>);
    method public java.util.List<android.hardware.camera2.CaptureRequest.Key<?>> getKeys();
    method public java.lang.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(android.view.Surface);
    method public android.hardware.camera2.CaptureRequest build();
    method public <T> T get(android.hardware.camera2.CaptureRequest.Key<T>);
    method public <T> T getPhysicalCameraKey(android.hardware.camera2.CaptureRequest.Key<T>, java.lang.String);
    method public void removeTarget(android.view.Surface);
    method public <T> void set(android.hardware.camera2.CaptureRequest.Key<T>, T);
    method public <T> android.hardware.camera2.CaptureRequest.Builder setPhysicalCameraKey(android.hardware.camera2.CaptureRequest.Key<T>, T, java.lang.String);
    method public void setTag(java.lang.Object);
  }

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

  public class CaptureResult extends android.hardware.camera2.CameraMetadata {
    method public <T> T get(android.hardware.camera2.CaptureResult.Key<T>);
    method public long getFrameNumber();
    method public java.util.List<android.hardware.camera2.CaptureResult.Key<?>> getKeys();
    method 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 public static final deprecated 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 public java.lang.String getName();
  }

  public final class DngCreator implements java.lang.AutoCloseable {
    ctor public DngCreator(android.hardware.camera2.CameraCharacteristics, android.hardware.camera2.CaptureResult);
    method public void close();
    method public android.hardware.camera2.DngCreator setDescription(java.lang.String);
    method public android.hardware.camera2.DngCreator setLocation(android.location.Location);
    method public android.hardware.camera2.DngCreator setOrientation(int);
    method public android.hardware.camera2.DngCreator setThumbnail(android.graphics.Bitmap);
    method public android.hardware.camera2.DngCreator setThumbnail(android.media.Image);
    method public void writeByteBuffer(java.io.OutputStream, android.util.Size, java.nio.ByteBuffer, long) throws java.io.IOException;
    method public void writeImage(java.io.OutputStream, android.media.Image) throws java.io.IOException;
    method public void writeInputStream(java.io.OutputStream, android.util.Size, java.io.InputStream, 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 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(android.view.Surface);
    ctor public OutputConfiguration(int, android.view.Surface);
    ctor public OutputConfiguration(android.util.Size, java.lang.Class<T>);
    method public void addSurface(android.view.Surface);
    method public int describeContents();
    method public void enableSurfaceSharing();
    method public int getMaxSharedSurfaceCount();
    method public android.view.Surface getSurface();
    method public int getSurfaceGroupId();
    method public java.util.List<android.view.Surface> getSurfaces();
    method public void removeSurface(android.view.Surface);
    method public void setPhysicalCameraId(java.lang.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, java.util.List<android.hardware.camera2.params.OutputConfiguration>, java.util.concurrent.Executor, 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(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(java.lang.Class<T>, android.util.Size);
    method public <T> android.util.Size[] getOutputSizes(java.lang.Class<T>);
    method public android.util.Size[] getOutputSizes(int);
    method public long getOutputStallDuration(int, android.util.Size);
    method public <T> long getOutputStallDuration(java.lang.Class<T>, android.util.Size);
    method public int[] getValidOutputFormatsForInput(int);
    method public boolean isOutputSupportedFor(int);
    method public static <T> boolean isOutputSupportedFor(java.lang.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(java.lang.String, int, int, int, android.view.Surface, int);
    method public android.hardware.display.VirtualDisplay createVirtualDisplay(java.lang.String, int, int, int, android.view.Surface, int, android.hardware.display.VirtualDisplay.Callback, android.os.Handler);
    method public android.view.Display getDisplay(int);
    method public android.view.Display[] getDisplays();
    method public android.view.Display[] getDisplays(java.lang.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 java.lang.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 abstract interface DisplayManager.DisplayListener {
    method public abstract void onDisplayAdded(int);
    method public abstract void onDisplayChanged(int);
    method public abstract 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 static abstract class VirtualDisplay.Callback {
    ctor public VirtualDisplay.Callback();
    method public void onPaused();
    method public void onResumed();
    method public void onStopped();
  }

}

package android.hardware.fingerprint {

  public deprecated class FingerprintManager {
    method public deprecated void authenticate(android.hardware.fingerprint.FingerprintManager.CryptoObject, android.os.CancellationSignal, int, android.hardware.fingerprint.FingerprintManager.AuthenticationCallback, android.os.Handler);
    method public deprecated boolean hasEnrolledFingerprints();
    method public deprecated 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
  }

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

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

  public static final deprecated class FingerprintManager.CryptoObject {
    ctor public FingerprintManager.CryptoObject(java.security.Signature);
    ctor public FingerprintManager.CryptoObject(javax.crypto.Cipher);
    ctor public FingerprintManager.CryptoObject(javax.crypto.Mac);
    method public javax.crypto.Cipher getCipher();
    method public javax.crypto.Mac getMac();
    method 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 java.lang.String ACTION_QUERY_KEYBOARD_LAYOUTS = "android.hardware.input.action.QUERY_KEYBOARD_LAYOUTS";
    field public static final java.lang.String META_DATA_KEYBOARD_LAYOUTS = "android.hardware.input.metadata.KEYBOARD_LAYOUTS";
  }

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

}

package android.hardware.usb {

  public class UsbAccessory implements android.os.Parcelable {
    method public int describeContents();
    method public java.lang.String getDescription();
    method public java.lang.String getManufacturer();
    method public java.lang.String getModel();
    method public java.lang.String getSerial();
    method public java.lang.String getUri();
    method public java.lang.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 public android.hardware.usb.UsbInterface getInterface(int);
    method public int getInterfaceCount();
    method public int getMaxPower();
    method public java.lang.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 public android.hardware.usb.UsbConfiguration getConfiguration(int);
    method public int getConfigurationCount();
    method public int getDeviceClass();
    method public int getDeviceId();
    method public static int getDeviceId(java.lang.String);
    method public java.lang.String getDeviceName();
    method public static java.lang.String getDeviceName(int);
    method public int getDeviceProtocol();
    method public int getDeviceSubclass();
    method public android.hardware.usb.UsbInterface getInterface(int);
    method public int getInterfaceCount();
    method public java.lang.String getManufacturerName();
    method public int getProductId();
    method public java.lang.String getProductName();
    method public java.lang.String getSerialNumber();
    method public int getVendorId();
    method public java.lang.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 java.lang.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 public java.lang.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 java.lang.String ACTION_USB_ACCESSORY_ATTACHED = "android.hardware.usb.action.USB_ACCESSORY_ATTACHED";
    field public static final java.lang.String ACTION_USB_ACCESSORY_DETACHED = "android.hardware.usb.action.USB_ACCESSORY_DETACHED";
    field public static final java.lang.String ACTION_USB_DEVICE_ATTACHED = "android.hardware.usb.action.USB_DEVICE_ATTACHED";
    field public static final java.lang.String ACTION_USB_DEVICE_DETACHED = "android.hardware.usb.action.USB_DEVICE_DETACHED";
    field public static final java.lang.String EXTRA_ACCESSORY = "accessory";
    field public static final java.lang.String EXTRA_DEVICE = "device";
    field public static final java.lang.String EXTRA_PERMISSION_GRANTED = "permission";
  }

  public class UsbRequest {
    ctor public UsbRequest();
    method public boolean cancel();
    method public void close();
    method public java.lang.Object getClientData();
    method public android.hardware.usb.UsbEndpoint getEndpoint();
    method public boolean initialize(android.hardware.usb.UsbDeviceConnection, android.hardware.usb.UsbEndpoint);
    method public deprecated boolean queue(java.nio.ByteBuffer, int);
    method public boolean queue(java.nio.ByteBuffer);
    method public void setClientData(java.lang.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(java.lang.CharSequence, int);
    method public static int codePointAt(char[], int);
    method public static int codePointAt(char[], int, int);
    method public static int codePointBefore(java.lang.CharSequence, int);
    method public static int codePointBefore(char[], int);
    method public static int codePointBefore(char[], int, int);
    method public static int codePointCount(java.lang.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 java.lang.String foldCase(java.lang.String, boolean);
    method public static int foldCase(int, int);
    method public static java.lang.String foldCase(java.lang.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(java.lang.String);
    method public static int getCharFromName(java.lang.String);
    method public static int getCharFromNameAlias(java.lang.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 java.lang.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 java.lang.String getName(int);
    method public static java.lang.String getName(java.lang.String, java.lang.String);
    method public static java.lang.String getNameAlias(int);
    method public static android.icu.util.ValueIterator getNameIterator();
    method public static int getNumericValue(int);
    method public static int getPropertyEnum(java.lang.CharSequence);
    method public static java.lang.String getPropertyName(int, int);
    method public static int getPropertyValueEnum(int, java.lang.CharSequence);
    method public static java.lang.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(java.lang.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(java.lang.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 java.lang.String toLowerCase(java.lang.String);
    method public static java.lang.String toLowerCase(java.util.Locale, java.lang.String);
    method public static java.lang.String toLowerCase(android.icu.util.ULocale, java.lang.String);
    method public static java.lang.String toString(int);
    method public static int toTitleCase(int);
    method public static java.lang.String toTitleCase(java.lang.String, android.icu.text.BreakIterator);
    method public static java.lang.String toTitleCase(java.util.Locale, java.lang.String, android.icu.text.BreakIterator);
    method public static java.lang.String toTitleCase(android.icu.util.ULocale, java.lang.String, android.icu.text.BreakIterator);
    method public static java.lang.String toTitleCase(android.icu.util.ULocale, java.lang.String, android.icu.text.BreakIterator, int);
    method public static java.lang.String toTitleCase(java.util.Locale, java.lang.String, android.icu.text.BreakIterator, int);
    method public static int toUpperCase(int);
    method public static java.lang.String toUpperCase(java.lang.String);
    method public static java.lang.String toUpperCase(java.util.Locale, java.lang.String);
    method public static java.lang.String toUpperCase(android.icu.util.ULocale, java.lang.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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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(java.lang.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 abstract 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 java.lang.String toString(int);
  }

  public final class UCharacterDirection implements android.icu.lang.UCharacterEnums.ECharacterDirection {
    method public static java.lang.String toString(int);
  }

  public class UCharacterEnums {
  }

  public static abstract 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 abstract 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 abstract 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 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 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 abstract 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(java.lang.String);
    method public static int getCodeFromName(java.lang.String);
    method public static java.lang.String getName(int);
    method public static java.lang.String getSampleString(int);
    method public static int getScript(int);
    method public static int getScriptExtensions(int, java.util.BitSet);
    method public static java.lang.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 static final class UScript.ScriptUsage extends java.lang.Enum {
    method public static android.icu.lang.UScript.ScriptUsage valueOf(java.lang.String);
    method public static final android.icu.lang.UScript.ScriptUsage[] values();
    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 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(java.lang.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 java.lang.String format(int, int);
    method public java.lang.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 {
    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(java.lang.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(java.lang.CharSequence);
    method public java.util.List<java.lang.String> getBucketLabels();
    method public android.icu.text.RuleBasedCollator getCollator();
    method public java.lang.String getInflowLabel();
    method public int getMaxLabelCount();
    method public java.lang.String getOverflowLabel();
    method public int getRecordCount();
    method public java.lang.String getUnderflowLabel();
    method public java.util.Iterator<android.icu.text.AlphabeticIndex.Bucket<V>> iterator();
    method public android.icu.text.AlphabeticIndex<V> setInflowLabel(java.lang.String);
    method public android.icu.text.AlphabeticIndex<V> setMaxLabelCount(int);
    method public android.icu.text.AlphabeticIndex<V> setOverflowLabel(java.lang.String);
    method public android.icu.text.AlphabeticIndex<V> setUnderflowLabel(java.lang.String);
  }

  public static class AlphabeticIndex.Bucket<V> implements java.lang.Iterable {
    method public java.lang.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 static final class AlphabeticIndex.Bucket.LabelType extends java.lang.Enum {
    method public static android.icu.text.AlphabeticIndex.Bucket.LabelType valueOf(java.lang.String);
    method public static final android.icu.text.AlphabeticIndex.Bucket.LabelType[] values();
    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 {
    method public android.icu.text.AlphabeticIndex.Bucket<V> getBucket(int);
    method public int getBucketCount();
    method public int getBucketIndex(java.lang.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 java.lang.CharSequence getName();
  }

  public abstract class BreakIterator implements java.lang.Cloneable {
    ctor protected BreakIterator();
    method public java.lang.Object clone();
    method public abstract int current();
    method public abstract int first();
    method public abstract int following(int);
    method public static synchronized 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(java.lang.String);
    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 final class CollationElementIterator {
    method public int getMaxExpansion(int);
    method public int getOffset();
    method public deprecated int hashCode();
    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(java.lang.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 {
    ctor public CollationKey(java.lang.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 java.lang.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 android.icu.util.Freezable {
    ctor protected Collator();
    method public java.lang.Object clone() throws java.lang.CloneNotSupportedException;
    method public android.icu.text.Collator cloneAsThawed();
    method public abstract int compare(java.lang.String, java.lang.String);
    method public int compare(java.lang.Object, java.lang.Object);
    method public boolean equals(java.lang.String, java.lang.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(java.lang.String);
    method public int getDecomposition();
    method public static java.lang.String getDisplayName(java.util.Locale, java.util.Locale);
    method public static java.lang.String getDisplayName(android.icu.util.ULocale, android.icu.util.ULocale);
    method public static java.lang.String getDisplayName(java.util.Locale);
    method public static java.lang.String getDisplayName(android.icu.util.ULocale);
    method public static int[] getEquivalentReorderCodes(int);
    method public static final android.icu.util.ULocale getFunctionalEquivalent(java.lang.String, android.icu.util.ULocale, boolean[]);
    method public static final android.icu.util.ULocale getFunctionalEquivalent(java.lang.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 java.lang.String[] getKeywordValues(java.lang.String);
    method public static final java.lang.String[] getKeywordValuesForLocale(java.lang.String, android.icu.util.ULocale, boolean);
    method public static final java.lang.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 abstract 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 static final class CompactDecimalFormat.CompactStyle extends java.lang.Enum {
    method public static android.icu.text.CompactDecimalFormat.CompactStyle valueOf(java.lang.String);
    method public static final android.icu.text.CompactDecimalFormat.CompactStyle[] values();
    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 java.lang.Object clone();
    method public java.lang.String getCurrencyPluralPattern(java.lang.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 deprecated int hashCode();
    method public void setCurrencyPluralPattern(java.lang.String, java.lang.String);
    method public void setLocale(android.icu.util.ULocale);
    method public void setPluralRules(java.lang.String);
  }

  public abstract class DateFormat extends android.icu.text.UFormat {
    ctor protected DateFormat();
    method public final java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition);
    method public abstract java.lang.StringBuffer format(android.icu.util.Calendar, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.StringBuffer format(java.util.Date, java.lang.StringBuffer, java.text.FieldPosition);
    method public final java.lang.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(java.lang.String);
    method public static final android.icu.text.DateFormat getInstanceForSkeleton(java.lang.String, java.util.Locale);
    method public static final android.icu.text.DateFormat getInstanceForSkeleton(java.lang.String, android.icu.util.ULocale);
    method public static final android.icu.text.DateFormat getInstanceForSkeleton(android.icu.util.Calendar, java.lang.String, java.util.Locale);
    method public static final android.icu.text.DateFormat getInstanceForSkeleton(android.icu.util.Calendar, java.lang.String, android.icu.util.ULocale);
    method public android.icu.text.NumberFormat getNumberFormat();
    method public static final android.icu.text.DateFormat getPatternInstance(java.lang.String);
    method public static final android.icu.text.DateFormat getPatternInstance(java.lang.String, java.util.Locale);
    method public static final android.icu.text.DateFormat getPatternInstance(java.lang.String, android.icu.util.ULocale);
    method public static final android.icu.text.DateFormat getPatternInstance(android.icu.util.Calendar, java.lang.String, java.util.Locale);
    method public static final android.icu.text.DateFormat getPatternInstance(android.icu.util.Calendar, java.lang.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(java.lang.String) throws java.text.ParseException;
    method public abstract void parse(java.lang.String, android.icu.util.Calendar, java.text.ParsePosition);
    method public java.util.Date parse(java.lang.String, java.text.ParsePosition);
    method public java.lang.Object parseObject(java.lang.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 java.lang.String ABBR_GENERIC_TZ = "v";
    field public static final java.lang.String ABBR_MONTH = "MMM";
    field public static final java.lang.String ABBR_MONTH_DAY = "MMMd";
    field public static final java.lang.String ABBR_MONTH_WEEKDAY_DAY = "MMMEd";
    field public static final java.lang.String ABBR_QUARTER = "QQQ";
    field public static final java.lang.String ABBR_SPECIFIC_TZ = "z";
    field public static final java.lang.String ABBR_UTC_TZ = "ZZZZ";
    field public static final java.lang.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 java.lang.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 java.lang.String GENERIC_TZ = "vvvv";
    field public static final java.lang.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 java.lang.String HOUR24 = "H";
    field public static final java.lang.String HOUR24_MINUTE = "Hm";
    field public static final java.lang.String HOUR24_MINUTE_SECOND = "Hms";
    field public static final java.lang.String HOUR_MINUTE = "jm";
    field public static final java.lang.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 java.lang.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 java.lang.String MINUTE = "m";
    field public static final int MINUTE_FIELD = 6; // 0x6
    field public static final java.lang.String MINUTE_SECOND = "ms";
    field public static final java.lang.String MONTH = "MMMM";
    field public static final java.lang.String MONTH_DAY = "MMMMd";
    field public static final int MONTH_FIELD = 2; // 0x2
    field public static final java.lang.String MONTH_WEEKDAY_DAY = "MMMMEEEEd";
    field public static final int NONE = -1; // 0xffffffff
    field public static final java.lang.String NUM_MONTH = "M";
    field public static final java.lang.String NUM_MONTH_DAY = "Md";
    field public static final java.lang.String NUM_MONTH_WEEKDAY_DAY = "MEd";
    field public static final java.lang.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 java.lang.String SECOND = "s";
    field public static final int SECOND_FIELD = 7; // 0x7
    field public static final int SHORT = 3; // 0x3
    field public static final java.lang.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 java.lang.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 java.lang.String YEAR = "y";
    field public static final java.lang.String YEAR_ABBR_MONTH = "yMMM";
    field public static final java.lang.String YEAR_ABBR_MONTH_DAY = "yMMMd";
    field public static final java.lang.String YEAR_ABBR_MONTH_WEEKDAY_DAY = "yMMMEd";
    field public static final java.lang.String YEAR_ABBR_QUARTER = "yQQQ";
    field public static final int YEAR_FIELD = 1; // 0x1
    field public static final java.lang.String YEAR_MONTH = "yMMMM";
    field public static final java.lang.String YEAR_MONTH_DAY = "yMMMMd";
    field public static final java.lang.String YEAR_MONTH_WEEKDAY_DAY = "yMMMMEEEEd";
    field public static final int YEAR_NAME_FIELD = 30; // 0x1e
    field public static final java.lang.String YEAR_NUM_MONTH = "yM";
    field public static final java.lang.String YEAR_NUM_MONTH_DAY = "yMd";
    field public static final java.lang.String YEAR_NUM_MONTH_WEEKDAY_DAY = "yMEd";
    field public static final java.lang.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 static final class DateFormat.BooleanAttribute extends java.lang.Enum {
    method public static android.icu.text.DateFormat.BooleanAttribute valueOf(java.lang.String);
    method public static final android.icu.text.DateFormat.BooleanAttribute[] values();
    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(java.lang.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(java.lang.Class<? extends android.icu.util.Calendar>, java.util.Locale);
    ctor public DateFormatSymbols(java.lang.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 java.lang.Object clone();
    method public java.lang.String[] getAmPmStrings();
    method public static java.util.Locale[] getAvailableLocales();
    method public java.lang.String[] getEraNames();
    method public java.lang.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 java.lang.String getLocalPatternChars();
    method public java.lang.String[] getMonths();
    method public java.lang.String[] getMonths(int, int);
    method public java.lang.String[] getQuarters(int, int);
    method public java.lang.String[] getShortMonths();
    method public java.lang.String[] getShortWeekdays();
    method public java.lang.String[] getWeekdays();
    method public java.lang.String[] getWeekdays(int, int);
    method public java.lang.String[] getYearNames(int, int);
    method public java.lang.String[] getZodiacNames(int, int);
    method public java.lang.String[][] getZoneStrings();
    method protected void initializeData(android.icu.util.ULocale, java.lang.String);
    method public void setAmPmStrings(java.lang.String[]);
    method public void setEraNames(java.lang.String[]);
    method public void setEras(java.lang.String[]);
    method public void setLocalPatternChars(java.lang.String);
    method public void setMonths(java.lang.String[]);
    method public void setMonths(java.lang.String[], int, int);
    method public void setQuarters(java.lang.String[], int, int);
    method public void setShortMonths(java.lang.String[]);
    method public void setShortWeekdays(java.lang.String[]);
    method public void setWeekdays(java.lang.String[], int, int);
    method public void setWeekdays(java.lang.String[]);
    method public void setYearNames(java.lang.String[], int, int);
    method public void setZodiacNames(java.lang.String[], int, int);
    method public void setZoneStrings(java.lang.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 synchronized java.lang.Object clone();
    method public final java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition);
    method public final synchronized java.lang.StringBuffer format(android.icu.util.DateInterval, java.lang.StringBuffer, java.text.FieldPosition);
    method public final synchronized java.lang.StringBuffer format(android.icu.util.Calendar, android.icu.util.Calendar, java.lang.StringBuffer, java.text.FieldPosition);
    method public synchronized android.icu.text.DateFormat getDateFormat();
    method public android.icu.text.DateIntervalInfo getDateIntervalInfo();
    method public static final android.icu.text.DateIntervalFormat getInstance(java.lang.String);
    method public static final android.icu.text.DateIntervalFormat getInstance(java.lang.String, java.util.Locale);
    method public static final android.icu.text.DateIntervalFormat getInstance(java.lang.String, android.icu.util.ULocale);
    method public static final android.icu.text.DateIntervalFormat getInstance(java.lang.String, android.icu.text.DateIntervalInfo);
    method public static final android.icu.text.DateIntervalFormat getInstance(java.lang.String, java.util.Locale, android.icu.text.DateIntervalInfo);
    method public static final android.icu.text.DateIntervalFormat getInstance(java.lang.String, android.icu.util.ULocale, android.icu.text.DateIntervalInfo);
    method public android.icu.util.TimeZone getTimeZone();
    method public deprecated java.lang.Object parseObject(java.lang.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 java.io.Serializable {
    ctor public DateIntervalInfo(android.icu.util.ULocale);
    ctor public DateIntervalInfo(java.util.Locale);
    method public java.lang.Object clone();
    method public android.icu.text.DateIntervalInfo cloneAsThawed();
    method public android.icu.text.DateIntervalInfo freeze();
    method public boolean getDefaultOrder();
    method public java.lang.String getFallbackIntervalPattern();
    method public android.icu.text.DateIntervalInfo.PatternInfo getIntervalPattern(java.lang.String, int);
    method public boolean isFrozen();
    method public void setFallbackIntervalPattern(java.lang.String);
    method public void setIntervalPattern(java.lang.String, int, java.lang.String);
  }

  public static final class DateIntervalInfo.PatternInfo implements java.lang.Cloneable java.io.Serializable {
    ctor public DateIntervalInfo.PatternInfo(java.lang.String, java.lang.String, boolean);
    method public boolean firstDateInPtnIsLaterDate();
    method public java.lang.String getFirstPart();
    method public java.lang.String getSecondPart();
    method public deprecated java.lang.String toString();
  }

  public class DateTimePatternGenerator implements java.lang.Cloneable android.icu.util.Freezable {
    ctor protected DateTimePatternGenerator();
    method public android.icu.text.DateTimePatternGenerator addPattern(java.lang.String, boolean, android.icu.text.DateTimePatternGenerator.PatternInfo);
    method public java.lang.Object clone();
    method public android.icu.text.DateTimePatternGenerator cloneAsThawed();
    method public android.icu.text.DateTimePatternGenerator freeze();
    method public java.lang.String getAppendItemFormat(int);
    method public java.lang.String getAppendItemName(int);
    method public java.lang.String getBaseSkeleton(java.lang.String);
    method public java.util.Set<java.lang.String> getBaseSkeletons(java.util.Set<java.lang.String>);
    method public java.lang.String getBestPattern(java.lang.String);
    method public java.lang.String getBestPattern(java.lang.String, int);
    method public java.lang.String getDateTimeFormat();
    method public java.lang.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 java.lang.String getSkeleton(java.lang.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 java.lang.String replaceFieldTypes(java.lang.String, java.lang.String);
    method public java.lang.String replaceFieldTypes(java.lang.String, java.lang.String, int);
    method public void setAppendItemFormat(int, java.lang.String);
    method public void setAppendItemName(int, java.lang.String);
    method public void setDateTimeFormat(java.lang.String);
    method public void setDecimal(java.lang.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 java.lang.String conflictingPattern;
    field public int status;
  }

  public class DecimalFormat extends android.icu.text.NumberFormat {
    ctor public DecimalFormat();
    ctor public DecimalFormat(java.lang.String);
    ctor public DecimalFormat(java.lang.String, android.icu.text.DecimalFormatSymbols);
    ctor public DecimalFormat(java.lang.String, android.icu.text.DecimalFormatSymbols, android.icu.text.CurrencyPluralInfo, int);
    method public synchronized void applyLocalizedPattern(java.lang.String);
    method public synchronized void applyPattern(java.lang.String);
    method public synchronized boolean areSignificantDigitsUsed();
    method public synchronized boolean equals(java.lang.Object);
    method public java.lang.StringBuffer format(double, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.StringBuffer format(long, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.StringBuffer format(java.math.BigInteger, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.StringBuffer format(java.math.BigDecimal, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.StringBuffer format(android.icu.math.BigDecimal, java.lang.StringBuffer, java.text.FieldPosition);
    method public synchronized android.icu.util.Currency getCurrency();
    method public synchronized android.icu.text.CurrencyPluralInfo getCurrencyPluralInfo();
    method public synchronized android.icu.util.Currency.CurrencyUsage getCurrencyUsage();
    method public synchronized android.icu.text.DecimalFormatSymbols getDecimalFormatSymbols();
    method public synchronized int getFormatWidth();
    method public synchronized int getGroupingSize();
    method public synchronized java.math.MathContext getMathContext();
    method public synchronized android.icu.math.MathContext getMathContextICU();
    method public synchronized int getMaximumFractionDigits();
    method public synchronized int getMaximumIntegerDigits();
    method public synchronized int getMaximumSignificantDigits();
    method public synchronized byte getMinimumExponentDigits();
    method public synchronized int getMinimumFractionDigits();
    method public synchronized int getMinimumIntegerDigits();
    method public synchronized int getMinimumSignificantDigits();
    method public synchronized int getMultiplier();
    method public synchronized java.lang.String getNegativePrefix();
    method public synchronized java.lang.String getNegativeSuffix();
    method public synchronized char getPadCharacter();
    method public synchronized int getPadPosition();
    method public deprecated int getParseMaxDigits();
    method public synchronized java.lang.String getPositivePrefix();
    method public synchronized java.lang.String getPositiveSuffix();
    method public synchronized java.math.BigDecimal getRoundingIncrement();
    method public synchronized int getRoundingMode();
    method public synchronized int getSecondaryGroupingSize();
    method public synchronized int hashCode();
    method public synchronized boolean isDecimalPatternMatchRequired();
    method public synchronized boolean isDecimalSeparatorAlwaysShown();
    method public synchronized boolean isExponentSignAlwaysShown();
    method public synchronized boolean isGroupingUsed();
    method public synchronized boolean isParseBigDecimal();
    method public synchronized boolean isParseIntegerOnly();
    method public synchronized boolean isParseStrict();
    method public synchronized boolean isScientificNotation();
    method public java.lang.Number parse(java.lang.String, java.text.ParsePosition);
    method public synchronized void setCurrency(android.icu.util.Currency);
    method public synchronized void setCurrencyPluralInfo(android.icu.text.CurrencyPluralInfo);
    method public synchronized void setCurrencyUsage(android.icu.util.Currency.CurrencyUsage);
    method public synchronized void setDecimalFormatSymbols(android.icu.text.DecimalFormatSymbols);
    method public synchronized void setDecimalPatternMatchRequired(boolean);
    method public synchronized void setDecimalSeparatorAlwaysShown(boolean);
    method public synchronized void setExponentSignAlwaysShown(boolean);
    method public synchronized void setFormatWidth(int);
    method public synchronized void setGroupingSize(int);
    method public synchronized void setGroupingUsed(boolean);
    method public synchronized void setMathContext(java.math.MathContext);
    method public synchronized void setMathContextICU(android.icu.math.MathContext);
    method public synchronized void setMaximumFractionDigits(int);
    method public synchronized void setMaximumIntegerDigits(int);
    method public synchronized void setMaximumSignificantDigits(int);
    method public synchronized void setMinimumExponentDigits(byte);
    method public synchronized void setMinimumFractionDigits(int);
    method public synchronized void setMinimumIntegerDigits(int);
    method public synchronized void setMinimumSignificantDigits(int);
    method public synchronized void setMultiplier(int);
    method public synchronized void setNegativePrefix(java.lang.String);
    method public synchronized void setNegativeSuffix(java.lang.String);
    method public synchronized void setPadCharacter(char);
    method public synchronized void setPadPosition(int);
    method public synchronized void setParseBigDecimal(boolean);
    method public synchronized void setParseIntegerOnly(boolean);
    method public deprecated void setParseMaxDigits(int);
    method public synchronized void setParseStrict(boolean);
    method public synchronized void setPositivePrefix(java.lang.String);
    method public synchronized void setPositiveSuffix(java.lang.String);
    method public synchronized void setRoundingIncrement(java.math.BigDecimal);
    method public synchronized void setRoundingIncrement(android.icu.math.BigDecimal);
    method public synchronized void setRoundingIncrement(double);
    method public synchronized void setRoundingMode(int);
    method public synchronized void setScientificNotation(boolean);
    method public synchronized void setSecondaryGroupingSize(int);
    method public synchronized void setSignificantDigitsUsed(boolean);
    method public synchronized java.lang.String toLocalizedPattern();
    method public synchronized java.lang.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 java.lang.Object clone();
    method public static java.util.Locale[] getAvailableLocales();
    method public android.icu.util.Currency getCurrency();
    method public java.lang.String getCurrencySymbol();
    method public char getDecimalSeparator();
    method public java.lang.String getDecimalSeparatorString();
    method public char getDigit();
    method public java.lang.String[] getDigitStrings();
    method public char[] getDigits();
    method public java.lang.String getExponentMultiplicationSign();
    method public java.lang.String getExponentSeparator();
    method public char getGroupingSeparator();
    method public java.lang.String getGroupingSeparatorString();
    method public java.lang.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 java.lang.String getInternationalCurrencySymbol();
    method public java.util.Locale getLocale();
    method public char getMinusSign();
    method public java.lang.String getMinusSignString();
    method public char getMonetaryDecimalSeparator();
    method public java.lang.String getMonetaryDecimalSeparatorString();
    method public char getMonetaryGroupingSeparator();
    method public java.lang.String getMonetaryGroupingSeparatorString();
    method public java.lang.String getNaN();
    method public char getPadEscape();
    method public java.lang.String getPatternForCurrencySpacing(int, boolean);
    method public char getPatternSeparator();
    method public char getPerMill();
    method public java.lang.String getPerMillString();
    method public char getPercent();
    method public java.lang.String getPercentString();
    method public char getPlusSign();
    method public java.lang.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(java.lang.String);
    method public void setDecimalSeparator(char);
    method public void setDecimalSeparatorString(java.lang.String);
    method public void setDigit(char);
    method public void setDigitStrings(java.lang.String[]);
    method public void setExponentMultiplicationSign(java.lang.String);
    method public void setExponentSeparator(java.lang.String);
    method public void setGroupingSeparator(char);
    method public void setGroupingSeparatorString(java.lang.String);
    method public void setInfinity(java.lang.String);
    method public void setInternationalCurrencySymbol(java.lang.String);
    method public void setMinusSign(char);
    method public void setMinusSignString(java.lang.String);
    method public void setMonetaryDecimalSeparator(char);
    method public void setMonetaryDecimalSeparatorString(java.lang.String);
    method public void setMonetaryGroupingSeparator(char);
    method public void setMonetaryGroupingSeparatorString(java.lang.String);
    method public void setNaN(java.lang.String);
    method public void setPadEscape(char);
    method public void setPatternForCurrencySpacing(int, boolean, java.lang.String);
    method public void setPatternSeparator(char);
    method public void setPerMill(char);
    method public void setPerMillString(java.lang.String);
    method public void setPercent(char);
    method public void setPercentString(java.lang.String);
    method public void setPlusSign(char);
    method public void setPlusSignString(java.lang.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 final class DisplayContext extends java.lang.Enum {
    method public android.icu.text.DisplayContext.Type type();
    method public int value();
    method public static android.icu.text.DisplayContext valueOf(java.lang.String);
    method public static final android.icu.text.DisplayContext[] values();
    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 static final class DisplayContext.Type extends java.lang.Enum {
    method public static android.icu.text.DisplayContext.Type valueOf(java.lang.String);
    method public static final android.icu.text.DisplayContext.Type[] values();
    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 abstract class IDNA {
    method public static android.icu.text.IDNA getUTS46Instance(int);
    method public abstract java.lang.StringBuilder labelToASCII(java.lang.CharSequence, java.lang.StringBuilder, android.icu.text.IDNA.Info);
    method public abstract java.lang.StringBuilder labelToUnicode(java.lang.CharSequence, java.lang.StringBuilder, android.icu.text.IDNA.Info);
    method public abstract java.lang.StringBuilder nameToASCII(java.lang.CharSequence, java.lang.StringBuilder, android.icu.text.IDNA.Info);
    method public abstract java.lang.StringBuilder nameToUnicode(java.lang.CharSequence, java.lang.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 static final class IDNA.Error extends java.lang.Enum {
    method public static android.icu.text.IDNA.Error valueOf(java.lang.String);
    method public static final android.icu.text.IDNA.Error[] values();
    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 java.lang.String format(java.lang.Object...);
    method public java.lang.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 java.lang.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 java.lang.String keyDisplayName(java.lang.String);
    method public abstract java.lang.String keyValueDisplayName(java.lang.String, java.lang.String);
    method public abstract java.lang.String languageDisplayName(java.lang.String);
    method public abstract java.lang.String localeDisplayName(android.icu.util.ULocale);
    method public abstract java.lang.String localeDisplayName(java.util.Locale);
    method public abstract java.lang.String localeDisplayName(java.lang.String);
    method public abstract java.lang.String regionDisplayName(java.lang.String);
    method public abstract java.lang.String scriptDisplayName(java.lang.String);
    method public abstract java.lang.String scriptDisplayName(int);
    method public abstract java.lang.String variantDisplayName(java.lang.String);
  }

  public static final class LocaleDisplayNames.DialectHandling extends java.lang.Enum {
    method public static android.icu.text.LocaleDisplayNames.DialectHandling valueOf(java.lang.String);
    method public static final android.icu.text.LocaleDisplayNames.DialectHandling[] values();
    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, java.lang.String, java.lang.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 java.lang.String nameInDisplayLocale;
    field public final java.lang.String nameInSelf;
  }

  public class MeasureFormat extends android.icu.text.UFormat {
    method public final boolean equals(java.lang.Object);
    method public java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.StringBuilder formatMeasurePerUnit(android.icu.util.Measure, android.icu.util.MeasureUnit, java.lang.StringBuilder, java.text.FieldPosition);
    method public final java.lang.String formatMeasures(android.icu.util.Measure...);
    method public java.lang.StringBuilder formatMeasures(java.lang.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 java.lang.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(java.lang.String, java.text.ParsePosition);
  }

  public static final class MeasureFormat.FormatWidth extends java.lang.Enum {
    method public static android.icu.text.MeasureFormat.FormatWidth valueOf(java.lang.String);
    method public static final android.icu.text.MeasureFormat.FormatWidth[] values();
    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(java.lang.String);
    ctor public MessageFormat(java.lang.String, java.util.Locale);
    ctor public MessageFormat(java.lang.String, android.icu.util.ULocale);
    method public void applyPattern(java.lang.String);
    method public void applyPattern(java.lang.String, android.icu.text.MessagePattern.ApostropheMode);
    method public static java.lang.String autoQuoteApostrophe(java.lang.String);
    method public final java.lang.StringBuffer format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition);
    method public final java.lang.StringBuffer format(java.util.Map<java.lang.String, java.lang.Object>, java.lang.StringBuffer, java.text.FieldPosition);
    method public static java.lang.String format(java.lang.String, java.lang.Object...);
    method public static java.lang.String format(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>);
    method public final java.lang.StringBuffer format(java.lang.Object, java.lang.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(java.lang.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 java.lang.Object[] parse(java.lang.String, java.text.ParsePosition);
    method public java.lang.Object[] parse(java.lang.String) throws java.text.ParseException;
    method public java.lang.Object parseObject(java.lang.String, java.text.ParsePosition);
    method public java.util.Map<java.lang.String, java.lang.Object> parseToMap(java.lang.String, java.text.ParsePosition);
    method public java.util.Map<java.lang.String, java.lang.Object> parseToMap(java.lang.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(java.lang.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 java.lang.String toPattern();
    method public boolean usesNamedArguments();
  }

  public static class MessageFormat.Field extends java.text.Format.Field {
    ctor protected MessageFormat.Field(java.lang.String);
    field public static final android.icu.text.MessageFormat.Field ARGUMENT;
  }

  public final class MessagePattern implements java.lang.Cloneable android.icu.util.Freezable {
    ctor public MessagePattern();
    ctor public MessagePattern(android.icu.text.MessagePattern.ApostropheMode);
    ctor public MessagePattern(java.lang.String);
    method public java.lang.String autoQuoteApostropheDeep();
    method public void clear();
    method public void clearPatternAndSetApostropheMode(android.icu.text.MessagePattern.ApostropheMode);
    method public java.lang.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 java.lang.String getPatternString();
    method public double getPluralOffset(int);
    method public java.lang.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(java.lang.String);
    method public android.icu.text.MessagePattern parseChoiceStyle(java.lang.String);
    method public android.icu.text.MessagePattern parsePluralStyle(java.lang.String);
    method public android.icu.text.MessagePattern parseSelectStyle(java.lang.String);
    method public boolean partSubstringMatches(android.icu.text.MessagePattern.Part, java.lang.String);
    method public static int validateArgumentName(java.lang.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 static final class MessagePattern.ApostropheMode extends java.lang.Enum {
    method public static android.icu.text.MessagePattern.ApostropheMode valueOf(java.lang.String);
    method public static final android.icu.text.MessagePattern.ApostropheMode[] values();
    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 static final class MessagePattern.ArgType extends java.lang.Enum {
    method public boolean hasPluralStyle();
    method public static android.icu.text.MessagePattern.ArgType valueOf(java.lang.String);
    method public static final android.icu.text.MessagePattern.ArgType[] values();
    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 static final class MessagePattern.Part.Type extends java.lang.Enum {
    method public boolean hasNumericValue();
    method public static android.icu.text.MessagePattern.Part.Type valueOf(java.lang.String);
    method public static final android.icu.text.MessagePattern.Part.Type[] values();
    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 public deprecated java.lang.Object clone();
    method public static int compare(char[], int, int, char[], int, int, int);
    method public static int compare(java.lang.String, java.lang.String, int);
    method public static int compare(char[], char[], int);
    method public static int compare(int, int, int);
    method public static int compare(int, java.lang.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 java.lang.StringBuilder append(java.lang.StringBuilder, java.lang.CharSequence);
    method public int composePair(int, int);
    method public int getCombiningClass(int);
    method public abstract java.lang.String getDecomposition(int);
    method public static android.icu.text.Normalizer2 getInstance(java.io.InputStream, java.lang.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 java.lang.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(java.lang.CharSequence);
    method public java.lang.String normalize(java.lang.CharSequence);
    method public abstract java.lang.StringBuilder normalize(java.lang.CharSequence, java.lang.StringBuilder);
    method public abstract java.lang.Appendable normalize(java.lang.CharSequence, java.lang.Appendable);
    method public abstract java.lang.StringBuilder normalizeSecondAndAppend(java.lang.StringBuilder, java.lang.CharSequence);
    method public abstract android.icu.text.Normalizer.QuickCheckResult quickCheck(java.lang.CharSequence);
    method public abstract int spanQuickCheckYes(java.lang.CharSequence);
  }

  public static final class Normalizer2.Mode extends java.lang.Enum {
    method public static android.icu.text.Normalizer2.Mode valueOf(java.lang.String);
    method public static final android.icu.text.Normalizer2.Mode[] values();
    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 java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition);
    method public final java.lang.String format(double);
    method public final java.lang.String format(long);
    method public final java.lang.String format(java.math.BigInteger);
    method public final java.lang.String format(java.math.BigDecimal);
    method public final java.lang.String format(android.icu.math.BigDecimal);
    method public final java.lang.String format(android.icu.util.CurrencyAmount);
    method public abstract java.lang.StringBuffer format(double, java.lang.StringBuffer, java.text.FieldPosition);
    method public abstract java.lang.StringBuffer format(long, java.lang.StringBuffer, java.text.FieldPosition);
    method public abstract java.lang.StringBuffer format(java.math.BigInteger, java.lang.StringBuffer, java.text.FieldPosition);
    method public abstract java.lang.StringBuffer format(java.math.BigDecimal, java.lang.StringBuffer, java.text.FieldPosition);
    method public abstract java.lang.StringBuffer format(android.icu.math.BigDecimal, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.StringBuffer format(android.icu.util.CurrencyAmount, java.lang.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 java.lang.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 java.lang.Number parse(java.lang.String, java.text.ParsePosition);
    method public java.lang.Number parse(java.lang.String) throws java.text.ParseException;
    method public android.icu.util.CurrencyAmount parseCurrency(java.lang.CharSequence, java.text.ParsePosition);
    method public final java.lang.Object parseObject(java.lang.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(java.lang.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 java.lang.String[] getAvailableNames();
    method public java.lang.String getDescription();
    method public static android.icu.text.NumberingSystem getInstance(int, boolean, java.lang.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(java.lang.String);
    method public java.lang.String getName();
    method public int getRadix();
    method public boolean isAlgorithmic();
    method public static boolean isValidDigitString(java.lang.String);
  }

  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(java.lang.String);
    ctor public PluralFormat(android.icu.util.ULocale, java.lang.String);
    ctor public PluralFormat(android.icu.text.PluralRules, java.lang.String);
    ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules, java.lang.String);
    ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules.PluralType, java.lang.String);
    method public void applyPattern(java.lang.String);
    method public boolean equals(android.icu.text.PluralFormat);
    method public final java.lang.String format(double);
    method public java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.Number parse(java.lang.String, java.text.ParsePosition);
    method public java.lang.Object parseObject(java.lang.String, java.text.ParsePosition);
    method public void setNumberFormat(android.icu.text.NumberFormat);
    method public java.lang.String toPattern();
  }

  public class PluralRules implements java.io.Serializable {
    method public static android.icu.text.PluralRules createRules(java.lang.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(java.lang.String);
    method public java.util.Set<java.lang.String> getKeywords();
    method public java.util.Collection<java.lang.Double> getSamples(java.lang.String);
    method public double getUniqueKeywordValue(java.lang.String);
    method public deprecated int hashCode();
    method public static android.icu.text.PluralRules parseDescription(java.lang.String) throws java.text.ParseException;
    method public java.lang.String select(double);
    field public static final android.icu.text.PluralRules DEFAULT;
    field public static final java.lang.String KEYWORD_FEW = "few";
    field public static final java.lang.String KEYWORD_MANY = "many";
    field public static final java.lang.String KEYWORD_ONE = "one";
    field public static final java.lang.String KEYWORD_OTHER = "other";
    field public static final java.lang.String KEYWORD_TWO = "two";
    field public static final java.lang.String KEYWORD_ZERO = "zero";
    field public static final double NO_UNIQUE_VALUE = -0.00123456777;
  }

  public static final class PluralRules.PluralType extends java.lang.Enum {
    method public static android.icu.text.PluralRules.PluralType valueOf(java.lang.String);
    method public static final android.icu.text.PluralRules.PluralType[] values();
    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 java.lang.String combineDateAndTime(java.lang.String, java.lang.String);
    method public java.lang.String format(double, android.icu.text.RelativeDateTimeFormatter.Direction, android.icu.text.RelativeDateTimeFormatter.RelativeUnit);
    method public java.lang.String format(android.icu.text.RelativeDateTimeFormatter.Direction, android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit);
    method public java.lang.String format(double, android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit);
    method public java.lang.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 static final class RelativeDateTimeFormatter.AbsoluteUnit extends java.lang.Enum {
    method public static android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit valueOf(java.lang.String);
    method public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit[] values();
    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 static final class RelativeDateTimeFormatter.Direction extends java.lang.Enum {
    method public static android.icu.text.RelativeDateTimeFormatter.Direction valueOf(java.lang.String);
    method public static final android.icu.text.RelativeDateTimeFormatter.Direction[] values();
    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 static final class RelativeDateTimeFormatter.RelativeDateTimeUnit extends java.lang.Enum {
    method public static android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit valueOf(java.lang.String);
    method public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit[] values();
    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 static final class RelativeDateTimeFormatter.RelativeUnit extends java.lang.Enum {
    method public static android.icu.text.RelativeDateTimeFormatter.RelativeUnit valueOf(java.lang.String);
    method public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit[] values();
    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 static final class RelativeDateTimeFormatter.Style extends java.lang.Enum {
    method public static android.icu.text.RelativeDateTimeFormatter.Style valueOf(java.lang.String);
    method public static final android.icu.text.RelativeDateTimeFormatter.Style[] values();
    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 abstract interface Replaceable {
    method public abstract int char32At(int);
    method public abstract char charAt(int);
    method public abstract void copy(int, int, int);
    method public abstract void getChars(int, int, char[], int);
    method public abstract boolean hasMetaData();
    method public abstract int length();
    method public abstract void replace(int, int, java.lang.String);
    method public abstract void replace(int, int, char[], int, int);
  }

  public final class RuleBasedCollator extends android.icu.text.Collator {
    ctor public RuleBasedCollator(java.lang.String) throws java.lang.Exception;
    method public android.icu.text.RuleBasedCollator cloneAsThawed();
    method public int compare(java.lang.String, java.lang.String);
    method public android.icu.text.CollationElementIterator getCollationElementIterator(java.lang.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(java.lang.String);
    method public void getContractionsAndExpansions(android.icu.text.UnicodeSet, android.icu.text.UnicodeSet, boolean) throws java.lang.Exception;
    method public boolean getNumericCollation();
    method public java.lang.String getRules();
    method public java.lang.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 java.lang.String format(java.lang.Object);
    method public static android.icu.text.ScientificNumberFormatter getMarkupInstance(android.icu.util.ULocale, java.lang.String, java.lang.String);
    method public static android.icu.text.ScientificNumberFormatter getMarkupInstance(android.icu.text.DecimalFormat, java.lang.String, java.lang.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 java.lang.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 static final class SearchIterator.ElementComparisonType extends java.lang.Enum {
    method public static android.icu.text.SearchIterator.ElementComparisonType valueOf(java.lang.String);
    method public static final android.icu.text.SearchIterator.ElementComparisonType[] values();
    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(java.lang.String);
    method public void applyPattern(java.lang.String);
    method public final java.lang.String format(java.lang.String);
    method public java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.Object parseObject(java.lang.String, java.text.ParsePosition);
    method public java.lang.String toPattern();
  }

  public class SimpleDateFormat extends android.icu.text.DateFormat {
    ctor public SimpleDateFormat();
    ctor public SimpleDateFormat(java.lang.String);
    ctor public SimpleDateFormat(java.lang.String, java.util.Locale);
    ctor public SimpleDateFormat(java.lang.String, android.icu.util.ULocale);
    ctor public SimpleDateFormat(java.lang.String, java.lang.String, android.icu.util.ULocale);
    ctor public SimpleDateFormat(java.lang.String, android.icu.text.DateFormatSymbols);
    method public void applyLocalizedPattern(java.lang.String);
    method public void applyPattern(java.lang.String);
    method public java.lang.StringBuffer format(android.icu.util.Calendar, java.lang.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(java.lang.String, int, int, java.lang.String[], android.icu.util.Calendar);
    method protected int matchString(java.lang.String, int, int, java.lang.String[], android.icu.util.Calendar);
    method public void parse(java.lang.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(java.lang.String, android.icu.text.NumberFormat);
    method public void setTimeZoneFormat(android.icu.text.TimeZoneFormat);
    method protected java.lang.String subFormat(char, int, int, java.text.FieldPosition, android.icu.text.DateFormatSymbols, android.icu.util.Calendar) throws java.lang.IllegalArgumentException;
    method protected int subParse(java.lang.String, int, char, int, boolean, boolean, boolean[], android.icu.util.Calendar);
    method public java.lang.String toLocalizedPattern();
    method public java.lang.String toPattern();
    method protected java.lang.String zeroPaddingNumber(long, int, int);
  }

  public class StringPrepParseException extends java.text.ParseException {
    ctor public StringPrepParseException(java.lang.String, int);
    ctor public StringPrepParseException(java.lang.String, int, java.lang.String, int);
    ctor public StringPrepParseException(java.lang.String, int, java.lang.String, int, int);
    method public int getError();
    method public deprecated int hashCode();
    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(java.lang.String, java.text.CharacterIterator, android.icu.text.RuleBasedCollator, android.icu.text.BreakIterator);
    ctor public StringSearch(java.lang.String, java.text.CharacterIterator, android.icu.text.RuleBasedCollator);
    ctor public StringSearch(java.lang.String, java.text.CharacterIterator, java.util.Locale);
    ctor public StringSearch(java.lang.String, java.text.CharacterIterator, android.icu.util.ULocale);
    ctor public StringSearch(java.lang.String, java.lang.String);
    method public android.icu.text.RuleBasedCollator getCollator();
    method public int getIndex();
    method public java.lang.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(java.lang.String);
  }

  public abstract interface SymbolTable {
    method public abstract char[] lookup(java.lang.String);
    method public abstract android.icu.text.UnicodeMatcher lookupMatcher(int);
    method public abstract java.lang.String parseReference(java.lang.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 java.io.Serializable {
    ctor protected TimeZoneFormat(android.icu.util.ULocale);
    method public android.icu.text.TimeZoneFormat cloneAsThawed();
    method public final java.lang.String format(android.icu.text.TimeZoneFormat.Style, android.icu.util.TimeZone, long);
    method public java.lang.String format(android.icu.text.TimeZoneFormat.Style, android.icu.util.TimeZone, long, android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>);
    method public java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition);
    method public final java.lang.String formatOffsetISO8601Basic(int, boolean, boolean, boolean);
    method public final java.lang.String formatOffsetISO8601Extended(int, boolean, boolean, boolean);
    method public java.lang.String formatOffsetLocalizedGMT(int);
    method public java.lang.String formatOffsetShortLocalizedGMT(int);
    method public android.icu.text.TimeZoneFormat freeze();
    method public java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption> getDefaultParseOptions();
    method public java.lang.String getGMTOffsetDigits();
    method public java.lang.String getGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType);
    method public java.lang.String getGMTPattern();
    method public java.lang.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, java.lang.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, java.lang.String, java.text.ParsePosition, android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>);
    method public final android.icu.util.TimeZone parse(java.lang.String, java.text.ParsePosition);
    method public final android.icu.util.TimeZone parse(java.lang.String) throws java.text.ParseException;
    method public java.lang.Object parseObject(java.lang.String, java.text.ParsePosition);
    method public final int parseOffsetISO8601(java.lang.String, java.text.ParsePosition);
    method public int parseOffsetLocalizedGMT(java.lang.String, java.text.ParsePosition);
    method public int parseOffsetShortLocalizedGMT(java.lang.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(java.lang.String);
    method public android.icu.text.TimeZoneFormat setGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType, java.lang.String);
    method public android.icu.text.TimeZoneFormat setGMTPattern(java.lang.String);
    method public android.icu.text.TimeZoneFormat setGMTZeroFormat(java.lang.String);
    method public android.icu.text.TimeZoneFormat setTimeZoneNames(android.icu.text.TimeZoneNames);
  }

  public static final class TimeZoneFormat.GMTOffsetPatternType extends java.lang.Enum {
    method public static android.icu.text.TimeZoneFormat.GMTOffsetPatternType valueOf(java.lang.String);
    method public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType[] values();
    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 static final class TimeZoneFormat.ParseOption extends java.lang.Enum {
    method public static android.icu.text.TimeZoneFormat.ParseOption valueOf(java.lang.String);
    method public static final android.icu.text.TimeZoneFormat.ParseOption[] values();
    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 static final class TimeZoneFormat.Style extends java.lang.Enum {
    method public static android.icu.text.TimeZoneFormat.Style valueOf(java.lang.String);
    method public static final android.icu.text.TimeZoneFormat.Style[] values();
    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 static final class TimeZoneFormat.TimeType extends java.lang.Enum {
    method public static android.icu.text.TimeZoneFormat.TimeType valueOf(java.lang.String);
    method public static final android.icu.text.TimeZoneFormat.TimeType[] values();
    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(java.lang.String);
    method public final java.lang.String getDisplayName(java.lang.String, android.icu.text.TimeZoneNames.NameType, long);
    method public java.lang.String getExemplarLocationName(java.lang.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 java.lang.String getMetaZoneDisplayName(java.lang.String, android.icu.text.TimeZoneNames.NameType);
    method public abstract java.lang.String getMetaZoneID(java.lang.String, long);
    method public abstract java.lang.String getReferenceZoneID(java.lang.String, java.lang.String);
    method public static android.icu.text.TimeZoneNames getTZDBInstance(android.icu.util.ULocale);
    method public abstract java.lang.String getTimeZoneDisplayName(java.lang.String, android.icu.text.TimeZoneNames.NameType);
  }

  public static final class TimeZoneNames.NameType extends java.lang.Enum {
    method public static android.icu.text.TimeZoneNames.NameType valueOf(java.lang.String);
    method public static final android.icu.text.TimeZoneNames.NameType[] values();
    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 UCharacterIterator implements java.lang.Cloneable {
    ctor protected UCharacterIterator();
    method public java.lang.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(java.lang.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(java.lang.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 java.lang.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 abstract interface UnicodeMatcher {
    method public abstract void addMatchSetTo(android.icu.text.UnicodeSet);
    method public abstract int matches(android.icu.text.Replaceable, int[], int, boolean);
    method public abstract boolean matchesIndexValue(int);
    method public abstract java.lang.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.util.Freezable java.lang.Iterable {
    ctor public UnicodeSet();
    ctor public UnicodeSet(android.icu.text.UnicodeSet);
    ctor public UnicodeSet(int, int);
    ctor public UnicodeSet(int...);
    ctor public UnicodeSet(java.lang.String);
    ctor public UnicodeSet(java.lang.String, boolean);
    ctor public UnicodeSet(java.lang.String, int);
    ctor public UnicodeSet(java.lang.String, java.text.ParsePosition, android.icu.text.SymbolTable);
    ctor public UnicodeSet(java.lang.String, java.text.ParsePosition, android.icu.text.SymbolTable, int);
    method public java.lang.StringBuffer _generatePattern(java.lang.StringBuffer, boolean);
    method public java.lang.StringBuffer _generatePattern(java.lang.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(java.lang.CharSequence);
    method public android.icu.text.UnicodeSet add(java.lang.Iterable<?>);
    method public android.icu.text.UnicodeSet addAll(int, int);
    method public final android.icu.text.UnicodeSet addAll(java.lang.CharSequence);
    method public android.icu.text.UnicodeSet addAll(android.icu.text.UnicodeSet);
    method public android.icu.text.UnicodeSet addAll(java.lang.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(java.lang.String);
    method public android.icu.text.UnicodeSet applyPattern(java.lang.String, boolean);
    method public android.icu.text.UnicodeSet applyPattern(java.lang.String, int);
    method public android.icu.text.UnicodeSet applyPropertyAlias(java.lang.String, java.lang.String);
    method public android.icu.text.UnicodeSet applyPropertyAlias(java.lang.String, java.lang.String, android.icu.text.SymbolTable);
    method public int charAt(int);
    method public android.icu.text.UnicodeSet clear();
    method public java.lang.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(java.lang.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(java.lang.CharSequence);
    method public final android.icu.text.UnicodeSet complementAll(java.lang.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(java.lang.CharSequence);
    method public boolean containsAll(android.icu.text.UnicodeSet);
    method public boolean containsAll(java.lang.String);
    method public <T extends java.lang.CharSequence> boolean containsAll(java.lang.Iterable<T>);
    method public boolean containsNone(int, int);
    method public boolean containsNone(android.icu.text.UnicodeSet);
    method public boolean containsNone(java.lang.CharSequence);
    method public <T extends java.lang.CharSequence> boolean containsNone(java.lang.Iterable<T>);
    method public final boolean containsSome(int, int);
    method public final boolean containsSome(android.icu.text.UnicodeSet);
    method public final boolean containsSome(java.lang.CharSequence);
    method public final <T extends java.lang.CharSequence> boolean containsSome(java.lang.Iterable<T>);
    method public android.icu.text.UnicodeSet freeze();
    method public static android.icu.text.UnicodeSet from(java.lang.CharSequence);
    method public static android.icu.text.UnicodeSet fromAll(java.lang.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 java.lang.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(java.lang.CharSequence);
    method public final android.icu.text.UnicodeSet removeAll(java.lang.CharSequence);
    method public android.icu.text.UnicodeSet removeAll(android.icu.text.UnicodeSet);
    method public <T extends java.lang.CharSequence> android.icu.text.UnicodeSet removeAll(java.lang.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(java.lang.CharSequence);
    method public final android.icu.text.UnicodeSet retainAll(java.lang.CharSequence);
    method public android.icu.text.UnicodeSet retainAll(android.icu.text.UnicodeSet);
    method public <T extends java.lang.CharSequence> android.icu.text.UnicodeSet retainAll(java.lang.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(java.lang.CharSequence, android.icu.text.UnicodeSet.SpanCondition);
    method public int span(java.lang.CharSequence, int, android.icu.text.UnicodeSet.SpanCondition);
    method public int spanBack(java.lang.CharSequence, android.icu.text.UnicodeSet.SpanCondition);
    method public int spanBack(java.lang.CharSequence, int, android.icu.text.UnicodeSet.SpanCondition);
    method public java.util.Collection<java.lang.String> strings();
    method public java.lang.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 static final class UnicodeSet.ComparisonStyle extends java.lang.Enum {
    method public static android.icu.text.UnicodeSet.ComparisonStyle valueOf(java.lang.String);
    method public static final android.icu.text.UnicodeSet.ComparisonStyle[] values();
    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 static final class UnicodeSet.SpanCondition extends java.lang.Enum {
    method public static android.icu.text.UnicodeSet.SpanCondition valueOf(java.lang.String);
    method public static final android.icu.text.UnicodeSet.SpanCondition[] values();
    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 java.lang.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 java.lang.String string;
  }

  public class UnicodeSetSpanner {
    ctor public UnicodeSetSpanner(android.icu.text.UnicodeSet);
    method public int countIn(java.lang.CharSequence);
    method public int countIn(java.lang.CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod);
    method public int countIn(java.lang.CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod, android.icu.text.UnicodeSet.SpanCondition);
    method public java.lang.String deleteFrom(java.lang.CharSequence);
    method public java.lang.String deleteFrom(java.lang.CharSequence, android.icu.text.UnicodeSet.SpanCondition);
    method public android.icu.text.UnicodeSet getUnicodeSet();
    method public java.lang.String replaceFrom(java.lang.CharSequence, java.lang.CharSequence);
    method public java.lang.String replaceFrom(java.lang.CharSequence, java.lang.CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod);
    method public java.lang.String replaceFrom(java.lang.CharSequence, java.lang.CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod, android.icu.text.UnicodeSet.SpanCondition);
    method public java.lang.CharSequence trim(java.lang.CharSequence);
    method public java.lang.CharSequence trim(java.lang.CharSequence, android.icu.text.UnicodeSetSpanner.TrimOption);
    method public java.lang.CharSequence trim(java.lang.CharSequence, android.icu.text.UnicodeSetSpanner.TrimOption, android.icu.text.UnicodeSet.SpanCondition);
  }

  public static final class UnicodeSetSpanner.CountMethod extends java.lang.Enum {
    method public static android.icu.text.UnicodeSetSpanner.CountMethod valueOf(java.lang.String);
    method public static final android.icu.text.UnicodeSetSpanner.CountMethod[] values();
    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 static final class UnicodeSetSpanner.TrimOption extends java.lang.Enum {
    method public static android.icu.text.UnicodeSetSpanner.TrimOption valueOf(java.lang.String);
    method public static final android.icu.text.UnicodeSetSpanner.TrimOption[] values();
    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 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(java.lang.Object);
    method public boolean before(java.lang.Object);
    method public final void clear();
    method public final void clear(int);
    method public java.lang.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 protected deprecated int computeMillisInDay();
    method protected void computeTime();
    method protected deprecated int computeZoneOffset(long, int);
    method public int fieldDifference(java.util.Date, int);
    method protected java.lang.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 java.lang.String getDisplayName(java.util.Locale);
    method public java.lang.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 java.lang.String[] getKeywordValuesForLocale(java.lang.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 java.lang.String getType();
    method public android.icu.util.Calendar.WeekData getWeekData();
    method public static android.icu.util.Calendar.WeekData getWeekDataForRegion(java.lang.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(java.lang.String, java.util.Locale);
    method protected android.icu.text.DateFormat handleGetDateFormat(java.lang.String, java.lang.String, java.util.Locale);
    method protected android.icu.text.DateFormat handleGetDateFormat(java.lang.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 protected static final deprecated 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 protected static final deprecated 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(java.lang.String, java.lang.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 protected deprecated void handleComputeFields(int);
    method protected deprecated int handleGetExtendedYear();
    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(java.lang.String);
    method public static java.util.Set<android.icu.util.Currency> getAvailableCurrencies();
    method public static java.lang.String[] getAvailableCurrencyCodes(android.icu.util.ULocale, java.util.Date);
    method public static java.lang.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 java.lang.String getCurrencyCode();
    method public int getDefaultFractionDigits();
    method public int getDefaultFractionDigits(android.icu.util.Currency.CurrencyUsage);
    method public java.lang.String getDisplayName();
    method public java.lang.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(java.lang.String);
    method public static final java.lang.String[] getKeywordValuesForLocale(java.lang.String, android.icu.util.ULocale, boolean);
    method public java.lang.String getName(java.util.Locale, int, boolean[]);
    method public java.lang.String getName(android.icu.util.ULocale, int, boolean[]);
    method public java.lang.String getName(java.util.Locale, int, java.lang.String, boolean[]);
    method public java.lang.String getName(android.icu.util.ULocale, int, java.lang.String, boolean[]);
    method public int getNumericCode();
    method public double getRoundingIncrement();
    method public double getRoundingIncrement(android.icu.util.Currency.CurrencyUsage);
    method public java.lang.String getSymbol();
    method public java.lang.String getSymbol(java.util.Locale);
    method public java.lang.String getSymbol(android.icu.util.ULocale);
    method public static boolean isAvailable(java.lang.String, java.util.Date, java.util.Date);
    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 static final class Currency.CurrencyUsage extends java.lang.Enum {
    method public static android.icu.util.Currency.CurrencyUsage valueOf(java.lang.String);
    method public static final android.icu.util.Currency.CurrencyUsage[] values();
    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(java.lang.Number, android.icu.util.Currency);
    ctor public CurrencyAmount(double, android.icu.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 protected deprecated void handleComputeFields(int);
    method protected deprecated int handleGetExtendedYear();
    method protected deprecated 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 abstract interface Freezable<T> implements java.lang.Cloneable {
    method public abstract T cloneAsThawed();
    method public abstract T freeze();
    method public abstract 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 protected deprecated 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(java.lang.String);
    ctor public ICUUncheckedIOException(java.lang.Throwable);
    ctor public ICUUncheckedIOException(java.lang.String, java.lang.Throwable);
  }

  public class IllformedLocaleException extends java.lang.RuntimeException {
    ctor public IllformedLocaleException();
    ctor public IllformedLocaleException(java.lang.String);
    ctor public IllformedLocaleException(java.lang.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 static final class IslamicCalendar.CalculationType extends java.lang.Enum {
    method public static android.icu.util.IslamicCalendar.CalculationType valueOf(java.lang.String);
    method public static final android.icu.util.IslamicCalendar.CalculationType[] values();
    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 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 java.lang.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(java.lang.Number, android.icu.util.MeasureUnit);
    method public java.lang.Number getNumber();
    method public android.icu.util.MeasureUnit getUnit();
  }

  public class MeasureUnit implements java.io.Serializable {
    method public static synchronized java.util.Set<android.icu.util.MeasureUnit> getAvailable(java.lang.String);
    method public static synchronized java.util.Set<android.icu.util.MeasureUnit> getAvailable();
    method public static synchronized java.util.Set<java.lang.String> getAvailableTypes();
    method public java.lang.String getSubtype();
    method public java.lang.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 abstract interface RangeValueIterator {
    method public abstract boolean next(android.icu.util.RangeValueIterator.Element);
    method public abstract 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 java.io.Serializable {
    ctor public TimeZone();
    method public java.lang.Object clone();
    method public android.icu.util.TimeZone cloneAsThawed();
    method public static int countEquivalentIDs(java.lang.String);
    method public android.icu.util.TimeZone freeze();
    method public static java.util.Set<java.lang.String> getAvailableIDs(android.icu.util.TimeZone.SystemTimeZoneType, java.lang.String, java.lang.Integer);
    method public static java.lang.String[] getAvailableIDs(int);
    method public static java.lang.String[] getAvailableIDs(java.lang.String);
    method public static java.lang.String[] getAvailableIDs();
    method public static java.lang.String getCanonicalID(java.lang.String);
    method public static java.lang.String getCanonicalID(java.lang.String, boolean[]);
    method public int getDSTSavings();
    method public static android.icu.util.TimeZone getDefault();
    method public final java.lang.String getDisplayName();
    method public final java.lang.String getDisplayName(java.util.Locale);
    method public final java.lang.String getDisplayName(android.icu.util.ULocale);
    method public final java.lang.String getDisplayName(boolean, int);
    method public java.lang.String getDisplayName(boolean, int, java.util.Locale);
    method public java.lang.String getDisplayName(boolean, int, android.icu.util.ULocale);
    method public static java.lang.String getEquivalentID(java.lang.String, int);
    method public static android.icu.util.TimeZone getFrozenTimeZone(java.lang.String);
    method public java.lang.String getID();
    method public static java.lang.String getIDForWindowsID(java.lang.String, java.lang.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 java.lang.String getRegion(java.lang.String);
    method public static java.lang.String getTZDataVersion();
    method public static android.icu.util.TimeZone getTimeZone(java.lang.String);
    method public static android.icu.util.TimeZone getTimeZone(java.lang.String, int);
    method public static java.lang.String getWindowsID(java.lang.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(java.lang.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 java.lang.String UNKNOWN_ZONE_ID = "Etc/Unknown";
  }

  public static final class TimeZone.SystemTimeZoneType extends java.lang.Enum {
    method public static android.icu.util.TimeZone.SystemTimeZoneType valueOf(java.lang.String);
    method public static final android.icu.util.TimeZone.SystemTimeZoneType[] values();
    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 java.io.Serializable {
    ctor public ULocale(java.lang.String);
    ctor public ULocale(java.lang.String, java.lang.String);
    ctor public ULocale(java.lang.String, java.lang.String, java.lang.String);
    method public static android.icu.util.ULocale acceptLanguage(java.lang.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(java.lang.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 java.lang.String canonicalize(java.lang.String);
    method public java.lang.Object clone();
    method public int compareTo(android.icu.util.ULocale);
    method public static android.icu.util.ULocale createCanonical(java.lang.String);
    method public static android.icu.util.ULocale forLanguageTag(java.lang.String);
    method public static android.icu.util.ULocale forLocale(java.util.Locale);
    method public static android.icu.util.ULocale[] getAvailableLocales();
    method public java.lang.String getBaseName();
    method public static java.lang.String getBaseName(java.lang.String);
    method public java.lang.String getCharacterOrientation();
    method public java.lang.String getCountry();
    method public static java.lang.String getCountry(java.lang.String);
    method public static android.icu.util.ULocale getDefault();
    method public static android.icu.util.ULocale getDefault(android.icu.util.ULocale.Category);
    method public java.lang.String getDisplayCountry();
    method public java.lang.String getDisplayCountry(android.icu.util.ULocale);
    method public static java.lang.String getDisplayCountry(java.lang.String, java.lang.String);
    method public static java.lang.String getDisplayCountry(java.lang.String, android.icu.util.ULocale);
    method public static java.lang.String getDisplayKeyword(java.lang.String);
    method public static java.lang.String getDisplayKeyword(java.lang.String, java.lang.String);
    method public static java.lang.String getDisplayKeyword(java.lang.String, android.icu.util.ULocale);
    method public java.lang.String getDisplayKeywordValue(java.lang.String);
    method public java.lang.String getDisplayKeywordValue(java.lang.String, android.icu.util.ULocale);
    method public static java.lang.String getDisplayKeywordValue(java.lang.String, java.lang.String, java.lang.String);
    method public static java.lang.String getDisplayKeywordValue(java.lang.String, java.lang.String, android.icu.util.ULocale);
    method public java.lang.String getDisplayLanguage();
    method public java.lang.String getDisplayLanguage(android.icu.util.ULocale);
    method public static java.lang.String getDisplayLanguage(java.lang.String, java.lang.String);
    method public static java.lang.String getDisplayLanguage(java.lang.String, android.icu.util.ULocale);
    method public java.lang.String getDisplayLanguageWithDialect();
    method public java.lang.String getDisplayLanguageWithDialect(android.icu.util.ULocale);
    method public static java.lang.String getDisplayLanguageWithDialect(java.lang.String, java.lang.String);
    method public static java.lang.String getDisplayLanguageWithDialect(java.lang.String, android.icu.util.ULocale);
    method public java.lang.String getDisplayName();
    method public java.lang.String getDisplayName(android.icu.util.ULocale);
    method public static java.lang.String getDisplayName(java.lang.String, java.lang.String);
    method public static java.lang.String getDisplayName(java.lang.String, android.icu.util.ULocale);
    method public java.lang.String getDisplayNameWithDialect();
    method public java.lang.String getDisplayNameWithDialect(android.icu.util.ULocale);
    method public static java.lang.String getDisplayNameWithDialect(java.lang.String, java.lang.String);
    method public static java.lang.String getDisplayNameWithDialect(java.lang.String, android.icu.util.ULocale);
    method public java.lang.String getDisplayScript();
    method public java.lang.String getDisplayScript(android.icu.util.ULocale);
    method public static java.lang.String getDisplayScript(java.lang.String, java.lang.String);
    method public static java.lang.String getDisplayScript(java.lang.String, android.icu.util.ULocale);
    method public java.lang.String getDisplayVariant();
    method public java.lang.String getDisplayVariant(android.icu.util.ULocale);
    method public static java.lang.String getDisplayVariant(java.lang.String, java.lang.String);
    method public static java.lang.String getDisplayVariant(java.lang.String, android.icu.util.ULocale);
    method public java.lang.String getExtension(char);
    method public java.util.Set<java.lang.Character> getExtensionKeys();
    method public static java.lang.String getFallback(java.lang.String);
    method public android.icu.util.ULocale getFallback();
    method public java.lang.String getISO3Country();
    method public static java.lang.String getISO3Country(java.lang.String);
    method public java.lang.String getISO3Language();
    method public static java.lang.String getISO3Language(java.lang.String);
    method public static java.lang.String[] getISOCountries();
    method public static java.lang.String[] getISOLanguages();
    method public java.lang.String getKeywordValue(java.lang.String);
    method public static java.lang.String getKeywordValue(java.lang.String, java.lang.String);
    method public java.util.Iterator<java.lang.String> getKeywords();
    method public static java.util.Iterator<java.lang.String> getKeywords(java.lang.String);
    method public java.lang.String getLanguage();
    method public static java.lang.String getLanguage(java.lang.String);
    method public java.lang.String getLineOrientation();
    method public java.lang.String getName();
    method public static java.lang.String getName(java.lang.String);
    method public java.lang.String getScript();
    method public static java.lang.String getScript(java.lang.String);
    method public java.util.Set<java.lang.String> getUnicodeLocaleAttributes();
    method public java.util.Set<java.lang.String> getUnicodeLocaleKeys();
    method public java.lang.String getUnicodeLocaleType(java.lang.String);
    method public java.lang.String getVariant();
    method public static java.lang.String getVariant(java.lang.String);
    method public boolean isRightToLeft();
    method public static android.icu.util.ULocale minimizeSubtags(android.icu.util.ULocale);
    method public android.icu.util.ULocale setKeywordValue(java.lang.String, java.lang.String);
    method public static java.lang.String setKeywordValue(java.lang.String, java.lang.String, java.lang.String);
    method public java.lang.String toLanguageTag();
    method public static java.lang.String toLegacyKey(java.lang.String);
    method public static java.lang.String toLegacyType(java.lang.String, java.lang.String);
    method public java.util.Locale toLocale();
    method public static java.lang.String toUnicodeLocaleKey(java.lang.String);
    method public static java.lang.String toUnicodeLocaleType(java.lang.String, java.lang.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(java.lang.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(java.lang.String);
    method public android.icu.util.ULocale.Builder setExtension(char, java.lang.String);
    method public android.icu.util.ULocale.Builder setLanguage(java.lang.String);
    method public android.icu.util.ULocale.Builder setLanguageTag(java.lang.String);
    method public android.icu.util.ULocale.Builder setLocale(android.icu.util.ULocale);
    method public android.icu.util.ULocale.Builder setRegion(java.lang.String);
    method public android.icu.util.ULocale.Builder setScript(java.lang.String);
    method public android.icu.util.ULocale.Builder setUnicodeLocaleKeyword(java.lang.String, java.lang.String);
    method public android.icu.util.ULocale.Builder setVariant(java.lang.String);
  }

  public static final class ULocale.Category extends java.lang.Enum {
    method public static android.icu.util.ULocale.Category valueOf(java.lang.String);
    method public static final android.icu.util.ULocale.Category[] values();
    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 public static final deprecated 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 abstract interface ValueIterator {
    method public abstract boolean next(android.icu.util.ValueIterator.Element);
    method public abstract void reset();
    method public abstract void setRange(int, int);
  }

  public static final class ValueIterator.Element {
    ctor public ValueIterator.Element();
    field public int integer;
    field public java.lang.Object value;
  }

  public final class VersionInfo implements java.lang.Comparable {
    method public int compareTo(android.icu.util.VersionInfo);
    method public static android.icu.util.VersionInfo getInstance(java.lang.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 public void createSession(android.view.inputmethod.InputMethod.SessionCallback);
    method public void revokeSession(android.view.inputmethod.InputMethodSession);
    method 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 public deprecated 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 java.lang.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(java.lang.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 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 public deprecated 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(int);
    method public void showWindow(boolean);
    method public void switchInputMethod(java.lang.String);
    method public final void switchInputMethod(java.lang.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 public static final deprecated int BACK_DISPOSITION_WILL_DISMISS = 2; // 0x2
    field public static final deprecated int BACK_DISPOSITION_WILL_NOT_DISMISS = 1; // 0x1
  }

  public class InputMethodService.InputMethodImpl extends android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl {
    ctor public InputMethodService.InputMethodImpl();
    method public void attachToken(android.os.IBinder);
    method public void bindInput(android.view.inputmethod.InputBinding);
    method public void changeInputMethodSubtype(android.view.inputmethod.InputMethodSubtype);
    method public void hideSoftInput(int, android.os.ResultReceiver);
    method public void restartInput(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo);
    method public void showSoftInput(int, android.os.ResultReceiver);
    method public void startInput(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo);
    method public void unbindInput();
  }

  public class InputMethodService.InputMethodSessionImpl extends android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodSessionImpl {
    ctor public InputMethodService.InputMethodSessionImpl();
    method public void appPrivateCommand(java.lang.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, int, int, int, int);
    ctor public Keyboard(android.content.Context, int, int);
    ctor public Keyboard(android.content.Context, int, java.lang.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 java.lang.CharSequence label;
    field public boolean modifier;
    field public boolean on;
    field public java.lang.CharSequence popupCharacters;
    field public int popupResId;
    field public boolean pressed;
    field public boolean repeatable;
    field public boolean sticky;
    field public java.lang.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 abstract interface KeyboardView.OnKeyboardActionListener {
    method public abstract void onKey(int, int[]);
    method public abstract void onPress(int);
    method public abstract void onRelease(int);
    method public abstract void onText(java.lang.CharSequence);
    method public abstract void swipeDown();
    method public abstract void swipeLeft();
    method public abstract void swipeRight();
    method public abstract 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 java.lang.String getAddressLine(int);
    method public java.lang.String getAdminArea();
    method public java.lang.String getCountryCode();
    method public java.lang.String getCountryName();
    method public android.os.Bundle getExtras();
    method public java.lang.String getFeatureName();
    method public double getLatitude();
    method public java.util.Locale getLocale();
    method public java.lang.String getLocality();
    method public double getLongitude();
    method public int getMaxAddressLineIndex();
    method public java.lang.String getPhone();
    method public java.lang.String getPostalCode();
    method public java.lang.String getPremises();
    method public java.lang.String getSubAdminArea();
    method public java.lang.String getSubLocality();
    method public java.lang.String getSubThoroughfare();
    method public java.lang.String getThoroughfare();
    method public java.lang.String getUrl();
    method public boolean hasLatitude();
    method public boolean hasLongitude();
    method public void setAddressLine(int, java.lang.String);
    method public void setAdminArea(java.lang.String);
    method public void setCountryCode(java.lang.String);
    method public void setCountryName(java.lang.String);
    method public void setExtras(android.os.Bundle);
    method public void setFeatureName(java.lang.String);
    method public void setLatitude(double);
    method public void setLocality(java.lang.String);
    method public void setLongitude(double);
    method public void setPhone(java.lang.String);
    method public void setPostalCode(java.lang.String);
    method public void setPremises(java.lang.String);
    method public void setSubAdminArea(java.lang.String);
    method public void setSubLocality(java.lang.String);
    method public void setSubThoroughfare(java.lang.String);
    method public void setThoroughfare(java.lang.String);
    method public void setUrl(java.lang.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(java.lang.String, int) throws java.io.IOException;
    method public java.util.List<android.location.Address> getFromLocationName(java.lang.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 public deprecated long getCarrierCycles();
    method public float getCarrierFrequencyHz();
    method public deprecated double getCarrierPhase();
    method public deprecated 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 public deprecated boolean hasCarrierCycles();
    method public boolean hasCarrierFrequencyHz();
    method public deprecated boolean hasCarrierPhase();
    method public deprecated 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 public android.location.GnssClock getClock();
    method 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 static abstract 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 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 static abstract 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 static abstract 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();
  }

  public final deprecated class GpsSatellite {
    method public float getAzimuth();
    method public float getElevation();
    method public int getPrn();
    method public float getSnr();
    method public boolean hasAlmanac();
    method public boolean hasEphemeris();
    method public boolean usedInFix();
  }

  public final deprecated class GpsStatus {
    method public int getMaxSatellites();
    method public java.lang.Iterable<android.location.GpsSatellite> getSatellites();
    method public int getTimeToFirstFix();
    field public static final int GPS_EVENT_FIRST_FIX = 3; // 0x3
    field public static final int GPS_EVENT_SATELLITE_STATUS = 4; // 0x4
    field public static final int GPS_EVENT_STARTED = 1; // 0x1
    field public static final int GPS_EVENT_STOPPED = 2; // 0x2
  }

  public static abstract deprecated interface GpsStatus.Listener {
    method public abstract void onGpsStatusChanged(int);
  }

  public static abstract deprecated interface GpsStatus.NmeaListener {
    method public abstract void onNmeaReceived(long, java.lang.String);
  }

  public class Location implements android.os.Parcelable {
    ctor public Location(java.lang.String);
    ctor public Location(android.location.Location);
    method public float bearingTo(android.location.Location);
    method public static java.lang.String convert(double, int);
    method public static double convert(java.lang.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, java.lang.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 java.lang.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 public deprecated void removeAccuracy();
    method public deprecated void removeAltitude();
    method public deprecated void removeBearing();
    method public deprecated 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(java.lang.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 abstract interface LocationListener {
    method public abstract void onLocationChanged(android.location.Location);
    method public abstract void onProviderDisabled(java.lang.String);
    method public abstract void onProviderEnabled(java.lang.String);
    method public abstract void onStatusChanged(java.lang.String, int, android.os.Bundle);
  }

  public class LocationManager {
    method public deprecated boolean addGpsStatusListener(android.location.GpsStatus.Listener);
    method public deprecated boolean addNmeaListener(android.location.GpsStatus.NmeaListener);
    method public boolean addNmeaListener(android.location.OnNmeaMessageListener);
    method public boolean addNmeaListener(android.location.OnNmeaMessageListener, android.os.Handler);
    method public void addProximityAlert(double, double, float, long, android.app.PendingIntent);
    method public void addTestProvider(java.lang.String, boolean, boolean, boolean, boolean, boolean, boolean, boolean, int, int);
    method public void clearTestProviderEnabled(java.lang.String);
    method public void clearTestProviderLocation(java.lang.String);
    method public void clearTestProviderStatus(java.lang.String);
    method public java.util.List<java.lang.String> getAllProviders();
    method public java.lang.String getBestProvider(android.location.Criteria, boolean);
    method public java.lang.String getGnssHardwareModelName();
    method public int getGnssYearOfHardware();
    method public deprecated android.location.GpsStatus getGpsStatus(android.location.GpsStatus);
    method public android.location.Location getLastKnownLocation(java.lang.String);
    method public android.location.LocationProvider getProvider(java.lang.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(java.lang.String);
    method public boolean registerGnssMeasurementsCallback(android.location.GnssMeasurementsEvent.Callback);
    method public boolean registerGnssMeasurementsCallback(android.location.GnssMeasurementsEvent.Callback, android.os.Handler);
    method public boolean registerGnssNavigationMessageCallback(android.location.GnssNavigationMessage.Callback);
    method public boolean registerGnssNavigationMessageCallback(android.location.GnssNavigationMessage.Callback, android.os.Handler);
    method public boolean registerGnssStatusCallback(android.location.GnssStatus.Callback);
    method public boolean registerGnssStatusCallback(android.location.GnssStatus.Callback, android.os.Handler);
    method public deprecated void removeGpsStatusListener(android.location.GpsStatus.Listener);
    method public deprecated void removeNmeaListener(android.location.GpsStatus.NmeaListener);
    method public void removeNmeaListener(android.location.OnNmeaMessageListener);
    method public void removeProximityAlert(android.app.PendingIntent);
    method public void removeTestProvider(java.lang.String);
    method public void removeUpdates(android.location.LocationListener);
    method public void removeUpdates(android.app.PendingIntent);
    method public void requestLocationUpdates(java.lang.String, long, float, android.location.LocationListener);
    method public void requestLocationUpdates(java.lang.String, long, float, android.location.LocationListener, android.os.Looper);
    method public void requestLocationUpdates(long, float, android.location.Criteria, android.location.LocationListener, android.os.Looper);
    method public void requestLocationUpdates(java.lang.String, long, float, android.app.PendingIntent);
    method public void requestLocationUpdates(long, float, android.location.Criteria, android.app.PendingIntent);
    method public void requestSingleUpdate(java.lang.String, android.location.LocationListener, android.os.Looper);
    method public void requestSingleUpdate(android.location.Criteria, android.location.LocationListener, android.os.Looper);
    method public void requestSingleUpdate(java.lang.String, android.app.PendingIntent);
    method public void requestSingleUpdate(android.location.Criteria, android.app.PendingIntent);
    method public boolean sendExtraCommand(java.lang.String, java.lang.String, android.os.Bundle);
    method public void setTestProviderEnabled(java.lang.String, boolean);
    method public void setTestProviderLocation(java.lang.String, android.location.Location);
    method public void setTestProviderStatus(java.lang.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 java.lang.String GPS_PROVIDER = "gps";
    field public static final java.lang.String KEY_LOCATION_CHANGED = "location";
    field public static final java.lang.String KEY_PROVIDER_ENABLED = "providerEnabled";
    field public static final java.lang.String KEY_PROXIMITY_ENTERING = "entering";
    field public static final java.lang.String KEY_STATUS_CHANGED = "status";
    field public static final java.lang.String MODE_CHANGED_ACTION = "android.location.MODE_CHANGED";
    field public static final java.lang.String NETWORK_PROVIDER = "network";
    field public static final java.lang.String PASSIVE_PROVIDER = "passive";
    field public static final java.lang.String PROVIDERS_CHANGED_ACTION = "android.location.PROVIDERS_CHANGED";
  }

  public class LocationProvider {
    method public int getAccuracy();
    method public java.lang.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 abstract interface OnNmeaMessageListener {
    method public abstract void onNmeaMessage(java.lang.String, long);
  }

  public abstract class SettingInjectorService extends android.app.Service {
    ctor public SettingInjectorService(java.lang.String);
    method public final android.os.IBinder onBind(android.content.Intent);
    method protected abstract boolean onGetEnabled();
    method protected abstract deprecated java.lang.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 java.lang.String ACTION_INJECTED_SETTING_CHANGED = "android.location.InjectedSettingChanged";
    field public static final java.lang.String ACTION_SERVICE_INTENT = "android.location.SettingInjectorService";
    field public static final java.lang.String ATTRIBUTES_NAME = "injected-location-setting";
    field public static final java.lang.String META_DATA_NAME = "android.location.SettingInjectorService";
  }

}

package android.media {

  public class AsyncPlayer {
    ctor public AsyncPlayer(java.lang.String);
    method public deprecated void play(android.content.Context, android.net.Uri, boolean, int);
    method public void play(android.content.Context, android.net.Uri, boolean, 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 public static final deprecated 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 public java.lang.String getAddress();
    method public int[] getChannelCounts();
    method public int[] getChannelIndexMasks();
    method public int[] getChannelMasks();
    method public int[] getEncodings();
    method public int getId();
    method public java.lang.CharSequence getProductName();
    method 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 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(android.media.AudioFocusRequest);
    method public android.media.AudioFocusRequest build();
    method public android.media.AudioFocusRequest.Builder setAcceptsDelayedFocusGain(boolean);
    method public android.media.AudioFocusRequest.Builder setAudioAttributes(android.media.AudioAttributes);
    method public android.media.AudioFocusRequest.Builder setFocusGain(int);
    method public android.media.AudioFocusRequest.Builder setForceDucking(boolean);
    method public android.media.AudioFocusRequest.Builder setOnAudioFocusChangeListener(android.media.AudioManager.OnAudioFocusChangeListener);
    method public android.media.AudioFocusRequest.Builder setOnAudioFocusChangeListener(android.media.AudioManager.OnAudioFocusChangeListener, android.os.Handler);
    method 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 public static final deprecated int CHANNEL_CONFIGURATION_DEFAULT = 1; // 0x1
    field public static final deprecated int CHANNEL_CONFIGURATION_INVALID = 0; // 0x0
    field public static final deprecated int CHANNEL_CONFIGURATION_MONO = 2; // 0x2
    field public static final deprecated 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 public static final deprecated 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 public android.media.AudioFormat.Builder setChannelIndexMask(int);
    method 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 public deprecated int abandonAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener);
    method public int abandonAudioFocusRequest(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 public java.util.List<android.media.AudioPlaybackConfiguration> getActivePlaybackConfigurations();
    method 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 java.lang.String getParameters(java.lang.String);
    method public java.lang.String getProperty(java.lang.String);
    method public int getRingerMode();
    method public deprecated 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 public deprecated int getVibrateSetting(int);
    method public deprecated 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 public deprecated 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(android.media.AudioManager.AudioPlaybackCallback, android.os.Handler);
    method public void registerAudioRecordingCallback(android.media.AudioManager.AudioRecordingCallback, android.os.Handler);
    method public deprecated void registerMediaButtonEventReceiver(android.content.ComponentName);
    method public deprecated void registerMediaButtonEventReceiver(android.app.PendingIntent);
    method public deprecated void registerRemoteControlClient(android.media.RemoteControlClient);
    method public deprecated boolean registerRemoteController(android.media.RemoteController);
    method public deprecated int requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, int, int);
    method public int requestAudioFocus(android.media.AudioFocusRequest);
    method public deprecated void setBluetoothA2dpOn(boolean);
    method public void setBluetoothScoOn(boolean);
    method public void setMicrophoneMute(boolean);
    method public void setMode(int);
    method public void setParameters(java.lang.String);
    method public void setRingerMode(int);
    method public deprecated void setRouting(int, int, int);
    method public void setSpeakerphoneOn(boolean);
    method public deprecated void setStreamMute(int, boolean);
    method public deprecated void setStreamSolo(int, boolean);
    method public void setStreamVolume(int, int, int);
    method public deprecated void setVibrateSetting(int, int);
    method public deprecated void setWiredHeadsetOn(boolean);
    method public deprecated 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(android.media.AudioManager.AudioPlaybackCallback);
    method public void unregisterAudioRecordingCallback(android.media.AudioManager.AudioRecordingCallback);
    method public deprecated void unregisterMediaButtonEventReceiver(android.content.ComponentName);
    method public deprecated void unregisterMediaButtonEventReceiver(android.app.PendingIntent);
    method public deprecated void unregisterRemoteControlClient(android.media.RemoteControlClient);
    method public deprecated void unregisterRemoteController(android.media.RemoteController);
    field public static final java.lang.String ACTION_AUDIO_BECOMING_NOISY = "android.media.AUDIO_BECOMING_NOISY";
    field public static final java.lang.String ACTION_HDMI_AUDIO_PLUG = "android.media.action.HDMI_AUDIO_PLUG";
    field public static final java.lang.String ACTION_HEADSET_PLUG = "android.intent.action.HEADSET_PLUG";
    field public static final java.lang.String ACTION_MICROPHONE_MUTE_CHANGED = "android.media.action.MICROPHONE_MUTE_CHANGED";
    field public static final deprecated java.lang.String ACTION_SCO_AUDIO_STATE_CHANGED = "android.media.SCO_AUDIO_STATE_CHANGED";
    field public static final java.lang.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 java.lang.String EXTRA_AUDIO_PLUG_STATE = "android.media.extra.AUDIO_PLUG_STATE";
    field public static final java.lang.String EXTRA_ENCODINGS = "android.media.extra.ENCODINGS";
    field public static final java.lang.String EXTRA_MAX_CHANNEL_COUNT = "android.media.extra.MAX_CHANNEL_COUNT";
    field public static final java.lang.String EXTRA_RINGER_MODE = "android.media.EXTRA_RINGER_MODE";
    field public static final java.lang.String EXTRA_SCO_AUDIO_PREVIOUS_STATE = "android.media.extra.SCO_AUDIO_PREVIOUS_STATE";
    field public static final java.lang.String EXTRA_SCO_AUDIO_STATE = "android.media.extra.SCO_AUDIO_STATE";
    field public static final deprecated java.lang.String EXTRA_VIBRATE_SETTING = "android.media.EXTRA_VIBRATE_SETTING";
    field public static final deprecated java.lang.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 public static final deprecated int NUM_STREAMS = 5; // 0x5
    field public static final java.lang.String PROPERTY_OUTPUT_FRAMES_PER_BUFFER = "android.media.property.OUTPUT_FRAMES_PER_BUFFER";
    field public static final java.lang.String PROPERTY_OUTPUT_SAMPLE_RATE = "android.media.property.OUTPUT_SAMPLE_RATE";
    field public static final java.lang.String PROPERTY_SUPPORT_AUDIO_SOURCE_UNPROCESSED = "android.media.property.SUPPORT_AUDIO_SOURCE_UNPROCESSED";
    field public static final java.lang.String PROPERTY_SUPPORT_MIC_NEAR_ULTRASOUND = "android.media.property.SUPPORT_MIC_NEAR_ULTRASOUND";
    field public static final java.lang.String PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND = "android.media.property.SUPPORT_SPEAKER_NEAR_ULTRASOUND";
    field public static final java.lang.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 public static final deprecated int ROUTE_ALL = -1; // 0xffffffff
    field public static final deprecated int ROUTE_BLUETOOTH = 4; // 0x4
    field public static final deprecated int ROUTE_BLUETOOTH_A2DP = 16; // 0x10
    field public static final deprecated int ROUTE_BLUETOOTH_SCO = 4; // 0x4
    field public static final deprecated int ROUTE_EARPIECE = 1; // 0x1
    field public static final deprecated int ROUTE_HEADSET = 8; // 0x8
    field public static final deprecated 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 public static final deprecated java.lang.String VIBRATE_SETTING_CHANGED_ACTION = "android.media.VIBRATE_SETTING_CHANGED";
    field public static final deprecated int VIBRATE_SETTING_OFF = 0; // 0x0
    field public static final deprecated int VIBRATE_SETTING_ON = 1; // 0x1
    field public static final deprecated int VIBRATE_SETTING_ONLY_SILENT = 2; // 0x2
    field public static final deprecated int VIBRATE_TYPE_NOTIFICATION = 1; // 0x1
    field public static final deprecated int VIBRATE_TYPE_RINGER = 0; // 0x0
  }

  public static abstract class AudioManager.AudioPlaybackCallback {
    ctor public AudioManager.AudioPlaybackCallback();
    method public void onPlaybackConfigChanged(java.util.List<android.media.AudioPlaybackConfiguration>);
  }

  public static abstract class AudioManager.AudioRecordingCallback {
    ctor public AudioManager.AudioRecordingCallback();
    method public void onRecordingConfigChanged(java.util.List<android.media.AudioRecordingConfiguration>);
  }

  public static abstract interface AudioManager.OnAudioFocusChangeListener {
    method public abstract 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 public deprecated 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 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(android.media.AudioTimestamp, int);
    method public int read(byte[], int, int);
    method public int read(byte[], int, int, int);
    method public int read(short[], int, int);
    method public int read(short[], int, int, int);
    method public int read(float[], int, int, int);
    method public int read(java.nio.ByteBuffer, int);
    method public int read(java.nio.ByteBuffer, int, int);
    method public void release();
    method public void removeOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener);
    method public deprecated 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(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 java.lang.String CHANNELS = "android.media.audiorecord.channels";
    field public static final java.lang.String ENCODING = "android.media.audiorecord.encoding";
    field public static final java.lang.String LATENCY = "android.media.audiorecord.latency";
    field public static final java.lang.String SAMPLERATE = "android.media.audiorecord.samplerate";
    field public static final java.lang.String SOURCE = "android.media.audiorecord.source";
  }

  public static abstract interface AudioRecord.OnRecordPositionUpdateListener {
    method public abstract void onMarkerReached(android.media.AudioRecord);
    method public abstract void onPeriodicNotification(android.media.AudioRecord);
  }

  public static abstract deprecated interface AudioRecord.OnRoutingChangedListener implements android.media.AudioRouting.OnRoutingChangedListener {
    method public abstract void onRoutingChanged(android.media.AudioRecord);
    method 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 abstract interface AudioRouting {
    method public abstract void addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler);
    method public abstract android.media.AudioDeviceInfo getPreferredDevice();
    method public abstract android.media.AudioDeviceInfo getRoutedDevice();
    method public abstract void removeOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener);
    method public abstract boolean setPreferredDevice(android.media.AudioDeviceInfo);
  }

  public static abstract interface AudioRouting.OnRoutingChangedListener {
    method public abstract 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 public deprecated AudioTrack(int, int, int, int, int, int) throws java.lang.IllegalArgumentException;
    ctor public deprecated 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 public deprecated void addOnRoutingChangedListener(android.media.AudioTrack.OnRoutingChangedListener, android.os.Handler);
    method public int attachAuxEffect(int);
    method public android.media.VolumeShaper createVolumeShaper(android.media.VolumeShaper.Configuration);
    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 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 protected deprecated 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 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 public deprecated 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(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(android.media.AudioPresentation);
    method protected deprecated void setState(int);
    method public deprecated int setStereoVolume(float, float);
    method public int setVolume(float);
    method public void stop() throws java.lang.IllegalStateException;
    method public int write(byte[], int, int);
    method public int write(byte[], int, int, int);
    method public int write(short[], int, int);
    method public int write(short[], int, int, int);
    method public int write(float[], int, int, int);
    method public int write(java.nio.ByteBuffer, int, int);
    method public int write(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 public android.media.AudioTrack build() throws java.lang.UnsupportedOperationException;
    method public android.media.AudioTrack.Builder setAudioAttributes(android.media.AudioAttributes) throws java.lang.IllegalArgumentException;
    method public android.media.AudioTrack.Builder setAudioFormat(android.media.AudioFormat) throws java.lang.IllegalArgumentException;
    method public android.media.AudioTrack.Builder setBufferSizeInBytes(int) throws java.lang.IllegalArgumentException;
    method public android.media.AudioTrack.Builder setPerformanceMode(int);
    method public android.media.AudioTrack.Builder setSessionId(int) throws java.lang.IllegalArgumentException;
    method public android.media.AudioTrack.Builder setTransferMode(int) throws java.lang.IllegalArgumentException;
  }

  public static final class AudioTrack.MetricsConstants {
    field public static final java.lang.String CHANNELMASK = "android.media.audiorecord.channelmask";
    field public static final java.lang.String CONTENTTYPE = "android.media.audiotrack.type";
    field public static final java.lang.String SAMPLERATE = "android.media.audiorecord.samplerate";
    field public static final java.lang.String STREAMTYPE = "android.media.audiotrack.streamtype";
    field public static final java.lang.String USAGE = "android.media.audiotrack.usage";
  }

  public static abstract interface AudioTrack.OnPlaybackPositionUpdateListener {
    method public abstract void onMarkerReached(android.media.AudioTrack);
    method public abstract void onPeriodicNotification(android.media.AudioTrack);
  }

  public static abstract deprecated interface AudioTrack.OnRoutingChangedListener implements android.media.AudioRouting.OnRoutingChangedListener {
    method public abstract void onRoutingChanged(android.media.AudioTrack);
    method 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(java.lang.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 java.lang.String mimeType;
  }

  public class ExifInterface {
    ctor public ExifInterface(java.lang.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 java.lang.String getAttribute(java.lang.String);
    method public double getAttributeDouble(java.lang.String, double);
    method public int getAttributeInt(java.lang.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(java.lang.String, java.lang.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 public static final deprecated java.lang.String TAG_APERTURE = "FNumber";
    field public static final java.lang.String TAG_APERTURE_VALUE = "ApertureValue";
    field public static final java.lang.String TAG_ARTIST = "Artist";
    field public static final java.lang.String TAG_BITS_PER_SAMPLE = "BitsPerSample";
    field public static final java.lang.String TAG_BRIGHTNESS_VALUE = "BrightnessValue";
    field public static final java.lang.String TAG_CFA_PATTERN = "CFAPattern";
    field public static final java.lang.String TAG_COLOR_SPACE = "ColorSpace";
    field public static final java.lang.String TAG_COMPONENTS_CONFIGURATION = "ComponentsConfiguration";
    field public static final java.lang.String TAG_COMPRESSED_BITS_PER_PIXEL = "CompressedBitsPerPixel";
    field public static final java.lang.String TAG_COMPRESSION = "Compression";
    field public static final java.lang.String TAG_CONTRAST = "Contrast";
    field public static final java.lang.String TAG_COPYRIGHT = "Copyright";
    field public static final java.lang.String TAG_CUSTOM_RENDERED = "CustomRendered";
    field public static final java.lang.String TAG_DATETIME = "DateTime";
    field public static final java.lang.String TAG_DATETIME_DIGITIZED = "DateTimeDigitized";
    field public static final java.lang.String TAG_DATETIME_ORIGINAL = "DateTimeOriginal";
    field public static final java.lang.String TAG_DEFAULT_CROP_SIZE = "DefaultCropSize";
    field public static final java.lang.String TAG_DEVICE_SETTING_DESCRIPTION = "DeviceSettingDescription";
    field public static final java.lang.String TAG_DIGITAL_ZOOM_RATIO = "DigitalZoomRatio";
    field public static final java.lang.String TAG_DNG_VERSION = "DNGVersion";
    field public static final java.lang.String TAG_EXIF_VERSION = "ExifVersion";
    field public static final java.lang.String TAG_EXPOSURE_BIAS_VALUE = "ExposureBiasValue";
    field public static final java.lang.String TAG_EXPOSURE_INDEX = "ExposureIndex";
    field public static final java.lang.String TAG_EXPOSURE_MODE = "ExposureMode";
    field public static final java.lang.String TAG_EXPOSURE_PROGRAM = "ExposureProgram";
    field public static final java.lang.String TAG_EXPOSURE_TIME = "ExposureTime";
    field public static final java.lang.String TAG_FILE_SOURCE = "FileSource";
    field public static final java.lang.String TAG_FLASH = "Flash";
    field public static final java.lang.String TAG_FLASHPIX_VERSION = "FlashpixVersion";
    field public static final java.lang.String TAG_FLASH_ENERGY = "FlashEnergy";
    field public static final java.lang.String TAG_FOCAL_LENGTH = "FocalLength";
    field public static final java.lang.String TAG_FOCAL_LENGTH_IN_35MM_FILM = "FocalLengthIn35mmFilm";
    field public static final java.lang.String TAG_FOCAL_PLANE_RESOLUTION_UNIT = "FocalPlaneResolutionUnit";
    field public static final java.lang.String TAG_FOCAL_PLANE_X_RESOLUTION = "FocalPlaneXResolution";
    field public static final java.lang.String TAG_FOCAL_PLANE_Y_RESOLUTION = "FocalPlaneYResolution";
    field public static final java.lang.String TAG_F_NUMBER = "FNumber";
    field public static final java.lang.String TAG_GAIN_CONTROL = "GainControl";
    field public static final java.lang.String TAG_GPS_ALTITUDE = "GPSAltitude";
    field public static final java.lang.String TAG_GPS_ALTITUDE_REF = "GPSAltitudeRef";
    field public static final java.lang.String TAG_GPS_AREA_INFORMATION = "GPSAreaInformation";
    field public static final java.lang.String TAG_GPS_DATESTAMP = "GPSDateStamp";
    field public static final java.lang.String TAG_GPS_DEST_BEARING = "GPSDestBearing";
    field public static final java.lang.String TAG_GPS_DEST_BEARING_REF = "GPSDestBearingRef";
    field public static final java.lang.String TAG_GPS_DEST_DISTANCE = "GPSDestDistance";
    field public static final java.lang.String TAG_GPS_DEST_DISTANCE_REF = "GPSDestDistanceRef";
    field public static final java.lang.String TAG_GPS_DEST_LATITUDE = "GPSDestLatitude";
    field public static final java.lang.String TAG_GPS_DEST_LATITUDE_REF = "GPSDestLatitudeRef";
    field public static final java.lang.String TAG_GPS_DEST_LONGITUDE = "GPSDestLongitude";
    field public static final java.lang.String TAG_GPS_DEST_LONGITUDE_REF = "GPSDestLongitudeRef";
    field public static final java.lang.String TAG_GPS_DIFFERENTIAL = "GPSDifferential";
    field public static final java.lang.String TAG_GPS_DOP = "GPSDOP";
    field public static final java.lang.String TAG_GPS_IMG_DIRECTION = "GPSImgDirection";
    field public static final java.lang.String TAG_GPS_IMG_DIRECTION_REF = "GPSImgDirectionRef";
    field public static final java.lang.String TAG_GPS_LATITUDE = "GPSLatitude";
    field public static final java.lang.String TAG_GPS_LATITUDE_REF = "GPSLatitudeRef";
    field public static final java.lang.String TAG_GPS_LONGITUDE = "GPSLongitude";
    field public static final java.lang.String TAG_GPS_LONGITUDE_REF = "GPSLongitudeRef";
    field public static final java.lang.String TAG_GPS_MAP_DATUM = "GPSMapDatum";
    field public static final java.lang.String TAG_GPS_MEASURE_MODE = "GPSMeasureMode";
    field public static final java.lang.String TAG_GPS_PROCESSING_METHOD = "GPSProcessingMethod";
    field public static final java.lang.String TAG_GPS_SATELLITES = "GPSSatellites";
    field public static final java.lang.String TAG_GPS_SPEED = "GPSSpeed";
    field public static final java.lang.String TAG_GPS_SPEED_REF = "GPSSpeedRef";
    field public static final java.lang.String TAG_GPS_STATUS = "GPSStatus";
    field public static final java.lang.String TAG_GPS_TIMESTAMP = "GPSTimeStamp";
    field public static final java.lang.String TAG_GPS_TRACK = "GPSTrack";
    field public static final java.lang.String TAG_GPS_TRACK_REF = "GPSTrackRef";
    field public static final java.lang.String TAG_GPS_VERSION_ID = "GPSVersionID";
    field public static final java.lang.String TAG_IMAGE_DESCRIPTION = "ImageDescription";
    field public static final java.lang.String TAG_IMAGE_LENGTH = "ImageLength";
    field public static final java.lang.String TAG_IMAGE_UNIQUE_ID = "ImageUniqueID";
    field public static final java.lang.String TAG_IMAGE_WIDTH = "ImageWidth";
    field public static final java.lang.String TAG_INTEROPERABILITY_INDEX = "InteroperabilityIndex";
    field public static final deprecated java.lang.String TAG_ISO = "ISOSpeedRatings";
    field public static final java.lang.String TAG_ISO_SPEED_RATINGS = "ISOSpeedRatings";
    field public static final java.lang.String TAG_JPEG_INTERCHANGE_FORMAT = "JPEGInterchangeFormat";
    field public static final java.lang.String TAG_JPEG_INTERCHANGE_FORMAT_LENGTH = "JPEGInterchangeFormatLength";
    field public static final java.lang.String TAG_LIGHT_SOURCE = "LightSource";
    field public static final java.lang.String TAG_MAKE = "Make";
    field public static final java.lang.String TAG_MAKER_NOTE = "MakerNote";
    field public static final java.lang.String TAG_MAX_APERTURE_VALUE = "MaxApertureValue";
    field public static final java.lang.String TAG_METERING_MODE = "MeteringMode";
    field public static final java.lang.String TAG_MODEL = "Model";
    field public static final java.lang.String TAG_NEW_SUBFILE_TYPE = "NewSubfileType";
    field public static final java.lang.String TAG_OECF = "OECF";
    field public static final java.lang.String TAG_ORF_ASPECT_FRAME = "AspectFrame";
    field public static final java.lang.String TAG_ORF_PREVIEW_IMAGE_LENGTH = "PreviewImageLength";
    field public static final java.lang.String TAG_ORF_PREVIEW_IMAGE_START = "PreviewImageStart";
    field public static final java.lang.String TAG_ORF_THUMBNAIL_IMAGE = "ThumbnailImage";
    field public static final java.lang.String TAG_ORIENTATION = "Orientation";
    field public static final java.lang.String TAG_PHOTOMETRIC_INTERPRETATION = "PhotometricInterpretation";
    field public static final java.lang.String TAG_PIXEL_X_DIMENSION = "PixelXDimension";
    field public static final java.lang.String TAG_PIXEL_Y_DIMENSION = "PixelYDimension";
    field public static final java.lang.String TAG_PLANAR_CONFIGURATION = "PlanarConfiguration";
    field public static final java.lang.String TAG_PRIMARY_CHROMATICITIES = "PrimaryChromaticities";
    field public static final java.lang.String TAG_REFERENCE_BLACK_WHITE = "ReferenceBlackWhite";
    field public static final java.lang.String TAG_RELATED_SOUND_FILE = "RelatedSoundFile";
    field public static final java.lang.String TAG_RESOLUTION_UNIT = "ResolutionUnit";
    field public static final java.lang.String TAG_ROWS_PER_STRIP = "RowsPerStrip";
    field public static final java.lang.String TAG_RW2_ISO = "ISO";
    field public static final java.lang.String TAG_RW2_JPG_FROM_RAW = "JpgFromRaw";
    field public static final java.lang.String TAG_RW2_SENSOR_BOTTOM_BORDER = "SensorBottomBorder";
    field public static final java.lang.String TAG_RW2_SENSOR_LEFT_BORDER = "SensorLeftBorder";
    field public static final java.lang.String TAG_RW2_SENSOR_RIGHT_BORDER = "SensorRightBorder";
    field public static final java.lang.String TAG_RW2_SENSOR_TOP_BORDER = "SensorTopBorder";
    field public static final java.lang.String TAG_SAMPLES_PER_PIXEL = "SamplesPerPixel";
    field public static final java.lang.String TAG_SATURATION = "Saturation";
    field public static final java.lang.String TAG_SCENE_CAPTURE_TYPE = "SceneCaptureType";
    field public static final java.lang.String TAG_SCENE_TYPE = "SceneType";
    field public static final java.lang.String TAG_SENSING_METHOD = "SensingMethod";
    field public static final java.lang.String TAG_SHARPNESS = "Sharpness";
    field public static final java.lang.String TAG_SHUTTER_SPEED_VALUE = "ShutterSpeedValue";
    field public static final java.lang.String TAG_SOFTWARE = "Software";
    field public static final java.lang.String TAG_SPATIAL_FREQUENCY_RESPONSE = "SpatialFrequencyResponse";
    field public static final java.lang.String TAG_SPECTRAL_SENSITIVITY = "SpectralSensitivity";
    field public static final java.lang.String TAG_STRIP_BYTE_COUNTS = "StripByteCounts";
    field public static final java.lang.String TAG_STRIP_OFFSETS = "StripOffsets";
    field public static final java.lang.String TAG_SUBFILE_TYPE = "SubfileType";
    field public static final java.lang.String TAG_SUBJECT_AREA = "SubjectArea";
    field public static final java.lang.String TAG_SUBJECT_DISTANCE = "SubjectDistance";
    field public static final java.lang.String TAG_SUBJECT_DISTANCE_RANGE = "SubjectDistanceRange";
    field public static final java.lang.String TAG_SUBJECT_LOCATION = "SubjectLocation";
    field public static final java.lang.String TAG_SUBSEC_TIME = "SubSecTime";
    field public static final deprecated java.lang.String TAG_SUBSEC_TIME_DIG = "SubSecTimeDigitized";
    field public static final java.lang.String TAG_SUBSEC_TIME_DIGITIZED = "SubSecTimeDigitized";
    field public static final deprecated java.lang.String TAG_SUBSEC_TIME_ORIG = "SubSecTimeOriginal";
    field public static final java.lang.String TAG_SUBSEC_TIME_ORIGINAL = "SubSecTimeOriginal";
    field public static final java.lang.String TAG_THUMBNAIL_IMAGE_LENGTH = "ThumbnailImageLength";
    field public static final java.lang.String TAG_THUMBNAIL_IMAGE_WIDTH = "ThumbnailImageWidth";
    field public static final java.lang.String TAG_TRANSFER_FUNCTION = "TransferFunction";
    field public static final java.lang.String TAG_USER_COMMENT = "UserComment";
    field public static final java.lang.String TAG_WHITE_BALANCE = "WhiteBalance";
    field public static final java.lang.String TAG_WHITE_POINT = "WhitePoint";
    field public static final java.lang.String TAG_X_RESOLUTION = "XResolution";
    field public static final java.lang.String TAG_Y_CB_CR_COEFFICIENTS = "YCbCrCoefficients";
    field public static final java.lang.String TAG_Y_CB_CR_POSITIONING = "YCbCrPositioning";
    field public static final java.lang.String TAG_Y_CB_CR_SUB_SAMPLING = "YCbCrSubSampling";
    field public static final java.lang.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 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 static abstract 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 abstract interface ImageReader.OnImageAvailableListener {
    method public abstract 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 abstract interface ImageWriter.OnImageReleasedListener {
    method public abstract void onImageReleased(android.media.ImageWriter);
  }

  public class JetPlayer {
    method public boolean clearQueue();
    method public java.lang.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(java.lang.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 abstract interface JetPlayer.OnJetEventListener {
    method public abstract void onJetEvent(android.media.JetPlayer, short, byte, byte, byte, byte);
    method public abstract void onJetNumQueuedSegmentUpdate(android.media.JetPlayer, int);
    method public abstract void onJetPauseUpdate(android.media.JetPlayer, int);
    method public abstract 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(byte[], int, int) throws android.media.MediaCasException;
    method public void processEmm(byte[]) throws android.media.MediaCasException;
    method public void provision(java.lang.String) throws android.media.MediaCasException;
    method public void refreshEntitlements(int, byte[]) throws android.media.MediaCasException;
    method public void sendEvent(int, int, byte[]) throws android.media.MediaCasException;
    method public void setEventListener(android.media.MediaCas.EventListener, android.os.Handler);
    method public void setPrivateData(byte[]) throws android.media.MediaCasException;
  }

  public static abstract interface MediaCas.EventListener {
    method public abstract void onEvent(android.media.MediaCas, int, int, byte[]);
  }

  public static class MediaCas.PluginDescriptor {
    method public java.lang.String getName();
    method public int getSystemId();
  }

  public final class MediaCas.Session implements java.lang.AutoCloseable {
    method public void close();
    method public void processEcm(byte[], int, int) throws android.media.MediaCasException;
    method public void processEcm(byte[]) throws android.media.MediaCasException;
    method public void setPrivateData(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 public java.lang.String getDiagnosticInfo();
  }

  public final class MediaCodec {
    method public void configure(android.media.MediaFormat, android.view.Surface, android.media.MediaCrypto, int);
    method public void configure(android.media.MediaFormat, android.view.Surface, int, android.media.MediaDescrambler);
    method public static android.media.MediaCodec createByCodecName(java.lang.String) throws java.io.IOException;
    method public static android.media.MediaCodec createDecoderByType(java.lang.String) throws java.io.IOException;
    method public static android.media.MediaCodec createEncoderByType(java.lang.String) throws java.io.IOException;
    method public android.view.Surface createInputSurface();
    method public static android.view.Surface createPersistentInputSurface();
    method public int dequeueInputBuffer(long);
    method public int dequeueOutputBuffer(android.media.MediaCodec.BufferInfo, long);
    method protected void finalize();
    method public void flush();
    method public android.media.MediaCodecInfo getCodecInfo();
    method public java.nio.ByteBuffer getInputBuffer(int);
    method public deprecated java.nio.ByteBuffer[] getInputBuffers();
    method public android.media.MediaFormat getInputFormat();
    method public android.media.Image getInputImage(int);
    method public android.os.PersistableBundle getMetrics();
    method public java.lang.String getName();
    method public java.nio.ByteBuffer getOutputBuffer(int);
    method public deprecated java.nio.ByteBuffer[] getOutputBuffers();
    method public android.media.MediaFormat getOutputFormat();
    method public android.media.MediaFormat getOutputFormat(int);
    method 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, 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(android.media.MediaCodec.Callback, android.os.Handler);
    method public void setCallback(android.media.MediaCodec.Callback);
    method public void setInputSurface(android.view.Surface);
    method public void setOnFrameRenderedListener(android.media.MediaCodec.OnFrameRenderedListener, android.os.Handler);
    method public void setOutputSurface(android.view.Surface);
    method public void setParameters(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 public static final deprecated 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 public static final deprecated 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 java.lang.String PARAMETER_KEY_REQUEST_SYNC_FRAME = "request-sync";
    field public static final java.lang.String PARAMETER_KEY_SUSPEND = "drop-input-frames";
    field public static final java.lang.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 static abstract class MediaCodec.Callback {
    ctor public MediaCodec.Callback();
    method public abstract void onError(android.media.MediaCodec, android.media.MediaCodec.CodecException);
    method public abstract void onInputBufferAvailable(android.media.MediaCodec, int);
    method public abstract void onOutputBufferAvailable(android.media.MediaCodec, int, android.media.MediaCodec.BufferInfo);
    method public abstract void onOutputFormatChanged(android.media.MediaCodec, android.media.MediaFormat);
  }

  public static final class MediaCodec.CodecException extends java.lang.IllegalStateException {
    method public java.lang.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, java.lang.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, int[], int[], byte[], 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 java.lang.String CODEC = "android.media.mediacodec.codec";
    field public static final java.lang.String ENCODER = "android.media.mediacodec.encoder";
    field public static final java.lang.String HEIGHT = "android.media.mediacodec.height";
    field public static final java.lang.String MIME_TYPE = "android.media.mediacodec.mime";
    field public static final java.lang.String MODE = "android.media.mediacodec.mode";
    field public static final java.lang.String MODE_AUDIO = "audio";
    field public static final java.lang.String MODE_VIDEO = "video";
    field public static final java.lang.String ROTATION = "android.media.mediacodec.rotation";
    field public static final java.lang.String SECURE = "android.media.mediacodec.secure";
    field public static final java.lang.String WIDTH = "android.media.mediacodec.width";
  }

  public static abstract interface MediaCodec.OnFrameRenderedListener {
    method public abstract void onFrameRendered(android.media.MediaCodec, long, long);
  }

  public final class MediaCodecInfo {
    method public android.media.MediaCodecInfo.CodecCapabilities getCapabilitiesForType(java.lang.String);
    method public java.lang.String getName();
    method public java.lang.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(java.lang.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 java.lang.String getMimeType();
    method public android.media.MediaCodecInfo.VideoCapabilities getVideoCapabilities();
    method public boolean isFeatureRequired(java.lang.String);
    method public boolean isFeatureSupported(java.lang.String);
    method public boolean isFormatSupported(android.media.MediaFormat);
    field public static final deprecated int COLOR_Format12bitRGB444 = 3; // 0x3
    field public static final deprecated int COLOR_Format16bitARGB1555 = 5; // 0x5
    field public static final deprecated int COLOR_Format16bitARGB4444 = 4; // 0x4
    field public static final deprecated int COLOR_Format16bitBGR565 = 7; // 0x7
    field public static final int COLOR_Format16bitRGB565 = 6; // 0x6
    field public static final deprecated int COLOR_Format18BitBGR666 = 41; // 0x29
    field public static final deprecated int COLOR_Format18bitARGB1665 = 9; // 0x9
    field public static final deprecated int COLOR_Format18bitRGB666 = 8; // 0x8
    field public static final deprecated int COLOR_Format19bitARGB1666 = 10; // 0xa
    field public static final deprecated int COLOR_Format24BitABGR6666 = 43; // 0x2b
    field public static final deprecated int COLOR_Format24BitARGB6666 = 42; // 0x2a
    field public static final deprecated int COLOR_Format24bitARGB1887 = 13; // 0xd
    field public static final int COLOR_Format24bitBGR888 = 12; // 0xc
    field public static final deprecated int COLOR_Format24bitRGB888 = 11; // 0xb
    field public static final deprecated int COLOR_Format25bitARGB1888 = 14; // 0xe
    field public static final int COLOR_Format32bitABGR8888 = 2130747392; // 0x7f00a000
    field public static final deprecated int COLOR_Format32bitARGB8888 = 16; // 0x10
    field public static final deprecated int COLOR_Format32bitBGRA8888 = 15; // 0xf
    field public static final deprecated int COLOR_Format8bitRGB332 = 2; // 0x2
    field public static final deprecated int COLOR_FormatCbYCrY = 27; // 0x1b
    field public static final deprecated int COLOR_FormatCrYCbY = 28; // 0x1c
    field public static final int COLOR_FormatL16 = 36; // 0x24
    field public static final deprecated int COLOR_FormatL2 = 33; // 0x21
    field public static final deprecated int COLOR_FormatL24 = 37; // 0x25
    field public static final deprecated int COLOR_FormatL32 = 38; // 0x26
    field public static final deprecated int COLOR_FormatL4 = 34; // 0x22
    field public static final int COLOR_FormatL8 = 35; // 0x23
    field public static final deprecated 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 public static final deprecated int COLOR_FormatYCbYCr = 25; // 0x19
    field public static final deprecated int COLOR_FormatYCrYCb = 26; // 0x1a
    field public static final deprecated int COLOR_FormatYUV411PackedPlanar = 18; // 0x12
    field public static final deprecated int COLOR_FormatYUV411Planar = 17; // 0x11
    field public static final int COLOR_FormatYUV420Flexible = 2135033992; // 0x7f420888
    field public static final deprecated int COLOR_FormatYUV420PackedPlanar = 20; // 0x14
    field public static final deprecated int COLOR_FormatYUV420PackedSemiPlanar = 39; // 0x27
    field public static final deprecated int COLOR_FormatYUV420Planar = 19; // 0x13
    field public static final deprecated int COLOR_FormatYUV420SemiPlanar = 21; // 0x15
    field public static final int COLOR_FormatYUV422Flexible = 2135042184; // 0x7f422888
    field public static final deprecated int COLOR_FormatYUV422PackedPlanar = 23; // 0x17
    field public static final deprecated int COLOR_FormatYUV422PackedSemiPlanar = 40; // 0x28
    field public static final deprecated int COLOR_FormatYUV422Planar = 22; // 0x16
    field public static final deprecated int COLOR_FormatYUV422SemiPlanar = 24; // 0x18
    field public static final int COLOR_FormatYUV444Flexible = 2135181448; // 0x7f444888
    field public static final deprecated int COLOR_FormatYUV444Interleaved = 29; // 0x1d
    field public static final deprecated int COLOR_QCOM_FormatYUV420SemiPlanar = 2141391872; // 0x7fa30c00
    field public static final deprecated int COLOR_TI_FormatYUV420PackedSemiPlanar = 2130706688; // 0x7f000100
    field public static final java.lang.String FEATURE_AdaptivePlayback = "adaptive-playback";
    field public static final java.lang.String FEATURE_IntraRefresh = "intra-refresh";
    field public static final java.lang.String FEATURE_PartialFrame = "partial-frame";
    field public static final java.lang.String FEATURE_SecurePlayback = "secure-playback";
    field public static final java.lang.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 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 java.lang.String findDecoderForFormat(android.media.MediaFormat);
    method public java.lang.String findEncoderForFormat(android.media.MediaFormat);
    method public static deprecated int getCodecCount();
    method public static deprecated 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(java.util.UUID, byte[]) throws android.media.MediaCryptoException;
    method protected void finalize();
    method public static boolean isCryptoSchemeSupported(java.util.UUID);
    method public void release();
    method public boolean requiresSecureDecoderComponent(java.lang.String);
    method public void setMediaDrmSession(byte[]) throws android.media.MediaCryptoException;
  }

  public final class MediaCryptoException extends java.lang.Exception {
    ctor public MediaCryptoException(java.lang.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(java.nio.ByteBuffer, java.nio.ByteBuffer, android.media.MediaCodec.CryptoInfo);
    method protected void finalize();
    method public boolean requiresSecureDecoderComponent(java.lang.String);
    method public void setMediaCasSession(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 public java.lang.CharSequence getDescription();
    method public android.os.Bundle getExtras();
    method public android.graphics.Bitmap getIconBitmap();
    method public android.net.Uri getIconUri();
    method public java.lang.String getMediaId();
    method public android.net.Uri getMediaUri();
    method public java.lang.CharSequence getSubtitle();
    method public java.lang.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 java.lang.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(java.lang.CharSequence);
    method public android.media.MediaDescription.Builder setExtras(android.os.Bundle);
    method public android.media.MediaDescription.Builder setIconBitmap(android.graphics.Bitmap);
    method public android.media.MediaDescription.Builder setIconUri(android.net.Uri);
    method public android.media.MediaDescription.Builder setMediaId(java.lang.String);
    method public android.media.MediaDescription.Builder setMediaUri(android.net.Uri);
    method public android.media.MediaDescription.Builder setSubtitle(java.lang.CharSequence);
    method public android.media.MediaDescription.Builder setTitle(java.lang.CharSequence);
  }

  public final class MediaDrm implements java.lang.AutoCloseable {
    ctor public MediaDrm(java.util.UUID) throws android.media.UnsupportedSchemeException;
    method public void close();
    method public void closeSession(byte[]);
    method public int getConnectedHdcpLevel();
    method public android.media.MediaDrm.CryptoSession getCryptoSession(byte[], java.lang.String, java.lang.String);
    method public android.media.MediaDrm.KeyRequest getKeyRequest(byte[], byte[], java.lang.String, int, java.util.HashMap<java.lang.String, java.lang.String>) throws android.media.NotProvisionedException;
    method public int getMaxHdcpLevel();
    method public static int getMaxSecurityLevel();
    method public int getMaxSessionCount();
    method public android.os.PersistableBundle getMetrics();
    method public int getOpenSessionCount();
    method public byte[] getPropertyByteArray(java.lang.String);
    method public java.lang.String getPropertyString(java.lang.String);
    method public android.media.MediaDrm.ProvisionRequest getProvisionRequest();
    method public byte[] getSecureStop(byte[]);
    method public java.util.List<byte[]> getSecureStopIds();
    method public java.util.List<byte[]> getSecureStops();
    method public int getSecurityLevel(byte[]);
    method public static boolean isCryptoSchemeSupported(java.util.UUID);
    method public static boolean isCryptoSchemeSupported(java.util.UUID, java.lang.String);
    method public byte[] openSession() throws android.media.NotProvisionedException, android.media.ResourceBusyException;
    method public byte[] openSession(int) throws android.media.NotProvisionedException, android.media.ResourceBusyException;
    method public byte[] provideKeyResponse(byte[], byte[]) throws android.media.DeniedByServerException, android.media.NotProvisionedException;
    method public void provideProvisionResponse(byte[]) throws android.media.DeniedByServerException;
    method public java.util.HashMap<java.lang.String, java.lang.String> queryKeyStatus(byte[]);
    method public deprecated void release();
    method public deprecated void releaseAllSecureStops();
    method public void releaseSecureStops(byte[]);
    method public void removeAllSecureStops();
    method public void removeKeys(byte[]);
    method public void removeSecureStop(byte[]);
    method public void restoreKeys(byte[], byte[]);
    method public void setOnEventListener(android.media.MediaDrm.OnEventListener);
    method public void setOnExpirationUpdateListener(android.media.MediaDrm.OnExpirationUpdateListener, android.os.Handler);
    method public void setOnKeyStatusChangeListener(android.media.MediaDrm.OnKeyStatusChangeListener, android.os.Handler);
    method public void setPropertyByteArray(java.lang.String, byte[]);
    method public void setPropertyString(java.lang.String, java.lang.String);
    field public static final deprecated int EVENT_KEY_EXPIRED = 3; // 0x3
    field public static final int EVENT_KEY_REQUIRED = 2; // 0x2
    field public static final deprecated 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 java.lang.String PROPERTY_ALGORITHMS = "algorithms";
    field public static final java.lang.String PROPERTY_DESCRIPTION = "description";
    field public static final java.lang.String PROPERTY_DEVICE_UNIQUE_ID = "deviceUniqueId";
    field public static final java.lang.String PROPERTY_VENDOR = "vendor";
    field public static final java.lang.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 public byte[] decrypt(byte[], byte[], byte[]);
    method public byte[] encrypt(byte[], byte[], byte[]);
    method public byte[] sign(byte[], byte[]);
    method public boolean verify(byte[], byte[], byte[]);
  }

  public static abstract class MediaDrm.HdcpLevel implements java.lang.annotation.Annotation {
  }

  public static final class MediaDrm.KeyRequest {
    method public byte[] getData();
    method public java.lang.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 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 public java.lang.String getDiagnosticInfo();
  }

  public static final class MediaDrm.MetricsConstants {
    field public static final java.lang.String CLOSE_SESSION_ERROR_COUNT = "drm.mediadrm.close_session.error.count";
    field public static final java.lang.String CLOSE_SESSION_ERROR_LIST = "drm.mediadrm.close_session.error.list";
    field public static final java.lang.String CLOSE_SESSION_OK_COUNT = "drm.mediadrm.close_session.ok.count";
    field public static final java.lang.String EVENT_KEY_EXPIRED_COUNT = "drm.mediadrm.event.KEY_EXPIRED.count";
    field public static final java.lang.String EVENT_KEY_NEEDED_COUNT = "drm.mediadrm.event.KEY_NEEDED.count";
    field public static final java.lang.String EVENT_PROVISION_REQUIRED_COUNT = "drm.mediadrm.event.PROVISION_REQUIRED.count";
    field public static final java.lang.String EVENT_SESSION_RECLAIMED_COUNT = "drm.mediadrm.event.SESSION_RECLAIMED.count";
    field public static final java.lang.String EVENT_VENDOR_DEFINED_COUNT = "drm.mediadrm.event.VENDOR_DEFINED.count";
    field public static final java.lang.String GET_DEVICE_UNIQUE_ID_ERROR_COUNT = "drm.mediadrm.get_device_unique_id.error.count";
    field public static final java.lang.String GET_DEVICE_UNIQUE_ID_ERROR_LIST = "drm.mediadrm.get_device_unique_id.error.list";
    field public static final java.lang.String GET_DEVICE_UNIQUE_ID_OK_COUNT = "drm.mediadrm.get_device_unique_id.ok.count";
    field public static final java.lang.String GET_KEY_REQUEST_ERROR_COUNT = "drm.mediadrm.get_key_request.error.count";
    field public static final java.lang.String GET_KEY_REQUEST_ERROR_LIST = "drm.mediadrm.get_key_request.error.list";
    field public static final java.lang.String GET_KEY_REQUEST_OK_COUNT = "drm.mediadrm.get_key_request.ok.count";
    field public static final java.lang.String GET_KEY_REQUEST_OK_TIME_MICROS = "drm.mediadrm.get_key_request.ok.average_time_micros";
    field public static final java.lang.String GET_PROVISION_REQUEST_ERROR_COUNT = "drm.mediadrm.get_provision_request.error.count";
    field public static final java.lang.String GET_PROVISION_REQUEST_ERROR_LIST = "drm.mediadrm.get_provision_request.error.list";
    field public static final java.lang.String GET_PROVISION_REQUEST_OK_COUNT = "drm.mediadrm.get_provision_request.ok.count";
    field public static final java.lang.String KEY_STATUS_EXPIRED_COUNT = "drm.mediadrm.key_status.EXPIRED.count";
    field public static final java.lang.String KEY_STATUS_INTERNAL_ERROR_COUNT = "drm.mediadrm.key_status.INTERNAL_ERROR.count";
    field public static final java.lang.String KEY_STATUS_OUTPUT_NOT_ALLOWED_COUNT = "drm.mediadrm.key_status_change.OUTPUT_NOT_ALLOWED.count";
    field public static final java.lang.String KEY_STATUS_PENDING_COUNT = "drm.mediadrm.key_status_change.PENDING.count";
    field public static final java.lang.String KEY_STATUS_USABLE_COUNT = "drm.mediadrm.key_status_change.USABLE.count";
    field public static final java.lang.String OPEN_SESSION_ERROR_COUNT = "drm.mediadrm.open_session.error.count";
    field public static final java.lang.String OPEN_SESSION_ERROR_LIST = "drm.mediadrm.open_session.error.list";
    field public static final java.lang.String OPEN_SESSION_OK_COUNT = "drm.mediadrm.open_session.ok.count";
    field public static final java.lang.String PROVIDE_KEY_RESPONSE_ERROR_COUNT = "drm.mediadrm.provide_key_response.error.count";
    field public static final java.lang.String PROVIDE_KEY_RESPONSE_ERROR_LIST = "drm.mediadrm.provide_key_response.error.list";
    field public static final java.lang.String PROVIDE_KEY_RESPONSE_OK_COUNT = "drm.mediadrm.provide_key_response.ok.count";
    field public static final java.lang.String PROVIDE_KEY_RESPONSE_OK_TIME_MICROS = "drm.mediadrm.provide_key_response.ok.average_time_micros";
    field public static final java.lang.String PROVIDE_PROVISION_RESPONSE_ERROR_COUNT = "drm.mediadrm.provide_provision_response.error.count";
    field public static final java.lang.String PROVIDE_PROVISION_RESPONSE_ERROR_LIST = "drm.mediadrm.provide_provision_response.error.list";
    field public static final java.lang.String PROVIDE_PROVISION_RESPONSE_OK_COUNT = "drm.mediadrm.provide_provision_response.ok.count";
    field public static final java.lang.String SESSION_END_TIMES_MS = "drm.mediadrm.session_end_times_ms";
    field public static final java.lang.String SESSION_START_TIMES_MS = "drm.mediadrm.session_start_times_ms";
  }

  public static abstract interface MediaDrm.OnEventListener {
    method public abstract void onEvent(android.media.MediaDrm, byte[], int, int, byte[]);
  }

  public static abstract interface MediaDrm.OnExpirationUpdateListener {
    method public abstract void onExpirationUpdate(android.media.MediaDrm, byte[], long);
  }

  public static abstract interface MediaDrm.OnKeyStatusChangeListener {
    method public abstract void onKeyStatusChange(android.media.MediaDrm, byte[], java.util.List<android.media.MediaDrm.KeyStatus>, boolean);
  }

  public static final class MediaDrm.ProvisionRequest {
    method public byte[] getData();
    method public java.lang.String getDefaultUrl();
  }

  public static abstract class MediaDrm.SecurityLevel implements java.lang.annotation.Annotation {
  }

  public class MediaDrmException extends java.lang.Exception {
    ctor public MediaDrmException(java.lang.String);
  }

  public class MediaDrmResetException extends java.lang.IllegalStateException {
    ctor public MediaDrmResetException(java.lang.String);
  }

  public final class MediaExtractor {
    ctor public MediaExtractor();
    method public boolean advance();
    method protected void finalize();
    method 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 public java.util.Map<java.util.UUID, byte[]> getPsshInfo();
    method public boolean getSampleCryptoInfo(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 public android.media.MediaFormat getTrackFormat(int);
    method public boolean hasCacheReachedEndOfStream();
    method public int readSampleData(java.nio.ByteBuffer, int);
    method public void release();
    method public void seekTo(long, int);
    method public void selectTrack(int);
    method public void setDataSource(android.media.MediaDataSource) throws java.io.IOException;
    method public void setDataSource(android.content.Context, android.net.Uri, java.util.Map<java.lang.String, java.lang.String>) throws java.io.IOException;
    method public void setDataSource(java.lang.String, java.util.Map<java.lang.String, java.lang.String>) throws java.io.IOException;
    method public void setDataSource(java.lang.String) throws java.io.IOException;
    method public void setDataSource(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;
    method public void setDataSource(java.io.FileDescriptor, long, long) throws java.io.IOException;
    method public void setMediaCas(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 java.lang.String FORMAT = "android.media.mediaextractor.fmt";
    field public static final java.lang.String MIME_TYPE = "android.media.mediaextractor.mime";
    field public static final java.lang.String TRACKS = "android.media.mediaextractor.ntrk";
  }

  public final class MediaFormat {
    ctor public MediaFormat();
    method public boolean containsKey(java.lang.String);
    method public static android.media.MediaFormat createAudioFormat(java.lang.String, int, int);
    method public static android.media.MediaFormat createSubtitleFormat(java.lang.String, java.lang.String);
    method public static android.media.MediaFormat createVideoFormat(java.lang.String, int, int);
    method public java.nio.ByteBuffer getByteBuffer(java.lang.String);
    method public boolean getFeatureEnabled(java.lang.String);
    method public float getFloat(java.lang.String);
    method public int getInteger(java.lang.String);
    method public long getLong(java.lang.String);
    method public java.lang.String getString(java.lang.String);
    method public void setByteBuffer(java.lang.String, java.nio.ByteBuffer);
    method public void setFeatureEnabled(java.lang.String, boolean);
    method public void setFloat(java.lang.String, float);
    method public void setInteger(java.lang.String, int);
    method public void setLong(java.lang.String, long);
    method public void setString(java.lang.String, java.lang.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 java.lang.String KEY_AAC_DRC_ATTENUATION_FACTOR = "aac-drc-cut-level";
    field public static final java.lang.String KEY_AAC_DRC_BOOST_FACTOR = "aac-drc-boost-level";
    field public static final java.lang.String KEY_AAC_DRC_EFFECT_TYPE = "aac-drc-effect-type";
    field public static final java.lang.String KEY_AAC_DRC_HEAVY_COMPRESSION = "aac-drc-heavy-compression";
    field public static final java.lang.String KEY_AAC_DRC_TARGET_REFERENCE_LEVEL = "aac-target-ref-level";
    field public static final java.lang.String KEY_AAC_ENCODED_TARGET_LEVEL = "aac-encoded-target-level";
    field public static final java.lang.String KEY_AAC_MAX_OUTPUT_CHANNEL_COUNT = "aac-max-output-channel_count";
    field public static final java.lang.String KEY_AAC_PROFILE = "aac-profile";
    field public static final java.lang.String KEY_AAC_SBR_MODE = "aac-sbr-mode";
    field public static final java.lang.String KEY_AUDIO_SESSION_ID = "audio-session-id";
    field public static final java.lang.String KEY_BITRATE_MODE = "bitrate-mode";
    field public static final java.lang.String KEY_BIT_RATE = "bitrate";
    field public static final java.lang.String KEY_CAPTURE_RATE = "capture-rate";
    field public static final java.lang.String KEY_CHANNEL_COUNT = "channel-count";
    field public static final java.lang.String KEY_CHANNEL_MASK = "channel-mask";
    field public static final java.lang.String KEY_COLOR_FORMAT = "color-format";
    field public static final java.lang.String KEY_COLOR_RANGE = "color-range";
    field public static final java.lang.String KEY_COLOR_STANDARD = "color-standard";
    field public static final java.lang.String KEY_COLOR_TRANSFER = "color-transfer";
    field public static final java.lang.String KEY_COMPLEXITY = "complexity";
    field public static final java.lang.String KEY_DURATION = "durationUs";
    field public static final java.lang.String KEY_FLAC_COMPRESSION_LEVEL = "flac-compression-level";
    field public static final java.lang.String KEY_FRAME_RATE = "frame-rate";
    field public static final java.lang.String KEY_GRID_COLUMNS = "grid-cols";
    field public static final java.lang.String KEY_GRID_ROWS = "grid-rows";
    field public static final java.lang.String KEY_HDR_STATIC_INFO = "hdr-static-info";
    field public static final java.lang.String KEY_HEIGHT = "height";
    field public static final java.lang.String KEY_INTRA_REFRESH_PERIOD = "intra-refresh-period";
    field public static final java.lang.String KEY_IS_ADTS = "is-adts";
    field public static final java.lang.String KEY_IS_AUTOSELECT = "is-autoselect";
    field public static final java.lang.String KEY_IS_DEFAULT = "is-default";
    field public static final java.lang.String KEY_IS_FORCED_SUBTITLE = "is-forced-subtitle";
    field public static final java.lang.String KEY_I_FRAME_INTERVAL = "i-frame-interval";
    field public static final java.lang.String KEY_LANGUAGE = "language";
    field public static final java.lang.String KEY_LATENCY = "latency";
    field public static final java.lang.String KEY_LEVEL = "level";
    field public static final java.lang.String KEY_MAX_HEIGHT = "max-height";
    field public static final java.lang.String KEY_MAX_INPUT_SIZE = "max-input-size";
    field public static final java.lang.String KEY_MAX_WIDTH = "max-width";
    field public static final java.lang.String KEY_MIME = "mime";
    field public static final java.lang.String KEY_OPERATING_RATE = "operating-rate";
    field public static final java.lang.String KEY_OUTPUT_REORDER_DEPTH = "output-reorder-depth";
    field public static final java.lang.String KEY_PCM_ENCODING = "pcm-encoding";
    field public static final java.lang.String KEY_PRIORITY = "priority";
    field public static final java.lang.String KEY_PROFILE = "profile";
    field public static final java.lang.String KEY_PUSH_BLANK_BUFFERS_ON_STOP = "push-blank-buffers-on-shutdown";
    field public static final java.lang.String KEY_QUALITY = "quality";
    field public static final java.lang.String KEY_REPEAT_PREVIOUS_FRAME_AFTER = "repeat-previous-frame-after";
    field public static final java.lang.String KEY_ROTATION = "rotation-degrees";
    field public static final java.lang.String KEY_SAMPLE_RATE = "sample-rate";
    field public static final java.lang.String KEY_SLICE_HEIGHT = "slice-height";
    field public static final java.lang.String KEY_STRIDE = "stride";
    field public static final java.lang.String KEY_TEMPORAL_LAYERING = "ts-schema";
    field public static final java.lang.String KEY_TILE_HEIGHT = "tile-height";
    field public static final java.lang.String KEY_TILE_WIDTH = "tile-width";
    field public static final java.lang.String KEY_TRACK_ID = "track-id";
    field public static final java.lang.String KEY_WIDTH = "width";
    field public static final java.lang.String MIMETYPE_AUDIO_AAC = "audio/mp4a-latm";
    field public static final java.lang.String MIMETYPE_AUDIO_AC3 = "audio/ac3";
    field public static final java.lang.String MIMETYPE_AUDIO_AMR_NB = "audio/3gpp";
    field public static final java.lang.String MIMETYPE_AUDIO_AMR_WB = "audio/amr-wb";
    field public static final java.lang.String MIMETYPE_AUDIO_EAC3 = "audio/eac3";
    field public static final java.lang.String MIMETYPE_AUDIO_FLAC = "audio/flac";
    field public static final java.lang.String MIMETYPE_AUDIO_G711_ALAW = "audio/g711-alaw";
    field public static final java.lang.String MIMETYPE_AUDIO_G711_MLAW = "audio/g711-mlaw";
    field public static final java.lang.String MIMETYPE_AUDIO_MPEG = "audio/mpeg";
    field public static final java.lang.String MIMETYPE_AUDIO_MSGSM = "audio/gsm";
    field public static final java.lang.String MIMETYPE_AUDIO_OPUS = "audio/opus";
    field public static final java.lang.String MIMETYPE_AUDIO_QCELP = "audio/qcelp";
    field public static final java.lang.String MIMETYPE_AUDIO_RAW = "audio/raw";
    field public static final java.lang.String MIMETYPE_AUDIO_SCRAMBLED = "audio/scrambled";
    field public static final java.lang.String MIMETYPE_AUDIO_VORBIS = "audio/vorbis";
    field public static final java.lang.String MIMETYPE_IMAGE_ANDROID_HEIC = "image/vnd.android.heic";
    field public static final java.lang.String MIMETYPE_TEXT_CEA_608 = "text/cea-608";
    field public static final java.lang.String MIMETYPE_TEXT_CEA_708 = "text/cea-708";
    field public static final java.lang.String MIMETYPE_TEXT_SUBRIP = "application/x-subrip";
    field public static final java.lang.String MIMETYPE_TEXT_VTT = "text/vtt";
    field public static final java.lang.String MIMETYPE_VIDEO_AVC = "video/avc";
    field public static final java.lang.String MIMETYPE_VIDEO_DOLBY_VISION = "video/dolby-vision";
    field public static final java.lang.String MIMETYPE_VIDEO_H263 = "video/3gpp";
    field public static final java.lang.String MIMETYPE_VIDEO_HEVC = "video/hevc";
    field public static final java.lang.String MIMETYPE_VIDEO_MPEG2 = "video/mpeg2";
    field public static final java.lang.String MIMETYPE_VIDEO_MPEG4 = "video/mp4v-es";
    field public static final java.lang.String MIMETYPE_VIDEO_RAW = "video/raw";
    field public static final java.lang.String MIMETYPE_VIDEO_SCRAMBLED = "video/scrambled";
    field public static final java.lang.String MIMETYPE_VIDEO_VP8 = "video/x-vnd.on2.vp8";
    field public static final java.lang.String MIMETYPE_VIDEO_VP9 = "video/x-vnd.on2.vp9";
  }

  public final class MediaMetadata implements android.os.Parcelable {
    method public boolean containsKey(java.lang.String);
    method public int describeContents();
    method public android.graphics.Bitmap getBitmap(java.lang.String);
    method public android.media.MediaDescription getDescription();
    method public long getLong(java.lang.String);
    method public android.media.Rating getRating(java.lang.String);
    method public java.lang.String getString(java.lang.String);
    method public java.lang.CharSequence getText(java.lang.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 java.lang.String METADATA_KEY_ALBUM = "android.media.metadata.ALBUM";
    field public static final java.lang.String METADATA_KEY_ALBUM_ART = "android.media.metadata.ALBUM_ART";
    field public static final java.lang.String METADATA_KEY_ALBUM_ARTIST = "android.media.metadata.ALBUM_ARTIST";
    field public static final java.lang.String METADATA_KEY_ALBUM_ART_URI = "android.media.metadata.ALBUM_ART_URI";
    field public static final java.lang.String METADATA_KEY_ART = "android.media.metadata.ART";
    field public static final java.lang.String METADATA_KEY_ARTIST = "android.media.metadata.ARTIST";
    field public static final java.lang.String METADATA_KEY_ART_URI = "android.media.metadata.ART_URI";
    field public static final java.lang.String METADATA_KEY_AUTHOR = "android.media.metadata.AUTHOR";
    field public static final java.lang.String METADATA_KEY_BT_FOLDER_TYPE = "android.media.metadata.BT_FOLDER_TYPE";
    field public static final java.lang.String METADATA_KEY_COMPILATION = "android.media.metadata.COMPILATION";
    field public static final java.lang.String METADATA_KEY_COMPOSER = "android.media.metadata.COMPOSER";
    field public static final java.lang.String METADATA_KEY_DATE = "android.media.metadata.DATE";
    field public static final java.lang.String METADATA_KEY_DISC_NUMBER = "android.media.metadata.DISC_NUMBER";
    field public static final java.lang.String METADATA_KEY_DISPLAY_DESCRIPTION = "android.media.metadata.DISPLAY_DESCRIPTION";
    field public static final java.lang.String METADATA_KEY_DISPLAY_ICON = "android.media.metadata.DISPLAY_ICON";
    field public static final java.lang.String METADATA_KEY_DISPLAY_ICON_URI = "android.media.metadata.DISPLAY_ICON_URI";
    field public static final java.lang.String METADATA_KEY_DISPLAY_SUBTITLE = "android.media.metadata.DISPLAY_SUBTITLE";
    field public static final java.lang.String METADATA_KEY_DISPLAY_TITLE = "android.media.metadata.DISPLAY_TITLE";
    field public static final java.lang.String METADATA_KEY_DURATION = "android.media.metadata.DURATION";
    field public static final java.lang.String METADATA_KEY_GENRE = "android.media.metadata.GENRE";
    field public static final java.lang.String METADATA_KEY_MEDIA_ID = "android.media.metadata.MEDIA_ID";
    field public static final java.lang.String METADATA_KEY_MEDIA_URI = "android.media.metadata.MEDIA_URI";
    field public static final java.lang.String METADATA_KEY_NUM_TRACKS = "android.media.metadata.NUM_TRACKS";
    field public static final java.lang.String METADATA_KEY_RATING = "android.media.metadata.RATING";
    field public static final java.lang.String METADATA_KEY_TITLE = "android.media.metadata.TITLE";
    field public static final java.lang.String METADATA_KEY_TRACK_NUMBER = "android.media.metadata.TRACK_NUMBER";
    field public static final java.lang.String METADATA_KEY_USER_RATING = "android.media.metadata.USER_RATING";
    field public static final java.lang.String METADATA_KEY_WRITER = "android.media.metadata.WRITER";
    field public static final java.lang.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(java.lang.String, android.graphics.Bitmap);
    method public android.media.MediaMetadata.Builder putLong(java.lang.String, long);
    method public android.media.MediaMetadata.Builder putRating(java.lang.String, android.media.Rating);
    method public android.media.MediaMetadata.Builder putString(java.lang.String, java.lang.String);
    method public android.media.MediaMetadata.Builder putText(java.lang.String, java.lang.CharSequence);
  }

  public abstract deprecated class MediaMetadataEditor {
    method public synchronized void addEditableKey(int);
    method public abstract void apply();
    method public synchronized void clear();
    method public synchronized android.graphics.Bitmap getBitmap(int, android.graphics.Bitmap) throws java.lang.IllegalArgumentException;
    method public synchronized int[] getEditableKeys();
    method public synchronized long getLong(int, long) throws java.lang.IllegalArgumentException;
    method public synchronized java.lang.Object getObject(int, java.lang.Object) throws java.lang.IllegalArgumentException;
    method public synchronized java.lang.String getString(int, java.lang.String) throws java.lang.IllegalArgumentException;
    method public synchronized android.media.MediaMetadataEditor putBitmap(int, android.graphics.Bitmap) throws java.lang.IllegalArgumentException;
    method public synchronized android.media.MediaMetadataEditor putLong(int, long) throws java.lang.IllegalArgumentException;
    method public synchronized android.media.MediaMetadataEditor putObject(int, java.lang.Object) throws java.lang.IllegalArgumentException;
    method public synchronized android.media.MediaMetadataEditor putString(int, java.lang.String) throws java.lang.IllegalArgumentException;
    method public synchronized void removeEditableKeys();
    field public static final int BITMAP_KEY_ARTWORK = 100; // 0x64
    field public static final int RATING_KEY_BY_OTHERS = 101; // 0x65
    field public static final int RATING_KEY_BY_USER = 268435457; // 0x10000001
  }

  public class MediaMetadataRetriever {
    ctor public MediaMetadataRetriever();
    method public java.lang.String extractMetadata(int);
    method public byte[] getEmbeddedPicture();
    method public android.graphics.Bitmap getFrameAtIndex(int, 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 public java.util.List<android.graphics.Bitmap> getFramesAtIndex(int, int, android.media.MediaMetadataRetriever.BitmapParams);
    method public java.util.List<android.graphics.Bitmap> getFramesAtIndex(int, int);
    method public android.graphics.Bitmap getImageAtIndex(int, android.media.MediaMetadataRetriever.BitmapParams);
    method public android.graphics.Bitmap getImageAtIndex(int);
    method public android.graphics.Bitmap getPrimaryImage(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(java.lang.String) throws java.lang.IllegalArgumentException;
    method public void setDataSource(java.lang.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 public android.graphics.Bitmap.Config getActualConfig();
    method public android.graphics.Bitmap.Config getPreferredConfig();
    method public void setPreferredConfig(android.graphics.Bitmap.Config);
  }

  public final class MediaMuxer {
    ctor public MediaMuxer(java.lang.String, int) throws java.io.IOException;
    ctor public MediaMuxer(java.io.FileDescriptor, int) throws java.io.IOException;
    method public int addTrack(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, java.nio.ByteBuffer, 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(java.lang.String, java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void addTimedTextSource(android.content.Context, android.net.Uri, java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void addTimedTextSource(java.io.FileDescriptor, java.lang.String) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void addTimedTextSource(java.io.FileDescriptor, long, long, java.lang.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 public android.media.VolumeShaper createVolumeShaper(android.media.VolumeShaper.Configuration);
    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 public java.lang.String getDrmPropertyString(java.lang.String) throws android.media.MediaPlayer.NoDrmSchemeException;
    method public int getDuration();
    method public android.media.MediaDrm.KeyRequest getKeyRequest(byte[], byte[], java.lang.String, int, java.util.Map<java.lang.String, java.lang.String>) throws android.media.MediaPlayer.NoDrmSchemeException;
    method public android.os.PersistableBundle getMetrics();
    method 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 public android.media.SyncParams getSyncParams();
    method 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(java.util.UUID) throws android.media.MediaPlayer.ProvisioningNetworkErrorException, android.media.MediaPlayer.ProvisioningServerErrorException, android.media.ResourceBusyException, android.media.UnsupportedSchemeException;
    method public byte[] provideKeyResponse(byte[], 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(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 public deprecated void setAudioStreamType(int);
    method public void setAuxEffectSendLevel(float);
    method public void setDataSource(android.content.Context, android.net.Uri) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.SecurityException;
    method public void setDataSource(android.content.Context, android.net.Uri, java.util.Map<java.lang.String, java.lang.String>, java.util.List<java.net.HttpCookie>) throws java.io.IOException;
    method public void setDataSource(android.content.Context, android.net.Uri, 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(java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.SecurityException;
    method public void setDataSource(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(java.lang.String, java.lang.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(android.media.MediaPlayer.OnMediaTimeDiscontinuityListener, android.os.Handler);
    method public void setOnMediaTimeDiscontinuityListener(android.media.MediaPlayer.OnMediaTimeDiscontinuityListener);
    method public void setOnPreparedListener(android.media.MediaPlayer.OnPreparedListener);
    method public void setOnSeekCompleteListener(android.media.MediaPlayer.OnSeekCompleteListener);
    method public void setOnSubtitleDataListener(android.media.MediaPlayer.OnSubtitleDataListener, android.os.Handler);
    method public void setOnSubtitleDataListener(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(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(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 public static final deprecated java.lang.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 java.lang.String CODEC_AUDIO = "android.media.mediaplayer.audio.codec";
    field public static final java.lang.String CODEC_VIDEO = "android.media.mediaplayer.video.codec";
    field public static final java.lang.String DURATION = "android.media.mediaplayer.durationMs";
    field public static final java.lang.String ERRORS = "android.media.mediaplayer.err";
    field public static final java.lang.String ERROR_CODE = "android.media.mediaplayer.errcode";
    field public static final java.lang.String FRAMES = "android.media.mediaplayer.frames";
    field public static final java.lang.String FRAMES_DROPPED = "android.media.mediaplayer.dropped";
    field public static final java.lang.String HEIGHT = "android.media.mediaplayer.height";
    field public static final java.lang.String MIME_TYPE_AUDIO = "android.media.mediaplayer.audio.mime";
    field public static final java.lang.String MIME_TYPE_VIDEO = "android.media.mediaplayer.video.mime";
    field public static final java.lang.String PLAYING = "android.media.mediaplayer.playingMs";
    field public static final java.lang.String WIDTH = "android.media.mediaplayer.width";
  }

  public static final class MediaPlayer.NoDrmSchemeException extends android.media.MediaDrmException {
    ctor public MediaPlayer.NoDrmSchemeException(java.lang.String);
  }

  public static abstract interface MediaPlayer.OnBufferingUpdateListener {
    method public abstract void onBufferingUpdate(android.media.MediaPlayer, int);
  }

  public static abstract interface MediaPlayer.OnCompletionListener {
    method public abstract void onCompletion(android.media.MediaPlayer);
  }

  public static abstract interface MediaPlayer.OnDrmConfigHelper {
    method public abstract void onDrmConfig(android.media.MediaPlayer);
  }

  public static abstract interface MediaPlayer.OnDrmInfoListener {
    method public abstract void onDrmInfo(android.media.MediaPlayer, android.media.MediaPlayer.DrmInfo);
  }

  public static abstract interface MediaPlayer.OnDrmPreparedListener {
    method public abstract void onDrmPrepared(android.media.MediaPlayer, int);
  }

  public static abstract interface MediaPlayer.OnErrorListener {
    method public abstract boolean onError(android.media.MediaPlayer, int, int);
  }

  public static abstract interface MediaPlayer.OnInfoListener {
    method public abstract boolean onInfo(android.media.MediaPlayer, int, int);
  }

  public static abstract interface MediaPlayer.OnMediaTimeDiscontinuityListener {
    method public abstract void onMediaTimeDiscontinuity(android.media.MediaPlayer, android.media.MediaTimestamp);
  }

  public static abstract interface MediaPlayer.OnPreparedListener {
    method public abstract void onPrepared(android.media.MediaPlayer);
  }

  public static abstract interface MediaPlayer.OnSeekCompleteListener {
    method public abstract void onSeekComplete(android.media.MediaPlayer);
  }

  public static abstract interface MediaPlayer.OnSubtitleDataListener {
    method public abstract void onSubtitleData(android.media.MediaPlayer, android.media.SubtitleData);
  }

  public static abstract interface MediaPlayer.OnTimedMetaDataAvailableListener {
    method public abstract void onTimedMetaDataAvailable(android.media.MediaPlayer, android.media.TimedMetaData);
  }

  public static abstract interface MediaPlayer.OnTimedTextListener {
    method public abstract void onTimedText(android.media.MediaPlayer, android.media.TimedText);
  }

  public static abstract interface MediaPlayer.OnVideoSizeChangedListener {
    method public abstract void onVideoSizeChanged(android.media.MediaPlayer, int, int);
  }

  public static final class MediaPlayer.ProvisioningNetworkErrorException extends android.media.MediaDrmException {
    ctor public MediaPlayer.ProvisioningNetworkErrorException(java.lang.String);
  }

  public static final class MediaPlayer.ProvisioningServerErrorException extends android.media.MediaDrmException {
    ctor public MediaPlayer.ProvisioningServerErrorException(java.lang.String);
  }

  public static class MediaPlayer.TrackInfo implements android.os.Parcelable {
    method public int describeContents();
    method public android.media.MediaFormat getFormat();
    method public java.lang.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 public deprecated void setCamera(android.hardware.Camera);
    method public void setCaptureRate(double);
    method public void setInputSurface(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(java.lang.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 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 java.lang.String AUDIO_BITRATE = "android.media.mediarecorder.audio-bitrate";
    field public static final java.lang.String AUDIO_CHANNELS = "android.media.mediarecorder.audio-channels";
    field public static final java.lang.String AUDIO_SAMPLERATE = "android.media.mediarecorder.audio-samplerate";
    field public static final java.lang.String AUDIO_TIMESCALE = "android.media.mediarecorder.audio-timescale";
    field public static final java.lang.String CAPTURE_FPS = "android.media.mediarecorder.capture-fps";
    field public static final java.lang.String CAPTURE_FPS_ENABLE = "android.media.mediarecorder.capture-fpsenable";
    field public static final java.lang.String FRAMERATE = "android.media.mediarecorder.frame-rate";
    field public static final java.lang.String HEIGHT = "android.media.mediarecorder.height";
    field public static final java.lang.String MOVIE_TIMESCALE = "android.media.mediarecorder.movie-timescale";
    field public static final java.lang.String ROTATION = "android.media.mediarecorder.rotation";
    field public static final java.lang.String VIDEO_BITRATE = "android.media.mediarecorder.video-bitrate";
    field public static final java.lang.String VIDEO_IFRAME_INTERVAL = "android.media.mediarecorder.video-iframe-interval";
    field public static final java.lang.String VIDEO_LEVEL = "android.media.mediarecorder.video-encoder-level";
    field public static final java.lang.String VIDEO_PROFILE = "android.media.mediarecorder.video-encoder-profile";
    field public static final java.lang.String VIDEO_TIMESCALE = "android.media.mediarecorder.video-timescale";
    field public static final java.lang.String WIDTH = "android.media.mediarecorder.width";
  }

  public static abstract interface MediaRecorder.OnErrorListener {
    method public abstract void onError(android.media.MediaRecorder, int, int);
  }

  public static abstract interface MediaRecorder.OnInfoListener {
    method public abstract 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 public static final deprecated 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(java.lang.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, 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 static abstract 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 java.lang.CharSequence getName();
    method public java.lang.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(int);
  }

  public static class MediaRouter.RouteInfo {
    method public android.media.MediaRouter.RouteCategory getCategory();
    method public java.lang.CharSequence getDescription();
    method public int getDeviceType();
    method public android.media.MediaRouter.RouteGroup getGroup();
    method public android.graphics.drawable.Drawable getIconDrawable();
    method public java.lang.CharSequence getName();
    method public java.lang.CharSequence getName(android.content.Context);
    method public int getPlaybackStream();
    method public int getPlaybackType();
    method public android.view.Display getPresentationDisplay();
    method public java.lang.CharSequence getStatus();
    method public int getSupportedTypes();
    method public java.lang.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(java.lang.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(java.lang.CharSequence);
    method public void setIconDrawable(android.graphics.drawable.Drawable);
    method public void setIconResource(int);
    method public void setName(java.lang.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(java.lang.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 static abstract 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 synchronized boolean isConnected();
    method public void onServiceConnected(android.content.ComponentName, android.os.IBinder);
    method public void onServiceDisconnected(android.content.ComponentName);
    method public void scanFile(java.lang.String, java.lang.String);
    method public static void scanFile(android.content.Context, java.lang.String[], java.lang.String[], android.media.MediaScannerConnection.OnScanCompletedListener);
  }

  public static abstract interface MediaScannerConnection.MediaScannerConnectionClient implements android.media.MediaScannerConnection.OnScanCompletedListener {
    method public abstract void onMediaScannerConnected();
  }

  public static abstract interface MediaScannerConnection.OnScanCompletedListener {
    method public abstract void onScanCompleted(java.lang.String, android.net.Uri);
  }

  public final class MediaSync {
    ctor public MediaSync();
    method public android.view.Surface createInputSurface();
    method protected void finalize();
    method public void flush();
    method public android.media.PlaybackParams getPlaybackParams();
    method public android.media.SyncParams getSyncParams();
    method public android.media.MediaTimestamp getTimestamp();
    method public void queueAudio(java.nio.ByteBuffer, int, long);
    method public void release();
    method public void setAudioTrack(android.media.AudioTrack);
    method public void setCallback(android.media.MediaSync.Callback, android.os.Handler);
    method public void setOnErrorListener(android.media.MediaSync.OnErrorListener, android.os.Handler);
    method public void setPlaybackParams(android.media.PlaybackParams);
    method public void setSurface(android.view.Surface);
    method public void setSyncParams(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 static abstract class MediaSync.Callback {
    ctor public MediaSync.Callback();
    method public abstract void onAudioBufferConsumed(android.media.MediaSync, java.nio.ByteBuffer, int);
  }

  public static abstract interface MediaSync.OnErrorListener {
    method public abstract void onError(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 public java.lang.String getAddress();
    method public java.util.List<android.util.Pair<java.lang.Integer, java.lang.Integer>> getChannelMapping();
    method public java.lang.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(java.lang.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
  }

  public deprecated class RemoteControlClient {
    ctor public RemoteControlClient(android.app.PendingIntent);
    ctor public RemoteControlClient(android.app.PendingIntent, android.os.Looper);
    method public android.media.RemoteControlClient.MetadataEditor editMetadata(boolean);
    method public android.media.session.MediaSession getMediaSession();
    method public void setMetadataUpdateListener(android.media.RemoteControlClient.OnMetadataUpdateListener);
    method public void setOnGetPlaybackPositionListener(android.media.RemoteControlClient.OnGetPlaybackPositionListener);
    method public void setPlaybackPositionUpdateListener(android.media.RemoteControlClient.OnPlaybackPositionUpdateListener);
    method public void setPlaybackState(int);
    method public void setPlaybackState(int, long, float);
    method public void setTransportControlFlags(int);
    field public static final int FLAG_KEY_MEDIA_FAST_FORWARD = 64; // 0x40
    field public static final int FLAG_KEY_MEDIA_NEXT = 128; // 0x80
    field public static final int FLAG_KEY_MEDIA_PAUSE = 16; // 0x10
    field public static final int FLAG_KEY_MEDIA_PLAY = 4; // 0x4
    field public static final int FLAG_KEY_MEDIA_PLAY_PAUSE = 8; // 0x8
    field public static final int FLAG_KEY_MEDIA_POSITION_UPDATE = 256; // 0x100
    field public static final int FLAG_KEY_MEDIA_PREVIOUS = 1; // 0x1
    field public static final int FLAG_KEY_MEDIA_RATING = 512; // 0x200
    field public static final int FLAG_KEY_MEDIA_REWIND = 2; // 0x2
    field public static final int FLAG_KEY_MEDIA_STOP = 32; // 0x20
    field public static final int PLAYSTATE_BUFFERING = 8; // 0x8
    field public static final int PLAYSTATE_ERROR = 9; // 0x9
    field public static final int PLAYSTATE_FAST_FORWARDING = 4; // 0x4
    field public static final int PLAYSTATE_PAUSED = 2; // 0x2
    field public static final int PLAYSTATE_PLAYING = 3; // 0x3
    field public static final int PLAYSTATE_REWINDING = 5; // 0x5
    field public static final int PLAYSTATE_SKIPPING_BACKWARDS = 7; // 0x7
    field public static final int PLAYSTATE_SKIPPING_FORWARDS = 6; // 0x6
    field public static final int PLAYSTATE_STOPPED = 1; // 0x1
  }

  public deprecated class RemoteControlClient.MetadataEditor extends android.media.MediaMetadataEditor {
    method public synchronized void apply();
    method public java.lang.Object clone() throws java.lang.CloneNotSupportedException;
    method public synchronized android.media.RemoteControlClient.MetadataEditor putBitmap(int, android.graphics.Bitmap) throws java.lang.IllegalArgumentException;
    method public synchronized android.media.RemoteControlClient.MetadataEditor putLong(int, long) throws java.lang.IllegalArgumentException;
    method public synchronized android.media.RemoteControlClient.MetadataEditor putObject(int, java.lang.Object) throws java.lang.IllegalArgumentException;
    method public synchronized android.media.RemoteControlClient.MetadataEditor putString(int, java.lang.String) throws java.lang.IllegalArgumentException;
    field public static final int BITMAP_KEY_ARTWORK = 100; // 0x64
  }

  public static abstract interface RemoteControlClient.OnGetPlaybackPositionListener {
    method public abstract long onGetPlaybackPosition();
  }

  public static abstract interface RemoteControlClient.OnMetadataUpdateListener {
    method public abstract void onMetadataUpdate(int, java.lang.Object);
  }

  public static abstract interface RemoteControlClient.OnPlaybackPositionUpdateListener {
    method public abstract void onPlaybackPositionUpdate(long);
  }

  public final deprecated class RemoteController {
    ctor public RemoteController(android.content.Context, android.media.RemoteController.OnClientUpdateListener) throws java.lang.IllegalArgumentException;
    ctor public RemoteController(android.content.Context, android.media.RemoteController.OnClientUpdateListener, android.os.Looper) throws java.lang.IllegalArgumentException;
    method public boolean clearArtworkConfiguration();
    method public android.media.RemoteController.MetadataEditor editMetadata();
    method public long getEstimatedMediaPosition();
    method public boolean seekTo(long) throws java.lang.IllegalArgumentException;
    method public boolean sendMediaKeyEvent(android.view.KeyEvent) throws java.lang.IllegalArgumentException;
    method public boolean setArtworkConfiguration(int, int) throws java.lang.IllegalArgumentException;
    method public boolean setSynchronizationMode(int) throws java.lang.IllegalArgumentException;
    field public static final int POSITION_SYNCHRONIZATION_CHECK = 1; // 0x1
    field public static final int POSITION_SYNCHRONIZATION_NONE = 0; // 0x0
  }

  public class RemoteController.MetadataEditor extends android.media.MediaMetadataEditor {
    method public synchronized void apply();
  }

  public static abstract interface RemoteController.OnClientUpdateListener {
    method public abstract void onClientChange(boolean);
    method public abstract void onClientMetadataUpdate(android.media.RemoteController.MetadataEditor);
    method public abstract void onClientPlaybackStateUpdate(int);
    method public abstract void onClientPlaybackStateUpdate(int, long, long, float);
    method public abstract void onClientTransportControlUpdate(int);
  }

  public final class ResourceBusyException extends android.media.MediaDrmException {
    ctor public ResourceBusyException(java.lang.String);
  }

  public class Ringtone {
    method protected void finalize();
    method public android.media.AudioAttributes getAudioAttributes();
    method public deprecated int getStreamType();
    method public java.lang.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 public deprecated 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 public deprecated 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 public deprecated void setIncludeDrm(boolean);
    method public void setStopPreviousRingtone(boolean);
    method public void setType(int);
    method public void stopPreviousRingtone();
    field public static final java.lang.String ACTION_RINGTONE_PICKER = "android.intent.action.RINGTONE_PICKER";
    field public static final java.lang.String EXTRA_RINGTONE_DEFAULT_URI = "android.intent.extra.ringtone.DEFAULT_URI";
    field public static final java.lang.String EXTRA_RINGTONE_EXISTING_URI = "android.intent.extra.ringtone.EXISTING_URI";
    field public static final deprecated java.lang.String EXTRA_RINGTONE_INCLUDE_DRM = "android.intent.extra.ringtone.INCLUDE_DRM";
    field public static final java.lang.String EXTRA_RINGTONE_PICKED_URI = "android.intent.extra.ringtone.PICKED_URI";
    field public static final java.lang.String EXTRA_RINGTONE_SHOW_DEFAULT = "android.intent.extra.ringtone.SHOW_DEFAULT";
    field public static final java.lang.String EXTRA_RINGTONE_SHOW_SILENT = "android.intent.extra.ringtone.SHOW_SILENT";
    field public static final java.lang.String EXTRA_RINGTONE_TITLE = "android.intent.extra.ringtone.TITLE";
    field public static final java.lang.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 public deprecated SoundPool(int, int, int);
    method public final void autoPause();
    method public final void autoResume();
    method protected void finalize();
    method public int load(java.lang.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 abstract interface SoundPool.OnLoadCompleteListener {
    method public abstract void onLoadComplete(android.media.SoundPool, int, int);
  }

  public final class SubtitleData {
    method 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(java.lang.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 java.lang.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(java.lang.String);
  }

  public abstract interface VolumeAutomation {
    method public abstract android.media.VolumeShaper createVolumeShaper(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(android.media.VolumeShaper.Operation);
    method public void close();
    method protected void finalize();
    method public float getVolume();
    method public void replace(android.media.VolumeShaper.Configuration, 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(android.media.VolumeShaper.Configuration);
    method public android.media.VolumeShaper.Configuration build();
    method public android.media.VolumeShaper.Configuration.Builder invertVolumes();
    method public android.media.VolumeShaper.Configuration.Builder reflectTimes();
    method public android.media.VolumeShaper.Configuration.Builder scaleToEndVolume(float);
    method public android.media.VolumeShaper.Configuration.Builder scaleToStartVolume(float);
    method public android.media.VolumeShaper.Configuration.Builder setCurve(float[], float[]);
    method public android.media.VolumeShaper.Configuration.Builder setDuration(long);
    method 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 java.lang.String ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION = "android.media.action.CLOSE_AUDIO_EFFECT_CONTROL_SESSION";
    field public static final java.lang.String ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL = "android.media.action.DISPLAY_AUDIO_EFFECT_CONTROL_PANEL";
    field public static final java.lang.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 java.lang.String EFFECT_AUXILIARY = "Auxiliary";
    field public static final java.lang.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 java.lang.String EXTRA_AUDIO_SESSION = "android.media.extra.AUDIO_SESSION";
    field public static final java.lang.String EXTRA_CONTENT_TYPE = "android.media.extra.CONTENT_TYPE";
    field public static final java.lang.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(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    field public java.lang.String connectMode;
    field public java.lang.String implementor;
    field public java.lang.String name;
    field public java.util.UUID type;
    field public java.util.UUID uuid;
  }

  public static abstract interface AudioEffect.OnControlStatusChangeListener {
    method public abstract void onControlStatusChange(android.media.audiofx.AudioEffect, boolean);
  }

  public static abstract interface AudioEffect.OnEnableStatusChangeListener {
    method public abstract 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 abstract interface BassBoost.OnParameterChangeListener {
    method public abstract void onParameterChange(android.media.audiofx.BassBoost, int, int, short);
  }

  public static class BassBoost.Settings {
    ctor public BassBoost.Settings();
    ctor public BassBoost.Settings(java.lang.String);
    field public short strength;
  }

  public final class DynamicsProcessing extends android.media.audiofx.AudioEffect {
    ctor public DynamicsProcessing(int);
    ctor public DynamicsProcessing(int, int, 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 abstract interface EnvironmentalReverb.OnParameterChangeListener {
    method public abstract void onParameterChange(android.media.audiofx.EnvironmentalReverb, int, int, int);
  }

  public static class EnvironmentalReverb.Settings {
    ctor public EnvironmentalReverb.Settings();
    ctor public EnvironmentalReverb.Settings(java.lang.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 java.lang.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 abstract interface Equalizer.OnParameterChangeListener {
    method public abstract void onParameterChange(android.media.audiofx.Equalizer, int, int, int, int);
  }

  public static class Equalizer.Settings {
    ctor public Equalizer.Settings();
    ctor public Equalizer.Settings(java.lang.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 abstract interface PresetReverb.OnParameterChangeListener {
    method public abstract void onParameterChange(android.media.audiofx.PresetReverb, int, int, short);
  }

  public static class PresetReverb.Settings {
    ctor public PresetReverb.Settings();
    ctor public PresetReverb.Settings(java.lang.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 abstract interface Virtualizer.OnParameterChangeListener {
    method public abstract void onParameterChange(android.media.audiofx.Virtualizer, int, int, short);
  }

  public static class Virtualizer.Settings {
    ctor public Virtualizer.Settings();
    ctor public Virtualizer.Settings(java.lang.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 abstract interface Visualizer.OnDataCaptureListener {
    method public abstract void onFftDataCapture(android.media.audiofx.Visualizer, byte[], int);
    method public abstract 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 public android.os.Bundle getExtras();
    method public void getItem(java.lang.String, android.media.browse.MediaBrowser.ItemCallback);
    method public java.lang.String getRoot();
    method public android.content.ComponentName getServiceComponent();
    method public android.media.session.MediaSession.Token getSessionToken();
    method public boolean isConnected();
    method public void subscribe(java.lang.String, android.media.browse.MediaBrowser.SubscriptionCallback);
    method public void subscribe(java.lang.String, android.os.Bundle, android.media.browse.MediaBrowser.SubscriptionCallback);
    method public void unsubscribe(java.lang.String);
    method public void unsubscribe(java.lang.String, android.media.browse.MediaBrowser.SubscriptionCallback);
    field public static final java.lang.String EXTRA_PAGE = "android.media.browse.extra.PAGE";
    field public static final java.lang.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 static abstract class MediaBrowser.ItemCallback {
    ctor public MediaBrowser.ItemCallback();
    method public void onError(java.lang.String);
    method public void onItemLoaded(android.media.browse.MediaBrowser.MediaItem);
  }

  public static class MediaBrowser.MediaItem implements android.os.Parcelable {
    ctor public MediaBrowser.MediaItem(android.media.MediaDescription, int);
    method public int describeContents();
    method public android.media.MediaDescription getDescription();
    method public int getFlags();
    method public java.lang.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 static abstract class MediaBrowser.SubscriptionCallback {
    ctor public MediaBrowser.SubscriptionCallback();
    method public void onChildrenLoaded(java.lang.String, java.util.List<android.media.browse.MediaBrowser.MediaItem>);
    method public void onChildrenLoaded(java.lang.String, java.util.List<android.media.browse.MediaBrowser.MediaItem>, android.os.Bundle);
    method public void onError(java.lang.String);
    method public void onError(java.lang.String, 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 java.lang.String getName();
    method public abstract void release();
    method public abstract void setParameter(java.lang.String, java.lang.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(java.lang.String);
    method public static boolean isEffectSupported(java.lang.String);
    field public static final java.lang.String EFFECT_AUTOFIX = "android.media.effect.effects.AutoFixEffect";
    field public static final java.lang.String EFFECT_BACKDROPPER = "android.media.effect.effects.BackDropperEffect";
    field public static final java.lang.String EFFECT_BITMAPOVERLAY = "android.media.effect.effects.BitmapOverlayEffect";
    field public static final java.lang.String EFFECT_BLACKWHITE = "android.media.effect.effects.BlackWhiteEffect";
    field public static final java.lang.String EFFECT_BRIGHTNESS = "android.media.effect.effects.BrightnessEffect";
    field public static final java.lang.String EFFECT_CONTRAST = "android.media.effect.effects.ContrastEffect";
    field public static final java.lang.String EFFECT_CROP = "android.media.effect.effects.CropEffect";
    field public static final java.lang.String EFFECT_CROSSPROCESS = "android.media.effect.effects.CrossProcessEffect";
    field public static final java.lang.String EFFECT_DOCUMENTARY = "android.media.effect.effects.DocumentaryEffect";
    field public static final java.lang.String EFFECT_DUOTONE = "android.media.effect.effects.DuotoneEffect";
    field public static final java.lang.String EFFECT_FILLLIGHT = "android.media.effect.effects.FillLightEffect";
    field public static final java.lang.String EFFECT_FISHEYE = "android.media.effect.effects.FisheyeEffect";
    field public static final java.lang.String EFFECT_FLIP = "android.media.effect.effects.FlipEffect";
    field public static final java.lang.String EFFECT_GRAIN = "android.media.effect.effects.GrainEffect";
    field public static final java.lang.String EFFECT_GRAYSCALE = "android.media.effect.effects.GrayscaleEffect";
    field public static final java.lang.String EFFECT_LOMOISH = "android.media.effect.effects.LomoishEffect";
    field public static final java.lang.String EFFECT_NEGATIVE = "android.media.effect.effects.NegativeEffect";
    field public static final java.lang.String EFFECT_POSTERIZE = "android.media.effect.effects.PosterizeEffect";
    field public static final java.lang.String EFFECT_REDEYE = "android.media.effect.effects.RedEyeEffect";
    field public static final java.lang.String EFFECT_ROTATE = "android.media.effect.effects.RotateEffect";
    field public static final java.lang.String EFFECT_SATURATE = "android.media.effect.effects.SaturateEffect";
    field public static final java.lang.String EFFECT_SEPIA = "android.media.effect.effects.SepiaEffect";
    field public static final java.lang.String EFFECT_SHARPEN = "android.media.effect.effects.SharpenEffect";
    field public static final java.lang.String EFFECT_STRAIGHTEN = "android.media.effect.effects.StraightenEffect";
    field public static final java.lang.String EFFECT_TEMPERATURE = "android.media.effect.effects.ColorTemperatureEffect";
    field public static final java.lang.String EFFECT_TINT = "android.media.effect.effects.TintEffect";
    field public static final java.lang.String EFFECT_VIGNETTE = "android.media.effect.effects.VignetteEffect";
  }

  public abstract interface EffectUpdateListener {
    method public abstract void onEffectUpdated(android.media.effect.Effect, java.lang.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 java.lang.String PROPERTY_BLUETOOTH_DEVICE = "bluetooth_device";
    field public static final java.lang.String PROPERTY_MANUFACTURER = "manufacturer";
    field public static final java.lang.String PROPERTY_NAME = "name";
    field public static final java.lang.String PROPERTY_PRODUCT = "product";
    field public static final java.lang.String PROPERTY_SERIAL_NUMBER = "serial_number";
    field public static final java.lang.String PROPERTY_USB_DEVICE = "usb_device";
    field public static final java.lang.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 java.lang.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 java.lang.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 abstract interface MidiManager.OnDeviceOpenedListener {
    method public abstract 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(java.lang.String, int, int, int, int, android.view.Surface, android.hardware.display.VirtualDisplay.Callback, 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 static abstract 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, android.content.Intent);
  }

}

package android.media.session {

  public final class MediaController {
    ctor public MediaController(android.content.Context, android.media.session.MediaSession.Token);
    method public void adjustVolume(int, int);
    method public boolean dispatchMediaButtonEvent(android.view.KeyEvent);
    method public android.os.Bundle getExtras();
    method public long getFlags();
    method public android.media.MediaMetadata getMetadata();
    method public java.lang.String getPackageName();
    method public android.media.session.MediaController.PlaybackInfo getPlaybackInfo();
    method public android.media.session.PlaybackState getPlaybackState();
    method public java.util.List<android.media.session.MediaSession.QueueItem> getQueue();
    method public java.lang.CharSequence getQueueTitle();
    method public int getRatingType();
    method public android.app.PendingIntent getSessionActivity();
    method public android.media.session.MediaSession.Token getSessionToken();
    method public android.media.session.MediaController.TransportControls getTransportControls();
    method public void registerCallback(android.media.session.MediaController.Callback);
    method public void registerCallback(android.media.session.MediaController.Callback, android.os.Handler);
    method public void sendCommand(java.lang.String, android.os.Bundle, android.os.ResultReceiver);
    method public void setVolumeTo(int, int);
    method public void unregisterCallback(android.media.session.MediaController.Callback);
  }

  public static abstract class MediaController.Callback {
    ctor public MediaController.Callback();
    method public void onAudioInfoChanged(android.media.session.MediaController.PlaybackInfo);
    method public void onExtrasChanged(android.os.Bundle);
    method public void onMetadataChanged(android.media.MediaMetadata);
    method public void onPlaybackStateChanged(android.media.session.PlaybackState);
    method public void onQueueChanged(java.util.List<android.media.session.MediaSession.QueueItem>);
    method public void onQueueTitleChanged(java.lang.CharSequence);
    method public void onSessionDestroyed();
    method public void onSessionEvent(java.lang.String, 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(java.lang.String, android.os.Bundle);
    method public void playFromSearch(java.lang.String, android.os.Bundle);
    method public void playFromUri(android.net.Uri, android.os.Bundle);
    method public void prepare();
    method public void prepareFromMediaId(java.lang.String, android.os.Bundle);
    method public void prepareFromSearch(java.lang.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(android.media.session.PlaybackState.CustomAction, android.os.Bundle);
    method public void sendCustomAction(java.lang.String, 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(android.content.Context, java.lang.String);
    method public android.media.session.MediaController getController();
    method public android.media.session.MediaSessionManager.RemoteUserInfo getCurrentControllerInfo();
    method public android.media.session.MediaSession.Token getSessionToken();
    method public boolean isActive();
    method public void release();
    method public void sendSessionEvent(java.lang.String, android.os.Bundle);
    method public void setActive(boolean);
    method public void setCallback(android.media.session.MediaSession.Callback);
    method public void setCallback(android.media.session.MediaSession.Callback, android.os.Handler);
    method public void setExtras(android.os.Bundle);
    method public void setFlags(int);
    method public void setMediaButtonReceiver(android.app.PendingIntent);
    method public void setMetadata(android.media.MediaMetadata);
    method public void setPlaybackState(android.media.session.PlaybackState);
    method public void setPlaybackToLocal(android.media.AudioAttributes);
    method public void setPlaybackToRemote(android.media.VolumeProvider);
    method public void setQueue(java.util.List<android.media.session.MediaSession.QueueItem>);
    method public void setQueueTitle(java.lang.CharSequence);
    method public void setRatingType(int);
    method public void setSessionActivity(android.app.PendingIntent);
    field public static final deprecated int FLAG_HANDLES_MEDIA_BUTTONS = 1; // 0x1
    field public static final deprecated int FLAG_HANDLES_TRANSPORT_CONTROLS = 2; // 0x2
  }

  public static abstract class MediaSession.Callback {
    ctor public MediaSession.Callback();
    method public void onCommand(java.lang.String, android.os.Bundle, android.os.ResultReceiver);
    method public void onCustomAction(java.lang.String, android.os.Bundle);
    method public void onFastForward();
    method public boolean onMediaButtonEvent(android.content.Intent);
    method public void onPause();
    method public void onPlay();
    method public void onPlayFromMediaId(java.lang.String, android.os.Bundle);
    method public void onPlayFromSearch(java.lang.String, android.os.Bundle);
    method public void onPlayFromUri(android.net.Uri, android.os.Bundle);
    method public void onPrepare();
    method public void onPrepareFromMediaId(java.lang.String, android.os.Bundle);
    method public void onPrepareFromSearch(java.lang.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(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(android.media.session.MediaSessionManager.OnActiveSessionsChangedListener, android.content.ComponentName);
    method public void addOnActiveSessionsChangedListener(android.media.session.MediaSessionManager.OnActiveSessionsChangedListener, android.content.ComponentName, android.os.Handler);
    method public java.util.List<android.media.session.MediaController> getActiveSessions(android.content.ComponentName);
    method public boolean isTrustedForMediaControl(android.media.session.MediaSessionManager.RemoteUserInfo);
    method public void removeOnActiveSessionsChangedListener(android.media.session.MediaSessionManager.OnActiveSessionsChangedListener);
  }

  public static abstract interface MediaSessionManager.OnActiveSessionsChangedListener {
    method public abstract void onActiveSessionsChanged(java.util.List<android.media.session.MediaController>);
  }

  public static final class MediaSessionManager.RemoteUserInfo {
    ctor public MediaSessionManager.RemoteUserInfo(java.lang.String, int, int);
    method public java.lang.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 java.lang.CharSequence getErrorMessage();
    method 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(java.lang.String, java.lang.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(java.lang.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 java.lang.String getAction();
    method public android.os.Bundle getExtras();
    method public int getIcon();
    method public java.lang.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(java.lang.String, java.lang.CharSequence, 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(android.media.tv.TvContentRating);
    method public static android.media.tv.TvContentRating createRating(java.lang.String, java.lang.String, java.lang.String, java.lang.String...);
    method public java.lang.String flattenToString();
    method public java.lang.String getDomain();
    method public java.lang.String getMainRating();
    method public java.lang.String getRatingSystem();
    method public java.util.List<java.lang.String> getSubRatings();
    method public static android.media.tv.TvContentRating unflattenFromString(java.lang.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(java.lang.String);
    method public static android.net.Uri buildChannelsUriForInput(java.lang.String);
    method public static java.lang.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(android.net.Uri);
    method public static boolean isChannelUriForPassthroughInput(android.net.Uri);
    method public static boolean isChannelUriForTunerInput(android.net.Uri);
    method public static boolean isProgramUri(android.net.Uri);
    method public static boolean isRecordedProgramUri(android.net.Uri);
    method public static void requestChannelBrowsable(android.content.Context, long);
    field public static final java.lang.String ACTION_INITIALIZE_PROGRAMS = "android.media.tv.action.INITIALIZE_PROGRAMS";
    field public static final java.lang.String ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT = "android.media.tv.action.PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT";
    field public static final java.lang.String ACTION_PREVIEW_PROGRAM_BROWSABLE_DISABLED = "android.media.tv.action.PREVIEW_PROGRAM_BROWSABLE_DISABLED";
    field public static final java.lang.String ACTION_REQUEST_CHANNEL_BROWSABLE = "android.media.tv.action.REQUEST_CHANNEL_BROWSABLE";
    field public static final java.lang.String ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED = "android.media.tv.action.WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED";
    field public static final java.lang.String AUTHORITY = "android.media.tv";
    field public static final java.lang.String EXTRA_CHANNEL_ID = "android.media.tv.extra.CHANNEL_ID";
    field public static final java.lang.String EXTRA_PREVIEW_PROGRAM_ID = "android.media.tv.extra.PREVIEW_PROGRAM_ID";
    field public static final java.lang.String EXTRA_WATCH_NEXT_PROGRAM_ID = "android.media.tv.extra.WATCH_NEXT_PROGRAM_ID";
  }

  public static abstract interface TvContract.BaseTvColumns implements android.provider.BaseColumns {
    field public static final java.lang.String COLUMN_PACKAGE_NAME = "package_name";
  }

  public static final class TvContract.Channels implements android.media.tv.TvContract.BaseTvColumns {
    method public static java.lang.String getVideoResolution(java.lang.String);
    field public static final java.lang.String COLUMN_APP_LINK_COLOR = "app_link_color";
    field public static final java.lang.String COLUMN_APP_LINK_ICON_URI = "app_link_icon_uri";
    field public static final java.lang.String COLUMN_APP_LINK_INTENT_URI = "app_link_intent_uri";
    field public static final java.lang.String COLUMN_APP_LINK_POSTER_ART_URI = "app_link_poster_art_uri";
    field public static final java.lang.String COLUMN_APP_LINK_TEXT = "app_link_text";
    field public static final java.lang.String COLUMN_BROWSABLE = "browsable";
    field public static final java.lang.String COLUMN_DESCRIPTION = "description";
    field public static final java.lang.String COLUMN_DISPLAY_NAME = "display_name";
    field public static final java.lang.String COLUMN_DISPLAY_NUMBER = "display_number";
    field public static final java.lang.String COLUMN_INPUT_ID = "input_id";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_ID = "internal_provider_id";
    field public static final java.lang.String COLUMN_LOCKED = "locked";
    field public static final java.lang.String COLUMN_NETWORK_AFFILIATION = "network_affiliation";
    field public static final java.lang.String COLUMN_ORIGINAL_NETWORK_ID = "original_network_id";
    field public static final java.lang.String COLUMN_SEARCHABLE = "searchable";
    field public static final java.lang.String COLUMN_SERVICE_ID = "service_id";
    field public static final java.lang.String COLUMN_SERVICE_TYPE = "service_type";
    field public static final java.lang.String COLUMN_TRANSIENT = "transient";
    field public static final java.lang.String COLUMN_TRANSPORT_STREAM_ID = "transport_stream_id";
    field public static final java.lang.String COLUMN_TYPE = "type";
    field public static final java.lang.String COLUMN_VERSION_NUMBER = "version_number";
    field public static final java.lang.String COLUMN_VIDEO_FORMAT = "video_format";
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/channel";
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/channel";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String SERVICE_TYPE_AUDIO = "SERVICE_TYPE_AUDIO";
    field public static final java.lang.String SERVICE_TYPE_AUDIO_VIDEO = "SERVICE_TYPE_AUDIO_VIDEO";
    field public static final java.lang.String SERVICE_TYPE_OTHER = "SERVICE_TYPE_OTHER";
    field public static final java.lang.String TYPE_1SEG = "TYPE_1SEG";
    field public static final java.lang.String TYPE_ATSC_C = "TYPE_ATSC_C";
    field public static final java.lang.String TYPE_ATSC_M_H = "TYPE_ATSC_M_H";
    field public static final java.lang.String TYPE_ATSC_T = "TYPE_ATSC_T";
    field public static final java.lang.String TYPE_CMMB = "TYPE_CMMB";
    field public static final java.lang.String TYPE_DTMB = "TYPE_DTMB";
    field public static final java.lang.String TYPE_DVB_C = "TYPE_DVB_C";
    field public static final java.lang.String TYPE_DVB_C2 = "TYPE_DVB_C2";
    field public static final java.lang.String TYPE_DVB_H = "TYPE_DVB_H";
    field public static final java.lang.String TYPE_DVB_S = "TYPE_DVB_S";
    field public static final java.lang.String TYPE_DVB_S2 = "TYPE_DVB_S2";
    field public static final java.lang.String TYPE_DVB_SH = "TYPE_DVB_SH";
    field public static final java.lang.String TYPE_DVB_T = "TYPE_DVB_T";
    field public static final java.lang.String TYPE_DVB_T2 = "TYPE_DVB_T2";
    field public static final java.lang.String TYPE_ISDB_C = "TYPE_ISDB_C";
    field public static final java.lang.String TYPE_ISDB_S = "TYPE_ISDB_S";
    field public static final java.lang.String TYPE_ISDB_T = "TYPE_ISDB_T";
    field public static final java.lang.String TYPE_ISDB_TB = "TYPE_ISDB_TB";
    field public static final java.lang.String TYPE_NTSC = "TYPE_NTSC";
    field public static final java.lang.String TYPE_OTHER = "TYPE_OTHER";
    field public static final java.lang.String TYPE_PAL = "TYPE_PAL";
    field public static final java.lang.String TYPE_PREVIEW = "TYPE_PREVIEW";
    field public static final java.lang.String TYPE_SECAM = "TYPE_SECAM";
    field public static final java.lang.String TYPE_S_DMB = "TYPE_S_DMB";
    field public static final java.lang.String TYPE_T_DMB = "TYPE_T_DMB";
    field public static final java.lang.String VIDEO_FORMAT_1080I = "VIDEO_FORMAT_1080I";
    field public static final java.lang.String VIDEO_FORMAT_1080P = "VIDEO_FORMAT_1080P";
    field public static final java.lang.String VIDEO_FORMAT_2160P = "VIDEO_FORMAT_2160P";
    field public static final java.lang.String VIDEO_FORMAT_240P = "VIDEO_FORMAT_240P";
    field public static final java.lang.String VIDEO_FORMAT_360P = "VIDEO_FORMAT_360P";
    field public static final java.lang.String VIDEO_FORMAT_4320P = "VIDEO_FORMAT_4320P";
    field public static final java.lang.String VIDEO_FORMAT_480I = "VIDEO_FORMAT_480I";
    field public static final java.lang.String VIDEO_FORMAT_480P = "VIDEO_FORMAT_480P";
    field public static final java.lang.String VIDEO_FORMAT_576I = "VIDEO_FORMAT_576I";
    field public static final java.lang.String VIDEO_FORMAT_576P = "VIDEO_FORMAT_576P";
    field public static final java.lang.String VIDEO_FORMAT_720P = "VIDEO_FORMAT_720P";
    field public static final java.lang.String VIDEO_RESOLUTION_ED = "VIDEO_RESOLUTION_ED";
    field public static final java.lang.String VIDEO_RESOLUTION_FHD = "VIDEO_RESOLUTION_FHD";
    field public static final java.lang.String VIDEO_RESOLUTION_HD = "VIDEO_RESOLUTION_HD";
    field public static final java.lang.String VIDEO_RESOLUTION_SD = "VIDEO_RESOLUTION_SD";
    field public static final java.lang.String VIDEO_RESOLUTION_UHD = "VIDEO_RESOLUTION_UHD";
  }

  public static final class TvContract.Channels.Logo {
    field public static final java.lang.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 java.lang.String COLUMN_AUDIO_LANGUAGE = "audio_language";
    field public static final java.lang.String COLUMN_AUTHOR = "author";
    field public static final java.lang.String COLUMN_AVAILABILITY = "availability";
    field public static final java.lang.String COLUMN_BROWSABLE = "browsable";
    field public static final java.lang.String COLUMN_CANONICAL_GENRE = "canonical_genre";
    field public static final java.lang.String COLUMN_CHANNEL_ID = "channel_id";
    field public static final java.lang.String COLUMN_CONTENT_ID = "content_id";
    field public static final java.lang.String COLUMN_CONTENT_RATING = "content_rating";
    field public static final java.lang.String COLUMN_DURATION_MILLIS = "duration_millis";
    field public static final java.lang.String COLUMN_EPISODE_DISPLAY_NUMBER = "episode_display_number";
    field public static final java.lang.String COLUMN_EPISODE_TITLE = "episode_title";
    field public static final java.lang.String COLUMN_INTENT_URI = "intent_uri";
    field public static final java.lang.String COLUMN_INTERACTION_COUNT = "interaction_count";
    field public static final java.lang.String COLUMN_INTERACTION_TYPE = "interaction_type";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_ID = "internal_provider_id";
    field public static final java.lang.String COLUMN_ITEM_COUNT = "item_count";
    field public static final java.lang.String COLUMN_LAST_PLAYBACK_POSITION_MILLIS = "last_playback_position_millis";
    field public static final java.lang.String COLUMN_LIVE = "live";
    field public static final java.lang.String COLUMN_LOGO_URI = "logo_uri";
    field public static final java.lang.String COLUMN_LONG_DESCRIPTION = "long_description";
    field public static final java.lang.String COLUMN_OFFER_PRICE = "offer_price";
    field public static final java.lang.String COLUMN_POSTER_ART_ASPECT_RATIO = "poster_art_aspect_ratio";
    field public static final java.lang.String COLUMN_POSTER_ART_URI = "poster_art_uri";
    field public static final java.lang.String COLUMN_PREVIEW_VIDEO_URI = "preview_video_uri";
    field public static final java.lang.String COLUMN_RELEASE_DATE = "release_date";
    field public static final java.lang.String COLUMN_REVIEW_RATING = "review_rating";
    field public static final java.lang.String COLUMN_REVIEW_RATING_STYLE = "review_rating_style";
    field public static final java.lang.String COLUMN_SEARCHABLE = "searchable";
    field public static final java.lang.String COLUMN_SEASON_DISPLAY_NUMBER = "season_display_number";
    field public static final java.lang.String COLUMN_SEASON_TITLE = "season_title";
    field public static final java.lang.String COLUMN_SHORT_DESCRIPTION = "short_description";
    field public static final java.lang.String COLUMN_STARTING_PRICE = "starting_price";
    field public static final java.lang.String COLUMN_THUMBNAIL_ASPECT_RATIO = "poster_thumbnail_aspect_ratio";
    field public static final java.lang.String COLUMN_THUMBNAIL_URI = "thumbnail_uri";
    field public static final java.lang.String COLUMN_TITLE = "title";
    field public static final java.lang.String COLUMN_TRANSIENT = "transient";
    field public static final java.lang.String COLUMN_TYPE = "type";
    field public static final java.lang.String COLUMN_VERSION_NUMBER = "version_number";
    field public static final java.lang.String COLUMN_VIDEO_HEIGHT = "video_height";
    field public static final java.lang.String COLUMN_VIDEO_WIDTH = "video_width";
    field public static final java.lang.String COLUMN_WEIGHT = "weight";
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/preview_program";
    field public static final java.lang.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 java.lang.String COLUMN_AUDIO_LANGUAGE = "audio_language";
    field public static final java.lang.String COLUMN_BROADCAST_GENRE = "broadcast_genre";
    field public static final java.lang.String COLUMN_CANONICAL_GENRE = "canonical_genre";
    field public static final java.lang.String COLUMN_CHANNEL_ID = "channel_id";
    field public static final java.lang.String COLUMN_CONTENT_RATING = "content_rating";
    field public static final java.lang.String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
    field public static final java.lang.String COLUMN_EPISODE_DISPLAY_NUMBER = "episode_display_number";
    field public static final deprecated java.lang.String COLUMN_EPISODE_NUMBER = "episode_number";
    field public static final java.lang.String COLUMN_EPISODE_TITLE = "episode_title";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
    field public static final java.lang.String COLUMN_LONG_DESCRIPTION = "long_description";
    field public static final java.lang.String COLUMN_POSTER_ART_URI = "poster_art_uri";
    field public static final java.lang.String COLUMN_RECORDING_PROHIBITED = "recording_prohibited";
    field public static final java.lang.String COLUMN_REVIEW_RATING = "review_rating";
    field public static final java.lang.String COLUMN_REVIEW_RATING_STYLE = "review_rating_style";
    field public static final java.lang.String COLUMN_SEARCHABLE = "searchable";
    field public static final java.lang.String COLUMN_SEASON_DISPLAY_NUMBER = "season_display_number";
    field public static final deprecated java.lang.String COLUMN_SEASON_NUMBER = "season_number";
    field public static final java.lang.String COLUMN_SEASON_TITLE = "season_title";
    field public static final java.lang.String COLUMN_SHORT_DESCRIPTION = "short_description";
    field public static final java.lang.String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
    field public static final java.lang.String COLUMN_THUMBNAIL_URI = "thumbnail_uri";
    field public static final java.lang.String COLUMN_TITLE = "title";
    field public static final java.lang.String COLUMN_VERSION_NUMBER = "version_number";
    field public static final java.lang.String COLUMN_VIDEO_HEIGHT = "video_height";
    field public static final java.lang.String COLUMN_VIDEO_WIDTH = "video_width";
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/program";
    field public static final java.lang.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 java.lang.String[] decode(java.lang.String);
    method public static java.lang.String encode(java.lang.String...);
    method public static boolean isCanonical(java.lang.String);
    field public static final java.lang.String ANIMAL_WILDLIFE = "ANIMAL_WILDLIFE";
    field public static final java.lang.String ARTS = "ARTS";
    field public static final java.lang.String COMEDY = "COMEDY";
    field public static final java.lang.String DRAMA = "DRAMA";
    field public static final java.lang.String EDUCATION = "EDUCATION";
    field public static final java.lang.String ENTERTAINMENT = "ENTERTAINMENT";
    field public static final java.lang.String FAMILY_KIDS = "FAMILY_KIDS";
    field public static final java.lang.String GAMING = "GAMING";
    field public static final java.lang.String LIFE_STYLE = "LIFE_STYLE";
    field public static final java.lang.String MOVIES = "MOVIES";
    field public static final java.lang.String MUSIC = "MUSIC";
    field public static final java.lang.String NEWS = "NEWS";
    field public static final java.lang.String PREMIER = "PREMIER";
    field public static final java.lang.String SHOPPING = "SHOPPING";
    field public static final java.lang.String SPORTS = "SPORTS";
    field public static final java.lang.String TECH_SCIENCE = "TECH_SCIENCE";
    field public static final java.lang.String TRAVEL = "TRAVEL";
  }

  public static final class TvContract.RecordedPrograms implements android.media.tv.TvContract.BaseTvColumns {
    field public static final java.lang.String COLUMN_AUDIO_LANGUAGE = "audio_language";
    field public static final java.lang.String COLUMN_BROADCAST_GENRE = "broadcast_genre";
    field public static final java.lang.String COLUMN_CANONICAL_GENRE = "canonical_genre";
    field public static final java.lang.String COLUMN_CHANNEL_ID = "channel_id";
    field public static final java.lang.String COLUMN_CONTENT_RATING = "content_rating";
    field public static final java.lang.String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
    field public static final java.lang.String COLUMN_EPISODE_DISPLAY_NUMBER = "episode_display_number";
    field public static final java.lang.String COLUMN_EPISODE_TITLE = "episode_title";
    field public static final java.lang.String COLUMN_INPUT_ID = "input_id";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
    field public static final java.lang.String COLUMN_LONG_DESCRIPTION = "long_description";
    field public static final java.lang.String COLUMN_POSTER_ART_URI = "poster_art_uri";
    field public static final java.lang.String COLUMN_RECORDING_DATA_BYTES = "recording_data_bytes";
    field public static final java.lang.String COLUMN_RECORDING_DATA_URI = "recording_data_uri";
    field public static final java.lang.String COLUMN_RECORDING_DURATION_MILLIS = "recording_duration_millis";
    field public static final java.lang.String COLUMN_RECORDING_EXPIRE_TIME_UTC_MILLIS = "recording_expire_time_utc_millis";
    field public static final java.lang.String COLUMN_REVIEW_RATING = "review_rating";
    field public static final java.lang.String COLUMN_REVIEW_RATING_STYLE = "review_rating_style";
    field public static final java.lang.String COLUMN_SEARCHABLE = "searchable";
    field public static final java.lang.String COLUMN_SEASON_DISPLAY_NUMBER = "season_display_number";
    field public static final java.lang.String COLUMN_SEASON_TITLE = "season_title";
    field public static final java.lang.String COLUMN_SHORT_DESCRIPTION = "short_description";
    field public static final java.lang.String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
    field public static final java.lang.String COLUMN_THUMBNAIL_URI = "thumbnail_uri";
    field public static final java.lang.String COLUMN_TITLE = "title";
    field public static final java.lang.String COLUMN_VERSION_NUMBER = "version_number";
    field public static final java.lang.String COLUMN_VIDEO_HEIGHT = "video_height";
    field public static final java.lang.String COLUMN_VIDEO_WIDTH = "video_width";
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/recorded_program";
    field public static final java.lang.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 java.lang.String COLUMN_AUDIO_LANGUAGE = "audio_language";
    field public static final java.lang.String COLUMN_AUTHOR = "author";
    field public static final java.lang.String COLUMN_AVAILABILITY = "availability";
    field public static final java.lang.String COLUMN_BROWSABLE = "browsable";
    field public static final java.lang.String COLUMN_CANONICAL_GENRE = "canonical_genre";
    field public static final java.lang.String COLUMN_CONTENT_ID = "content_id";
    field public static final java.lang.String COLUMN_CONTENT_RATING = "content_rating";
    field public static final java.lang.String COLUMN_DURATION_MILLIS = "duration_millis";
    field public static final java.lang.String COLUMN_EPISODE_DISPLAY_NUMBER = "episode_display_number";
    field public static final java.lang.String COLUMN_EPISODE_TITLE = "episode_title";
    field public static final java.lang.String COLUMN_INTENT_URI = "intent_uri";
    field public static final java.lang.String COLUMN_INTERACTION_COUNT = "interaction_count";
    field public static final java.lang.String COLUMN_INTERACTION_TYPE = "interaction_type";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
    field public static final java.lang.String COLUMN_INTERNAL_PROVIDER_ID = "internal_provider_id";
    field public static final java.lang.String COLUMN_ITEM_COUNT = "item_count";
    field public static final java.lang.String COLUMN_LAST_ENGAGEMENT_TIME_UTC_MILLIS = "last_engagement_time_utc_millis";
    field public static final java.lang.String COLUMN_LAST_PLAYBACK_POSITION_MILLIS = "last_playback_position_millis";
    field public static final java.lang.String COLUMN_LIVE = "live";
    field public static final java.lang.String COLUMN_LOGO_URI = "logo_uri";
    field public static final java.lang.String COLUMN_LONG_DESCRIPTION = "long_description";
    field public static final java.lang.String COLUMN_OFFER_PRICE = "offer_price";
    field public static final java.lang.String COLUMN_POSTER_ART_ASPECT_RATIO = "poster_art_aspect_ratio";
    field public static final java.lang.String COLUMN_POSTER_ART_URI = "poster_art_uri";
    field public static final java.lang.String COLUMN_PREVIEW_VIDEO_URI = "preview_video_uri";
    field public static final java.lang.String COLUMN_RELEASE_DATE = "release_date";
    field public static final java.lang.String COLUMN_REVIEW_RATING = "review_rating";
    field public static final java.lang.String COLUMN_REVIEW_RATING_STYLE = "review_rating_style";
    field public static final java.lang.String COLUMN_SEARCHABLE = "searchable";
    field public static final java.lang.String COLUMN_SEASON_DISPLAY_NUMBER = "season_display_number";
    field public static final java.lang.String COLUMN_SEASON_TITLE = "season_title";
    field public static final java.lang.String COLUMN_SHORT_DESCRIPTION = "short_description";
    field public static final java.lang.String COLUMN_STARTING_PRICE = "starting_price";
    field public static final java.lang.String COLUMN_THUMBNAIL_ASPECT_RATIO = "poster_thumbnail_aspect_ratio";
    field public static final java.lang.String COLUMN_THUMBNAIL_URI = "thumbnail_uri";
    field public static final java.lang.String COLUMN_TITLE = "title";
    field public static final java.lang.String COLUMN_TRANSIENT = "transient";
    field public static final java.lang.String COLUMN_TYPE = "type";
    field public static final java.lang.String COLUMN_VERSION_NUMBER = "version_number";
    field public static final java.lang.String COLUMN_VIDEO_HEIGHT = "video_height";
    field public static final java.lang.String COLUMN_VIDEO_WIDTH = "video_width";
    field public static final java.lang.String COLUMN_WATCH_NEXT_TYPE = "watch_next_type";
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/watch_next_program";
    field public static final java.lang.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 public deprecated android.content.Intent createSettingsIntent();
    method public android.content.Intent createSetupIntent();
    method public int describeContents();
    method public android.os.Bundle getExtras();
    method public java.lang.String getId();
    method public java.lang.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 java.lang.CharSequence loadCustomLabel(android.content.Context);
    method public android.graphics.drawable.Drawable loadIcon(android.content.Context);
    method public java.lang.CharSequence loadLabel(android.content.Context);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.tv.TvInputInfo> CREATOR;
    field public static final java.lang.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(java.lang.String);
    method public android.media.tv.TvInputInfo getTvInputInfo(java.lang.String);
    method public java.util.List<android.media.tv.TvInputInfo> getTvInputList();
    method public boolean isParentalControlsEnabled();
    method public boolean isRatingBlocked(android.media.tv.TvContentRating);
    method public void registerCallback(android.media.tv.TvInputManager.TvInputCallback, android.os.Handler);
    method public void unregisterCallback(android.media.tv.TvInputManager.TvInputCallback);
    method public void updateTvInputInfo(android.media.tv.TvInputInfo);
    field public static final java.lang.String ACTION_BLOCKED_RATINGS_CHANGED = "android.media.tv.action.BLOCKED_RATINGS_CHANGED";
    field public static final java.lang.String ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED = "android.media.tv.action.PARENTAL_CONTROLS_ENABLED_CHANGED";
    field public static final java.lang.String ACTION_QUERY_CONTENT_RATING_SYSTEMS = "android.media.tv.action.QUERY_CONTENT_RATING_SYSTEMS";
    field public static final java.lang.String ACTION_SETUP_INPUTS = "android.media.tv.action.SETUP_INPUTS";
    field public static final java.lang.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 java.lang.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 static abstract class TvInputManager.TvInputCallback {
    ctor public TvInputManager.TvInputCallback();
    method public void onInputAdded(java.lang.String);
    method public void onInputRemoved(java.lang.String);
    method public void onInputStateChanged(java.lang.String, int);
    method public void onInputUpdated(java.lang.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 public android.media.tv.TvInputService.RecordingSession onCreateRecordingSession(java.lang.String);
    method public abstract android.media.tv.TvInputService.Session onCreateSession(java.lang.String);
    field public static final java.lang.String SERVICE_INTERFACE = "android.media.tv.TvInputService";
    field public static final java.lang.String SERVICE_META_DATA = "android.media.tv.input";
  }

  public static abstract class TvInputService.HardwareSession extends android.media.tv.TvInputService.Session {
    ctor public TvInputService.HardwareSession(android.content.Context);
    method public abstract java.lang.String getHardwareInputId();
    method public void onHardwareVideoAvailable();
    method public void onHardwareVideoUnavailable(int);
    method public final boolean onSetSurface(android.view.Surface);
  }

  public static abstract 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(java.lang.String, android.os.Bundle);
    method public abstract void onRelease();
    method public abstract void onStartRecording(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 static abstract 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(android.media.tv.TvContentRating);
    method public void notifyTimeShiftStatusChanged(int);
    method public void notifyTrackSelected(int, java.lang.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(java.lang.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, java.lang.String);
    method public abstract void onSetCaptionEnabled(boolean);
    method public abstract void onSetStreamVolume(float);
    method public abstract boolean onSetSurface(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, java.lang.String, android.media.tv.TvRecordingClient.RecordingCallback, android.os.Handler);
    method public void release();
    method public void sendAppPrivateCommand(java.lang.String, android.os.Bundle);
    method public void startRecording(android.net.Uri);
    method public void stopRecording();
    method public void tune(java.lang.String, android.net.Uri);
    method public void tune(java.lang.String, android.net.Uri, android.os.Bundle);
  }

  public static abstract class TvRecordingClient.RecordingCallback {
    ctor public TvRecordingClient.RecordingCallback();
    method public void onConnectionFailed(java.lang.String);
    method public void onDisconnected(java.lang.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 java.lang.CharSequence getDescription();
    method public android.os.Bundle getExtra();
    method public java.lang.String getId();
    method public java.lang.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, java.lang.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(java.lang.CharSequence);
    method public android.media.tv.TvTrackInfo.Builder setExtra(android.os.Bundle);
    method public android.media.tv.TvTrackInfo.Builder setLanguage(java.lang.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 java.lang.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, java.lang.String);
    method public void sendAppPrivateCommand(java.lang.String, android.os.Bundle);
    method public void setCallback(android.media.tv.TvView.TvInputCallback);
    method public void setCaptionEnabled(boolean);
    method public void setOnUnhandledInputEventListener(android.media.tv.TvView.OnUnhandledInputEventListener);
    method public void setStreamVolume(float);
    method public void setTimeShiftPositionCallback(android.media.tv.TvView.TimeShiftPositionCallback);
    method public void setZOrderMediaOverlay(boolean);
    method public void setZOrderOnTop(boolean);
    method public void timeShiftPause();
    method public void timeShiftPlay(java.lang.String, android.net.Uri);
    method public void timeShiftResume();
    method public void timeShiftSeekTo(long);
    method public void timeShiftSetPlaybackParams(android.media.PlaybackParams);
    method public void tune(java.lang.String, android.net.Uri);
    method public void tune(java.lang.String, android.net.Uri, android.os.Bundle);
  }

  public static abstract interface TvView.OnUnhandledInputEventListener {
    method public abstract boolean onUnhandledInputEvent(android.view.InputEvent);
  }

  public static abstract class TvView.TimeShiftPositionCallback {
    ctor public TvView.TimeShiftPositionCallback();
    method public void onTimeShiftCurrentPositionChanged(java.lang.String, long);
    method public void onTimeShiftStartPositionChanged(java.lang.String, long);
  }

  public static abstract class TvView.TvInputCallback {
    ctor public TvView.TvInputCallback();
    method public void onChannelRetuned(java.lang.String, android.net.Uri);
    method public void onConnectionFailed(java.lang.String);
    method public void onContentAllowed(java.lang.String);
    method public void onContentBlocked(java.lang.String, android.media.tv.TvContentRating);
    method public void onDisconnected(java.lang.String);
    method public void onTimeShiftStatusChanged(java.lang.String, int);
    method public void onTrackSelected(java.lang.String, int, java.lang.String);
    method public void onTracksChanged(java.lang.String, java.util.List<android.media.tv.TvTrackInfo>);
    method public void onVideoAvailable(java.lang.String);
    method public void onVideoSizeChanged(java.lang.String, int, int);
    method public void onVideoUnavailable(java.lang.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(android.hardware.usb.UsbDevice);
    method public void close();
    method public boolean deleteObject(int);
    method public int getDeviceId();
    method public android.mtp.MtpDeviceInfo getDeviceInfo();
    method public java.lang.String getDeviceName();
    method public byte[] getObject(int, int);
    method public int[] getObjectHandles(int, int, int);
    method public android.mtp.MtpObjectInfo getObjectInfo(int);
    method public long getParent(int);
    method public long getPartialObject(int, long, long, byte[]) throws java.io.IOException;
    method public long getPartialObject64(int, long, long, byte[]) throws java.io.IOException;
    method public long getStorageId(int);
    method public int[] getStorageIds();
    method public android.mtp.MtpStorageInfo getStorageInfo(int);
    method public byte[] getThumbnail(int);
    method public boolean importFile(int, java.lang.String);
    method public boolean importFile(int, android.os.ParcelFileDescriptor);
    method public boolean open(android.hardware.usb.UsbDeviceConnection);
    method public android.mtp.MtpEvent readEvent(android.os.CancellationSignal) throws java.io.IOException;
    method public boolean sendObject(int, long, android.os.ParcelFileDescriptor);
    method public android.mtp.MtpObjectInfo sendObjectInfo(android.mtp.MtpObjectInfo);
  }

  public class MtpDeviceInfo {
    method public final int[] getEventsSupported();
    method public final java.lang.String getManufacturer();
    method public final java.lang.String getModel();
    method public final int[] getOperationsSupported();
    method public final java.lang.String getSerialNumber();
    method public final java.lang.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 public java.lang.String getKeywords();
    method public java.lang.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(java.lang.String);
    method public android.mtp.MtpObjectInfo.Builder setName(java.lang.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 public java.lang.String getDescription();
    method public long getFreeSpace();
    method public long getMaxCapacity();
    method public int getStorageId();
    method public java.lang.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(android.net.Network);
    method public android.net.Network getActiveNetwork();
    method public android.net.NetworkInfo getActiveNetworkInfo();
    method public deprecated android.net.NetworkInfo[] getAllNetworkInfo();
    method public android.net.Network[] getAllNetworks();
    method public deprecated boolean getBackgroundDataSetting();
    method public android.net.Network getBoundNetworkForProcess();
    method public android.net.ProxyInfo getDefaultProxy();
    method public android.net.LinkProperties getLinkProperties(android.net.Network);
    method public int getMultipathPreference(android.net.Network);
    method public android.net.NetworkCapabilities getNetworkCapabilities(android.net.Network);
    method public deprecated android.net.NetworkInfo getNetworkInfo(int);
    method public android.net.NetworkInfo getNetworkInfo(android.net.Network);
    method public deprecated int getNetworkPreference();
    method public byte[] getNetworkWatchlistConfigHash();
    method public static deprecated android.net.Network getProcessDefaultNetwork();
    method public int getRestrictBackgroundStatus();
    method public boolean isActiveNetworkMetered();
    method public boolean isDefaultNetworkActive();
    method public static deprecated boolean isNetworkTypeValid(int);
    method public void registerDefaultNetworkCallback(android.net.ConnectivityManager.NetworkCallback);
    method public void registerDefaultNetworkCallback(android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
    method public void registerNetworkCallback(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback);
    method public void registerNetworkCallback(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
    method public void registerNetworkCallback(android.net.NetworkRequest, android.app.PendingIntent);
    method public void releaseNetworkRequest(android.app.PendingIntent);
    method public void removeDefaultNetworkActiveListener(android.net.ConnectivityManager.OnNetworkActiveListener);
    method public deprecated void reportBadNetwork(android.net.Network);
    method public void reportNetworkConnectivity(android.net.Network, boolean);
    method public boolean requestBandwidthUpdate(android.net.Network);
    method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback);
    method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
    method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, int);
    method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, android.os.Handler, int);
    method public void requestNetwork(android.net.NetworkRequest, android.app.PendingIntent);
    method public deprecated void setNetworkPreference(int);
    method public static deprecated boolean setProcessDefaultNetwork(android.net.Network);
    method public void unregisterNetworkCallback(android.net.ConnectivityManager.NetworkCallback);
    method public void unregisterNetworkCallback(android.app.PendingIntent);
    field public static final deprecated java.lang.String ACTION_BACKGROUND_DATA_SETTING_CHANGED = "android.net.conn.BACKGROUND_DATA_SETTING_CHANGED";
    field public static final java.lang.String ACTION_CAPTIVE_PORTAL_SIGN_IN = "android.net.conn.CAPTIVE_PORTAL";
    field public static final java.lang.String ACTION_RESTRICT_BACKGROUND_CHANGED = "android.net.conn.RESTRICT_BACKGROUND_CHANGED";
    field public static final deprecated java.lang.String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
    field public static final deprecated int DEFAULT_NETWORK_PREFERENCE = 1; // 0x1
    field public static final java.lang.String EXTRA_CAPTIVE_PORTAL = "android.net.extra.CAPTIVE_PORTAL";
    field public static final java.lang.String EXTRA_CAPTIVE_PORTAL_URL = "android.net.extra.CAPTIVE_PORTAL_URL";
    field public static final java.lang.String EXTRA_EXTRA_INFO = "extraInfo";
    field public static final java.lang.String EXTRA_IS_FAILOVER = "isFailover";
    field public static final java.lang.String EXTRA_NETWORK = "android.net.extra.NETWORK";
    field public static final deprecated java.lang.String EXTRA_NETWORK_INFO = "networkInfo";
    field public static final java.lang.String EXTRA_NETWORK_REQUEST = "android.net.extra.NETWORK_REQUEST";
    field public static final java.lang.String EXTRA_NETWORK_TYPE = "networkType";
    field public static final java.lang.String EXTRA_NO_CONNECTIVITY = "noConnectivity";
    field public static final java.lang.String EXTRA_OTHER_NETWORK_INFO = "otherNetwork";
    field public static final java.lang.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 public static final deprecated int TYPE_BLUETOOTH = 7; // 0x7
    field public static final deprecated int TYPE_DUMMY = 8; // 0x8
    field public static final deprecated int TYPE_ETHERNET = 9; // 0x9
    field public static final deprecated int TYPE_MOBILE = 0; // 0x0
    field public static final deprecated int TYPE_MOBILE_DUN = 4; // 0x4
    field public static final deprecated int TYPE_MOBILE_HIPRI = 5; // 0x5
    field public static final deprecated int TYPE_MOBILE_MMS = 2; // 0x2
    field public static final deprecated int TYPE_MOBILE_SUPL = 3; // 0x3
    field public static final deprecated int TYPE_VPN = 17; // 0x11
    field public static final deprecated int TYPE_WIFI = 1; // 0x1
    field public static final deprecated int TYPE_WIMAX = 6; // 0x6
  }

  public static class ConnectivityManager.NetworkCallback {
    ctor public ConnectivityManager.NetworkCallback();
    method public void onAvailable(android.net.Network);
    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 abstract interface ConnectivityManager.OnNetworkActiveListener {
    method public abstract 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 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(java.lang.String, byte[]);
    ctor public IpSecAlgorithm(java.lang.String, byte[], int);
    method public int describeContents();
    method public byte[] getKey();
    method public java.lang.String getName();
    method public int getTruncationLengthBits();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final java.lang.String AUTH_CRYPT_AES_GCM = "rfc4106(gcm(aes))";
    field public static final java.lang.String AUTH_HMAC_MD5 = "hmac(md5)";
    field public static final java.lang.String AUTH_HMAC_SHA1 = "hmac(sha1)";
    field public static final java.lang.String AUTH_HMAC_SHA256 = "hmac(sha256)";
    field public static final java.lang.String AUTH_HMAC_SHA384 = "hmac(sha384)";
    field public static final java.lang.String AUTH_HMAC_SHA512 = "hmac(sha512)";
    field public static final android.os.Parcelable.Creator<android.net.IpSecAlgorithm> CREATOR;
    field public static final java.lang.String CRYPT_AES_CBC = "cbc(aes)";
  }

  public final class IpSecManager {
    method public android.net.IpSecManager.SecurityParameterIndex allocateSecurityParameterIndex(java.net.InetAddress) throws android.net.IpSecManager.ResourceUnavailableException;
    method public android.net.IpSecManager.SecurityParameterIndex allocateSecurityParameterIndex(java.net.InetAddress, int) throws android.net.IpSecManager.ResourceUnavailableException, android.net.IpSecManager.SpiUnavailableException;
    method public void applyTransportModeTransform(java.net.Socket, int, android.net.IpSecTransform) throws java.io.IOException;
    method public void applyTransportModeTransform(java.net.DatagramSocket, int, android.net.IpSecTransform) throws java.io.IOException;
    method public void applyTransportModeTransform(java.io.FileDescriptor, int, android.net.IpSecTransform) throws java.io.IOException;
    method public android.net.IpSecManager.UdpEncapsulationSocket openUdpEncapsulationSocket(int) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException;
    method public android.net.IpSecManager.UdpEncapsulationSocket openUdpEncapsulationSocket() throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException;
    method public void removeTransportModeTransforms(java.net.Socket) throws java.io.IOException;
    method public void removeTransportModeTransforms(java.net.DatagramSocket) throws java.io.IOException;
    method public void removeTransportModeTransforms(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(android.content.Context);
    method public android.net.IpSecTransform buildTransportModeTransform(java.net.InetAddress, android.net.IpSecManager.SecurityParameterIndex) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException, android.net.IpSecManager.SpiUnavailableException;
    method public android.net.IpSecTransform.Builder setAuthenticatedEncryption(android.net.IpSecAlgorithm);
    method public android.net.IpSecTransform.Builder setAuthentication(android.net.IpSecAlgorithm);
    method public android.net.IpSecTransform.Builder setEncryption(android.net.IpSecAlgorithm);
    method public android.net.IpSecTransform.Builder setIpv4Encapsulation(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 java.lang.String getDomains();
    method public android.net.ProxyInfo getHttpProxy();
    method public java.lang.String getInterfaceName();
    method public java.util.List<android.net.LinkAddress> getLinkAddresses();
    method public java.lang.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(java.lang.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 synchronized boolean isBound();
    method public boolean isClosed();
    method public synchronized 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(java.lang.String, android.net.LocalSocketAddress.Namespace);
    ctor public LocalSocketAddress(java.lang.String);
    method public java.lang.String getName();
    method public android.net.LocalSocketAddress.Namespace getNamespace();
  }

  public static final class LocalSocketAddress.Namespace extends java.lang.Enum {
    method public static android.net.LocalSocketAddress.Namespace valueOf(java.lang.String);
    method public static final android.net.LocalSocketAddress.Namespace[] values();
    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 public static android.net.MacAddress fromBytes(byte[]);
    method public static android.net.MacAddress fromString(java.lang.String);
    method public int getAddressType();
    method public boolean isLocallyAssigned();
    method public byte[] toByteArray();
    method public java.lang.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 java.lang.String getBody();
    method public java.lang.String getCc();
    method public java.util.Map<java.lang.String, java.lang.String> getHeaders();
    method public java.lang.String getSubject();
    method public java.lang.String getTo();
    method public static boolean isMailTo(java.lang.String);
    method public static android.net.MailTo parse(java.lang.String) throws android.net.ParseException;
    field public static final java.lang.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(java.lang.String) throws java.net.UnknownHostException;
    method public java.net.InetAddress getByName(java.lang.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 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
  }

  public class NetworkInfo implements android.os.Parcelable {
    method public int describeContents();
    method public android.net.NetworkInfo.DetailedState getDetailedState();
    method public java.lang.String getExtraInfo();
    method public deprecated java.lang.String getReason();
    method public deprecated android.net.NetworkInfo.State getState();
    method public int getSubtype();
    method public java.lang.String getSubtypeName();
    method public deprecated int getType();
    method public deprecated java.lang.String getTypeName();
    method public deprecated boolean isAvailable();
    method public boolean isConnected();
    method public deprecated boolean isConnectedOrConnecting();
    method public deprecated boolean isFailover();
    method public deprecated boolean isRoaming();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.NetworkInfo> CREATOR;
  }

  public static final class NetworkInfo.DetailedState extends java.lang.Enum {
    method public static android.net.NetworkInfo.DetailedState valueOf(java.lang.String);
    method public static final android.net.NetworkInfo.DetailedState[] values();
    enum_constant public static final android.net.NetworkInfo.DetailedState AUTHENTICATING;
    enum_constant public static final android.net.NetworkInfo.DetailedState BLOCKED;
    enum_constant public static final android.net.NetworkInfo.DetailedState CAPTIVE_PORTAL_CHECK;
    enum_constant public static final android.net.NetworkInfo.DetailedState CONNECTED;
    enum_constant public static final android.net.NetworkInfo.DetailedState CONNECTING;
    enum_constant public static final android.net.NetworkInfo.DetailedState DISCONNECTED;
    enum_constant public static final android.net.NetworkInfo.DetailedState DISCONNECTING;
    enum_constant public static final android.net.NetworkInfo.DetailedState FAILED;
    enum_constant public static final android.net.NetworkInfo.DetailedState IDLE;
    enum_constant public static final android.net.NetworkInfo.DetailedState OBTAINING_IPADDR;
    enum_constant public static final android.net.NetworkInfo.DetailedState SCANNING;
    enum_constant public static final android.net.NetworkInfo.DetailedState SUSPENDED;
    enum_constant public static final android.net.NetworkInfo.DetailedState VERIFYING_POOR_LINK;
  }

  public static final class NetworkInfo.State extends java.lang.Enum {
    method public static android.net.NetworkInfo.State valueOf(java.lang.String);
    method public static final android.net.NetworkInfo.State[] values();
    enum_constant public static final android.net.NetworkInfo.State CONNECTED;
    enum_constant public static final android.net.NetworkInfo.State CONNECTING;
    enum_constant public static final android.net.NetworkInfo.State DISCONNECTED;
    enum_constant public static final android.net.NetworkInfo.State DISCONNECTING;
    enum_constant public static final android.net.NetworkInfo.State SUSPENDED;
    enum_constant 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(java.lang.String);
    method public android.net.NetworkRequest.Builder setNetworkSpecifier(android.net.NetworkSpecifier);
  }

  public abstract class NetworkSpecifier {
  }

  public class ParseException extends java.lang.RuntimeException {
    field public java.lang.String response;
  }

  public final class Proxy {
    ctor public Proxy();
    method public static deprecated java.lang.String getDefaultHost();
    method public static deprecated int getDefaultPort();
    method public static deprecated java.lang.String getHost(android.content.Context);
    method public static deprecated int getPort(android.content.Context);
    field public static final deprecated java.lang.String EXTRA_PROXY_INFO = "android.intent.extra.PROXY_INFO";
    field public static final java.lang.String PROXY_CHANGE_ACTION = "android.intent.action.PROXY_CHANGE";
  }

  public class ProxyInfo implements android.os.Parcelable {
    method public static android.net.ProxyInfo buildDirectProxy(java.lang.String, int);
    method public static android.net.ProxyInfo buildDirectProxy(java.lang.String, int, java.util.List<java.lang.String>);
    method public static android.net.ProxyInfo buildPacProxy(android.net.Uri);
    method public int describeContents();
    method public java.lang.String[] getExclusionList();
    method public java.lang.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 java.lang.String getInterface();
    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;
  }

  public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
    ctor public deprecated SSLCertificateSocketFactory(int);
    method public java.net.Socket createSocket(java.net.Socket, java.lang.String, int, boolean) throws java.io.IOException;
    method public java.net.Socket createSocket(java.net.InetAddress, int, java.net.InetAddress, int) throws java.io.IOException;
    method public java.net.Socket createSocket(java.net.InetAddress, int) throws java.io.IOException;
    method public java.net.Socket createSocket(java.lang.String, int, java.net.InetAddress, int) throws java.io.IOException;
    method public java.net.Socket createSocket(java.lang.String, int) throws java.io.IOException;
    method public static javax.net.SocketFactory getDefault(int);
    method public static javax.net.ssl.SSLSocketFactory getDefault(int, android.net.SSLSessionCache);
    method public java.lang.String[] getDefaultCipherSuites();
    method public static javax.net.ssl.SSLSocketFactory getInsecure(int, android.net.SSLSessionCache);
    method public byte[] getNpnSelectedProtocol(java.net.Socket);
    method public java.lang.String[] getSupportedCipherSuites();
    method public void setHostname(java.net.Socket, java.lang.String);
    method public void setKeyManagers(javax.net.ssl.KeyManager[]);
    method public void setNpnProtocols(byte[][]);
    method public void setTrustManagers(javax.net.ssl.TrustManager[]);
    method 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 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 public static deprecated long getUidTcpRxBytes(int);
    method public static deprecated long getUidTcpRxSegments(int);
    method public static deprecated long getUidTcpTxBytes(int);
    method public static deprecated long getUidTcpTxSegments(int);
    method public static long getUidTxBytes(int);
    method public static long getUidTxPackets(int);
    method public static deprecated long getUidUdpRxBytes(int);
    method public static deprecated long getUidUdpRxPackets(int);
    method public static deprecated long getUidUdpTxBytes(int);
    method public static deprecated 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 abstract class Uri implements java.lang.Comparable android.os.Parcelable {
    method public abstract android.net.Uri.Builder buildUpon();
    method public int compareTo(android.net.Uri);
    method public static java.lang.String decode(java.lang.String);
    method public static java.lang.String encode(java.lang.String);
    method public static java.lang.String encode(java.lang.String, java.lang.String);
    method public static android.net.Uri fromFile(java.io.File);
    method public static android.net.Uri fromParts(java.lang.String, java.lang.String, java.lang.String);
    method public abstract java.lang.String getAuthority();
    method public boolean getBooleanQueryParameter(java.lang.String, boolean);
    method public abstract java.lang.String getEncodedAuthority();
    method public abstract java.lang.String getEncodedFragment();
    method public abstract java.lang.String getEncodedPath();
    method public abstract java.lang.String getEncodedQuery();
    method public abstract java.lang.String getEncodedSchemeSpecificPart();
    method public abstract java.lang.String getEncodedUserInfo();
    method public abstract java.lang.String getFragment();
    method public abstract java.lang.String getHost();
    method public abstract java.lang.String getLastPathSegment();
    method public abstract java.lang.String getPath();
    method public abstract java.util.List<java.lang.String> getPathSegments();
    method public abstract int getPort();
    method public abstract java.lang.String getQuery();
    method public java.lang.String getQueryParameter(java.lang.String);
    method public java.util.Set<java.lang.String> getQueryParameterNames();
    method public java.util.List<java.lang.String> getQueryParameters(java.lang.String);
    method public abstract java.lang.String getScheme();
    method public abstract java.lang.String getSchemeSpecificPart();
    method public abstract java.lang.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(java.lang.String);
    method public abstract java.lang.String toString();
    method public static android.net.Uri withAppendedPath(android.net.Uri, java.lang.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(java.lang.String);
    method public android.net.Uri.Builder appendPath(java.lang.String);
    method public android.net.Uri.Builder appendQueryParameter(java.lang.String, java.lang.String);
    method public android.net.Uri.Builder authority(java.lang.String);
    method public android.net.Uri build();
    method public android.net.Uri.Builder clearQuery();
    method public android.net.Uri.Builder encodedAuthority(java.lang.String);
    method public android.net.Uri.Builder encodedFragment(java.lang.String);
    method public android.net.Uri.Builder encodedOpaquePart(java.lang.String);
    method public android.net.Uri.Builder encodedPath(java.lang.String);
    method public android.net.Uri.Builder encodedQuery(java.lang.String);
    method public android.net.Uri.Builder fragment(java.lang.String);
    method public android.net.Uri.Builder opaquePart(java.lang.String);
    method public android.net.Uri.Builder path(java.lang.String);
    method public android.net.Uri.Builder query(java.lang.String);
    method public android.net.Uri.Builder scheme(java.lang.String);
  }

  public class UrlQuerySanitizer {
    ctor public UrlQuerySanitizer();
    ctor public UrlQuerySanitizer(java.lang.String);
    method protected void addSanitizedEntry(java.lang.String, java.lang.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(java.lang.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 java.lang.String getValue(java.lang.String);
    method public android.net.UrlQuerySanitizer.ValueSanitizer getValueSanitizer(java.lang.String);
    method public boolean hasParameter(java.lang.String);
    method protected boolean isHexDigit(char);
    method protected void parseEntry(java.lang.String, java.lang.String);
    method public void parseQuery(java.lang.String);
    method public void parseUrl(java.lang.String);
    method public void registerParameter(java.lang.String, android.net.UrlQuerySanitizer.ValueSanitizer);
    method public void registerParameters(java.lang.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 java.lang.String unescape(java.lang.String);
  }

  public static class UrlQuerySanitizer.IllegalCharacterValueSanitizer implements android.net.UrlQuerySanitizer.ValueSanitizer {
    ctor public UrlQuerySanitizer.IllegalCharacterValueSanitizer(int);
    method public java.lang.String sanitize(java.lang.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(java.lang.String, java.lang.String);
    field public java.lang.String mParameter;
    field public java.lang.String mValue;
  }

  public static abstract interface UrlQuerySanitizer.ValueSanitizer {
    method public abstract java.lang.String sanitize(java.lang.String);
  }

  public class VpnService extends android.app.Service {
    ctor public VpnService();
    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 java.lang.String SERVICE_INTERFACE = "android.net.VpnService";
    field public static final java.lang.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(java.lang.String, int);
    method public android.net.VpnService.Builder addAllowedApplication(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.net.VpnService.Builder addDisallowedApplication(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.net.VpnService.Builder addDnsServer(java.net.InetAddress);
    method public android.net.VpnService.Builder addDnsServer(java.lang.String);
    method public android.net.VpnService.Builder addRoute(java.net.InetAddress, int);
    method public android.net.VpnService.Builder addRoute(java.lang.String, int);
    method public android.net.VpnService.Builder addSearchDomain(java.lang.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 setMtu(int);
    method public android.net.VpnService.Builder setSession(java.lang.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, java.lang.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 synchronized 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 public deprecated SslCertificate(java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    ctor public deprecated SslCertificate(java.lang.String, java.lang.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 public deprecated java.lang.String getValidNotAfter();
    method public java.util.Date getValidNotAfterDate();
    method public deprecated java.lang.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(java.lang.String);
    method public java.lang.String getCName();
    method public java.lang.String getDName();
    method public java.lang.String getOName();
    method public java.lang.String getUName();
  }

  public class SslError {
    ctor public deprecated SslError(int, android.net.http.SslCertificate);
    ctor public deprecated SslError(int, java.security.cert.X509Certificate);
    ctor public SslError(int, android.net.http.SslCertificate, java.lang.String);
    ctor public SslError(int, java.security.cert.X509Certificate, java.lang.String);
    method public boolean addError(int);
    method public android.net.http.SslCertificate getCertificate();
    method public int getPrimaryError();
    method public java.lang.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 public static final deprecated 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[], java.lang.String, java.lang.String) throws java.security.cert.CertificateException;
    method public boolean isSameTrustConfiguration(java.lang.String, java.lang.String);
    method public boolean isUserAddedCertificate(java.security.cert.X509Certificate);
  }

}

package android.net.nsd {

  public final class NsdManager {
    method public void discoverServices(java.lang.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 java.lang.String ACTION_NSD_STATE_CHANGED = "android.net.nsd.STATE_CHANGED";
    field public static final java.lang.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 abstract interface NsdManager.DiscoveryListener {
    method public abstract void onDiscoveryStarted(java.lang.String);
    method public abstract void onDiscoveryStopped(java.lang.String);
    method public abstract void onServiceFound(android.net.nsd.NsdServiceInfo);
    method public abstract void onServiceLost(android.net.nsd.NsdServiceInfo);
    method public abstract void onStartDiscoveryFailed(java.lang.String, int);
    method public abstract void onStopDiscoveryFailed(java.lang.String, int);
  }

  public static abstract interface NsdManager.RegistrationListener {
    method public abstract void onRegistrationFailed(android.net.nsd.NsdServiceInfo, int);
    method public abstract void onServiceRegistered(android.net.nsd.NsdServiceInfo);
    method public abstract void onServiceUnregistered(android.net.nsd.NsdServiceInfo);
    method public abstract void onUnregistrationFailed(android.net.nsd.NsdServiceInfo, int);
  }

  public static abstract interface NsdManager.ResolveListener {
    method public abstract void onResolveFailed(android.net.nsd.NsdServiceInfo, int);
    method public abstract 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 java.lang.String getServiceName();
    method public java.lang.String getServiceType();
    method public void removeAttribute(java.lang.String);
    method public void setAttribute(java.lang.String, java.lang.String);
    method public void setHost(java.net.InetAddress);
    method public void setPort(int);
    method public void setServiceName(java.lang.String);
    method public void setServiceType(java.lang.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, java.lang.String, java.lang.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 java.lang.String fmtp;
    field public final java.lang.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, java.lang.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, java.lang.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 java.lang.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(java.lang.String);
    ctor public SipException(java.lang.String, java.lang.Throwable);
  }

  public class SipManager {
    method public void close(java.lang.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 java.lang.String getCallId(android.content.Intent);
    method public static java.lang.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(java.lang.String) throws android.net.sip.SipException;
    method public boolean isRegistered(java.lang.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(java.lang.String, java.lang.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(java.lang.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 java.lang.String EXTRA_CALL_ID = "android:sipCallID";
    field public static final java.lang.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 java.lang.String getAuthUserName();
    method public boolean getAutoRegistration();
    method public java.lang.String getDisplayName();
    method public java.lang.String getPassword();
    method public int getPort();
    method public java.lang.String getProfileName();
    method public java.lang.String getProtocol();
    method public java.lang.String getProxyAddress();
    method public boolean getSendKeepAlive();
    method public java.lang.String getSipDomain();
    method public java.lang.String getUriString();
    method public java.lang.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(java.lang.String) throws java.text.ParseException;
    ctor public SipProfile.Builder(java.lang.String, java.lang.String) throws java.text.ParseException;
    method public android.net.sip.SipProfile build();
    method public android.net.sip.SipProfile.Builder setAuthUserName(java.lang.String);
    method public android.net.sip.SipProfile.Builder setAutoRegistration(boolean);
    method public android.net.sip.SipProfile.Builder setDisplayName(java.lang.String);
    method public android.net.sip.SipProfile.Builder setOutboundProxy(java.lang.String);
    method public android.net.sip.SipProfile.Builder setPassword(java.lang.String);
    method public android.net.sip.SipProfile.Builder setPort(int) throws java.lang.IllegalArgumentException;
    method public android.net.sip.SipProfile.Builder setProfileName(java.lang.String);
    method public android.net.sip.SipProfile.Builder setProtocol(java.lang.String) throws java.lang.IllegalArgumentException;
    method public android.net.sip.SipProfile.Builder setSendKeepAlive(boolean);
  }

  public abstract interface SipRegistrationListener {
    method public abstract void onRegistering(java.lang.String);
    method public abstract void onRegistrationDone(java.lang.String, long);
    method public abstract void onRegistrationFailed(java.lang.String, int, java.lang.String);
  }

  public final class SipSession {
    method public void answerCall(java.lang.String, int);
    method public void changeCall(java.lang.String, int);
    method public void endCall();
    method public java.lang.String getCallId();
    method public java.lang.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, java.lang.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, java.lang.String);
    method public void onCallEnded(android.net.sip.SipSession);
    method public void onCallEstablished(android.net.sip.SipSession, java.lang.String);
    method public void onCalling(android.net.sip.SipSession);
    method public void onError(android.net.sip.SipSession, int, java.lang.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, java.lang.String);
    method public void onRegistrationTimeout(android.net.sip.SipSession);
    method public void onRinging(android.net.sip.SipSession, android.net.sip.SipProfile, java.lang.String);
    method public void onRingingBack(android.net.sip.SipSession);
  }

  public static class SipSession.State {
    method public static java.lang.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.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 java.lang.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 java.lang.String SSID;
    field public java.lang.String capabilities;
    field public int centerFreq0;
    field public int centerFreq1;
    field public int channelWidth;
    field public int frequency;
    field public int level;
    field public java.lang.CharSequence operatorFriendlyName;
    field public long timestamp;
    field public java.lang.CharSequence venueName;
  }

  public final class SupplicantState extends java.lang.Enum implements android.os.Parcelable {
    method public int describeContents();
    method public static boolean isValidState(android.net.wifi.SupplicantState);
    method public static android.net.wifi.SupplicantState valueOf(java.lang.String);
    method public static final android.net.wifi.SupplicantState[] values();
    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 java.lang.String BSSID;
    field public java.lang.String FQDN;
    field public java.lang.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 java.lang.String preSharedKey;
    field public deprecated int priority;
    field public java.lang.String providerFriendlyName;
    field public long[] roamingConsortiumIds;
    field public int status;
    field public deprecated java.lang.String[] wepKeys;
    field public deprecated int wepTxKeyIndex;
  }

  public static class WifiConfiguration.AuthAlgorithm {
    field public static final int LEAP = 2; // 0x2
    field public static final int OPEN = 0; // 0x0
    field public static final deprecated int SHARED = 1; // 0x1
    field public static final java.lang.String[] strings;
    field public static final java.lang.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 public static final deprecated int WEP104 = 1; // 0x1
    field public static final deprecated int WEP40 = 0; // 0x0
    field public static final java.lang.String[] strings;
    field public static final java.lang.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 java.lang.String[] strings;
    field public static final java.lang.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 public static final deprecated int TKIP = 1; // 0x1
    field public static final java.lang.String[] strings;
    field public static final java.lang.String varName = "pairwise";
  }

  public static class WifiConfiguration.Protocol {
    field public static final int RSN = 1; // 0x1
    field public static final deprecated int WPA = 0; // 0x0
    field public static final java.lang.String[] strings;
    field public static final java.lang.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 java.lang.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 java.lang.String getAltSubjectMatch();
    method public java.lang.String getAnonymousIdentity();
    method public java.security.cert.X509Certificate getCaCertificate();
    method public java.security.cert.X509Certificate[] getCaCertificates();
    method public java.security.cert.X509Certificate getClientCertificate();
    method public java.security.cert.X509Certificate[] getClientCertificateChain();
    method public java.lang.String getDomainSuffixMatch();
    method public int getEapMethod();
    method public java.lang.String getIdentity();
    method public java.lang.String getPassword();
    method public int getPhase2Method();
    method public java.lang.String getPlmn();
    method public java.lang.String getRealm();
    method public deprecated java.lang.String getSubjectMatch();
    method public void setAltSubjectMatch(java.lang.String);
    method public void setAnonymousIdentity(java.lang.String);
    method public void setCaCertificate(java.security.cert.X509Certificate);
    method public void setCaCertificates(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(java.lang.String);
    method public void setEapMethod(int);
    method public void setIdentity(java.lang.String);
    method public void setPassword(java.lang.String);
    method public void setPhase2Method(int);
    method public void setPlmn(java.lang.String);
    method public void setRealm(java.lang.String);
    method public deprecated void setSubjectMatch(java.lang.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 java.lang.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 java.lang.String getMacAddress();
    method public int getNetworkId();
    method public int getRssi();
    method public java.lang.String getSSID();
    method public android.net.wifi.SupplicantState getSupplicantState();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final java.lang.String FREQUENCY_UNITS = "MHz";
    field public static final java.lang.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 public deprecated void cancelWps(android.net.wifi.WifiManager.WpsCallback);
    method public static int compareSignalLevel(int, int);
    method public android.net.wifi.WifiManager.MulticastLock createMulticastLock(java.lang.String);
    method public android.net.wifi.WifiManager.WifiLock createWifiLock(int, java.lang.String);
    method public android.net.wifi.WifiManager.WifiLock createWifiLock(java.lang.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 public deprecated boolean pingSupplicant();
    method public boolean reassociate();
    method public boolean reconnect();
    method public boolean removeNetwork(int);
    method public void removePasspointConfiguration(java.lang.String);
    method public deprecated boolean saveConfiguration();
    method public void setTdlsEnabled(java.net.InetAddress, boolean);
    method public void setTdlsEnabledWithMacAddress(java.lang.String, boolean);
    method public boolean setWifiEnabled(boolean);
    method public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, android.os.Handler);
    method public deprecated boolean startScan();
    method public deprecated void startWps(android.net.wifi.WpsInfo, android.net.wifi.WifiManager.WpsCallback);
    method public int updateNetwork(android.net.wifi.WifiConfiguration);
    field public static final java.lang.String ACTION_PICK_WIFI_NETWORK = "android.net.wifi.PICK_WIFI_NETWORK";
    field public static final java.lang.String ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE = "android.net.wifi.action.REQUEST_SCAN_ALWAYS_AVAILABLE";
    field public static final deprecated int ERROR_AUTHENTICATING = 1; // 0x1
    field public static final deprecated java.lang.String EXTRA_BSSID = "bssid";
    field public static final java.lang.String EXTRA_NETWORK_INFO = "networkInfo";
    field public static final java.lang.String EXTRA_NEW_RSSI = "newRssi";
    field public static final deprecated java.lang.String EXTRA_NEW_STATE = "newState";
    field public static final java.lang.String EXTRA_PREVIOUS_WIFI_STATE = "previous_wifi_state";
    field public static final java.lang.String EXTRA_RESULTS_UPDATED = "resultsUpdated";
    field public static final deprecated java.lang.String EXTRA_SUPPLICANT_CONNECTED = "connected";
    field public static final deprecated java.lang.String EXTRA_SUPPLICANT_ERROR = "supplicantError";
    field public static final deprecated java.lang.String EXTRA_WIFI_INFO = "wifiInfo";
    field public static final java.lang.String EXTRA_WIFI_STATE = "wifi_state";
    field public static final java.lang.String NETWORK_IDS_CHANGED_ACTION = "android.net.wifi.NETWORK_IDS_CHANGED";
    field public static final java.lang.String NETWORK_STATE_CHANGED_ACTION = "android.net.wifi.STATE_CHANGE";
    field public static final java.lang.String RSSI_CHANGED_ACTION = "android.net.wifi.RSSI_CHANGED";
    field public static final java.lang.String SCAN_RESULTS_AVAILABLE_ACTION = "android.net.wifi.SCAN_RESULTS";
    field public static final deprecated java.lang.String SUPPLICANT_CONNECTION_CHANGE_ACTION = "android.net.wifi.supplicant.CONNECTION_CHANGE";
    field public static final deprecated java.lang.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 java.lang.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 public static final deprecated int WPS_AUTH_FAILURE = 6; // 0x6
    field public static final deprecated int WPS_OVERLAP_ERROR = 3; // 0x3
    field public static final deprecated int WPS_TIMED_OUT = 7; // 0x7
    field public static final deprecated int WPS_TKIP_ONLY_PROHIBITED = 5; // 0x5
    field public static final deprecated 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);
  }

  public static abstract deprecated class WifiManager.WpsCallback {
    ctor public WifiManager.WpsCallback();
    method public abstract deprecated void onFailed(int);
    method public abstract deprecated void onStarted(java.lang.String);
    method public abstract deprecated void onSucceeded();
  }

  public deprecated class WpsInfo implements android.os.Parcelable {
    ctor public deprecated WpsInfo();
    ctor public deprecated WpsInfo(android.net.wifi.WpsInfo);
    method public deprecated int describeContents();
    method public deprecated java.lang.String toString();
    method public deprecated void writeToParcel(android.os.Parcel, int);
    field public deprecated java.lang.String BSSID;
    field public static final deprecated android.os.Parcelable.Creator<android.net.wifi.WpsInfo> CREATOR;
    field public static final deprecated int DISPLAY = 1; // 0x1
    field public static final deprecated int INVALID = 4; // 0x4
    field public static final deprecated int KEYPAD = 2; // 0x2
    field public static final deprecated int LABEL = 3; // 0x3
    field public static final deprecated int PBC = 0; // 0x0
    field public deprecated java.lang.String pin;
    field public deprecated 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(android.net.wifi.aware.PeerHandle);
    method public android.net.NetworkSpecifier createNetworkSpecifierPassphrase(android.net.wifi.aware.PeerHandle, java.lang.String);
    method public void sendMessage(android.net.wifi.aware.PeerHandle, int, 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(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(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(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(java.lang.String);
    method public android.net.wifi.aware.PublishConfig.Builder setServiceSpecificInfo(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(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(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(java.lang.String);
    method public android.net.wifi.aware.SubscribeConfig.Builder setServiceSpecificInfo(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(android.net.wifi.aware.SubscribeConfig);
  }

  public class WifiAwareManager {
    method public void attach(android.net.wifi.aware.AttachCallback, android.os.Handler);
    method public void attach(android.net.wifi.aware.AttachCallback, android.net.wifi.aware.IdentityChangedListener, android.os.Handler);
    method public android.net.wifi.aware.Characteristics getCharacteristics();
    method public boolean isAvailable();
    field public static final java.lang.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, byte[]);
    method public android.net.NetworkSpecifier createNetworkSpecifierPassphrase(int, byte[], java.lang.String);
    method public void publish(android.net.wifi.aware.PublishConfig, android.net.wifi.aware.DiscoverySessionCallback, android.os.Handler);
    method public void subscribe(android.net.wifi.aware.SubscribeConfig, android.net.wifi.aware.DiscoverySessionCallback, android.os.Handler);
  }

}

package android.net.wifi.hotspot2 {

  public final class ConfigParser {
    method public static android.net.wifi.hotspot2.PasspointConfiguration parsePasspointConfig(java.lang.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(java.lang.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 java.lang.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(java.lang.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 java.lang.String getCertType();
    method public void setCertSha256Fingerprint(byte[]);
    method public void setCertType(java.lang.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 java.lang.String getImsi();
    method public void setEapType(int);
    method public void setImsi(java.lang.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 java.lang.String getNonEapInnerMethod();
    method public java.lang.String getPassword();
    method public java.lang.String getUsername();
    method public void setEapType(int);
    method public void setNonEapInnerMethod(java.lang.String);
    method public void setPassword(java.lang.String);
    method public void setUsername(java.lang.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 java.lang.String getFqdn();
    method public java.lang.String getFriendlyName();
    method public long[] getRoamingConsortiumOis();
    method public void setFqdn(java.lang.String);
    method public void setFriendlyName(java.lang.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 java.lang.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 java.lang.String deviceAddress;
    field public java.lang.String deviceName;
    field public java.lang.String primaryDeviceType;
    field public java.lang.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(java.lang.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 java.lang.String getInterface();
    method public java.lang.String getNetworkName();
    method public android.net.wifi.p2p.WifiP2pDevice getOwner();
    method public java.lang.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 java.lang.String EXTRA_DISCOVERY_STATE = "discoveryState";
    field public static final java.lang.String EXTRA_NETWORK_INFO = "networkInfo";
    field public static final java.lang.String EXTRA_P2P_DEVICE_LIST = "wifiP2pDeviceList";
    field public static final java.lang.String EXTRA_WIFI_P2P_DEVICE = "wifiP2pDevice";
    field public static final java.lang.String EXTRA_WIFI_P2P_GROUP = "p2pGroupInfo";
    field public static final java.lang.String EXTRA_WIFI_P2P_INFO = "wifiP2pInfo";
    field public static final java.lang.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 java.lang.String WIFI_P2P_CONNECTION_CHANGED_ACTION = "android.net.wifi.p2p.CONNECTION_STATE_CHANGE";
    field public static final java.lang.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 java.lang.String WIFI_P2P_PEERS_CHANGED_ACTION = "android.net.wifi.p2p.PEERS_CHANGED";
    field public static final java.lang.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 java.lang.String WIFI_P2P_THIS_DEVICE_CHANGED_ACTION = "android.net.wifi.p2p.THIS_DEVICE_CHANGED";
  }

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

  public static class WifiP2pManager.Channel implements java.lang.AutoCloseable {
    method public void close();
  }

  public static abstract interface WifiP2pManager.ChannelListener {
    method public abstract void onChannelDisconnected();
  }

  public static abstract interface WifiP2pManager.ConnectionInfoListener {
    method public abstract void onConnectionInfoAvailable(android.net.wifi.p2p.WifiP2pInfo);
  }

  public static abstract interface WifiP2pManager.DnsSdServiceResponseListener {
    method public abstract void onDnsSdServiceAvailable(java.lang.String, java.lang.String, android.net.wifi.p2p.WifiP2pDevice);
  }

  public static abstract interface WifiP2pManager.DnsSdTxtRecordListener {
    method public abstract void onDnsSdTxtRecordAvailable(java.lang.String, java.util.Map<java.lang.String, java.lang.String>, android.net.wifi.p2p.WifiP2pDevice);
  }

  public static abstract interface WifiP2pManager.GroupInfoListener {
    method public abstract void onGroupInfoAvailable(android.net.wifi.p2p.WifiP2pGroup);
  }

  public static abstract interface WifiP2pManager.PeerListListener {
    method public abstract void onPeersAvailable(android.net.wifi.p2p.WifiP2pDeviceList);
  }

  public static abstract interface WifiP2pManager.ServiceResponseListener {
    method public abstract void onServiceAvailable(int, byte[], android.net.wifi.p2p.WifiP2pDevice);
  }

  public static abstract interface WifiP2pManager.UpnpServiceResponseListener {
    method public abstract 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(java.lang.String, java.lang.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(java.lang.String);
    method public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest newInstance(java.lang.String, java.lang.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, java.lang.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(java.lang.String, java.lang.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(java.lang.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(android.net.wifi.ScanResult);
    method public android.net.wifi.rtt.RangingRequest.Builder addAccessPoints(java.util.List<android.net.wifi.ScanResult>);
    method public android.net.wifi.rtt.RangingRequest.Builder addWifiAwarePeer(android.net.MacAddress);
    method public android.net.wifi.rtt.RangingRequest.Builder addWifiAwarePeer(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 public android.net.MacAddress getMacAddress();
    method public int getNumAttemptedMeasurements();
    method public int getNumSuccessfulMeasurements();
    method 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(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 public void startRanging(android.net.wifi.rtt.RangingRequest, java.util.concurrent.Executor, android.net.wifi.rtt.RangingResultCallback);
    field public static final java.lang.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(java.lang.String);
    ctor public FormatException(java.lang.String, java.lang.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 public deprecated NdefRecord(byte[]) throws android.nfc.FormatException;
    method public static android.nfc.NdefRecord createApplicationRecord(java.lang.String);
    method public static android.nfc.NdefRecord createExternal(java.lang.String, java.lang.String, byte[]);
    method public static android.nfc.NdefRecord createMime(java.lang.String, byte[]);
    method public static android.nfc.NdefRecord createTextRecord(java.lang.String, java.lang.String);
    method public static android.nfc.NdefRecord createUri(android.net.Uri);
    method public static android.nfc.NdefRecord createUri(java.lang.String);
    method public int describeContents();
    method public byte[] getId();
    method public byte[] getPayload();
    method public short getTnf();
    method public byte[] getType();
    method public deprecated byte[] toByteArray();
    method public java.lang.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 void disableForegroundDispatch(android.app.Activity);
    method public deprecated 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[], java.lang.String[][]);
    method public deprecated 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 public boolean ignore(android.nfc.Tag, int, android.nfc.NfcAdapter.OnTagRemovedListener, android.os.Handler);
    method public boolean invokeBeam(android.app.Activity);
    method public boolean isEnabled();
    method public boolean isNdefPushEnabled();
    method public void setBeamPushUris(android.net.Uri[], android.app.Activity);
    method public void setBeamPushUrisCallback(android.nfc.NfcAdapter.CreateBeamUrisCallback, android.app.Activity);
    method public void setNdefPushMessage(android.nfc.NdefMessage, android.app.Activity, android.app.Activity...);
    method public void setNdefPushMessageCallback(android.nfc.NfcAdapter.CreateNdefMessageCallback, android.app.Activity, android.app.Activity...);
    method public void setOnNdefPushCompleteCallback(android.nfc.NfcAdapter.OnNdefPushCompleteCallback, android.app.Activity, android.app.Activity...);
    field public static final java.lang.String ACTION_ADAPTER_STATE_CHANGED = "android.nfc.action.ADAPTER_STATE_CHANGED";
    field public static final java.lang.String ACTION_NDEF_DISCOVERED = "android.nfc.action.NDEF_DISCOVERED";
    field public static final java.lang.String ACTION_TAG_DISCOVERED = "android.nfc.action.TAG_DISCOVERED";
    field public static final java.lang.String ACTION_TECH_DISCOVERED = "android.nfc.action.TECH_DISCOVERED";
    field public static final java.lang.String ACTION_TRANSACTION_DETECTED = "android.nfc.action.TRANSACTION_DETECTED";
    field public static final java.lang.String EXTRA_ADAPTER_STATE = "android.nfc.extra.ADAPTER_STATE";
    field public static final java.lang.String EXTRA_AID = "android.nfc.extra.AID";
    field public static final java.lang.String EXTRA_DATA = "android.nfc.extra.DATA";
    field public static final java.lang.String EXTRA_ID = "android.nfc.extra.ID";
    field public static final java.lang.String EXTRA_NDEF_MESSAGES = "android.nfc.extra.NDEF_MESSAGES";
    field public static final java.lang.String EXTRA_READER_PRESENCE_CHECK_DELAY = "presence";
    field public static final java.lang.String EXTRA_SECURE_ELEMENT_NAME = "android.nfc.extra.SECURE_ELEMENT_NAME";
    field public static final java.lang.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
  }

  public static abstract interface NfcAdapter.CreateBeamUrisCallback {
    method public abstract android.net.Uri[] createBeamUris(android.nfc.NfcEvent);
  }

  public static abstract interface NfcAdapter.CreateNdefMessageCallback {
    method public abstract android.nfc.NdefMessage createNdefMessage(android.nfc.NfcEvent);
  }

  public static abstract interface NfcAdapter.OnNdefPushCompleteCallback {
    method public abstract void onNdefPushComplete(android.nfc.NfcEvent);
  }

  public static abstract interface NfcAdapter.OnTagRemovedListener {
    method public abstract void onTagRemoved();
  }

  public static abstract interface NfcAdapter.ReaderCallback {
    method public abstract 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 java.lang.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(java.lang.String);
  }

}

package android.nfc.cardemulation {

  public final class CardEmulation {
    method public boolean categoryAllowsForegroundPreference(java.lang.String);
    method public java.util.List<java.lang.String> getAidsForService(android.content.ComponentName, java.lang.String);
    method public static synchronized android.nfc.cardemulation.CardEmulation getInstance(android.nfc.NfcAdapter);
    method public int getSelectionModeForCategory(java.lang.String);
    method public boolean isDefaultServiceForAid(android.content.ComponentName, java.lang.String);
    method public boolean isDefaultServiceForCategory(android.content.ComponentName, java.lang.String);
    method public boolean registerAidsForService(android.content.ComponentName, java.lang.String, java.util.List<java.lang.String>);
    method public boolean removeAidsForService(android.content.ComponentName, java.lang.String);
    method public boolean setPreferredService(android.app.Activity, android.content.ComponentName);
    method public boolean supportsAidPrefixRegistration();
    method public boolean unsetPreferredService(android.app.Activity);
    field public static final java.lang.String ACTION_CHANGE_DEFAULT = "android.nfc.cardemulation.action.ACTION_CHANGE_DEFAULT";
    field public static final java.lang.String CATEGORY_OTHER = "other";
    field public static final java.lang.String CATEGORY_PAYMENT = "payment";
    field public static final java.lang.String EXTRA_CATEGORY = "category";
    field public static final java.lang.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 java.lang.String SERVICE_INTERFACE = "android.nfc.cardemulation.action.HOST_APDU_SERVICE";
    field public static final java.lang.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 java.lang.String SERVICE_INTERFACE = "android.nfc.cardemulation.action.HOST_NFCF_SERVICE";
    field public static final java.lang.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 synchronized android.nfc.cardemulation.NfcFCardEmulation getInstance(android.nfc.NfcAdapter);
    method public java.lang.String getNfcid2ForService(android.content.ComponentName) throws java.lang.RuntimeException;
    method public java.lang.String getSystemCodeForService(android.content.ComponentName) throws java.lang.RuntimeException;
    method public boolean registerSystemCodeForService(android.content.ComponentName, java.lang.String) throws java.lang.RuntimeException;
    method public boolean setNfcid2ForService(android.content.ComponentName, java.lang.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 java.lang.String SERVICE_INTERFACE = "android.nfc.cardemulation.action.OFF_HOST_APDU_SERVICE";
    field public static final java.lang.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 static android.nfc.tech.IsoDep get(android.nfc.Tag);
    method public byte[] getHiLayerResponse();
    method public byte[] getHistoricalBytes();
    method public int getMaxTransceiveLength();
    method public int getTimeout();
    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 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 int getTimeout();
    method public int getType();
    method public void increment(int, int) throws java.io.IOException;
    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 static android.nfc.tech.MifareUltralight get(android.nfc.Tag);
    method public int getMaxTransceiveLength();
    method public int getTimeout();
    method public int getType();
    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 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 java.lang.String getType();
    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 java.lang.String MIFARE_CLASSIC = "com.nxp.ndef.mifareclassic";
    field public static final java.lang.String NFC_FORUM_TYPE_1 = "org.nfcforum.ndef.type1";
    field public static final java.lang.String NFC_FORUM_TYPE_2 = "org.nfcforum.ndef.type2";
    field public static final java.lang.String NFC_FORUM_TYPE_3 = "org.nfcforum.ndef.type3";
    field public static final java.lang.String NFC_FORUM_TYPE_4 = "org.nfcforum.ndef.type4";
  }

  public final class NdefFormatable implements android.nfc.tech.TagTechnology {
    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);
  }

  public final class NfcA implements android.nfc.tech.TagTechnology {
    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 int getTimeout();
    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 static android.nfc.tech.NfcB get(android.nfc.Tag);
    method public byte[] getApplicationData();
    method public int getMaxTransceiveLength();
    method public byte[] getProtocolInfo();
    method public byte[] transceive(byte[]) throws java.io.IOException;
  }

  public final class NfcBarcode implements android.nfc.tech.TagTechnology {
    method public static android.nfc.tech.NfcBarcode get(android.nfc.Tag);
    method public byte[] getBarcode();
    method public int getType();
    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 static android.nfc.tech.NfcF get(android.nfc.Tag);
    method public byte[] getManufacturer();
    method public int getMaxTransceiveLength();
    method public byte[] getSystemCode();
    method public int getTimeout();
    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 static android.nfc.tech.NfcV get(android.nfc.Tag);
    method public byte getDsfId();
    method public int getMaxTransceiveLength();
    method public byte getResponseFlags();
    method public byte[] transceive(byte[]) throws java.io.IOException;
  }

  public abstract interface TagTechnology implements java.io.Closeable {
    method public abstract void connect() throws java.io.IOException;
    method public abstract android.nfc.Tag getTag();
    method public abstract 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 public static deprecated 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, java.lang.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 java.lang.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 protected deprecated EGLObjectHandle(int);
    ctor protected EGLObjectHandle(long);
    method public deprecated 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 java.lang.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, java.lang.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 java.lang.String glGetActiveAttrib(int, int, int[], int, int[], int);
    method public static java.lang.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 java.lang.String glGetActiveUniform(int, int, int[], int, int[], int);
    method public static java.lang.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, java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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, java.lang.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, java.lang.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 public static final deprecated 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 java.lang.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, java.lang.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 java.lang.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 public static deprecated 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 java.lang.String glGetTransformFeedbackVarying(int, int, int[], int, int[], int);
    method public static java.lang.String glGetTransformFeedbackVarying(int, int, java.nio.IntBuffer, java.nio.IntBuffer);
    method public static int glGetUniformBlockIndex(int, java.lang.String);
    method public static void glGetUniformIndices(int, java.lang.String[], int[], int);
    method public static void glGetUniformIndices(int, java.lang.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, java.lang.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, java.lang.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 java.lang.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, java.lang.String);
    method public static int glGetProgramResourceLocation(int, int, java.lang.String);
    method public static java.lang.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, java.lang.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 java.lang.String[] glGetDebugMessageLogKHR(int, int[], int, int[], int, int[], int, int[], int);
    method public static java.lang.String[] glGetDebugMessageLogKHR(int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer);
    method public static java.lang.String glGetObjectLabelKHR(int, int);
    method public static java.lang.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, java.lang.String);
    method public static void glObjectPtrLabelKHR(long, java.lang.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, java.lang.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 abstract interface GLES31Ext.DebugProcKHR {
    method public abstract void onMessage(int, int, int, int, java.lang.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, java.lang.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 java.lang.String[] glGetDebugMessageLog(int, int[], int, int[], int, int[], int, int[], int);
    method public static java.lang.String[] glGetDebugMessageLog(int, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer, java.nio.IntBuffer);
    method public static int glGetGraphicsResetStatus();
    method public static java.lang.String glGetObjectLabel(int, int);
    method public static java.lang.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, java.lang.String);
    method public static void glObjectPtrLabel(long, java.lang.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, java.lang.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 abstract interface GLES32.DebugProc {
    method public abstract void onMessage(int, int, int, int, java.lang.String);
  }

  public class GLException extends java.lang.RuntimeException {
    ctor public GLException(int);
    ctor public GLException(int, java.lang.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(java.lang.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 public deprecated 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 abstract interface GLSurfaceView.EGLConfigChooser {
    method public abstract javax.microedition.khronos.egl.EGLConfig chooseConfig(javax.microedition.khronos.egl.EGL10, javax.microedition.khronos.egl.EGLDisplay);
  }

  public static abstract interface GLSurfaceView.EGLContextFactory {
    method public abstract javax.microedition.khronos.egl.EGLContext createContext(javax.microedition.khronos.egl.EGL10, javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig);
    method public abstract void destroyContext(javax.microedition.khronos.egl.EGL10, javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLContext);
  }

  public static abstract interface GLSurfaceView.EGLWindowSurfaceFactory {
    method public abstract javax.microedition.khronos.egl.EGLSurface createWindowSurface(javax.microedition.khronos.egl.EGL10, javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig, java.lang.Object);
    method public abstract void destroySurface(javax.microedition.khronos.egl.EGL10, javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLSurface);
  }

  public static abstract interface GLSurfaceView.GLWrapper {
    method public abstract javax.microedition.khronos.opengles.GL wrap(javax.microedition.khronos.opengles.GL);
  }

  public static abstract interface GLSurfaceView.Renderer {
    method public abstract void onDrawFrame(javax.microedition.khronos.opengles.GL10);
    method public abstract void onSurfaceChanged(javax.microedition.khronos.opengles.GL10, int, int);
    method public abstract void onSurfaceCreated(javax.microedition.khronos.opengles.GL10, javax.microedition.khronos.egl.EGLConfig);
  }

  public class GLU {
    ctor public GLU();
    method public static java.lang.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 java.lang.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 public deprecated 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 protected abstract Result doInBackground(Params...);
    method public final android.os.AsyncTask<Params, Progress, Result> execute(Params...);
    method public static void execute(java.lang.Runnable);
    method 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 protected void onCancelled(Result);
    method protected void onCancelled();
    method protected void onPostExecute(Result);
    method protected void onPreExecute();
    method protected void onProgressUpdate(Progress...);
    method 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 static final class AsyncTask.Status extends java.lang.Enum {
    method public static android.os.AsyncTask.Status valueOf(java.lang.String);
    method public static final android.os.AsyncTask.Status[] values();
    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(java.lang.String);
    ctor public BadParcelableException(java.lang.Exception);
  }

  public class BaseBundle {
    method public void clear();
    method public boolean containsKey(java.lang.String);
    method public java.lang.Object get(java.lang.String);
    method public boolean getBoolean(java.lang.String);
    method public boolean getBoolean(java.lang.String, boolean);
    method public boolean[] getBooleanArray(java.lang.String);
    method public double getDouble(java.lang.String);
    method public double getDouble(java.lang.String, double);
    method public double[] getDoubleArray(java.lang.String);
    method public int getInt(java.lang.String);
    method public int getInt(java.lang.String, int);
    method public int[] getIntArray(java.lang.String);
    method public long getLong(java.lang.String);
    method public long getLong(java.lang.String, long);
    method public long[] getLongArray(java.lang.String);
    method public java.lang.String getString(java.lang.String);
    method public java.lang.String getString(java.lang.String, java.lang.String);
    method public java.lang.String[] getStringArray(java.lang.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(java.lang.String, boolean);
    method public void putBooleanArray(java.lang.String, boolean[]);
    method public void putDouble(java.lang.String, double);
    method public void putDoubleArray(java.lang.String, double[]);
    method public void putInt(java.lang.String, int);
    method public void putIntArray(java.lang.String, int[]);
    method public void putLong(java.lang.String, long);
    method public void putLongArray(java.lang.String, long[]);
    method public void putString(java.lang.String, java.lang.String);
    method public void putStringArray(java.lang.String, java.lang.String[]);
    method public void remove(java.lang.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 java.lang.String ACTION_CHARGING = "android.os.action.CHARGING";
    field public static final java.lang.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 java.lang.String EXTRA_BATTERY_LOW = "battery_low";
    field public static final java.lang.String EXTRA_HEALTH = "health";
    field public static final java.lang.String EXTRA_ICON_SMALL = "icon-small";
    field public static final java.lang.String EXTRA_LEVEL = "level";
    field public static final java.lang.String EXTRA_PLUGGED = "plugged";
    field public static final java.lang.String EXTRA_PRESENT = "present";
    field public static final java.lang.String EXTRA_SCALE = "scale";
    field public static final java.lang.String EXTRA_STATUS = "status";
    field public static final java.lang.String EXTRA_TECHNOLOGY = "technology";
    field public static final java.lang.String EXTRA_TEMPERATURE = "temperature";
    field public static final java.lang.String EXTRA_VOLTAGE = "voltage";
  }

  public class Binder implements android.os.IBinder {
    ctor public Binder();
    method public void attachInterface(android.os.IInterface, java.lang.String);
    method public static final long clearCallingIdentity();
    method public void dump(java.io.FileDescriptor, java.lang.String[]);
    method protected void dump(java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
    method public void dumpAsync(java.io.FileDescriptor, java.lang.String[]);
    method public static final void flushPendingCommands();
    method public static final int getCallingPid();
    method public static final int getCallingUid();
    method public static final android.os.UserHandle getCallingUserHandle();
    method public java.lang.String getInterfaceDescriptor();
    method public boolean isBinderAlive();
    method public static final void joinThreadPool();
    method public void linkToDeath(android.os.IBinder.DeathRecipient, int);
    method protected boolean onTransact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
    method public boolean pingBinder();
    method public android.os.IInterface queryLocalInterface(java.lang.String);
    method public static final void restoreCallingIdentity(long);
    method public final boolean transact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
    method public boolean unlinkToDeath(android.os.IBinder.DeathRecipient, int);
  }

  public class Build {
    ctor public Build();
    method public static java.lang.String getRadioVersion();
    method public static java.lang.String getSerial();
    field public static final java.lang.String BOARD;
    field public static final java.lang.String BOOTLOADER;
    field public static final java.lang.String BRAND;
    field public static final deprecated java.lang.String CPU_ABI;
    field public static final deprecated java.lang.String CPU_ABI2;
    field public static final java.lang.String DEVICE;
    field public static final java.lang.String DISPLAY;
    field public static final java.lang.String FINGERPRINT;
    field public static final java.lang.String HARDWARE;
    field public static final java.lang.String HOST;
    field public static final java.lang.String ID;
    field public static final java.lang.String MANUFACTURER;
    field public static final java.lang.String MODEL;
    field public static final java.lang.String PRODUCT;
    field public static final deprecated java.lang.String RADIO;
    field public static final deprecated java.lang.String SERIAL;
    field public static final java.lang.String[] SUPPORTED_32_BIT_ABIS;
    field public static final java.lang.String[] SUPPORTED_64_BIT_ABIS;
    field public static final java.lang.String[] SUPPORTED_ABIS;
    field public static final java.lang.String TAGS;
    field public static final long TIME;
    field public static final java.lang.String TYPE;
    field public static final java.lang.String UNKNOWN = "unknown";
    field public static final java.lang.String USER;
  }

  public static class Build.VERSION {
    ctor public Build.VERSION();
    field public static final java.lang.String BASE_OS;
    field public static final java.lang.String CODENAME;
    field public static final java.lang.String INCREMENTAL;
    field public static final int PREVIEW_SDK_INT;
    field public static final java.lang.String RELEASE;
    field public static final deprecated java.lang.String SDK;
    field public static final int SDK_INT;
    field public static final java.lang.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(java.lang.ClassLoader);
    ctor public Bundle(int);
    ctor public Bundle(android.os.Bundle);
    ctor public Bundle(android.os.PersistableBundle);
    method public java.lang.Object clone();
    method public android.os.Bundle deepCopy();
    method public int describeContents();
    method public android.os.IBinder getBinder(java.lang.String);
    method public android.os.Bundle getBundle(java.lang.String);
    method public byte getByte(java.lang.String);
    method public java.lang.Byte getByte(java.lang.String, byte);
    method public byte[] getByteArray(java.lang.String);
    method public char getChar(java.lang.String);
    method public char getChar(java.lang.String, char);
    method public char[] getCharArray(java.lang.String);
    method public java.lang.CharSequence getCharSequence(java.lang.String);
    method public java.lang.CharSequence getCharSequence(java.lang.String, java.lang.CharSequence);
    method public java.lang.CharSequence[] getCharSequenceArray(java.lang.String);
    method public java.util.ArrayList<java.lang.CharSequence> getCharSequenceArrayList(java.lang.String);
    method public java.lang.ClassLoader getClassLoader();
    method public float getFloat(java.lang.String);
    method public float getFloat(java.lang.String, float);
    method public float[] getFloatArray(java.lang.String);
    method public java.util.ArrayList<java.lang.Integer> getIntegerArrayList(java.lang.String);
    method public <T extends android.os.Parcelable> T getParcelable(java.lang.String);
    method public android.os.Parcelable[] getParcelableArray(java.lang.String);
    method public <T extends android.os.Parcelable> java.util.ArrayList<T> getParcelableArrayList(java.lang.String);
    method public java.io.Serializable getSerializable(java.lang.String);
    method public short getShort(java.lang.String);
    method public short getShort(java.lang.String, short);
    method public short[] getShortArray(java.lang.String);
    method public android.util.Size getSize(java.lang.String);
    method public android.util.SizeF getSizeF(java.lang.String);
    method public <T extends android.os.Parcelable> android.util.SparseArray<T> getSparseParcelableArray(java.lang.String);
    method public java.util.ArrayList<java.lang.String> getStringArrayList(java.lang.String);
    method public boolean hasFileDescriptors();
    method public void putAll(android.os.Bundle);
    method public void putBinder(java.lang.String, android.os.IBinder);
    method public void putBundle(java.lang.String, android.os.Bundle);
    method public void putByte(java.lang.String, byte);
    method public void putByteArray(java.lang.String, byte[]);
    method public void putChar(java.lang.String, char);
    method public void putCharArray(java.lang.String, char[]);
    method public void putCharSequence(java.lang.String, java.lang.CharSequence);
    method public void putCharSequenceArray(java.lang.String, java.lang.CharSequence[]);
    method public void putCharSequenceArrayList(java.lang.String, java.util.ArrayList<java.lang.CharSequence>);
    method public void putFloat(java.lang.String, float);
    method public void putFloatArray(java.lang.String, float[]);
    method public void putIntegerArrayList(java.lang.String, java.util.ArrayList<java.lang.Integer>);
    method public void putParcelable(java.lang.String, android.os.Parcelable);
    method public void putParcelableArray(java.lang.String, android.os.Parcelable[]);
    method public void putParcelableArrayList(java.lang.String, java.util.ArrayList<? extends android.os.Parcelable>);
    method public void putSerializable(java.lang.String, java.io.Serializable);
    method public void putShort(java.lang.String, short);
    method public void putShortArray(java.lang.String, short[]);
    method public void putSize(java.lang.String, android.util.Size);
    method public void putSizeF(java.lang.String, android.util.SizeF);
    method public void putSparseParcelableArray(java.lang.String, android.util.SparseArray<? extends android.os.Parcelable>);
    method public void putStringArrayList(java.lang.String, java.util.ArrayList<java.lang.String>);
    method public void readFromParcel(android.os.Parcel);
    method public void setClassLoader(java.lang.ClassLoader);
    method public synchronized java.lang.String toString();
    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 abstract interface CancellationSignal.OnCancelListener {
    method public abstract 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 synchronized void cancel();
    method public abstract void onFinish();
    method public abstract void onTick(long);
    method public final synchronized 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(java.lang.String);
  }

  public class DeadSystemException extends android.os.DeadObjectException {
    ctor public DeadSystemException();
  }

  public final class Debug {
    method public static void attachJvmtiAgent(java.lang.String, java.lang.String, java.lang.ClassLoader) throws java.io.IOException;
    method public static deprecated void changeDebugPort(int);
    method public static void dumpHprofData(java.lang.String) throws java.io.IOException;
    method public static boolean dumpService(java.lang.String, java.io.FileDescriptor, java.lang.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 public static deprecated int getGlobalAllocCount();
    method public static deprecated int getGlobalAllocSize();
    method public static deprecated int getGlobalClassInitCount();
    method public static deprecated int getGlobalClassInitTime();
    method public static deprecated int getGlobalExternalAllocCount();
    method public static deprecated int getGlobalExternalAllocSize();
    method public static deprecated int getGlobalExternalFreedCount();
    method public static deprecated int getGlobalExternalFreedSize();
    method public static deprecated int getGlobalFreedCount();
    method public static deprecated int getGlobalFreedSize();
    method public static deprecated 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 java.lang.String getRuntimeStat(java.lang.String);
    method public static java.util.Map<java.lang.String, java.lang.String> getRuntimeStats();
    method public static deprecated int getThreadAllocCount();
    method public static deprecated int getThreadAllocSize();
    method public static deprecated int getThreadExternalAllocCount();
    method public static deprecated int getThreadExternalAllocSize();
    method public static deprecated int getThreadGcInvocationCount();
    method public static boolean isDebuggerConnected();
    method public static void printLoadedClasses(int);
    method public static deprecated void resetAllCounts();
    method public static deprecated void resetGlobalAllocCount();
    method public static deprecated void resetGlobalAllocSize();
    method public static deprecated void resetGlobalClassInitCount();
    method public static deprecated void resetGlobalClassInitTime();
    method public static deprecated void resetGlobalExternalAllocCount();
    method public static deprecated void resetGlobalExternalAllocSize();
    method public static deprecated void resetGlobalExternalFreedCount();
    method public static deprecated void resetGlobalExternalFreedSize();
    method public static deprecated void resetGlobalFreedCount();
    method public static deprecated void resetGlobalFreedSize();
    method public static deprecated void resetGlobalGcInvocationCount();
    method public static deprecated void resetThreadAllocCount();
    method public static deprecated void resetThreadAllocSize();
    method public static deprecated void resetThreadExternalAllocCount();
    method public static deprecated void resetThreadExternalAllocSize();
    method public static deprecated void resetThreadGcInvocationCount();
    method public static deprecated int setAllocationLimit(int);
    method public static deprecated int setGlobalAllocationLimit(int);
    method public static deprecated void startAllocCounting();
    method public static void startMethodTracing();
    method public static void startMethodTracing(java.lang.String);
    method public static void startMethodTracing(java.lang.String, int);
    method public static void startMethodTracing(java.lang.String, int, int);
    method public static void startMethodTracingSampling(java.lang.String, int, int);
    method public static void startNativeTracing();
    method public static deprecated 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 public static final deprecated int TRACE_COUNT_ALLOCS = 1; // 0x1
  }

  public static deprecated class Debug.InstructionCount {
    ctor public Debug.InstructionCount();
    method public boolean collect();
    method public int globalMethodInvocations();
    method public int globalTotal();
    method public boolean resetAndStart();
  }

  public static class Debug.MemoryInfo implements android.os.Parcelable {
    ctor public Debug.MemoryInfo();
    method public int describeContents();
    method public java.lang.String getMemoryStat(java.lang.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(java.lang.String, byte[], int);
    method public void addFile(java.lang.String, java.io.File, int) throws java.io.IOException;
    method public void addText(java.lang.String, java.lang.String);
    method public android.os.DropBoxManager.Entry getNextEntry(java.lang.String, long);
    method public boolean isTagEnabled(java.lang.String);
    field public static final java.lang.String ACTION_DROPBOX_ENTRY_ADDED = "android.intent.action.DROPBOX_ENTRY_ADDED";
    field public static final java.lang.String EXTRA_TAG = "tag";
    field public static final java.lang.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(java.lang.String, long);
    ctor public DropBoxManager.Entry(java.lang.String, long, java.lang.String);
    ctor public DropBoxManager.Entry(java.lang.String, long, byte[], int);
    ctor public DropBoxManager.Entry(java.lang.String, long, android.os.ParcelFileDescriptor, int);
    ctor public DropBoxManager.Entry(java.lang.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 java.lang.String getTag();
    method public java.lang.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(java.lang.String);
    method public static java.lang.String getExternalStorageState();
    method public static java.lang.String getExternalStorageState(java.io.File);
    method public static java.io.File getRootDirectory();
    method public static deprecated java.lang.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 java.lang.String DIRECTORY_ALARMS;
    field public static java.lang.String DIRECTORY_DCIM;
    field public static java.lang.String DIRECTORY_DOCUMENTS;
    field public static java.lang.String DIRECTORY_DOWNLOADS;
    field public static java.lang.String DIRECTORY_MOVIES;
    field public static java.lang.String DIRECTORY_MUSIC;
    field public static java.lang.String DIRECTORY_NOTIFICATIONS;
    field public static java.lang.String DIRECTORY_PICTURES;
    field public static java.lang.String DIRECTORY_PODCASTS;
    field public static java.lang.String DIRECTORY_RINGTONES;
    field public static final java.lang.String MEDIA_BAD_REMOVAL = "bad_removal";
    field public static final java.lang.String MEDIA_CHECKING = "checking";
    field public static final java.lang.String MEDIA_EJECTING = "ejecting";
    field public static final java.lang.String MEDIA_MOUNTED = "mounted";
    field public static final java.lang.String MEDIA_MOUNTED_READ_ONLY = "mounted_ro";
    field public static final java.lang.String MEDIA_NOFS = "nofs";
    field public static final java.lang.String MEDIA_REMOVED = "removed";
    field public static final java.lang.String MEDIA_SHARED = "shared";
    field public static final java.lang.String MEDIA_UNKNOWN = "unknown";
    field public static final java.lang.String MEDIA_UNMOUNTABLE = "unmountable";
    field public static final java.lang.String MEDIA_UNMOUNTED = "unmounted";
  }

  public abstract class FileObserver {
    ctor public FileObserver(java.lang.String);
    ctor public FileObserver(java.lang.String, int);
    method protected void finalize();
    method public abstract void onEvent(int, java.lang.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(java.lang.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 public static android.os.Handler createAsync(android.os.Looper);
    method public static android.os.Handler createAsync(android.os.Looper, android.os.Handler.Callback);
    method public void dispatchMessage(android.os.Message);
    method public final void dump(android.util.Printer, java.lang.String);
    method public final android.os.Looper getLooper();
    method public java.lang.String getMessageName(android.os.Message);
    method public void handleMessage(android.os.Message);
    method public final boolean hasMessages(int);
    method public final boolean hasMessages(int, java.lang.Object);
    method public final android.os.Message obtainMessage();
    method public final android.os.Message obtainMessage(int);
    method public final android.os.Message obtainMessage(int, java.lang.Object);
    method public final android.os.Message obtainMessage(int, int, int);
    method public final android.os.Message obtainMessage(int, int, int, java.lang.Object);
    method public final boolean post(java.lang.Runnable);
    method public final boolean postAtFrontOfQueue(java.lang.Runnable);
    method public final boolean postAtTime(java.lang.Runnable, long);
    method public final boolean postAtTime(java.lang.Runnable, java.lang.Object, long);
    method public final boolean postDelayed(java.lang.Runnable, long);
    method public final boolean postDelayed(java.lang.Runnable, java.lang.Object, long);
    method public final void removeCallbacks(java.lang.Runnable);
    method public final void removeCallbacks(java.lang.Runnable, java.lang.Object);
    method public final void removeCallbacksAndMessages(java.lang.Object);
    method public final void removeMessages(int);
    method public final void removeMessages(int, java.lang.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 abstract interface Handler.Callback {
    method public abstract boolean handleMessage(android.os.Message);
  }

  public class HandlerThread extends java.lang.Thread {
    ctor public HandlerThread(java.lang.String);
    ctor public HandlerThread(java.lang.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 public android.os.CpuUsageInfo[] getCpuUsages();
    method public float[] getDeviceTemperatures(int, int);
    method 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 abstract interface IBinder {
    method public abstract void dump(java.io.FileDescriptor, java.lang.String[]) throws android.os.RemoteException;
    method public abstract void dumpAsync(java.io.FileDescriptor, java.lang.String[]) throws android.os.RemoteException;
    method public abstract java.lang.String getInterfaceDescriptor() throws android.os.RemoteException;
    method public abstract boolean isBinderAlive();
    method public abstract void linkToDeath(android.os.IBinder.DeathRecipient, int) throws android.os.RemoteException;
    method public abstract boolean pingBinder();
    method public abstract android.os.IInterface queryLocalInterface(java.lang.String);
    method public abstract boolean transact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
    method public abstract boolean unlinkToDeath(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 abstract interface IBinder.DeathRecipient {
    method public abstract void binderDied();
  }

  public abstract interface IInterface {
    method public abstract android.os.IBinder asBinder();
  }

  public final class LocaleList implements android.os.Parcelable {
    ctor public LocaleList(java.util.Locale...);
    method public int describeContents();
    method public static android.os.LocaleList forLanguageTags(java.lang.String);
    method public java.util.Locale get(int);
    method public static android.os.LocaleList getAdjustedDefault();
    method public static android.os.LocaleList getDefault();
    method public static android.os.LocaleList getEmptyLocaleList();
    method public java.util.Locale getFirstMatch(java.lang.String[]);
    method public int indexOf(java.util.Locale);
    method public boolean isEmpty();
    method public static void setDefault(android.os.LocaleList);
    method public int size();
    method public java.lang.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(android.util.Printer, java.lang.String);
    method public static android.os.Looper getMainLooper();
    method public android.os.MessageQueue getQueue();
    method public java.lang.Thread getThread();
    method public boolean isCurrentThread();
    method public static void loop();
    method public static android.os.Looper myLooper();
    method 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(android.util.Printer);
  }

  public class MemoryFile {
    ctor public MemoryFile(java.lang.String, int) throws java.io.IOException;
    method public deprecated synchronized boolean allowPurging(boolean) throws java.io.IOException;
    method public void close();
    method public java.io.InputStream getInputStream();
    method public java.io.OutputStream getOutputStream();
    method public deprecated 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 java.lang.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, java.lang.Runnable);
    method public static android.os.Message obtain(android.os.Handler, int);
    method public static android.os.Message obtain(android.os.Handler, int, java.lang.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, java.lang.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 java.lang.Object obj;
    field public android.os.Messenger replyTo;
    field public int sendingUid;
    field public int what;
  }

  public final class MessageQueue {
    method public void addIdleHandler(android.os.MessageQueue.IdleHandler);
    method public void addOnFileDescriptorEventListener(java.io.FileDescriptor, int, android.os.MessageQueue.OnFileDescriptorEventListener);
    method public boolean isIdle();
    method public void removeIdleHandler(android.os.MessageQueue.IdleHandler);
    method public void removeOnFileDescriptorEventListener(java.io.FileDescriptor);
  }

  public static abstract interface MessageQueue.IdleHandler {
    method public abstract boolean queueIdle();
  }

  public static abstract interface MessageQueue.OnFileDescriptorEventListener {
    method public abstract int onFileDescriptorEvents(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(java.lang.String);
  }

  public final class Parcel {
    method public void appendFrom(android.os.Parcel, int, int);
    method public android.os.IBinder[] createBinderArray();
    method public java.util.ArrayList<android.os.IBinder> createBinderArrayList();
    method public boolean[] createBooleanArray();
    method public byte[] createByteArray();
    method public char[] createCharArray();
    method public double[] createDoubleArray();
    method public float[] createFloatArray();
    method public int[] createIntArray();
    method public long[] createLongArray();
    method public java.lang.String[] createStringArray();
    method public java.util.ArrayList<java.lang.String> createStringArrayList();
    method public <T> T[] createTypedArray(android.os.Parcelable.Creator<T>);
    method public <T> java.util.ArrayList<T> createTypedArrayList(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(java.lang.String);
    method public boolean hasFileDescriptors();
    method public byte[] marshall();
    method public static android.os.Parcel obtain();
    method public java.lang.Object[] readArray(java.lang.ClassLoader);
    method public java.util.ArrayList readArrayList(java.lang.ClassLoader);
    method public void readBinderArray(android.os.IBinder[]);
    method public void readBinderList(java.util.List<android.os.IBinder>);
    method public void readBooleanArray(boolean[]);
    method public android.os.Bundle readBundle();
    method public android.os.Bundle readBundle(java.lang.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, java.lang.String);
    method public android.os.ParcelFileDescriptor readFileDescriptor();
    method public float readFloat();
    method public void readFloatArray(float[]);
    method public java.util.HashMap readHashMap(java.lang.ClassLoader);
    method public int readInt();
    method public void readIntArray(int[]);
    method public void readList(java.util.List, java.lang.ClassLoader);
    method public long readLong();
    method public void readLongArray(long[]);
    method public void readMap(java.util.Map, java.lang.ClassLoader);
    method public <T extends android.os.Parcelable> T readParcelable(java.lang.ClassLoader);
    method public android.os.Parcelable[] readParcelableArray(java.lang.ClassLoader);
    method public android.os.PersistableBundle readPersistableBundle();
    method public android.os.PersistableBundle readPersistableBundle(java.lang.ClassLoader);
    method public java.io.Serializable readSerializable();
    method public android.util.Size readSize();
    method public android.util.SizeF readSizeF();
    method public android.util.SparseArray readSparseArray(java.lang.ClassLoader);
    method public android.util.SparseBooleanArray readSparseBooleanArray();
    method public java.lang.String readString();
    method public void readStringArray(java.lang.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 public <T> T readTypedObject(android.os.Parcelable.Creator<T>);
    method public java.lang.Object readValue(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String);
    method public void writeStringArray(java.lang.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(java.lang.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(java.lang.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(java.lang.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 public static final deprecated int MODE_WORLD_READABLE = 1; // 0x1
    field public static final deprecated 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 abstract interface ParcelFileDescriptor.OnCloseListener {
    method public abstract void onClose(java.io.IOException);
  }

  public class ParcelFormatException extends java.lang.RuntimeException {
    ctor public ParcelFormatException();
    ctor public ParcelFormatException(java.lang.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(java.lang.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 abstract interface Parcelable {
    method public abstract int describeContents();
    method public abstract 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 abstract interface Parcelable.ClassLoaderCreator<T> implements android.os.Parcelable.Creator {
    method public abstract T createFromParcel(android.os.Parcel, java.lang.ClassLoader);
  }

  public static abstract interface Parcelable.Creator<T> {
    method public abstract T createFromParcel(android.os.Parcel);
    method public abstract T[] newArray(int);
  }

  public class PatternMatcher implements android.os.Parcelable {
    ctor public PatternMatcher(java.lang.String, int);
    ctor public PatternMatcher(android.os.Parcel);
    method public int describeContents();
    method public final java.lang.String getPath();
    method public final int getType();
    method public boolean match(java.lang.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 java.lang.Object clone();
    method public android.os.PersistableBundle deepCopy();
    method public int describeContents();
    method public android.os.PersistableBundle getPersistableBundle(java.lang.String);
    method public void putPersistableBundle(java.lang.String, android.os.PersistableBundle);
    method public synchronized java.lang.String toString();
    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(java.lang.String);
    method public boolean isInteractive();
    method public boolean isPowerSaveMode();
    method public deprecated boolean isScreenOn();
    method public boolean isSustainedPerformanceModeSupported();
    method public boolean isWakeLockLevelSupported(int);
    method public android.os.PowerManager.WakeLock newWakeLock(int, java.lang.String);
    method public void reboot(java.lang.String);
    field public static final int ACQUIRE_CAUSES_WAKEUP = 268435456; // 0x10000000
    field public static final java.lang.String ACTION_DEVICE_IDLE_MODE_CHANGED = "android.os.action.DEVICE_IDLE_MODE_CHANGED";
    field public static final java.lang.String ACTION_POWER_SAVE_MODE_CHANGED = "android.os.action.POWER_SAVE_MODE_CHANGED";
    field public static final deprecated 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 public static final deprecated int SCREEN_BRIGHT_WAKE_LOCK = 10; // 0xa
    field public static final deprecated 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(java.lang.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(java.lang.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 public static final deprecated boolean supportsProcesses();
    field public static final int FIRST_APPLICATION_UID = 10000; // 0x2710
    field public static final int LAST_APPLICATION_UID = 19999; // 0x4e1f
    field public static final int PHONE_UID = 1001; // 0x3e9
    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 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 abstract interface RecoverySystem.ProgressListener {
    method public abstract void onProgress(int);
  }

  public class RemoteCallbackList<E extends android.os.IInterface> {
    ctor public RemoteCallbackList();
    method public int beginBroadcast();
    method public void finishBroadcast();
    method public java.lang.Object getBroadcastCookie(int);
    method public E getBroadcastItem(int);
    method public java.lang.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, java.lang.Object);
    method public boolean register(E);
    method public boolean register(E, java.lang.Object);
    method public boolean unregister(E);
  }

  public class RemoteException extends android.util.AndroidException {
    ctor public RemoteException();
    ctor public RemoteException(java.lang.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 public static android.os.SharedMemory create(java.lang.String, int) throws android.system.ErrnoException;
    method public int describeContents();
    method public int getSize();
    method public java.nio.ByteBuffer map(int, int, int) throws android.system.ErrnoException;
    method public java.nio.ByteBuffer mapReadOnly() throws android.system.ErrnoException;
    method public java.nio.ByteBuffer mapReadWrite() throws android.system.ErrnoException;
    method public boolean setProtect(int);
    method public static void unmap(java.nio.ByteBuffer);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.SharedMemory> CREATOR;
  }

  public class StatFs {
    ctor public StatFs(java.lang.String);
    method public deprecated int getAvailableBlocks();
    method public long getAvailableBlocksLong();
    method public long getAvailableBytes();
    method public deprecated int getBlockCount();
    method public long getBlockCountLong();
    method public deprecated int getBlockSize();
    method public long getBlockSizeLong();
    method public deprecated int getFreeBlocks();
    method public long getFreeBlocksLong();
    method public long getFreeBytes();
    method public long getTotalBytes();
    method public void restat(java.lang.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(java.lang.String);
    method public static void setThreadPolicy(android.os.StrictMode.ThreadPolicy);
    method public static void setVmPolicy(android.os.StrictMode.VmPolicy);
  }

  public static abstract interface StrictMode.OnThreadViolationListener {
    method public abstract void onThreadViolation(android.os.strictmode.Violation);
  }

  public static abstract interface StrictMode.OnVmViolationListener {
    method public abstract 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(java.util.concurrent.Executor, 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(java.util.concurrent.Executor, 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(java.lang.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, java.lang.Object, int);
    method public boolean hasMessages(android.os.Handler, java.lang.Object, java.lang.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, java.lang.String);
    method public void acquire(android.os.IBinder, java.lang.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(java.lang.String);
    method public static void endSection();
  }

  public class TransactionTooLargeException extends android.os.RemoteException {
    ctor public TransactionTooLargeException();
    ctor public TransactionTooLargeException(java.lang.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(java.lang.String, java.lang.String, java.lang.String, android.os.PersistableBundle);
    method public android.os.Bundle getApplicationRestrictions(java.lang.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 java.lang.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(java.lang.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, android.os.UserHandle);
    method public deprecated boolean setRestrictionsChallenge(java.lang.String);
    method public deprecated void setUserRestriction(java.lang.String, boolean);
    method public deprecated void setUserRestrictions(android.os.Bundle);
    method public deprecated void setUserRestrictions(android.os.Bundle, android.os.UserHandle);
    method public static boolean supportsMultipleUsers();
    field public static final java.lang.String ALLOW_PARENT_PROFILE_APP_LINKING = "allow_parent_profile_app_linking";
    field public static final java.lang.String DISALLOW_ADD_MANAGED_PROFILE = "no_add_managed_profile";
    field public static final java.lang.String DISALLOW_ADD_USER = "no_add_user";
    field public static final java.lang.String DISALLOW_ADJUST_VOLUME = "no_adjust_volume";
    field public static final java.lang.String DISALLOW_AIRPLANE_MODE = "no_airplane_mode";
    field public static final java.lang.String DISALLOW_AMBIENT_DISPLAY = "no_ambient_display";
    field public static final java.lang.String DISALLOW_APPS_CONTROL = "no_control_apps";
    field public static final java.lang.String DISALLOW_AUTOFILL = "no_autofill";
    field public static final java.lang.String DISALLOW_BLUETOOTH = "no_bluetooth";
    field public static final java.lang.String DISALLOW_BLUETOOTH_SHARING = "no_bluetooth_sharing";
    field public static final java.lang.String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth";
    field public static final java.lang.String DISALLOW_CONFIG_BRIGHTNESS = "no_config_brightness";
    field public static final java.lang.String DISALLOW_CONFIG_CELL_BROADCASTS = "no_config_cell_broadcasts";
    field public static final java.lang.String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials";
    field public static final java.lang.String DISALLOW_CONFIG_DATE_TIME = "no_config_date_time";
    field public static final java.lang.String DISALLOW_CONFIG_LOCALE = "no_config_locale";
    field public static final java.lang.String DISALLOW_CONFIG_LOCATION = "no_config_location";
    field public static final java.lang.String DISALLOW_CONFIG_MOBILE_NETWORKS = "no_config_mobile_networks";
    field public static final java.lang.String DISALLOW_CONFIG_SCREEN_TIMEOUT = "no_config_screen_timeout";
    field public static final java.lang.String DISALLOW_CONFIG_TETHERING = "no_config_tethering";
    field public static final java.lang.String DISALLOW_CONFIG_VPN = "no_config_vpn";
    field public static final java.lang.String DISALLOW_CONFIG_WIFI = "no_config_wifi";
    field public static final java.lang.String DISALLOW_CREATE_WINDOWS = "no_create_windows";
    field public static final java.lang.String DISALLOW_CROSS_PROFILE_COPY_PASTE = "no_cross_profile_copy_paste";
    field public static final java.lang.String DISALLOW_DATA_ROAMING = "no_data_roaming";
    field public static final java.lang.String DISALLOW_DEBUGGING_FEATURES = "no_debugging_features";
    field public static final java.lang.String DISALLOW_FACTORY_RESET = "no_factory_reset";
    field public static final java.lang.String DISALLOW_FUN = "no_fun";
    field public static final java.lang.String DISALLOW_INSTALL_APPS = "no_install_apps";
    field public static final java.lang.String DISALLOW_INSTALL_UNKNOWN_SOURCES = "no_install_unknown_sources";
    field public static final java.lang.String DISALLOW_MODIFY_ACCOUNTS = "no_modify_accounts";
    field public static final java.lang.String DISALLOW_MOUNT_PHYSICAL_MEDIA = "no_physical_media";
    field public static final java.lang.String DISALLOW_NETWORK_RESET = "no_network_reset";
    field public static final java.lang.String DISALLOW_OUTGOING_BEAM = "no_outgoing_beam";
    field public static final java.lang.String DISALLOW_OUTGOING_CALLS = "no_outgoing_calls";
    field public static final java.lang.String DISALLOW_PRINTING = "no_printing";
    field public static final java.lang.String DISALLOW_REMOVE_MANAGED_PROFILE = "no_remove_managed_profile";
    field public static final java.lang.String DISALLOW_REMOVE_USER = "no_remove_user";
    field public static final java.lang.String DISALLOW_SAFE_BOOT = "no_safe_boot";
    field public static final java.lang.String DISALLOW_SET_USER_ICON = "no_set_user_icon";
    field public static final java.lang.String DISALLOW_SET_WALLPAPER = "no_set_wallpaper";
    field public static final java.lang.String DISALLOW_SHARE_INTO_MANAGED_PROFILE = "no_sharing_into_profile";
    field public static final java.lang.String DISALLOW_SHARE_LOCATION = "no_share_location";
    field public static final java.lang.String DISALLOW_SMS = "no_sms";
    field public static final java.lang.String DISALLOW_SYSTEM_ERROR_DIALOGS = "no_system_error_dialogs";
    field public static final java.lang.String DISALLOW_UNIFIED_PASSWORD = "no_unified_password";
    field public static final java.lang.String DISALLOW_UNINSTALL_APPS = "no_uninstall_apps";
    field public static final java.lang.String DISALLOW_UNMUTE_MICROPHONE = "no_unmute_microphone";
    field public static final java.lang.String DISALLOW_USB_FILE_TRANSFER = "no_usb_file_transfer";
    field public static final java.lang.String DISALLOW_USER_SWITCH = "no_user_switch";
    field public static final java.lang.String ENSURE_VERIFY_APPS = "ensure_verify_apps";
    field public static final java.lang.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 public abstract void cancel();
    method public abstract boolean hasAmplitudeControl();
    method public abstract boolean hasVibrator();
    method public deprecated void vibrate(long);
    method public deprecated void vibrate(long, android.media.AudioAttributes);
    method public deprecated void vibrate(long[], int);
    method public deprecated void vibrate(long[], int, android.media.AudioAttributes);
    method public void vibrate(android.os.VibrationEffect);
    method 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 java.lang.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 public static final deprecated 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(java.lang.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 public void allocateBytes(java.util.UUID, long) throws java.io.IOException;
    method public void allocateBytes(java.io.FileDescriptor, long) throws java.io.IOException;
    method public long getAllocatableBytes(java.util.UUID) throws java.io.IOException;
    method public long getCacheQuotaBytes(java.util.UUID) throws java.io.IOException;
    method public long getCacheSizeBytes(java.util.UUID) throws java.io.IOException;
    method public java.lang.String getMountedObbPath(java.lang.String);
    method public android.os.storage.StorageVolume getPrimaryStorageVolume();
    method public android.os.storage.StorageVolume getStorageVolume(java.io.File);
    method public java.util.List<android.os.storage.StorageVolume> getStorageVolumes();
    method public java.util.UUID getUuidForPath(java.io.File) throws java.io.IOException;
    method public boolean isAllocationSupported(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(java.lang.String);
    method public boolean mountObb(java.lang.String, java.lang.String, android.os.storage.OnObbStateChangeListener);
    method 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(java.lang.String, boolean, android.os.storage.OnObbStateChangeListener);
    field public static final java.lang.String ACTION_MANAGE_STORAGE = "android.os.storage.action.MANAGE_STORAGE";
    field public static final java.lang.String EXTRA_REQUESTED_BYTES = "android.os.storage.extra.REQUESTED_BYTES";
    field public static final java.lang.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 public android.content.Intent createAccessIntent(java.lang.String);
    method public int describeContents();
    method public java.lang.String getDescription(android.content.Context);
    method public java.lang.String getState();
    method public java.lang.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 java.lang.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 java.lang.CharSequence getDialogMessage();
    method public java.lang.CharSequence getDialogTitle();
    method public java.lang.CharSequence getNegativeButtonText();
    method public java.lang.CharSequence getPositiveButtonText();
    method public void onActivityDestroy();
    method 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(int);
    method public void setDialogLayoutResource(int);
    method public void setDialogMessage(java.lang.CharSequence);
    method public void setDialogMessage(int);
    method public void setDialogTitle(java.lang.CharSequence);
    method public void setDialogTitle(int);
    method public void setNegativeButtonText(java.lang.CharSequence);
    method public void setNegativeButtonText(int);
    method public void setPositiveButtonText(java.lang.CharSequence);
    method public void setPositiveButtonText(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 java.lang.String getText();
    method protected void onAddEditTextToDialogView(android.view.View, android.widget.EditText);
    method public void setText(java.lang.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(java.lang.String);
    method public java.lang.CharSequence[] getEntries();
    method public java.lang.CharSequence getEntry();
    method public java.lang.CharSequence[] getEntryValues();
    method public java.lang.String getValue();
    method public void setEntries(java.lang.CharSequence[]);
    method public void setEntries(int);
    method public void setEntryValues(java.lang.CharSequence[]);
    method public void setEntryValues(int);
    method public void setValue(java.lang.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(java.lang.String);
    method public java.lang.CharSequence[] getEntries();
    method public java.lang.CharSequence[] getEntryValues();
    method public java.util.Set<java.lang.String> getValues();
    method public void setEntries(java.lang.CharSequence[]);
    method public void setEntries(int);
    method public void setEntryValues(java.lang.CharSequence[]);
    method public void setEntryValues(int);
    method public void setValues(java.util.Set<java.lang.String>);
  }

  public class Preference implements java.lang.Comparable {
    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(java.lang.Object);
    method public int compareTo(android.preference.Preference);
    method protected android.preference.Preference findPreferenceInHierarchy(java.lang.String);
    method public android.content.Context getContext();
    method public java.lang.String getDependency();
    method public android.content.SharedPreferences.Editor getEditor();
    method public android.os.Bundle getExtras();
    method public java.lang.String getFragment();
    method public android.graphics.drawable.Drawable getIcon();
    method public android.content.Intent getIntent();
    method public java.lang.String getKey();
    method public int getLayoutResource();
    method public android.preference.Preference.OnPreferenceChangeListener getOnPreferenceChangeListener();
    method public android.preference.Preference.OnPreferenceClickListener getOnPreferenceClickListener();
    method public int getOrder();
    method 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 java.lang.String getPersistedString(java.lang.String);
    method public java.util.Set<java.lang.String> getPersistedStringSet(java.util.Set<java.lang.String>);
    method public android.preference.PreferenceDataStore getPreferenceDataStore();
    method public android.preference.PreferenceManager getPreferenceManager();
    method public android.content.SharedPreferences getSharedPreferences();
    method public boolean getShouldDisableView();
    method public java.lang.CharSequence getSummary();
    method public java.lang.CharSequence getTitle();
    method public int getTitleRes();
    method public android.view.View getView(android.view.View, android.view.ViewGroup);
    method 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 protected void onBindView(android.view.View);
    method protected void onClick();
    method protected android.view.View onCreateView(android.view.ViewGroup);
    method public void onDependencyChanged(android.preference.Preference, boolean);
    method protected java.lang.Object onGetDefaultValue(android.content.res.TypedArray, int);
    method public void onParentChanged(android.preference.Preference, boolean);
    method protected void onPrepareForRemoval();
    method protected void onRestoreInstanceState(android.os.Parcelable);
    method protected android.os.Parcelable onSaveInstanceState();
    method protected void onSetInitialValue(boolean, java.lang.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(java.lang.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(java.lang.Object);
    method public void setDependency(java.lang.String);
    method public void setEnabled(boolean);
    method public void setFragment(java.lang.String);
    method public void setIcon(android.graphics.drawable.Drawable);
    method public void setIcon(int);
    method public void setIconSpaceReserved(boolean);
    method public void setIntent(android.content.Intent);
    method public void setKey(java.lang.String);
    method public void setLayoutResource(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 public void setRecycleEnabled(boolean);
    method public void setSelectable(boolean);
    method public void setShouldDisableView(boolean);
    method public void setSingleLineTitle(boolean);
    method public void setSummary(java.lang.CharSequence);
    method public void setSummary(int);
    method public void setTitle(java.lang.CharSequence);
    method public void setTitle(int);
    method public void setWidgetLayoutResource(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 abstract interface Preference.OnPreferenceChangeListener {
    method public abstract boolean onPreferenceChange(android.preference.Preference, java.lang.Object);
  }

  public static abstract interface Preference.OnPreferenceClickListener {
    method public abstract boolean onPreferenceClick(android.preference.Preference);
  }

  public abstract class PreferenceActivity extends android.app.ListActivity implements android.preference.PreferenceFragment.OnPreferenceStartFragmentCallback {
    ctor public PreferenceActivity();
    method public deprecated void addPreferencesFromIntent(android.content.Intent);
    method public deprecated void addPreferencesFromResource(int);
    method public deprecated android.preference.Preference findPreference(java.lang.CharSequence);
    method public void finishPreferencePanel(android.app.Fragment, int, android.content.Intent);
    method public deprecated android.preference.PreferenceManager getPreferenceManager();
    method public deprecated android.preference.PreferenceScreen getPreferenceScreen();
    method public boolean hasHeaders();
    method public void invalidateHeaders();
    method public boolean isMultiPane();
    method protected boolean isValidFragment(java.lang.String);
    method public void loadHeadersFromResource(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(java.lang.String, android.os.Bundle, 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 public deprecated boolean onPreferenceTreeClick(android.preference.PreferenceScreen, android.preference.Preference);
    method public void setListFooter(android.view.View);
    method public void setParentTitle(java.lang.CharSequence, java.lang.CharSequence, android.view.View.OnClickListener);
    method public deprecated void setPreferenceScreen(android.preference.PreferenceScreen);
    method public void showBreadCrumbs(java.lang.CharSequence, java.lang.CharSequence);
    method public void startPreferenceFragment(android.app.Fragment, boolean);
    method public void startPreferencePanel(java.lang.String, android.os.Bundle, int, java.lang.CharSequence, android.app.Fragment, int);
    method public void startWithFragment(java.lang.String, android.os.Bundle, android.app.Fragment, int);
    method public void startWithFragment(java.lang.String, android.os.Bundle, android.app.Fragment, int, int, int);
    method public void switchToHeader(java.lang.String, android.os.Bundle);
    method public void switchToHeader(android.preference.PreferenceActivity.Header);
    field public static final java.lang.String EXTRA_NO_HEADERS = ":android:no_headers";
    field public static final java.lang.String EXTRA_SHOW_FRAGMENT = ":android:show_fragment";
    field public static final java.lang.String EXTRA_SHOW_FRAGMENT_ARGUMENTS = ":android:show_fragment_args";
    field public static final java.lang.String EXTRA_SHOW_FRAGMENT_SHORT_TITLE = ":android:show_fragment_short_title";
    field public static final java.lang.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 java.lang.CharSequence getBreadCrumbShortTitle(android.content.res.Resources);
    method public java.lang.CharSequence getBreadCrumbTitle(android.content.res.Resources);
    method public java.lang.CharSequence getSummary(android.content.res.Resources);
    method public java.lang.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 java.lang.CharSequence breadCrumbShortTitle;
    field public int breadCrumbShortTitleRes;
    field public java.lang.CharSequence breadCrumbTitle;
    field public int breadCrumbTitleRes;
    field public android.os.Bundle extras;
    field public java.lang.String fragment;
    field public android.os.Bundle fragmentArguments;
    field public int iconRes;
    field public long id;
    field public android.content.Intent intent;
    field public java.lang.CharSequence summary;
    field public int summaryRes;
    field public java.lang.CharSequence title;
    field 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 abstract interface PreferenceDataStore {
    method public default boolean getBoolean(java.lang.String, boolean);
    method public default float getFloat(java.lang.String, float);
    method public default int getInt(java.lang.String, int);
    method public default long getLong(java.lang.String, long);
    method public default java.lang.String getString(java.lang.String, java.lang.String);
    method public default java.util.Set<java.lang.String> getStringSet(java.lang.String, java.util.Set<java.lang.String>);
    method public default void putBoolean(java.lang.String, boolean);
    method public default void putFloat(java.lang.String, float);
    method public default void putInt(java.lang.String, int);
    method public default void putLong(java.lang.String, long);
    method public default void putString(java.lang.String, java.lang.String);
    method public default void putStringSet(java.lang.String, java.util.Set<java.lang.String>);
  }

  public abstract deprecated class PreferenceFragment extends android.app.Fragment {
    ctor public PreferenceFragment();
    method public void addPreferencesFromIntent(android.content.Intent);
    method public void addPreferencesFromResource(int);
    method public android.preference.Preference findPreference(java.lang.CharSequence);
    method public android.preference.PreferenceManager getPreferenceManager();
    method public android.preference.PreferenceScreen getPreferenceScreen();
    method public boolean onPreferenceTreeClick(android.preference.PreferenceScreen, android.preference.Preference);
    method public void setPreferenceScreen(android.preference.PreferenceScreen);
  }

  public static abstract deprecated interface PreferenceFragment.OnPreferenceStartFragmentCallback {
    method public abstract 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(java.lang.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 public android.preference.Preference findPreference(java.lang.CharSequence);
    method public static android.content.SharedPreferences getDefaultSharedPreferences(android.content.Context);
    method public static java.lang.String getDefaultSharedPreferencesName(android.content.Context);
    method public android.preference.PreferenceDataStore getPreferenceDataStore();
    method public android.content.SharedPreferences getSharedPreferences();
    method public int getSharedPreferencesMode();
    method public java.lang.String getSharedPreferencesName();
    method public boolean isStorageDefault();
    method public boolean isStorageDeviceProtected();
    method public static void setDefaultValues(android.content.Context, int, boolean);
    method public static void setDefaultValues(android.content.Context, java.lang.String, int, int, boolean);
    method public void setPreferenceDataStore(android.preference.PreferenceDataStore);
    method public void setSharedPreferencesMode(int);
    method public void setSharedPreferencesName(java.lang.String);
    method public void setStorageDefault();
    method public void setStorageDeviceProtected();
    field public static final java.lang.String KEY_HAS_SET_DEFAULT_VALUES = "_has_set_default_values";
    field public static final java.lang.String METADATA_KEY_PREFERENCES = "android.preference";
  }

  public static abstract interface PreferenceManager.OnActivityDestroyListener {
    method public abstract void onActivityDestroy();
  }

  public static abstract interface PreferenceManager.OnActivityResultListener {
    method public abstract boolean onActivityResult(int, int, android.content.Intent);
  }

  public static abstract interface PreferenceManager.OnActivityStopListener {
    method public abstract 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 java.lang.CharSequence getSwitchTextOff();
    method public java.lang.CharSequence getSwitchTextOn();
    method public void setSwitchTextOff(java.lang.CharSequence);
    method public void setSwitchTextOff(int);
    method public void setSwitchTextOn(java.lang.CharSequence);
    method public void setSwitchTextOn(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 java.lang.CharSequence getSummaryOff();
    method public java.lang.CharSequence getSummaryOn();
    method public boolean isChecked();
    method public void setChecked(boolean);
    method public void setDisableDependentsState(boolean);
    method public void setSummaryOff(java.lang.CharSequence);
    method public void setSummaryOff(int);
    method public void setSummaryOn(java.lang.CharSequence);
    method public void setSummaryOn(int);
  }

}

package android.print {

  public final class PageRange implements android.os.Parcelable {
    ctor public PageRange(int, int);
    method public int describeContents();
    method public int getEnd();
    method 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 public int getColorMode();
    method public int getDuplexMode();
    method public android.print.PrintAttributes.MediaSize getMediaSize();
    method public android.print.PrintAttributes.Margins getMinMargins();
    method 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 public android.print.PrintAttributes build();
    method public android.print.PrintAttributes.Builder setColorMode(int);
    method public android.print.PrintAttributes.Builder setDuplexMode(int);
    method public android.print.PrintAttributes.Builder setMediaSize(android.print.PrintAttributes.MediaSize);
    method public android.print.PrintAttributes.Builder setMinMargins(android.print.PrintAttributes.Margins);
    method public android.print.PrintAttributes.Builder setResolution(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(java.lang.String, java.lang.String, int, int);
    method public android.print.PrintAttributes.MediaSize asLandscape();
    method public android.print.PrintAttributes.MediaSize asPortrait();
    method public int getHeightMils();
    method public java.lang.String getId();
    method public java.lang.String getLabel(android.content.pm.PackageManager);
    method 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(java.lang.String, java.lang.String, int, int);
    method public int getHorizontalDpi();
    method public java.lang.String getId();
    method public java.lang.String getLabel();
    method 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 java.lang.String EXTRA_PRINT_PREVIEW = "EXTRA_PRINT_PREVIEW";
  }

  public static abstract class PrintDocumentAdapter.LayoutResultCallback {
    method public void onLayoutCancelled();
    method public void onLayoutFailed(java.lang.CharSequence);
    method public void onLayoutFinished(android.print.PrintDocumentInfo, boolean);
  }

  public static abstract class PrintDocumentAdapter.WriteResultCallback {
    method public void onWriteCancelled();
    method public void onWriteFailed(java.lang.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 public long getDataSize();
    method public java.lang.String getName();
    method 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(java.lang.String);
    method public android.print.PrintDocumentInfo build();
    method public android.print.PrintDocumentInfo.Builder setContentType(int);
    method public android.print.PrintDocumentInfo.Builder setPageCount(int);
  }

  public final class PrintJob {
    method public void cancel();
    method public android.print.PrintJobId getId();
    method 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(java.lang.String);
    method public java.lang.String getAdvancedStringOption(java.lang.String);
    method public android.print.PrintAttributes getAttributes();
    method public int getCopies();
    method public long getCreationTime();
    method public android.print.PrintJobId getId();
    method public java.lang.String getLabel();
    method public android.print.PageRange[] getPages();
    method public android.print.PrinterId getPrinterId();
    method public int getState();
    method public boolean hasAdvancedOption(java.lang.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(android.print.PrintJobInfo);
    method public android.print.PrintJobInfo build();
    method public void putAdvancedOption(java.lang.String, java.lang.String);
    method public void putAdvancedOption(java.lang.String, int);
    method public void setAttributes(android.print.PrintAttributes);
    method public void setCopies(int);
    method public void setPages(android.print.PageRange[]);
  }

  public final class PrintManager {
    method public java.util.List<android.print.PrintJob> getPrintJobs();
    method public android.print.PrintJob print(java.lang.String, android.print.PrintDocumentAdapter, android.print.PrintAttributes);
  }

  public final class PrinterCapabilitiesInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getColorModes();
    method public android.print.PrintAttributes getDefaults();
    method public int getDuplexModes();
    method public java.util.List<android.print.PrintAttributes.MediaSize> getMediaSizes();
    method public android.print.PrintAttributes.Margins getMinMargins();
    method 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(android.print.PrinterId);
    method public android.print.PrinterCapabilitiesInfo.Builder addMediaSize(android.print.PrintAttributes.MediaSize, boolean);
    method public android.print.PrinterCapabilitiesInfo.Builder addResolution(android.print.PrintAttributes.Resolution, boolean);
    method public android.print.PrinterCapabilitiesInfo build();
    method public android.print.PrinterCapabilitiesInfo.Builder setColorModes(int, int);
    method public android.print.PrinterCapabilitiesInfo.Builder setDuplexModes(int, int);
    method public android.print.PrinterCapabilitiesInfo.Builder setMinMargins(android.print.PrintAttributes.Margins);
  }

  public final class PrinterId implements android.os.Parcelable {
    method public int describeContents();
    method public java.lang.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 public android.print.PrinterCapabilitiesInfo getCapabilities();
    method public java.lang.String getDescription();
    method public android.print.PrinterId getId();
    method public java.lang.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(android.print.PrinterId, java.lang.String, int);
    ctor public PrinterInfo.Builder(android.print.PrinterInfo);
    method public android.print.PrinterInfo build();
    method public android.print.PrinterInfo.Builder setCapabilities(android.print.PrinterCapabilitiesInfo);
    method public android.print.PrinterInfo.Builder setDescription(java.lang.String);
    method public android.print.PrinterInfo.Builder setHasCustomPrinterIcon(boolean);
    method public android.print.PrinterInfo.Builder setIconResourceId(int);
    method public android.print.PrinterInfo.Builder setInfoIntent(android.app.PendingIntent);
    method public android.print.PrinterInfo.Builder setName(java.lang.String);
    method public android.print.PrinterInfo.Builder setStatus(int);
  }

}

package android.print.pdf {

  public class PrintedPdfDocument extends android.graphics.pdf.PdfDocument {
    ctor public PrintedPdfDocument(android.content.Context, android.print.PrintAttributes);
    method public android.graphics.Rect getPageContentRect();
    method public int getPageHeight();
    method public int getPageWidth();
    method public android.graphics.pdf.PdfDocument.Page startPage(int);
  }

}

package android.printservice {

  public final class CustomPrinterIconCallback {
    method public boolean onCustomPrinterIconLoaded(android.graphics.drawable.Icon);
  }

  public final class PrintDocument {
    method public android.os.ParcelFileDescriptor getData();
    method public android.print.PrintDocumentInfo getInfo();
  }

  public final class PrintJob {
    method public boolean block(java.lang.String);
    method public boolean cancel();
    method public boolean complete();
    method public boolean fail(java.lang.String);
    method public int getAdvancedIntOption(java.lang.String);
    method public java.lang.String getAdvancedStringOption(java.lang.String);
    method public android.printservice.PrintDocument getDocument();
    method public android.print.PrintJobId getId();
    method public android.print.PrintJobInfo getInfo();
    method public java.lang.String getTag();
    method public boolean hasAdvancedOption(java.lang.String);
    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 setProgress(float);
    method public void setStatus(java.lang.CharSequence);
    method public void setStatus(int);
    method public boolean setTag(java.lang.String);
    method public boolean start();
  }

  public abstract class PrintService extends android.app.Service {
    ctor public PrintService();
    method protected final void attachBaseContext(android.content.Context);
    method public final android.print.PrinterId generatePrinterId(java.lang.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 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 java.lang.String EXTRA_CAN_SELECT_PRINTER = "android.printservice.extra.CAN_SELECT_PRINTER";
    field public static final java.lang.String EXTRA_PRINTER_INFO = "android.intent.extra.print.EXTRA_PRINTER_INFO";
    field public static final java.lang.String EXTRA_PRINT_DOCUMENT_INFO = "android.printservice.extra.PRINT_DOCUMENT_INFO";
    field public static final java.lang.String EXTRA_PRINT_JOB_INFO = "android.intent.extra.print.PRINT_JOB_INFO";
    field public static final java.lang.String EXTRA_SELECT_PRINTER = "android.printservice.extra.SELECT_PRINTER";
    field public static final java.lang.String SERVICE_INTERFACE = "android.printservice.PrintService";
    field public static final java.lang.String SERVICE_META_DATA = "android.printservice";
  }

  public abstract class PrinterDiscoverySession {
    ctor public PrinterDiscoverySession();
    method public final void addPrinters(java.util.List<android.print.PrinterInfo>);
    method public final java.util.List<android.print.PrinterInfo> getPrinters();
    method 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(android.print.PrinterId, android.os.CancellationSignal, android.printservice.CustomPrinterIconCallback);
    method public abstract void onStartPrinterDiscovery(java.util.List<android.print.PrinterId>);
    method public abstract void onStartPrinterStateTracking(android.print.PrinterId);
    method public abstract void onStopPrinterDiscovery();
    method public abstract void onStopPrinterStateTracking(android.print.PrinterId);
    method public abstract void onValidatePrinters(java.util.List<android.print.PrinterId>);
    method public final void removePrinters(java.util.List<android.print.PrinterId>);
  }

}

package android.provider {

  public final class AlarmClock {
    ctor public AlarmClock();
    field public static final java.lang.String ACTION_DISMISS_ALARM = "android.intent.action.DISMISS_ALARM";
    field public static final java.lang.String ACTION_DISMISS_TIMER = "android.intent.action.DISMISS_TIMER";
    field public static final java.lang.String ACTION_SET_ALARM = "android.intent.action.SET_ALARM";
    field public static final java.lang.String ACTION_SET_TIMER = "android.intent.action.SET_TIMER";
    field public static final java.lang.String ACTION_SHOW_ALARMS = "android.intent.action.SHOW_ALARMS";
    field public static final java.lang.String ACTION_SHOW_TIMERS = "android.intent.action.SHOW_TIMERS";
    field public static final java.lang.String ACTION_SNOOZE_ALARM = "android.intent.action.SNOOZE_ALARM";
    field public static final java.lang.String ALARM_SEARCH_MODE_ALL = "android.all";
    field public static final java.lang.String ALARM_SEARCH_MODE_LABEL = "android.label";
    field public static final java.lang.String ALARM_SEARCH_MODE_NEXT = "android.next";
    field public static final java.lang.String ALARM_SEARCH_MODE_TIME = "android.time";
    field public static final java.lang.String EXTRA_ALARM_SEARCH_MODE = "android.intent.extra.alarm.SEARCH_MODE";
    field public static final java.lang.String EXTRA_ALARM_SNOOZE_DURATION = "android.intent.extra.alarm.SNOOZE_DURATION";
    field public static final java.lang.String EXTRA_DAYS = "android.intent.extra.alarm.DAYS";
    field public static final java.lang.String EXTRA_HOUR = "android.intent.extra.alarm.HOUR";
    field public static final java.lang.String EXTRA_IS_PM = "android.intent.extra.alarm.IS_PM";
    field public static final java.lang.String EXTRA_LENGTH = "android.intent.extra.alarm.LENGTH";
    field public static final java.lang.String EXTRA_MESSAGE = "android.intent.extra.alarm.MESSAGE";
    field public static final java.lang.String EXTRA_MINUTES = "android.intent.extra.alarm.MINUTES";
    field public static final java.lang.String EXTRA_RINGTONE = "android.intent.extra.alarm.RINGTONE";
    field public static final java.lang.String EXTRA_SKIP_UI = "android.intent.extra.alarm.SKIP_UI";
    field public static final java.lang.String EXTRA_VIBRATE = "android.intent.extra.alarm.VIBRATE";
    field public static final java.lang.String VALUE_RINGTONE_SILENT = "silent";
  }

  public abstract interface BaseColumns {
    field public static final java.lang.String _COUNT = "_count";
    field public static final java.lang.String _ID = "_id";
  }

  public class BlockedNumberContract {
    method public static boolean canCurrentUserBlockNumbers(android.content.Context);
    method public static boolean isBlocked(android.content.Context, java.lang.String);
    method public static int unblock(android.content.Context, java.lang.String);
    field public static final java.lang.String AUTHORITY = "com.android.blockednumber";
    field public static final android.net.Uri AUTHORITY_URI;
  }

  public static class BlockedNumberContract.BlockedNumbers {
    field public static final java.lang.String COLUMN_E164_NUMBER = "e164_number";
    field public static final java.lang.String COLUMN_ID = "_id";
    field public static final java.lang.String COLUMN_ORIGINAL_NUMBER = "original_number";
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/blocked_number";
    field public static final java.lang.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, java.lang.String);
    field public static final java.lang.String EXTRA_APPLICATION_ID = "com.android.browser.application_id";
    field public static final java.lang.String EXTRA_CREATE_NEW_TAB = "create_new_tab";
    field public static final java.lang.String EXTRA_HEADERS = "com.android.browser.headers";
    field public static final java.lang.String INITIAL_ZOOM_LEVEL = "browser.initialZoomLevel";
  }

  public final class CalendarContract {
    field public static final java.lang.String ACCOUNT_TYPE_LOCAL = "LOCAL";
    field public static final java.lang.String ACTION_EVENT_REMINDER = "android.intent.action.EVENT_REMINDER";
    field public static final java.lang.String ACTION_HANDLE_CUSTOM_EVENT = "android.provider.calendar.action.HANDLE_CUSTOM_EVENT";
    field public static final java.lang.String AUTHORITY = "com.android.calendar";
    field public static final java.lang.String CALLER_IS_SYNCADAPTER = "caller_is_syncadapter";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String EXTRA_CUSTOM_APP_URI = "customAppUri";
    field public static final java.lang.String EXTRA_EVENT_ALL_DAY = "allDay";
    field public static final java.lang.String EXTRA_EVENT_BEGIN_TIME = "beginTime";
    field public static final java.lang.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, java.lang.String[]);
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static abstract interface CalendarContract.AttendeesColumns {
    field public static final java.lang.String ATTENDEE_EMAIL = "attendeeEmail";
    field public static final java.lang.String ATTENDEE_IDENTITY = "attendeeIdentity";
    field public static final java.lang.String ATTENDEE_ID_NAMESPACE = "attendeeIdNamespace";
    field public static final java.lang.String ATTENDEE_NAME = "attendeeName";
    field public static final java.lang.String ATTENDEE_RELATIONSHIP = "attendeeRelationship";
    field public static final java.lang.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 java.lang.String ATTENDEE_TYPE = "attendeeType";
    field public static final java.lang.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 abstract interface CalendarContract.CalendarAlertsColumns {
    field public static final java.lang.String ALARM_TIME = "alarmTime";
    field public static final java.lang.String BEGIN = "begin";
    field public static final java.lang.String CREATION_TIME = "creationTime";
    field public static final java.lang.String DEFAULT_SORT_ORDER = "begin ASC,title ASC";
    field public static final java.lang.String END = "end";
    field public static final java.lang.String EVENT_ID = "event_id";
    field public static final java.lang.String MINUTES = "minutes";
    field public static final java.lang.String NOTIFY_TIME = "notifyTime";
    field public static final java.lang.String RECEIVED_TIME = "receivedTime";
    field public static final java.lang.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 java.lang.String KEY_TIMEZONE_INSTANCES = "timezoneInstances";
    field public static final java.lang.String KEY_TIMEZONE_INSTANCES_PREVIOUS = "timezoneInstancesPrevious";
    field public static final java.lang.String KEY_TIMEZONE_TYPE = "timezoneType";
    field public static final java.lang.String TIMEZONE_TYPE_AUTO = "auto";
    field public static final java.lang.String TIMEZONE_TYPE_HOME = "home";
    field public static final android.net.Uri URI;
  }

  protected static abstract interface CalendarContract.CalendarCacheColumns {
    field public static final java.lang.String KEY = "key";
    field public static final java.lang.String VALUE = "value";
  }

  protected static abstract interface CalendarContract.CalendarColumns {
    field public static final java.lang.String ALLOWED_ATTENDEE_TYPES = "allowedAttendeeTypes";
    field public static final java.lang.String ALLOWED_AVAILABILITY = "allowedAvailability";
    field public static final java.lang.String ALLOWED_REMINDERS = "allowedReminders";
    field public static final java.lang.String CALENDAR_ACCESS_LEVEL = "calendar_access_level";
    field public static final java.lang.String CALENDAR_COLOR = "calendar_color";
    field public static final java.lang.String CALENDAR_COLOR_KEY = "calendar_color_index";
    field public static final java.lang.String CALENDAR_DISPLAY_NAME = "calendar_displayName";
    field public static final java.lang.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 java.lang.String CAN_MODIFY_TIME_ZONE = "canModifyTimeZone";
    field public static final java.lang.String CAN_ORGANIZER_RESPOND = "canOrganizerRespond";
    field public static final java.lang.String IS_PRIMARY = "isPrimary";
    field public static final java.lang.String MAX_REMINDERS = "maxReminders";
    field public static final java.lang.String OWNER_ACCOUNT = "ownerAccount";
    field public static final java.lang.String SYNC_EVENTS = "sync_events";
    field public static final java.lang.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 abstract interface CalendarContract.CalendarSyncColumns {
    field public static final java.lang.String CAL_SYNC1 = "cal_sync1";
    field public static final java.lang.String CAL_SYNC10 = "cal_sync10";
    field public static final java.lang.String CAL_SYNC2 = "cal_sync2";
    field public static final java.lang.String CAL_SYNC3 = "cal_sync3";
    field public static final java.lang.String CAL_SYNC4 = "cal_sync4";
    field public static final java.lang.String CAL_SYNC5 = "cal_sync5";
    field public static final java.lang.String CAL_SYNC6 = "cal_sync6";
    field public static final java.lang.String CAL_SYNC7 = "cal_sync7";
    field public static final java.lang.String CAL_SYNC8 = "cal_sync8";
    field public static final java.lang.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 java.lang.String CALENDAR_LOCATION = "calendar_location";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String DEFAULT_SORT_ORDER = "calendar_displayName";
    field public static final java.lang.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 abstract interface CalendarContract.ColorsColumns implements android.provider.SyncStateContract.Columns {
    field public static final java.lang.String COLOR = "color";
    field public static final java.lang.String COLOR_KEY = "color_index";
    field public static final java.lang.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, java.lang.String[]);
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static abstract interface CalendarContract.EventDaysColumns {
    field public static final java.lang.String ENDDAY = "endDay";
    field public static final java.lang.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 abstract 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 java.lang.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 java.lang.String ALL_DAY = "allDay";
    field public static final java.lang.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 java.lang.String CALENDAR_ID = "calendar_id";
    field public static final java.lang.String CAN_INVITE_OTHERS = "canInviteOthers";
    field public static final java.lang.String CUSTOM_APP_PACKAGE = "customAppPackage";
    field public static final java.lang.String CUSTOM_APP_URI = "customAppUri";
    field public static final java.lang.String DESCRIPTION = "description";
    field public static final java.lang.String DISPLAY_COLOR = "displayColor";
    field public static final java.lang.String DTEND = "dtend";
    field public static final java.lang.String DTSTART = "dtstart";
    field public static final java.lang.String DURATION = "duration";
    field public static final java.lang.String EVENT_COLOR = "eventColor";
    field public static final java.lang.String EVENT_COLOR_KEY = "eventColor_index";
    field public static final java.lang.String EVENT_END_TIMEZONE = "eventEndTimezone";
    field public static final java.lang.String EVENT_LOCATION = "eventLocation";
    field public static final java.lang.String EVENT_TIMEZONE = "eventTimezone";
    field public static final java.lang.String EXDATE = "exdate";
    field public static final java.lang.String EXRULE = "exrule";
    field public static final java.lang.String GUESTS_CAN_INVITE_OTHERS = "guestsCanInviteOthers";
    field public static final java.lang.String GUESTS_CAN_MODIFY = "guestsCanModify";
    field public static final java.lang.String GUESTS_CAN_SEE_GUESTS = "guestsCanSeeGuests";
    field public static final java.lang.String HAS_ALARM = "hasAlarm";
    field public static final java.lang.String HAS_ATTENDEE_DATA = "hasAttendeeData";
    field public static final java.lang.String HAS_EXTENDED_PROPERTIES = "hasExtendedProperties";
    field public static final java.lang.String IS_ORGANIZER = "isOrganizer";
    field public static final java.lang.String LAST_DATE = "lastDate";
    field public static final java.lang.String LAST_SYNCED = "lastSynced";
    field public static final java.lang.String ORGANIZER = "organizer";
    field public static final java.lang.String ORIGINAL_ALL_DAY = "originalAllDay";
    field public static final java.lang.String ORIGINAL_ID = "original_id";
    field public static final java.lang.String ORIGINAL_INSTANCE_TIME = "originalInstanceTime";
    field public static final java.lang.String ORIGINAL_SYNC_ID = "original_sync_id";
    field public static final java.lang.String RDATE = "rdate";
    field public static final java.lang.String RRULE = "rrule";
    field public static final java.lang.String SELF_ATTENDEE_STATUS = "selfAttendeeStatus";
    field public static final java.lang.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 java.lang.String SYNC_DATA1 = "sync_data1";
    field public static final java.lang.String SYNC_DATA10 = "sync_data10";
    field public static final java.lang.String SYNC_DATA2 = "sync_data2";
    field public static final java.lang.String SYNC_DATA3 = "sync_data3";
    field public static final java.lang.String SYNC_DATA4 = "sync_data4";
    field public static final java.lang.String SYNC_DATA5 = "sync_data5";
    field public static final java.lang.String SYNC_DATA6 = "sync_data6";
    field public static final java.lang.String SYNC_DATA7 = "sync_data7";
    field public static final java.lang.String SYNC_DATA8 = "sync_data8";
    field public static final java.lang.String SYNC_DATA9 = "sync_data9";
    field public static final java.lang.String TITLE = "title";
    field public static final java.lang.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 abstract interface CalendarContract.ExtendedPropertiesColumns {
    field public static final java.lang.String EVENT_ID = "event_id";
    field public static final java.lang.String NAME = "name";
    field public static final java.lang.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, java.lang.String[], long, long);
    method public static android.database.Cursor query(android.content.ContentResolver, java.lang.String[], long, long, java.lang.String);
    field public static final java.lang.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 java.lang.String END = "end";
    field public static final java.lang.String END_DAY = "endDay";
    field public static final java.lang.String END_MINUTE = "endMinute";
    field public static final java.lang.String EVENT_ID = "event_id";
    field public static final java.lang.String START_DAY = "startDay";
    field public static final java.lang.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, java.lang.String[]);
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static abstract interface CalendarContract.RemindersColumns {
    field public static final java.lang.String EVENT_ID = "event_id";
    field public static final java.lang.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 java.lang.String MINUTES = "minutes";
    field public static final int MINUTES_DEFAULT = -1; // 0xffffffff
  }

  protected static abstract interface CalendarContract.SyncColumns implements android.provider.CalendarContract.CalendarSyncColumns {
    field public static final java.lang.String ACCOUNT_NAME = "account_name";
    field public static final java.lang.String ACCOUNT_TYPE = "account_type";
    field public static final java.lang.String CAN_PARTIALLY_UPDATE = "canPartiallyUpdate";
    field public static final java.lang.String DELETED = "deleted";
    field public static final java.lang.String DIRTY = "dirty";
    field public static final java.lang.String MUTATORS = "mutators";
    field public static final java.lang.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 java.lang.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 java.lang.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 java.lang.String CACHED_FORMATTED_NUMBER = "formatted_number";
    field public static final java.lang.String CACHED_LOOKUP_URI = "lookup_uri";
    field public static final java.lang.String CACHED_MATCHED_NUMBER = "matched_number";
    field public static final java.lang.String CACHED_NAME = "name";
    field public static final java.lang.String CACHED_NORMALIZED_NUMBER = "normalized_number";
    field public static final java.lang.String CACHED_NUMBER_LABEL = "numberlabel";
    field public static final java.lang.String CACHED_NUMBER_TYPE = "numbertype";
    field public static final java.lang.String CACHED_PHOTO_ID = "photo_id";
    field public static final java.lang.String CACHED_PHOTO_URI = "photo_uri";
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/calls";
    field public static final java.lang.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 java.lang.String COUNTRY_ISO = "countryiso";
    field public static final java.lang.String DATA_USAGE = "data_usage";
    field public static final java.lang.String DATE = "date";
    field public static final java.lang.String DEFAULT_SORT_ORDER = "date DESC";
    field public static final java.lang.String DURATION = "duration";
    field public static final java.lang.String EXTRA_CALL_TYPE_FILTER = "android.provider.extra.CALL_TYPE_FILTER";
    field public static final java.lang.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 java.lang.String GEOCODED_LOCATION = "geocoded_location";
    field public static final int INCOMING_TYPE = 1; // 0x1
    field public static final java.lang.String IS_READ = "is_read";
    field public static final java.lang.String LAST_MODIFIED = "last_modified";
    field public static final java.lang.String LIMIT_PARAM_KEY = "limit";
    field public static final int MISSED_TYPE = 3; // 0x3
    field public static final java.lang.String NEW = "new";
    field public static final java.lang.String NUMBER = "number";
    field public static final java.lang.String NUMBER_PRESENTATION = "presentation";
    field public static final java.lang.String OFFSET_PARAM_KEY = "offset";
    field public static final int OUTGOING_TYPE = 2; // 0x2
    field public static final java.lang.String PHONE_ACCOUNT_COMPONENT_NAME = "subscription_component_name";
    field public static final java.lang.String PHONE_ACCOUNT_ID = "subscription_id";
    field public static final java.lang.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 java.lang.String TRANSCRIPTION = "transcription";
    field public static final java.lang.String TYPE = "type";
    field public static final java.lang.String VIA_NUMBER = "via_number";
    field public static final int VOICEMAIL_TYPE = 4; // 0x4
    field public static final java.lang.String VOICEMAIL_URI = "voicemail_uri";
  }

  public deprecated class Contacts {
    field public static final deprecated java.lang.String AUTHORITY = "contacts";
    field public static final deprecated android.net.Uri CONTENT_URI;
    field public static final deprecated int KIND_EMAIL = 1; // 0x1
    field public static final deprecated int KIND_IM = 3; // 0x3
    field public static final deprecated int KIND_ORGANIZATION = 4; // 0x4
    field public static final deprecated int KIND_PHONE = 5; // 0x5
    field public static final deprecated int KIND_POSTAL = 2; // 0x2
  }

  public static final deprecated class Contacts.ContactMethods implements android.provider.BaseColumns android.provider.Contacts.ContactMethodsColumns android.provider.Contacts.PeopleColumns {
    method public deprecated void addPostalLocation(android.content.Context, long, double, double);
    method public static deprecated java.lang.Object decodeImProtocol(java.lang.String);
    method public static deprecated java.lang.String encodeCustomImProtocol(java.lang.String);
    method public static deprecated java.lang.String encodePredefinedImProtocol(int);
    method public static deprecated java.lang.CharSequence getDisplayLabel(android.content.Context, int, int, java.lang.CharSequence);
    field public static final deprecated java.lang.String CONTENT_EMAIL_ITEM_TYPE = "vnd.android.cursor.item/email";
    field public static final deprecated java.lang.String CONTENT_EMAIL_TYPE = "vnd.android.cursor.dir/email";
    field public static final deprecated android.net.Uri CONTENT_EMAIL_URI;
    field public static final deprecated java.lang.String CONTENT_IM_ITEM_TYPE = "vnd.android.cursor.item/jabber-im";
    field public static final deprecated java.lang.String CONTENT_POSTAL_ITEM_TYPE = "vnd.android.cursor.item/postal-address";
    field public static final deprecated java.lang.String CONTENT_POSTAL_TYPE = "vnd.android.cursor.dir/postal-address";
    field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/contact-methods";
    field public static final deprecated android.net.Uri CONTENT_URI;
    field public static final deprecated java.lang.String DEFAULT_SORT_ORDER = "name ASC";
    field public static final deprecated java.lang.String PERSON_ID = "person";
    field public static final deprecated java.lang.String POSTAL_LOCATION_LATITUDE = "data";
    field public static final deprecated java.lang.String POSTAL_LOCATION_LONGITUDE = "aux_data";
    field public static final deprecated int PROTOCOL_AIM = 0; // 0x0
    field public static final deprecated int PROTOCOL_GOOGLE_TALK = 5; // 0x5
    field public static final deprecated int PROTOCOL_ICQ = 6; // 0x6
    field public static final deprecated int PROTOCOL_JABBER = 7; // 0x7
    field public static final deprecated int PROTOCOL_MSN = 1; // 0x1
    field public static final deprecated int PROTOCOL_QQ = 4; // 0x4
    field public static final deprecated int PROTOCOL_SKYPE = 3; // 0x3
    field public static final deprecated int PROTOCOL_YAHOO = 2; // 0x2
  }

  public static abstract deprecated interface Contacts.ContactMethodsColumns {
    field public static final deprecated java.lang.String AUX_DATA = "aux_data";
    field public static final deprecated java.lang.String DATA = "data";
    field public static final deprecated java.lang.String ISPRIMARY = "isprimary";
    field public static final deprecated java.lang.String KIND = "kind";
    field public static final deprecated java.lang.String LABEL = "label";
    field public static final deprecated java.lang.String TYPE = "type";
    field public static final deprecated int TYPE_CUSTOM = 0; // 0x0
    field public static final deprecated int TYPE_HOME = 1; // 0x1
    field public static final deprecated int TYPE_OTHER = 3; // 0x3
    field public static final deprecated int TYPE_WORK = 2; // 0x2
  }

  public static final deprecated class Contacts.Extensions implements android.provider.BaseColumns android.provider.Contacts.ExtensionsColumns {
    field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_extensions";
    field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/contact_extensions";
    field public static final deprecated android.net.Uri CONTENT_URI;
    field public static final deprecated java.lang.String DEFAULT_SORT_ORDER = "person, name ASC";
    field public static final deprecated java.lang.String PERSON_ID = "person";
  }

  public static abstract deprecated interface Contacts.ExtensionsColumns {
    field public static final deprecated java.lang.String NAME = "name";
    field public static final deprecated java.lang.String VALUE = "value";
  }

  public static final deprecated class Contacts.GroupMembership implements android.provider.BaseColumns android.provider.Contacts.GroupsColumns {
    field public static final deprecated java.lang.String CONTENT_DIRECTORY = "groupmembership";
    field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contactsgroupmembership";
    field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/contactsgroupmembership";
    field public static final deprecated android.net.Uri CONTENT_URI;
    field public static final deprecated java.lang.String DEFAULT_SORT_ORDER = "group_id ASC";
    field public static final deprecated java.lang.String GROUP_ID = "group_id";
    field public static final deprecated java.lang.String GROUP_SYNC_ACCOUNT = "group_sync_account";
    field public static final deprecated java.lang.String GROUP_SYNC_ACCOUNT_TYPE = "group_sync_account_type";
    field public static final deprecated java.lang.String GROUP_SYNC_ID = "group_sync_id";
    field public static final deprecated java.lang.String PERSON_ID = "person";
    field public static final deprecated android.net.Uri RAW_CONTENT_URI;
  }

  public static final deprecated class Contacts.Groups implements android.provider.BaseColumns android.provider.Contacts.GroupsColumns {
    field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contactsgroup";
    field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/contactsgroup";
    field public static final deprecated android.net.Uri CONTENT_URI;
    field public static final deprecated java.lang.String DEFAULT_SORT_ORDER = "name ASC";
    field public static final deprecated android.net.Uri DELETED_CONTENT_URI;
    field public static final deprecated java.lang.String GROUP_ANDROID_STARRED = "Starred in Android";
    field public static final deprecated java.lang.String GROUP_MY_CONTACTS = "Contacts";
  }

  public static abstract deprecated interface Contacts.GroupsColumns {
    field public static final deprecated java.lang.String NAME = "name";
    field public static final deprecated java.lang.String NOTES = "notes";
    field public static final deprecated java.lang.String SHOULD_SYNC = "should_sync";
    field public static final deprecated java.lang.String SYSTEM_ID = "system_id";
  }

  public static final deprecated class Contacts.Intents {
    ctor public deprecated Contacts.Intents();
    field public static final deprecated java.lang.String ATTACH_IMAGE = "com.android.contacts.action.ATTACH_IMAGE";
    field public static final deprecated java.lang.String EXTRA_CREATE_DESCRIPTION = "com.android.contacts.action.CREATE_DESCRIPTION";
    field public static final deprecated java.lang.String EXTRA_FORCE_CREATE = "com.android.contacts.action.FORCE_CREATE";
    field public static final deprecated java.lang.String SEARCH_SUGGESTION_CLICKED = "android.provider.Contacts.SEARCH_SUGGESTION_CLICKED";
    field public static final deprecated java.lang.String SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED = "android.provider.Contacts.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED";
    field public static final deprecated java.lang.String SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED = "android.provider.Contacts.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED";
    field public static final deprecated java.lang.String SHOW_OR_CREATE_CONTACT = "com.android.contacts.action.SHOW_OR_CREATE_CONTACT";
  }

  public static final deprecated class Contacts.Intents.Insert {
    ctor public deprecated Contacts.Intents.Insert();
    field public static final deprecated java.lang.String ACTION = "android.intent.action.INSERT";
    field public static final deprecated java.lang.String COMPANY = "company";
    field public static final deprecated java.lang.String EMAIL = "email";
    field public static final deprecated java.lang.String EMAIL_ISPRIMARY = "email_isprimary";
    field public static final deprecated java.lang.String EMAIL_TYPE = "email_type";
    field public static final deprecated java.lang.String FULL_MODE = "full_mode";
    field public static final deprecated java.lang.String IM_HANDLE = "im_handle";
    field public static final deprecated java.lang.String IM_ISPRIMARY = "im_isprimary";
    field public static final deprecated java.lang.String IM_PROTOCOL = "im_protocol";
    field public static final deprecated java.lang.String JOB_TITLE = "job_title";
    field public static final deprecated java.lang.String NAME = "name";
    field public static final deprecated java.lang.String NOTES = "notes";
    field public static final deprecated java.lang.String PHONE = "phone";
    field public static final deprecated java.lang.String PHONETIC_NAME = "phonetic_name";
    field public static final deprecated java.lang.String PHONE_ISPRIMARY = "phone_isprimary";
    field public static final deprecated java.lang.String PHONE_TYPE = "phone_type";
    field public static final deprecated java.lang.String POSTAL = "postal";
    field public static final deprecated java.lang.String POSTAL_ISPRIMARY = "postal_isprimary";
    field public static final deprecated java.lang.String POSTAL_TYPE = "postal_type";
    field public static final deprecated java.lang.String SECONDARY_EMAIL = "secondary_email";
    field public static final deprecated java.lang.String SECONDARY_EMAIL_TYPE = "secondary_email_type";
    field public static final deprecated java.lang.String SECONDARY_PHONE = "secondary_phone";
    field public static final deprecated java.lang.String SECONDARY_PHONE_TYPE = "secondary_phone_type";
    field public static final deprecated java.lang.String TERTIARY_EMAIL = "tertiary_email";
    field public static final deprecated java.lang.String TERTIARY_EMAIL_TYPE = "tertiary_email_type";
    field public static final deprecated java.lang.String TERTIARY_PHONE = "tertiary_phone";
    field public static final deprecated java.lang.String TERTIARY_PHONE_TYPE = "tertiary_phone_type";
  }

  public static final deprecated class Contacts.Intents.UI {
    ctor public deprecated Contacts.Intents.UI();
    field public static final deprecated java.lang.String FILTER_CONTACTS_ACTION = "com.android.contacts.action.FILTER_CONTACTS";
    field public static final deprecated java.lang.String FILTER_TEXT_EXTRA_KEY = "com.android.contacts.extra.FILTER_TEXT";
    field public static final deprecated java.lang.String GROUP_NAME_EXTRA_KEY = "com.android.contacts.extra.GROUP";
    field public static final deprecated java.lang.String LIST_ALL_CONTACTS_ACTION = "com.android.contacts.action.LIST_ALL_CONTACTS";
    field public static final deprecated java.lang.String LIST_CONTACTS_WITH_PHONES_ACTION = "com.android.contacts.action.LIST_CONTACTS_WITH_PHONES";
    field public static final deprecated java.lang.String LIST_DEFAULT = "com.android.contacts.action.LIST_DEFAULT";
    field public static final deprecated java.lang.String LIST_FREQUENT_ACTION = "com.android.contacts.action.LIST_FREQUENT";
    field public static final deprecated java.lang.String LIST_GROUP_ACTION = "com.android.contacts.action.LIST_GROUP";
    field public static final deprecated java.lang.String LIST_STARRED_ACTION = "com.android.contacts.action.LIST_STARRED";
    field public static final deprecated java.lang.String LIST_STREQUENT_ACTION = "com.android.contacts.action.LIST_STREQUENT";
    field public static final deprecated java.lang.String TITLE_EXTRA_KEY = "com.android.contacts.extra.TITLE_EXTRA";
  }

  public static abstract deprecated interface Contacts.OrganizationColumns {
    field public static final deprecated java.lang.String COMPANY = "company";
    field public static final deprecated java.lang.String ISPRIMARY = "isprimary";
    field public static final deprecated java.lang.String LABEL = "label";
    field public static final deprecated java.lang.String PERSON_ID = "person";
    field public static final deprecated java.lang.String TITLE = "title";
    field public static final deprecated java.lang.String TYPE = "type";
    field public static final deprecated int TYPE_CUSTOM = 0; // 0x0
    field public static final deprecated int TYPE_OTHER = 2; // 0x2
    field public static final deprecated int TYPE_WORK = 1; // 0x1
  }

  public static final deprecated class Contacts.Organizations implements android.provider.BaseColumns android.provider.Contacts.OrganizationColumns {
    method public static deprecated java.lang.CharSequence getDisplayLabel(android.content.Context, int, java.lang.CharSequence);
    field public static final deprecated java.lang.String CONTENT_DIRECTORY = "organizations";
    field public static final deprecated android.net.Uri CONTENT_URI;
    field public static final deprecated java.lang.String DEFAULT_SORT_ORDER = "company, title, isprimary ASC";
  }

  public static final deprecated class Contacts.People implements android.provider.BaseColumns android.provider.Contacts.PeopleColumns android.provider.Contacts.PhonesColumns android.provider.Contacts.PresenceColumns {
    method public static deprecated android.net.Uri addToGroup(android.content.ContentResolver, long, java.lang.String);
    method public static deprecated android.net.Uri addToGroup(android.content.ContentResolver, long, long);
    method public static deprecated android.net.Uri addToMyContactsGroup(android.content.ContentResolver, long);
    method public static deprecated android.net.Uri createPersonInMyContactsGroup(android.content.ContentResolver, android.content.ContentValues);
    method public static deprecated android.graphics.Bitmap loadContactPhoto(android.content.Context, android.net.Uri, int, android.graphics.BitmapFactory.Options);
    method public static deprecated void markAsContacted(android.content.ContentResolver, long);
    method public static deprecated java.io.InputStream openContactPhotoInputStream(android.content.ContentResolver, android.net.Uri);
    method public static deprecated android.database.Cursor queryGroups(android.content.ContentResolver, long);
    method public static deprecated void setPhotoData(android.content.ContentResolver, android.net.Uri, byte[]);
    field public static final deprecated android.net.Uri CONTENT_FILTER_URI;
    field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/person";
    field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/person";
    field public static final deprecated android.net.Uri CONTENT_URI;
    field public static final deprecated java.lang.String DEFAULT_SORT_ORDER = "name ASC";
    field public static final deprecated android.net.Uri DELETED_CONTENT_URI;
    field public static final deprecated java.lang.String PRIMARY_EMAIL_ID = "primary_email";
    field public static final deprecated java.lang.String PRIMARY_ORGANIZATION_ID = "primary_organization";
    field public static final deprecated java.lang.String PRIMARY_PHONE_ID = "primary_phone";
  }

  public static final deprecated class Contacts.People.ContactMethods implements android.provider.BaseColumns android.provider.Contacts.ContactMethodsColumns android.provider.Contacts.PeopleColumns {
    field public static final deprecated java.lang.String CONTENT_DIRECTORY = "contact_methods";
    field public static final deprecated java.lang.String DEFAULT_SORT_ORDER = "data ASC";
  }

  public static deprecated class Contacts.People.Extensions implements android.provider.BaseColumns android.provider.Contacts.ExtensionsColumns {
    field public static final deprecated java.lang.String CONTENT_DIRECTORY = "extensions";
    field public static final deprecated java.lang.String DEFAULT_SORT_ORDER = "name ASC";
    field public static final deprecated java.lang.String PERSON_ID = "person";
  }

  public static final deprecated class Contacts.People.Phones implements android.provider.BaseColumns android.provider.Contacts.PeopleColumns android.provider.Contacts.PhonesColumns {
    field public static final deprecated java.lang.String CONTENT_DIRECTORY = "phones";
    field public static final deprecated java.lang.String DEFAULT_SORT_ORDER = "number ASC";
  }

  public static abstract deprecated interface Contacts.PeopleColumns {
    field public static final deprecated java.lang.String CUSTOM_RINGTONE = "custom_ringtone";
    field public static final deprecated java.lang.String DISPLAY_NAME = "display_name";
    field public static final deprecated java.lang.String LAST_TIME_CONTACTED = "last_time_contacted";
    field public static final deprecated java.lang.String NAME = "name";
    field public static final deprecated java.lang.String NOTES = "notes";
    field public static final deprecated java.lang.String PHONETIC_NAME = "phonetic_name";
    field public static final deprecated java.lang.String PHOTO_VERSION = "photo_version";
    field public static final deprecated java.lang.String SEND_TO_VOICEMAIL = "send_to_voicemail";
    field public static final deprecated java.lang.String STARRED = "starred";
    field public static final deprecated java.lang.String TIMES_CONTACTED = "times_contacted";
  }

  public static final deprecated class Contacts.Phones implements android.provider.BaseColumns android.provider.Contacts.PeopleColumns android.provider.Contacts.PhonesColumns {
    method public static deprecated java.lang.CharSequence getDisplayLabel(android.content.Context, int, java.lang.CharSequence, java.lang.CharSequence[]);
    method public static deprecated java.lang.CharSequence getDisplayLabel(android.content.Context, int, java.lang.CharSequence);
    field public static final deprecated android.net.Uri CONTENT_FILTER_URL;
    field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone";
    field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/phone";
    field public static final deprecated android.net.Uri CONTENT_URI;
    field public static final deprecated java.lang.String DEFAULT_SORT_ORDER = "name ASC";
    field public static final deprecated java.lang.String PERSON_ID = "person";
  }

  public static abstract deprecated interface Contacts.PhonesColumns {
    field public static final deprecated java.lang.String ISPRIMARY = "isprimary";
    field public static final deprecated java.lang.String LABEL = "label";
    field public static final deprecated java.lang.String NUMBER = "number";
    field public static final deprecated java.lang.String NUMBER_KEY = "number_key";
    field public static final deprecated java.lang.String TYPE = "type";
    field public static final deprecated int TYPE_CUSTOM = 0; // 0x0
    field public static final deprecated int TYPE_FAX_HOME = 5; // 0x5
    field public static final deprecated int TYPE_FAX_WORK = 4; // 0x4
    field public static final deprecated int TYPE_HOME = 1; // 0x1
    field public static final deprecated int TYPE_MOBILE = 2; // 0x2
    field public static final deprecated int TYPE_OTHER = 7; // 0x7
    field public static final deprecated int TYPE_PAGER = 6; // 0x6
    field public static final deprecated int TYPE_WORK = 3; // 0x3
  }

  public static final deprecated class Contacts.Photos implements android.provider.BaseColumns android.provider.Contacts.PhotosColumns {
    field public static final deprecated java.lang.String CONTENT_DIRECTORY = "photo";
    field public static final deprecated android.net.Uri CONTENT_URI;
    field public static final deprecated java.lang.String DEFAULT_SORT_ORDER = "person ASC";
  }

  public static abstract deprecated interface Contacts.PhotosColumns {
    field public static final deprecated java.lang.String DATA = "data";
    field public static final deprecated java.lang.String DOWNLOAD_REQUIRED = "download_required";
    field public static final deprecated java.lang.String EXISTS_ON_SERVER = "exists_on_server";
    field public static final deprecated java.lang.String LOCAL_VERSION = "local_version";
    field public static final deprecated java.lang.String PERSON_ID = "person";
    field public static final deprecated java.lang.String SYNC_ERROR = "sync_error";
  }

  public static abstract deprecated interface Contacts.PresenceColumns {
    field public static final int AVAILABLE = 5; // 0x5
    field public static final int AWAY = 2; // 0x2
    field public static final int DO_NOT_DISTURB = 4; // 0x4
    field public static final int IDLE = 3; // 0x3
    field public static final deprecated java.lang.String IM_ACCOUNT = "im_account";
    field public static final deprecated java.lang.String IM_HANDLE = "im_handle";
    field public static final deprecated java.lang.String IM_PROTOCOL = "im_protocol";
    field public static final int INVISIBLE = 1; // 0x1
    field public static final int OFFLINE = 0; // 0x0
    field public static final java.lang.String PRESENCE_CUSTOM_STATUS = "status";
    field public static final java.lang.String PRESENCE_STATUS = "mode";
    field public static final java.lang.String PRIORITY = "priority";
  }

  public static final deprecated class Contacts.Settings implements android.provider.BaseColumns android.provider.Contacts.SettingsColumns {
    method public static deprecated java.lang.String getSetting(android.content.ContentResolver, java.lang.String, java.lang.String);
    method public static deprecated void setSetting(android.content.ContentResolver, java.lang.String, java.lang.String, java.lang.String);
    field public static final deprecated java.lang.String CONTENT_DIRECTORY = "settings";
    field public static final deprecated android.net.Uri CONTENT_URI;
    field public static final deprecated java.lang.String DEFAULT_SORT_ORDER = "key ASC";
    field public static final deprecated java.lang.String SYNC_EVERYTHING = "syncEverything";
  }

  public static abstract deprecated interface Contacts.SettingsColumns {
    field public static final deprecated java.lang.String KEY = "key";
    field public static final deprecated java.lang.String VALUE = "value";
    field public static final deprecated java.lang.String _SYNC_ACCOUNT = "_sync_account";
    field public static final deprecated java.lang.String _SYNC_ACCOUNT_TYPE = "_sync_account_type";
  }

  public final class ContactsContract {
    ctor public ContactsContract();
    method public static boolean isProfileId(long);
    field public static final java.lang.String AUTHORITY = "com.android.contacts";
    field public static final android.net.Uri AUTHORITY_URI;
    field public static final java.lang.String CALLER_IS_SYNCADAPTER = "caller_is_syncadapter";
    field public static final java.lang.String DEFERRED_SNIPPETING = "deferred_snippeting";
    field public static final java.lang.String DEFERRED_SNIPPETING_QUERY = "deferred_snippeting_query";
    field public static final java.lang.String DIRECTORY_PARAM_KEY = "directory";
    field public static final java.lang.String LIMIT_PARAM_KEY = "limit";
    field public static final java.lang.String PRIMARY_ACCOUNT_NAME = "name_for_primary_account";
    field public static final java.lang.String PRIMARY_ACCOUNT_TYPE = "type_for_primary_account";
    field public static final java.lang.String REMOVE_DUPLICATE_ENTRIES = "remove_duplicate_entries";
    field public static final java.lang.String STREQUENT_PHONE_ONLY = "strequent_phone_only";
  }

  public static final class ContactsContract.AggregationExceptions implements android.provider.BaseColumns {
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/aggregation_exception";
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/aggregation_exception";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String RAW_CONTACT_ID1 = "raw_contact_id1";
    field public static final java.lang.String RAW_CONTACT_ID2 = "raw_contact_id2";
    field public static final java.lang.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 abstract interface ContactsContract.BaseSyncColumns {
    field public static final java.lang.String SYNC1 = "sync1";
    field public static final java.lang.String SYNC2 = "sync2";
    field public static final java.lang.String SYNC3 = "sync3";
    field public static final java.lang.String SYNC4 = "sync4";
  }

  public static final class ContactsContract.CommonDataKinds {
  }

  public static abstract 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 java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
  }

  protected static abstract interface ContactsContract.CommonDataKinds.CommonColumns implements android.provider.ContactsContract.CommonDataKinds.BaseTypes {
    field public static final java.lang.String DATA = "data1";
    field public static final java.lang.String LABEL = "data3";
    field public static final java.lang.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 java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.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 java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final java.lang.String ADDRESS = "data1";
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/email_v2";
    field public static final android.net.Uri CONTENT_LOOKUP_URI;
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/email_v2";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.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 java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.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 java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static int getTypeResource(java.lang.Integer);
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_event";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.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 java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/group_membership";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.String GROUP_ROW_ID = "data1";
    field public static final java.lang.String GROUP_SOURCE_ID = "group_sourceid";
  }

  public static final class ContactsContract.CommonDataKinds.Identity implements android.provider.ContactsContract.DataColumnsWithJoins {
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/identity";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.String IDENTITY = "data1";
    field public static final java.lang.String NAMESPACE = "data2";
  }

  public static final class ContactsContract.CommonDataKinds.Im implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    method public static java.lang.CharSequence getProtocolLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static int getProtocolLabelResource(int);
    method public static java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im";
    field public static final java.lang.String CUSTOM_PROTOCOL = "data6";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.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 java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/nickname";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.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 public static final deprecated 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 java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/note";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.String NOTE = "data1";
  }

  public static final class ContactsContract.CommonDataKinds.Organization implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    method public static java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final java.lang.String COMPANY = "data1";
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/organization";
    field public static final java.lang.String DEPARTMENT = "data5";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.String JOB_DESCRIPTION = "data6";
    field public static final java.lang.String OFFICE_LOCATION = "data9";
    field public static final java.lang.String PHONETIC_NAME = "data8";
    field public static final java.lang.String PHONETIC_NAME_STYLE = "data10";
    field public static final java.lang.String SYMBOL = "data7";
    field public static final java.lang.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 java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final android.net.Uri CONTENT_FILTER_URI;
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone_v2";
    field public static final java.lang.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 java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.String NORMALIZED_NUMBER = "data4";
    field public static final java.lang.String NUMBER = "data1";
    field public static final java.lang.String SEARCH_DISPLAY_NAME_KEY = "search_display_name";
    field public static final java.lang.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 java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/photo";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.String PHOTO = "data15";
    field public static final java.lang.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 java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/relation";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.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 java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/sip_address";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.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 java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/name";
    field public static final java.lang.String DISPLAY_NAME = "data1";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.String FAMILY_NAME = "data3";
    field public static final java.lang.String FULL_NAME_STYLE = "data10";
    field public static final java.lang.String GIVEN_NAME = "data2";
    field public static final java.lang.String MIDDLE_NAME = "data5";
    field public static final java.lang.String PHONETIC_FAMILY_NAME = "data9";
    field public static final java.lang.String PHONETIC_GIVEN_NAME = "data7";
    field public static final java.lang.String PHONETIC_MIDDLE_NAME = "data8";
    field public static final java.lang.String PHONETIC_NAME_STYLE = "data11";
    field public static final java.lang.String PREFIX = "data4";
    field public static final java.lang.String SUFFIX = "data6";
  }

  public static final class ContactsContract.CommonDataKinds.StructuredPostal implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
    method public static java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static int getTypeLabelResource(int);
    field public static final java.lang.String CITY = "data7";
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/postal-address_v2";
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/postal-address_v2";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String COUNTRY = "data10";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.String FORMATTED_ADDRESS = "data1";
    field public static final java.lang.String NEIGHBORHOOD = "data6";
    field public static final java.lang.String POBOX = "data5";
    field public static final java.lang.String POSTCODE = "data9";
    field public static final java.lang.String REGION = "data8";
    field public static final java.lang.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 java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/website";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.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 java.lang.String URL = "data1";
  }

  protected static abstract interface ContactsContract.ContactNameColumns {
    field public static final java.lang.String DISPLAY_NAME_ALTERNATIVE = "display_name_alt";
    field public static final java.lang.String DISPLAY_NAME_PRIMARY = "display_name";
    field public static final java.lang.String DISPLAY_NAME_SOURCE = "display_name_source";
    field public static final java.lang.String PHONETIC_NAME = "phonetic_name";
    field public static final java.lang.String PHONETIC_NAME_STYLE = "phonetic_name_style";
    field public static final java.lang.String SORT_KEY_ALTERNATIVE = "sort_key_alt";
    field public static final java.lang.String SORT_KEY_PRIMARY = "sort_key";
  }

  protected static abstract interface ContactsContract.ContactOptionsColumns {
    field public static final java.lang.String CUSTOM_RINGTONE = "custom_ringtone";
    field public static final java.lang.String LAST_TIME_CONTACTED = "last_time_contacted";
    field public static final java.lang.String PINNED = "pinned";
    field public static final java.lang.String SEND_TO_VOICEMAIL = "send_to_voicemail";
    field public static final java.lang.String STARRED = "starred";
    field public static final java.lang.String TIMES_CONTACTED = "times_contacted";
  }

  protected static abstract interface ContactsContract.ContactStatusColumns {
    field public static final java.lang.String CONTACT_CHAT_CAPABILITY = "contact_chat_capability";
    field public static final java.lang.String CONTACT_PRESENCE = "contact_presence";
    field public static final java.lang.String CONTACT_STATUS = "contact_status";
    field public static final java.lang.String CONTACT_STATUS_ICON = "contact_status_icon";
    field public static final java.lang.String CONTACT_STATUS_LABEL = "contact_status_label";
    field public static final java.lang.String CONTACT_STATUS_RES_PACKAGE = "contact_status_res_package";
    field public static final java.lang.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, java.lang.String);
    method public static boolean isEnterpriseContactId(long);
    method public static android.net.Uri lookupContact(android.content.ContentResolver, android.net.Uri);
    method public static deprecated 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 java.lang.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 java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/contact";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.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 java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.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 java.lang.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(java.lang.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 java.lang.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 java.lang.String CONTENT_DIRECTORY = "entities";
    field public static final java.lang.String DATA_ID = "data_id";
    field public static final java.lang.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 java.lang.String CONTENT_DIRECTORY = "photo";
    field public static final java.lang.String DISPLAY_PHOTO = "display_photo";
    field public static final java.lang.String PHOTO = "data15";
    field public static final java.lang.String PHOTO_FILE_ID = "data14";
  }

  protected static abstract interface ContactsContract.ContactsColumns {
    field public static final java.lang.String CONTACT_LAST_UPDATED_TIMESTAMP = "contact_last_updated_timestamp";
    field public static final java.lang.String DISPLAY_NAME = "display_name";
    field public static final java.lang.String HAS_PHONE_NUMBER = "has_phone_number";
    field public static final java.lang.String IN_DEFAULT_DIRECTORY = "in_default_directory";
    field public static final java.lang.String IN_VISIBLE_GROUP = "in_visible_group";
    field public static final java.lang.String IS_USER_PROFILE = "is_user_profile";
    field public static final java.lang.String LOOKUP_KEY = "lookup";
    field public static final java.lang.String NAME_RAW_CONTACT_ID = "name_raw_contact_id";
    field public static final java.lang.String PHOTO_FILE_ID = "photo_file_id";
    field public static final java.lang.String PHOTO_ID = "photo_id";
    field public static final java.lang.String PHOTO_THUMBNAIL_URI = "photo_thumb_uri";
    field public static final java.lang.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 java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/data";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
    field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
    field public static final java.lang.String VISIBLE_CONTACTS_ONLY = "visible_contacts_only";
  }

  protected static abstract interface ContactsContract.DataColumns {
    field public static final java.lang.String CARRIER_PRESENCE = "carrier_presence";
    field public static final int CARRIER_PRESENCE_VT_CAPABLE = 1; // 0x1
    field public static final java.lang.String DATA1 = "data1";
    field public static final java.lang.String DATA10 = "data10";
    field public static final java.lang.String DATA11 = "data11";
    field public static final java.lang.String DATA12 = "data12";
    field public static final java.lang.String DATA13 = "data13";
    field public static final java.lang.String DATA14 = "data14";
    field public static final java.lang.String DATA15 = "data15";
    field public static final java.lang.String DATA2 = "data2";
    field public static final java.lang.String DATA3 = "data3";
    field public static final java.lang.String DATA4 = "data4";
    field public static final java.lang.String DATA5 = "data5";
    field public static final java.lang.String DATA6 = "data6";
    field public static final java.lang.String DATA7 = "data7";
    field public static final java.lang.String DATA8 = "data8";
    field public static final java.lang.String DATA9 = "data9";
    field public static final java.lang.String DATA_VERSION = "data_version";
    field public static final java.lang.String IS_PRIMARY = "is_primary";
    field public static final java.lang.String IS_READ_ONLY = "is_read_only";
    field public static final java.lang.String IS_SUPER_PRIMARY = "is_super_primary";
    field public static final java.lang.String MIMETYPE = "mimetype";
    field public static final java.lang.String PREFERRED_PHONE_ACCOUNT_COMPONENT_NAME = "preferred_phone_account_component_name";
    field public static final java.lang.String PREFERRED_PHONE_ACCOUNT_ID = "preferred_phone_account_id";
    field public static final java.lang.String RAW_CONTACT_ID = "raw_contact_id";
    field public static final java.lang.String RES_PACKAGE = "res_package";
    field public static final java.lang.String SYNC1 = "data_sync1";
    field public static final java.lang.String SYNC2 = "data_sync2";
    field public static final java.lang.String SYNC3 = "data_sync3";
    field public static final java.lang.String SYNC4 = "data_sync4";
  }

  protected static abstract interface ContactsContract.DataColumnsWithJoins implements 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 java.lang.String USAGE_TYPE = "type";
    field public static final java.lang.String USAGE_TYPE_CALL = "call";
    field public static final java.lang.String USAGE_TYPE_LONG_TEXT = "long_text";
    field public static final java.lang.String USAGE_TYPE_SHORT_TEXT = "short_text";
  }

  protected static abstract interface ContactsContract.DataUsageStatColumns {
    field public static final java.lang.String LAST_TIME_USED = "last_time_used";
    field public static final java.lang.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 abstract interface ContactsContract.DeletedContactsColumns {
    field public static final java.lang.String CONTACT_DELETED_TIMESTAMP = "contact_deleted_timestamp";
    field public static final java.lang.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 java.lang.String ACCOUNT_NAME = "accountName";
    field public static final java.lang.String ACCOUNT_TYPE = "accountType";
    field public static final java.lang.String CALLER_PACKAGE_PARAM_KEY = "callerPackage";
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_directory";
    field public static final java.lang.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 java.lang.String DIRECTORY_AUTHORITY = "authority";
    field public static final java.lang.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 java.lang.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 java.lang.String PACKAGE_NAME = "packageName";
    field public static final java.lang.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 java.lang.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 java.lang.String TYPE_RESOURCE_ID = "typeResourceId";
  }

  public static abstract 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 java.lang.String DISPLAY_MAX_DIM = "display_max_dim";
    field public static final java.lang.String THUMBNAIL_MAX_DIM = "thumbnail_max_dim";
  }

  public static abstract 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 java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/group";
    field public static final android.net.Uri CONTENT_SUMMARY_URI;
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/group";
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static abstract interface ContactsContract.GroupsColumns {
    field public static final java.lang.String AUTO_ADD = "auto_add";
    field public static final java.lang.String DATA_SET = "data_set";
    field public static final java.lang.String DELETED = "deleted";
    field public static final java.lang.String FAVORITES = "favorites";
    field public static final java.lang.String GROUP_IS_READ_ONLY = "group_is_read_only";
    field public static final java.lang.String GROUP_VISIBLE = "group_visible";
    field public static final java.lang.String NOTES = "notes";
    field public static final java.lang.String RES_PACKAGE = "res_package";
    field public static final java.lang.String SHOULD_SYNC = "should_sync";
    field public static final java.lang.String SUMMARY_COUNT = "summ_count";
    field public static final java.lang.String SUMMARY_WITH_PHONES = "summ_phones";
    field public static final java.lang.String SYSTEM_ID = "system_id";
    field public static final java.lang.String TITLE = "title";
    field public static final java.lang.String TITLE_RES = "title_res";
  }

  public static final class ContactsContract.Intents {
    ctor public ContactsContract.Intents();
    field public static final java.lang.String ACTION_VOICE_SEND_MESSAGE_TO_CONTACTS = "android.provider.action.VOICE_SEND_MESSAGE_TO_CONTACTS";
    field public static final java.lang.String ATTACH_IMAGE = "com.android.contacts.action.ATTACH_IMAGE";
    field public static final java.lang.String CONTACTS_DATABASE_CREATED = "android.provider.Contacts.DATABASE_CREATED";
    field public static final java.lang.String EXTRA_CREATE_DESCRIPTION = "com.android.contacts.action.CREATE_DESCRIPTION";
    field public static final java.lang.String EXTRA_FORCE_CREATE = "com.android.contacts.action.FORCE_CREATE";
    field public static final java.lang.String EXTRA_RECIPIENT_CONTACT_CHAT_ID = "android.provider.extra.RECIPIENT_CONTACT_CHAT_ID";
    field public static final java.lang.String EXTRA_RECIPIENT_CONTACT_NAME = "android.provider.extra.RECIPIENT_CONTACT_NAME";
    field public static final java.lang.String EXTRA_RECIPIENT_CONTACT_URI = "android.provider.extra.RECIPIENT_CONTACT_URI";
    field public static final java.lang.String INVITE_CONTACT = "com.android.contacts.action.INVITE_CONTACT";
    field public static final java.lang.String METADATA_ACCOUNT_TYPE = "android.provider.account_type";
    field public static final java.lang.String METADATA_MIMETYPE = "android.provider.mimetype";
    field public static final java.lang.String SEARCH_SUGGESTION_CLICKED = "android.provider.Contacts.SEARCH_SUGGESTION_CLICKED";
    field public static final java.lang.String SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED = "android.provider.Contacts.SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED";
    field public static final java.lang.String SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED = "android.provider.Contacts.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED";
    field public static final java.lang.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 java.lang.String ACTION = "android.intent.action.INSERT";
    field public static final java.lang.String COMPANY = "company";
    field public static final java.lang.String DATA = "data";
    field public static final java.lang.String EMAIL = "email";
    field public static final java.lang.String EMAIL_ISPRIMARY = "email_isprimary";
    field public static final java.lang.String EMAIL_TYPE = "email_type";
    field public static final java.lang.String EXTRA_ACCOUNT = "android.provider.extra.ACCOUNT";
    field public static final java.lang.String EXTRA_DATA_SET = "android.provider.extra.DATA_SET";
    field public static final java.lang.String FULL_MODE = "full_mode";
    field public static final java.lang.String IM_HANDLE = "im_handle";
    field public static final java.lang.String IM_ISPRIMARY = "im_isprimary";
    field public static final java.lang.String IM_PROTOCOL = "im_protocol";
    field public static final java.lang.String JOB_TITLE = "job_title";
    field public static final java.lang.String NAME = "name";
    field public static final java.lang.String NOTES = "notes";
    field public static final java.lang.String PHONE = "phone";
    field public static final java.lang.String PHONETIC_NAME = "phonetic_name";
    field public static final java.lang.String PHONE_ISPRIMARY = "phone_isprimary";
    field public static final java.lang.String PHONE_TYPE = "phone_type";
    field public static final java.lang.String POSTAL = "postal";
    field public static final java.lang.String POSTAL_ISPRIMARY = "postal_isprimary";
    field public static final java.lang.String POSTAL_TYPE = "postal_type";
    field public static final java.lang.String SECONDARY_EMAIL = "secondary_email";
    field public static final java.lang.String SECONDARY_EMAIL_TYPE = "secondary_email_type";
    field public static final java.lang.String SECONDARY_PHONE = "secondary_phone";
    field public static final java.lang.String SECONDARY_PHONE_TYPE = "secondary_phone_type";
    field public static final java.lang.String TERTIARY_EMAIL = "tertiary_email";
    field public static final java.lang.String TERTIARY_EMAIL_TYPE = "tertiary_email_type";
    field public static final java.lang.String TERTIARY_PHONE = "tertiary_phone";
    field public static final java.lang.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 java.lang.String QUERY_PARAMETER_SIP_ADDRESS = "sip";
  }

  protected static abstract interface ContactsContract.PhoneLookupColumns {
    field public static final java.lang.String CONTACT_ID = "contact_id";
    field public static final java.lang.String DATA_ID = "data_id";
    field public static final java.lang.String LABEL = "label";
    field public static final java.lang.String NORMALIZED_NUMBER = "normalized_number";
    field public static final java.lang.String NUMBER = "number";
    field public static final java.lang.String TYPE = "type";
  }

  public static abstract 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
  }

  public static final deprecated class ContactsContract.Presence extends android.provider.ContactsContract.StatusUpdates {
    ctor public ContactsContract.Presence();
  }

  protected static abstract interface ContactsContract.PresenceColumns {
    field public static final java.lang.String CUSTOM_PROTOCOL = "custom_protocol";
    field public static final java.lang.String DATA_ID = "presence_data_id";
    field public static final java.lang.String IM_ACCOUNT = "im_account";
    field public static final java.lang.String IM_HANDLE = "im_handle";
    field public static final java.lang.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 java.lang.String CONTENT_DIRECTORY = "syncstate";
    field public static final android.net.Uri CONTENT_URI;
  }

  public static final class ContactsContract.ProviderStatus {
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/provider_status";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String DATABASE_CREATION_TIMESTAMP = "database_creation_timestamp";
    field public static final java.lang.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, java.lang.String[]);
    method public static void showQuickContact(android.content.Context, android.graphics.Rect, android.net.Uri, int, java.lang.String[]);
    method public static void showQuickContact(android.content.Context, android.view.View, android.net.Uri, java.lang.String[], java.lang.String);
    method public static void showQuickContact(android.content.Context, android.graphics.Rect, android.net.Uri, java.lang.String[], java.lang.String);
    field public static final java.lang.String ACTION_QUICK_CONTACT = "android.provider.action.QUICK_CONTACT";
    field public static final java.lang.String EXTRA_EXCLUDE_MIMES = "android.provider.extra.EXCLUDE_MIMES";
    field public static final java.lang.String EXTRA_MODE = "android.provider.extra.MODE";
    field public static final java.lang.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 public static final deprecated int AGGREGATION_MODE_IMMEDIATE = 1; // 0x1
    field public static final int AGGREGATION_MODE_SUSPENDED = 2; // 0x2
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/raw_contact";
    field public static final java.lang.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 java.lang.String CONTENT_DIRECTORY = "data";
  }

  public static final class ContactsContract.RawContacts.DisplayPhoto {
    field public static final java.lang.String CONTENT_DIRECTORY = "display_photo";
  }

  public static final class ContactsContract.RawContacts.Entity implements android.provider.BaseColumns android.provider.ContactsContract.DataColumns {
    field public static final java.lang.String CONTENT_DIRECTORY = "entity";
    field public static final java.lang.String DATA_ID = "data_id";
  }

  protected static abstract interface ContactsContract.RawContactsColumns {
    field public static final java.lang.String ACCOUNT_TYPE_AND_DATA_SET = "account_type_and_data_set";
    field public static final java.lang.String AGGREGATION_MODE = "aggregation_mode";
    field public static final java.lang.String BACKUP_ID = "backup_id";
    field public static final java.lang.String CONTACT_ID = "contact_id";
    field public static final java.lang.String DATA_SET = "data_set";
    field public static final java.lang.String DELETED = "deleted";
    field public static final java.lang.String METADATA_DIRTY = "metadata_dirty";
    field public static final java.lang.String RAW_CONTACT_IS_READ_ONLY = "raw_contact_is_read_only";
    field public static final java.lang.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 java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/raw_contact_entity";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.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 java.lang.String DEFERRED_SNIPPETING_KEY = "deferred_snippeting";
    field public static final java.lang.String SNIPPET = "snippet";
  }

  public static final class ContactsContract.Settings implements android.provider.ContactsContract.SettingsColumns {
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/setting";
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/setting";
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static abstract interface ContactsContract.SettingsColumns {
    field public static final java.lang.String ACCOUNT_NAME = "account_name";
    field public static final java.lang.String ACCOUNT_TYPE = "account_type";
    field public static final java.lang.String ANY_UNSYNCED = "any_unsynced";
    field public static final java.lang.String DATA_SET = "data_set";
    field public static final java.lang.String SHOULD_SYNC = "should_sync";
    field public static final java.lang.String UNGROUPED_COUNT = "summ_count";
    field public static final java.lang.String UNGROUPED_VISIBLE = "ungrouped_visible";
    field public static final java.lang.String UNGROUPED_WITH_PHONES = "summ_phones";
  }

  protected static abstract 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 java.lang.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 java.lang.String PRESENCE = "mode";
    field public static final deprecated java.lang.String PRESENCE_CUSTOM_STATUS = "status";
    field public static final deprecated java.lang.String PRESENCE_STATUS = "mode";
    field public static final java.lang.String STATUS = "status";
    field public static final java.lang.String STATUS_ICON = "status_icon";
    field public static final java.lang.String STATUS_LABEL = "status_label";
    field public static final java.lang.String STATUS_RES_PACKAGE = "status_res_package";
    field public static final java.lang.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 java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/status-update";
    field public static final java.lang.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 abstract interface ContactsContract.SyncColumns implements android.provider.ContactsContract.BaseSyncColumns {
    field public static final java.lang.String ACCOUNT_NAME = "account_name";
    field public static final java.lang.String ACCOUNT_TYPE = "account_type";
    field public static final java.lang.String DIRTY = "dirty";
    field public static final java.lang.String SOURCE_ID = "sourceid";
    field public static final java.lang.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 java.lang.String CONTENT_DIRECTORY = "syncstate";
    field public static final android.net.Uri CONTENT_URI;
  }

  public final class DocumentsContract {
    method public static android.net.Uri buildChildDocumentsUri(java.lang.String, java.lang.String);
    method public static android.net.Uri buildChildDocumentsUriUsingTree(android.net.Uri, java.lang.String);
    method public static android.net.Uri buildDocumentUri(java.lang.String, java.lang.String);
    method public static android.net.Uri buildDocumentUriUsingTree(android.net.Uri, java.lang.String);
    method public static android.net.Uri buildRecentDocumentsUri(java.lang.String, java.lang.String);
    method public static android.net.Uri buildRootUri(java.lang.String, java.lang.String);
    method public static android.net.Uri buildRootsUri(java.lang.String);
    method public static android.net.Uri buildSearchDocumentsUri(java.lang.String, java.lang.String, java.lang.String);
    method public static android.net.Uri buildTreeDocumentUri(java.lang.String, java.lang.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, java.lang.String, java.lang.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 java.lang.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 java.lang.String getRootId(android.net.Uri);
    method public static java.lang.String getSearchDocumentsQuery(android.net.Uri);
    method public static java.lang.String getTreeDocumentId(android.net.Uri);
    method public static boolean isDocumentUri(android.content.Context, 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, java.lang.String) throws java.io.FileNotFoundException;
    field public static final java.lang.String ACTION_DOCUMENT_SETTINGS = "android.provider.action.DOCUMENT_SETTINGS";
    field public static final java.lang.String EXTRA_ERROR = "error";
    field public static final java.lang.String EXTRA_EXCLUDE_SELF = "android.provider.extra.EXCLUDE_SELF";
    field public static final java.lang.String EXTRA_INFO = "info";
    field public static final java.lang.String EXTRA_INITIAL_URI = "android.provider.extra.INITIAL_URI";
    field public static final java.lang.String EXTRA_LOADING = "loading";
    field public static final java.lang.String EXTRA_ORIENTATION = "android.provider.extra.ORIENTATION";
    field public static final java.lang.String EXTRA_PROMPT = "android.provider.extra.PROMPT";
    field public static final java.lang.String PROVIDER_INTERFACE = "android.content.action.DOCUMENTS_PROVIDER";
  }

  public static final class DocumentsContract.Document {
    field public static final java.lang.String COLUMN_DISPLAY_NAME = "_display_name";
    field public static final java.lang.String COLUMN_DOCUMENT_ID = "document_id";
    field public static final java.lang.String COLUMN_FLAGS = "flags";
    field public static final java.lang.String COLUMN_ICON = "icon";
    field public static final java.lang.String COLUMN_LAST_MODIFIED = "last_modified";
    field public static final java.lang.String COLUMN_MIME_TYPE = "mime_type";
    field public static final java.lang.String COLUMN_SIZE = "_size";
    field public static final java.lang.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 java.lang.String MIME_TYPE_DIR = "vnd.android.document/directory";
  }

  public static final class DocumentsContract.Path implements android.os.Parcelable {
    ctor public DocumentsContract.Path(java.lang.String, java.util.List<java.lang.String>);
    method public int describeContents();
    method public java.util.List<java.lang.String> getPath();
    method public java.lang.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 java.lang.String COLUMN_AVAILABLE_BYTES = "available_bytes";
    field public static final java.lang.String COLUMN_CAPACITY_BYTES = "capacity_bytes";
    field public static final java.lang.String COLUMN_DOCUMENT_ID = "document_id";
    field public static final java.lang.String COLUMN_FLAGS = "flags";
    field public static final java.lang.String COLUMN_ICON = "icon";
    field public static final java.lang.String COLUMN_MIME_TYPES = "mime_types";
    field public static final java.lang.String COLUMN_ROOT_ID = "root_id";
    field public static final java.lang.String COLUMN_SUMMARY = "summary";
    field public static final java.lang.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 java.lang.String MIME_TYPE_ITEM = "vnd.android.document/root";
  }

  public abstract class DocumentsProvider extends android.content.ContentProvider {
    ctor public DocumentsProvider();
    method public java.lang.String copyDocument(java.lang.String, java.lang.String) throws java.io.FileNotFoundException;
    method public java.lang.String createDocument(java.lang.String, java.lang.String, java.lang.String) throws java.io.FileNotFoundException;
    method public android.content.IntentSender createWebLinkIntent(java.lang.String, android.os.Bundle) throws java.io.FileNotFoundException;
    method public final int delete(android.net.Uri, java.lang.String, java.lang.String[]);
    method public void deleteDocument(java.lang.String) throws java.io.FileNotFoundException;
    method public void ejectRoot(java.lang.String);
    method public android.provider.DocumentsContract.Path findDocumentPath(java.lang.String, java.lang.String) throws java.io.FileNotFoundException;
    method public java.lang.String[] getDocumentStreamTypes(java.lang.String, java.lang.String);
    method public java.lang.String getDocumentType(java.lang.String) throws java.io.FileNotFoundException;
    method public final java.lang.String getType(android.net.Uri);
    method public final android.net.Uri insert(android.net.Uri, android.content.ContentValues);
    method public boolean isChildDocument(java.lang.String, java.lang.String);
    method public java.lang.String moveDocument(java.lang.String, java.lang.String, java.lang.String) throws java.io.FileNotFoundException;
    method public final android.content.res.AssetFileDescriptor openAssetFile(android.net.Uri, java.lang.String) throws java.io.FileNotFoundException;
    method public final android.content.res.AssetFileDescriptor openAssetFile(android.net.Uri, java.lang.String, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public abstract android.os.ParcelFileDescriptor openDocument(java.lang.String, java.lang.String, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public android.content.res.AssetFileDescriptor openDocumentThumbnail(java.lang.String, android.graphics.Point, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public final android.os.ParcelFileDescriptor openFile(android.net.Uri, java.lang.String) throws java.io.FileNotFoundException;
    method public final android.os.ParcelFileDescriptor openFile(android.net.Uri, java.lang.String, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public final android.content.res.AssetFileDescriptor openTypedAssetFile(android.net.Uri, java.lang.String, android.os.Bundle) throws java.io.FileNotFoundException;
    method public final android.content.res.AssetFileDescriptor openTypedAssetFile(android.net.Uri, java.lang.String, android.os.Bundle, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public android.content.res.AssetFileDescriptor openTypedDocument(java.lang.String, java.lang.String, android.os.Bundle, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public final android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
    method public final android.database.Cursor query(android.net.Uri, java.lang.String[], android.os.Bundle, android.os.CancellationSignal);
    method public abstract android.database.Cursor queryChildDocuments(java.lang.String, java.lang.String[], java.lang.String) throws java.io.FileNotFoundException;
    method public android.database.Cursor queryChildDocuments(java.lang.String, java.lang.String[], android.os.Bundle) throws java.io.FileNotFoundException;
    method public abstract android.database.Cursor queryDocument(java.lang.String, java.lang.String[]) throws java.io.FileNotFoundException;
    method public android.database.Cursor queryRecentDocuments(java.lang.String, java.lang.String[]) throws java.io.FileNotFoundException;
    method public abstract android.database.Cursor queryRoots(java.lang.String[]) throws java.io.FileNotFoundException;
    method public android.database.Cursor querySearchDocuments(java.lang.String, java.lang.String, java.lang.String[]) throws java.io.FileNotFoundException;
    method public void removeDocument(java.lang.String, java.lang.String) throws java.io.FileNotFoundException;
    method public java.lang.String renameDocument(java.lang.String, java.lang.String) throws java.io.FileNotFoundException;
    method public final void revokeDocumentPermission(java.lang.String);
    method public final int update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]);
  }

  public final class FontRequest {
    ctor public FontRequest(java.lang.String, java.lang.String, java.lang.String);
    ctor public FontRequest(java.lang.String, java.lang.String, java.lang.String, java.util.List<java.util.List<byte[]>>);
    method public java.util.List<java.util.List<byte[]>> getCertificates();
    method public java.lang.String getProviderAuthority();
    method public java.lang.String getProviderPackage();
    method public java.lang.String getQuery();
  }

  public class FontsContract {
    method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[]);
    method public static android.provider.FontsContract.FontFamilyResult fetchFonts(android.content.Context, android.os.CancellationSignal, android.provider.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException;
    method public static void requestFonts(android.content.Context, android.provider.FontRequest, android.os.Handler, android.os.CancellationSignal, android.provider.FontsContract.FontRequestCallback);
  }

  public static final class FontsContract.Columns implements android.provider.BaseColumns {
    field public static final java.lang.String FILE_ID = "file_id";
    field public static final java.lang.String ITALIC = "font_italic";
    field public static final java.lang.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 java.lang.String TTC_INDEX = "font_ttc_index";
    field public static final java.lang.String VARIATION_SETTINGS = "font_variation_settings";
    field public static final java.lang.String WEIGHT = "font_weight";
  }

  public static class FontsContract.FontFamilyResult {
    method 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 public android.graphics.fonts.FontVariationAxis[] getAxes();
    method public int getResultCode();
    method public int getTtcIndex();
    method public android.net.Uri getUri();
    method 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
  }

  public final deprecated class LiveFolders implements android.provider.BaseColumns {
    field public static final java.lang.String ACTION_CREATE_LIVE_FOLDER = "android.intent.action.CREATE_LIVE_FOLDER";
    field public static final java.lang.String DESCRIPTION = "description";
    field public static final int DISPLAY_MODE_GRID = 1; // 0x1
    field public static final int DISPLAY_MODE_LIST = 2; // 0x2
    field public static final java.lang.String EXTRA_LIVE_FOLDER_BASE_INTENT = "android.intent.extra.livefolder.BASE_INTENT";
    field public static final java.lang.String EXTRA_LIVE_FOLDER_DISPLAY_MODE = "android.intent.extra.livefolder.DISPLAY_MODE";
    field public static final java.lang.String EXTRA_LIVE_FOLDER_ICON = "android.intent.extra.livefolder.ICON";
    field public static final java.lang.String EXTRA_LIVE_FOLDER_NAME = "android.intent.extra.livefolder.NAME";
    field public static final java.lang.String ICON_BITMAP = "icon_bitmap";
    field public static final java.lang.String ICON_PACKAGE = "icon_package";
    field public static final java.lang.String ICON_RESOURCE = "icon_resource";
    field public static final java.lang.String INTENT = "intent";
    field public static final java.lang.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 java.lang.String getVersion(android.content.Context);
    field public static final java.lang.String ACTION_IMAGE_CAPTURE = "android.media.action.IMAGE_CAPTURE";
    field public static final java.lang.String ACTION_IMAGE_CAPTURE_SECURE = "android.media.action.IMAGE_CAPTURE_SECURE";
    field public static final java.lang.String ACTION_VIDEO_CAPTURE = "android.media.action.VIDEO_CAPTURE";
    field public static final java.lang.String AUTHORITY = "media";
    field public static final java.lang.String EXTRA_DURATION_LIMIT = "android.intent.extra.durationLimit";
    field public static final java.lang.String EXTRA_FINISH_ON_COMPLETION = "android.intent.extra.finishOnCompletion";
    field public static final java.lang.String EXTRA_FULL_SCREEN = "android.intent.extra.fullScreen";
    field public static final java.lang.String EXTRA_MEDIA_ALBUM = "android.intent.extra.album";
    field public static final java.lang.String EXTRA_MEDIA_ARTIST = "android.intent.extra.artist";
    field public static final java.lang.String EXTRA_MEDIA_FOCUS = "android.intent.extra.focus";
    field public static final java.lang.String EXTRA_MEDIA_GENRE = "android.intent.extra.genre";
    field public static final java.lang.String EXTRA_MEDIA_PLAYLIST = "android.intent.extra.playlist";
    field public static final java.lang.String EXTRA_MEDIA_RADIO_CHANNEL = "android.intent.extra.radio_channel";
    field public static final java.lang.String EXTRA_MEDIA_TITLE = "android.intent.extra.title";
    field public static final java.lang.String EXTRA_OUTPUT = "output";
    field public static final java.lang.String EXTRA_SCREEN_ORIENTATION = "android.intent.extra.screenOrientation";
    field public static final java.lang.String EXTRA_SHOW_ACTION_ICONS = "android.intent.extra.showActionIcons";
    field public static final java.lang.String EXTRA_SIZE_LIMIT = "android.intent.extra.sizeLimit";
    field public static final java.lang.String EXTRA_VIDEO_QUALITY = "android.intent.extra.videoQuality";
    field public static final java.lang.String INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH = "android.media.action.MEDIA_PLAY_FROM_SEARCH";
    field public static final java.lang.String INTENT_ACTION_MEDIA_SEARCH = "android.intent.action.MEDIA_SEARCH";
    field public static final deprecated java.lang.String INTENT_ACTION_MUSIC_PLAYER = "android.intent.action.MUSIC_PLAYER";
    field public static final java.lang.String INTENT_ACTION_STILL_IMAGE_CAMERA = "android.media.action.STILL_IMAGE_CAMERA";
    field public static final java.lang.String INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE = "android.media.action.STILL_IMAGE_CAMERA_SECURE";
    field public static final java.lang.String INTENT_ACTION_TEXT_OPEN_FROM_SEARCH = "android.media.action.TEXT_OPEN_FROM_SEARCH";
    field public static final java.lang.String INTENT_ACTION_VIDEO_CAMERA = "android.media.action.VIDEO_CAMERA";
    field public static final java.lang.String INTENT_ACTION_VIDEO_PLAY_FROM_SEARCH = "android.media.action.VIDEO_PLAY_FROM_SEARCH";
    field public static final java.lang.String MEDIA_IGNORE_FILENAME = ".nomedia";
    field public static final java.lang.String MEDIA_SCANNER_VOLUME = "volume";
    field public static final java.lang.String META_DATA_STILL_IMAGE_CAMERA_PREWARM_SERVICE = "android.media.still_image_camera_preview_service";
    field public static final java.lang.String UNKNOWN_STRING = "<unknown>";
  }

  public static final class MediaStore.Audio {
    ctor public MediaStore.Audio();
    method public static java.lang.String keyFor(java.lang.String);
  }

  public static abstract interface MediaStore.Audio.AlbumColumns {
    field public static final java.lang.String ALBUM = "album";
    field public static final java.lang.String ALBUM_ART = "album_art";
    field public static final java.lang.String ALBUM_ID = "album_id";
    field public static final java.lang.String ALBUM_KEY = "album_key";
    field public static final java.lang.String ARTIST = "artist";
    field public static final java.lang.String FIRST_YEAR = "minyear";
    field public static final java.lang.String LAST_YEAR = "maxyear";
    field public static final java.lang.String NUMBER_OF_SONGS = "numsongs";
    field public static final java.lang.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(java.lang.String);
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/albums";
    field public static final java.lang.String DEFAULT_SORT_ORDER = "album_key";
    field public static final java.lang.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 abstract interface MediaStore.Audio.ArtistColumns {
    field public static final java.lang.String ARTIST = "artist";
    field public static final java.lang.String ARTIST_KEY = "artist_key";
    field public static final java.lang.String NUMBER_OF_ALBUMS = "number_of_albums";
    field public static final java.lang.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(java.lang.String);
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/artists";
    field public static final java.lang.String DEFAULT_SORT_ORDER = "artist_key";
    field public static final java.lang.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(java.lang.String, long);
  }

  public static abstract interface MediaStore.Audio.AudioColumns implements android.provider.MediaStore.MediaColumns {
    field public static final java.lang.String ALBUM = "album";
    field public static final java.lang.String ALBUM_ID = "album_id";
    field public static final java.lang.String ALBUM_KEY = "album_key";
    field public static final java.lang.String ARTIST = "artist";
    field public static final java.lang.String ARTIST_ID = "artist_id";
    field public static final java.lang.String ARTIST_KEY = "artist_key";
    field public static final java.lang.String BOOKMARK = "bookmark";
    field public static final java.lang.String COMPOSER = "composer";
    field public static final java.lang.String DURATION = "duration";
    field public static final java.lang.String IS_ALARM = "is_alarm";
    field public static final java.lang.String IS_MUSIC = "is_music";
    field public static final java.lang.String IS_NOTIFICATION = "is_notification";
    field public static final java.lang.String IS_PODCAST = "is_podcast";
    field public static final java.lang.String IS_RINGTONE = "is_ringtone";
    field public static final java.lang.String TITLE_KEY = "title_key";
    field public static final java.lang.String TRACK = "track";
    field public static final java.lang.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(java.lang.String);
    method public static android.net.Uri getContentUriForAudioId(java.lang.String, int);
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/genre";
    field public static final java.lang.String DEFAULT_SORT_ORDER = "name";
    field public static final java.lang.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(java.lang.String, long);
    field public static final java.lang.String AUDIO_ID = "audio_id";
    field public static final java.lang.String CONTENT_DIRECTORY = "members";
    field public static final java.lang.String DEFAULT_SORT_ORDER = "title_key";
    field public static final java.lang.String GENRE_ID = "genre_id";
  }

  public static abstract interface MediaStore.Audio.GenresColumns {
    field public static final java.lang.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(java.lang.String);
    method public static android.net.Uri getContentUriForPath(java.lang.String);
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/audio";
    field public static final java.lang.String DEFAULT_SORT_ORDER = "title_key";
    field public static final java.lang.String ENTRY_CONTENT_TYPE = "vnd.android.cursor.item/audio";
    field public static final android.net.Uri EXTERNAL_CONTENT_URI;
    field public static final java.lang.String EXTRA_MAX_BYTES = "android.provider.MediaStore.extra.MAX_BYTES";
    field public static final android.net.Uri INTERNAL_CONTENT_URI;
    field public static final java.lang.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(java.lang.String);
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/playlist";
    field public static final java.lang.String DEFAULT_SORT_ORDER = "name";
    field public static final java.lang.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(java.lang.String, long);
    method public static boolean moveItem(android.content.ContentResolver, long, int, int);
    field public static final java.lang.String AUDIO_ID = "audio_id";
    field public static final java.lang.String CONTENT_DIRECTORY = "members";
    field public static final java.lang.String DEFAULT_SORT_ORDER = "play_order";
    field public static final java.lang.String PLAYLIST_ID = "playlist_id";
    field public static final java.lang.String PLAY_ORDER = "play_order";
    field public static final java.lang.String _ID = "_id";
  }

  public static abstract interface MediaStore.Audio.PlaylistsColumns {
    field public static final java.lang.String DATA = "_data";
    field public static final java.lang.String DATE_ADDED = "date_added";
    field public static final java.lang.String DATE_MODIFIED = "date_modified";
    field public static final java.lang.String NAME = "name";
  }

  public static final class MediaStore.Audio.Radio {
    field public static final java.lang.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(java.lang.String);
    method public static android.net.Uri getContentUri(java.lang.String, long);
  }

  public static abstract interface MediaStore.Files.FileColumns implements android.provider.MediaStore.MediaColumns {
    field public static final java.lang.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 java.lang.String MIME_TYPE = "mime_type";
    field public static final java.lang.String PARENT = "parent";
    field public static final java.lang.String TITLE = "title";
  }

  public static final class MediaStore.Images {
    ctor public MediaStore.Images();
  }

  public static abstract interface MediaStore.Images.ImageColumns implements android.provider.MediaStore.MediaColumns {
    field public static final java.lang.String BUCKET_DISPLAY_NAME = "bucket_display_name";
    field public static final java.lang.String BUCKET_ID = "bucket_id";
    field public static final java.lang.String DATE_TAKEN = "datetaken";
    field public static final java.lang.String DESCRIPTION = "description";
    field public static final java.lang.String IS_PRIVATE = "isprivate";
    field public static final java.lang.String LATITUDE = "latitude";
    field public static final java.lang.String LONGITUDE = "longitude";
    field public static final java.lang.String MINI_THUMB_MAGIC = "mini_thumb_magic";
    field public static final java.lang.String ORIENTATION = "orientation";
    field public static final java.lang.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(java.lang.String);
    method public static java.lang.String insertImage(android.content.ContentResolver, java.lang.String, java.lang.String, java.lang.String) throws java.io.FileNotFoundException;
    method public static java.lang.String insertImage(android.content.ContentResolver, android.graphics.Bitmap, java.lang.String, java.lang.String);
    method public static android.database.Cursor query(android.content.ContentResolver, android.net.Uri, java.lang.String[]);
    method public static android.database.Cursor query(android.content.ContentResolver, android.net.Uri, java.lang.String[], java.lang.String, java.lang.String);
    method public static android.database.Cursor query(android.content.ContentResolver, android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/image";
    field public static final java.lang.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(java.lang.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, java.lang.String[]);
    method public static final android.database.Cursor queryMiniThumbnail(android.content.ContentResolver, long, int, java.lang.String[]);
    method public static final android.database.Cursor queryMiniThumbnails(android.content.ContentResolver, android.net.Uri, int, java.lang.String[]);
    field public static final java.lang.String DATA = "_data";
    field public static final java.lang.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 java.lang.String HEIGHT = "height";
    field public static final java.lang.String IMAGE_ID = "image_id";
    field public static final android.net.Uri INTERNAL_CONTENT_URI;
    field public static final java.lang.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 java.lang.String THUMB_DATA = "thumb_data";
    field public static final java.lang.String WIDTH = "width";
  }

  public static abstract interface MediaStore.MediaColumns implements android.provider.BaseColumns {
    field public static final java.lang.String DATA = "_data";
    field public static final java.lang.String DATE_ADDED = "date_added";
    field public static final java.lang.String DATE_MODIFIED = "date_modified";
    field public static final java.lang.String DISPLAY_NAME = "_display_name";
    field public static final java.lang.String HEIGHT = "height";
    field public static final java.lang.String MIME_TYPE = "mime_type";
    field public static final java.lang.String SIZE = "_size";
    field public static final java.lang.String TITLE = "title";
    field public static final java.lang.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, java.lang.String[]);
    field public static final java.lang.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(java.lang.String);
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/video";
    field public static final java.lang.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(java.lang.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 java.lang.String DATA = "_data";
    field public static final java.lang.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 java.lang.String HEIGHT = "height";
    field public static final android.net.Uri INTERNAL_CONTENT_URI;
    field public static final java.lang.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 java.lang.String VIDEO_ID = "video_id";
    field public static final java.lang.String WIDTH = "width";
  }

  public static abstract interface MediaStore.Video.VideoColumns implements android.provider.MediaStore.MediaColumns {
    field public static final java.lang.String ALBUM = "album";
    field public static final java.lang.String ARTIST = "artist";
    field public static final java.lang.String BOOKMARK = "bookmark";
    field public static final java.lang.String BUCKET_DISPLAY_NAME = "bucket_display_name";
    field public static final java.lang.String BUCKET_ID = "bucket_id";
    field public static final java.lang.String CATEGORY = "category";
    field public static final java.lang.String DATE_TAKEN = "datetaken";
    field public static final java.lang.String DESCRIPTION = "description";
    field public static final java.lang.String DURATION = "duration";
    field public static final java.lang.String IS_PRIVATE = "isprivate";
    field public static final java.lang.String LANGUAGE = "language";
    field public static final java.lang.String LATITUDE = "latitude";
    field public static final java.lang.String LONGITUDE = "longitude";
    field public static final java.lang.String MINI_THUMB_MAGIC = "mini_thumb_magic";
    field public static final java.lang.String RESOLUTION = "resolution";
    field public static final java.lang.String TAGS = "tags";
  }

  public abstract interface OpenableColumns {
    field public static final java.lang.String DISPLAY_NAME = "_display_name";
    field public static final java.lang.String SIZE = "_size";
  }

  public class SearchRecentSuggestions {
    ctor public SearchRecentSuggestions(android.content.Context, java.lang.String, int);
    method public void clearHistory();
    method public void saveRecentQuery(java.lang.String, java.lang.String);
    method protected void truncateHistory(android.content.ContentResolver, int);
    field public static final java.lang.String[] QUERIES_PROJECTION_1LINE;
    field public static final java.lang.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 java.lang.String ACTION_ACCESSIBILITY_SETTINGS = "android.settings.ACCESSIBILITY_SETTINGS";
    field public static final java.lang.String ACTION_ADD_ACCOUNT = "android.settings.ADD_ACCOUNT_SETTINGS";
    field public static final java.lang.String ACTION_AIRPLANE_MODE_SETTINGS = "android.settings.AIRPLANE_MODE_SETTINGS";
    field public static final java.lang.String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
    field public static final java.lang.String ACTION_APPLICATION_DETAILS_SETTINGS = "android.settings.APPLICATION_DETAILS_SETTINGS";
    field public static final java.lang.String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
    field public static final java.lang.String ACTION_APPLICATION_SETTINGS = "android.settings.APPLICATION_SETTINGS";
    field public static final java.lang.String ACTION_APP_NOTIFICATION_SETTINGS = "android.settings.APP_NOTIFICATION_SETTINGS";
    field public static final java.lang.String ACTION_BATTERY_SAVER_SETTINGS = "android.settings.BATTERY_SAVER_SETTINGS";
    field public static final java.lang.String ACTION_BLUETOOTH_SETTINGS = "android.settings.BLUETOOTH_SETTINGS";
    field public static final java.lang.String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
    field public static final java.lang.String ACTION_CAST_SETTINGS = "android.settings.CAST_SETTINGS";
    field public static final java.lang.String ACTION_CHANNEL_NOTIFICATION_SETTINGS = "android.settings.CHANNEL_NOTIFICATION_SETTINGS";
    field public static final java.lang.String ACTION_DATA_ROAMING_SETTINGS = "android.settings.DATA_ROAMING_SETTINGS";
    field public static final java.lang.String ACTION_DATA_USAGE_SETTINGS = "android.settings.DATA_USAGE_SETTINGS";
    field public static final java.lang.String ACTION_DATE_SETTINGS = "android.settings.DATE_SETTINGS";
    field public static final java.lang.String ACTION_DEVICE_INFO_SETTINGS = "android.settings.DEVICE_INFO_SETTINGS";
    field public static final java.lang.String ACTION_DISPLAY_SETTINGS = "android.settings.DISPLAY_SETTINGS";
    field public static final java.lang.String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
    field public static final java.lang.String ACTION_FINGERPRINT_ENROLL = "android.settings.FINGERPRINT_ENROLL";
    field public static final java.lang.String ACTION_HARD_KEYBOARD_SETTINGS = "android.settings.HARD_KEYBOARD_SETTINGS";
    field public static final java.lang.String ACTION_HOME_SETTINGS = "android.settings.HOME_SETTINGS";
    field public static final java.lang.String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS = "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
    field public static final java.lang.String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS = "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
    field public static final java.lang.String ACTION_INPUT_METHOD_SETTINGS = "android.settings.INPUT_METHOD_SETTINGS";
    field public static final java.lang.String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
    field public static final java.lang.String ACTION_INTERNAL_STORAGE_SETTINGS = "android.settings.INTERNAL_STORAGE_SETTINGS";
    field public static final java.lang.String ACTION_LOCALE_SETTINGS = "android.settings.LOCALE_SETTINGS";
    field public static final java.lang.String ACTION_LOCATION_SOURCE_SETTINGS = "android.settings.LOCATION_SOURCE_SETTINGS";
    field public static final java.lang.String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
    field public static final java.lang.String ACTION_MANAGE_APPLICATIONS_SETTINGS = "android.settings.MANAGE_APPLICATIONS_SETTINGS";
    field public static final java.lang.String ACTION_MANAGE_DEFAULT_APPS_SETTINGS = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
    field public static final java.lang.String ACTION_MANAGE_OVERLAY_PERMISSION = "android.settings.action.MANAGE_OVERLAY_PERMISSION";
    field public static final java.lang.String ACTION_MANAGE_UNKNOWN_APP_SOURCES = "android.settings.MANAGE_UNKNOWN_APP_SOURCES";
    field public static final java.lang.String ACTION_MANAGE_WRITE_SETTINGS = "android.settings.action.MANAGE_WRITE_SETTINGS";
    field public static final java.lang.String ACTION_MEMORY_CARD_SETTINGS = "android.settings.MEMORY_CARD_SETTINGS";
    field public static final java.lang.String ACTION_NETWORK_OPERATOR_SETTINGS = "android.settings.NETWORK_OPERATOR_SETTINGS";
    field public static final java.lang.String ACTION_NFCSHARING_SETTINGS = "android.settings.NFCSHARING_SETTINGS";
    field public static final java.lang.String ACTION_NFC_PAYMENT_SETTINGS = "android.settings.NFC_PAYMENT_SETTINGS";
    field public static final java.lang.String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
    field public static final java.lang.String ACTION_NIGHT_DISPLAY_SETTINGS = "android.settings.NIGHT_DISPLAY_SETTINGS";
    field public static final java.lang.String ACTION_NOTIFICATION_LISTENER_SETTINGS = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
    field public static final java.lang.String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
    field public static final java.lang.String ACTION_PRINT_SETTINGS = "android.settings.ACTION_PRINT_SETTINGS";
    field public static final java.lang.String ACTION_PRIVACY_SETTINGS = "android.settings.PRIVACY_SETTINGS";
    field public static final java.lang.String ACTION_QUICK_LAUNCH_SETTINGS = "android.settings.QUICK_LAUNCH_SETTINGS";
    field public static final java.lang.String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
    field public static final java.lang.String ACTION_REQUEST_SET_AUTOFILL_SERVICE = "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
    field public static final java.lang.String ACTION_SEARCH_SETTINGS = "android.search.action.SEARCH_SETTINGS";
    field public static final java.lang.String ACTION_SECURITY_SETTINGS = "android.settings.SECURITY_SETTINGS";
    field public static final java.lang.String ACTION_SETTINGS = "android.settings.SETTINGS";
    field public static final java.lang.String ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
    field public static final java.lang.String ACTION_SOUND_SETTINGS = "android.settings.SOUND_SETTINGS";
    field public static final java.lang.String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS = "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS";
    field public static final java.lang.String ACTION_SYNC_SETTINGS = "android.settings.SYNC_SETTINGS";
    field public static final java.lang.String ACTION_USAGE_ACCESS_SETTINGS = "android.settings.USAGE_ACCESS_SETTINGS";
    field public static final java.lang.String ACTION_USER_DICTIONARY_SETTINGS = "android.settings.USER_DICTIONARY_SETTINGS";
    field public static final java.lang.String ACTION_VOICE_CONTROL_AIRPLANE_MODE = "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
    field public static final java.lang.String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE = "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
    field public static final java.lang.String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE = "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
    field public static final java.lang.String ACTION_VOICE_INPUT_SETTINGS = "android.settings.VOICE_INPUT_SETTINGS";
    field public static final java.lang.String ACTION_VPN_SETTINGS = "android.settings.VPN_SETTINGS";
    field public static final java.lang.String ACTION_VR_LISTENER_SETTINGS = "android.settings.VR_LISTENER_SETTINGS";
    field public static final java.lang.String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
    field public static final java.lang.String ACTION_WIFI_IP_SETTINGS = "android.settings.WIFI_IP_SETTINGS";
    field public static final java.lang.String ACTION_WIFI_SETTINGS = "android.settings.WIFI_SETTINGS";
    field public static final java.lang.String ACTION_WIRELESS_SETTINGS = "android.settings.WIRELESS_SETTINGS";
    field public static final java.lang.String ACTION_ZEN_MODE_PRIORITY_SETTINGS = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
    field public static final java.lang.String AUTHORITY = "settings";
    field public static final java.lang.String EXTRA_ACCOUNT_TYPES = "account_types";
    field public static final java.lang.String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
    field public static final java.lang.String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE";
    field public static final java.lang.String EXTRA_AUTHORITIES = "authorities";
    field public static final java.lang.String EXTRA_BATTERY_SAVER_MODE_ENABLED = "android.settings.extra.battery_saver_mode_enabled";
    field public static final java.lang.String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID";
    field public static final java.lang.String EXTRA_DO_NOT_DISTURB_MODE_ENABLED = "android.settings.extra.do_not_disturb_mode_enabled";
    field public static final java.lang.String EXTRA_DO_NOT_DISTURB_MODE_MINUTES = "android.settings.extra.do_not_disturb_mode_minutes";
    field public static final java.lang.String EXTRA_INPUT_METHOD_ID = "input_method_id";
    field public static final java.lang.String EXTRA_SUB_ID = "android.provider.extra.SUB_ID";
    field public static final java.lang.String INTENT_CATEGORY_USAGE_ACCESS_CONFIG = "android.intent.category.USAGE_ACCESS_CONFIG";
    field public static final java.lang.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, java.lang.String, float);
    method public static float getFloat(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException;
    method public static int getInt(android.content.ContentResolver, java.lang.String, int);
    method public static int getInt(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException;
    method public static long getLong(android.content.ContentResolver, java.lang.String, long);
    method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException;
    method public static java.lang.String getString(android.content.ContentResolver, java.lang.String);
    method public static android.net.Uri getUriFor(java.lang.String);
    method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float);
    method public static boolean putInt(android.content.ContentResolver, java.lang.String, int);
    method public static boolean putLong(android.content.ContentResolver, java.lang.String, long);
    method public static boolean putString(android.content.ContentResolver, java.lang.String, java.lang.String);
    field public static final java.lang.String ADB_ENABLED = "adb_enabled";
    field public static final java.lang.String AIRPLANE_MODE_ON = "airplane_mode_on";
    field public static final java.lang.String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
    field public static final java.lang.String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
    field public static final java.lang.String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
    field public static final java.lang.String AUTO_TIME = "auto_time";
    field public static final java.lang.String AUTO_TIME_ZONE = "auto_time_zone";
    field public static final java.lang.String BLUETOOTH_ON = "bluetooth_on";
    field public static final java.lang.String BOOT_COUNT = "boot_count";
    field public static final java.lang.String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String DATA_ROAMING = "data_roaming";
    field public static final java.lang.String DEBUG_APP = "debug_app";
    field public static final java.lang.String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
    field public static final java.lang.String DEVICE_NAME = "device_name";
    field public static final java.lang.String DEVICE_PROVISIONED = "device_provisioned";
    field public static final java.lang.String HTTP_PROXY = "http_proxy";
    field public static final deprecated java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
    field public static final java.lang.String MODE_RINGER = "mode_ringer";
    field public static final java.lang.String NETWORK_PREFERENCE = "network_preference";
    field public static final java.lang.String RADIO_BLUETOOTH = "bluetooth";
    field public static final java.lang.String RADIO_CELL = "cell";
    field public static final java.lang.String RADIO_NFC = "nfc";
    field public static final java.lang.String RADIO_WIFI = "wifi";
    field public static final deprecated java.lang.String SHOW_PROCESSES = "show_processes";
    field public static final java.lang.String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
    field public static final java.lang.String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
    field public static final java.lang.String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
    field public static final java.lang.String USE_GOOGLE_MAIL = "use_google_mail";
    field public static final java.lang.String WAIT_FOR_DEBUGGER = "wait_for_debugger";
    field public static final java.lang.String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN = "wifi_device_owner_configs_lockdown";
    field public static final java.lang.String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
    field public static final java.lang.String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = "wifi_mobile_data_transition_wakelock_timeout_ms";
    field public static final deprecated java.lang.String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = "wifi_networks_available_notification_on";
    field public static final java.lang.String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = "wifi_networks_available_repeat_delay";
    field public static final java.lang.String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
    field public static final java.lang.String WIFI_ON = "wifi_on";
    field public static final java.lang.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 java.lang.String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
    field public static final java.lang.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, java.lang.String);
    method protected static boolean putString(android.content.ContentResolver, android.net.Uri, java.lang.String, java.lang.String);
    field public static final java.lang.String NAME = "name";
    field public static final java.lang.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, java.lang.String, float);
    method public static float getFloat(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException;
    method public static int getInt(android.content.ContentResolver, java.lang.String, int);
    method public static int getInt(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException;
    method public static long getLong(android.content.ContentResolver, java.lang.String, long);
    method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException;
    method public static java.lang.String getString(android.content.ContentResolver, java.lang.String);
    method public static android.net.Uri getUriFor(java.lang.String);
    method public static deprecated boolean isLocationProviderEnabled(android.content.ContentResolver, java.lang.String);
    method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float);
    method public static boolean putInt(android.content.ContentResolver, java.lang.String, int);
    method public static boolean putLong(android.content.ContentResolver, java.lang.String, long);
    method public static boolean putString(android.content.ContentResolver, java.lang.String, java.lang.String);
    method public static deprecated void setLocationProviderEnabled(android.content.ContentResolver, java.lang.String, boolean);
    field public static final java.lang.String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = "accessibility_display_inversion_enabled";
    field public static final java.lang.String ACCESSIBILITY_ENABLED = "accessibility_enabled";
    field public static final deprecated java.lang.String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
    field public static final deprecated java.lang.String ADB_ENABLED = "adb_enabled";
    field public static final java.lang.String ALLOWED_GEOLOCATION_ORIGINS = "allowed_geolocation_origins";
    field public static final deprecated java.lang.String ALLOW_MOCK_LOCATION = "mock_location";
    field public static final java.lang.String ANDROID_ID = "android_id";
    field public static final deprecated java.lang.String BACKGROUND_DATA = "background_data";
    field public static final deprecated java.lang.String BLUETOOTH_ON = "bluetooth_on";
    field public static final android.net.Uri CONTENT_URI;
    field public static final deprecated java.lang.String DATA_ROAMING = "data_roaming";
    field public static final java.lang.String DEFAULT_INPUT_METHOD = "default_input_method";
    field public static final deprecated java.lang.String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
    field public static final deprecated java.lang.String DEVICE_PROVISIONED = "device_provisioned";
    field public static final java.lang.String ENABLED_ACCESSIBILITY_SERVICES = "enabled_accessibility_services";
    field public static final java.lang.String ENABLED_INPUT_METHODS = "enabled_input_methods";
    field public static final deprecated java.lang.String HTTP_PROXY = "http_proxy";
    field public static final java.lang.String INPUT_METHOD_SELECTOR_VISIBILITY = "input_method_selector_visibility";
    field public static final deprecated java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
    field public static final deprecated java.lang.String LOCATION_MODE = "location_mode";
    field public static final deprecated int LOCATION_MODE_BATTERY_SAVING = 2; // 0x2
    field public static final deprecated int LOCATION_MODE_HIGH_ACCURACY = 3; // 0x3
    field public static final deprecated int LOCATION_MODE_OFF = 0; // 0x0
    field public static final deprecated int LOCATION_MODE_SENSORS_ONLY = 1; // 0x1
    field public static final deprecated java.lang.String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
    field public static final deprecated java.lang.String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
    field public static final deprecated java.lang.String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
    field public static final deprecated java.lang.String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
    field public static final deprecated java.lang.String LOGGING_ID = "logging_id";
    field public static final deprecated java.lang.String NETWORK_PREFERENCE = "network_preference";
    field public static final java.lang.String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
    field public static final java.lang.String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
    field public static final java.lang.String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
    field public static final java.lang.String RTT_CALLING_MODE = "rtt_calling_mode";
    field public static final java.lang.String SELECTED_INPUT_METHOD_SUBTYPE = "selected_input_method_subtype";
    field public static final java.lang.String SETTINGS_CLASSNAME = "settings_classname";
    field public static final java.lang.String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
    field public static final java.lang.String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
    field public static final deprecated java.lang.String TTS_DEFAULT_COUNTRY = "tts_default_country";
    field public static final deprecated java.lang.String TTS_DEFAULT_LANG = "tts_default_lang";
    field public static final java.lang.String TTS_DEFAULT_PITCH = "tts_default_pitch";
    field public static final java.lang.String TTS_DEFAULT_RATE = "tts_default_rate";
    field public static final java.lang.String TTS_DEFAULT_SYNTH = "tts_default_synth";
    field public static final deprecated java.lang.String TTS_DEFAULT_VARIANT = "tts_default_variant";
    field public static final java.lang.String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
    field public static final deprecated java.lang.String TTS_USE_DEFAULTS = "tts_use_defaults";
    field public static final deprecated java.lang.String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
    field public static final deprecated java.lang.String USE_GOOGLE_MAIL = "use_google_mail";
    field public static final deprecated java.lang.String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
    field public static final deprecated java.lang.String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = "wifi_mobile_data_transition_wakelock_timeout_ms";
    field public static final deprecated java.lang.String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = "wifi_networks_available_notification_on";
    field public static final deprecated java.lang.String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = "wifi_networks_available_repeat_delay";
    field public static final deprecated java.lang.String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
    field public static final deprecated java.lang.String WIFI_ON = "wifi_on";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = "wifi_watchdog_acceptable_packet_loss_percentage";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = "wifi_watchdog_background_check_delay_ms";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = "wifi_watchdog_background_check_enabled";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = "wifi_watchdog_background_check_timeout_ms";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = "wifi_watchdog_initial_ignored_ping_count";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
  }

  public static class Settings.SettingNotFoundException extends android.util.AndroidException {
    ctor public Settings.SettingNotFoundException(java.lang.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, java.lang.String, float);
    method public static float getFloat(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException;
    method public static int getInt(android.content.ContentResolver, java.lang.String, int);
    method public static int getInt(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException;
    method public static long getLong(android.content.ContentResolver, java.lang.String, long);
    method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException;
    method public static deprecated boolean getShowGTalkServiceStatus(android.content.ContentResolver);
    method public static java.lang.String getString(android.content.ContentResolver, java.lang.String);
    method public static android.net.Uri getUriFor(java.lang.String);
    method public static boolean putConfiguration(android.content.ContentResolver, android.content.res.Configuration);
    method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float);
    method public static boolean putInt(android.content.ContentResolver, java.lang.String, int);
    method public static boolean putLong(android.content.ContentResolver, java.lang.String, long);
    method public static boolean putString(android.content.ContentResolver, java.lang.String, java.lang.String);
    method public static deprecated void setShowGTalkServiceStatus(android.content.ContentResolver, boolean);
    field public static final java.lang.String ACCELEROMETER_ROTATION = "accelerometer_rotation";
    field public static final deprecated java.lang.String ADB_ENABLED = "adb_enabled";
    field public static final deprecated java.lang.String AIRPLANE_MODE_ON = "airplane_mode_on";
    field public static final deprecated java.lang.String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
    field public static final java.lang.String ALARM_ALERT = "alarm_alert";
    field public static final deprecated java.lang.String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
    field public static final deprecated java.lang.String ANDROID_ID = "android_id";
    field public static final deprecated java.lang.String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
    field public static final deprecated java.lang.String AUTO_TIME = "auto_time";
    field public static final deprecated java.lang.String AUTO_TIME_ZONE = "auto_time_zone";
    field public static final java.lang.String BLUETOOTH_DISCOVERABILITY = "bluetooth_discoverability";
    field public static final java.lang.String BLUETOOTH_DISCOVERABILITY_TIMEOUT = "bluetooth_discoverability_timeout";
    field public static final deprecated java.lang.String BLUETOOTH_ON = "bluetooth_on";
    field public static final android.net.Uri CONTENT_URI;
    field public static final deprecated java.lang.String DATA_ROAMING = "data_roaming";
    field public static final java.lang.String DATE_FORMAT = "date_format";
    field public static final deprecated java.lang.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 public static final deprecated java.lang.String DEVICE_PROVISIONED = "device_provisioned";
    field public static final deprecated java.lang.String DIM_SCREEN = "dim_screen";
    field public static final java.lang.String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
    field public static final java.lang.String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
    field public static final java.lang.String END_BUTTON_BEHAVIOR = "end_button_behavior";
    field public static final java.lang.String FONT_SCALE = "font_scale";
    field public static final java.lang.String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
    field public static final deprecated java.lang.String HTTP_PROXY = "http_proxy";
    field public static final deprecated java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
    field public static final deprecated java.lang.String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
    field public static final deprecated java.lang.String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
    field public static final deprecated java.lang.String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
    field public static final deprecated java.lang.String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
    field public static final deprecated java.lang.String LOGGING_ID = "logging_id";
    field public static final deprecated java.lang.String MODE_RINGER = "mode_ringer";
    field public static final java.lang.String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
    field public static final java.lang.String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
    field public static final deprecated java.lang.String NETWORK_PREFERENCE = "network_preference";
    field public static final deprecated java.lang.String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
    field public static final java.lang.String NOTIFICATION_SOUND = "notification_sound";
    field public static final deprecated java.lang.String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
    field public static final deprecated java.lang.String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
    field public static final deprecated java.lang.String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
    field public static final deprecated java.lang.String RADIO_BLUETOOTH = "bluetooth";
    field public static final deprecated java.lang.String RADIO_CELL = "cell";
    field public static final deprecated java.lang.String RADIO_NFC = "nfc";
    field public static final deprecated java.lang.String RADIO_WIFI = "wifi";
    field public static final java.lang.String RINGTONE = "ringtone";
    field public static final java.lang.String SCREEN_BRIGHTNESS = "screen_brightness";
    field public static final java.lang.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 java.lang.String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
    field public static final deprecated java.lang.String SETTINGS_CLASSNAME = "settings_classname";
    field public static final java.lang.String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
    field public static final java.lang.String SHOW_GTALK_SERVICE_STATUS = "SHOW_GTALK_SERVICE_STATUS";
    field public static final deprecated java.lang.String SHOW_PROCESSES = "show_processes";
    field public static final deprecated java.lang.String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
    field public static final java.lang.String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
    field public static final deprecated java.lang.String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
    field public static final java.lang.String TEXT_AUTO_CAPS = "auto_caps";
    field public static final java.lang.String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
    field public static final java.lang.String TEXT_AUTO_REPLACE = "auto_replace";
    field public static final java.lang.String TEXT_SHOW_PASSWORD = "show_password";
    field public static final java.lang.String TIME_12_24 = "time_12_24";
    field public static final deprecated java.lang.String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
    field public static final deprecated java.lang.String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
    field public static final java.lang.String USER_ROTATION = "user_rotation";
    field public static final deprecated java.lang.String USE_GOOGLE_MAIL = "use_google_mail";
    field public static final java.lang.String VIBRATE_ON = "vibrate_on";
    field public static final java.lang.String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
    field public static final deprecated java.lang.String WAIT_FOR_DEBUGGER = "wait_for_debugger";
    field public static final deprecated java.lang.String WALLPAPER_ACTIVITY = "wallpaper_activity";
    field public static final deprecated java.lang.String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
    field public static final deprecated java.lang.String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = "wifi_mobile_data_transition_wakelock_timeout_ms";
    field public static final deprecated java.lang.String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = "wifi_networks_available_notification_on";
    field public static final deprecated java.lang.String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = "wifi_networks_available_repeat_delay";
    field public static final deprecated java.lang.String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
    field public static final deprecated java.lang.String WIFI_ON = "wifi_on";
    field public static final deprecated java.lang.String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
    field public static final deprecated int WIFI_SLEEP_POLICY_DEFAULT = 0; // 0x0
    field public static final deprecated int WIFI_SLEEP_POLICY_NEVER = 2; // 0x2
    field public static final deprecated int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; // 0x1
    field public static final deprecated java.lang.String WIFI_STATIC_DNS1 = "wifi_static_dns1";
    field public static final deprecated java.lang.String WIFI_STATIC_DNS2 = "wifi_static_dns2";
    field public static final deprecated java.lang.String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
    field public static final deprecated java.lang.String WIFI_STATIC_IP = "wifi_static_ip";
    field public static final deprecated java.lang.String WIFI_STATIC_NETMASK = "wifi_static_netmask";
    field public static final deprecated java.lang.String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = "wifi_watchdog_acceptable_packet_loss_percentage";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = "wifi_watchdog_background_check_delay_ms";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = "wifi_watchdog_background_check_enabled";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = "wifi_watchdog_background_check_timeout_ms";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = "wifi_watchdog_initial_ignored_ping_count";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
    field public static final deprecated java.lang.String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
    field public static final deprecated java.lang.String WINDOW_ANIMATION_SCALE = "window_animation_scale";
  }

  public class SettingsSlicesContract {
    field public static final java.lang.String AUTHORITY = "android.settings.slices";
    field public static final android.net.Uri BASE_URI;
    field public static final java.lang.String KEY_AIRPLANE_MODE = "airplane_mode";
    field public static final java.lang.String KEY_BATTERY_SAVER = "battery_saver";
    field public static final java.lang.String KEY_BLUETOOTH = "bluetooth";
    field public static final java.lang.String KEY_LOCATION = "location";
    field public static final java.lang.String KEY_WIFI = "wifi";
    field public static final java.lang.String PATH_SETTING_ACTION = "action";
    field public static final java.lang.String PATH_SETTING_INTENT = "intent";
  }

  public class SyncStateContract {
    ctor public SyncStateContract();
  }

  public static abstract interface SyncStateContract.Columns implements android.provider.BaseColumns {
    field public static final java.lang.String ACCOUNT_NAME = "account_name";
    field public static final java.lang.String ACCOUNT_TYPE = "account_type";
    field public static final java.lang.String DATA = "data";
  }

  public static class SyncStateContract.Constants implements android.provider.SyncStateContract.Columns {
    ctor public SyncStateContract.Constants();
    field public static final java.lang.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 abstract interface Telephony.BaseMmsColumns implements android.provider.BaseColumns {
    field public static final java.lang.String CONTENT_CLASS = "ct_cls";
    field public static final java.lang.String CONTENT_LOCATION = "ct_l";
    field public static final java.lang.String CONTENT_TYPE = "ct_t";
    field public static final java.lang.String CREATOR = "creator";
    field public static final java.lang.String DATE = "date";
    field public static final java.lang.String DATE_SENT = "date_sent";
    field public static final java.lang.String DELIVERY_REPORT = "d_rpt";
    field public static final java.lang.String DELIVERY_TIME = "d_tm";
    field public static final java.lang.String EXPIRY = "exp";
    field public static final java.lang.String LOCKED = "locked";
    field public static final java.lang.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 java.lang.String MESSAGE_CLASS = "m_cls";
    field public static final java.lang.String MESSAGE_ID = "m_id";
    field public static final java.lang.String MESSAGE_SIZE = "m_size";
    field public static final java.lang.String MESSAGE_TYPE = "m_type";
    field public static final java.lang.String MMS_VERSION = "v";
    field public static final java.lang.String PRIORITY = "pri";
    field public static final java.lang.String READ = "read";
    field public static final java.lang.String READ_REPORT = "rr";
    field public static final java.lang.String READ_STATUS = "read_status";
    field public static final java.lang.String REPORT_ALLOWED = "rpt_a";
    field public static final java.lang.String RESPONSE_STATUS = "resp_st";
    field public static final java.lang.String RESPONSE_TEXT = "resp_txt";
    field public static final java.lang.String RETRIEVE_STATUS = "retr_st";
    field public static final java.lang.String RETRIEVE_TEXT = "retr_txt";
    field public static final java.lang.String RETRIEVE_TEXT_CHARSET = "retr_txt_cs";
    field public static final java.lang.String SEEN = "seen";
    field public static final java.lang.String STATUS = "st";
    field public static final java.lang.String SUBJECT = "sub";
    field public static final java.lang.String SUBJECT_CHARSET = "sub_cs";
    field public static final java.lang.String SUBSCRIPTION_ID = "sub_id";
    field public static final java.lang.String TEXT_ONLY = "text_only";
    field public static final java.lang.String THREAD_ID = "thread_id";
    field public static final java.lang.String TRANSACTION_ID = "tr_id";
  }

  public static abstract interface Telephony.CanonicalAddressesColumns implements android.provider.BaseColumns {
    field public static final java.lang.String ADDRESS = "address";
  }

  public static final class Telephony.CarrierId implements android.provider.BaseColumns {
    method public static android.net.Uri getUriForSubscriptionId(int);
    field public static final java.lang.String CARRIER_ID = "carrier_id";
    field public static final java.lang.String CARRIER_NAME = "carrier_name";
    field public static final android.net.Uri CONTENT_URI;
  }

  public static final class Telephony.Carriers implements android.provider.BaseColumns {
    field public static final java.lang.String APN = "apn";
    field public static final java.lang.String AUTH_TYPE = "authtype";
    field public static final deprecated java.lang.String BEARER = "bearer";
    field public static final java.lang.String CARRIER_ENABLED = "carrier_enabled";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String CURRENT = "current";
    field public static final java.lang.String DEFAULT_SORT_ORDER = "name ASC";
    field public static final java.lang.String MCC = "mcc";
    field public static final java.lang.String MMSC = "mmsc";
    field public static final java.lang.String MMSPORT = "mmsport";
    field public static final java.lang.String MMSPROXY = "mmsproxy";
    field public static final java.lang.String MNC = "mnc";
    field public static final java.lang.String MVNO_MATCH_DATA = "mvno_match_data";
    field public static final java.lang.String MVNO_TYPE = "mvno_type";
    field public static final java.lang.String NAME = "name";
    field public static final java.lang.String NETWORK_TYPE_BITMASK = "network_type_bitmask";
    field public static final java.lang.String NUMERIC = "numeric";
    field public static final java.lang.String PASSWORD = "password";
    field public static final java.lang.String PORT = "port";
    field public static final java.lang.String PROTOCOL = "protocol";
    field public static final java.lang.String PROXY = "proxy";
    field public static final java.lang.String ROAMING_PROTOCOL = "roaming_protocol";
    field public static final java.lang.String SERVER = "server";
    field public static final java.lang.String SUBSCRIPTION_ID = "sub_id";
    field public static final java.lang.String TYPE = "type";
    field public static final java.lang.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 java.lang.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 java.lang.String ADDRESS = "address";
    field public static final java.lang.String CHARSET = "charset";
    field public static final java.lang.String CONTACT_ID = "contact_id";
    field public static final java.lang.String MSG_ID = "msg_id";
    field public static final java.lang.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 java.lang.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 java.lang.String DEFAULT_SORT_ORDER = "date DESC";
  }

  public static final class Telephony.Mms.Intents {
    field public static final java.lang.String CONTENT_CHANGED_ACTION = "android.intent.action.CONTENT_CHANGED";
    field public static final java.lang.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 java.lang.String DEFAULT_SORT_ORDER = "date DESC";
  }

  public static final class Telephony.Mms.Part implements android.provider.BaseColumns {
    field public static final java.lang.String CHARSET = "chset";
    field public static final java.lang.String CONTENT_DISPOSITION = "cd";
    field public static final java.lang.String CONTENT_ID = "cid";
    field public static final java.lang.String CONTENT_LOCATION = "cl";
    field public static final java.lang.String CONTENT_TYPE = "ct";
    field public static final java.lang.String CT_START = "ctt_s";
    field public static final java.lang.String CT_TYPE = "ctt_t";
    field public static final java.lang.String FILENAME = "fn";
    field public static final java.lang.String MSG_ID = "mid";
    field public static final java.lang.String NAME = "name";
    field public static final java.lang.String SEQ = "seq";
    field public static final java.lang.String TEXT = "text";
    field public static final java.lang.String _DATA = "_data";
  }

  public static final class Telephony.Mms.Rate {
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.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 java.lang.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 java.lang.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 java.lang.String DUE_TIME = "due_time";
    field public static final java.lang.String ERROR_CODE = "err_code";
    field public static final java.lang.String ERROR_TYPE = "err_type";
    field public static final java.lang.String LAST_TRY = "last_try";
    field public static final java.lang.String MSG_ID = "msg_id";
    field public static final java.lang.String MSG_TYPE = "msg_type";
    field public static final java.lang.String PROTO_TYPE = "proto_type";
    field public static final java.lang.String RETRY_INDEX = "retry_index";
    field public static final java.lang.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, java.lang.String);
    field public static final java.lang.String AUTHORITY = "service-state";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String IS_MANUAL_NETWORK_SELECTION = "is_manual_network_selection";
    field public static final java.lang.String VOICE_OPERATOR_NUMERIC = "voice_operator_numeric";
    field public static final java.lang.String VOICE_REG_STATE = "voice_reg_state";
  }

  public static final class Telephony.Sms implements android.provider.BaseColumns android.provider.Telephony.TextBasedSmsColumns {
    method public static java.lang.String getDefaultSmsPackage(android.content.Context);
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.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 java.lang.String DEFAULT_SORT_ORDER = "date DESC";
    field public static final java.lang.String MESSAGE_COUNT = "msg_count";
    field public static final java.lang.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 java.lang.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 java.lang.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 java.lang.String ACTION_CHANGE_DEFAULT = "android.provider.Telephony.ACTION_CHANGE_DEFAULT";
    field public static final java.lang.String ACTION_DEFAULT_SMS_PACKAGE_CHANGED = "android.provider.action.DEFAULT_SMS_PACKAGE_CHANGED";
    field public static final java.lang.String ACTION_EXTERNAL_PROVIDER_CHANGE = "android.provider.action.EXTERNAL_PROVIDER_CHANGE";
    field public static final java.lang.String DATA_SMS_RECEIVED_ACTION = "android.intent.action.DATA_SMS_RECEIVED";
    field public static final java.lang.String EXTRA_IS_DEFAULT_SMS_APP = "android.provider.extra.IS_DEFAULT_SMS_APP";
    field public static final java.lang.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 public static final deprecated java.lang.String SECRET_CODE_ACTION = "android.provider.Telephony.SECRET_CODE";
    field public static final java.lang.String SIM_FULL_ACTION = "android.provider.Telephony.SIM_FULL";
    field public static final java.lang.String SMS_CB_RECEIVED_ACTION = "android.provider.Telephony.SMS_CB_RECEIVED";
    field public static final java.lang.String SMS_DELIVER_ACTION = "android.provider.Telephony.SMS_DELIVER";
    field public static final java.lang.String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_RECEIVED";
    field public static final java.lang.String SMS_REJECTED_ACTION = "android.provider.Telephony.SMS_REJECTED";
    field public static final java.lang.String SMS_SERVICE_CATEGORY_PROGRAM_DATA_RECEIVED_ACTION = "android.provider.Telephony.SMS_SERVICE_CATEGORY_PROGRAM_DATA_RECEIVED";
    field public static final java.lang.String WAP_PUSH_DELIVER_ACTION = "android.provider.Telephony.WAP_PUSH_DELIVER";
    field public static final java.lang.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 java.lang.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 java.lang.String DEFAULT_SORT_ORDER = "date DESC";
  }

  public static abstract interface Telephony.TextBasedSmsColumns {
    field public static final java.lang.String ADDRESS = "address";
    field public static final java.lang.String BODY = "body";
    field public static final java.lang.String CREATOR = "creator";
    field public static final java.lang.String DATE = "date";
    field public static final java.lang.String DATE_SENT = "date_sent";
    field public static final java.lang.String ERROR_CODE = "error_code";
    field public static final java.lang.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 java.lang.String PERSON = "person";
    field public static final java.lang.String PROTOCOL = "protocol";
    field public static final java.lang.String READ = "read";
    field public static final java.lang.String REPLY_PATH_PRESENT = "reply_path_present";
    field public static final java.lang.String SEEN = "seen";
    field public static final java.lang.String SERVICE_CENTER = "service_center";
    field public static final java.lang.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 java.lang.String SUBJECT = "subject";
    field public static final java.lang.String SUBSCRIPTION_ID = "sub_id";
    field public static final java.lang.String THREAD_ID = "thread_id";
    field public static final java.lang.String TYPE = "type";
  }

  public static final class Telephony.Threads implements android.provider.Telephony.ThreadsColumns {
    method public static long getOrCreateThreadId(android.content.Context, java.lang.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 abstract interface Telephony.ThreadsColumns implements android.provider.BaseColumns {
    field public static final java.lang.String ARCHIVED = "archived";
    field public static final java.lang.String DATE = "date";
    field public static final java.lang.String ERROR = "error";
    field public static final java.lang.String HAS_ATTACHMENT = "has_attachment";
    field public static final java.lang.String MESSAGE_COUNT = "message_count";
    field public static final java.lang.String READ = "read";
    field public static final java.lang.String RECIPIENT_IDS = "recipient_ids";
    field public static final java.lang.String SNIPPET = "snippet";
    field public static final java.lang.String SNIPPET_CHARSET = "snippet_cs";
    field public static final java.lang.String TYPE = "type";
  }

  public class UserDictionary {
    ctor public UserDictionary();
    field public static final java.lang.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 public static deprecated void addWord(android.content.Context, java.lang.String, int, int);
    method public static void addWord(android.content.Context, java.lang.String, int, java.lang.String, java.util.Locale);
    field public static final java.lang.String APP_ID = "appid";
    field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.google.userword";
    field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.google.userword";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String DEFAULT_SORT_ORDER = "frequency DESC";
    field public static final java.lang.String FREQUENCY = "frequency";
    field public static final java.lang.String LOCALE = "locale";
    field public static final deprecated int LOCALE_TYPE_ALL = 0; // 0x0
    field public static final deprecated int LOCALE_TYPE_CURRENT = 1; // 0x1
    field public static final java.lang.String SHORTCUT = "shortcut";
    field public static final java.lang.String WORD = "word";
    field public static final java.lang.String _ID = "_id";
  }

  public class VoicemailContract {
    field public static final java.lang.String ACTION_FETCH_VOICEMAIL = "android.intent.action.FETCH_VOICEMAIL";
    field public static final java.lang.String ACTION_NEW_VOICEMAIL = "android.intent.action.NEW_VOICEMAIL";
    field public static final java.lang.String ACTION_SYNC_VOICEMAIL = "android.provider.action.SYNC_VOICEMAIL";
    field public static final java.lang.String AUTHORITY = "com.android.voicemail";
    field public static final java.lang.String EXTRA_PHONE_ACCOUNT_HANDLE = "android.provider.extra.PHONE_ACCOUNT_HANDLE";
    field public static final java.lang.String EXTRA_SELF_CHANGE = "com.android.voicemail.extra.SELF_CHANGE";
    field public static final java.lang.String PARAM_KEY_SOURCE_PACKAGE = "source_package";
  }

  public static final class VoicemailContract.Status implements android.provider.BaseColumns {
    method public static android.net.Uri buildSourceUri(java.lang.String);
    field public static final java.lang.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 java.lang.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 java.lang.String DIR_TYPE = "vnd.android.cursor.dir/voicemail.source.status";
    field public static final java.lang.String ITEM_TYPE = "vnd.android.cursor.item/voicemail.source.status";
    field public static final java.lang.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 java.lang.String PHONE_ACCOUNT_COMPONENT_NAME = "phone_account_component_name";
    field public static final java.lang.String PHONE_ACCOUNT_ID = "phone_account_id";
    field public static final java.lang.String QUOTA_OCCUPIED = "quota_occupied";
    field public static final java.lang.String QUOTA_TOTAL = "quota_total";
    field public static final int QUOTA_UNAVAILABLE = -1; // 0xffffffff
    field public static final java.lang.String SETTINGS_URI = "settings_uri";
    field public static final java.lang.String SOURCE_PACKAGE = "source_package";
    field public static final java.lang.String SOURCE_TYPE = "source_type";
    field public static final java.lang.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(java.lang.String);
    field public static final java.lang.String ARCHIVED = "archived";
    field public static final java.lang.String BACKED_UP = "backed_up";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String DATE = "date";
    field public static final java.lang.String DELETED = "deleted";
    field public static final java.lang.String DIRTY = "dirty";
    field public static final int DIRTY_RETAIN = -1; // 0xffffffff
    field public static final java.lang.String DIR_TYPE = "vnd.android.cursor.dir/voicemails";
    field public static final java.lang.String DURATION = "duration";
    field public static final java.lang.String HAS_CONTENT = "has_content";
    field public static final java.lang.String IS_OMTP_VOICEMAIL = "is_omtp_voicemail";
    field public static final java.lang.String IS_READ = "is_read";
    field public static final java.lang.String ITEM_TYPE = "vnd.android.cursor.item/voicemail";
    field public static final java.lang.String LAST_MODIFIED = "last_modified";
    field public static final java.lang.String MIME_TYPE = "mime_type";
    field public static final java.lang.String NEW = "new";
    field public static final java.lang.String NUMBER = "number";
    field public static final java.lang.String PHONE_ACCOUNT_COMPONENT_NAME = "subscription_component_name";
    field public static final java.lang.String PHONE_ACCOUNT_ID = "subscription_id";
    field public static final java.lang.String RESTORED = "restored";
    field public static final java.lang.String SOURCE_DATA = "source_data";
    field public static final java.lang.String SOURCE_PACKAGE = "source_package";
    field public static final java.lang.String TRANSCRIPTION = "transcription";
  }

}

package android.renderscript {

  public class Allocation extends android.renderscript.BaseObj {
    method public void copy1DRangeFrom(int, int, java.lang.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, java.lang.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, java.lang.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, java.lang.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, java.lang.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, java.lang.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, java.lang.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, java.lang.Object);
    method public void copyFrom(android.renderscript.BaseObj[]);
    method public void copyFrom(java.lang.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(java.lang.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(java.lang.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, java.lang.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 public deprecated synchronized 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 static final class Allocation.MipmapControl extends java.lang.Enum {
    method public static android.renderscript.Allocation.MipmapControl valueOf(java.lang.String);
    method public static final android.renderscript.Allocation.MipmapControl[] values();
    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 abstract interface Allocation.OnBufferAvailableListener {
    method public abstract 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 synchronized 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 java.lang.String getName();
    method public void setName(java.lang.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 public static deprecated 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 java.lang.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, java.lang.String, int);
    method public android.renderscript.Element.Builder add(android.renderscript.Element, java.lang.String);
    method public android.renderscript.Element create();
  }

  public static final class Element.DataKind extends java.lang.Enum {
    method public static android.renderscript.Element.DataKind valueOf(java.lang.String);
    method public static final android.renderscript.Element.DataKind[] values();
    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 static final class Element.DataType extends java.lang.Enum {
    method public static android.renderscript.Element.DataType valueOf(java.lang.String);
    method public static final android.renderscript.Element.DataType[] values();
    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(java.lang.String);
  }

  public class RSIllegalArgumentException extends android.renderscript.RSRuntimeException {
    ctor public RSIllegalArgumentException(java.lang.String);
  }

  public class RSInvalidStateException extends android.renderscript.RSRuntimeException {
    ctor public RSInvalidStateException(java.lang.String);
  }

  public class RSRuntimeException extends java.lang.RuntimeException {
    ctor public RSRuntimeException(java.lang.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 static final class RenderScript.ContextType extends java.lang.Enum {
    method public static android.renderscript.RenderScript.ContextType valueOf(java.lang.String);
    method public static final android.renderscript.RenderScript.ContextType[] values();
    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 static final class RenderScript.Priority extends java.lang.Enum {
    method public static android.renderscript.RenderScript.Priority valueOf(java.lang.String);
    method public static final android.renderscript.RenderScript.Priority[] values();
    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 java.lang.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 static final class Sampler.Value extends java.lang.Enum {
    method public static android.renderscript.Sampler.Value valueOf(java.lang.String);
    method public static final android.renderscript.Sampler.Value[] values();
    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(java.lang.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, java.lang.String, byte[], byte[]);
  }

  public final class ScriptGroup extends android.renderscript.BaseObj {
    method public java.lang.Object[] execute(java.lang.Object...);
    method public deprecated void execute();
    method public deprecated void setInput(android.renderscript.Script.KernelID, android.renderscript.Allocation);
    method public deprecated void setOutput(android.renderscript.Script.KernelID, android.renderscript.Allocation);
  }

  public static final class ScriptGroup.Binding {
    ctor public ScriptGroup.Binding(android.renderscript.Script.FieldID, java.lang.Object);
  }

  public static final deprecated class ScriptGroup.Builder {
    ctor public ScriptGroup.Builder(android.renderscript.RenderScript);
    method public android.renderscript.ScriptGroup.Builder addConnection(android.renderscript.Type, android.renderscript.Script.KernelID, android.renderscript.Script.FieldID);
    method public android.renderscript.ScriptGroup.Builder addConnection(android.renderscript.Type, android.renderscript.Script.KernelID, android.renderscript.Script.KernelID);
    method public android.renderscript.ScriptGroup.Builder addKernel(android.renderscript.Script.KernelID);
    method 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(java.lang.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 public static deprecated 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 static final class Type.CubemapFace extends java.lang.Enum {
    method public static android.renderscript.Type.CubemapFace valueOf(java.lang.String);
    method public static final android.renderscript.Type.CubemapFace[] values();
    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 public static final deprecated android.renderscript.Type.CubemapFace POSITVE_X;
    enum_constant public static final deprecated android.renderscript.Type.CubemapFace POSITVE_Y;
    enum_constant public static final deprecated android.renderscript.Type.CubemapFace POSITVE_Z;
  }

}

package android.sax {

  public class Element {
    method public android.sax.Element getChild(java.lang.String);
    method public android.sax.Element getChild(java.lang.String, java.lang.String);
    method public android.sax.Element requireChild(java.lang.String);
    method public android.sax.Element requireChild(java.lang.String, java.lang.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 abstract interface ElementListener implements android.sax.EndElementListener android.sax.StartElementListener {
  }

  public abstract interface EndElementListener {
    method public abstract void end();
  }

  public abstract interface EndTextElementListener {
    method public abstract void end(java.lang.String);
  }

  public class RootElement extends android.sax.Element {
    ctor public RootElement(java.lang.String, java.lang.String);
    ctor public RootElement(java.lang.String);
    method public org.xml.sax.ContentHandler getContentHandler();
  }

  public abstract interface StartElementListener {
    method public abstract void start(org.xml.sax.Attributes);
  }

  public abstract interface TextElementListener implements android.sax.EndTextElementListener android.sax.StartElementListener {
  }

}

package android.se.omapi {

  public final class Channel implements java.nio.channels.Channel {
    method public void close();
    method public byte[] getSelectResponse();
    method public android.se.omapi.Session getSession();
    method public boolean isBasicChannel();
    method public boolean isOpen();
    method public boolean selectNext() throws java.io.IOException;
    method public byte[] transmit(byte[]) throws java.io.IOException;
  }

  public final class Reader {
    method public void closeSessions();
    method public java.lang.String getName();
    method public android.se.omapi.SEService getSEService();
    method public boolean isSecureElementPresent();
    method public android.se.omapi.Session openSession() throws java.io.IOException;
  }

  public final class SEService {
    ctor public SEService(android.content.Context, java.util.concurrent.Executor, android.se.omapi.SEService.OnConnectedListener);
    method public android.se.omapi.Reader[] getReaders();
    method public java.lang.String getVersion();
    method public boolean isConnected();
    method public void shutdown();
  }

  public static abstract interface SEService.OnConnectedListener {
    method public abstract void onConnected();
  }

  public final class Session {
    method public void close();
    method public void closeChannels();
    method public byte[] getATR();
    method public android.se.omapi.Reader getReader();
    method public boolean isClosed();
    method public android.se.omapi.Channel openBasicChannel(byte[], byte) throws java.io.IOException;
    method public android.se.omapi.Channel openBasicChannel(byte[]) throws java.io.IOException;
    method public android.se.omapi.Channel openLogicalChannel(byte[], byte) throws java.io.IOException;
    method public android.se.omapi.Channel openLogicalChannel(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(java.lang.String);
  }

  public abstract class ConfirmationCallback {
    ctor public ConfirmationCallback();
    method public void onCanceled();
    method public void onConfirmed(byte[]);
    method public void onDismissed();
    method public void onError(java.lang.Throwable);
  }

  public class ConfirmationNotAvailableException extends java.lang.Exception {
    ctor public ConfirmationNotAvailableException();
    ctor public ConfirmationNotAvailableException(java.lang.String);
  }

  public class ConfirmationPrompt {
    method public void cancelPrompt();
    method public static boolean isSupported(android.content.Context);
    method public void presentPrompt(java.util.concurrent.Executor, 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(java.lang.CharSequence);
  }

  public final class KeyChain {
    ctor public KeyChain();
    method public static void choosePrivateKeyAlias(android.app.Activity, android.security.KeyChainAliasCallback, java.lang.String[], java.security.Principal[], java.lang.String, int, java.lang.String);
    method public static void choosePrivateKeyAlias(android.app.Activity, android.security.KeyChainAliasCallback, java.lang.String[], java.security.Principal[], android.net.Uri, java.lang.String);
    method public static android.content.Intent createInstallIntent();
    method public static java.security.cert.X509Certificate[] getCertificateChain(android.content.Context, java.lang.String) throws java.lang.InterruptedException, android.security.KeyChainException;
    method public static java.security.PrivateKey getPrivateKey(android.content.Context, java.lang.String) throws java.lang.InterruptedException, android.security.KeyChainException;
    method public static deprecated boolean isBoundKeyAlgorithm(java.lang.String);
    method public static boolean isKeyAlgorithmSupported(java.lang.String);
    field public static final java.lang.String ACTION_KEYCHAIN_CHANGED = "android.security.action.KEYCHAIN_CHANGED";
    field public static final java.lang.String ACTION_KEY_ACCESS_CHANGED = "android.security.action.KEY_ACCESS_CHANGED";
    field public static final deprecated java.lang.String ACTION_STORAGE_CHANGED = "android.security.STORAGE_CHANGED";
    field public static final java.lang.String ACTION_TRUST_STORE_CHANGED = "android.security.action.TRUST_STORE_CHANGED";
    field public static final java.lang.String EXTRA_CERTIFICATE = "CERT";
    field public static final java.lang.String EXTRA_KEY_ACCESSIBLE = "android.security.extra.KEY_ACCESSIBLE";
    field public static final java.lang.String EXTRA_KEY_ALIAS = "android.security.extra.KEY_ALIAS";
    field public static final java.lang.String EXTRA_NAME = "name";
    field public static final java.lang.String EXTRA_PKCS12 = "PKCS12";
  }

  public abstract interface KeyChainAliasCallback {
    method public abstract void alias(java.lang.String);
  }

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

  public final deprecated class KeyPairGeneratorSpec implements java.security.spec.AlgorithmParameterSpec {
    method public java.security.spec.AlgorithmParameterSpec getAlgorithmParameterSpec();
    method public android.content.Context getContext();
    method public java.util.Date getEndDate();
    method public int getKeySize();
    method public java.lang.String getKeyType();
    method public java.lang.String getKeystoreAlias();
    method public java.math.BigInteger getSerialNumber();
    method public java.util.Date getStartDate();
    method public javax.security.auth.x500.X500Principal getSubjectDN();
    method public boolean isEncryptionRequired();
  }

  public static final deprecated class KeyPairGeneratorSpec.Builder {
    ctor public KeyPairGeneratorSpec.Builder(android.content.Context);
    method public android.security.KeyPairGeneratorSpec build();
    method public android.security.KeyPairGeneratorSpec.Builder setAlgorithmParameterSpec(java.security.spec.AlgorithmParameterSpec);
    method public android.security.KeyPairGeneratorSpec.Builder setAlias(java.lang.String);
    method public android.security.KeyPairGeneratorSpec.Builder setEncryptionRequired();
    method public android.security.KeyPairGeneratorSpec.Builder setEndDate(java.util.Date);
    method public android.security.KeyPairGeneratorSpec.Builder setKeySize(int);
    method public android.security.KeyPairGeneratorSpec.Builder setKeyType(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public android.security.KeyPairGeneratorSpec.Builder setSerialNumber(java.math.BigInteger);
    method public android.security.KeyPairGeneratorSpec.Builder setStartDate(java.util.Date);
    method public android.security.KeyPairGeneratorSpec.Builder setSubject(javax.security.auth.x500.X500Principal);
  }

  public final deprecated class KeyStoreParameter implements java.security.KeyStore.ProtectionParameter {
    method public boolean isEncryptionRequired();
  }

  public static final deprecated class KeyStoreParameter.Builder {
    ctor public KeyStoreParameter.Builder(android.content.Context);
    method public android.security.KeyStoreParameter build();
    method 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(java.lang.String);
  }

}

package android.security.keystore {

  public class KeyExpiredException extends java.security.InvalidKeyException {
    ctor public KeyExpiredException();
    ctor public KeyExpiredException(java.lang.String);
    ctor public KeyExpiredException(java.lang.String, java.lang.Throwable);
  }

  public final class KeyGenParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    method public java.security.spec.AlgorithmParameterSpec getAlgorithmParameterSpec();
    method public byte[] getAttestationChallenge();
    method public java.lang.String[] getBlockModes();
    method public java.util.Date getCertificateNotAfter();
    method public java.util.Date getCertificateNotBefore();
    method public java.math.BigInteger getCertificateSerialNumber();
    method public javax.security.auth.x500.X500Principal getCertificateSubject();
    method public java.lang.String[] getDigests();
    method public java.lang.String[] getEncryptionPaddings();
    method public int getKeySize();
    method public java.util.Date getKeyValidityForConsumptionEnd();
    method public java.util.Date getKeyValidityForOriginationEnd();
    method public java.util.Date getKeyValidityStart();
    method public java.lang.String getKeystoreAlias();
    method public int getPurposes();
    method public java.lang.String[] getSignaturePaddings();
    method public int getUserAuthenticationValidityDurationSeconds();
    method 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(java.lang.String, int);
    method public android.security.keystore.KeyGenParameterSpec build();
    method public android.security.keystore.KeyGenParameterSpec.Builder setAlgorithmParameterSpec(java.security.spec.AlgorithmParameterSpec);
    method public android.security.keystore.KeyGenParameterSpec.Builder setAttestationChallenge(byte[]);
    method public android.security.keystore.KeyGenParameterSpec.Builder setBlockModes(java.lang.String...);
    method public android.security.keystore.KeyGenParameterSpec.Builder setCertificateNotAfter(java.util.Date);
    method public android.security.keystore.KeyGenParameterSpec.Builder setCertificateNotBefore(java.util.Date);
    method public android.security.keystore.KeyGenParameterSpec.Builder setCertificateSerialNumber(java.math.BigInteger);
    method public android.security.keystore.KeyGenParameterSpec.Builder setCertificateSubject(javax.security.auth.x500.X500Principal);
    method public android.security.keystore.KeyGenParameterSpec.Builder setDigests(java.lang.String...);
    method public android.security.keystore.KeyGenParameterSpec.Builder setEncryptionPaddings(java.lang.String...);
    method public android.security.keystore.KeyGenParameterSpec.Builder setInvalidatedByBiometricEnrollment(boolean);
    method public android.security.keystore.KeyGenParameterSpec.Builder setIsStrongBoxBacked(boolean);
    method public android.security.keystore.KeyGenParameterSpec.Builder setKeySize(int);
    method public android.security.keystore.KeyGenParameterSpec.Builder setKeyValidityEnd(java.util.Date);
    method public android.security.keystore.KeyGenParameterSpec.Builder setKeyValidityForConsumptionEnd(java.util.Date);
    method public android.security.keystore.KeyGenParameterSpec.Builder setKeyValidityForOriginationEnd(java.util.Date);
    method public android.security.keystore.KeyGenParameterSpec.Builder setKeyValidityStart(java.util.Date);
    method public android.security.keystore.KeyGenParameterSpec.Builder setRandomizedEncryptionRequired(boolean);
    method public android.security.keystore.KeyGenParameterSpec.Builder setSignaturePaddings(java.lang.String...);
    method public android.security.keystore.KeyGenParameterSpec.Builder setUnlockedDeviceRequired(boolean);
    method public android.security.keystore.KeyGenParameterSpec.Builder setUserAuthenticationRequired(boolean);
    method public android.security.keystore.KeyGenParameterSpec.Builder setUserAuthenticationValidWhileOnBody(boolean);
    method public android.security.keystore.KeyGenParameterSpec.Builder setUserAuthenticationValidityDurationSeconds(int);
    method public android.security.keystore.KeyGenParameterSpec.Builder setUserConfirmationRequired(boolean);
    method public android.security.keystore.KeyGenParameterSpec.Builder setUserPresenceRequired(boolean);
  }

  public class KeyInfo implements java.security.spec.KeySpec {
    method public java.lang.String[] getBlockModes();
    method public java.lang.String[] getDigests();
    method public java.lang.String[] getEncryptionPaddings();
    method public int getKeySize();
    method public java.util.Date getKeyValidityForConsumptionEnd();
    method public java.util.Date getKeyValidityForOriginationEnd();
    method public java.util.Date getKeyValidityStart();
    method public java.lang.String getKeystoreAlias();
    method public int getOrigin();
    method public int getPurposes();
    method public java.lang.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(java.lang.String);
    ctor public KeyNotYetValidException(java.lang.String, java.lang.Throwable);
  }

  public class KeyPermanentlyInvalidatedException extends java.security.InvalidKeyException {
    ctor public KeyPermanentlyInvalidatedException();
    ctor public KeyPermanentlyInvalidatedException(java.lang.String);
    ctor public KeyPermanentlyInvalidatedException(java.lang.String, java.lang.Throwable);
  }

  public abstract class KeyProperties {
    field public static final java.lang.String BLOCK_MODE_CBC = "CBC";
    field public static final java.lang.String BLOCK_MODE_CTR = "CTR";
    field public static final java.lang.String BLOCK_MODE_ECB = "ECB";
    field public static final java.lang.String BLOCK_MODE_GCM = "GCM";
    field public static final java.lang.String DIGEST_MD5 = "MD5";
    field public static final java.lang.String DIGEST_NONE = "NONE";
    field public static final java.lang.String DIGEST_SHA1 = "SHA-1";
    field public static final java.lang.String DIGEST_SHA224 = "SHA-224";
    field public static final java.lang.String DIGEST_SHA256 = "SHA-256";
    field public static final java.lang.String DIGEST_SHA384 = "SHA-384";
    field public static final java.lang.String DIGEST_SHA512 = "SHA-512";
    field public static final java.lang.String ENCRYPTION_PADDING_NONE = "NoPadding";
    field public static final java.lang.String ENCRYPTION_PADDING_PKCS7 = "PKCS7Padding";
    field public static final java.lang.String ENCRYPTION_PADDING_RSA_OAEP = "OAEPPadding";
    field public static final java.lang.String ENCRYPTION_PADDING_RSA_PKCS1 = "PKCS1Padding";
    field public static final deprecated java.lang.String KEY_ALGORITHM_3DES = "DESede";
    field public static final java.lang.String KEY_ALGORITHM_AES = "AES";
    field public static final java.lang.String KEY_ALGORITHM_EC = "EC";
    field public static final java.lang.String KEY_ALGORITHM_HMAC_SHA1 = "HmacSHA1";
    field public static final java.lang.String KEY_ALGORITHM_HMAC_SHA224 = "HmacSHA224";
    field public static final java.lang.String KEY_ALGORITHM_HMAC_SHA256 = "HmacSHA256";
    field public static final java.lang.String KEY_ALGORITHM_HMAC_SHA384 = "HmacSHA384";
    field public static final java.lang.String KEY_ALGORITHM_HMAC_SHA512 = "HmacSHA512";
    field public static final java.lang.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 java.lang.String SIGNATURE_PADDING_RSA_PKCS1 = "PKCS1";
    field public static final java.lang.String SIGNATURE_PADDING_RSA_PSS = "PSS";
  }

  public final class KeyProtection implements java.security.KeyStore.ProtectionParameter {
    method public java.lang.String[] getBlockModes();
    method public java.lang.String[] getDigests();
    method public java.lang.String[] getEncryptionPaddings();
    method public java.util.Date getKeyValidityForConsumptionEnd();
    method public java.util.Date getKeyValidityForOriginationEnd();
    method public java.util.Date getKeyValidityStart();
    method public int getPurposes();
    method public java.lang.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 public android.security.keystore.KeyProtection build();
    method public android.security.keystore.KeyProtection.Builder setBlockModes(java.lang.String...);
    method public android.security.keystore.KeyProtection.Builder setDigests(java.lang.String...);
    method public android.security.keystore.KeyProtection.Builder setEncryptionPaddings(java.lang.String...);
    method public android.security.keystore.KeyProtection.Builder setInvalidatedByBiometricEnrollment(boolean);
    method public android.security.keystore.KeyProtection.Builder setKeyValidityEnd(java.util.Date);
    method public android.security.keystore.KeyProtection.Builder setKeyValidityForConsumptionEnd(java.util.Date);
    method public android.security.keystore.KeyProtection.Builder setKeyValidityForOriginationEnd(java.util.Date);
    method public android.security.keystore.KeyProtection.Builder setKeyValidityStart(java.util.Date);
    method public android.security.keystore.KeyProtection.Builder setRandomizedEncryptionRequired(boolean);
    method public android.security.keystore.KeyProtection.Builder setSignaturePaddings(java.lang.String...);
    method public android.security.keystore.KeyProtection.Builder setUnlockedDeviceRequired(boolean);
    method public android.security.keystore.KeyProtection.Builder setUserAuthenticationRequired(boolean);
    method public android.security.keystore.KeyProtection.Builder setUserAuthenticationValidWhileOnBody(boolean);
    method public android.security.keystore.KeyProtection.Builder setUserAuthenticationValidityDurationSeconds(int);
    method public android.security.keystore.KeyProtection.Builder setUserConfirmationRequired(boolean);
    method public android.security.keystore.KeyProtection.Builder setUserPresenceRequired(boolean);
  }

  public class SecureKeyImportUnavailableException extends java.security.ProviderException {
    ctor public SecureKeyImportUnavailableException();
    ctor public SecureKeyImportUnavailableException(java.lang.String);
    ctor public SecureKeyImportUnavailableException(java.lang.String, java.lang.Throwable);
    ctor public SecureKeyImportUnavailableException(java.lang.Throwable);
  }

  public class StrongBoxUnavailableException extends java.security.ProviderException {
    ctor public StrongBoxUnavailableException();
    ctor public StrongBoxUnavailableException(java.lang.String);
    ctor public StrongBoxUnavailableException(java.lang.String, java.lang.Throwable);
    ctor public StrongBoxUnavailableException(java.lang.Throwable);
  }

  public class UserNotAuthenticatedException extends java.security.InvalidKeyException {
    ctor public UserNotAuthenticatedException();
    ctor public UserNotAuthenticatedException(java.lang.String);
    ctor public UserNotAuthenticatedException(java.lang.String, java.lang.Throwable);
  }

  public class UserPresenceUnavailableException extends java.security.InvalidKeyException {
    ctor public UserPresenceUnavailableException();
    ctor public UserPresenceUnavailableException(java.lang.String);
    ctor public UserPresenceUnavailableException(java.lang.String, java.lang.Throwable);
  }

  public class WrappedKeyEntry implements java.security.KeyStore.Entry {
    ctor public WrappedKeyEntry(byte[], java.lang.String, java.lang.String, java.security.spec.AlgorithmParameterSpec);
    method public java.security.spec.AlgorithmParameterSpec getAlgorithmParameterSpec();
    method public java.lang.String getTransformation();
    method public byte[] getWrappedKeyBytes();
    method public java.lang.String getWrappingKeyAlias();
  }

}

package android.service.autofill {

  public abstract class AutofillService extends android.app.Service {
    ctor public AutofillService();
    method 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(android.service.autofill.FillRequest, android.os.CancellationSignal, android.service.autofill.FillCallback);
    method public abstract void onSaveRequest(android.service.autofill.SaveRequest, android.service.autofill.SaveCallback);
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.autofill.AutofillService";
    field public static final java.lang.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, android.service.autofill.Transformation);
    method public android.service.autofill.BatchUpdates.Builder updateTemplate(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(android.view.autofill.AutofillId, java.util.regex.Pattern, java.lang.String);
    method public android.service.autofill.CharSequenceTransformation.Builder addField(android.view.autofill.AutofillId, java.util.regex.Pattern, java.lang.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(android.widget.RemoteViews);
    method public android.service.autofill.CustomDescription.Builder addChild(int, android.service.autofill.Transformation);
    method public android.service.autofill.CustomDescription.Builder batchUpdate(android.service.autofill.Validator, 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(android.widget.RemoteViews);
    ctor public Dataset.Builder();
    method public android.service.autofill.Dataset build();
    method public android.service.autofill.Dataset.Builder setAuthentication(android.content.IntentSender);
    method public android.service.autofill.Dataset.Builder setId(java.lang.String);
    method public android.service.autofill.Dataset.Builder setValue(android.view.autofill.AutofillId, android.view.autofill.AutofillValue);
    method public android.service.autofill.Dataset.Builder setValue(android.view.autofill.AutofillId, android.view.autofill.AutofillValue, android.widget.RemoteViews);
    method public android.service.autofill.Dataset.Builder setValue(android.view.autofill.AutofillId, android.view.autofill.AutofillValue, java.util.regex.Pattern);
    method public android.service.autofill.Dataset.Builder setValue(android.view.autofill.AutofillId, android.view.autofill.AutofillValue, java.util.regex.Pattern, android.widget.RemoteViews);
  }

  public final class DateTransformation implements android.os.Parcelable android.service.autofill.Transformation {
    ctor public DateTransformation(android.view.autofill.AutofillId, 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(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 public java.util.List<android.service.autofill.FieldClassification.Match> getMatches();
  }

  public static final class FieldClassification.Match {
    method public java.lang.String getCategoryId();
    method public float getScore();
  }

  public final class FillCallback {
    method public void onFailure(java.lang.CharSequence);
    method public void onSuccess(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 public deprecated android.os.Bundle getClientState();
    method 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 public java.util.Map<android.view.autofill.AutofillId, java.lang.String> getChangedFields();
    method public android.os.Bundle getClientState();
    method public java.lang.String getDatasetId();
    method public java.util.Map<android.view.autofill.AutofillId, android.service.autofill.FieldClassification> getFieldsClassification();
    method public java.util.Set<java.lang.String> getIgnoredDatasetIds();
    method public java.util.Map<android.view.autofill.AutofillId, java.util.Set<java.lang.String>> getManuallyEnteredField();
    method 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 public android.os.Bundle getClientState();
    method 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 public android.service.autofill.FillResponse.Builder addDataset(android.service.autofill.Dataset);
    method public android.service.autofill.FillResponse build();
    method public android.service.autofill.FillResponse.Builder disableAutofill(long);
    method public android.service.autofill.FillResponse.Builder setAuthentication(android.view.autofill.AutofillId[], android.content.IntentSender, android.widget.RemoteViews);
    method public android.service.autofill.FillResponse.Builder setClientState(android.os.Bundle);
    method public android.service.autofill.FillResponse.Builder setFieldClassificationIds(android.view.autofill.AutofillId...);
    method public android.service.autofill.FillResponse.Builder setFlags(int);
    method public android.service.autofill.FillResponse.Builder setFooter(android.widget.RemoteViews);
    method public android.service.autofill.FillResponse.Builder setHeader(android.widget.RemoteViews);
    method public android.service.autofill.FillResponse.Builder setIgnoredIds(android.view.autofill.AutofillId...);
    method public android.service.autofill.FillResponse.Builder setSaveInfo(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 public deprecated ImageTransformation.Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int);
    ctor public ImageTransformation.Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int, java.lang.CharSequence);
    method public deprecated android.service.autofill.ImageTransformation.Builder addOption(java.util.regex.Pattern, int);
    method public android.service.autofill.ImageTransformation.Builder addOption(java.util.regex.Pattern, int, java.lang.CharSequence);
    method public android.service.autofill.ImageTransformation build();
  }

  public final class LuhnChecksumValidator implements android.os.Parcelable android.service.autofill.Validator {
    ctor public LuhnChecksumValidator(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(android.view.autofill.AutofillId, 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 abstract interface Sanitizer {
  }

  public final class SaveCallback {
    method public void onFailure(java.lang.CharSequence);
    method public void onSuccess();
    method public void onSuccess(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, android.view.autofill.AutofillId[]);
    ctor public SaveInfo.Builder(int);
    method public android.service.autofill.SaveInfo.Builder addSanitizer(android.service.autofill.Sanitizer, android.view.autofill.AutofillId...);
    method public android.service.autofill.SaveInfo build();
    method public android.service.autofill.SaveInfo.Builder setCustomDescription(android.service.autofill.CustomDescription);
    method public android.service.autofill.SaveInfo.Builder setDescription(java.lang.CharSequence);
    method public android.service.autofill.SaveInfo.Builder setFlags(int);
    method public android.service.autofill.SaveInfo.Builder setNegativeAction(int, android.content.IntentSender);
    method public android.service.autofill.SaveInfo.Builder setOptionalIds(android.view.autofill.AutofillId[]);
    method public android.service.autofill.SaveInfo.Builder setTriggerId(android.view.autofill.AutofillId);
    method public android.service.autofill.SaveInfo.Builder setValidator(android.service.autofill.Validator);
  }

  public final class SaveRequest implements android.os.Parcelable {
    method public int describeContents();
    method public android.os.Bundle getClientState();
    method public java.util.List<java.lang.String> getDatasetIds();
    method 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(java.util.regex.Pattern, java.lang.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 abstract interface Transformation {
  }

  public final class UserData implements android.os.Parcelable {
    method public int describeContents();
    method public java.lang.String getFieldClassificationAlgorithm();
    method public java.lang.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(java.lang.String, java.lang.String, java.lang.String);
    method public android.service.autofill.UserData.Builder add(java.lang.String, java.lang.String);
    method public android.service.autofill.UserData build();
    method public android.service.autofill.UserData.Builder setFieldClassificationAlgorithm(java.lang.String, android.os.Bundle);
  }

  public abstract interface Validator {
  }

  public final class Validators {
    method public static android.service.autofill.Validator and(android.service.autofill.Validator...);
    method public static android.service.autofill.Validator not(android.service.autofill.Validator);
    method public static android.service.autofill.Validator or(android.service.autofill.Validator...);
  }

}

package android.service.carrier {

  public class CarrierIdentifier implements android.os.Parcelable {
    ctor public CarrierIdentifier(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    ctor public CarrierIdentifier(byte[], java.lang.String, java.lang.String);
    method public int describeContents();
    method public java.lang.String getGid1();
    method public java.lang.String getGid2();
    method public java.lang.String getImsi();
    method public java.lang.String getMcc();
    method public java.lang.String getMnc();
    method public java.lang.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 public android.os.IBinder onBind(android.content.Intent);
    method public void onDownloadMms(android.net.Uri, int, android.net.Uri, android.service.carrier.CarrierMessagingService.ResultCallback<java.lang.Integer>);
    method public deprecated void onFilterSms(android.service.carrier.MessagePdu, java.lang.String, int, int, android.service.carrier.CarrierMessagingService.ResultCallback<java.lang.Boolean>);
    method public void onReceiveTextSms(android.service.carrier.MessagePdu, java.lang.String, int, int, android.service.carrier.CarrierMessagingService.ResultCallback<java.lang.Integer>);
    method public deprecated void onSendDataSms(byte[], int, java.lang.String, int, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendSmsResult>);
    method public void onSendDataSms(byte[], int, java.lang.String, int, int, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendSmsResult>);
    method public void onSendMms(android.net.Uri, int, android.net.Uri, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendMmsResult>);
    method public deprecated void onSendMultipartTextSms(java.util.List<java.lang.String>, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendMultipartSmsResult>);
    method public void onSendMultipartTextSms(java.util.List<java.lang.String>, int, java.lang.String, int, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendMultipartSmsResult>);
    method public deprecated void onSendTextSms(java.lang.String, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendSmsResult>);
    method public void onSendTextSms(java.lang.String, int, java.lang.String, int, 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 java.lang.String SERVICE_INTERFACE = "android.service.carrier.CarrierMessagingService";
  }

  public static abstract interface CarrierMessagingService.ResultCallback<T> {
    method public abstract void onReceiveResult(T) throws android.os.RemoteException;
  }

  public static final class CarrierMessagingService.SendMmsResult {
    ctor public CarrierMessagingService.SendMmsResult(int, byte[]);
    method public byte[] getSendConfPdu();
    method public int getSendStatus();
  }

  public static final class CarrierMessagingService.SendMultipartSmsResult {
    ctor public CarrierMessagingService.SendMultipartSmsResult(int, int[]);
    method 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 public android.os.IBinder onBind(android.content.Intent);
    method public abstract android.os.PersistableBundle onLoadConfig(android.service.carrier.CarrierIdentifier);
    field public static final java.lang.String CARRIER_SERVICE_INTERFACE = "android.service.carrier.CarrierService";
  }

  public final class MessagePdu implements android.os.Parcelable {
    ctor public MessagePdu(java.util.List<byte[]>);
    method public int describeContents();
    method 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(java.lang.CharSequence, android.graphics.drawable.Icon, float, android.content.ComponentName, 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 java.lang.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 java.lang.String BIND_PERMISSION = "android.permission.BIND_CHOOSER_TARGET_SERVICE";
    field public static final java.lang.String META_DATA_NAME = "android.service.chooser.chooser_target_service";
    field public static final java.lang.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(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 public final <T extends android.view.View> T requireViewById(int);
    method public void setContentView(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 java.lang.String DREAM_META_DATA = "android.service.dream";
    field public static final java.lang.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, java.lang.String[]);
    method public final android.os.Bundle getBrowserRootHints();
    method public final android.media.session.MediaSessionManager.RemoteUserInfo getCurrentBrowserInfo();
    method public android.media.session.MediaSession.Token getSessionToken();
    method public void notifyChildrenChanged(java.lang.String);
    method public void notifyChildrenChanged(java.lang.String, android.os.Bundle);
    method public android.os.IBinder onBind(android.content.Intent);
    method public abstract android.service.media.MediaBrowserService.BrowserRoot onGetRoot(java.lang.String, int, android.os.Bundle);
    method public abstract void onLoadChildren(java.lang.String, android.service.media.MediaBrowserService.Result<java.util.List<android.media.browse.MediaBrowser.MediaItem>>);
    method public void onLoadChildren(java.lang.String, android.service.media.MediaBrowserService.Result<java.util.List<android.media.browse.MediaBrowser.MediaItem>>, android.os.Bundle);
    method public void onLoadItem(java.lang.String, android.service.media.MediaBrowserService.Result<android.media.browse.MediaBrowser.MediaItem>);
    method public void setSessionToken(android.media.session.MediaSession.Token);
    field public static final java.lang.String SERVICE_INTERFACE = "android.media.browse.MediaBrowserService";
  }

  public static final class MediaBrowserService.BrowserRoot {
    ctor public MediaBrowserService.BrowserRoot(java.lang.String, android.os.Bundle);
    method public android.os.Bundle getExtras();
    method public java.lang.String getRootId();
    field public static final java.lang.String EXTRA_OFFLINE = "android.service.media.extra.OFFLINE";
    field public static final java.lang.String EXTRA_RECENT = "android.service.media.extra.RECENT";
    field public static final java.lang.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, java.lang.String, int);
    ctor public Condition(android.net.Uri, java.lang.String, java.lang.String, java.lang.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, java.lang.String);
    method public static android.net.Uri.Builder newId(android.content.Context);
    method public static java.lang.String relevanceToString(int);
    method public static java.lang.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 java.lang.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 java.lang.String line1;
    field public final java.lang.String line2;
    field public final int state;
    field public final java.lang.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 java.lang.String EXTRA_RULE_ID = "android.service.notification.extra.RULE_ID";
    field public static final java.lang.String META_DATA_CONFIGURATION_ACTIVITY = "android.service.zen.automatic.configurationActivity";
    field public static final java.lang.String META_DATA_RULE_INSTANCE_LIMIT = "android.service.zen.automatic.ruleInstanceLimit";
    field public static final java.lang.String META_DATA_RULE_TYPE = "android.service.zen.automatic.ruleType";
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.notification.ConditionProviderService";
  }

  public abstract class NotificationListenerService extends android.app.Service {
    ctor public NotificationListenerService();
    method public final void cancelAllNotifications();
    method public final deprecated void cancelNotification(java.lang.String, java.lang.String, int);
    method public final void cancelNotification(java.lang.String);
    method public final void cancelNotifications(java.lang.String[]);
    method public android.service.notification.StatusBarNotification[] getActiveNotifications();
    method public android.service.notification.StatusBarNotification[] getActiveNotifications(java.lang.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(java.lang.String, android.os.UserHandle);
    method public final java.util.List<android.app.NotificationChannel> getNotificationChannels(java.lang.String, 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(java.lang.String, android.os.UserHandle, android.app.NotificationChannelGroup, int);
    method public void onNotificationChannelModified(java.lang.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(java.lang.String[]);
    method public final void snoozeNotification(java.lang.String, long);
    method public final void updateNotificationChannel(java.lang.String, android.os.UserHandle, 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 java.lang.String SERVICE_INTERFACE = "android.service.notification.NotificationListenerService";
    field public static final deprecated int SUPPRESSED_EFFECT_SCREEN_OFF = 1; // 0x1
    field public static final deprecated 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 java.lang.CharSequence getImportanceExplanation();
    method public java.lang.String getKey();
    method public java.lang.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 java.lang.String[] getOrderedKeys();
    method public boolean getRanking(java.lang.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 public deprecated StatusBarNotification(java.lang.String, java.lang.String, int, java.lang.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 java.lang.String getGroupKey();
    method public int getId();
    method public java.lang.String getKey();
    method public android.app.Notification getNotification();
    method public java.lang.String getOverrideGroupKey();
    method public java.lang.String getPackageName();
    method public long getPostTime();
    method public java.lang.String getTag();
    method public android.os.UserHandle getUser();
    method public deprecated int getUserId();
    method public boolean isClearable();
    method public boolean isGroup();
    method public boolean isOngoing();
    method public void setOverrideGroupKey(java.lang.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 java.lang.CharSequence getContentDescription();
    method public android.graphics.drawable.Icon getIcon();
    method public java.lang.CharSequence getLabel();
    method public int getState();
    method public void setContentDescription(java.lang.CharSequence);
    method public void setIcon(android.graphics.drawable.Icon);
    method public void setLabel(java.lang.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(java.lang.Runnable);
    field public static final java.lang.String ACTION_QS_TILE = "android.service.quicksettings.action.QS_TILE";
    field public static final java.lang.String ACTION_QS_TILE_PREFERENCES = "android.service.quicksettings.action.QS_TILE_PREFERENCES";
    field public static final java.lang.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, java.lang.String, java.lang.String, java.lang.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 java.lang.String SERVICE_INTERFACE = "android.service.textservice.SpellCheckerService";
  }

  public static abstract class SpellCheckerService.Session {
    ctor public SpellCheckerService.Session();
    method public android.os.Bundle getBundle();
    method public java.lang.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 static abstract class AlwaysOnHotwordDetector.Callback {
    ctor public AlwaysOnHotwordDetector.Callback();
    method public abstract void onAvailabilityChanged(int);
    method public abstract void onDetected(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 public android.media.AudioFormat getCaptureAudioFormat();
    method public byte[] getTriggerAudio();
  }

  public class VoiceInteractionService extends android.app.Service {
    ctor public VoiceInteractionService();
    method public final android.service.voice.AlwaysOnHotwordDetector createAlwaysOnHotwordDetector(java.lang.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 java.lang.String SERVICE_INTERFACE = "android.service.voice.VoiceInteractionService";
    field public static final java.lang.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(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.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(java.lang.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(java.lang.String[]);
    method public void onHandleAssist(android.os.Bundle, android.app.assist.AssistStructure, android.app.assist.AssistContent);
    method public void onHandleAssistSecondary(android.os.Bundle, android.app.assist.AssistStructure, android.app.assist.AssistContent, int, int);
    method public void onHandleScreenshot(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 public deprecated java.lang.CharSequence getMessage();
    method 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 java.lang.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 public deprecated java.lang.CharSequence getMessage();
    method 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 public deprecated java.lang.CharSequence getPrompt();
    method 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 public deprecated java.lang.CharSequence getPrompt();
    method 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 java.lang.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(android.content.Context, android.content.ComponentName);
    method public android.os.IBinder onBind(android.content.Intent);
    method public void onCurrentVrActivityChanged(android.content.ComponentName);
    field public static final java.lang.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 java.lang.String SERVICE_INTERFACE = "android.service.wallpaper.WallpaperService";
    field public static final java.lang.String SERVICE_META_DATA = "android.service.wallpaper";
  }

  public class WallpaperService.Engine {
    ctor public WallpaperService.Engine();
    method protected void dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.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(java.lang.String, int, int, int, android.os.Bundle, boolean);
    method 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 abstract interface RecognitionListener {
    method public abstract void onBeginningOfSpeech();
    method public abstract void onBufferReceived(byte[]);
    method public abstract void onEndOfSpeech();
    method public abstract void onError(int);
    method public abstract void onEvent(int, android.os.Bundle);
    method public abstract void onPartialResults(android.os.Bundle);
    method public abstract void onReadyForSpeech(android.os.Bundle);
    method public abstract void onResults(android.os.Bundle);
    method public abstract 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 java.lang.String SERVICE_INTERFACE = "android.speech.RecognitionService";
    field public static final java.lang.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 java.lang.String ACTION_GET_LANGUAGE_DETAILS = "android.speech.action.GET_LANGUAGE_DETAILS";
    field public static final java.lang.String ACTION_RECOGNIZE_SPEECH = "android.speech.action.RECOGNIZE_SPEECH";
    field public static final java.lang.String ACTION_VOICE_SEARCH_HANDS_FREE = "android.speech.action.VOICE_SEARCH_HANDS_FREE";
    field public static final java.lang.String ACTION_WEB_SEARCH = "android.speech.action.WEB_SEARCH";
    field public static final java.lang.String DETAILS_META_DATA = "android.speech.DETAILS";
    field public static final java.lang.String EXTRA_CALLING_PACKAGE = "calling_package";
    field public static final java.lang.String EXTRA_CONFIDENCE_SCORES = "android.speech.extra.CONFIDENCE_SCORES";
    field public static final java.lang.String EXTRA_LANGUAGE = "android.speech.extra.LANGUAGE";
    field public static final java.lang.String EXTRA_LANGUAGE_MODEL = "android.speech.extra.LANGUAGE_MODEL";
    field public static final java.lang.String EXTRA_LANGUAGE_PREFERENCE = "android.speech.extra.LANGUAGE_PREFERENCE";
    field public static final java.lang.String EXTRA_MAX_RESULTS = "android.speech.extra.MAX_RESULTS";
    field public static final java.lang.String EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE = "android.speech.extra.ONLY_RETURN_LANGUAGE_PREFERENCE";
    field public static final java.lang.String EXTRA_ORIGIN = "android.speech.extra.ORIGIN";
    field public static final java.lang.String EXTRA_PARTIAL_RESULTS = "android.speech.extra.PARTIAL_RESULTS";
    field public static final java.lang.String EXTRA_PREFER_OFFLINE = "android.speech.extra.PREFER_OFFLINE";
    field public static final java.lang.String EXTRA_PROMPT = "android.speech.extra.PROMPT";
    field public static final java.lang.String EXTRA_RESULTS = "android.speech.extra.RESULTS";
    field public static final java.lang.String EXTRA_RESULTS_PENDINGINTENT = "android.speech.extra.RESULTS_PENDINGINTENT";
    field public static final java.lang.String EXTRA_RESULTS_PENDINGINTENT_BUNDLE = "android.speech.extra.RESULTS_PENDINGINTENT_BUNDLE";
    field public static final java.lang.String EXTRA_SECURE = "android.speech.extras.EXTRA_SECURE";
    field public static final java.lang.String EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS";
    field public static final java.lang.String EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_MINIMUM_LENGTH_MILLIS";
    field public static final java.lang.String EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS";
    field public static final java.lang.String EXTRA_SUPPORTED_LANGUAGES = "android.speech.extra.SUPPORTED_LANGUAGES";
    field public static final java.lang.String EXTRA_WEB_SEARCH_ONLY = "android.speech.extra.WEB_SEARCH_ONLY";
    field public static final java.lang.String LANGUAGE_MODEL_FREE_FORM = "free_form";
    field public static final java.lang.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 java.lang.String ACTION_VOICE_SEARCH_RESULTS = "android.speech.action.VOICE_SEARCH_RESULTS";
    field public static final java.lang.String EXTRA_VOICE_SEARCH_RESULT_HTML = "android.speech.extras.VOICE_SEARCH_RESULT_HTML";
    field public static final java.lang.String EXTRA_VOICE_SEARCH_RESULT_HTML_BASE_URLS = "android.speech.extras.VOICE_SEARCH_RESULT_HTML_BASE_URLS";
    field public static final java.lang.String EXTRA_VOICE_SEARCH_RESULT_HTTP_HEADERS = "android.speech.extras.EXTRA_VOICE_SEARCH_RESULT_HTTP_HEADERS";
    field public static final java.lang.String EXTRA_VOICE_SEARCH_RESULT_STRINGS = "android.speech.extras.VOICE_SEARCH_RESULT_STRINGS";
    field public static final java.lang.String EXTRA_VOICE_SEARCH_RESULT_URLS = "android.speech.extras.VOICE_SEARCH_RESULT_URLS";
    field public static final java.lang.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 java.lang.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 java.lang.String RESULTS_RECOGNITION = "results_recognition";
  }

}

package android.speech.tts {

  public abstract interface SynthesisCallback {
    method public abstract int audioAvailable(byte[], int, int);
    method public abstract int done();
    method public abstract void error();
    method public abstract void error(int);
    method public abstract int getMaxBufferSize();
    method public abstract boolean hasFinished();
    method public abstract boolean hasStarted();
    method public default void rangeStart(int, int, int);
    method public abstract int start(int, int, int);
  }

  public final class SynthesisRequest {
    ctor public SynthesisRequest(java.lang.String, android.os.Bundle);
    ctor public SynthesisRequest(java.lang.CharSequence, android.os.Bundle);
    method public int getCallerUid();
    method public java.lang.CharSequence getCharSequenceText();
    method public java.lang.String getCountry();
    method public java.lang.String getLanguage();
    method public android.os.Bundle getParams();
    method public int getPitch();
    method public int getSpeechRate();
    method public deprecated java.lang.String getText();
    method public java.lang.String getVariant();
    method public java.lang.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, java.lang.String);
    method public int addEarcon(java.lang.String, java.lang.String, int);
    method public deprecated int addEarcon(java.lang.String, java.lang.String);
    method public int addEarcon(java.lang.String, java.io.File);
    method public int addSpeech(java.lang.String, java.lang.String, int);
    method public int addSpeech(java.lang.CharSequence, java.lang.String, int);
    method public int addSpeech(java.lang.String, java.lang.String);
    method public int addSpeech(java.lang.CharSequence, java.io.File);
    method public deprecated boolean areDefaultsEnforced();
    method public java.util.Set<java.util.Locale> getAvailableLanguages();
    method public java.lang.String getDefaultEngine();
    method public deprecated java.util.Locale getDefaultLanguage();
    method public android.speech.tts.Voice getDefaultVoice();
    method public java.util.List<android.speech.tts.TextToSpeech.EngineInfo> getEngines();
    method public deprecated java.util.Set<java.lang.String> getFeatures(java.util.Locale);
    method public deprecated 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(java.lang.String, int, android.os.Bundle, java.lang.String);
    method public deprecated int playEarcon(java.lang.String, int, java.util.HashMap<java.lang.String, java.lang.String>);
    method public deprecated int playSilence(long, int, java.util.HashMap<java.lang.String, java.lang.String>);
    method public int playSilentUtterance(long, int, java.lang.String);
    method public int setAudioAttributes(android.media.AudioAttributes);
    method public deprecated int setEngineByPackageName(java.lang.String);
    method public int setLanguage(java.util.Locale);
    method public deprecated 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(java.lang.CharSequence, int, android.os.Bundle, java.lang.String);
    method public deprecated int speak(java.lang.String, int, java.util.HashMap<java.lang.String, java.lang.String>);
    method public int stop();
    method public int synthesizeToFile(java.lang.CharSequence, android.os.Bundle, java.io.File, java.lang.String);
    method public deprecated int synthesizeToFile(java.lang.String, java.util.HashMap<java.lang.String, java.lang.String>, java.lang.String);
    field public static final java.lang.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 java.lang.String ACTION_CHECK_TTS_DATA = "android.speech.tts.engine.CHECK_TTS_DATA";
    field public static final java.lang.String ACTION_GET_SAMPLE_TEXT = "android.speech.tts.engine.GET_SAMPLE_TEXT";
    field public static final java.lang.String ACTION_INSTALL_TTS_DATA = "android.speech.tts.engine.INSTALL_TTS_DATA";
    field public static final java.lang.String ACTION_TTS_DATA_INSTALLED = "android.speech.tts.engine.TTS_DATA_INSTALLED";
    field public static final deprecated int CHECK_VOICE_DATA_BAD_DATA = -1; // 0xffffffff
    field public static final int CHECK_VOICE_DATA_FAIL = 0; // 0x0
    field public static final deprecated int CHECK_VOICE_DATA_MISSING_DATA = -2; // 0xfffffffe
    field public static final deprecated 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 java.lang.String EXTRA_AVAILABLE_VOICES = "availableVoices";
    field public static final deprecated java.lang.String EXTRA_CHECK_VOICE_DATA_FOR = "checkVoiceDataFor";
    field public static final java.lang.String EXTRA_SAMPLE_TEXT = "sampleText";
    field public static final deprecated java.lang.String EXTRA_TTS_DATA_INSTALLED = "dataInstalled";
    field public static final java.lang.String EXTRA_UNAVAILABLE_VOICES = "unavailableVoices";
    field public static final deprecated java.lang.String EXTRA_VOICE_DATA_FILES = "dataFiles";
    field public static final deprecated java.lang.String EXTRA_VOICE_DATA_FILES_INFO = "dataFilesInfo";
    field public static final deprecated java.lang.String EXTRA_VOICE_DATA_ROOT_DIRECTORY = "dataRoot";
    field public static final java.lang.String INTENT_ACTION_TTS_SERVICE = "android.intent.action.TTS_SERVICE";
    field public static final deprecated java.lang.String KEY_FEATURE_EMBEDDED_SYNTHESIS = "embeddedTts";
    field public static final java.lang.String KEY_FEATURE_NETWORK_RETRIES_COUNT = "networkRetriesCount";
    field public static final deprecated java.lang.String KEY_FEATURE_NETWORK_SYNTHESIS = "networkTts";
    field public static final java.lang.String KEY_FEATURE_NETWORK_TIMEOUT_MS = "networkTimeoutMs";
    field public static final java.lang.String KEY_FEATURE_NOT_INSTALLED = "notInstalled";
    field public static final java.lang.String KEY_PARAM_PAN = "pan";
    field public static final java.lang.String KEY_PARAM_SESSION_ID = "sessionId";
    field public static final java.lang.String KEY_PARAM_STREAM = "streamType";
    field public static final java.lang.String KEY_PARAM_UTTERANCE_ID = "utteranceId";
    field public static final java.lang.String KEY_PARAM_VOLUME = "volume";
    field public static final java.lang.String SERVICE_META_DATA = "android.speech.tts";
  }

  public static class TextToSpeech.EngineInfo {
    ctor public TextToSpeech.EngineInfo();
    field public int icon;
    field public java.lang.String label;
    field public java.lang.String name;
  }

  public static abstract interface TextToSpeech.OnInitListener {
    method public abstract void onInit(int);
  }

  public static abstract deprecated interface TextToSpeech.OnUtteranceCompletedListener {
    method public abstract void onUtteranceCompleted(java.lang.String);
  }

  public abstract class TextToSpeechService extends android.app.Service {
    ctor public TextToSpeechService();
    method public android.os.IBinder onBind(android.content.Intent);
    method public java.lang.String onGetDefaultVoiceNameFor(java.lang.String, java.lang.String, java.lang.String);
    method protected java.util.Set<java.lang.String> onGetFeaturesForLanguage(java.lang.String, java.lang.String, java.lang.String);
    method protected abstract java.lang.String[] onGetLanguage();
    method public java.util.List<android.speech.tts.Voice> onGetVoices();
    method protected abstract int onIsLanguageAvailable(java.lang.String, java.lang.String, java.lang.String);
    method public int onIsValidVoiceName(java.lang.String);
    method protected abstract int onLoadLanguage(java.lang.String, java.lang.String, java.lang.String);
    method public int onLoadVoice(java.lang.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(java.lang.String, byte[]);
    method public void onBeginSynthesis(java.lang.String, int, int, int);
    method public abstract void onDone(java.lang.String);
    method public abstract deprecated void onError(java.lang.String);
    method public void onError(java.lang.String, int);
    method public void onRangeStart(java.lang.String, int, int, int);
    method public abstract void onStart(java.lang.String);
    method public void onStop(java.lang.String, boolean);
  }

  public class Voice implements android.os.Parcelable {
    ctor public Voice(java.lang.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 java.lang.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(java.lang.String, int);
    ctor public ErrnoException(java.lang.String, int, java.lang.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(java.lang.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(java.lang.String, int) throws android.system.ErrnoException;
    method public static void chown(java.lang.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 java.lang.String[] environ();
    method public static void execv(java.lang.String, java.lang.String[]) throws android.system.ErrnoException;
    method public static void execve(java.lang.String, java.lang.String[], java.lang.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 java.lang.String gai_strerror(int);
    method public static int getegid();
    method public static java.lang.String getenv(java.lang.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(java.lang.String, java.lang.String) throws android.system.ErrnoException;
    method public static java.lang.String if_indextoname(int);
    method public static int if_nametoindex(java.lang.String);
    method public static java.net.InetAddress inet_pton(int, java.lang.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(java.lang.String, int, int) throws android.system.ErrnoException;
    method public static void link(java.lang.String, java.lang.String) throws android.system.ErrnoException;
    method public static void listen(java.io.FileDescriptor, int) throws android.system.ErrnoException;
    method public static java.lang.String[] listxattr(java.lang.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(java.lang.String) throws android.system.ErrnoException;
    method public static void mincore(long, long, byte[]) throws android.system.ErrnoException;
    method public static void mkdir(java.lang.String, int) throws android.system.ErrnoException;
    method public static void mkfifo(java.lang.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(java.lang.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 java.lang.String readlink(java.lang.String) throws android.system.ErrnoException;
    method public static int readv(java.io.FileDescriptor, java.lang.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(java.lang.String) throws android.system.ErrnoException;
    method public static void removexattr(java.lang.String, java.lang.String) throws android.system.ErrnoException;
    method public static void rename(java.lang.String, java.lang.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 public static void setegid(int) throws android.system.ErrnoException;
    method public static void setenv(java.lang.String, java.lang.String, boolean) throws android.system.ErrnoException;
    method public static void seteuid(int) throws android.system.ErrnoException;
    method 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 public static void setuid(int) throws android.system.ErrnoException;
    method public static void setxattr(java.lang.String, java.lang.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(java.lang.String) throws android.system.ErrnoException;
    method public static android.system.StructStatVfs statvfs(java.lang.String) throws android.system.ErrnoException;
    method public static java.lang.String strerror(int);
    method public static java.lang.String strsignal(int);
    method public static void symlink(java.lang.String, java.lang.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(java.lang.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, java.lang.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 java.lang.String errnoName(int);
    method public static java.lang.String gaiName(int);
    field public static final int AF_INET;
    field public static final int AF_INET6;
    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 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 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 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 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_DGRAM;
    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 java.lang.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 {
    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(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    field public final java.lang.String machine;
    field public final java.lang.String nodename;
    field public final java.lang.String release;
    field public final java.lang.String sysname;
    field public final java.lang.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 java.lang.String getRemainingPostDialSequence();
    method 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, java.lang.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(java.lang.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 public static final java.lang.String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts";
    field public static final java.lang.String EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS = "android.telecom.extra.LAST_EMERGENCY_CALLBACK_TIME_MILLIS";
    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 static abstract 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, java.lang.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, java.lang.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 java.lang.String capabilitiesToString(int);
    method public android.telecom.PhoneAccountHandle getAccountHandle();
    method public int getCallCapabilities();
    method public int getCallProperties();
    method public java.lang.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 java.lang.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 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_RTT = 1024; // 0x400
    field public static final int PROPERTY_SELF_MANAGED = 256; // 0x100
    field public static final int PROPERTY_WIFI = 8; // 0x8
  }

  public static final class Call.RttCall {
    method public int getRttAudioMode();
    method public java.lang.String read();
    method public java.lang.String readImmediately() throws java.io.IOException;
    method public void setRttMode(int);
    method public void write(java.lang.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 java.lang.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 abstract class CallRedirectionService extends android.app.Service {
    ctor public CallRedirectionService();
    method public final void cancelCall();
    method public android.os.IBinder onBind(android.content.Intent);
    method public abstract void onPlaceCall(android.net.Uri, android.telecom.PhoneAccountHandle);
    method public final void placeCallUnmodified();
    method public final void redirectCall(android.net.Uri, android.telecom.PhoneAccountHandle);
    field public static final java.lang.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(android.telecom.Call.Details);
    method public final void respondToCall(android.telecom.Call.Details, android.telecom.CallScreeningService.CallResponse);
    field public static final java.lang.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(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(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 java.lang.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 java.lang.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(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(java.lang.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(java.lang.String);
    method public void onSeparate();
    method public void onShowIncomingCallUi();
    method public void onSilence();
    method public void onStartRtt(android.telecom.Connection.RttTextStream);
    method public void onStateChanged(int);
    method public void onStopDtmfTone();
    method public void onStopRtt();
    method public void onUnhold();
    method public static java.lang.String propertiesToString(int);
    method public final void putExtras(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(android.bluetooth.BluetoothDevice);
    method public void sendConnectionEvent(java.lang.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(java.lang.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(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(java.lang.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 java.lang.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 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 java.lang.String EVENT_CALL_MERGE_FAILED = "android.telecom.event.CALL_MERGE_FAILED";
    field public static final java.lang.String EVENT_CALL_PULL_FAILED = "android.telecom.event.CALL_PULL_FAILED";
    field public static final java.lang.String EXTRA_ANSWERING_DROPS_FG_CALL = "android.telecom.extra.ANSWERING_DROPS_FG_CALL";
    field public static final java.lang.String EXTRA_ANSWERING_DROPS_FG_CALL_APP_NAME = "android.telecom.extra.ANSWERING_DROPS_FG_CALL_APP_NAME";
    field public static final java.lang.String EXTRA_CALL_SUBJECT = "android.telecom.extra.CALL_SUBJECT";
    field public static final java.lang.String EXTRA_CHILD_ADDRESS = "android.telecom.extra.CHILD_ADDRESS";
    field public static final java.lang.String EXTRA_LAST_FORWARDED_NUMBER = "android.telecom.extra.LAST_FORWARDED_NUMBER";
    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 java.lang.String read() throws java.io.IOException;
    method public java.lang.String readImmediately() throws java.io.IOException;
    method public void write(java.lang.String) throws java.io.IOException;
  }

  public static abstract 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(java.lang.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 java.lang.String SERVICE_INTERFACE = "android.telecom.ConnectionService";
  }

  public final class DisconnectCause implements android.os.Parcelable {
    ctor public DisconnectCause(int);
    ctor public DisconnectCause(int, java.lang.String);
    ctor public DisconnectCause(int, java.lang.CharSequence, java.lang.CharSequence, java.lang.String);
    ctor public DisconnectCause(int, java.lang.CharSequence, java.lang.CharSequence, java.lang.String, int);
    method public int describeContents();
    method public int getCode();
    method public java.lang.CharSequence getDescription();
    method public java.lang.CharSequence getLabel();
    method public java.lang.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(java.lang.String, android.net.Uri, android.net.Uri);
    method public int describeContents();
    method public android.net.Uri getGatewayAddress();
    method public java.lang.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, java.lang.String, android.os.Bundle);
    method public void onSilenceRinger();
    method public final void requestBluetoothAudio(android.bluetooth.BluetoothDevice);
    method public final void setAudioRoute(int);
    method public final void setMuted(boolean);
    field public static final java.lang.String SERVICE_INTERFACE = "android.telecom.InCallService";
  }

  public static abstract 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(java.lang.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 static abstract 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, java.lang.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 java.lang.CharSequence getLabel();
    method public java.lang.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(java.lang.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 java.lang.String EXTRA_CALL_SUBJECT_CHARACTER_ENCODING = "android.telecom.extra.CALL_SUBJECT_CHARACTER_ENCODING";
    field public static final java.lang.String EXTRA_CALL_SUBJECT_MAX_LENGTH = "android.telecom.extra.CALL_SUBJECT_MAX_LENGTH";
    field public static final java.lang.String EXTRA_LOG_SELF_MANAGED_CALLS = "android.telecom.extra.LOG_SELF_MANAGED_CALLS";
    field public static final java.lang.String EXTRA_SUPPORTS_HANDOVER_FROM = "android.telecom.extra.SUPPORTS_HANDOVER_FROM";
    field public static final java.lang.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 java.lang.String SCHEME_SIP = "sip";
    field public static final java.lang.String SCHEME_TEL = "tel";
    field public static final java.lang.String SCHEME_VOICEMAIL = "voicemail";
  }

  public static class PhoneAccount.Builder {
    ctor public PhoneAccount.Builder(android.telecom.PhoneAccountHandle, java.lang.CharSequence);
    ctor public PhoneAccount.Builder(android.telecom.PhoneAccount);
    method public android.telecom.PhoneAccount.Builder addSupportedUriScheme(java.lang.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(java.lang.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(android.content.ComponentName, java.lang.String);
    ctor public PhoneAccountHandle(android.content.ComponentName, java.lang.String, android.os.UserHandle);
    method public int describeContents();
    method public android.content.ComponentName getComponentName();
    method public java.lang.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 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 static abstract 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, 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 java.lang.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 static abstract 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, java.lang.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, java.lang.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, android.os.Bundle);
    method public void onPostDialChar(android.telecom.RemoteConnection, char);
    method public void onPostDialWait(android.telecom.RemoteConnection, java.lang.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(java.lang.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 static abstract 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(java.lang.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 java.lang.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 public void acceptRingingCall();
    method public void acceptRingingCall(int);
    method public void addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
    method public void cancelMissedCallsNotification();
    method public android.content.Intent createManageBlockedNumbersIntent();
    method public boolean endCall();
    method public android.net.Uri getAdnUriForPhoneAccount(android.telecom.PhoneAccountHandle);
    method public java.util.List<android.telecom.PhoneAccountHandle> getCallCapablePhoneAccounts();
    method public java.lang.String getDefaultDialerPackage();
    method public android.telecom.PhoneAccountHandle getDefaultOutgoingPhoneAccount(java.lang.String);
    method public java.lang.String getLine1Number(android.telecom.PhoneAccountHandle);
    method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle);
    method public java.util.List<android.telecom.PhoneAccountHandle> getSelfManagedPhoneAccounts();
    method public android.telecom.PhoneAccountHandle getSimCallManager();
    method public java.lang.String getVoiceMailNumber(android.telecom.PhoneAccountHandle);
    method public boolean handleMmi(java.lang.String);
    method public boolean handleMmi(java.lang.String, android.telecom.PhoneAccountHandle);
    method public boolean isInCall();
    method public boolean isInManagedCall();
    method public boolean isIncomingCallPermitted(android.telecom.PhoneAccountHandle);
    method public boolean isOutgoingCallPermitted(android.telecom.PhoneAccountHandle);
    method public boolean isTtySupported();
    method public boolean isVoiceMailNumber(android.telecom.PhoneAccountHandle, java.lang.String);
    method public void placeCall(android.net.Uri, android.os.Bundle);
    method public void registerPhoneAccount(android.telecom.PhoneAccount);
    method public void showInCallScreen(boolean);
    method public void silenceRinger();
    method public void unregisterPhoneAccount(android.telecom.PhoneAccountHandle);
    field public static final java.lang.String ACTION_CHANGE_DEFAULT_DIALER = "android.telecom.action.CHANGE_DEFAULT_DIALER";
    field public static final java.lang.String ACTION_CHANGE_PHONE_ACCOUNTS = "android.telecom.action.CHANGE_PHONE_ACCOUNTS";
    field public static final java.lang.String ACTION_CONFIGURE_PHONE_ACCOUNT = "android.telecom.action.CONFIGURE_PHONE_ACCOUNT";
    field public static final java.lang.String ACTION_DEFAULT_DIALER_CHANGED = "android.telecom.action.DEFAULT_DIALER_CHANGED";
    field public static final deprecated java.lang.String ACTION_INCOMING_CALL = "android.telecom.action.INCOMING_CALL";
    field public static final java.lang.String ACTION_PHONE_ACCOUNT_REGISTERED = "android.telecom.action.PHONE_ACCOUNT_REGISTERED";
    field public static final java.lang.String ACTION_PHONE_ACCOUNT_UNREGISTERED = "android.telecom.action.PHONE_ACCOUNT_UNREGISTERED";
    field public static final java.lang.String ACTION_SHOW_CALL_ACCESSIBILITY_SETTINGS = "android.telecom.action.SHOW_CALL_ACCESSIBILITY_SETTINGS";
    field public static final java.lang.String ACTION_SHOW_CALL_SETTINGS = "android.telecom.action.SHOW_CALL_SETTINGS";
    field public static final java.lang.String ACTION_SHOW_MISSED_CALLS_NOTIFICATION = "android.telecom.action.SHOW_MISSED_CALLS_NOTIFICATION";
    field public static final java.lang.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 java.lang.String EXTRA_CALL_BACK_NUMBER = "android.telecom.extra.CALL_BACK_NUMBER";
    field public static final java.lang.String EXTRA_CALL_DISCONNECT_CAUSE = "android.telecom.extra.CALL_DISCONNECT_CAUSE";
    field public static final java.lang.String EXTRA_CALL_DISCONNECT_MESSAGE = "android.telecom.extra.CALL_DISCONNECT_MESSAGE";
    field public static final java.lang.String EXTRA_CALL_SUBJECT = "android.telecom.extra.CALL_SUBJECT";
    field public static final java.lang.String EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME = "android.telecom.extra.CHANGE_DEFAULT_DIALER_PACKAGE_NAME";
    field public static final java.lang.String EXTRA_INCOMING_CALL_ADDRESS = "android.telecom.extra.INCOMING_CALL_ADDRESS";
    field public static final java.lang.String EXTRA_INCOMING_CALL_EXTRAS = "android.telecom.extra.INCOMING_CALL_EXTRAS";
    field public static final java.lang.String EXTRA_INCOMING_VIDEO_STATE = "android.telecom.extra.INCOMING_VIDEO_STATE";
    field public static final java.lang.String EXTRA_NOTIFICATION_COUNT = "android.telecom.extra.NOTIFICATION_COUNT";
    field public static final java.lang.String EXTRA_NOTIFICATION_PHONE_NUMBER = "android.telecom.extra.NOTIFICATION_PHONE_NUMBER";
    field public static final java.lang.String EXTRA_OUTGOING_CALL_EXTRAS = "android.telecom.extra.OUTGOING_CALL_EXTRAS";
    field public static final java.lang.String EXTRA_PHONE_ACCOUNT_HANDLE = "android.telecom.extra.PHONE_ACCOUNT_HANDLE";
    field public static final java.lang.String EXTRA_START_CALL_WITH_RTT = "android.telecom.extra.START_CALL_WITH_RTT";
    field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.telecom.extra.START_CALL_WITH_SPEAKERPHONE";
    field public static final java.lang.String EXTRA_START_CALL_WITH_VIDEO_STATE = "android.telecom.extra.START_CALL_WITH_VIDEO_STATE";
    field public static final java.lang.String GATEWAY_ORIGINAL_ADDRESS = "android.telecom.extra.GATEWAY_ORIGINAL_ADDRESS";
    field public static final java.lang.String GATEWAY_PROVIDER_PACKAGE = "android.telecom.extra.GATEWAY_PROVIDER_PACKAGE";
    field public static final java.lang.String METADATA_INCLUDE_EXTERNAL_CALLS = "android.telecom.INCLUDE_EXTERNAL_CALLS";
    field public static final java.lang.String METADATA_INCLUDE_SELF_MANAGED_CALLS = "android.telecom.INCLUDE_SELF_MANAGED_CALLS";
    field public static final java.lang.String METADATA_IN_CALL_SERVICE_RINGING = "android.telecom.IN_CALL_SERVICE_RINGING";
    field public static final java.lang.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 java.lang.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(int, int);
    method public int describeContents();
    method public int getHeight();
    method public int getWidth();
    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 class CarrierConfigManager {
    method public android.os.PersistableBundle getConfig();
    method public android.os.PersistableBundle getConfigForSubId(int);
    method public static boolean isConfigForIdentifiedCarrier(android.os.PersistableBundle);
    method public void notifyConfigChangedForSubId(int);
    field public static final java.lang.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 java.lang.String EXTRA_SLOT_INDEX = "android.telephony.extra.SLOT_INDEX";
    field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
    field public static final java.lang.String KEY_ADDITIONAL_CALL_SETTING_BOOL = "additional_call_setting_bool";
    field public static final java.lang.String KEY_ALLOW_ADDING_APNS_BOOL = "allow_adding_apns_bool";
    field public static final java.lang.String KEY_ALLOW_ADD_CALL_DURING_VIDEO_CALL_BOOL = "allow_add_call_during_video_call";
    field public static final java.lang.String KEY_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG_BOOL = "allow_emergency_numbers_in_call_log_bool";
    field public static final java.lang.String KEY_ALLOW_EMERGENCY_VIDEO_CALLS_BOOL = "allow_emergency_video_calls_bool";
    field public static final java.lang.String KEY_ALLOW_LOCAL_DTMF_TONES_BOOL = "allow_local_dtmf_tones_bool";
    field public static final java.lang.String KEY_ALLOW_MERGE_WIFI_CALLS_WHEN_VOWIFI_OFF_BOOL = "allow_merge_wifi_calls_when_vowifi_off_bool";
    field public static final java.lang.String KEY_ALLOW_NON_EMERGENCY_CALLS_IN_ECM_BOOL = "allow_non_emergency_calls_in_ecm_bool";
    field public static final java.lang.String KEY_ALWAYS_SHOW_EMERGENCY_ALERT_ONOFF_BOOL = "always_show_emergency_alert_onoff_bool";
    field public static final java.lang.String KEY_APN_EXPAND_BOOL = "apn_expand_bool";
    field public static final java.lang.String KEY_AUTO_RETRY_ENABLED_BOOL = "auto_retry_enabled_bool";
    field public static final java.lang.String KEY_CALL_BARRING_SUPPORTS_DEACTIVATE_ALL_BOOL = "call_barring_supports_deactivate_all_bool";
    field public static final java.lang.String KEY_CALL_BARRING_SUPPORTS_PASSWORD_CHANGE_BOOL = "call_barring_supports_password_change_bool";
    field public static final java.lang.String KEY_CALL_BARRING_VISIBILITY_BOOL = "call_barring_visibility_bool";
    field public static final java.lang.String KEY_CALL_FORWARDING_BLOCKS_WHILE_ROAMING_STRING_ARRAY = "call_forwarding_blocks_while_roaming_string_array";
    field public static final java.lang.String KEY_CARRIER_ALLOW_TURNOFF_IMS_BOOL = "carrier_allow_turnoff_ims_bool";
    field public static final java.lang.String KEY_CARRIER_DATA_CALL_PERMANENT_FAILURE_STRINGS = "carrier_data_call_permanent_failure_strings";
    field public static final java.lang.String KEY_CARRIER_DEFAULT_WFC_IMS_MODE_INT = "carrier_default_wfc_ims_mode_int";
    field public static final java.lang.String KEY_CARRIER_DEFAULT_WFC_IMS_ROAMING_MODE_INT = "carrier_default_wfc_ims_roaming_mode_int";
    field public static final java.lang.String KEY_CARRIER_FORCE_DISABLE_ETWS_CMAS_TEST_BOOL = "carrier_force_disable_etws_cmas_test_bool";
    field public static final java.lang.String KEY_CARRIER_IMS_GBA_REQUIRED_BOOL = "carrier_ims_gba_required_bool";
    field public static final java.lang.String KEY_CARRIER_INSTANT_LETTERING_AVAILABLE_BOOL = "carrier_instant_lettering_available_bool";
    field public static final java.lang.String KEY_CARRIER_INSTANT_LETTERING_ENCODING_STRING = "carrier_instant_lettering_encoding_string";
    field public static final java.lang.String KEY_CARRIER_INSTANT_LETTERING_ESCAPED_CHARS_STRING = "carrier_instant_lettering_escaped_chars_string";
    field public static final java.lang.String KEY_CARRIER_INSTANT_LETTERING_INVALID_CHARS_STRING = "carrier_instant_lettering_invalid_chars_string";
    field public static final java.lang.String KEY_CARRIER_INSTANT_LETTERING_LENGTH_LIMIT_INT = "carrier_instant_lettering_length_limit_int";
    field public static final java.lang.String KEY_CARRIER_NAME_OVERRIDE_BOOL = "carrier_name_override_bool";
    field public static final java.lang.String KEY_CARRIER_NAME_STRING = "carrier_name_string";
    field public static final java.lang.String KEY_CARRIER_SETTINGS_ENABLE_BOOL = "carrier_settings_enable_bool";
    field public static final java.lang.String KEY_CARRIER_USE_IMS_FIRST_FOR_EMERGENCY_BOOL = "carrier_use_ims_first_for_emergency_bool";
    field public static final java.lang.String KEY_CARRIER_VOLTE_AVAILABLE_BOOL = "carrier_volte_available_bool";
    field public static final java.lang.String KEY_CARRIER_VOLTE_PROVISIONED_BOOL = "carrier_volte_provisioned_bool";
    field public static final java.lang.String KEY_CARRIER_VOLTE_PROVISIONING_REQUIRED_BOOL = "carrier_volte_provisioning_required_bool";
    field public static final java.lang.String KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL = "carrier_volte_tty_supported_bool";
    field public static final java.lang.String KEY_CARRIER_VT_AVAILABLE_BOOL = "carrier_vt_available_bool";
    field public static final deprecated java.lang.String KEY_CARRIER_VVM_PACKAGE_NAME_STRING = "carrier_vvm_package_name_string";
    field public static final java.lang.String KEY_CARRIER_VVM_PACKAGE_NAME_STRING_ARRAY = "carrier_vvm_package_name_string_array";
    field public static final java.lang.String KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL = "carrier_wfc_ims_available_bool";
    field public static final java.lang.String KEY_CARRIER_WFC_SUPPORTS_WIFI_ONLY_BOOL = "carrier_wfc_supports_wifi_only_bool";
    field public static final java.lang.String KEY_CDMA_3WAYCALL_FLASH_DELAY_INT = "cdma_3waycall_flash_delay_int";
    field public static final java.lang.String KEY_CDMA_DTMF_TONE_DELAY_INT = "cdma_dtmf_tone_delay_int";
    field public static final java.lang.String KEY_CDMA_NONROAMING_NETWORKS_STRING_ARRAY = "cdma_nonroaming_networks_string_array";
    field public static final java.lang.String KEY_CDMA_ROAMING_MODE_INT = "cdma_roaming_mode_int";
    field public static final java.lang.String KEY_CDMA_ROAMING_NETWORKS_STRING_ARRAY = "cdma_roaming_networks_string_array";
    field public static final java.lang.String KEY_CI_ACTION_ON_SYS_UPDATE_BOOL = "ci_action_on_sys_update_bool";
    field public static final java.lang.String KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_STRING = "ci_action_on_sys_update_extra_string";
    field public static final java.lang.String KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_VAL_STRING = "ci_action_on_sys_update_extra_val_string";
    field public static final java.lang.String KEY_CI_ACTION_ON_SYS_UPDATE_INTENT_STRING = "ci_action_on_sys_update_intent_string";
    field public static final java.lang.String KEY_CONFIG_IMS_PACKAGE_OVERRIDE_STRING = "config_ims_package_override_string";
    field public static final java.lang.String KEY_CONFIG_PLANS_PACKAGE_OVERRIDE_STRING = "config_plans_package_override_string";
    field public static final java.lang.String KEY_CONFIG_TELEPHONY_USE_OWN_NUMBER_FOR_VOICEMAIL_BOOL = "config_telephony_use_own_number_for_voicemail_bool";
    field public static final java.lang.String KEY_CSP_ENABLED_BOOL = "csp_enabled_bool";
    field public static final java.lang.String KEY_DATA_LIMIT_THRESHOLD_BYTES_LONG = "data_limit_threshold_bytes_long";
    field public static final java.lang.String KEY_DATA_WARNING_THRESHOLD_BYTES_LONG = "data_warning_threshold_bytes_long";
    field public static final java.lang.String KEY_DEFAULT_SIM_CALL_MANAGER_STRING = "default_sim_call_manager_string";
    field public static final java.lang.String KEY_DEFAULT_VM_NUMBER_STRING = "default_vm_number_string";
    field public static final java.lang.String KEY_DIAL_STRING_REPLACE_STRING_ARRAY = "dial_string_replace_string_array";
    field public static final java.lang.String KEY_DISABLE_CDMA_ACTIVATION_CODE_BOOL = "disable_cdma_activation_code_bool";
    field public static final java.lang.String KEY_DISPLAY_HD_AUDIO_PROPERTY_BOOL = "display_hd_audio_property_bool";
    field public static final java.lang.String KEY_DROP_VIDEO_CALL_WHEN_ANSWERING_AUDIO_CALL_BOOL = "drop_video_call_when_answering_audio_call_bool";
    field public static final java.lang.String KEY_DTMF_TYPE_ENABLED_BOOL = "dtmf_type_enabled_bool";
    field public static final java.lang.String KEY_DURATION_BLOCKING_DISABLED_AFTER_EMERGENCY_INT = "duration_blocking_disabled_after_emergency_int";
    field public static final java.lang.String KEY_EDITABLE_ENHANCED_4G_LTE_BOOL = "editable_enhanced_4g_lte_bool";
    field public static final java.lang.String KEY_EDITABLE_VOICEMAIL_NUMBER_BOOL = "editable_voicemail_number_bool";
    field public static final java.lang.String KEY_EDITABLE_VOICEMAIL_NUMBER_SETTING_BOOL = "editable_voicemail_number_setting_bool";
    field public static final java.lang.String KEY_ENABLE_DIALER_KEY_VIBRATION_BOOL = "enable_dialer_key_vibration_bool";
    field public static final java.lang.String KEY_FORCE_HOME_NETWORK_BOOL = "force_home_network_bool";
    field public static final java.lang.String KEY_GSM_DTMF_TONE_DELAY_INT = "gsm_dtmf_tone_delay_int";
    field public static final java.lang.String KEY_GSM_NONROAMING_NETWORKS_STRING_ARRAY = "gsm_nonroaming_networks_string_array";
    field public static final java.lang.String KEY_GSM_ROAMING_NETWORKS_STRING_ARRAY = "gsm_roaming_networks_string_array";
    field public static final java.lang.String KEY_HAS_IN_CALL_NOISE_SUPPRESSION_BOOL = "has_in_call_noise_suppression_bool";
    field public static final java.lang.String KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL = "hide_carrier_network_settings_bool";
    field public static final java.lang.String KEY_HIDE_ENHANCED_4G_LTE_BOOL = "hide_enhanced_4g_lte_bool";
    field public static final java.lang.String KEY_HIDE_IMS_APN_BOOL = "hide_ims_apn_bool";
    field public static final java.lang.String KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL = "hide_preferred_network_type_bool";
    field public static final java.lang.String KEY_HIDE_SIM_LOCK_SETTINGS_BOOL = "hide_sim_lock_settings_bool";
    field public static final java.lang.String KEY_IGNORE_SIM_NETWORK_LOCKED_EVENTS_BOOL = "ignore_sim_network_locked_events_bool";
    field public static final java.lang.String KEY_IMS_CONFERENCE_SIZE_LIMIT_INT = "ims_conference_size_limit_int";
    field public static final java.lang.String KEY_IMS_DTMF_TONE_DELAY_INT = "ims_dtmf_tone_delay_int";
    field public static final java.lang.String KEY_IS_IMS_CONFERENCE_SIZE_ENFORCED_BOOL = "is_ims_conference_size_enforced_bool";
    field public static final java.lang.String KEY_MDN_IS_ADDITIONAL_VOICEMAIL_NUMBER_BOOL = "mdn_is_additional_voicemail_number_bool";
    field public static final java.lang.String KEY_MMS_ALIAS_ENABLED_BOOL = "aliasEnabled";
    field public static final java.lang.String KEY_MMS_ALIAS_MAX_CHARS_INT = "aliasMaxChars";
    field public static final java.lang.String KEY_MMS_ALIAS_MIN_CHARS_INT = "aliasMinChars";
    field public static final java.lang.String KEY_MMS_ALLOW_ATTACH_AUDIO_BOOL = "allowAttachAudio";
    field public static final java.lang.String KEY_MMS_APPEND_TRANSACTION_ID_BOOL = "enabledTransID";
    field public static final java.lang.String KEY_MMS_EMAIL_GATEWAY_NUMBER_STRING = "emailGatewayNumber";
    field public static final java.lang.String KEY_MMS_GROUP_MMS_ENABLED_BOOL = "enableGroupMms";
    field public static final java.lang.String KEY_MMS_HTTP_PARAMS_STRING = "httpParams";
    field public static final java.lang.String KEY_MMS_HTTP_SOCKET_TIMEOUT_INT = "httpSocketTimeout";
    field public static final java.lang.String KEY_MMS_MAX_IMAGE_HEIGHT_INT = "maxImageHeight";
    field public static final java.lang.String KEY_MMS_MAX_IMAGE_WIDTH_INT = "maxImageWidth";
    field public static final java.lang.String KEY_MMS_MAX_MESSAGE_SIZE_INT = "maxMessageSize";
    field public static final java.lang.String KEY_MMS_MESSAGE_TEXT_MAX_SIZE_INT = "maxMessageTextSize";
    field public static final java.lang.String KEY_MMS_MMS_DELIVERY_REPORT_ENABLED_BOOL = "enableMMSDeliveryReports";
    field public static final java.lang.String KEY_MMS_MMS_ENABLED_BOOL = "enabledMMS";
    field public static final java.lang.String KEY_MMS_MMS_READ_REPORT_ENABLED_BOOL = "enableMMSReadReports";
    field public static final java.lang.String KEY_MMS_MULTIPART_SMS_ENABLED_BOOL = "enableMultipartSMS";
    field public static final java.lang.String KEY_MMS_NAI_SUFFIX_STRING = "naiSuffix";
    field public static final java.lang.String KEY_MMS_NOTIFY_WAP_MMSC_ENABLED_BOOL = "enabledNotifyWapMMSC";
    field public static final java.lang.String KEY_MMS_RECIPIENT_LIMIT_INT = "recipientLimit";
    field public static final java.lang.String KEY_MMS_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES_BOOL = "sendMultipartSmsAsSeparateMessages";
    field public static final java.lang.String KEY_MMS_SHOW_CELL_BROADCAST_APP_LINKS_BOOL = "config_cellBroadcastAppLinks";
    field public static final java.lang.String KEY_MMS_SMS_DELIVERY_REPORT_ENABLED_BOOL = "enableSMSDeliveryReports";
    field public static final java.lang.String KEY_MMS_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD_INT = "smsToMmsTextLengthThreshold";
    field public static final java.lang.String KEY_MMS_SMS_TO_MMS_TEXT_THRESHOLD_INT = "smsToMmsTextThreshold";
    field public static final java.lang.String KEY_MMS_SUBJECT_MAX_LENGTH_INT = "maxSubjectLength";
    field public static final java.lang.String KEY_MMS_SUPPORT_HTTP_CHARSET_HEADER_BOOL = "supportHttpCharsetHeader";
    field public static final java.lang.String KEY_MMS_SUPPORT_MMS_CONTENT_DISPOSITION_BOOL = "supportMmsContentDisposition";
    field public static final java.lang.String KEY_MMS_UA_PROF_TAG_NAME_STRING = "uaProfTagName";
    field public static final java.lang.String KEY_MMS_UA_PROF_URL_STRING = "uaProfUrl";
    field public static final java.lang.String KEY_MMS_USER_AGENT_STRING = "userAgent";
    field public static final java.lang.String KEY_MONTHLY_DATA_CYCLE_DAY_INT = "monthly_data_cycle_day_int";
    field public static final java.lang.String KEY_ONLY_SINGLE_DC_ALLOWED_INT_ARRAY = "only_single_dc_allowed_int_array";
    field public static final java.lang.String KEY_OPERATOR_SELECTION_EXPAND_BOOL = "operator_selection_expand_bool";
    field public static final java.lang.String KEY_PREFER_2G_BOOL = "prefer_2g_bool";
    field public static final java.lang.String KEY_RADIO_RESTART_FAILURE_CAUSES_INT_ARRAY = "radio_restart_failure_causes_int_array";
    field public static final java.lang.String KEY_RCS_CONFIG_SERVER_URL_STRING = "rcs_config_server_url_string";
    field public static final java.lang.String KEY_REQUIRE_ENTITLEMENT_CHECKS_BOOL = "require_entitlement_checks_bool";
    field public static final deprecated java.lang.String KEY_RESTART_RADIO_ON_PDP_FAIL_REGULAR_DEACTIVATION_BOOL = "restart_radio_on_pdp_fail_regular_deactivation_bool";
    field public static final java.lang.String KEY_RTT_SUPPORTED_BOOL = "rtt_supported_bool";
    field public static final java.lang.String KEY_SHOW_APN_SETTING_CDMA_BOOL = "show_apn_setting_cdma_bool";
    field public static final java.lang.String KEY_SHOW_CDMA_CHOICES_BOOL = "show_cdma_choices_bool";
    field public static final java.lang.String KEY_SHOW_ICCID_IN_SIM_STATUS_BOOL = "show_iccid_in_sim_status_bool";
    field public static final java.lang.String KEY_SHOW_ONSCREEN_DIAL_BUTTON_BOOL = "show_onscreen_dial_button_bool";
    field public static final java.lang.String KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL = "show_signal_strength_in_sim_status_bool";
    field public static final java.lang.String KEY_SIMPLIFIED_NETWORK_SETTINGS_BOOL = "simplified_network_settings_bool";
    field public static final java.lang.String KEY_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL = "sim_network_unlock_allow_dismiss_bool";
    field public static final java.lang.String KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL = "sms_requires_destination_number_conversion_bool";
    field public static final java.lang.String KEY_SUPPORT_3GPP_CALL_FORWARDING_WHILE_ROAMING_BOOL = "support_3gpp_call_forwarding_while_roaming_bool";
    field public static final java.lang.String KEY_SUPPORT_CONFERENCE_CALL_BOOL = "support_conference_call_bool";
    field public static final java.lang.String KEY_SUPPORT_EMERGENCY_SMS_OVER_IMS_BOOL = "support_emergency_sms_over_ims_bool";
    field public static final java.lang.String KEY_SUPPORT_PAUSE_IMS_VIDEO_CALLS_BOOL = "support_pause_ims_video_calls_bool";
    field public static final java.lang.String KEY_SUPPORT_SWAP_AFTER_MERGE_BOOL = "support_swap_after_merge_bool";
    field public static final java.lang.String KEY_TREAT_DOWNGRADED_VIDEO_CALLS_AS_VIDEO_CALLS_BOOL = "treat_downgraded_video_calls_as_video_calls_bool";
    field public static final java.lang.String KEY_USE_HFA_FOR_PROVISIONING_BOOL = "use_hfa_for_provisioning_bool";
    field public static final java.lang.String KEY_USE_OTASP_FOR_PROVISIONING_BOOL = "use_otasp_for_provisioning_bool";
    field public static final java.lang.String KEY_USE_RCS_PRESENCE_BOOL = "use_rcs_presence_bool";
    field public static final java.lang.String KEY_VOICEMAIL_NOTIFICATION_PERSISTENT_BOOL = "voicemail_notification_persistent_bool";
    field public static final java.lang.String KEY_VOICE_PRIVACY_DISABLE_UI_BOOL = "voice_privacy_disable_ui_bool";
    field public static final java.lang.String KEY_VOLTE_REPLACEMENT_RAT_INT = "volte_replacement_rat_int";
    field public static final java.lang.String KEY_VVM_CELLULAR_DATA_REQUIRED_BOOL = "vvm_cellular_data_required_bool";
    field public static final java.lang.String KEY_VVM_CLIENT_PREFIX_STRING = "vvm_client_prefix_string";
    field public static final java.lang.String KEY_VVM_DESTINATION_NUMBER_STRING = "vvm_destination_number_string";
    field public static final java.lang.String KEY_VVM_DISABLED_CAPABILITIES_STRING_ARRAY = "vvm_disabled_capabilities_string_array";
    field public static final java.lang.String KEY_VVM_LEGACY_MODE_ENABLED_BOOL = "vvm_legacy_mode_enabled_bool";
    field public static final java.lang.String KEY_VVM_PORT_NUMBER_INT = "vvm_port_number_int";
    field public static final java.lang.String KEY_VVM_PREFETCH_BOOL = "vvm_prefetch_bool";
    field public static final java.lang.String KEY_VVM_SSL_ENABLED_BOOL = "vvm_ssl_enabled_bool";
    field public static final java.lang.String KEY_VVM_TYPE_STRING = "vvm_type_string";
    field public static final java.lang.String KEY_WORLD_PHONE_BOOL = "world_phone_bool";
  }

  public abstract class CellIdentity implements android.os.Parcelable {
    method public int describeContents();
    method public java.lang.CharSequence getOperatorAlphaLong();
    method public java.lang.CharSequence getOperatorAlphaShort();
    method 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 public deprecated int getMcc();
    method public java.lang.String getMccString();
    method public deprecated int getMnc();
    method public java.lang.String getMncString();
    method public java.lang.String getMobileNetworkOperator();
    method public deprecated 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 public deprecated int getMcc();
    method public java.lang.String getMccString();
    method public deprecated int getMnc();
    method public java.lang.String getMncString();
    method public java.lang.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 CellIdentityTdscdma extends android.telephony.CellIdentity {
    method public int getCid();
    method public int getCpid();
    method public int getLac();
    method public java.lang.String getMccString();
    method public java.lang.String getMncString();
    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 public deprecated int getMcc();
    method public java.lang.String getMccString();
    method public deprecated int getMnc();
    method public java.lang.String getMncString();
    method public java.lang.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;
  }

  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 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(java.lang.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 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 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 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(android.telephony.mbms.DownloadRequest, java.util.concurrent.Executor, android.telephony.mbms.DownloadProgressListener);
    method public void addStatusListener(android.telephony.mbms.DownloadRequest, java.util.concurrent.Executor, android.telephony.mbms.DownloadStatusListener);
    method public void cancelDownload(android.telephony.mbms.DownloadRequest);
    method public void close();
    method public static android.telephony.MbmsDownloadSession create(android.content.Context, java.util.concurrent.Executor, android.telephony.mbms.MbmsDownloadSessionCallback);
    method public static android.telephony.MbmsDownloadSession create(android.content.Context, java.util.concurrent.Executor, int, android.telephony.mbms.MbmsDownloadSessionCallback);
    method public void download(android.telephony.mbms.DownloadRequest);
    method public java.io.File getTempFileRootDirectory();
    method public java.util.List<android.telephony.mbms.DownloadRequest> listPendingDownloads();
    method public void removeProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener);
    method public void removeStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener);
    method public void requestDownloadState(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo);
    method public void requestUpdateFileServices(java.util.List<java.lang.String>);
    method public void resetDownloadKnowledge(android.telephony.mbms.DownloadRequest);
    method public void setTempFileRootDirectory(java.io.File);
    field public static final java.lang.String DEFAULT_TOP_LEVEL_TEMP_DIRECTORY = "androidMbmsTempFileRoot";
    field public static final java.lang.String EXTRA_MBMS_COMPLETED_FILE_URI = "android.telephony.extra.MBMS_COMPLETED_FILE_URI";
    field public static final java.lang.String EXTRA_MBMS_DOWNLOAD_REQUEST = "android.telephony.extra.MBMS_DOWNLOAD_REQUEST";
    field public static final java.lang.String EXTRA_MBMS_DOWNLOAD_RESULT = "android.telephony.extra.MBMS_DOWNLOAD_RESULT";
    field public static final java.lang.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 MbmsStreamingSession implements java.lang.AutoCloseable {
    method public void close();
    method public static android.telephony.MbmsStreamingSession create(android.content.Context, java.util.concurrent.Executor, int, android.telephony.mbms.MbmsStreamingSessionCallback);
    method public static android.telephony.MbmsStreamingSession create(android.content.Context, java.util.concurrent.Executor, android.telephony.mbms.MbmsStreamingSessionCallback);
    method public void requestUpdateStreamingServices(java.util.List<java.lang.String>);
    method public android.telephony.mbms.StreamingService startStreaming(android.telephony.mbms.StreamingServiceInfo, java.util.concurrent.Executor, android.telephony.mbms.StreamingServiceCallback);
  }

  public class NeighboringCellInfo implements android.os.Parcelable {
    ctor public deprecated NeighboringCellInfo();
    ctor public deprecated NeighboringCellInfo(int, int);
    ctor public NeighboringCellInfo(int, java.lang.String, int);
    ctor public NeighboringCellInfo(android.os.Parcel);
    method public int describeContents();
    method public int getCid();
    method public int getLac();
    method public int getNetworkType();
    method public int getPsc();
    method public int getRssi();
    method public deprecated void setCid(int);
    method public deprecated void setRssi(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.NeighboringCellInfo> CREATOR;
    field public static final int UNKNOWN_CID = -1; // 0xffffffff
    field 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(java.lang.String);
    method public synchronized void afterTextChanged(android.text.Editable);
    method public void beforeTextChanged(java.lang.CharSequence, int, int, int);
    method public void onTextChanged(java.lang.CharSequence, int, int, int);
  }

  public class PhoneNumberUtils {
    ctor public PhoneNumberUtils();
    method public static void addTtsSpan(android.text.Spannable, int, int);
    method public static deprecated java.lang.String calledPartyBCDFragmentToString(byte[], int, int);
    method public static java.lang.String calledPartyBCDFragmentToString(byte[], int, int, int);
    method public static deprecated java.lang.String calledPartyBCDToString(byte[], int, int);
    method public static java.lang.String calledPartyBCDToString(byte[], int, int, int);
    method public static boolean compare(java.lang.String, java.lang.String);
    method public static boolean compare(android.content.Context, java.lang.String, java.lang.String);
    method public static java.lang.String convertKeypadLettersToDigits(java.lang.String);
    method public static android.text.style.TtsSpan createTtsSpan(java.lang.String);
    method public static java.lang.CharSequence createTtsSpannable(java.lang.CharSequence);
    method public static java.lang.String extractNetworkPortion(java.lang.String);
    method public static java.lang.String extractPostDialPortion(java.lang.String);
    method public static deprecated void formatJapaneseNumber(android.text.Editable);
    method public static deprecated void formatNanpNumber(android.text.Editable);
    method public static deprecated java.lang.String formatNumber(java.lang.String);
    method public static deprecated void formatNumber(android.text.Editable, int);
    method public static java.lang.String formatNumber(java.lang.String, java.lang.String);
    method public static java.lang.String formatNumber(java.lang.String, java.lang.String, java.lang.String);
    method public static java.lang.String formatNumberToE164(java.lang.String, java.lang.String);
    method public static java.lang.String formatNumberToRFC3966(java.lang.String, java.lang.String);
    method public static deprecated int getFormatTypeForLocale(java.util.Locale);
    method public static java.lang.String getNumberFromIntent(android.content.Intent, android.content.Context);
    method public static java.lang.String getStrippedReversed(java.lang.String);
    method public static final boolean is12Key(char);
    method public static final boolean isDialable(char);
    method public static boolean isEmergencyNumber(java.lang.String);
    method public static boolean isGlobalPhoneNumber(java.lang.String);
    method public static boolean isISODigit(char);
    method public static boolean isLocalEmergencyNumber(android.content.Context, java.lang.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(java.lang.String);
    method public static boolean isWellFormedSmsAddress(java.lang.String);
    method public static byte[] networkPortionToCalledPartyBCD(java.lang.String);
    method public static byte[] networkPortionToCalledPartyBCDWithLength(java.lang.String);
    method public static java.lang.String normalizeNumber(java.lang.String);
    method public static deprecated byte[] numberToCalledPartyBCD(java.lang.String);
    method public static byte[] numberToCalledPartyBCD(java.lang.String, int);
    method public static java.lang.String replaceUnicodeDigits(java.lang.String);
    method public static java.lang.String stringFromStringAndTOA(java.lang.String, int);
    method public static java.lang.String stripSeparators(java.lang.String);
    method public static java.lang.String toCallerIDMinMatch(java.lang.String);
    method public static int toaFromString(java.lang.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();
    method public void onCallForwardingIndicatorChanged(boolean);
    method public void onCallStateChanged(int, java.lang.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 public deprecated 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_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 public static final deprecated 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 java.lang.String getOperatorAlphaLong();
    method public java.lang.String getOperatorAlphaShort();
    method public java.lang.String getOperatorNumeric();
    method public boolean getRoaming();
    method public int getState();
    method public void setIsManualSelection(boolean);
    method public void setOperatorName(java.lang.String, java.lang.String, java.lang.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 public int getCdmaDbm();
    method public int getCdmaEcio();
    method public int getEvdoDbm();
    method public int getEvdoEcio();
    method public int getEvdoSnr();
    method public int getGsmBitErrorRate();
    method public int getGsmSignalStrength();
    method public int getLevel();
    method public boolean isGsm();
    method public void writeToParcel(android.os.Parcel, int);
  }

  public final class SmsManager {
    method public java.lang.String createAppSpecificSmsToken(android.app.PendingIntent);
    method public java.util.ArrayList<java.lang.String> divideMessage(java.lang.String);
    method public void downloadMultimediaMessage(android.content.Context, java.lang.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[], java.lang.String, android.app.PendingIntent);
    method public void sendDataMessage(java.lang.String, java.lang.String, short, byte[], android.app.PendingIntent, android.app.PendingIntent);
    method public void sendMultimediaMessage(android.content.Context, android.net.Uri, java.lang.String, android.os.Bundle, android.app.PendingIntent);
    method public void sendMultipartTextMessage(java.lang.String, java.lang.String, java.util.ArrayList<java.lang.String>, java.util.ArrayList<android.app.PendingIntent>, java.util.ArrayList<android.app.PendingIntent>);
    method public void sendTextMessage(java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent);
    method public void sendTextMessageWithoutPersisting(java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent);
    field public static final java.lang.String EXTRA_MMS_DATA = "android.telephony.extra.MMS_DATA";
    field public static final java.lang.String EXTRA_MMS_HTTP_STATUS = "android.telephony.extra.MMS_HTTP_STATUS";
    field public static final java.lang.String MMS_CONFIG_ALIAS_ENABLED = "aliasEnabled";
    field public static final java.lang.String MMS_CONFIG_ALIAS_MAX_CHARS = "aliasMaxChars";
    field public static final java.lang.String MMS_CONFIG_ALIAS_MIN_CHARS = "aliasMinChars";
    field public static final java.lang.String MMS_CONFIG_ALLOW_ATTACH_AUDIO = "allowAttachAudio";
    field public static final java.lang.String MMS_CONFIG_APPEND_TRANSACTION_ID = "enabledTransID";
    field public static final java.lang.String MMS_CONFIG_EMAIL_GATEWAY_NUMBER = "emailGatewayNumber";
    field public static final java.lang.String MMS_CONFIG_GROUP_MMS_ENABLED = "enableGroupMms";
    field public static final java.lang.String MMS_CONFIG_HTTP_PARAMS = "httpParams";
    field public static final java.lang.String MMS_CONFIG_HTTP_SOCKET_TIMEOUT = "httpSocketTimeout";
    field public static final java.lang.String MMS_CONFIG_MAX_IMAGE_HEIGHT = "maxImageHeight";
    field public static final java.lang.String MMS_CONFIG_MAX_IMAGE_WIDTH = "maxImageWidth";
    field public static final java.lang.String MMS_CONFIG_MAX_MESSAGE_SIZE = "maxMessageSize";
    field public static final java.lang.String MMS_CONFIG_MESSAGE_TEXT_MAX_SIZE = "maxMessageTextSize";
    field public static final java.lang.String MMS_CONFIG_MMS_DELIVERY_REPORT_ENABLED = "enableMMSDeliveryReports";
    field public static final java.lang.String MMS_CONFIG_MMS_ENABLED = "enabledMMS";
    field public static final java.lang.String MMS_CONFIG_MMS_READ_REPORT_ENABLED = "enableMMSReadReports";
    field public static final java.lang.String MMS_CONFIG_MULTIPART_SMS_ENABLED = "enableMultipartSMS";
    field public static final java.lang.String MMS_CONFIG_NAI_SUFFIX = "naiSuffix";
    field public static final java.lang.String MMS_CONFIG_NOTIFY_WAP_MMSC_ENABLED = "enabledNotifyWapMMSC";
    field public static final java.lang.String MMS_CONFIG_RECIPIENT_LIMIT = "recipientLimit";
    field public static final java.lang.String MMS_CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES = "sendMultipartSmsAsSeparateMessages";
    field public static final java.lang.String MMS_CONFIG_SHOW_CELL_BROADCAST_APP_LINKS = "config_cellBroadcastAppLinks";
    field public static final java.lang.String MMS_CONFIG_SMS_DELIVERY_REPORT_ENABLED = "enableSMSDeliveryReports";
    field public static final java.lang.String MMS_CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD = "smsToMmsTextLengthThreshold";
    field public static final java.lang.String MMS_CONFIG_SMS_TO_MMS_TEXT_THRESHOLD = "smsToMmsTextThreshold";
    field public static final java.lang.String MMS_CONFIG_SUBJECT_MAX_LENGTH = "maxSubjectLength";
    field public static final java.lang.String MMS_CONFIG_SUPPORT_HTTP_CHARSET_HEADER = "supportHttpCharsetHeader";
    field public static final java.lang.String MMS_CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION = "supportMmsContentDisposition";
    field public static final java.lang.String MMS_CONFIG_UA_PROF_TAG_NAME = "uaProfTagName";
    field public static final java.lang.String MMS_CONFIG_UA_PROF_URL = "uaProfUrl";
    field public static final java.lang.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(java.lang.CharSequence, boolean);
    method public static int[] calculateLength(java.lang.String, boolean);
    method public static deprecated android.telephony.SmsMessage createFromPdu(byte[]);
    method public static android.telephony.SmsMessage createFromPdu(byte[], java.lang.String);
    method public java.lang.String getDisplayMessageBody();
    method public java.lang.String getDisplayOriginatingAddress();
    method public java.lang.String getEmailBody();
    method public java.lang.String getEmailFrom();
    method public int getIndexOnIcc();
    method public deprecated int getIndexOnSim();
    method public java.lang.String getMessageBody();
    method public android.telephony.SmsMessage.MessageClass getMessageClass();
    method public java.lang.String getOriginatingAddress();
    method public byte[] getPdu();
    method public int getProtocolIdentifier();
    method public java.lang.String getPseudoSubject();
    method public java.lang.String getServiceCenterAddress();
    method public int getStatus();
    method public int getStatusOnIcc();
    method public deprecated int getStatusOnSim();
    method public static android.telephony.SmsMessage.SubmitPdu getSubmitPdu(java.lang.String, java.lang.String, java.lang.String, boolean);
    method public static android.telephony.SmsMessage.SubmitPdu getSubmitPdu(java.lang.String, java.lang.String, short, byte[], boolean);
    method public static int getTPLayerLengthForPDU(java.lang.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 java.lang.String FORMAT_3GPP = "3gpp";
    field public static final java.lang.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 static final class SmsMessage.MessageClass extends java.lang.Enum {
    method public static android.telephony.SmsMessage.MessageClass valueOf(java.lang.String);
    method public static final android.telephony.SmsMessage.MessageClass[] values();
    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 java.lang.CharSequence getCarrierName();
    method public java.lang.String getCountryIso();
    method public int getDataRoaming();
    method public java.lang.CharSequence getDisplayName();
    method public java.lang.String getIccId();
    method public int getIconTint();
    method public deprecated int getMcc();
    method public java.lang.String getMccString();
    method public deprecated int getMnc();
    method public java.lang.String getMncString();
    method public java.lang.String getNumber();
    method public int getParentSubId();
    method public int getSimSlotIndex();
    method public int getSubscriptionId();
    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 addOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
    method public boolean canManageSubscription(android.telephony.SubscriptionInfo);
    method public static deprecated android.telephony.SubscriptionManager from(android.content.Context);
    method public java.util.List<android.telephony.SubscriptionInfo> getAccessibleSubscriptionInfoList();
    method public android.telephony.SubscriptionInfo getActiveSubscriptionInfo(int);
    method public int getActiveSubscriptionInfoCount();
    method public int getActiveSubscriptionInfoCountMax();
    method public android.telephony.SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int);
    method 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 public java.util.List<android.telephony.SubscriptionPlan> getSubscriptionPlans(int);
    method public boolean isNetworkRoaming(int);
    method public void removeOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
    method public void setSubscriptionOverrideCongested(int, boolean, long);
    method public void setSubscriptionOverrideUnmetered(int, boolean, long);
    method public void setSubscriptionPlans(int, java.util.List<android.telephony.SubscriptionPlan>);
    method public void switchToSubscription(int, android.app.PendingIntent);
    field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED";
    field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED";
    field public static final java.lang.String ACTION_MANAGE_SUBSCRIPTION_PLANS = "android.telephony.action.MANAGE_SUBSCRIPTION_PLANS";
    field public static final java.lang.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 java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
    field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff
  }

  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 public java.lang.CharSequence getSummary();
    method public java.lang.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(java.lang.CharSequence);
    method public android.telephony.SubscriptionPlan.Builder setTitle(java.lang.CharSequence);
  }

  public class TelephonyManager {
    method public boolean canChangeDtmfToneLength();
    method public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle);
    method public android.telephony.TelephonyManager createForSubscriptionId(int);
    method public java.util.List<android.telephony.CellInfo> getAllCellInfo();
    method public int getCallState();
    method public android.os.PersistableBundle getCarrierConfig();
    method public deprecated android.telephony.CellLocation getCellLocation();
    method public int getDataActivity();
    method public int getDataNetworkType();
    method public int getDataState();
    method public deprecated java.lang.String getDeviceId();
    method public deprecated java.lang.String getDeviceId(int);
    method public java.lang.String getDeviceSoftwareVersion();
    method public java.lang.String[] getForbiddenPlmns();
    method public java.lang.String getGroupIdLevel1();
    method public java.lang.String getIccAuthentication(int, int, java.lang.String);
    method public java.lang.String getImei();
    method public java.lang.String getImei(int);
    method public java.lang.String getLine1Number();
    method public java.lang.String getManufacturerCode();
    method public java.lang.String getManufacturerCode(int);
    method public java.lang.String getMeid();
    method public java.lang.String getMeid(int);
    method public java.lang.String getMmsUAProfUrl();
    method public java.lang.String getMmsUserAgent();
    method public java.lang.String getNai();
    method public deprecated java.util.List<android.telephony.NeighboringCellInfo> getNeighboringCellInfo();
    method public java.lang.String getNetworkCountryIso();
    method public java.lang.String getNetworkOperator();
    method public java.lang.String getNetworkOperatorName();
    method public java.lang.String getNetworkSpecifier();
    method public int getNetworkType();
    method public int getPhoneCount();
    method public int getPhoneType();
    method public android.telephony.ServiceState getServiceState();
    method public android.telephony.SignalStrength getSignalStrength();
    method public int getSimCarrierId();
    method public java.lang.CharSequence getSimCarrierIdName();
    method public java.lang.String getSimCountryIso();
    method public java.lang.String getSimOperator();
    method public java.lang.String getSimOperatorName();
    method public java.lang.String getSimSerialNumber();
    method public int getSimState();
    method public int getSimState(int);
    method public java.lang.String getSubscriberId();
    method public java.lang.String getTypeAllocationCode();
    method public java.lang.String getTypeAllocationCode(int);
    method public java.lang.String getVisualVoicemailPackageName();
    method public java.lang.String getVoiceMailAlphaTag();
    method public java.lang.String getVoiceMailNumber();
    method 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, java.lang.String);
    method public deprecated android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String);
    method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String, int);
    method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String);
    method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String);
    method public boolean isConcurrentVoiceAndDataSupported();
    method public boolean isDataEnabled();
    method public boolean isDataRoamingEnabled();
    method public boolean isHearingAidCompatibilitySupported();
    method public boolean isNetworkRoaming();
    method public boolean isSmsCapable();
    method public deprecated 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 public android.telephony.NetworkScan requestNetworkScan(android.telephony.NetworkScanRequest, java.util.concurrent.Executor, android.telephony.TelephonyScanManager.NetworkScanCallback);
    method public void sendDialerSpecialCode(java.lang.String);
    method public java.lang.String sendEnvelopeWithStatus(java.lang.String);
    method public void sendUssdRequest(java.lang.String, android.telephony.TelephonyManager.UssdResponseCallback, android.os.Handler);
    method public void sendVisualVoicemailSms(java.lang.String, int, java.lang.String, android.app.PendingIntent);
    method public void setDataEnabled(boolean);
    method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String);
    method public void setNetworkSelectionModeAutomatic();
    method public boolean setNetworkSelectionModeManual(java.lang.String, boolean);
    method public boolean setOperatorBrandOverride(java.lang.String);
    method public boolean setPreferredNetworkTypeToGlobal();
    method public void setVisualVoicemailSmsFilterSettings(android.telephony.VisualVoicemailSmsFilterSettings);
    method public boolean setVoiceMailNumber(java.lang.String, java.lang.String);
    method public deprecated void setVoicemailRingtoneUri(android.telecom.PhoneAccountHandle, android.net.Uri);
    method public deprecated void setVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle, boolean);
    field public static final java.lang.String ACTION_CONFIGURE_VOICEMAIL = "android.telephony.action.CONFIGURE_VOICEMAIL";
    field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE";
    field public static final java.lang.String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE";
    field public static final java.lang.String ACTION_SECRET_CODE = "android.telephony.action.SECRET_CODE";
    field public static final java.lang.String ACTION_SHOW_VOICEMAIL_NOTIFICATION = "android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION";
    field public static final java.lang.String ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED = "android.telephony.action.SUBSCRIPTION_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 java.lang.String EXTRA_CALL_VOICEMAIL_INTENT = "android.telephony.extra.CALL_VOICEMAIL_INTENT";
    field public static final java.lang.String EXTRA_CARRIER_ID = "android.telephony.extra.CARRIER_ID";
    field public static final java.lang.String EXTRA_CARRIER_NAME = "android.telephony.extra.CARRIER_NAME";
    field public static final java.lang.String EXTRA_HIDE_PUBLIC_SETTINGS = "android.telephony.extra.HIDE_PUBLIC_SETTINGS";
    field public static final java.lang.String EXTRA_INCOMING_NUMBER = "incoming_number";
    field public static final java.lang.String EXTRA_IS_REFRESH = "android.telephony.extra.IS_REFRESH";
    field public static final java.lang.String EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT = "android.telephony.extra.LAUNCH_VOICEMAIL_SETTINGS_INTENT";
    field public static final java.lang.String EXTRA_NOTIFICATION_COUNT = "android.telephony.extra.NOTIFICATION_COUNT";
    field public static final java.lang.String EXTRA_PHONE_ACCOUNT_HANDLE = "android.telephony.extra.PHONE_ACCOUNT_HANDLE";
    field public static final java.lang.String EXTRA_STATE = "state";
    field public static final java.lang.String EXTRA_STATE_IDLE;
    field public static final java.lang.String EXTRA_STATE_OFFHOOK;
    field public static final java.lang.String EXTRA_STATE_RINGING;
    field public static final java.lang.String EXTRA_SUBSCRIPTION_ID = "android.telephony.extra.SUBSCRIPTION_ID";
    field public static final java.lang.String EXTRA_VOICEMAIL_NUMBER = "android.telephony.extra.VOICEMAIL_NUMBER";
    field public static final java.lang.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_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 java.lang.String VVM_TYPE_CVVM = "vvm_type_cvvm";
    field public static final java.lang.String VVM_TYPE_OMTP = "vvm_type_omtp";
  }

  public static abstract class TelephonyManager.UssdResponseCallback {
    ctor public TelephonyManager.UssdResponseCallback();
    method public void onReceiveUssdResponse(android.telephony.TelephonyManager, java.lang.String, java.lang.CharSequence);
    method public void onReceiveUssdResponseFailed(android.telephony.TelephonyManager, java.lang.String, int);
  }

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

  public static abstract 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 abstract class VisualVoicemailService extends android.app.Service {
    ctor public VisualVoicemailService();
    method public android.os.IBinder onBind(android.content.Intent);
    method public abstract void onCellServiceConnected(android.telephony.VisualVoicemailService.VisualVoicemailTask, android.telecom.PhoneAccountHandle);
    method public abstract void onSimRemoved(android.telephony.VisualVoicemailService.VisualVoicemailTask, android.telecom.PhoneAccountHandle);
    method public abstract void onSmsReceived(android.telephony.VisualVoicemailService.VisualVoicemailTask, android.telephony.VisualVoicemailSms);
    method public abstract void onStopped(android.telephony.VisualVoicemailService.VisualVoicemailTask);
    field public static final java.lang.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 java.lang.String getMessageBody();
    method public android.telecom.PhoneAccountHandle getPhoneAccountHandle();
    method public java.lang.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 java.lang.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(java.lang.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 java.lang.String getApnName();
    method public int getApnTypeBitmask();
    method public int getAuthType();
    method public java.lang.String getEntryName();
    method public int getId();
    method public deprecated java.net.InetAddress getMmsProxyAddress();
    method public java.lang.String getMmsProxyAddressAsString();
    method public int getMmsProxyPort();
    method public android.net.Uri getMmsc();
    method public int getMvnoType();
    method public int getNetworkTypeBitmask();
    method public java.lang.String getOperatorNumeric();
    method public java.lang.String getPassword();
    method public int getProtocol();
    method public deprecated java.net.InetAddress getProxyAddress();
    method public java.lang.String getProxyAddressAsString();
    method public int getProxyPort();
    method public int getRoamingProtocol();
    method public java.lang.String getUser();
    method public boolean isEnabled();
    method public void writeToParcel(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_PPP = 3; // 0x3
    field public static final int TYPE_CBS = 128; // 0x80
    field public static final int TYPE_DEFAULT = 1; // 0x1
    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(java.lang.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 setEntryName(java.lang.String);
    method public deprecated android.telephony.data.ApnSetting.Builder setMmsProxyAddress(java.net.InetAddress);
    method public android.telephony.data.ApnSetting.Builder setMmsProxyAddress(java.lang.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(java.lang.String);
    method public android.telephony.data.ApnSetting.Builder setPassword(java.lang.String);
    method public android.telephony.data.ApnSetting.Builder setProtocol(int);
    method public deprecated android.telephony.data.ApnSetting.Builder setProxyAddress(java.net.InetAddress);
    method public android.telephony.data.ApnSetting.Builder setProxyAddress(java.lang.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(java.lang.String);
  }

}

package android.telephony.euicc {

  public final class DownloadableSubscription implements android.os.Parcelable {
    method public int describeContents();
    method public static android.telephony.euicc.DownloadableSubscription forActivationCode(java.lang.String);
    method public java.lang.String getConfirmationCode();
    method public java.lang.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(java.lang.String);
    method public int describeContents();
    method public java.lang.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 void deleteSubscription(int, android.app.PendingIntent);
    method public void downloadSubscription(android.telephony.euicc.DownloadableSubscription, boolean, android.app.PendingIntent);
    method public java.lang.String getEid();
    method 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 public void switchToSubscription(int, android.app.PendingIntent);
    field public static final java.lang.String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS = "android.telephony.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS";
    field public static final java.lang.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 java.lang.String EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DETAILED_CODE";
    field public static final java.lang.String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION";
    field public static final java.lang.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();
  }

  public final deprecated class SmsManager {
    method public deprecated java.util.ArrayList<java.lang.String> divideMessage(java.lang.String);
    method public static deprecated android.telephony.gsm.SmsManager getDefault();
    method public deprecated void sendDataMessage(java.lang.String, java.lang.String, short, byte[], android.app.PendingIntent, android.app.PendingIntent);
    method public deprecated void sendMultipartTextMessage(java.lang.String, java.lang.String, java.util.ArrayList<java.lang.String>, java.util.ArrayList<android.app.PendingIntent>, java.util.ArrayList<android.app.PendingIntent>);
    method public deprecated void sendTextMessage(java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent);
    field public static final deprecated int RESULT_ERROR_GENERIC_FAILURE = 1; // 0x1
    field public static final deprecated int RESULT_ERROR_NO_SERVICE = 4; // 0x4
    field public static final deprecated int RESULT_ERROR_NULL_PDU = 3; // 0x3
    field public static final deprecated int RESULT_ERROR_RADIO_OFF = 2; // 0x2
    field public static final deprecated int STATUS_ON_SIM_FREE = 0; // 0x0
    field public static final deprecated int STATUS_ON_SIM_READ = 1; // 0x1
    field public static final deprecated int STATUS_ON_SIM_SENT = 5; // 0x5
    field public static final deprecated int STATUS_ON_SIM_UNREAD = 3; // 0x3
    field public static final deprecated int STATUS_ON_SIM_UNSENT = 7; // 0x7
  }

  public deprecated class SmsMessage {
    ctor public deprecated SmsMessage();
    method public static deprecated int[] calculateLength(java.lang.CharSequence, boolean);
    method public static deprecated int[] calculateLength(java.lang.String, boolean);
    method public static deprecated android.telephony.gsm.SmsMessage createFromPdu(byte[]);
    method public deprecated java.lang.String getDisplayMessageBody();
    method public deprecated java.lang.String getDisplayOriginatingAddress();
    method public deprecated java.lang.String getEmailBody();
    method public deprecated java.lang.String getEmailFrom();
    method public deprecated int getIndexOnSim();
    method public deprecated java.lang.String getMessageBody();
    method public deprecated android.telephony.gsm.SmsMessage.MessageClass getMessageClass();
    method public deprecated java.lang.String getOriginatingAddress();
    method public deprecated byte[] getPdu();
    method public deprecated int getProtocolIdentifier();
    method public deprecated java.lang.String getPseudoSubject();
    method public deprecated java.lang.String getServiceCenterAddress();
    method public deprecated int getStatus();
    method public deprecated int getStatusOnSim();
    method public static deprecated android.telephony.gsm.SmsMessage.SubmitPdu getSubmitPdu(java.lang.String, java.lang.String, java.lang.String, boolean);
    method public static deprecated android.telephony.gsm.SmsMessage.SubmitPdu getSubmitPdu(java.lang.String, java.lang.String, short, byte[], boolean);
    method public static deprecated int getTPLayerLengthForPDU(java.lang.String);
    method public deprecated long getTimestampMillis();
    method public deprecated byte[] getUserData();
    method public deprecated boolean isCphsMwiMessage();
    method public deprecated boolean isEmail();
    method public deprecated boolean isMWIClearMessage();
    method public deprecated boolean isMWISetMessage();
    method public deprecated boolean isMwiDontStore();
    method public deprecated boolean isReplace();
    method public deprecated boolean isReplyPathPresent();
    method public deprecated boolean isStatusReportMessage();
    field public static final deprecated int ENCODING_16BIT = 3; // 0x3
    field public static final deprecated int ENCODING_7BIT = 1; // 0x1
    field public static final deprecated int ENCODING_8BIT = 2; // 0x2
    field public static final deprecated int ENCODING_UNKNOWN = 0; // 0x0
    field public static final deprecated int MAX_USER_DATA_BYTES = 140; // 0x8c
    field public static final deprecated int MAX_USER_DATA_SEPTETS = 160; // 0xa0
    field public static final deprecated int MAX_USER_DATA_SEPTETS_WITH_HEADER = 153; // 0x99
  }

  public static final deprecated class SmsMessage.MessageClass extends java.lang.Enum {
    method public static android.telephony.gsm.SmsMessage.MessageClass valueOf(java.lang.String);
    method public static final android.telephony.gsm.SmsMessage.MessageClass[] values();
    enum_constant public static final android.telephony.gsm.SmsMessage.MessageClass CLASS_0;
    enum_constant public static final android.telephony.gsm.SmsMessage.MessageClass CLASS_1;
    enum_constant public static final android.telephony.gsm.SmsMessage.MessageClass CLASS_2;
    enum_constant public static final android.telephony.gsm.SmsMessage.MessageClass CLASS_3;
    enum_constant public static final android.telephony.gsm.SmsMessage.MessageClass UNKNOWN;
  }

  public static deprecated class SmsMessage.SubmitPdu {
    ctor public deprecated SmsMessage.SubmitPdu();
    method public deprecated java.lang.String toString();
    field public deprecated byte[] encodedMessage;
    field public deprecated 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 java.lang.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(android.net.Uri, 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 java.lang.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 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, java.lang.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.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 class MbmsStreamingSessionCallback {
    ctor public MbmsStreamingSessionCallback();
    method public void onError(int, java.lang.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 public java.lang.CharSequence getNameForLocale(java.util.Locale);
    method public java.util.Set<java.util.Locale> getNamedContentLocales();
    method public java.lang.String getServiceClassName();
    method public java.lang.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 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, java.lang.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(java.lang.CharSequence, char[], int, int);
    method public java.lang.CharSequence subSequence(int, int);
  }

  public deprecated class AndroidCharacter {
    ctor public AndroidCharacter();
    method public static void getDirectionalities(char[], byte[], int);
    method public static int getEastAsianWidth(char);
    method public static void getEastAsianWidths(char[], int, int, byte[]);
    method public static char getMirror(char);
    method public static boolean mirror(char[], int, int);
    field public static final int EAST_ASIAN_WIDTH_AMBIGUOUS = 1; // 0x1
    field public static final int EAST_ASIAN_WIDTH_FULL_WIDTH = 3; // 0x3
    field public static final int EAST_ASIAN_WIDTH_HALF_WIDTH = 2; // 0x2
    field public static final int EAST_ASIAN_WIDTH_NARROW = 4; // 0x4
    field public static final int EAST_ASIAN_WIDTH_NEUTRAL = 0; // 0x0
    field public static final int EAST_ASIAN_WIDTH_WIDE = 5; // 0x5
  }

  public class Annotation implements android.text.ParcelableSpan {
    ctor public Annotation(java.lang.String, java.lang.String);
    ctor public Annotation(android.os.Parcel);
    method public int describeContents();
    method public java.lang.String getKey();
    method public int getSpanTypeId();
    method public java.lang.String getValue();
    method public void writeToParcel(android.os.Parcel, int);
  }

  public class AutoText {
    method public static java.lang.String get(java.lang.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(java.lang.String);
    method public boolean isRtl(java.lang.CharSequence);
    method public boolean isRtlContext();
    method public java.lang.String unicodeWrap(java.lang.String, android.text.TextDirectionHeuristic, boolean);
    method public java.lang.CharSequence unicodeWrap(java.lang.CharSequence, android.text.TextDirectionHeuristic, boolean);
    method public java.lang.String unicodeWrap(java.lang.String, android.text.TextDirectionHeuristic);
    method public java.lang.CharSequence unicodeWrap(java.lang.CharSequence, android.text.TextDirectionHeuristic);
    method public java.lang.String unicodeWrap(java.lang.String, boolean);
    method public java.lang.CharSequence unicodeWrap(java.lang.CharSequence, boolean);
    method public java.lang.String unicodeWrap(java.lang.String);
    method public java.lang.CharSequence unicodeWrap(java.lang.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(java.lang.CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, android.text.BoringLayout.Metrics, boolean);
    ctor public BoringLayout(java.lang.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(java.lang.CharSequence, android.text.TextPaint);
    method public static android.text.BoringLayout.Metrics isBoring(java.lang.CharSequence, android.text.TextPaint, android.text.BoringLayout.Metrics);
    method public static android.text.BoringLayout make(java.lang.CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, android.text.BoringLayout.Metrics, boolean);
    method public static android.text.BoringLayout make(java.lang.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(java.lang.CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, android.text.BoringLayout.Metrics, boolean);
    method public android.text.BoringLayout replaceOrMake(java.lang.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;
  }

  public abstract deprecated class ClipboardManager {
    ctor public ClipboardManager();
    method public abstract java.lang.CharSequence getText();
    method public abstract boolean hasText();
    method public abstract void setText(java.lang.CharSequence);
  }

  public class DynamicLayout extends android.text.Layout {
    ctor public deprecated DynamicLayout(java.lang.CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, boolean);
    ctor public deprecated DynamicLayout(java.lang.CharSequence, java.lang.CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, boolean);
    ctor public deprecated DynamicLayout(java.lang.CharSequence, java.lang.CharSequence, 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 DynamicLayout.Builder {
    method public android.text.DynamicLayout build();
    method public static android.text.DynamicLayout.Builder obtain(java.lang.CharSequence, android.text.TextPaint, int);
    method public android.text.DynamicLayout.Builder setAlignment(android.text.Layout.Alignment);
    method public android.text.DynamicLayout.Builder setBreakStrategy(int);
    method public android.text.DynamicLayout.Builder setDisplayText(java.lang.CharSequence);
    method public android.text.DynamicLayout.Builder setEllipsize(android.text.TextUtils.TruncateAt);
    method public android.text.DynamicLayout.Builder setEllipsizedWidth(int);
    method public android.text.DynamicLayout.Builder setHyphenationFrequency(int);
    method public android.text.DynamicLayout.Builder setIncludePad(boolean);
    method public android.text.DynamicLayout.Builder setJustificationMode(int);
    method public android.text.DynamicLayout.Builder setLineSpacing(float, float);
    method public android.text.DynamicLayout.Builder setTextDirection(android.text.TextDirectionHeuristic);
    method public android.text.DynamicLayout.Builder setUseLineSpacingFromFallbacks(boolean);
  }

  public abstract interface Editable implements java.lang.Appendable java.lang.CharSequence android.text.GetChars android.text.Spannable {
    method public abstract android.text.Editable append(java.lang.CharSequence);
    method public abstract android.text.Editable append(java.lang.CharSequence, int, int);
    method public abstract android.text.Editable append(char);
    method public abstract void clear();
    method public abstract void clearSpans();
    method public abstract android.text.Editable delete(int, int);
    method public abstract android.text.InputFilter[] getFilters();
    method public abstract android.text.Editable insert(int, java.lang.CharSequence, int, int);
    method public abstract android.text.Editable insert(int, java.lang.CharSequence);
    method public abstract android.text.Editable replace(int, int, java.lang.CharSequence, int, int);
    method public abstract android.text.Editable replace(int, int, java.lang.CharSequence);
    method public abstract 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(java.lang.CharSequence);
  }

  public abstract interface GetChars implements java.lang.CharSequence {
    method public abstract void getChars(int, int, char[], int);
  }

  public class Html {
    method public static java.lang.String escapeHtml(java.lang.CharSequence);
    method public static deprecated android.text.Spanned fromHtml(java.lang.String);
    method public static android.text.Spanned fromHtml(java.lang.String, int);
    method public static deprecated android.text.Spanned fromHtml(java.lang.String, android.text.Html.ImageGetter, android.text.Html.TagHandler);
    method public static android.text.Spanned fromHtml(java.lang.String, int, android.text.Html.ImageGetter, android.text.Html.TagHandler);
    method public static deprecated java.lang.String toHtml(android.text.Spanned);
    method public static java.lang.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 abstract interface Html.ImageGetter {
    method public abstract android.graphics.drawable.Drawable getDrawable(java.lang.String);
  }

  public static abstract interface Html.TagHandler {
    method public abstract void handleTag(boolean, java.lang.String, android.text.Editable, org.xml.sax.XMLReader);
  }

  public abstract interface InputFilter {
    method public abstract java.lang.CharSequence filter(java.lang.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(java.util.Locale);
    method public java.lang.CharSequence filter(java.lang.CharSequence, int, int, android.text.Spanned, int, int);
  }

  public static class InputFilter.LengthFilter implements android.text.InputFilter {
    ctor public InputFilter.LengthFilter(int);
    method public java.lang.CharSequence filter(java.lang.CharSequence, int, int, android.text.Spanned, int, int);
    method public int getMax();
  }

  public abstract 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(java.lang.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, java.lang.CharSequence);
    method public static float getDesiredWidth(java.lang.CharSequence, android.text.TextPaint);
    method public static float getDesiredWidth(java.lang.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 java.lang.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 static final class Layout.Alignment extends java.lang.Enum {
    method public static android.text.Layout.Alignment valueOf(java.lang.String);
    method public static final android.text.Layout.Alignment[] values();
    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 java.lang.CharSequence filter(java.lang.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 abstract interface NoCopySpan {
  }

  public static class NoCopySpan.Concrete implements android.text.NoCopySpan {
    ctor public NoCopySpan.Concrete();
  }

  public abstract interface ParcelableSpan implements android.os.Parcelable {
    method public abstract int getSpanTypeId();
  }

  public class PrecomputedText implements android.text.Spannable {
    method public char charAt(int);
    method public static android.text.PrecomputedText create(java.lang.CharSequence, android.text.PrecomputedText.Params);
    method public void getBounds(int, int, android.graphics.Rect);
    method public int getParagraphCount();
    method public int getParagraphEnd(int);
    method public int getParagraphStart(int);
    method public android.text.PrecomputedText.Params getParams();
    method public int getSpanEnd(java.lang.Object);
    method public int getSpanFlags(java.lang.Object);
    method public int getSpanStart(java.lang.Object);
    method public <T> T[] getSpans(int, int, java.lang.Class<T>);
    method public float getWidth(int, int);
    method public int length();
    method public int nextSpanTransition(int, int, java.lang.Class);
    method public void removeSpan(java.lang.Object);
    method public void setSpan(java.lang.Object, int, int, int);
    method public java.lang.CharSequence subSequence(int, int);
  }

  public static final class PrecomputedText.Params {
    method public int getBreakStrategy();
    method public int getHyphenationFrequency();
    method public android.text.TextDirectionHeuristic getTextDirection();
    method public android.text.TextPaint getTextPaint();
  }

  public static class PrecomputedText.Params.Builder {
    ctor public PrecomputedText.Params.Builder(android.text.TextPaint);
    method 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(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(java.lang.CharSequence);
    method public static final int getSelectionStart(java.lang.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 java.lang.Object SELECTION_END;
    field public static final java.lang.Object SELECTION_START;
  }

  public abstract interface SpanWatcher implements android.text.NoCopySpan {
    method public abstract void onSpanAdded(android.text.Spannable, java.lang.Object, int, int);
    method public abstract void onSpanChanged(android.text.Spannable, java.lang.Object, int, int, int, int);
    method public abstract void onSpanRemoved(android.text.Spannable, java.lang.Object, int, int);
  }

  public abstract interface Spannable implements android.text.Spanned {
    method public abstract void removeSpan(java.lang.Object);
    method public abstract void setSpan(java.lang.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(java.lang.CharSequence);
  }

  public class SpannableString implements java.lang.CharSequence android.text.GetChars android.text.Spannable {
    ctor public SpannableString(java.lang.CharSequence);
    method public void removeSpan(java.lang.Object);
    method public void setSpan(java.lang.Object, int, int, int);
    method public final java.lang.CharSequence subSequence(int, int);
    method public static android.text.SpannableString valueOf(java.lang.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(java.lang.CharSequence);
    ctor public SpannableStringBuilder(java.lang.CharSequence, int, int);
    method public android.text.SpannableStringBuilder append(java.lang.CharSequence);
    method public android.text.SpannableStringBuilder append(java.lang.CharSequence, java.lang.Object, int);
    method public android.text.SpannableStringBuilder append(java.lang.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(java.lang.Object);
    method public int getSpanFlags(java.lang.Object);
    method public int getSpanStart(java.lang.Object);
    method public <T> T[] getSpans(int, int, java.lang.Class<T>);
    method public deprecated int getTextRunCursor(int, int, int, int, int, android.graphics.Paint);
    method public int getTextWatcherDepth();
    method public android.text.SpannableStringBuilder insert(int, java.lang.CharSequence, int, int);
    method public android.text.SpannableStringBuilder insert(int, java.lang.CharSequence);
    method public int length();
    method public int nextSpanTransition(int, int, java.lang.Class);
    method public void removeSpan(java.lang.Object);
    method public android.text.SpannableStringBuilder replace(int, int, java.lang.CharSequence);
    method public android.text.SpannableStringBuilder replace(int, int, java.lang.CharSequence, int, int);
    method public void setFilters(android.text.InputFilter[]);
    method public void setSpan(java.lang.Object, int, int, int);
    method public java.lang.CharSequence subSequence(int, int);
    method public static android.text.SpannableStringBuilder valueOf(java.lang.CharSequence);
  }

  public abstract interface Spanned implements java.lang.CharSequence {
    method public abstract int getSpanEnd(java.lang.Object);
    method public abstract int getSpanFlags(java.lang.Object);
    method public abstract int getSpanStart(java.lang.Object);
    method public abstract <T> T[] getSpans(int, int, java.lang.Class<T>);
    method public abstract int nextSpanTransition(int, int, java.lang.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(java.lang.CharSequence);
    method public java.lang.CharSequence subSequence(int, int);
    method public static android.text.SpannedString valueOf(java.lang.CharSequence);
  }

  public class StaticLayout extends android.text.Layout {
    ctor public deprecated StaticLayout(java.lang.CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, boolean);
    ctor public deprecated StaticLayout(java.lang.CharSequence, int, int, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, boolean);
    ctor public deprecated StaticLayout(java.lang.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 public android.text.StaticLayout build();
    method public static android.text.StaticLayout.Builder obtain(java.lang.CharSequence, int, int, android.text.TextPaint, int);
    method public android.text.StaticLayout.Builder setAlignment(android.text.Layout.Alignment);
    method public android.text.StaticLayout.Builder setBreakStrategy(int);
    method public android.text.StaticLayout.Builder setEllipsize(android.text.TextUtils.TruncateAt);
    method public android.text.StaticLayout.Builder setEllipsizedWidth(int);
    method public android.text.StaticLayout.Builder setHyphenationFrequency(int);
    method public android.text.StaticLayout.Builder setIncludePad(boolean);
    method public android.text.StaticLayout.Builder setIndents(int[], int[]);
    method public android.text.StaticLayout.Builder setJustificationMode(int);
    method public android.text.StaticLayout.Builder setLineSpacing(float, float);
    method public android.text.StaticLayout.Builder setMaxLines(int);
    method public android.text.StaticLayout.Builder setText(java.lang.CharSequence);
    method public android.text.StaticLayout.Builder setTextDirection(android.text.TextDirectionHeuristic);
    method public android.text.StaticLayout.Builder setUseLineSpacingFromFallbacks(boolean);
  }

  public abstract interface TextDirectionHeuristic {
    method public abstract boolean isRtl(char[], int, int);
    method public abstract boolean isRtl(java.lang.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 public int bgColor;
    field public float density;
    field public int[] drawableState;
    field public int linkColor;
  }

  public class TextUtils {
    method public static deprecated java.lang.CharSequence commaEllipsize(java.lang.CharSequence, android.text.TextPaint, float, java.lang.String, java.lang.String);
    method public static java.lang.CharSequence concat(java.lang.CharSequence...);
    method public static void copySpansFrom(android.text.Spanned, int, int, java.lang.Class, android.text.Spannable, int);
    method public static void dumpSpans(java.lang.CharSequence, android.util.Printer, java.lang.String);
    method public static java.lang.CharSequence ellipsize(java.lang.CharSequence, android.text.TextPaint, float, android.text.TextUtils.TruncateAt);
    method public static java.lang.CharSequence ellipsize(java.lang.CharSequence, android.text.TextPaint, float, android.text.TextUtils.TruncateAt, boolean, android.text.TextUtils.EllipsizeCallback);
    method public static boolean equals(java.lang.CharSequence, java.lang.CharSequence);
    method public static java.lang.CharSequence expandTemplate(java.lang.CharSequence, java.lang.CharSequence...);
    method public static int getCapsMode(java.lang.CharSequence, int, int);
    method public static void getChars(java.lang.CharSequence, int, int, char[], int);
    method public static int getLayoutDirectionFromLocale(java.util.Locale);
    method public static int getOffsetAfter(java.lang.CharSequence, int);
    method public static int getOffsetBefore(java.lang.CharSequence, int);
    method public static deprecated java.lang.CharSequence getReverse(java.lang.CharSequence, int, int);
    method public static int getTrimmedLength(java.lang.CharSequence);
    method public static java.lang.String htmlEncode(java.lang.String);
    method public static int indexOf(java.lang.CharSequence, char);
    method public static int indexOf(java.lang.CharSequence, char, int);
    method public static int indexOf(java.lang.CharSequence, char, int, int);
    method public static int indexOf(java.lang.CharSequence, java.lang.CharSequence);
    method public static int indexOf(java.lang.CharSequence, java.lang.CharSequence, int);
    method public static int indexOf(java.lang.CharSequence, java.lang.CharSequence, int, int);
    method public static boolean isDigitsOnly(java.lang.CharSequence);
    method public static boolean isEmpty(java.lang.CharSequence);
    method public static boolean isGraphic(java.lang.CharSequence);
    method public static deprecated boolean isGraphic(char);
    method public static java.lang.String join(java.lang.CharSequence, java.lang.Object[]);
    method public static java.lang.String join(java.lang.CharSequence, java.lang.Iterable);
    method public static int lastIndexOf(java.lang.CharSequence, char);
    method public static int lastIndexOf(java.lang.CharSequence, char, int);
    method public static int lastIndexOf(java.lang.CharSequence, char, int, int);
    method public static java.lang.CharSequence listEllipsize(android.content.Context, java.util.List<java.lang.CharSequence>, java.lang.String, android.text.TextPaint, float, int);
    method public static boolean regionMatches(java.lang.CharSequence, int, java.lang.CharSequence, int, int);
    method public static java.lang.CharSequence replace(java.lang.CharSequence, java.lang.String[], java.lang.CharSequence[]);
    method public static java.lang.String[] split(java.lang.String, java.lang.String);
    method public static java.lang.String[] split(java.lang.String, java.util.regex.Pattern);
    method public static java.lang.CharSequence stringOrSpannedString(java.lang.CharSequence);
    method public static java.lang.String substring(java.lang.CharSequence, int, int);
    method public static void writeToParcel(java.lang.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 abstract interface TextUtils.EllipsizeCallback {
    method public abstract void ellipsized(int, int);
  }

  public static class TextUtils.SimpleStringSplitter implements java.util.Iterator android.text.TextUtils.StringSplitter {
    ctor public TextUtils.SimpleStringSplitter(char);
    method public boolean hasNext();
    method public java.util.Iterator<java.lang.String> iterator();
    method public java.lang.String next();
    method public void setString(java.lang.String);
  }

  public static abstract interface TextUtils.StringSplitter implements java.lang.Iterable {
    method public abstract void setString(java.lang.String);
  }

  public static final class TextUtils.TruncateAt extends java.lang.Enum {
    method public static android.text.TextUtils.TruncateAt valueOf(java.lang.String);
    method public static final android.text.TextUtils.TruncateAt[] values();
    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 abstract interface TextWatcher implements android.text.NoCopySpan {
    method public abstract void afterTextChanged(android.text.Editable);
    method public abstract void beforeTextChanged(java.lang.CharSequence, int, int, int);
    method public abstract void onTextChanged(java.lang.CharSequence, int, int, int);
  }

}

package android.text.format {

  public class DateFormat {
    ctor public DateFormat();
    method public static java.lang.CharSequence format(java.lang.CharSequence, long);
    method public static java.lang.CharSequence format(java.lang.CharSequence, java.util.Date);
    method public static java.lang.CharSequence format(java.lang.CharSequence, java.util.Calendar);
    method public static java.lang.String getBestDateTimePattern(java.util.Locale, java.lang.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 java.lang.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, java.lang.String);
    method public static java.lang.String formatDateTime(android.content.Context, long, int);
    method public static java.lang.String formatElapsedTime(long);
    method public static java.lang.String formatElapsedTime(java.lang.StringBuilder, long);
    method public static final java.lang.CharSequence formatSameDayTime(long, long, int, int);
    method public static deprecated java.lang.String getAMPMString(int);
    method public static deprecated java.lang.String getDayOfWeekString(int, int);
    method public static deprecated java.lang.String getMonthString(int, int);
    method public static java.lang.CharSequence getRelativeDateTimeString(android.content.Context, long, long, long, int);
    method public static java.lang.CharSequence getRelativeTimeSpanString(long);
    method public static java.lang.CharSequence getRelativeTimeSpanString(long, long, long);
    method public static java.lang.CharSequence getRelativeTimeSpanString(long, long, long, int);
    method public static java.lang.CharSequence getRelativeTimeSpanString(android.content.Context, long, boolean);
    method public static java.lang.CharSequence getRelativeTimeSpanString(android.content.Context, long);
    method public static boolean isToday(long);
    field public static final deprecated java.lang.String ABBREV_MONTH_FORMAT = "%b";
    field public static final java.lang.String ABBREV_WEEKDAY_FORMAT = "%a";
    field public static final long DAY_IN_MILLIS = 86400000L; // 0x5265c00L
    field public static final deprecated int FORMAT_12HOUR = 64; // 0x40
    field public static final deprecated 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 public static final deprecated int FORMAT_CAP_AMPM = 256; // 0x100
    field public static final deprecated int FORMAT_CAP_MIDNIGHT = 4096; // 0x1000
    field public static final deprecated int FORMAT_CAP_NOON = 1024; // 0x400
    field public static final deprecated 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 public static final deprecated 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 public static final deprecated int FORMAT_UTC = 8192; // 0x2000
    field public static final long HOUR_IN_MILLIS = 3600000L; // 0x36ee80L
    field public static final deprecated java.lang.String HOUR_MINUTE_24 = "%H:%M";
    field public static final deprecated int LENGTH_LONG = 10; // 0xa
    field public static final deprecated int LENGTH_MEDIUM = 20; // 0x14
    field public static final deprecated int LENGTH_SHORT = 30; // 0x1e
    field public static final deprecated int LENGTH_SHORTER = 40; // 0x28
    field public static final deprecated int LENGTH_SHORTEST = 50; // 0x32
    field public static final long MINUTE_IN_MILLIS = 60000L; // 0xea60L
    field public static final java.lang.String MONTH_DAY_FORMAT = "%-d";
    field public static final java.lang.String MONTH_FORMAT = "%B";
    field public static final java.lang.String NUMERIC_MONTH_FORMAT = "%m";
    field public static final long SECOND_IN_MILLIS = 1000L; // 0x3e8L
    field public static final java.lang.String WEEKDAY_FORMAT = "%A";
    field public static final long WEEK_IN_MILLIS = 604800000L; // 0x240c8400L
    field public static final java.lang.String YEAR_FORMAT = "%Y";
    field public static final java.lang.String YEAR_FORMAT_TWO_DIGITS = "%g";
    field public static final long YEAR_IN_MILLIS = 31449600000L; // 0x7528ad000L
    field public static final deprecated int[] sameMonthTable;
    field public static final deprecated int[] sameYearTable;
  }

  public final class Formatter {
    ctor public Formatter();
    method public static java.lang.String formatFileSize(android.content.Context, long);
    method public static deprecated java.lang.String formatIpAddress(int);
    method public static java.lang.String formatShortFileSize(android.content.Context, long);
  }

  public deprecated class Time {
    ctor public Time(java.lang.String);
    ctor public Time();
    ctor public Time(android.text.format.Time);
    method public boolean after(android.text.format.Time);
    method public boolean before(android.text.format.Time);
    method public void clear(java.lang.String);
    method public static int compare(android.text.format.Time, android.text.format.Time);
    method public java.lang.String format(java.lang.String);
    method public java.lang.String format2445();
    method public java.lang.String format3339(boolean);
    method public int getActualMaximum(int);
    method public static java.lang.String getCurrentTimezone();
    method public static int getJulianDay(long, long);
    method public static int getJulianMondayFromWeeksSinceEpoch(int);
    method public int getWeekNumber();
    method public static int getWeeksSinceEpochFromJulianDay(int, int);
    method public static boolean isEpoch(android.text.format.Time);
    method public long normalize(boolean);
    method public boolean parse(java.lang.String);
    method public boolean parse3339(java.lang.String);
    method public void set(long);
    method public void set(android.text.format.Time);
    method public void set(int, int, int, int, int, int);
    method public void set(int, int, int);
    method public long setJulianDay(int);
    method public void setToNow();
    method public void switchTimezone(java.lang.String);
    method public long toMillis(boolean);
    field public static final int EPOCH_JULIAN_DAY = 2440588; // 0x253d8c
    field public static final int FRIDAY = 5; // 0x5
    field public static final int HOUR = 3; // 0x3
    field public static final int MINUTE = 2; // 0x2
    field public static final int MONDAY = 1; // 0x1
    field public static final int MONDAY_BEFORE_JULIAN_EPOCH = 2440585; // 0x253d89
    field public static final int MONTH = 5; // 0x5
    field public static final int MONTH_DAY = 4; // 0x4
    field public static final int SATURDAY = 6; // 0x6
    field public static final int SECOND = 1; // 0x1
    field public static final int SUNDAY = 0; // 0x0
    field public static final int THURSDAY = 4; // 0x4
    field public static final java.lang.String TIMEZONE_UTC = "UTC";
    field public static final int TUESDAY = 2; // 0x2
    field public static final int WEDNESDAY = 3; // 0x3
    field public static final int WEEK_DAY = 7; // 0x7
    field public static final int WEEK_NUM = 9; // 0x9
    field public static final int YEAR = 6; // 0x6
    field public static final int YEAR_DAY = 8; // 0x8
    field public boolean allDay;
    field public long gmtoff;
    field public int hour;
    field public int isDst;
    field public int minute;
    field public int month;
    field public int monthDay;
    field public int second;
    field public java.lang.String timezone;
    field public int weekDay;
    field public int year;
    field 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, java.lang.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 public deprecated DateKeyListener();
    ctor public DateKeyListener(java.util.Locale);
    method protected char[] getAcceptedChars();
    method public int getInputType();
    method public static deprecated android.text.method.DateKeyListener getInstance();
    method public static android.text.method.DateKeyListener getInstance(java.util.Locale);
    field public static final deprecated char[] CHARACTERS;
  }

  public class DateTimeKeyListener extends android.text.method.NumberKeyListener {
    ctor public deprecated DateTimeKeyListener();
    ctor public DateTimeKeyListener(java.util.Locale);
    method protected char[] getAcceptedChars();
    method public int getInputType();
    method public static deprecated android.text.method.DateTimeKeyListener getInstance();
    method public static android.text.method.DateTimeKeyListener getInstance(java.util.Locale);
    field public static final deprecated 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 public deprecated DigitsKeyListener();
    ctor public deprecated DigitsKeyListener(boolean, boolean);
    ctor public DigitsKeyListener(java.util.Locale);
    ctor public DigitsKeyListener(java.util.Locale, boolean, boolean);
    method protected char[] getAcceptedChars();
    method public int getInputType();
    method public static deprecated android.text.method.DigitsKeyListener getInstance();
    method public static deprecated android.text.method.DigitsKeyListener getInstance(boolean, boolean);
    method public static android.text.method.DigitsKeyListener getInstance(java.util.Locale);
    method public static android.text.method.DigitsKeyListener getInstance(java.util.Locale, boolean, boolean);
    method public static android.text.method.DigitsKeyListener getInstance(java.lang.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 abstract interface KeyListener {
    method public abstract void clearMetaKeyState(android.view.View, android.text.Editable, int);
    method public abstract int getInputType();
    method public abstract boolean onKeyDown(android.view.View, android.text.Editable, int, android.view.KeyEvent);
    method public abstract boolean onKeyOther(android.view.View, android.text.Editable, android.view.KeyEvent);
    method public abstract 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(java.lang.CharSequence);
    method public static final int getMetaState(java.lang.CharSequence, android.view.KeyEvent);
    method public static final int getMetaState(java.lang.CharSequence, int);
    method public static final int getMetaState(java.lang.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(java.lang.CharSequence, java.lang.Object);
    method public static boolean isSelectingMetaTracker(java.lang.CharSequence, java.lang.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 abstract interface MovementMethod {
    method public abstract boolean canSelectArbitrarily();
    method public abstract void initialize(android.widget.TextView, android.text.Spannable);
    method public abstract boolean onGenericMotionEvent(android.widget.TextView, android.text.Spannable, android.view.MotionEvent);
    method public abstract boolean onKeyDown(android.widget.TextView, android.text.Spannable, int, android.view.KeyEvent);
    method public abstract boolean onKeyOther(android.widget.TextView, android.text.Spannable, android.view.KeyEvent);
    method public abstract boolean onKeyUp(android.widget.TextView, android.text.Spannable, int, android.view.KeyEvent);
    method public abstract void onTakeFocus(android.widget.TextView, android.text.Spannable, int);
    method public abstract boolean onTouchEvent(android.widget.TextView, android.text.Spannable, android.view.MotionEvent);
    method public abstract 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, java.lang.Object, int, int);
    method public void onSpanChanged(android.text.Spannable, java.lang.Object, int, int, int, int);
    method public void onSpanRemoved(android.text.Spannable, java.lang.Object, int, int);
  }

  public abstract class NumberKeyListener extends android.text.method.BaseKeyListener implements android.text.InputFilter {
    ctor public NumberKeyListener();
    method public java.lang.CharSequence filter(java.lang.CharSequence, int, int, android.text.Spanned, int, int);
    method 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(java.lang.CharSequence, int, int, int);
    method public static android.text.method.PasswordTransformationMethod getInstance();
    method public java.lang.CharSequence getTransformation(java.lang.CharSequence, android.view.View);
    method public void onFocusChanged(android.view.View, java.lang.CharSequence, boolean, int, android.graphics.Rect);
    method public void onTextChanged(java.lang.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, java.lang.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 java.lang.CharSequence getTransformation(java.lang.CharSequence, android.view.View);
    method public void onFocusChanged(android.view.View, java.lang.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, java.lang.Object, int, int);
    method public void onSpanChanged(android.text.Spannable, java.lang.Object, int, int, int, int);
    method public void onSpanRemoved(android.text.Spannable, java.lang.Object, int, int);
    method public void release();
    method public static boolean shouldCap(android.text.method.TextKeyListener.Capitalize, java.lang.CharSequence, int);
  }

  public static final class TextKeyListener.Capitalize extends java.lang.Enum {
    method public static android.text.method.TextKeyListener.Capitalize valueOf(java.lang.String);
    method public static final android.text.method.TextKeyListener.Capitalize[] values();
    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 public deprecated TimeKeyListener();
    ctor public TimeKeyListener(java.util.Locale);
    method protected char[] getAcceptedChars();
    method public int getInputType();
    method public static deprecated android.text.method.TimeKeyListener getInstance();
    method public static android.text.method.TimeKeyListener getInstance(java.util.Locale);
    field public static final deprecated 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 abstract interface TransformationMethod {
    method public abstract java.lang.CharSequence getTransformation(java.lang.CharSequence, android.view.View);
    method public abstract void onFocusChanged(android.view.View, java.lang.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(android.os.Parcel);
    method public int describeContents();
    method public boolean getDip();
    method public int getSize();
    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 abstract interface AlignmentSpan implements android.text.style.ParagraphStyle {
    method public abstract android.text.Layout.Alignment getAlignment();
  }

  public static class AlignmentSpan.Standard implements android.text.style.AlignmentSpan android.text.ParcelableSpan {
    ctor public AlignmentSpan.Standard(android.text.Layout.Alignment);
    ctor public AlignmentSpan.Standard(android.os.Parcel);
    method public int describeContents();
    method public android.text.Layout.Alignment getAlignment();
    method public int getSpanTypeId();
    method public void writeToParcel(android.os.Parcel, int);
  }

  public class BackgroundColorSpan extends android.text.style.CharacterStyle implements android.text.ParcelableSpan android.text.style.UpdateAppearance {
    ctor public BackgroundColorSpan(int);
    ctor public BackgroundColorSpan(android.os.Parcel);
    method public int describeContents();
    method public int getBackgroundColor();
    method public int getSpanTypeId();
    method public void updateDrawState(android.text.TextPaint);
    method public void writeToParcel(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, int);
    ctor public BulletSpan(int, int, int);
    ctor public BulletSpan(android.os.Parcel);
    method public int describeContents();
    method public void drawLeadingMargin(android.graphics.Canvas, android.graphics.Paint, int, int, int, int, int, java.lang.CharSequence, int, int, boolean, 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(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(android.view.View);
    method public void updateDrawState(android.text.TextPaint);
  }

  public class DrawableMarginSpan implements android.text.style.LeadingMarginSpan android.text.style.LineHeightSpan {
    ctor public DrawableMarginSpan(android.graphics.drawable.Drawable);
    ctor public DrawableMarginSpan(android.graphics.drawable.Drawable, int);
    method public void chooseHeight(java.lang.CharSequence, int, int, int, int, android.graphics.Paint.FontMetricsInt);
    method public void drawLeadingMargin(android.graphics.Canvas, android.graphics.Paint, int, int, int, int, int, java.lang.CharSequence, int, int, boolean, 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(android.graphics.Canvas, java.lang.CharSequence, int, int, float, int, int, int, android.graphics.Paint);
    method public abstract android.graphics.drawable.Drawable getDrawable();
    method public int getSize(android.graphics.Paint, java.lang.CharSequence, int, int, 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(android.os.Parcel);
    method public int describeContents();
    method public int getSpanTypeId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final java.lang.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(int);
    ctor public ForegroundColorSpan(android.os.Parcel);
    method public int describeContents();
    method public int getForegroundColor();
    method public int getSpanTypeId();
    method public void updateDrawState(android.text.TextPaint);
    method public void writeToParcel(android.os.Parcel, int);
  }

  public class IconMarginSpan implements android.text.style.LeadingMarginSpan android.text.style.LineHeightSpan {
    ctor public IconMarginSpan(android.graphics.Bitmap);
    ctor public IconMarginSpan(android.graphics.Bitmap, int);
    method public void chooseHeight(java.lang.CharSequence, int, int, int, int, android.graphics.Paint.FontMetricsInt);
    method public void drawLeadingMargin(android.graphics.Canvas, android.graphics.Paint, int, int, int, int, int, java.lang.CharSequence, int, int, boolean, android.text.Layout);
    method public int getLeadingMargin(boolean);
  }

  public class ImageSpan extends android.text.style.DynamicDrawableSpan {
    ctor public deprecated ImageSpan(android.graphics.Bitmap);
    ctor public deprecated ImageSpan(android.graphics.Bitmap, int);
    ctor public ImageSpan(android.content.Context, android.graphics.Bitmap);
    ctor public ImageSpan(android.content.Context, android.graphics.Bitmap, int);
    ctor public ImageSpan(android.graphics.drawable.Drawable);
    ctor public ImageSpan(android.graphics.drawable.Drawable, int);
    ctor public ImageSpan(android.graphics.drawable.Drawable, java.lang.String);
    ctor public ImageSpan(android.graphics.drawable.Drawable, java.lang.String, int);
    ctor public ImageSpan(android.content.Context, android.net.Uri);
    ctor public ImageSpan(android.content.Context, android.net.Uri, int);
    ctor public ImageSpan(android.content.Context, int);
    ctor public ImageSpan(android.content.Context, int, int);
    method public android.graphics.drawable.Drawable getDrawable();
    method public java.lang.String getSource();
  }

  public abstract interface LeadingMarginSpan implements android.text.style.ParagraphStyle {
    method public abstract void drawLeadingMargin(android.graphics.Canvas, android.graphics.Paint, int, int, int, int, int, java.lang.CharSequence, int, int, boolean, android.text.Layout);
    method public abstract int getLeadingMargin(boolean);
  }

  public static abstract interface LeadingMarginSpan.LeadingMarginSpan2 implements android.text.style.LeadingMarginSpan android.text.style.WrapTogetherSpan {
    method public abstract 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, java.lang.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 abstract interface LineBackgroundSpan implements android.text.style.ParagraphStyle {
    method public abstract void drawBackground(android.graphics.Canvas, android.graphics.Paint, int, int, int, int, int, java.lang.CharSequence, int, int, int);
  }

  public abstract interface LineHeightSpan implements android.text.style.ParagraphStyle android.text.style.WrapTogetherSpan {
    method public abstract void chooseHeight(java.lang.CharSequence, int, int, int, int, android.graphics.Paint.FontMetricsInt);
  }

  public static abstract interface LineHeightSpan.WithDensity implements android.text.style.LineHeightSpan {
    method public abstract void chooseHeight(java.lang.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(java.util.Locale);
    ctor public LocaleSpan(android.os.LocaleList);
    ctor public LocaleSpan(android.os.Parcel);
    method public int describeContents();
    method public java.util.Locale getLocale();
    method 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(android.text.TextPaint);
  }

  public abstract interface ParagraphStyle {
  }

  public class QuoteSpan implements android.text.style.LeadingMarginSpan android.text.ParcelableSpan {
    ctor public QuoteSpan();
    ctor public QuoteSpan(int);
    ctor public QuoteSpan(int, int, int);
    ctor public QuoteSpan(android.os.Parcel);
    method public int describeContents();
    method public void drawLeadingMargin(android.graphics.Canvas, android.graphics.Paint, int, int, int, int, int, java.lang.CharSequence, int, int, boolean, android.text.Layout);
    method 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 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(float);
    ctor public RelativeSizeSpan(android.os.Parcel);
    method public int describeContents();
    method public float getSizeChange();
    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 abstract class ReplacementSpan extends android.text.style.MetricAffectingSpan {
    ctor public ReplacementSpan();
    method public abstract void draw(android.graphics.Canvas, java.lang.CharSequence, int, int, float, int, int, int, android.graphics.Paint);
    method public abstract int getSize(android.graphics.Paint, java.lang.CharSequence, int, int, 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(float);
    ctor public ScaleXSpan(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(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(android.os.Parcel);
    method public int describeContents();
    method public int getSpanTypeId();
    method public void updateDrawState(android.text.TextPaint);
    method public void writeToParcel(android.os.Parcel, int);
  }

  public class StyleSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
    ctor public StyleSpan(int);
    ctor public StyleSpan(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(android.os.Parcel);
    method public int describeContents();
    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 SuggestionSpan extends android.text.style.CharacterStyle implements android.text.ParcelableSpan {
    ctor public SuggestionSpan(android.content.Context, java.lang.String[], int);
    ctor public SuggestionSpan(java.util.Locale, java.lang.String[], int);
    ctor public SuggestionSpan(android.content.Context, java.util.Locale, java.lang.String[], int, java.lang.Class<?>);
    ctor public SuggestionSpan(android.os.Parcel);
    method public int describeContents();
    method public int getFlags();
    method public deprecated java.lang.String getLocale();
    method public java.util.Locale getLocaleObject();
    method public int getSpanTypeId();
    method public java.lang.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 java.lang.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 java.lang.String SUGGESTION_SPAN_PICKED_AFTER = "after";
    field public static final java.lang.String SUGGESTION_SPAN_PICKED_BEFORE = "before";
    field public static final java.lang.String SUGGESTION_SPAN_PICKED_HASHCODE = "hashcode";
  }

  public class SuperscriptSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
    ctor public SuperscriptSpan();
    ctor public SuperscriptSpan(android.os.Parcel);
    method public int describeContents();
    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 abstract interface TabStopSpan implements android.text.style.ParagraphStyle {
    method public abstract int getTabStop();
  }

  public static class TabStopSpan.Standard implements android.text.style.TabStopSpan {
    ctor public TabStopSpan.Standard(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(java.lang.String, int, int, android.content.res.ColorStateList, android.content.res.ColorStateList);
    ctor public TextAppearanceSpan(android.os.Parcel);
    method public int describeContents();
    method public java.lang.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(java.lang.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 java.lang.String getType();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final java.lang.String ANIMACY_ANIMATE = "android.animate";
    field public static final java.lang.String ANIMACY_INANIMATE = "android.inanimate";
    field public static final java.lang.String ARG_ANIMACY = "android.arg.animacy";
    field public static final java.lang.String ARG_CASE = "android.arg.case";
    field public static final java.lang.String ARG_COUNTRY_CODE = "android.arg.country_code";
    field public static final java.lang.String ARG_CURRENCY = "android.arg.money";
    field public static final java.lang.String ARG_DAY = "android.arg.day";
    field public static final java.lang.String ARG_DENOMINATOR = "android.arg.denominator";
    field public static final java.lang.String ARG_DIGITS = "android.arg.digits";
    field public static final java.lang.String ARG_DOMAIN = "android.arg.domain";
    field public static final java.lang.String ARG_EXTENSION = "android.arg.extension";
    field public static final java.lang.String ARG_FRACTIONAL_PART = "android.arg.fractional_part";
    field public static final java.lang.String ARG_FRAGMENT_ID = "android.arg.fragment_id";
    field public static final java.lang.String ARG_GENDER = "android.arg.gender";
    field public static final java.lang.String ARG_HOURS = "android.arg.hours";
    field public static final java.lang.String ARG_INTEGER_PART = "android.arg.integer_part";
    field public static final java.lang.String ARG_MINUTES = "android.arg.minutes";
    field public static final java.lang.String ARG_MONTH = "android.arg.month";
    field public static final java.lang.String ARG_MULTIPLICITY = "android.arg.multiplicity";
    field public static final java.lang.String ARG_NUMBER = "android.arg.number";
    field public static final java.lang.String ARG_NUMBER_PARTS = "android.arg.number_parts";
    field public static final java.lang.String ARG_NUMERATOR = "android.arg.numerator";
    field public static final java.lang.String ARG_PASSWORD = "android.arg.password";
    field public static final java.lang.String ARG_PATH = "android.arg.path";
    field public static final java.lang.String ARG_PORT = "android.arg.port";
    field public static final java.lang.String ARG_PROTOCOL = "android.arg.protocol";
    field public static final java.lang.String ARG_QUANTITY = "android.arg.quantity";
    field public static final java.lang.String ARG_QUERY_STRING = "android.arg.query_string";
    field public static final java.lang.String ARG_TEXT = "android.arg.text";
    field public static final java.lang.String ARG_UNIT = "android.arg.unit";
    field public static final java.lang.String ARG_USERNAME = "android.arg.username";
    field public static final java.lang.String ARG_VERBATIM = "android.arg.verbatim";
    field public static final java.lang.String ARG_WEEKDAY = "android.arg.weekday";
    field public static final java.lang.String ARG_YEAR = "android.arg.year";
    field public static final java.lang.String CASE_ABLATIVE = "android.ablative";
    field public static final java.lang.String CASE_ACCUSATIVE = "android.accusative";
    field public static final java.lang.String CASE_DATIVE = "android.dative";
    field public static final java.lang.String CASE_GENITIVE = "android.genitive";
    field public static final java.lang.String CASE_INSTRUMENTAL = "android.instrumental";
    field public static final java.lang.String CASE_LOCATIVE = "android.locative";
    field public static final java.lang.String CASE_NOMINATIVE = "android.nominative";
    field public static final java.lang.String CASE_VOCATIVE = "android.vocative";
    field public static final java.lang.String GENDER_FEMALE = "android.female";
    field public static final java.lang.String GENDER_MALE = "android.male";
    field public static final java.lang.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 java.lang.String MULTIPLICITY_DUAL = "android.dual";
    field public static final java.lang.String MULTIPLICITY_PLURAL = "android.plural";
    field public static final java.lang.String MULTIPLICITY_SINGLE = "android.single";
    field public static final java.lang.String TYPE_CARDINAL = "android.type.cardinal";
    field public static final java.lang.String TYPE_DATE = "android.type.date";
    field public static final java.lang.String TYPE_DECIMAL = "android.type.decimal";
    field public static final java.lang.String TYPE_DIGITS = "android.type.digits";
    field public static final java.lang.String TYPE_ELECTRONIC = "android.type.electronic";
    field public static final java.lang.String TYPE_FRACTION = "android.type.fraction";
    field public static final java.lang.String TYPE_MEASURE = "android.type.measure";
    field public static final java.lang.String TYPE_MONEY = "android.type.money";
    field public static final java.lang.String TYPE_ORDINAL = "android.type.ordinal";
    field public static final java.lang.String TYPE_TELEPHONE = "android.type.telephone";
    field public static final java.lang.String TYPE_TEXT = "android.type.text";
    field public static final java.lang.String TYPE_TIME = "android.type.time";
    field public static final java.lang.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(java.lang.String);
    method public android.text.style.TtsSpan build();
    method public C setIntArgument(java.lang.String, int);
    method public C setLongArgument(java.lang.String, long);
    method public C setStringArgument(java.lang.String, java.lang.String);
  }

  public static class TtsSpan.CardinalBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
    ctor public TtsSpan.CardinalBuilder();
    ctor public TtsSpan.CardinalBuilder(long);
    ctor public TtsSpan.CardinalBuilder(java.lang.String);
    method public android.text.style.TtsSpan.CardinalBuilder setNumber(long);
    method public android.text.style.TtsSpan.CardinalBuilder setNumber(java.lang.String);
  }

  public static class TtsSpan.DateBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
    ctor public TtsSpan.DateBuilder();
    ctor public TtsSpan.DateBuilder(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.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 {
    ctor public TtsSpan.DecimalBuilder();
    ctor public TtsSpan.DecimalBuilder(double, int, int);
    ctor public TtsSpan.DecimalBuilder(java.lang.String, java.lang.String);
    method public android.text.style.TtsSpan.DecimalBuilder setArgumentsFromDouble(double, int, int);
    method public android.text.style.TtsSpan.DecimalBuilder setFractionalPart(java.lang.String);
    method public android.text.style.TtsSpan.DecimalBuilder setIntegerPart(long);
    method public android.text.style.TtsSpan.DecimalBuilder setIntegerPart(java.lang.String);
  }

  public static class TtsSpan.DigitsBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
    ctor public TtsSpan.DigitsBuilder();
    ctor public TtsSpan.DigitsBuilder(java.lang.String);
    method public android.text.style.TtsSpan.DigitsBuilder setDigits(java.lang.String);
  }

  public static class TtsSpan.ElectronicBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
    ctor public TtsSpan.ElectronicBuilder();
    method public android.text.style.TtsSpan.ElectronicBuilder setDomain(java.lang.String);
    method public android.text.style.TtsSpan.ElectronicBuilder setEmailArguments(java.lang.String, java.lang.String);
    method public android.text.style.TtsSpan.ElectronicBuilder setFragmentId(java.lang.String);
    method public android.text.style.TtsSpan.ElectronicBuilder setPassword(java.lang.String);
    method public android.text.style.TtsSpan.ElectronicBuilder setPath(java.lang.String);
    method public android.text.style.TtsSpan.ElectronicBuilder setPort(int);
    method public android.text.style.TtsSpan.ElectronicBuilder setProtocol(java.lang.String);
    method public android.text.style.TtsSpan.ElectronicBuilder setQueryString(java.lang.String);
    method public android.text.style.TtsSpan.ElectronicBuilder setUsername(java.lang.String);
  }

  public static class TtsSpan.FractionBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
    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(java.lang.String);
    method public android.text.style.TtsSpan.FractionBuilder setIntegerPart(long);
    method public android.text.style.TtsSpan.FractionBuilder setIntegerPart(java.lang.String);
    method public android.text.style.TtsSpan.FractionBuilder setNumerator(long);
    method public android.text.style.TtsSpan.FractionBuilder setNumerator(java.lang.String);
  }

  public static class TtsSpan.MeasureBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
    ctor public TtsSpan.MeasureBuilder();
    method public android.text.style.TtsSpan.MeasureBuilder setDenominator(long);
    method public android.text.style.TtsSpan.MeasureBuilder setDenominator(java.lang.String);
    method public android.text.style.TtsSpan.MeasureBuilder setFractionalPart(java.lang.String);
    method public android.text.style.TtsSpan.MeasureBuilder setIntegerPart(long);
    method public android.text.style.TtsSpan.MeasureBuilder setIntegerPart(java.lang.String);
    method public android.text.style.TtsSpan.MeasureBuilder setNumber(long);
    method public android.text.style.TtsSpan.MeasureBuilder setNumber(java.lang.String);
    method public android.text.style.TtsSpan.MeasureBuilder setNumerator(long);
    method public android.text.style.TtsSpan.MeasureBuilder setNumerator(java.lang.String);
    method public android.text.style.TtsSpan.MeasureBuilder setUnit(java.lang.String);
  }

  public static class TtsSpan.MoneyBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
    ctor public TtsSpan.MoneyBuilder();
    method public android.text.style.TtsSpan.MoneyBuilder setCurrency(java.lang.String);
    method public android.text.style.TtsSpan.MoneyBuilder setFractionalPart(java.lang.String);
    method public android.text.style.TtsSpan.MoneyBuilder setIntegerPart(long);
    method public android.text.style.TtsSpan.MoneyBuilder setIntegerPart(java.lang.String);
    method public android.text.style.TtsSpan.MoneyBuilder setQuantity(java.lang.String);
  }

  public static class TtsSpan.OrdinalBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
    ctor public TtsSpan.OrdinalBuilder();
    ctor public TtsSpan.OrdinalBuilder(long);
    ctor public TtsSpan.OrdinalBuilder(java.lang.String);
    method public android.text.style.TtsSpan.OrdinalBuilder setNumber(long);
    method public android.text.style.TtsSpan.OrdinalBuilder setNumber(java.lang.String);
  }

  public static class TtsSpan.SemioticClassBuilder<C extends android.text.style.TtsSpan.SemioticClassBuilder<?>> extends android.text.style.TtsSpan.Builder {
    ctor public TtsSpan.SemioticClassBuilder(java.lang.String);
    method public C setAnimacy(java.lang.String);
    method public C setCase(java.lang.String);
    method public C setGender(java.lang.String);
    method public C setMultiplicity(java.lang.String);
  }

  public static class TtsSpan.TelephoneBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
    ctor public TtsSpan.TelephoneBuilder();
    ctor public TtsSpan.TelephoneBuilder(java.lang.String);
    method public android.text.style.TtsSpan.TelephoneBuilder setCountryCode(java.lang.String);
    method public android.text.style.TtsSpan.TelephoneBuilder setExtension(java.lang.String);
    method public android.text.style.TtsSpan.TelephoneBuilder setNumberParts(java.lang.String);
  }

  public static class TtsSpan.TextBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
    ctor public TtsSpan.TextBuilder();
    ctor public TtsSpan.TextBuilder(java.lang.String);
    method public android.text.style.TtsSpan.TextBuilder setText(java.lang.String);
  }

  public static class TtsSpan.TimeBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
    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 {
    ctor public TtsSpan.VerbatimBuilder();
    ctor public TtsSpan.VerbatimBuilder(java.lang.String);
    method public android.text.style.TtsSpan.VerbatimBuilder setVerbatim(java.lang.String);
  }

  public class TypefaceSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
    ctor public TypefaceSpan(java.lang.String);
    ctor public TypefaceSpan(android.graphics.Typeface);
    ctor public TypefaceSpan(android.os.Parcel);
    method public int describeContents();
    method public java.lang.String getFamily();
    method public int getSpanTypeId();
    method public android.graphics.Typeface getTypeface();
    method public void updateDrawState(android.text.TextPaint);
    method public void updateMeasureState(android.text.TextPaint);
    method public void writeToParcel(android.os.Parcel, int);
  }

  public class URLSpan extends android.text.style.ClickableSpan implements android.text.ParcelableSpan {
    ctor public URLSpan(java.lang.String);
    ctor public URLSpan(android.os.Parcel);
    method public int describeContents();
    method public int getSpanTypeId();
    method public java.lang.String getURL();
    method public void onClick(android.view.View);
    method public void writeToParcel(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(android.os.Parcel);
    method public int describeContents();
    method public int getSpanTypeId();
    method public void updateDrawState(android.text.TextPaint);
    method public void writeToParcel(android.os.Parcel, int);
  }

  public abstract interface UpdateAppearance {
  }

  public abstract interface UpdateLayout implements android.text.style.UpdateAppearance {
  }

  public abstract interface WrapTogetherSpan implements android.text.style.ParagraphStyle {
  }

}

package android.text.util {

  public class Linkify {
    ctor public Linkify();
    method public static final boolean addLinks(android.text.Spannable, int);
    method public static final boolean addLinks(android.widget.TextView, int);
    method public static final void addLinks(android.widget.TextView, java.util.regex.Pattern, java.lang.String);
    method public static final void addLinks(android.widget.TextView, java.util.regex.Pattern, java.lang.String, android.text.util.Linkify.MatchFilter, android.text.util.Linkify.TransformFilter);
    method public static final void addLinks(android.widget.TextView, java.util.regex.Pattern, java.lang.String, java.lang.String[], android.text.util.Linkify.MatchFilter, android.text.util.Linkify.TransformFilter);
    method public static final boolean addLinks(android.text.Spannable, java.util.regex.Pattern, java.lang.String);
    method public static final boolean addLinks(android.text.Spannable, java.util.regex.Pattern, java.lang.String, android.text.util.Linkify.MatchFilter, android.text.util.Linkify.TransformFilter);
    method public static final boolean addLinks(android.text.Spannable, java.util.regex.Pattern, java.lang.String, java.lang.String[], android.text.util.Linkify.MatchFilter, android.text.util.Linkify.TransformFilter);
    field public static final int ALL = 15; // 0xf
    field public static final int EMAIL_ADDRESSES = 2; // 0x2
    field public static final deprecated 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 abstract interface Linkify.MatchFilter {
    method public abstract boolean acceptMatch(java.lang.CharSequence, int, int);
  }

  public static abstract interface Linkify.TransformFilter {
    method public abstract java.lang.String transformUrl(java.util.regex.Matcher, java.lang.String);
  }

  public class Rfc822Token {
    ctor public Rfc822Token(java.lang.String, java.lang.String, java.lang.String);
    method public java.lang.String getAddress();
    method public java.lang.String getComment();
    method public java.lang.String getName();
    method public static java.lang.String quoteComment(java.lang.String);
    method public static java.lang.String quoteName(java.lang.String);
    method public static java.lang.String quoteNameIfNecessary(java.lang.String);
    method public void setAddress(java.lang.String);
    method public void setComment(java.lang.String);
    method public void setName(java.lang.String);
  }

  public class Rfc822Tokenizer implements android.widget.MultiAutoCompleteTextView.Tokenizer {
    ctor public Rfc822Tokenizer();
    method public int findTokenEnd(java.lang.CharSequence, int);
    method public int findTokenStart(java.lang.CharSequence, int);
    method public java.lang.CharSequence terminateToken(java.lang.CharSequence);
    method public static void tokenize(java.lang.CharSequence, java.util.Collection<android.text.util.Rfc822Token>);
    method public static android.text.util.Rfc822Token[] tokenize(java.lang.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 public deprecated 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 public deprecated 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(java.lang.Runnable);
    method public void setExitAction(java.lang.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(java.lang.String);
    method public android.transition.Transition addTarget(java.lang.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(java.lang.Class, boolean);
    method public android.transition.Transition excludeTarget(int, boolean);
    method public android.transition.Transition excludeTarget(java.lang.String, boolean);
    method public android.transition.Transition excludeTarget(android.view.View, boolean);
    method public android.transition.Transition excludeTarget(java.lang.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 java.lang.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 java.lang.String[] getTransitionProperties();
    method public android.transition.TransitionValues getTransitionValues(android.view.View, boolean);
    method public boolean isTransitionRequired(android.transition.TransitionValues, 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(java.lang.String);
    method public android.transition.Transition removeTarget(android.view.View);
    method public android.transition.Transition removeTarget(java.lang.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 static abstract class Transition.EpicenterCallback {
    ctor public Transition.EpicenterCallback();
    method public abstract android.graphics.Rect onGetEpicenter(android.transition.Transition);
  }

  public static abstract interface Transition.TransitionListener {
    method public abstract void onTransitionCancel(android.transition.Transition);
    method public abstract void onTransitionEnd(android.transition.Transition);
    method public abstract void onTransitionPause(android.transition.Transition);
    method public abstract void onTransitionResume(android.transition.Transition);
    method public abstract void onTransitionStart(android.transition.Transition);
  }

  public class TransitionInflater {
    method public static android.transition.TransitionInflater from(android.content.Context);
    method public android.transition.Transition inflateTransition(int);
    method public android.transition.TransitionManager inflateTransitionManager(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 java.lang.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(java.lang.String);
    method public android.transition.TransitionSet addTarget(java.lang.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(java.lang.Class);
    method public android.transition.TransitionSet removeTarget(java.lang.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 java.lang.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(java.lang.String);
    ctor public AndroidException(java.lang.String, java.lang.Throwable);
    ctor public AndroidException(java.lang.Exception);
  }

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

  public final class ArrayMap<K, V> implements java.util.Map {
    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(java.lang.Object);
    method public boolean containsValue(java.lang.Object);
    method public void ensureCapacity(int);
    method public java.util.Set<java.util.Map.Entry<K, V>> entrySet();
    method public V get(java.lang.Object);
    method public int indexOfKey(java.lang.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(java.lang.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 java.util.Set {
    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(java.lang.Object);
    method public boolean containsAll(java.util.Collection<?>);
    method public void ensureCapacity(int);
    method public int indexOf(java.lang.Object);
    method public boolean isEmpty();
    method public java.util.Iterator<E> iterator();
    method public boolean remove(java.lang.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 java.lang.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 abstract interface AttributeSet {
    method public abstract boolean getAttributeBooleanValue(java.lang.String, java.lang.String, boolean);
    method public abstract boolean getAttributeBooleanValue(int, boolean);
    method public abstract int getAttributeCount();
    method public abstract float getAttributeFloatValue(java.lang.String, java.lang.String, float);
    method public abstract float getAttributeFloatValue(int, float);
    method public abstract int getAttributeIntValue(java.lang.String, java.lang.String, int);
    method public abstract int getAttributeIntValue(int, int);
    method public abstract int getAttributeListValue(java.lang.String, java.lang.String, java.lang.String[], int);
    method public abstract int getAttributeListValue(int, java.lang.String[], int);
    method public abstract java.lang.String getAttributeName(int);
    method public abstract int getAttributeNameResource(int);
    method public default java.lang.String getAttributeNamespace(int);
    method public abstract int getAttributeResourceValue(java.lang.String, java.lang.String, int);
    method public abstract int getAttributeResourceValue(int, int);
    method public abstract int getAttributeUnsignedIntValue(java.lang.String, java.lang.String, int);
    method public abstract int getAttributeUnsignedIntValue(int, int);
    method public abstract java.lang.String getAttributeValue(int);
    method public abstract java.lang.String getAttributeValue(java.lang.String, java.lang.String);
    method public abstract java.lang.String getClassAttribute();
    method public abstract java.lang.String getIdAttribute();
    method public abstract int getIdAttributeResourceValue(int);
    method public abstract java.lang.String getPositionDescription();
    method public abstract int getStyleAttribute();
  }

  public class Base64 {
    method public static byte[] decode(java.lang.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 java.lang.String encodeToString(byte[], int);
    method public static java.lang.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(java.lang.String);
  }

  public class Base64InputStream extends java.io.FilterInputStream {
    ctor public Base64InputStream(java.io.InputStream, int);
    method public int available();
    method public void mark(int);
    method public void reset();
  }

  public class Base64OutputStream extends java.io.FilterOutputStream {
    ctor public Base64OutputStream(java.io.OutputStream, int);
  }

  public final deprecated class Config {
    field public static final deprecated boolean DEBUG = false;
    field public static final deprecated boolean LOGD = true;
    field public static final deprecated boolean LOGV = false;
    field public static final deprecated boolean PROFILE = false;
    field public static final deprecated boolean RELEASE = true;
  }

  public class DebugUtils {
    method public static boolean isObjectSelected(java.lang.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(java.lang.String);
    method public static java.lang.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, java.lang.String);
    method public static int writeEvent(int, java.lang.Object...);
  }

  public static final class EventLog.Event {
    method public synchronized java.lang.Object getData();
    method public int getProcessId();
    method public int getTag();
    method public int getThreadId();
    method public long getTimeNanos();
  }

  public deprecated class EventLogTags {
    ctor public EventLogTags() throws java.io.IOException;
    ctor public EventLogTags(java.io.BufferedReader) throws java.io.IOException;
    method public android.util.EventLogTags.Description get(java.lang.String);
    method public android.util.EventLogTags.Description get(int);
  }

  public static class EventLogTags.Description {
    field public final java.lang.String mName;
    field public final int mTag;
  }

  public deprecated class FloatMath {
  }

  public abstract class FloatProperty<T> extends android.util.Property {
    ctor public FloatProperty(java.lang.String);
    method public final void set(T, java.lang.Float);
    method public abstract void setValue(T, float);
  }

  public final class Half extends java.lang.Number implements java.lang.Comparable {
    ctor public Half(short);
    ctor public Half(float);
    ctor public Half(double);
    ctor public Half(java.lang.String) throws java.lang.NumberFormatException;
    method public static short abs(short);
    method public static short ceil(short);
    method public static int compare(short, short);
    method public int compareTo(android.util.Half);
    method public static short copySign(short, short);
    method public double doubleValue();
    method public static boolean equals(short, short);
    method public float floatValue();
    method public static short floor(short);
    method public static int getExponent(short);
    method public static int getSign(short);
    method public static int getSignificand(short);
    method public static boolean greater(short, short);
    method public static boolean greaterEquals(short, short);
    method public static int halfToIntBits(short);
    method public static int halfToRawIntBits(short);
    method public static short halfToShortBits(short);
    method public short halfValue();
    method public static int hashCode(short);
    method public static short intBitsToHalf(int);
    method public int intValue();
    method public static boolean isInfinite(short);
    method public boolean isNaN();
    method public static boolean isNaN(short);
    method public static boolean isNormalized(short);
    method public static boolean less(short, short);
    method public static boolean lessEquals(short, short);
    method public long longValue();
    method public static short max(short, short);
    method public static short min(short, short);
    method public static short parseHalf(java.lang.String) throws java.lang.NumberFormatException;
    method public static short round(short);
    method public static float toFloat(short);
    method public static short toHalf(float);
    method public static java.lang.String toHexString(short);
    method public static java.lang.String toString(short);
    method public static short trunc(short);
    method public static android.util.Half valueOf(short);
    method public static android.util.Half valueOf(float);
    method public static android.util.Half valueOf(java.lang.String);
    field public static final short EPSILON = 5120; // 0x1400
    field public static final short LOWEST_VALUE = -1025; // 0xfffffbff
    field public static final int MAX_EXPONENT = 15; // 0xf
    field public static final short MAX_VALUE = 31743; // 0x7bff
    field public static final int MIN_EXPONENT = -14; // 0xfffffff2
    field public static final short MIN_NORMAL = 1024; // 0x400
    field public static final short MIN_VALUE = 1; // 0x1
    field public static final short NEGATIVE_INFINITY = -1024; // 0xfffffc00
    field public static final short NEGATIVE_ZERO = -32768; // 0xffff8000
    field public static final short NaN = 32256; // 0x7e00
    field public static final short POSITIVE_INFINITY = 31744; // 0x7c00
    field 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 {
    ctor public IntProperty(java.lang.String);
    method public final void set(T, java.lang.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 java.lang.String nextName() throws java.io.IOException;
    method public void nextNull() throws java.io.IOException;
    method public java.lang.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 final class JsonToken extends java.lang.Enum {
    method public static android.util.JsonToken valueOf(java.lang.String);
    method public static final android.util.JsonToken[] values();
    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(java.lang.String) throws java.io.IOException;
    method public android.util.JsonWriter nullValue() throws java.io.IOException;
    method public void setIndent(java.lang.String);
    method public void setLenient(boolean);
    method public android.util.JsonWriter value(java.lang.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(java.lang.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(java.lang.String, java.lang.String);
    method public static int d(java.lang.String, java.lang.String, java.lang.Throwable);
    method public static int e(java.lang.String, java.lang.String);
    method public static int e(java.lang.String, java.lang.String, java.lang.Throwable);
    method public static java.lang.String getStackTraceString(java.lang.Throwable);
    method public static int i(java.lang.String, java.lang.String);
    method public static int i(java.lang.String, java.lang.String, java.lang.Throwable);
    method public static boolean isLoggable(java.lang.String, int);
    method public static int println(int, java.lang.String, java.lang.String);
    method public static int v(java.lang.String, java.lang.String);
    method public static int v(java.lang.String, java.lang.String, java.lang.Throwable);
    method public static int w(java.lang.String, java.lang.String);
    method public static int w(java.lang.String, java.lang.String, java.lang.Throwable);
    method public static int w(java.lang.String, java.lang.Throwable);
    method public static int wtf(java.lang.String, java.lang.String);
    method public static int wtf(java.lang.String, java.lang.Throwable);
    method public static int wtf(java.lang.String, java.lang.String, java.lang.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, java.lang.String);
    method public void println(java.lang.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 synchronized int createCount();
    method protected void entryRemoved(boolean, K, V, V);
    method public final void evictAll();
    method public final synchronized int evictionCount();
    method public final V get(K);
    method public final synchronized int hitCount();
    method public final synchronized int maxSize();
    method public final synchronized int missCount();
    method public final V put(K, V);
    method public final synchronized int putCount();
    method public final V remove(K);
    method public void resize(int);
    method public final synchronized int size();
    method protected int sizeOf(K, V);
    method public final synchronized java.util.Map<K, V> snapshot();
    method public final synchronized java.lang.String toString();
    method public void trimToSize(int);
  }

  public final class MalformedJsonException extends java.io.IOException {
    ctor public MalformedJsonException(java.lang.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();
  }

  public final deprecated class MutableBoolean {
    ctor public MutableBoolean(boolean);
    field public boolean value;
  }

  public final deprecated class MutableByte {
    ctor public MutableByte(byte);
    field public byte value;
  }

  public final deprecated class MutableChar {
    ctor public MutableChar(char);
    field public char value;
  }

  public final deprecated class MutableDouble {
    ctor public MutableDouble(double);
    field public double value;
  }

  public final deprecated class MutableFloat {
    ctor public MutableFloat(float);
    field public float value;
  }

  public final deprecated class MutableInt {
    ctor public MutableInt(int);
    field public int value;
  }

  public final deprecated class MutableLong {
    ctor public MutableLong(long);
    field public long value;
  }

  public final deprecated class MutableShort {
    ctor public MutableShort(short);
    field public short value;
  }

  public class NoSuchPropertyException extends java.lang.RuntimeException {
    ctor public NoSuchPropertyException(java.lang.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 java.lang.String concatGroups(java.util.regex.Matcher);
    method public static final java.lang.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 public static final deprecated java.lang.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 public static final deprecated java.util.regex.Pattern TOP_LEVEL_DOMAIN;
    field public static final deprecated java.lang.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 public static final deprecated java.lang.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(java.lang.String);
  }

  public class PrintWriterPrinter implements android.util.Printer {
    ctor public PrintWriterPrinter(java.io.PrintWriter);
    method public void println(java.lang.String);
  }

  public abstract interface Printer {
    method public abstract void println(java.lang.String);
  }

  public abstract class Property<T, V> {
    ctor public Property(java.lang.Class<V>, java.lang.String);
    method public abstract V get(T);
    method public java.lang.String getName();
    method public java.lang.Class<V> getType();
    method public boolean isReadOnly();
    method public static <T, V> android.util.Property<T, V> of(java.lang.Class<T>, java.lang.Class<V>, java.lang.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 {
    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(java.lang.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(java.lang.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(java.lang.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 java.lang.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(java.lang.StringBuilder);
    method public void println(java.lang.String);
  }

  public class TimeFormatException extends java.lang.RuntimeException {
  }

  public class TimeUtils {
    method public static java.util.TimeZone getTimeZone(int, boolean, long, java.lang.String);
    method public static java.lang.String getTimeZoneDatabaseVersion();
  }

  public class TimingLogger {
    ctor public TimingLogger(java.lang.String, java.lang.String);
    method public void addSplit(java.lang.String);
    method public void dumpToLog();
    method public void reset(java.lang.String, java.lang.String);
    method public void reset();
  }

  public class TypedValue {
    ctor public TypedValue();
    method public static float applyDimension(int, float, android.util.DisplayMetrics);
    method public final java.lang.CharSequence coerceToString();
    method public static final java.lang.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 public int resourceId;
    field public java.lang.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(java.lang.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(java.lang.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 java.lang.String FEATURE_RELAXED;
  }

  public static final class Xml.Encoding extends java.lang.Enum {
    method public static android.util.Xml.Encoding valueOf(java.lang.String);
    method public static final android.util.Xml.Encoding[] values();
    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, java.lang.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 java.lang.CharSequence getSubtitle();
    method public java.lang.Object getTag();
    method public abstract java.lang.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(java.lang.CharSequence);
    method public abstract void setSubtitle(int);
    method public void setTag(java.lang.Object);
    method public abstract void setTitle(java.lang.CharSequence);
    method public abstract void setTitle(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 abstract interface ActionMode.Callback {
    method public abstract boolean onActionItemClicked(android.view.ActionMode, android.view.MenuItem);
    method public abstract boolean onCreateActionMode(android.view.ActionMode, android.view.Menu);
    method public abstract void onDestroyActionMode(android.view.ActionMode);
    method public abstract boolean onPrepareActionMode(android.view.ActionMode, android.view.Menu);
  }

  public static abstract 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 public abstract deprecated 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 abstract interface ActionProvider.VisibilityListener {
    method public abstract 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 abstract interface Choreographer.FrameCallback {
    method public abstract void doFrame(long);
  }

  public abstract interface CollapsibleActionView {
    method public abstract void onActionViewCollapsed();
    method public abstract void onActionViewExpanded();
  }

  public abstract interface ContextMenu implements android.view.Menu {
    method public abstract void clearHeader();
    method public abstract android.view.ContextMenu setHeaderIcon(int);
    method public abstract android.view.ContextMenu setHeaderIcon(android.graphics.drawable.Drawable);
    method public abstract android.view.ContextMenu setHeaderTitle(int);
    method public abstract android.view.ContextMenu setHeaderTitle(java.lang.CharSequence);
    method public abstract android.view.ContextMenu setHeaderView(android.view.View);
  }

  public static abstract interface ContextMenu.ContextMenuInfo {
  }

  public class ContextThemeWrapper extends android.content.ContextWrapper {
    ctor public ContextThemeWrapper();
    ctor public ContextThemeWrapper(android.content.Context, 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 public deprecated int getHeight();
    method public void getMetrics(android.util.DisplayMetrics);
    method public android.view.Display.Mode getMode();
    method public java.lang.String getName();
    method public deprecated int getOrientation();
    method public deprecated 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 public deprecated float[] getSupportedRefreshRates();
    method public deprecated 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 java.lang.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(android.view.View, 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 public deprecated GestureDetector(android.view.GestureDetector.OnGestureListener, android.os.Handler);
    ctor public deprecated 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 abstract interface GestureDetector.OnContextClickListener {
    method public abstract boolean onContextClick(android.view.MotionEvent);
  }

  public static abstract interface GestureDetector.OnDoubleTapListener {
    method public abstract boolean onDoubleTap(android.view.MotionEvent);
    method public abstract boolean onDoubleTapEvent(android.view.MotionEvent);
    method public abstract boolean onSingleTapConfirmed(android.view.MotionEvent);
  }

  public static abstract interface GestureDetector.OnGestureListener {
    method public abstract boolean onDown(android.view.MotionEvent);
    method public abstract boolean onFling(android.view.MotionEvent, android.view.MotionEvent, float, float);
    method public abstract void onLongPress(android.view.MotionEvent);
    method public abstract boolean onScroll(android.view.MotionEvent, android.view.MotionEvent, float, float);
    method public abstract void onShowPress(android.view.MotionEvent);
    method public abstract 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(java.lang.String, java.lang.Throwable);
    ctor public InflateException(java.lang.String);
    ctor public InflateException(java.lang.Throwable);
  }

  public final class InputDevice implements android.os.Parcelable {
    method public int describeContents();
    method public int getControllerNumber();
    method public java.lang.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 java.lang.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 public static final deprecated int MOTION_RANGE_ORIENTATION = 8; // 0x8
    field public static final deprecated int MOTION_RANGE_PRESSURE = 2; // 0x2
    field public static final deprecated int MOTION_RANGE_SIZE = 3; // 0x3
    field public static final deprecated int MOTION_RANGE_TOOL_MAJOR = 6; // 0x6
    field public static final deprecated int MOTION_RANGE_TOOL_MINOR = 7; // 0x7
    field public static final deprecated int MOTION_RANGE_TOUCH_MAJOR = 4; // 0x4
    field public static final deprecated int MOTION_RANGE_TOUCH_MINOR = 5; // 0x5
    field public static final deprecated int MOTION_RANGE_X = 0; // 0x0
    field public static final deprecated 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 abstract interface InputQueue.Callback {
    method public abstract void onInputQueueCreated(android.view.InputQueue);
    method public abstract 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 public deprecated 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 public static final deprecated 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
  }

  public static deprecated class KeyCharacterMap.KeyData {
    ctor public KeyCharacterMap.KeyData();
    field public static final int META_LENGTH = 4; // 0x4
    field public char displayLabel;
    field public char[] meta;
    field public char number;
  }

  public static class KeyCharacterMap.UnavailableException extends android.util.AndroidRuntimeException {
    ctor public KeyCharacterMap.UnavailableException(java.lang.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, java.lang.String, int, int);
    ctor public KeyEvent(android.view.KeyEvent);
    ctor public deprecated 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 public final deprecated boolean dispatch(android.view.KeyEvent.Callback);
    method public final boolean dispatch(android.view.KeyEvent.Callback, android.view.KeyEvent.DispatcherState, java.lang.Object);
    method public final int getAction();
    method public final java.lang.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 public deprecated 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(java.lang.String);
    method public static java.lang.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 public static final deprecated 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 public static final deprecated 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 abstract interface KeyEvent.Callback {
    method public abstract boolean onKeyDown(int, android.view.KeyEvent);
    method public abstract boolean onKeyLongPress(int, android.view.KeyEvent);
    method public abstract boolean onKeyMultiple(int, int, android.view.KeyEvent);
    method public abstract 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(java.lang.Object);
    method public void startTracking(android.view.KeyEvent, java.lang.Object);
  }

  public final class KeyboardShortcutGroup implements android.os.Parcelable {
    ctor public KeyboardShortcutGroup(java.lang.CharSequence, java.util.List<android.view.KeyboardShortcutInfo>);
    ctor public KeyboardShortcutGroup(java.lang.CharSequence);
    method public void addItem(android.view.KeyboardShortcutInfo);
    method public int describeContents();
    method public java.util.List<android.view.KeyboardShortcutInfo> getItems();
    method public java.lang.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(java.lang.CharSequence, int, int);
    ctor public KeyboardShortcutInfo(java.lang.CharSequence, char, int);
    method public int describeContents();
    method public char getBaseCharacter();
    method public int getKeycode();
    method public java.lang.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(java.lang.String, java.lang.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(int, android.view.ViewGroup);
    method public android.view.View inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup);
    method public android.view.View inflate(int, android.view.ViewGroup, boolean);
    method public android.view.View inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean);
    method protected android.view.View onCreateView(java.lang.String, android.util.AttributeSet) throws java.lang.ClassNotFoundException;
    method protected android.view.View onCreateView(android.view.View, java.lang.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 abstract interface LayoutInflater.Factory {
    method public abstract android.view.View onCreateView(java.lang.String, android.content.Context, android.util.AttributeSet);
  }

  public static abstract interface LayoutInflater.Factory2 implements android.view.LayoutInflater.Factory {
    method public abstract android.view.View onCreateView(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet);
  }

  public static abstract interface LayoutInflater.Filter {
    method public abstract boolean onLoadClass(java.lang.Class);
  }

  public abstract interface Menu {
    method public abstract android.view.MenuItem add(java.lang.CharSequence);
    method public abstract android.view.MenuItem add(int);
    method public abstract android.view.MenuItem add(int, int, int, java.lang.CharSequence);
    method public abstract android.view.MenuItem add(int, int, int, int);
    method public abstract int addIntentOptions(int, int, int, android.content.ComponentName, android.content.Intent[], android.content.Intent, int, android.view.MenuItem[]);
    method public abstract android.view.SubMenu addSubMenu(java.lang.CharSequence);
    method public abstract android.view.SubMenu addSubMenu(int);
    method public abstract android.view.SubMenu addSubMenu(int, int, int, java.lang.CharSequence);
    method public abstract android.view.SubMenu addSubMenu(int, int, int, int);
    method public abstract void clear();
    method public abstract void close();
    method public abstract android.view.MenuItem findItem(int);
    method public abstract android.view.MenuItem getItem(int);
    method public abstract boolean hasVisibleItems();
    method public abstract boolean isShortcutKey(int, android.view.KeyEvent);
    method public abstract boolean performIdentifierAction(int, int);
    method public abstract boolean performShortcut(int, android.view.KeyEvent, int);
    method public abstract void removeGroup(int);
    method public abstract void removeItem(int);
    method public abstract void setGroupCheckable(int, boolean, boolean);
    method public default void setGroupDividerEnabled(boolean);
    method public abstract void setGroupEnabled(int, boolean);
    method public abstract void setGroupVisible(int, boolean);
    method public abstract void setQwertyMode(boolean);
    method public abstract 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(int, android.view.Menu);
  }

  public abstract interface MenuItem {
    method public abstract boolean collapseActionView();
    method public abstract boolean expandActionView();
    method public abstract android.view.ActionProvider getActionProvider();
    method public abstract android.view.View getActionView();
    method public default int getAlphabeticModifiers();
    method public abstract char getAlphabeticShortcut();
    method public default java.lang.CharSequence getContentDescription();
    method public abstract int getGroupId();
    method public abstract android.graphics.drawable.Drawable getIcon();
    method public default android.content.res.ColorStateList getIconTintList();
    method public default android.graphics.PorterDuff.Mode getIconTintMode();
    method public abstract android.content.Intent getIntent();
    method public abstract int getItemId();
    method public abstract android.view.ContextMenu.ContextMenuInfo getMenuInfo();
    method public default int getNumericModifiers();
    method public abstract char getNumericShortcut();
    method public abstract int getOrder();
    method public abstract android.view.SubMenu getSubMenu();
    method public abstract java.lang.CharSequence getTitle();
    method public abstract java.lang.CharSequence getTitleCondensed();
    method public default java.lang.CharSequence getTooltipText();
    method public abstract boolean hasSubMenu();
    method public abstract boolean isActionViewExpanded();
    method public abstract boolean isCheckable();
    method public abstract boolean isChecked();
    method public abstract boolean isEnabled();
    method public abstract boolean isVisible();
    method public abstract android.view.MenuItem setActionProvider(android.view.ActionProvider);
    method public abstract android.view.MenuItem setActionView(android.view.View);
    method public abstract android.view.MenuItem setActionView(int);
    method public abstract android.view.MenuItem setAlphabeticShortcut(char);
    method public default android.view.MenuItem setAlphabeticShortcut(char, int);
    method public abstract android.view.MenuItem setCheckable(boolean);
    method public abstract android.view.MenuItem setChecked(boolean);
    method public default android.view.MenuItem setContentDescription(java.lang.CharSequence);
    method public abstract android.view.MenuItem setEnabled(boolean);
    method public abstract android.view.MenuItem setIcon(android.graphics.drawable.Drawable);
    method public abstract android.view.MenuItem setIcon(int);
    method public default android.view.MenuItem setIconTintList(android.content.res.ColorStateList);
    method public default android.view.MenuItem setIconTintMode(android.graphics.PorterDuff.Mode);
    method public abstract android.view.MenuItem setIntent(android.content.Intent);
    method public abstract android.view.MenuItem setNumericShortcut(char);
    method public default android.view.MenuItem setNumericShortcut(char, int);
    method public abstract android.view.MenuItem setOnActionExpandListener(android.view.MenuItem.OnActionExpandListener);
    method public abstract android.view.MenuItem setOnMenuItemClickListener(android.view.MenuItem.OnMenuItemClickListener);
    method public abstract android.view.MenuItem setShortcut(char, char);
    method public default android.view.MenuItem setShortcut(char, char, int, int);
    method public abstract void setShowAsAction(int);
    method public abstract android.view.MenuItem setShowAsActionFlags(int);
    method public abstract android.view.MenuItem setTitle(java.lang.CharSequence);
    method public abstract android.view.MenuItem setTitle(int);
    method public abstract android.view.MenuItem setTitleCondensed(java.lang.CharSequence);
    method public default android.view.MenuItem setTooltipText(java.lang.CharSequence);
    method public abstract 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 abstract interface MenuItem.OnActionExpandListener {
    method public abstract boolean onMenuItemActionCollapse(android.view.MenuItem);
    method public abstract boolean onMenuItemActionExpand(android.view.MenuItem);
  }

  public static abstract interface MenuItem.OnMenuItemClickListener {
    method public abstract boolean onMenuItemClick(android.view.MenuItem);
  }

  public final class MotionEvent extends android.view.InputEvent implements android.os.Parcelable {
    method public static java.lang.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(java.lang.String);
    method public static java.lang.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 public static deprecated 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 public static deprecated 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 public static final deprecated int ACTION_POINTER_1_DOWN = 5; // 0x5
    field public static final deprecated int ACTION_POINTER_1_UP = 6; // 0x6
    field public static final deprecated int ACTION_POINTER_2_DOWN = 261; // 0x105
    field public static final deprecated int ACTION_POINTER_2_UP = 262; // 0x106
    field public static final deprecated int ACTION_POINTER_3_DOWN = 517; // 0x205
    field public static final deprecated int ACTION_POINTER_3_UP = 518; // 0x206
    field public static final int ACTION_POINTER_DOWN = 5; // 0x5
    field public static final deprecated int ACTION_POINTER_ID_MASK = 65280; // 0xff00
    field public static final deprecated 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
  }

  public abstract deprecated class OrientationListener implements android.hardware.SensorListener {
    ctor public OrientationListener(android.content.Context);
    ctor public OrientationListener(android.content.Context, int);
    method public void disable();
    method public void enable();
    method public void onAccuracyChanged(int, int);
    method public abstract void onOrientationChanged(int);
    method public void onSensorChanged(int, float[]);
    field public static final int ORIENTATION_UNKNOWN = -1; // 0xffffffff
  }

  public final class PixelCopy {
    method public static void request(android.view.SurfaceView, android.graphics.Bitmap, android.view.PixelCopy.OnPixelCopyFinishedListener, android.os.Handler);
    method public static void request(android.view.SurfaceView, android.graphics.Rect, android.graphics.Bitmap, android.view.PixelCopy.OnPixelCopyFinishedListener, android.os.Handler);
    method public static void request(android.view.Surface, android.graphics.Bitmap, android.view.PixelCopy.OnPixelCopyFinishedListener, android.os.Handler);
    method public static void request(android.view.Surface, android.graphics.Rect, android.graphics.Bitmap, android.view.PixelCopy.OnPixelCopyFinishedListener, android.os.Handler);
    method public static void request(android.view.Window, android.graphics.Bitmap, android.view.PixelCopy.OnPixelCopyFinishedListener, android.os.Handler);
    method public static void request(android.view.Window, android.graphics.Rect, android.graphics.Bitmap, android.view.PixelCopy.OnPixelCopyFinishedListener, 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 abstract interface PixelCopy.OnPixelCopyFinishedListener {
    method public abstract void onPixelCopyFinished(int);
  }

  public final class PointerIcon implements android.os.Parcelable {
    method public static android.view.PointerIcon create(android.graphics.Bitmap, float, float);
    method public int describeContents();
    method public static android.view.PointerIcon getSystemIcon(android.content.Context, int);
    method public static android.view.PointerIcon load(android.content.res.Resources, 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 abstract interface ScaleGestureDetector.OnScaleGestureListener {
    method public abstract boolean onScale(android.view.ScaleGestureDetector);
    method public abstract boolean onScaleBegin(android.view.ScaleGestureDetector);
    method public abstract 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 abstract interface SubMenu implements android.view.Menu {
    method public abstract void clearHeader();
    method public abstract android.view.MenuItem getItem();
    method public abstract android.view.SubMenu setHeaderIcon(int);
    method public abstract android.view.SubMenu setHeaderIcon(android.graphics.drawable.Drawable);
    method public abstract android.view.SubMenu setHeaderTitle(int);
    method public abstract android.view.SubMenu setHeaderTitle(java.lang.CharSequence);
    method public abstract android.view.SubMenu setHeaderView(android.view.View);
    method public abstract android.view.SubMenu setIcon(int);
    method public abstract 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 public deprecated 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(java.lang.String);
  }

  public abstract interface SurfaceHolder {
    method public abstract void addCallback(android.view.SurfaceHolder.Callback);
    method public abstract android.view.Surface getSurface();
    method public abstract android.graphics.Rect getSurfaceFrame();
    method public abstract boolean isCreating();
    method public abstract android.graphics.Canvas lockCanvas();
    method public abstract android.graphics.Canvas lockCanvas(android.graphics.Rect);
    method public default android.graphics.Canvas lockHardwareCanvas();
    method public abstract void removeCallback(android.view.SurfaceHolder.Callback);
    method public abstract void setFixedSize(int, int);
    method public abstract void setFormat(int);
    method public abstract void setKeepScreenOn(boolean);
    method public abstract void setSizeFromLayout();
    method public abstract deprecated void setType(int);
    method public abstract void unlockCanvasAndPost(android.graphics.Canvas);
    field public static final deprecated int SURFACE_TYPE_GPU = 2; // 0x2
    field public static final deprecated int SURFACE_TYPE_HARDWARE = 1; // 0x1
    field public static final deprecated int SURFACE_TYPE_NORMAL = 0; // 0x0
    field public static final deprecated int SURFACE_TYPE_PUSH_BUFFERS = 3; // 0x3
  }

  public static class SurfaceHolder.BadSurfaceTypeException extends java.lang.RuntimeException {
    ctor public SurfaceHolder.BadSurfaceTypeException();
    ctor public SurfaceHolder.BadSurfaceTypeException(java.lang.String);
  }

  public static abstract interface SurfaceHolder.Callback {
    method public abstract void surfaceChanged(android.view.SurfaceHolder, int, int, int);
    method public abstract void surfaceCreated(android.view.SurfaceHolder);
    method public abstract void surfaceDestroyed(android.view.SurfaceHolder);
  }

  public static abstract interface SurfaceHolder.Callback2 implements android.view.SurfaceHolder.Callback {
    method public abstract void surfaceRedrawNeeded(android.view.SurfaceHolder);
    method public default void surfaceRedrawNeededAsync(android.view.SurfaceHolder, java.lang.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 abstract interface TextureView.SurfaceTextureListener {
    method public abstract void onSurfaceTextureAvailable(android.graphics.SurfaceTexture, int, int);
    method public abstract boolean onSurfaceTextureDestroyed(android.graphics.SurfaceTexture);
    method public abstract void onSurfaceTextureSizeChanged(android.graphics.SurfaceTexture, int, int);
    method public abstract 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();
  }

  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, android.util.AttributeSet);
    ctor public View(android.content.Context, android.util.AttributeSet, int);
    ctor public View(android.content.Context, android.util.AttributeSet, int, int);
    method public void addChildrenForAccessibility(java.util.ArrayList<android.view.View>);
    method public void addExtraDataToAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo, java.lang.String, 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(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(java.lang.CharSequence);
    method public void autofill(android.view.autofill.AutofillValue);
    method public void autofill(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 public deprecated void buildDrawingCache();
    method public deprecated 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 public deprecated 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 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, int[], int[]);
    method public boolean dispatchNestedScroll(int, int, int, int, int[]);
    method public void dispatchPointerCaptureChanged(boolean);
    method public boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public void dispatchProvideAutofillStructure(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 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(android.view.View, int);
    method public void dispatchWindowFocusChanged(boolean);
    method public void dispatchWindowSystemUiVisiblityChanged(int);
    method public void dispatchWindowVisibilityChanged(int);
    method public void draw(android.graphics.Canvas);
    method public void drawableHotspotChanged(float, float);
    method protected void drawableStateChanged();
    method public android.view.View findFocus();
    method public final <T extends android.view.View> T findViewById(int);
    method public final <T extends android.view.View> T findViewWithTag(java.lang.Object);
    method public void findViewsWithText(java.util.ArrayList<android.view.View>, java.lang.CharSequence, int);
    method protected deprecated 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 java.lang.CharSequence getAccessibilityClassName();
    method public int getAccessibilityLiveRegion();
    method public android.view.accessibility.AccessibilityNodeProvider getAccessibilityNodeProvider();
    method public java.lang.CharSequence getAccessibilityPaneTitle();
    method public int getAccessibilityTraversalAfter();
    method public int getAccessibilityTraversalBefore();
    method public float getAlpha();
    method public android.view.animation.Animation getAnimation();
    method public android.os.IBinder getApplicationWindowToken();
    method public java.lang.String[] getAutofillHints();
    method public final android.view.autofill.AutofillId getAutofillId();
    method public int getAutofillType();
    method public android.view.autofill.AutofillValue getAutofillValue();
    method public android.graphics.drawable.Drawable getBackground();
    method public android.content.res.ColorStateList getBackgroundTintList();
    method public android.graphics.PorterDuff.Mode getBackgroundTintMode();
    method public int getBaseline();
    method 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 public java.lang.CharSequence getContentDescription();
    method public final android.content.Context getContext();
    method protected android.view.ContextMenu.ContextMenuInfo getContextMenuInfo();
    method public final boolean getDefaultFocusHighlightEnabled();
    method public static int getDefaultSize(int, int);
    method public android.view.Display getDisplay();
    method public final int[] getDrawableState();
    method public deprecated android.graphics.Bitmap getDrawingCache();
    method public deprecated android.graphics.Bitmap getDrawingCache(boolean);
    method public deprecated int getDrawingCacheBackgroundColor();
    method public deprecated int getDrawingCacheQuality();
    method public void getDrawingRect(android.graphics.Rect);
    method public long getDrawingTime();
    method public float getElevation();
    method public boolean getFilterTouchesWhenObscured();
    method public boolean getFitsSystemWindows();
    method 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 public android.content.res.ColorStateList getForegroundTintList();
    method 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 public final int getHeight();
    method public void getHitRect(android.graphics.Rect);
    method public int getHorizontalFadingEdgeLength();
    method protected int getHorizontalScrollbarHeight();
    method public int getId();
    method public int getImportantForAccessibility();
    method public int getImportantForAutofill();
    method public boolean getKeepScreenOn();
    method public android.view.KeyEvent.DispatcherState getKeyDispatcherState();
    method public int getLabelFor();
    method public int getLayerType();
    method public int getLayoutDirection();
    method public android.view.ViewGroup.LayoutParams getLayoutParams();
    method public final int getLeft();
    method protected float getLeftFadingEdgeStrength();
    method protected int getLeftPaddingOffset();
    method public final boolean getLocalVisibleRect(android.graphics.Rect);
    method public void getLocationInWindow(int[]);
    method public void getLocationOnScreen(int[]);
    method public android.graphics.Matrix getMatrix();
    method public final int getMeasuredHeight();
    method public final int getMeasuredHeightAndState();
    method public final int getMeasuredState();
    method public final int getMeasuredWidth();
    method 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 public int getOutlineAmbientShadowColor();
    method public android.view.ViewOutlineProvider getOutlineProvider();
    method 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 public float getPivotX();
    method public float getPivotY();
    method public android.view.PointerIcon getPointerIcon();
    method public android.content.res.Resources getResources();
    method public final boolean getRevealOnFocusHint();
    method 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 public float getRotation();
    method public float getRotationX();
    method public float getRotationY();
    method public float getScaleX();
    method public float getScaleY();
    method public int getScrollBarDefaultDelayBeforeFade();
    method public int getScrollBarFadeDuration();
    method public int getScrollBarSize();
    method public int getScrollBarStyle();
    method public int getScrollIndicators();
    method public final int getScrollX();
    method public final int getScrollY();
    method public int getSolidColor();
    method public android.animation.StateListAnimator getStateListAnimator();
    method protected int getSuggestedMinimumHeight();
    method protected int getSuggestedMinimumWidth();
    method public int getSystemUiVisibility();
    method public java.lang.Object getTag();
    method public java.lang.Object getTag(int);
    method public int getTextAlignment();
    method public int getTextDirection();
    method public java.lang.CharSequence getTooltipText();
    method 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 public java.lang.String getTransitionName();
    method public float getTranslationX();
    method public float getTranslationY();
    method public float getTranslationZ();
    method public int getVerticalFadingEdgeLength();
    method public int getVerticalScrollbarPosition();
    method public int getVerticalScrollbarWidth();
    method public android.view.ViewTreeObserver getViewTreeObserver();
    method public int getVisibility();
    method 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 public float getX();
    method public float getY();
    method public float getZ();
    method public boolean hasExplicitFocusable();
    method public boolean hasFocus();
    method public boolean hasFocusable();
    method public boolean hasNestedScrollingParent();
    method public boolean hasOnClickListeners();
    method public boolean hasOverlappingRendering();
    method public boolean hasPointerCapture();
    method public boolean hasTransientState();
    method public boolean hasWindowFocus();
    method public static android.view.View inflate(android.content.Context, int, android.view.ViewGroup);
    method public deprecated void invalidate(android.graphics.Rect);
    method public deprecated void invalidate(int, int, int, int);
    method public void invalidate();
    method public void invalidateDrawable(android.graphics.drawable.Drawable);
    method public void invalidateOutline();
    method public boolean isAccessibilityFocused();
    method public boolean isAccessibilityHeading();
    method public boolean isActivated();
    method public boolean isAttachedToWindow();
    method public boolean isClickable();
    method public boolean isContextClickable();
    method public boolean isDirty();
    method public deprecated boolean isDrawingCacheEnabled();
    method public boolean isDuplicateParentStateEnabled();
    method public boolean isEnabled();
    method public final boolean isFocusable();
    method public final boolean isFocusableInTouchMode();
    method public boolean isFocused();
    method public final boolean isFocusedByDefault();
    method public boolean isHapticFeedbackEnabled();
    method public boolean isHardwareAccelerated();
    method public boolean isHorizontalFadingEdgeEnabled();
    method public boolean isHorizontalScrollBarEnabled();
    method public boolean isHovered();
    method public boolean isImportantForAccessibility();
    method public final boolean isImportantForAutofill();
    method public boolean isInEditMode();
    method public boolean isInLayout();
    method public boolean isInTouchMode();
    method 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 public boolean isOpaque();
    method protected boolean isPaddingOffsetRequired();
    method public boolean isPaddingRelative();
    method public boolean isPivotSet();
    method public boolean isPressed();
    method public boolean isSaveEnabled();
    method public boolean isSaveFromParentEnabled();
    method public boolean isScreenReaderFocusable();
    method public boolean isScrollContainer();
    method public boolean isScrollbarFadingEnabled();
    method public boolean isSelected();
    method public boolean isShown();
    method 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 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 protected void onAnimationEnd();
    method protected void onAnimationStart();
    method public android.view.WindowInsets onApplyWindowInsets(android.view.WindowInsets);
    method 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 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 protected void onFinishInflate();
    method public void onFinishTemporaryDetach();
    method protected void onFocusChanged(boolean, int, android.graphics.Rect);
    method public boolean onGenericMotionEvent(android.view.MotionEvent);
    method public void onHoverChanged(boolean);
    method public boolean onHoverEvent(android.view.MotionEvent);
    method public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public void onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo);
    method public boolean onKeyDown(int, android.view.KeyEvent);
    method public boolean 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 public void onPointerCaptureChange(boolean);
    method 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 protected void onRestoreInstanceState(android.os.Parcelable);
    method public void onRtlPropertiesChanged(int);
    method 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 public void onVisibilityAggregated(boolean);
    method protected void onVisibilityChanged(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(java.lang.Runnable);
    method public boolean postDelayed(java.lang.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(java.lang.Runnable);
    method public void postOnAnimationDelayed(java.lang.Runnable, long);
    method public void refreshDrawableState();
    method public void releasePointerCapture();
    method public boolean removeCallbacks(java.lang.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 public deprecated 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 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 public final <T extends android.view.View> T requireViewById(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(android.graphics.drawable.Drawable, java.lang.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(android.view.View.AccessibilityDelegate);
    method public void setAccessibilityHeading(boolean);
    method public void setAccessibilityLiveRegion(int);
    method public void setAccessibilityPaneTitle(java.lang.CharSequence);
    method public void setAccessibilityTraversalAfter(int);
    method public void setAccessibilityTraversalBefore(int);
    method public void setActivated(boolean);
    method public void setAlpha(float);
    method public void setAnimation(android.view.animation.Animation);
    method public void setAutofillHints(java.lang.String...);
    method public void setAutofillId(android.view.autofill.AutofillId);
    method public void setBackground(android.graphics.drawable.Drawable);
    method public void setBackgroundColor(int);
    method public deprecated void setBackgroundDrawable(android.graphics.drawable.Drawable);
    method public void setBackgroundResource(int);
    method public void setBackgroundTintList(android.content.res.ColorStateList);
    method public void setBackgroundTintMode(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(java.lang.CharSequence);
    method public void setContextClickable(boolean);
    method public void setDefaultFocusHighlightEnabled(boolean);
    method public deprecated void setDrawingCacheBackgroundColor(int);
    method public deprecated void setDrawingCacheEnabled(boolean);
    method public deprecated 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(android.content.res.ColorStateList);
    method public void setForegroundTintMode(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(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(int);
    method public void setLayerPaint(android.graphics.Paint);
    method public void setLayerType(int, 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(android.view.View.OnClickListener);
    method public void setOnContextClickListener(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(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(int);
    method public void setOutlineProvider(android.view.ViewOutlineProvider);
    method public void setOutlineSpotShadowColor(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(java.lang.Object);
    method public void setTag(int, java.lang.Object);
    method public void setTextAlignment(int);
    method public void setTextDirection(int);
    method public void setTooltipText(java.lang.CharSequence);
    method public final void setTop(int);
    method public void setTouchDelegate(android.view.TouchDelegate);
    method public final void setTransitionName(java.lang.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 public deprecated 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 public final deprecated boolean startDrag(android.content.ClipData, android.view.View.DragShadowBuilder, java.lang.Object, int);
    method public final boolean startDragAndDrop(android.content.ClipData, android.view.View.DragShadowBuilder, java.lang.Object, int);
    method public boolean startNestedScroll(int);
    method public void stopNestedScroll();
    method public void unscheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable);
    method public void unscheduleDrawable(android.graphics.drawable.Drawable);
    method public final void updateDragShadow(android.view.View.DragShadowBuilder);
    method protected boolean verifyDrawable(android.graphics.drawable.Drawable);
    method public deprecated boolean willNotCacheDrawing();
    method 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 java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = "creditCardExpirationDate";
    field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay";
    field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = "creditCardExpirationMonth";
    field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = "creditCardExpirationYear";
    field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_NUMBER = "creditCardNumber";
    field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = "creditCardSecurityCode";
    field public static final java.lang.String AUTOFILL_HINT_EMAIL_ADDRESS = "emailAddress";
    field public static final java.lang.String AUTOFILL_HINT_NAME = "name";
    field public static final java.lang.String AUTOFILL_HINT_PASSWORD = "password";
    field public static final java.lang.String AUTOFILL_HINT_PHONE = "phone";
    field public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS = "postalAddress";
    field public static final java.lang.String AUTOFILL_HINT_POSTAL_CODE = "postalCode";
    field public static final java.lang.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 public static final deprecated int DRAWING_CACHE_QUALITY_AUTO = 0; // 0x0
    field public static final deprecated int DRAWING_CACHE_QUALITY_HIGH = 1048576; // 0x100000
    field public static final deprecated 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 public static final deprecated int STATUS_BAR_HIDDEN = 1; // 0x1
    field public static final deprecated 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 java.lang.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(android.view.View, android.view.accessibility.AccessibilityNodeInfo, java.lang.String, 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, java.lang.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(int, int);
    method public static java.lang.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 abstract interface View.OnApplyWindowInsetsListener {
    method public abstract android.view.WindowInsets onApplyWindowInsets(android.view.View, android.view.WindowInsets);
  }

  public static abstract interface View.OnAttachStateChangeListener {
    method public abstract void onViewAttachedToWindow(android.view.View);
    method public abstract void onViewDetachedFromWindow(android.view.View);
  }

  public static abstract interface View.OnCapturedPointerListener {
    method public abstract boolean onCapturedPointer(android.view.View, android.view.MotionEvent);
  }

  public static abstract interface View.OnClickListener {
    method public abstract void onClick(android.view.View);
  }

  public static abstract interface View.OnContextClickListener {
    method public abstract boolean onContextClick(android.view.View);
  }

  public static abstract interface View.OnCreateContextMenuListener {
    method public abstract void onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo);
  }

  public static abstract interface View.OnDragListener {
    method public abstract boolean onDrag(android.view.View, android.view.DragEvent);
  }

  public static abstract interface View.OnFocusChangeListener {
    method public abstract void onFocusChange(android.view.View, boolean);
  }

  public static abstract interface View.OnGenericMotionListener {
    method public abstract boolean onGenericMotion(android.view.View, android.view.MotionEvent);
  }

  public static abstract interface View.OnHoverListener {
    method public abstract boolean onHover(android.view.View, android.view.MotionEvent);
  }

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

  public static abstract interface View.OnLayoutChangeListener {
    method public abstract void onLayoutChange(android.view.View, int, int, int, int, int, int, int, int);
  }

  public static abstract interface View.OnLongClickListener {
    method public abstract boolean onLongClick(android.view.View);
  }

  public static abstract interface View.OnScrollChangeListener {
    method public abstract void onScrollChange(android.view.View, int, int, int, int);
  }

  public static abstract interface View.OnSystemUiVisibilityChangeListener {
    method public abstract void onSystemUiVisibilityChange(int);
  }

  public static abstract interface View.OnTouchListener {
    method public abstract boolean onTouch(android.view.View, android.view.MotionEvent);
  }

  public static abstract interface View.OnUnhandledKeyEventListener {
    method public abstract 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 public deprecated ViewConfiguration();
    method public static android.view.ViewConfiguration get(android.content.Context);
    method public static long getDefaultActionModeHideDuration();
    method public static int getDoubleTapTimeout();
    method public static deprecated int getEdgeSlop();
    method public static deprecated int getFadingEdgeLength();
    method public static deprecated long getGlobalActionKeyTimeout();
    method public static int getJumpTapTimeout();
    method public static int getKeyRepeatDelay();
    method public static int getKeyRepeatTimeout();
    method public static int getLongPressTimeout();
    method public static deprecated int getMaximumDrawingCacheSize();
    method public static deprecated int getMaximumFlingVelocity();
    method public static deprecated 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 public static deprecated int getScrollBarSize();
    method public static int getScrollDefaultDelay();
    method public static float getScrollFriction();
    method public static int getTapTimeout();
    method public static deprecated int getTouchSlop();
    method public static deprecated 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(java.lang.String, java.lang.Object);
    method public static deprecated void startHierarchyTracing(java.lang.String, android.view.View);
    method public static deprecated void startRecyclerTracing(java.lang.String, android.view.View);
    method public static deprecated void stopHierarchyTracing();
    method public static deprecated void stopRecyclerTracing();
    method public static deprecated void trace(android.view.View, android.view.ViewDebug.RecyclerTraceType, int...);
    method public static deprecated void trace(android.view.View, android.view.ViewDebug.HierarchyTraceType);
    field public static final deprecated boolean TRACE_HIERARCHY = false;
    field public static final deprecated boolean TRACE_RECYCLER = false;
  }

  public static abstract class ViewDebug.CapturedViewProperty implements java.lang.annotation.Annotation {
  }

  public static abstract class ViewDebug.ExportedProperty implements java.lang.annotation.Annotation {
  }

  public static abstract class ViewDebug.FlagToString implements java.lang.annotation.Annotation {
  }

  public static final deprecated class ViewDebug.HierarchyTraceType extends java.lang.Enum {
    method public static android.view.ViewDebug.HierarchyTraceType valueOf(java.lang.String);
    method public static final android.view.ViewDebug.HierarchyTraceType[] values();
    enum_constant public static final android.view.ViewDebug.HierarchyTraceType BUILD_CACHE;
    enum_constant public static final android.view.ViewDebug.HierarchyTraceType DRAW;
    enum_constant public static final android.view.ViewDebug.HierarchyTraceType INVALIDATE;
    enum_constant public static final android.view.ViewDebug.HierarchyTraceType INVALIDATE_CHILD;
    enum_constant public static final android.view.ViewDebug.HierarchyTraceType INVALIDATE_CHILD_IN_PARENT;
    enum_constant public static final android.view.ViewDebug.HierarchyTraceType ON_LAYOUT;
    enum_constant public static final android.view.ViewDebug.HierarchyTraceType ON_MEASURE;
    enum_constant public static final android.view.ViewDebug.HierarchyTraceType REQUEST_LAYOUT;
  }

  public static abstract class ViewDebug.IntToString implements java.lang.annotation.Annotation {
  }

  public static final deprecated class ViewDebug.RecyclerTraceType extends java.lang.Enum {
    method public static android.view.ViewDebug.RecyclerTraceType valueOf(java.lang.String);
    method public static final android.view.ViewDebug.RecyclerTraceType[] values();
    enum_constant public static final android.view.ViewDebug.RecyclerTraceType BIND_VIEW;
    enum_constant public static final android.view.ViewDebug.RecyclerTraceType MOVE_FROM_ACTIVE_TO_SCRAP_HEAP;
    enum_constant public static final android.view.ViewDebug.RecyclerTraceType MOVE_TO_SCRAP_HEAP;
    enum_constant public static final android.view.ViewDebug.RecyclerTraceType NEW_VIEW;
    enum_constant public static final android.view.ViewDebug.RecyclerTraceType RECYCLE_FROM_ACTIVE_HEAP;
    enum_constant public static final android.view.ViewDebug.RecyclerTraceType RECYCLE_FROM_SCRAP_HEAP;
  }

  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 public boolean getClipChildren();
    method public boolean getClipToPadding();
    method 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 public deprecated int getPersistentDrawingCache();
    method public boolean getTouchscreenBlocksFocus();
    method public int indexOfChild(android.view.View);
    method public final deprecated void invalidateChild(android.view.View, android.graphics.Rect);
    method public deprecated android.view.ViewParent invalidateChildInParent(int[], android.graphics.Rect);
    method public deprecated boolean isAlwaysDrawnWithCacheEnabled();
    method public deprecated boolean isAnimationCacheEnabled();
    method protected boolean isChildrenDrawingOrderEnabled();
    method protected deprecated 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 public deprecated void setAlwaysDrawnWithCacheEnabled(boolean);
    method public deprecated void setAnimationCacheEnabled(boolean);
    method protected deprecated void setChildrenDrawingCacheEnabled(boolean);
    method protected void setChildrenDrawingOrderEnabled(boolean);
    method protected deprecated 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 public deprecated 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 public static final deprecated int PERSISTENT_ALL_CACHES = 3; // 0x3
    field public static final deprecated int PERSISTENT_ANIMATION_CACHE = 1; // 0x1
    field public static final deprecated int PERSISTENT_NO_CACHE = 0; // 0x0
    field public static final deprecated 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 public static final deprecated int FILL_PARENT = -1; // 0xffffffff
    field public static final int MATCH_PARENT = -1; // 0xffffffff
    field public static final int WRAP_CONTENT = -2; // 0xfffffffe
    field public int height;
    field public android.view.animation.LayoutAnimationController.AnimationParameters layoutAnimationParameters;
    field 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 public int bottomMargin;
    field public int leftMargin;
    field public int rightMargin;
    field public int topMargin;
  }

  public static abstract interface ViewGroup.OnHierarchyChangeListener {
    method public abstract void onChildViewAdded(android.view.View, android.view.View);
    method public abstract void onChildViewRemoved(android.view.View, android.view.View);
  }

  public class ViewGroupOverlay extends android.view.ViewOverlay {
    method public void add(android.view.View);
    method public void remove(android.view.View);
  }

  public abstract interface ViewManager {
    method public abstract void addView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public abstract void removeView(android.view.View);
    method public abstract 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(android.graphics.drawable.Drawable);
    method public void clear();
    method public void remove(android.graphics.drawable.Drawable);
  }

  public abstract interface ViewParent {
    method public abstract void bringChildToFront(android.view.View);
    method public abstract boolean canResolveLayoutDirection();
    method public abstract boolean canResolveTextAlignment();
    method public abstract boolean canResolveTextDirection();
    method public abstract void childDrawableStateChanged(android.view.View);
    method public abstract void childHasTransientStateChanged(android.view.View, boolean);
    method public abstract void clearChildFocus(android.view.View);
    method public abstract void createContextMenu(android.view.ContextMenu);
    method public abstract android.view.View focusSearch(android.view.View, int);
    method public abstract void focusableViewAvailable(android.view.View);
    method public abstract boolean getChildVisibleRect(android.view.View, android.graphics.Rect, android.graphics.Point);
    method public abstract int getLayoutDirection();
    method public abstract android.view.ViewParent getParent();
    method public abstract android.view.ViewParent getParentForAccessibility();
    method public abstract int getTextAlignment();
    method public abstract int getTextDirection();
    method public abstract deprecated void invalidateChild(android.view.View, android.graphics.Rect);
    method public abstract deprecated android.view.ViewParent invalidateChildInParent(int[], android.graphics.Rect);
    method public abstract boolean isLayoutDirectionResolved();
    method public abstract boolean isLayoutRequested();
    method public abstract boolean isTextAlignmentResolved();
    method public abstract boolean isTextDirectionResolved();
    method public abstract android.view.View keyboardNavigationClusterSearch(android.view.View, int);
    method public abstract void notifySubtreeAccessibilityStateChanged(android.view.View, android.view.View, int);
    method public default void onDescendantInvalidated(android.view.View, android.view.View);
    method public abstract boolean onNestedFling(android.view.View, float, float, boolean);
    method public abstract boolean onNestedPreFling(android.view.View, float, float);
    method public abstract boolean onNestedPrePerformAccessibilityAction(android.view.View, int, android.os.Bundle);
    method public abstract void onNestedPreScroll(android.view.View, int, int, int[]);
    method public abstract void onNestedScroll(android.view.View, int, int, int, int);
    method public abstract void onNestedScrollAccepted(android.view.View, android.view.View, int);
    method public abstract boolean onStartNestedScroll(android.view.View, android.view.View, int);
    method public abstract void onStopNestedScroll(android.view.View);
    method public abstract void recomputeViewAttributes(android.view.View);
    method public abstract void requestChildFocus(android.view.View, android.view.View);
    method public abstract boolean requestChildRectangleOnScreen(android.view.View, android.graphics.Rect, boolean);
    method public abstract void requestDisallowInterceptTouchEvent(boolean);
    method public abstract void requestFitSystemWindows();
    method public abstract void requestLayout();
    method public abstract boolean requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public abstract void requestTransparentRegion(android.view.View);
    method public abstract boolean showContextMenuForChild(android.view.View);
    method public abstract boolean showContextMenuForChild(android.view.View, float, float);
    method public abstract android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback);
    method public abstract 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(java.lang.Runnable);
    method public android.view.ViewPropertyAnimator withLayer();
    method public android.view.ViewPropertyAnimator withStartAction(java.lang.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 public abstract android.view.autofill.AutofillId getAutofillId();
    method public abstract int getChildCount();
    method public abstract android.os.Bundle getExtras();
    method public abstract java.lang.CharSequence getHint();
    method public abstract java.lang.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(java.lang.String);
    method public abstract void setAccessibilityFocused(boolean);
    method public abstract void setActivated(boolean);
    method public abstract void setAlpha(float);
    method public abstract void setAutofillHints(java.lang.String[]);
    method public abstract void setAutofillId(android.view.autofill.AutofillId);
    method public abstract void setAutofillId(android.view.autofill.AutofillId, int);
    method public abstract void setAutofillOptions(java.lang.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(java.lang.String);
    method public abstract void setClickable(boolean);
    method public abstract void setContentDescription(java.lang.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(java.lang.CharSequence);
    method public abstract void setHtmlInfo(android.view.ViewStructure.HtmlInfo);
    method public abstract void setId(int, java.lang.String, java.lang.String, java.lang.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(java.lang.CharSequence);
    method public abstract void setText(java.lang.CharSequence, int, int);
    method public void setTextIdEntry(java.lang.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(java.lang.String);
  }

  public static abstract class ViewStructure.HtmlInfo {
    ctor public ViewStructure.HtmlInfo();
    method public abstract java.util.List<android.util.Pair<java.lang.String, java.lang.String>> getAttributes();
    method public abstract java.lang.String getTag();
  }

  public static abstract class ViewStructure.HtmlInfo.Builder {
    ctor public ViewStructure.HtmlInfo.Builder();
    method public abstract android.view.ViewStructure.HtmlInfo.Builder addAttribute(java.lang.String, java.lang.String);
    method public abstract android.view.ViewStructure.HtmlInfo build();
  }

  public final class ViewStub extends android.view.View {
    ctor public ViewStub(android.content.Context);
    ctor public ViewStub(android.content.Context, 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 public int getInflatedId();
    method public android.view.LayoutInflater getLayoutInflater();
    method public int getLayoutResource();
    method public android.view.View inflate();
    method public void setInflatedId(int);
    method public void setLayoutInflater(android.view.LayoutInflater);
    method public void setLayoutResource(int);
    method public void setOnInflateListener(android.view.ViewStub.OnInflateListener);
  }

  public static abstract interface ViewStub.OnInflateListener {
    method public abstract 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 public deprecated 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 abstract interface ViewTreeObserver.OnDrawListener {
    method public abstract void onDraw();
  }

  public static abstract interface ViewTreeObserver.OnGlobalFocusChangeListener {
    method public abstract void onGlobalFocusChanged(android.view.View, android.view.View);
  }

  public static abstract interface ViewTreeObserver.OnGlobalLayoutListener {
    method public abstract void onGlobalLayout();
  }

  public static abstract interface ViewTreeObserver.OnPreDrawListener {
    method public abstract boolean onPreDraw();
  }

  public static abstract interface ViewTreeObserver.OnScrollChangedListener {
    method public abstract void onScrollChanged();
  }

  public static abstract interface ViewTreeObserver.OnTouchModeChangeListener {
    method public abstract void onTouchModeChanged(boolean);
  }

  public static abstract interface ViewTreeObserver.OnWindowAttachListener {
    method public abstract void onWindowAttached();
    method public abstract void onWindowDetached();
  }

  public static abstract interface ViewTreeObserver.OnWindowFocusChangeListener {
    method public abstract 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(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(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 public abstract android.view.View getCurrentFocus();
    method 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 public abstract android.view.LayoutInflater getLayoutInflater();
    method protected final int getLocalFeatures();
    method public android.media.session.MediaController getMediaController();
    method public abstract int getNavigationBarColor();
    method 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 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 public final <T extends android.view.View> T requireViewById(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(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(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, 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(int);
    method public void setLayout(int, int);
    method public void setLocalFocus(boolean, boolean);
    method public void setLogo(int);
    method public void setMediaController(android.media.session.MediaController);
    method public abstract void setNavigationBarColor(int);
    method public void setNavigationBarDividerColor(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(int);
    method public void setSustainedPerformanceMode(boolean);
    method public abstract void setTitle(java.lang.CharSequence);
    method public abstract deprecated void setTitleColor(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(int);
    method public void setWindowManager(android.view.WindowManager, android.os.IBinder, java.lang.String);
    method public void setWindowManager(android.view.WindowManager, android.os.IBinder, java.lang.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 protected static final deprecated 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 public static final deprecated 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 public static final deprecated 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 java.lang.String NAVIGATION_BAR_BACKGROUND_TRANSITION_NAME = "android:navigation:background";
    field public static final deprecated int PROGRESS_END = 10000; // 0x2710
    field public static final deprecated int PROGRESS_INDETERMINATE_OFF = -4; // 0xfffffffc
    field public static final deprecated int PROGRESS_INDETERMINATE_ON = -3; // 0xfffffffd
    field public static final deprecated int PROGRESS_SECONDARY_END = 30000; // 0x7530
    field public static final deprecated int PROGRESS_SECONDARY_START = 20000; // 0x4e20
    field public static final deprecated int PROGRESS_START = 0; // 0x0
    field public static final deprecated int PROGRESS_VISIBILITY_OFF = -2; // 0xfffffffe
    field public static final deprecated int PROGRESS_VISIBILITY_ON = -1; // 0xffffffff
    field public static final java.lang.String STATUS_BAR_BACKGROUND_TRANSITION_NAME = "android:status:background";
  }

  public static abstract interface Window.Callback {
    method public abstract boolean dispatchGenericMotionEvent(android.view.MotionEvent);
    method public abstract boolean dispatchKeyEvent(android.view.KeyEvent);
    method public abstract boolean dispatchKeyShortcutEvent(android.view.KeyEvent);
    method public abstract boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public abstract boolean dispatchTouchEvent(android.view.MotionEvent);
    method public abstract boolean dispatchTrackballEvent(android.view.MotionEvent);
    method public abstract void onActionModeFinished(android.view.ActionMode);
    method public abstract void onActionModeStarted(android.view.ActionMode);
    method public abstract void onAttachedToWindow();
    method public abstract void onContentChanged();
    method public abstract boolean onCreatePanelMenu(int, android.view.Menu);
    method public abstract android.view.View onCreatePanelView(int);
    method public abstract void onDetachedFromWindow();
    method public abstract boolean onMenuItemSelected(int, android.view.MenuItem);
    method public abstract boolean onMenuOpened(int, android.view.Menu);
    method public abstract void onPanelClosed(int, android.view.Menu);
    method public default void onPointerCaptureChanged(boolean);
    method public abstract boolean onPreparePanel(int, android.view.View, android.view.Menu);
    method public default void onProvideKeyboardShortcuts(java.util.List<android.view.KeyboardShortcutGroup>, android.view.Menu, int);
    method public abstract boolean onSearchRequested();
    method public abstract boolean onSearchRequested(android.view.SearchEvent);
    method public abstract void onWindowAttributesChanged(android.view.WindowManager.LayoutParams);
    method public abstract void onWindowFocusChanged(boolean);
    method public abstract android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback);
    method public abstract android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback, int);
  }

  public static abstract interface Window.OnFrameMetricsAvailableListener {
    method public abstract void onFrameMetricsAvailable(android.view.Window, android.view.FrameMetrics, int);
  }

  public static abstract interface Window.OnRestrictedCaptionAreaChangedListener {
    method public abstract 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 static abstract 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 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 abstract interface WindowManager implements android.view.ViewManager {
    method public abstract android.view.Display getDefaultDisplay();
    method public abstract void removeViewImmediate(android.view.View);
  }

  public static class WindowManager.BadTokenException extends java.lang.RuntimeException {
    ctor public WindowManager.BadTokenException();
    ctor public WindowManager.BadTokenException(java.lang.String);
  }

  public static class WindowManager.InvalidDisplayException extends java.lang.RuntimeException {
    ctor public WindowManager.InvalidDisplayException();
    ctor public WindowManager.InvalidDisplayException(java.lang.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 java.lang.String debug(java.lang.String);
    method public int describeContents();
    method public int getColorMode();
    method public final java.lang.CharSequence getTitle();
    method public static boolean mayUseInputMethod(int);
    method public void setColorMode(int);
    method public final void setTitle(java.lang.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 public static final deprecated int FLAG_BLUR_BEHIND = 4; // 0x4
    field public static final int FLAG_DIM_BEHIND = 2; // 0x2
    field public static final deprecated int FLAG_DISMISS_KEYGUARD = 4194304; // 0x400000
    field public static final deprecated 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 public static final deprecated int FLAG_SHOW_WHEN_LOCKED = 524288; // 0x80000
    field public static final int FLAG_SPLIT_TOUCH = 8388608; // 0x800000
    field public static final deprecated 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 public static final deprecated 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 public static final deprecated int MEMORY_TYPE_GPU = 2; // 0x2
    field public static final deprecated int MEMORY_TYPE_HARDWARE = 1; // 0x1
    field public static final deprecated int MEMORY_TYPE_NORMAL = 0; // 0x0
    field public static final deprecated 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 public static final deprecated int TYPE_PHONE = 2002; // 0x7d2
    field public static final deprecated 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 public static final deprecated int TYPE_SYSTEM_ALERT = 2003; // 0x7d3
    field public static final int TYPE_SYSTEM_DIALOG = 2008; // 0x7d8
    field public static final deprecated int TYPE_SYSTEM_ERROR = 2010; // 0x7da
    field public static final deprecated int TYPE_SYSTEM_OVERLAY = 2006; // 0x7d6
    field public static final deprecated 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 public int flags;
    field public int format;
    field public int gravity;
    field public float horizontalMargin;
    field public float horizontalWeight;
    field public int layoutInDisplayCutoutMode;
    field public deprecated int memoryType;
    field public java.lang.String packageName;
    field public int preferredDisplayModeId;
    field public deprecated 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 public int type;
    field public float verticalMargin;
    field public float verticalWeight;
    field public int windowAnimations;
    field public int x;
    field 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 java.lang.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 java.lang.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(java.lang.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 public static final deprecated 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 abstract interface AccessibilityEventSource {
    method public abstract void sendAccessibilityEvent(int);
    method public abstract void sendAccessibilityEventUnchecked(android.view.accessibility.AccessibilityEvent);
  }

  public final class AccessibilityManager {
    method public void addAccessibilityRequestPreparer(android.view.accessibility.AccessibilityRequestPreparer);
    method public boolean addAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener);
    method public void addAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener, android.os.Handler);
    method public boolean addTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener);
    method public void addTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener, android.os.Handler);
    method public deprecated 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(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener);
    method public boolean removeTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener);
    method public void sendAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
  }

  public static abstract interface AccessibilityManager.AccessibilityStateChangeListener {
    method public abstract void onAccessibilityStateChanged(boolean);
  }

  public static abstract interface AccessibilityManager.TouchExplorationStateChangeListener {
    method public abstract void onTouchExplorationStateChanged(boolean);
  }

  public class AccessibilityNodeInfo implements android.os.Parcelable {
    method public void addAction(android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction);
    method public deprecated 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(java.lang.String);
    method public java.util.List<android.view.accessibility.AccessibilityNodeInfo> findAccessibilityNodeInfosByViewId(java.lang.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 public deprecated 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 java.lang.CharSequence getClassName();
    method public android.view.accessibility.AccessibilityNodeInfo.CollectionInfo getCollectionInfo();
    method public android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo getCollectionItemInfo();
    method public java.lang.CharSequence getContentDescription();
    method public int getDrawingOrder();
    method public java.lang.CharSequence getError();
    method public android.os.Bundle getExtras();
    method public java.lang.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 java.lang.CharSequence getPackageName();
    method public java.lang.CharSequence getPaneTitle();
    method public android.view.accessibility.AccessibilityNodeInfo getParent();
    method public android.view.accessibility.AccessibilityNodeInfo.RangeInfo getRangeInfo();
    method public java.lang.CharSequence getText();
    method public int getTextSelectionEnd();
    method public int getTextSelectionStart();
    method public java.lang.CharSequence getTooltipText();
    method public android.view.accessibility.AccessibilityNodeInfo getTraversalAfter();
    method public android.view.accessibility.AccessibilityNodeInfo getTraversalBefore();
    method public java.lang.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(java.lang.String, android.os.Bundle);
    method public deprecated 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(java.lang.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(java.lang.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(java.lang.CharSequence);
    method public void setFocusable(boolean);
    method public void setFocused(boolean);
    method public void setHeading(boolean);
    method public void setHintText(java.lang.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(java.lang.CharSequence);
    method public void setPaneTitle(java.lang.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(java.lang.CharSequence);
    method public void setTextSelection(int, int);
    method public void setTooltipText(java.lang.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(java.lang.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 java.lang.String ACTION_ARGUMENT_COLUMN_INT = "android.view.accessibility.action.ARGUMENT_COLUMN_INT";
    field public static final java.lang.String ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN = "ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN";
    field public static final java.lang.String ACTION_ARGUMENT_HTML_ELEMENT_STRING = "ACTION_ARGUMENT_HTML_ELEMENT_STRING";
    field public static final java.lang.String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT = "ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT";
    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_X = "ACTION_ARGUMENT_MOVE_WINDOW_X";
    field public static final java.lang.String ACTION_ARGUMENT_MOVE_WINDOW_Y = "ACTION_ARGUMENT_MOVE_WINDOW_Y";
    field public static final java.lang.String ACTION_ARGUMENT_PROGRESS_VALUE = "android.view.accessibility.action.ARGUMENT_PROGRESS_VALUE";
    field public static final java.lang.String ACTION_ARGUMENT_ROW_INT = "android.view.accessibility.action.ARGUMENT_ROW_INT";
    field public static final java.lang.String ACTION_ARGUMENT_SELECTION_END_INT = "ACTION_ARGUMENT_SELECTION_END_INT";
    field public static final java.lang.String ACTION_ARGUMENT_SELECTION_START_INT = "ACTION_ARGUMENT_SELECTION_START_INT";
    field public static final java.lang.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 java.lang.String EXTRA_DATA_TEXT_CHARACTER_LOCATION_ARG_LENGTH = "android.view.accessibility.extra.DATA_TEXT_CHARACTER_LOCATION_ARG_LENGTH";
    field public static final java.lang.String EXTRA_DATA_TEXT_CHARACTER_LOCATION_ARG_START_INDEX = "android.view.accessibility.extra.DATA_TEXT_CHARACTER_LOCATION_ARG_START_INDEX";
    field public static final java.lang.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, java.lang.CharSequence);
    method public int getId();
    method public java.lang.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 public deprecated 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, java.lang.String, android.os.Bundle);
    method public android.view.accessibility.AccessibilityNodeInfo createAccessibilityNodeInfo(int);
    method public java.util.List<android.view.accessibility.AccessibilityNodeInfo> findAccessibilityNodeInfosByText(java.lang.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 java.lang.CharSequence getBeforeText();
    method public java.lang.CharSequence getClassName();
    method public java.lang.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(java.lang.CharSequence);
    method public void setChecked(boolean);
    method public void setClassName(java.lang.CharSequence);
    method public void setContentDescription(java.lang.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(android.view.View, int);
    method public void setToIndex(int);
  }

  public abstract class AccessibilityRequestPreparer {
    ctor public AccessibilityRequestPreparer(android.view.View, int);
    method public android.view.View getView();
    method public abstract void onPrepareExtraData(int, java.lang.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 public java.lang.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(android.view.accessibility.CaptioningManager.CaptioningChangeListener);
    method public final float getFontScale();
    method public final java.util.Locale getLocale();
    method public android.view.accessibility.CaptioningManager.CaptionStyle getUserStyle();
    method public final boolean isEnabled();
    method public void removeCaptioningChangeListener(android.view.accessibility.CaptioningManager.CaptioningChangeListener);
  }

  public static final class CaptioningManager.CaptionStyle {
    method 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 static abstract class CaptioningManager.CaptioningChangeListener {
    ctor public CaptioningManager.CaptioningChangeListener();
    method public void onEnabledChanged(boolean);
    method public void onFontScaleChanged(float);
    method public void onLocaleChanged(java.util.Locale);
    method public void onUserStyleChanged(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 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(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, 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 abstract interface Animation.AnimationListener {
    method public abstract void onAnimationEnd(android.view.animation.Animation);
    method public abstract void onAnimationRepeat(android.view.animation.Animation);
    method public abstract 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, int) throws android.content.res.Resources.NotFoundException;
    method public static android.view.animation.Interpolator loadInterpolator(android.content.Context, int) throws android.content.res.Resources.NotFoundException;
    method public static android.view.animation.LayoutAnimationController loadLayoutAnimation(android.content.Context, 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 abstract interface Interpolator implements 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, int);
    method public void setAnimation(android.view.animation.Animation);
    method public void setDelay(float);
    method public void setInterpolator(android.content.Context, 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(float);
    method public void setTransformationType(int);
    method public java.lang.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 public android.content.ComponentName getAutofillServiceComponentName();
    method public java.util.List<java.lang.String> getAvailableFieldClassificationAlgorithms();
    method public java.lang.String getDefaultFieldClassificationAlgorithm();
    method public android.view.autofill.AutofillId getNextAutofillId();
    method public android.service.autofill.UserData getUserData();
    method public java.lang.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(android.view.View);
    method public void notifyViewClicked(android.view.View, int);
    method public void notifyViewEntered(android.view.View);
    method public void notifyViewEntered(android.view.View, int, android.graphics.Rect);
    method public void notifyViewExited(android.view.View);
    method public void notifyViewExited(android.view.View, int);
    method public void notifyViewVisibilityChanged(android.view.View, boolean);
    method public void notifyViewVisibilityChanged(android.view.View, int, boolean);
    method public void registerCallback(android.view.autofill.AutofillManager.AutofillCallback);
    method public void requestAutofill(android.view.View);
    method public void requestAutofill(android.view.View, int, android.graphics.Rect);
    method public void setUserData(android.service.autofill.UserData);
    method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback);
    field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE";
    field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT";
    field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.CLIENT_STATE";
  }

  public static abstract class AutofillManager.AutofillCallback {
    ctor public AutofillManager.AutofillCallback();
    method public void onAutofillEvent(android.view.View, int);
    method public void onAutofillEvent(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(java.lang.CharSequence);
    method public static android.view.autofill.AutofillValue forToggle(boolean);
    method public long getDateValue();
    method public int getListValue();
    method public java.lang.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 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(java.lang.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 java.lang.CharSequence getSelectedText(int);
    method public java.lang.CharSequence getTextAfterCursor(int, int);
    method public java.lang.CharSequence getTextBeforeCursor(int, int);
    method public boolean performContextMenuAction(int);
    method public boolean performEditorAction(int);
    method public boolean performPrivateCommand(java.lang.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(java.lang.CharSequence, int);
    method public boolean setSelection(int, int);
  }

  public final class CompletionInfo implements android.os.Parcelable {
    ctor public CompletionInfo(long, int, java.lang.CharSequence);
    ctor public CompletionInfo(long, int, java.lang.CharSequence, java.lang.CharSequence);
    method public int describeContents();
    method public long getId();
    method public java.lang.CharSequence getLabel();
    method public int getPosition();
    method public java.lang.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, java.lang.CharSequence, java.lang.CharSequence);
    method public int describeContents();
    method public java.lang.CharSequence getNewText();
    method public int getOffset();
    method public java.lang.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 java.lang.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, java.lang.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, java.lang.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 java.lang.CharSequence actionLabel;
    field public java.lang.String[] contentMimeTypes;
    field public android.os.Bundle extras;
    field public int fieldId;
    field public java.lang.String fieldName;
    field public android.os.LocaleList hintLocales;
    field public java.lang.CharSequence hintText;
    field public int imeOptions;
    field public int initialCapsMode;
    field public int initialSelEnd;
    field public int initialSelStart;
    field public int inputType;
    field public java.lang.CharSequence label;
    field public java.lang.String packageName;
    field public java.lang.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 java.lang.CharSequence hint;
    field public int partialEndOffset;
    field public int partialStartOffset;
    field public int selectionEnd;
    field public int selectionStart;
    field public int startOffset;
    field public java.lang.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 abstract interface InputConnection {
    method public abstract boolean beginBatchEdit();
    method public abstract boolean clearMetaKeyStates(int);
    method public abstract void closeConnection();
    method public abstract boolean commitCompletion(android.view.inputmethod.CompletionInfo);
    method public abstract boolean commitContent(android.view.inputmethod.InputContentInfo, int, android.os.Bundle);
    method public abstract boolean commitCorrection(android.view.inputmethod.CorrectionInfo);
    method public abstract boolean commitText(java.lang.CharSequence, int);
    method public abstract boolean deleteSurroundingText(int, int);
    method public abstract boolean deleteSurroundingTextInCodePoints(int, int);
    method public abstract boolean endBatchEdit();
    method public abstract boolean finishComposingText();
    method public abstract int getCursorCapsMode(int);
    method public abstract android.view.inputmethod.ExtractedText getExtractedText(android.view.inputmethod.ExtractedTextRequest, int);
    method public abstract android.os.Handler getHandler();
    method public abstract java.lang.CharSequence getSelectedText(int);
    method public abstract java.lang.CharSequence getTextAfterCursor(int, int);
    method public abstract java.lang.CharSequence getTextBeforeCursor(int, int);
    method public abstract boolean performContextMenuAction(int);
    method public abstract boolean performEditorAction(int);
    method public abstract boolean performPrivateCommand(java.lang.String, android.os.Bundle);
    method public abstract boolean reportFullscreenMode(boolean);
    method public abstract boolean requestCursorUpdates(int);
    method public abstract boolean sendKeyEvent(android.view.KeyEvent);
    method public abstract boolean setComposingRegion(int, int);
    method public abstract boolean setComposingText(java.lang.CharSequence, int);
    method public abstract 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(java.lang.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 java.lang.CharSequence getSelectedText(int);
    method public java.lang.CharSequence getTextAfterCursor(int, int);
    method public java.lang.CharSequence getTextBeforeCursor(int, int);
    method public boolean performContextMenuAction(int);
    method public boolean performEditorAction(int);
    method public boolean performPrivateCommand(java.lang.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(java.lang.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(android.net.Uri, android.content.ClipDescription);
    ctor public InputContentInfo(android.net.Uri, android.content.ClipDescription, android.net.Uri);
    method public int describeContents();
    method public android.net.Uri getContentUri();
    method public android.content.ClipDescription getDescription();
    method 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 abstract interface InputMethod {
    method public abstract void attachToken(android.os.IBinder);
    method public abstract void bindInput(android.view.inputmethod.InputBinding);
    method public abstract void changeInputMethodSubtype(android.view.inputmethod.InputMethodSubtype);
    method public abstract void createSession(android.view.inputmethod.InputMethod.SessionCallback);
    method public abstract void hideSoftInput(int, android.os.ResultReceiver);
    method public abstract void restartInput(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo);
    method public abstract void revokeSession(android.view.inputmethod.InputMethodSession);
    method public abstract void setSessionEnabled(android.view.inputmethod.InputMethodSession, boolean);
    method public abstract void showSoftInput(int, android.os.ResultReceiver);
    method public abstract void startInput(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo);
    method public abstract void unbindInput();
    field public static final java.lang.String SERVICE_INTERFACE = "android.view.InputMethod";
    field public static final java.lang.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 abstract interface InputMethod.SessionCallback {
    method public abstract 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(java.lang.String, java.lang.String, java.lang.CharSequence, java.lang.String);
    method public int describeContents();
    method public void dump(android.util.Printer, java.lang.String);
    method public android.content.ComponentName getComponent();
    method public java.lang.String getId();
    method public int getIsDefaultResourceId();
    method public java.lang.String getPackageName();
    method public android.content.pm.ServiceInfo getServiceInfo();
    method public java.lang.String getServiceName();
    method public java.lang.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 java.lang.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(android.view.View, 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 public deprecated 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 public deprecated 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 public deprecated boolean isWatchingCursor(android.view.View);
    method public void restartInput(android.view.View);
    method public void sendAppPrivateCommand(android.view.View, java.lang.String, android.os.Bundle);
    method public void setAdditionalInputMethodSubtypes(java.lang.String, android.view.inputmethod.InputMethodSubtype[]);
    method public boolean setCurrentInputMethodSubtype(android.view.inputmethod.InputMethodSubtype);
    method public deprecated void setInputMethod(android.os.IBinder, java.lang.String);
    method public deprecated void setInputMethodAndSubtype(android.os.IBinder, java.lang.String, android.view.inputmethod.InputMethodSubtype);
    method public deprecated boolean shouldOfferSwitchingToNextInputMethod(android.os.IBinder);
    method public void showInputMethodAndSubtypeEnabler(java.lang.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 public deprecated void showSoftInputFromInputMethod(android.os.IBinder, int);
    method public deprecated void showStatusIcon(android.os.IBinder, java.lang.String, int);
    method public deprecated boolean switchToLastInputMethod(android.os.IBinder);
    method public deprecated boolean switchToNextInputMethod(android.os.IBinder, boolean);
    method public void toggleSoftInput(int, int);
    method public void toggleSoftInputFromWindow(android.os.IBinder, int, int);
    method public deprecated 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 abstract interface InputMethodSession {
    method public abstract void appPrivateCommand(java.lang.String, android.os.Bundle);
    method public abstract void dispatchGenericMotionEvent(int, android.view.MotionEvent, android.view.inputmethod.InputMethodSession.EventCallback);
    method public abstract void dispatchKeyEvent(int, android.view.KeyEvent, android.view.inputmethod.InputMethodSession.EventCallback);
    method public abstract void dispatchTrackballEvent(int, android.view.MotionEvent, android.view.inputmethod.InputMethodSession.EventCallback);
    method public abstract void displayCompletions(android.view.inputmethod.CompletionInfo[]);
    method public abstract void finishInput();
    method public abstract void toggleSoftInput(int, int);
    method public abstract void updateCursor(android.graphics.Rect);
    method public abstract void updateCursorAnchorInfo(android.view.inputmethod.CursorAnchorInfo);
    method public abstract void updateExtractedText(int, android.view.inputmethod.ExtractedText);
    method public abstract void updateSelection(int, int, int, int, int, int);
    method public abstract void viewClicked(boolean);
  }

  public static abstract interface InputMethodSession.EventCallback {
    method public abstract void finishedEvent(int, boolean);
  }

  public final class InputMethodSubtype implements android.os.Parcelable {
    ctor public deprecated InputMethodSubtype(int, int, java.lang.String, java.lang.String, java.lang.String, boolean, boolean);
    ctor public deprecated InputMethodSubtype(int, int, java.lang.String, java.lang.String, java.lang.String, boolean, boolean, int);
    method public boolean containsExtraValueKey(java.lang.String);
    method public int describeContents();
    method public java.lang.CharSequence getDisplayName(android.content.Context, java.lang.String, android.content.pm.ApplicationInfo);
    method public java.lang.String getExtraValue();
    method public java.lang.String getExtraValueOf(java.lang.String);
    method public int getIconResId();
    method public java.lang.String getLanguageTag();
    method public deprecated java.lang.String getLocale();
    method public java.lang.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(java.lang.String);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setOverridesImplicitlyEnabledSubtype(boolean);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setSubtypeExtraValue(java.lang.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(java.lang.String);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setSubtypeMode(java.lang.String);
    method public android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder setSubtypeNameResId(int);
  }

}

package android.view.textclassifier {

  public final class SelectionEvent implements android.os.Parcelable {
    method public static android.view.textclassifier.SelectionEvent createSelectionActionEvent(int, int, int);
    method public static android.view.textclassifier.SelectionEvent createSelectionActionEvent(int, int, int, android.view.textclassifier.TextClassification);
    method public static android.view.textclassifier.SelectionEvent createSelectionModifiedEvent(int, int);
    method public static android.view.textclassifier.SelectionEvent createSelectionModifiedEvent(int, int, android.view.textclassifier.TextClassification);
    method public static android.view.textclassifier.SelectionEvent createSelectionModifiedEvent(int, int, android.view.textclassifier.TextSelection);
    method 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 public java.lang.String getEntityType();
    method public int getEventIndex();
    method public long getEventTime();
    method public int getEventType();
    method public int getInvocationMethod();
    method public java.lang.String getPackageName();
    method public java.lang.String getResultId();
    method public android.view.textclassifier.TextClassificationSessionId getSessionId();
    method public int getSmartEnd();
    method public int getSmartStart();
    method public int getStart();
    method public java.lang.String getWidgetType();
    method public java.lang.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 public float getConfidenceScore(java.lang.String);
    method public java.lang.String getEntity(int);
    method public int getEntityCount();
    method public deprecated android.graphics.drawable.Drawable getIcon();
    method public java.lang.String getId();
    method public deprecated android.content.Intent getIntent();
    method public deprecated java.lang.CharSequence getLabel();
    method public deprecated android.view.View.OnClickListener getOnClickListener();
    method public java.lang.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 public android.view.textclassifier.TextClassification.Builder addAction(android.app.RemoteAction);
    method public android.view.textclassifier.TextClassification build();
    method public android.view.textclassifier.TextClassification.Builder setEntityType(java.lang.String, float);
    method public deprecated android.view.textclassifier.TextClassification.Builder setIcon(android.graphics.drawable.Drawable);
    method public android.view.textclassifier.TextClassification.Builder setId(java.lang.String);
    method public deprecated android.view.textclassifier.TextClassification.Builder setIntent(android.content.Intent);
    method public deprecated android.view.textclassifier.TextClassification.Builder setLabel(java.lang.String);
    method public deprecated android.view.textclassifier.TextClassification.Builder setOnClickListener(android.view.View.OnClickListener);
    method public android.view.textclassifier.TextClassification.Builder setText(java.lang.String);
  }

  public static final class TextClassification.Request implements android.os.Parcelable {
    method public int describeContents();
    method public android.os.LocaleList getDefaultLocales();
    method public int getEndIndex();
    method public java.time.ZonedDateTime getReferenceTime();
    method public int getStartIndex();
    method public java.lang.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(java.lang.CharSequence, int, int);
    method public android.view.textclassifier.TextClassification.Request build();
    method public android.view.textclassifier.TextClassification.Request.Builder setDefaultLocales(android.os.LocaleList);
    method public android.view.textclassifier.TextClassification.Request.Builder setReferenceTime(java.time.ZonedDateTime);
  }

  public final class TextClassificationContext implements android.os.Parcelable {
    method public int describeContents();
    method public java.lang.String getPackageName();
    method public java.lang.String getWidgetType();
    method public java.lang.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(java.lang.String, java.lang.String);
    method public android.view.textclassifier.TextClassificationContext build();
    method public android.view.textclassifier.TextClassificationContext.Builder setWidgetVersion(java.lang.String);
  }

  public final class TextClassificationManager {
    method public android.view.textclassifier.TextClassifier createTextClassificationSession(android.view.textclassifier.TextClassificationContext);
    method public android.view.textclassifier.TextClassifier getTextClassifier();
    method public void setTextClassificationSessionFactory(android.view.textclassifier.TextClassificationSessionFactory);
    method public void setTextClassifier(android.view.textclassifier.TextClassifier);
  }

  public abstract interface TextClassificationSessionFactory {
    method public abstract android.view.textclassifier.TextClassifier createTextClassificationSession(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 abstract interface TextClassifier {
    method public default android.view.textclassifier.TextClassification classifyText(android.view.textclassifier.TextClassification.Request);
    method public default android.view.textclassifier.TextClassification classifyText(java.lang.CharSequence, int, int, android.os.LocaleList);
    method public default void destroy();
    method public default android.view.textclassifier.TextLinks generateLinks(android.view.textclassifier.TextLinks.Request);
    method public default int getMaxGenerateLinksTextLength();
    method public default boolean isDestroyed();
    method public default void onSelectionEvent(android.view.textclassifier.SelectionEvent);
    method public default android.view.textclassifier.TextSelection suggestSelection(android.view.textclassifier.TextSelection.Request);
    method public default android.view.textclassifier.TextSelection suggestSelection(java.lang.CharSequence, int, int, android.os.LocaleList);
    field public static final java.lang.String HINT_TEXT_IS_EDITABLE = "android.text_is_editable";
    field public static final java.lang.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 java.lang.String TYPE_ADDRESS = "address";
    field public static final java.lang.String TYPE_DATE = "date";
    field public static final java.lang.String TYPE_DATE_TIME = "datetime";
    field public static final java.lang.String TYPE_EMAIL = "email";
    field public static final java.lang.String TYPE_FLIGHT_NUMBER = "flight";
    field public static final java.lang.String TYPE_OTHER = "other";
    field public static final java.lang.String TYPE_PHONE = "phone";
    field public static final java.lang.String TYPE_UNKNOWN = "";
    field public static final java.lang.String TYPE_URL = "url";
    field public static final java.lang.String WIDGET_TYPE_CUSTOM_EDITTEXT = "customedit";
    field public static final java.lang.String WIDGET_TYPE_CUSTOM_TEXTVIEW = "customview";
    field public static final java.lang.String WIDGET_TYPE_CUSTOM_UNSELECTABLE_TEXTVIEW = "nosel-customview";
    field public static final java.lang.String WIDGET_TYPE_EDITTEXT = "edittext";
    field public static final java.lang.String WIDGET_TYPE_EDIT_WEBVIEW = "edit-webview";
    field public static final java.lang.String WIDGET_TYPE_TEXTVIEW = "textview";
    field public static final java.lang.String WIDGET_TYPE_UNKNOWN = "unknown";
    field public static final java.lang.String WIDGET_TYPE_UNSELECTABLE_TEXTVIEW = "nosel-textview";
    field public static final java.lang.String WIDGET_TYPE_WEBVIEW = "webview";
  }

  public static final class TextClassifier.EntityConfig implements android.os.Parcelable {
    method public static android.view.textclassifier.TextClassifier.EntityConfig create(java.util.Collection<java.lang.String>, java.util.Collection<java.lang.String>, java.util.Collection<java.lang.String>);
    method public static android.view.textclassifier.TextClassifier.EntityConfig createWithExplicitEntityList(java.util.Collection<java.lang.String>);
    method public static android.view.textclassifier.TextClassifier.EntityConfig createWithHints(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(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(android.text.Spannable, int, java.util.function.Function<android.view.textclassifier.TextLinks.TextLink, android.view.textclassifier.TextLinks.TextLinkSpan>);
    method public int describeContents();
    method 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(java.lang.String);
    method public android.view.textclassifier.TextLinks.Builder addLink(int, int, java.util.Map<java.lang.String, java.lang.Float>);
    method public android.view.textclassifier.TextLinks build();
    method public android.view.textclassifier.TextLinks.Builder clearTextLinks();
  }

  public static final class TextLinks.Request implements android.os.Parcelable {
    method public int describeContents();
    method public android.os.LocaleList getDefaultLocales();
    method public android.view.textclassifier.TextClassifier.EntityConfig getEntityConfig();
    method public java.lang.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(java.lang.CharSequence);
    method public android.view.textclassifier.TextLinks.Request build();
    method public android.view.textclassifier.TextLinks.Request.Builder setDefaultLocales(android.os.LocaleList);
    method public android.view.textclassifier.TextLinks.Request.Builder setEntityConfig(android.view.textclassifier.TextClassifier.EntityConfig);
  }

  public static final class TextLinks.TextLink implements android.os.Parcelable {
    method public int describeContents();
    method public float getConfidenceScore(java.lang.String);
    method public int getEnd();
    method public java.lang.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(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 public float getConfidenceScore(java.lang.String);
    method public java.lang.String getEntity(int);
    method public int getEntityCount();
    method public java.lang.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(int, int);
    method public android.view.textclassifier.TextSelection build();
    method public android.view.textclassifier.TextSelection.Builder setEntityType(java.lang.String, float);
    method public android.view.textclassifier.TextSelection.Builder setId(java.lang.String);
  }

  public static final class TextSelection.Request implements android.os.Parcelable {
    method public int describeContents();
    method public android.os.LocaleList getDefaultLocales();
    method public int getEndIndex();
    method public int getStartIndex();
    method public java.lang.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(java.lang.CharSequence, int, int);
    method public android.view.textclassifier.TextSelection.Request build();
    method public android.view.textclassifier.TextSelection.Request.Builder setDefaultLocales(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 java.lang.String getId();
    method public java.lang.String getPackageName();
    method public android.content.pm.ServiceInfo getServiceInfo();
    method public java.lang.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 java.lang.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 public deprecated void getSuggestions(android.view.textservice.TextInfo, int);
    method public deprecated void getSuggestions(android.view.textservice.TextInfo[], int, boolean);
    method public boolean isSessionDisconnected();
    field public static final java.lang.String SERVICE_META_DATA = "android.view.textservice.scs";
  }

  public static abstract interface SpellCheckerSession.SpellCheckerSessionListener {
    method public abstract void onGetSentenceSuggestions(android.view.textservice.SentenceSuggestionsInfo[]);
    method public abstract void onGetSuggestions(android.view.textservice.SuggestionsInfo[]);
  }

  public final class SpellCheckerSubtype implements android.os.Parcelable {
    ctor public deprecated SpellCheckerSubtype(int, java.lang.String, java.lang.String);
    method public boolean containsExtraValueKey(java.lang.String);
    method public int describeContents();
    method public java.lang.CharSequence getDisplayName(android.content.Context, java.lang.String, android.content.pm.ApplicationInfo);
    method public java.lang.String getExtraValue();
    method public java.lang.String getExtraValueOf(java.lang.String);
    method public java.lang.String getLanguageTag();
    method public deprecated java.lang.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, java.lang.String[]);
    ctor public SuggestionsInfo(int, java.lang.String[], int, int);
    ctor public SuggestionsInfo(android.os.Parcel);
    method public int describeContents();
    method public int getCookie();
    method public int getSequence();
    method public java.lang.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(java.lang.String);
    ctor public TextInfo(java.lang.String, int, int);
    ctor public TextInfo(java.lang.CharSequence, int, int, int, int);
    ctor public TextInfo(android.os.Parcel);
    method public int describeContents();
    method public java.lang.CharSequence getCharSequence();
    method public int getCookie();
    method public int getSequence();
    method public java.lang.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 java.lang.String getHost();
    method public abstract java.lang.String[] getKeyTypes();
    method public abstract int getPort();
    method 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(java.lang.String, java.lang.String, int, android.webkit.ConsoleMessage.MessageLevel);
    method public int lineNumber();
    method public java.lang.String message();
    method public android.webkit.ConsoleMessage.MessageLevel messageLevel();
    method public java.lang.String sourceId();
  }

  public static final class ConsoleMessage.MessageLevel extends java.lang.Enum {
    method public static android.webkit.ConsoleMessage.MessageLevel valueOf(java.lang.String);
    method public static final android.webkit.ConsoleMessage.MessageLevel[] values();
    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 java.lang.String getCookie(java.lang.String);
    method public static android.webkit.CookieManager getInstance();
    method public abstract boolean hasCookies();
    method public abstract deprecated void removeAllCookie();
    method public abstract void removeAllCookies(android.webkit.ValueCallback<java.lang.Boolean>);
    method public abstract deprecated void removeExpiredCookie();
    method public abstract deprecated void removeSessionCookie();
    method public abstract void removeSessionCookies(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(java.lang.String, java.lang.String);
    method public abstract void setCookie(java.lang.String, java.lang.String, android.webkit.ValueCallback<java.lang.Boolean>);
  }

  public final deprecated class CookieSyncManager implements java.lang.Runnable {
    method public static android.webkit.CookieSyncManager createInstance(android.content.Context);
    method public static android.webkit.CookieSyncManager getInstance();
    method public deprecated void resetSync();
    method public deprecated void startSync();
    method public deprecated void stopSync();
    method public deprecated void sync();
    method protected deprecated void syncFromRamToFlash();
  }

  public class DateSorter {
    ctor public DateSorter(android.content.Context);
    method public long getBoundary(int);
    method public int getIndex(long);
    method public java.lang.String getLabel(int);
    field public static final int DAY_COUNT = 5; // 0x5
  }

  public abstract interface DownloadListener {
    method public abstract void onDownloadStart(java.lang.String, java.lang.String, java.lang.String, java.lang.String, long);
  }

  public class GeolocationPermissions {
    method public void allow(java.lang.String);
    method public void clear(java.lang.String);
    method public void clearAll();
    method public void getAllowed(java.lang.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 abstract interface GeolocationPermissions.Callback {
    method public abstract void invoke(java.lang.String, boolean, boolean);
  }

  public class HttpAuthHandler extends android.os.Handler {
    method public void cancel();
    method public void proceed(java.lang.String, java.lang.String);
    method public boolean useHttpAuthUsernamePassword();
  }

  public abstract class JavascriptInterface implements java.lang.annotation.Annotation {
  }

  public class JsPromptResult extends android.webkit.JsResult {
    method public void confirm(java.lang.String);
  }

  public class JsResult {
    method public final void cancel();
    method public final void confirm();
  }

  public class MimeTypeMap {
    method public java.lang.String getExtensionFromMimeType(java.lang.String);
    method public static java.lang.String getFileExtensionFromUrl(java.lang.String);
    method public java.lang.String getMimeTypeFromExtension(java.lang.String);
    method public static android.webkit.MimeTypeMap getSingleton();
    method public boolean hasExtension(java.lang.String);
    method public boolean hasMimeType(java.lang.String);
  }

  public abstract class PermissionRequest {
    ctor public PermissionRequest();
    method public abstract void deny();
    method public abstract android.net.Uri getOrigin();
    method public abstract java.lang.String[] getResources();
    method public abstract void grant(java.lang.String[]);
    field public static final java.lang.String RESOURCE_AUDIO_CAPTURE = "android.webkit.resource.AUDIO_CAPTURE";
    field public static final java.lang.String RESOURCE_MIDI_SYSEX = "android.webkit.resource.MIDI_SYSEX";
    field public static final java.lang.String RESOURCE_PROTECTED_MEDIA_ID = "android.webkit.resource.PROTECTED_MEDIA_ID";
    field public static final java.lang.String RESOURCE_VIDEO_CAPTURE = "android.webkit.resource.VIDEO_CAPTURE";
  }

  public abstract interface PluginStub {
    method public abstract android.view.View getEmbeddedView(int, android.content.Context);
    method public abstract 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 public android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebResourceRequest);
  }

  public abstract class ServiceWorkerController {
    ctor public ServiceWorkerController();
    method public static android.webkit.ServiceWorkerController getInstance();
    method public abstract android.webkit.ServiceWorkerWebSettings getServiceWorkerWebSettings();
    method public abstract void setServiceWorkerClient(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 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 public static android.webkit.TracingController getInstance();
    method public abstract boolean isTracing();
    method public abstract void start(android.webkit.TracingConfig);
    method public abstract boolean stop(java.io.OutputStream, java.util.concurrent.Executor);
  }

  public final class URLUtil {
    ctor public URLUtil();
    method public static java.lang.String composeSearchUrl(java.lang.String, java.lang.String, java.lang.String);
    method public static byte[] decode(byte[]) throws java.lang.IllegalArgumentException;
    method public static java.lang.String guessFileName(java.lang.String, java.lang.String, java.lang.String);
    method public static java.lang.String guessUrl(java.lang.String);
    method public static boolean isAboutUrl(java.lang.String);
    method public static boolean isAssetUrl(java.lang.String);
    method public static boolean isContentUrl(java.lang.String);
    method public static deprecated boolean isCookielessProxyUrl(java.lang.String);
    method public static boolean isDataUrl(java.lang.String);
    method public static boolean isFileUrl(java.lang.String);
    method public static boolean isHttpUrl(java.lang.String);
    method public static boolean isHttpsUrl(java.lang.String);
    method public static boolean isJavaScriptUrl(java.lang.String);
    method public static boolean isNetworkUrl(java.lang.String);
    method public static boolean isValidUrl(java.lang.String);
    method public static java.lang.String stripAnchor(java.lang.String);
  }

  public abstract interface ValueCallback<T> {
    method public abstract 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 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 public android.graphics.Bitmap getDefaultVideoPoster();
    method public android.view.View getVideoLoadingProgressView();
    method public void getVisitedHistory(android.webkit.ValueCallback<java.lang.String[]>);
    method public void onCloseWindow(android.webkit.WebView);
    method public deprecated void onConsoleMessage(java.lang.String, int, java.lang.String);
    method public boolean onConsoleMessage(android.webkit.ConsoleMessage);
    method public boolean onCreateWindow(android.webkit.WebView, boolean, boolean, android.os.Message);
    method public deprecated void onExceededDatabaseQuota(java.lang.String, java.lang.String, long, long, long, android.webkit.WebStorage.QuotaUpdater);
    method public void onGeolocationPermissionsHidePrompt();
    method public void onGeolocationPermissionsShowPrompt(java.lang.String, android.webkit.GeolocationPermissions.Callback);
    method public void onHideCustomView();
    method public boolean onJsAlert(android.webkit.WebView, java.lang.String, java.lang.String, android.webkit.JsResult);
    method public boolean onJsBeforeUnload(android.webkit.WebView, java.lang.String, java.lang.String, android.webkit.JsResult);
    method public boolean onJsConfirm(android.webkit.WebView, java.lang.String, java.lang.String, android.webkit.JsResult);
    method public boolean onJsPrompt(android.webkit.WebView, java.lang.String, java.lang.String, java.lang.String, android.webkit.JsPromptResult);
    method public deprecated 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 public deprecated 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, java.lang.String);
    method public void onReceivedTouchIconUrl(android.webkit.WebView, java.lang.String, boolean);
    method public void onRequestFocus(android.webkit.WebView);
    method public void onShowCustomView(android.view.View, android.webkit.WebChromeClient.CustomViewCallback);
    method public deprecated 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 abstract interface WebChromeClient.CustomViewCallback {
    method public abstract void onCustomViewHidden();
  }

  public static abstract class WebChromeClient.FileChooserParams {
    ctor public WebChromeClient.FileChooserParams();
    method public abstract android.content.Intent createIntent();
    method public abstract java.lang.String[] getAcceptTypes();
    method public abstract java.lang.String getFilenameHint();
    method public abstract int getMode();
    method public abstract java.lang.CharSequence getTitle();
    method public abstract boolean isCaptureEnabled();
    method 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 public abstract android.graphics.Bitmap getFavicon();
    method public abstract java.lang.String getOriginalUrl();
    method public abstract java.lang.String getTitle();
    method public abstract java.lang.String getUrl();
  }

  public abstract deprecated class WebIconDatabase {
    ctor public WebIconDatabase();
    method public abstract void close();
    method public static android.webkit.WebIconDatabase getInstance();
    method public abstract void open(java.lang.String);
    method public abstract void releaseIconForPageUrl(java.lang.String);
    method public abstract void removeAllIcons();
    method public abstract void requestIconForPageUrl(java.lang.String, android.webkit.WebIconDatabase.IconListener);
    method public abstract void retainIconForPageUrl(java.lang.String);
  }

  public static abstract deprecated interface WebIconDatabase.IconListener {
    method public abstract void onReceivedIcon(java.lang.String, android.graphics.Bitmap);
  }

  public class WebMessage {
    ctor public WebMessage(java.lang.String);
    ctor public WebMessage(java.lang.String, android.webkit.WebMessagePort[]);
    method public java.lang.String getData();
    method 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 static abstract class WebMessagePort.WebMessageCallback {
    ctor public WebMessagePort.WebMessageCallback();
    method public void onMessage(android.webkit.WebMessagePort, android.webkit.WebMessage);
  }

  public abstract class WebResourceError {
    method public abstract java.lang.CharSequence getDescription();
    method public abstract int getErrorCode();
  }

  public abstract interface WebResourceRequest {
    method public abstract java.lang.String getMethod();
    method public abstract java.util.Map<java.lang.String, java.lang.String> getRequestHeaders();
    method public abstract android.net.Uri getUrl();
    method public abstract boolean hasGesture();
    method public abstract boolean isForMainFrame();
    method public abstract boolean isRedirect();
  }

  public class WebResourceResponse {
    ctor public WebResourceResponse(java.lang.String, java.lang.String, java.io.InputStream);
    ctor public WebResourceResponse(java.lang.String, java.lang.String, int, java.lang.String, java.util.Map<java.lang.String, java.lang.String>, java.io.InputStream);
    method public java.io.InputStream getData();
    method public java.lang.String getEncoding();
    method public java.lang.String getMimeType();
    method public java.lang.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(java.lang.String);
    method public void setMimeType(java.lang.String);
    method public void setResponseHeaders(java.util.Map<java.lang.String, java.lang.String>);
    method public void setStatusCodeAndReasonPhrase(int, java.lang.String);
  }

  public abstract class WebSettings {
    ctor public WebSettings();
    method public abstract deprecated 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 java.lang.String getCursiveFontFamily();
    method public abstract boolean getDatabaseEnabled();
    method public abstract deprecated java.lang.String getDatabasePath();
    method public abstract int getDefaultFixedFontSize();
    method public abstract int getDefaultFontSize();
    method public abstract java.lang.String getDefaultTextEncodingName();
    method public static java.lang.String getDefaultUserAgent(android.content.Context);
    method public abstract deprecated android.webkit.WebSettings.ZoomDensity getDefaultZoom();
    method public abstract int getDisabledActionModeMenuItems();
    method public abstract boolean getDisplayZoomControls();
    method public abstract boolean getDomStorageEnabled();
    method public abstract java.lang.String getFantasyFontFamily();
    method public abstract java.lang.String getFixedFontFamily();
    method public abstract boolean getJavaScriptCanOpenWindowsAutomatically();
    method public abstract boolean getJavaScriptEnabled();
    method public abstract android.webkit.WebSettings.LayoutAlgorithm getLayoutAlgorithm();
    method public abstract deprecated 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 public abstract deprecated android.webkit.WebSettings.PluginState getPluginState();
    method public abstract boolean getSafeBrowsingEnabled();
    method public abstract java.lang.String getSansSerifFontFamily();
    method public abstract deprecated boolean getSaveFormData();
    method public abstract deprecated boolean getSavePassword();
    method public abstract java.lang.String getSerifFontFamily();
    method public abstract java.lang.String getStandardFontFamily();
    method public deprecated synchronized android.webkit.WebSettings.TextSize getTextSize();
    method public abstract int getTextZoom();
    method public abstract boolean getUseWideViewPort();
    method public abstract java.lang.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 public abstract deprecated void setAppCacheMaxSize(long);
    method public abstract void setAppCachePath(java.lang.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(java.lang.String);
    method public abstract void setDatabaseEnabled(boolean);
    method public abstract deprecated void setDatabasePath(java.lang.String);
    method public abstract void setDefaultFixedFontSize(int);
    method public abstract void setDefaultFontSize(int);
    method public abstract void setDefaultTextEncodingName(java.lang.String);
    method public abstract deprecated 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 public abstract deprecated void setEnableSmoothTransition(boolean);
    method public abstract void setFantasyFontFamily(java.lang.String);
    method public abstract void setFixedFontFamily(java.lang.String);
    method public abstract deprecated void setGeolocationDatabasePath(java.lang.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 public abstract deprecated 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 public abstract deprecated void setPluginState(android.webkit.WebSettings.PluginState);
    method public abstract deprecated void setRenderPriority(android.webkit.WebSettings.RenderPriority);
    method public abstract void setSafeBrowsingEnabled(boolean);
    method public abstract void setSansSerifFontFamily(java.lang.String);
    method public abstract deprecated void setSaveFormData(boolean);
    method public abstract deprecated void setSavePassword(boolean);
    method public abstract void setSerifFontFamily(java.lang.String);
    method public abstract void setStandardFontFamily(java.lang.String);
    method public abstract void setSupportMultipleWindows(boolean);
    method public abstract void setSupportZoom(boolean);
    method public deprecated synchronized void setTextSize(android.webkit.WebSettings.TextSize);
    method public abstract void setTextZoom(int);
    method public abstract void setUseWideViewPort(boolean);
    method public abstract void setUserAgentString(java.lang.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 public static final deprecated 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 static final class WebSettings.LayoutAlgorithm extends java.lang.Enum {
    method public static android.webkit.WebSettings.LayoutAlgorithm valueOf(java.lang.String);
    method public static final android.webkit.WebSettings.LayoutAlgorithm[] values();
    enum_constant public static final deprecated android.webkit.WebSettings.LayoutAlgorithm NARROW_COLUMNS;
    enum_constant public static final android.webkit.WebSettings.LayoutAlgorithm NORMAL;
    enum_constant public static final deprecated android.webkit.WebSettings.LayoutAlgorithm SINGLE_COLUMN;
    enum_constant public static final android.webkit.WebSettings.LayoutAlgorithm TEXT_AUTOSIZING;
  }

  public static final class WebSettings.PluginState extends java.lang.Enum {
    method public static android.webkit.WebSettings.PluginState valueOf(java.lang.String);
    method public static final android.webkit.WebSettings.PluginState[] values();
    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 static final class WebSettings.RenderPriority extends java.lang.Enum {
    method public static android.webkit.WebSettings.RenderPriority valueOf(java.lang.String);
    method public static final android.webkit.WebSettings.RenderPriority[] values();
    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;
  }

  public static final deprecated class WebSettings.TextSize extends java.lang.Enum {
    method public static android.webkit.WebSettings.TextSize valueOf(java.lang.String);
    method public static final android.webkit.WebSettings.TextSize[] values();
    enum_constant public static final android.webkit.WebSettings.TextSize LARGER;
    enum_constant public static final android.webkit.WebSettings.TextSize LARGEST;
    enum_constant public static final android.webkit.WebSettings.TextSize NORMAL;
    enum_constant public static final android.webkit.WebSettings.TextSize SMALLER;
    enum_constant public static final android.webkit.WebSettings.TextSize SMALLEST;
  }

  public static final class WebSettings.ZoomDensity extends java.lang.Enum {
    method public static android.webkit.WebSettings.ZoomDensity valueOf(java.lang.String);
    method public static final android.webkit.WebSettings.ZoomDensity[] values();
    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(java.lang.String);
    method public static android.webkit.WebStorage getInstance();
    method public void getOrigins(android.webkit.ValueCallback<java.util.Map>);
    method public void getQuotaForOrigin(java.lang.String, android.webkit.ValueCallback<java.lang.Long>);
    method public void getUsageForOrigin(java.lang.String, android.webkit.ValueCallback<java.lang.Long>);
    method public deprecated void setQuotaForOrigin(java.lang.String, long);
  }

  public static class WebStorage.Origin {
    method public java.lang.String getOrigin();
    method public long getQuota();
    method public long getUsage();
  }

  public static abstract deprecated interface WebStorage.QuotaUpdater {
    method public abstract 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 public deprecated WebView(android.content.Context, android.util.AttributeSet, int, boolean);
    method public void addJavascriptInterface(java.lang.Object, java.lang.String);
    method public boolean canGoBack();
    method public boolean canGoBackOrForward(int);
    method public boolean canGoForward();
    method public deprecated boolean canZoomIn();
    method public deprecated boolean canZoomOut();
    method public deprecated android.graphics.Picture capturePicture();
    method public void clearCache(boolean);
    method public static void clearClientCertPreferences(java.lang.Runnable);
    method public void clearFormData();
    method public void clearHistory();
    method public void clearMatches();
    method public void clearSslPreferences();
    method public deprecated void clearView();
    method public android.webkit.WebBackForwardList copyBackForwardList();
    method public deprecated android.print.PrintDocumentAdapter createPrintDocumentAdapter();
    method public android.print.PrintDocumentAdapter createPrintDocumentAdapter(java.lang.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(java.lang.String, android.webkit.ValueCallback<java.lang.String>);
    method public static deprecated java.lang.String findAddress(java.lang.String);
    method public deprecated int findAll(java.lang.String);
    method public void findAllAsync(java.lang.String);
    method public void findNext(boolean);
    method public void flingScroll(int, int);
    method public deprecated void freeMemory();
    method public android.net.http.SslCertificate getCertificate();
    method public int getContentHeight();
    method public static android.content.pm.PackageInfo getCurrentWebViewPackage();
    method public android.graphics.Bitmap getFavicon();
    method public android.webkit.WebView.HitTestResult getHitTestResult();
    method public deprecated java.lang.String[] getHttpAuthUsernamePassword(java.lang.String, java.lang.String);
    method public java.lang.String getOriginalUrl();
    method public int getProgress();
    method public boolean getRendererPriorityWaivedWhenNotVisible();
    method public int getRendererRequestedPriority();
    method public static android.net.Uri getSafeBrowsingPrivacyPolicyUrl();
    method public deprecated float getScale();
    method public android.webkit.WebSettings getSettings();
    method public android.view.textclassifier.TextClassifier getTextClassifier();
    method public java.lang.String getTitle();
    method public java.lang.String getUrl();
    method public android.webkit.WebChromeClient getWebChromeClient();
    method public static java.lang.ClassLoader getWebViewClassLoader();
    method public android.webkit.WebViewClient getWebViewClient();
    method 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(java.lang.String, java.lang.String, java.lang.String);
    method public void loadDataWithBaseURL(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public void loadUrl(java.lang.String, java.util.Map<java.lang.String, java.lang.String>);
    method public void loadUrl(java.lang.String);
    method public deprecated void onChildViewAdded(android.view.View, android.view.View);
    method public deprecated void onChildViewRemoved(android.view.View, android.view.View);
    method public deprecated void onGlobalFocusChanged(android.view.View, android.view.View);
    method public void onPause();
    method public void onResume();
    method public deprecated boolean overlayHorizontalScrollbar();
    method public deprecated boolean overlayVerticalScrollbar();
    method public boolean pageDown(boolean);
    method public boolean pageUp(boolean);
    method public void pauseTimers();
    method public void postUrl(java.lang.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(java.lang.String);
    method public void requestFocusNodeHref(android.os.Message);
    method public void requestImageRef(android.os.Message);
    method public android.webkit.WebBackForwardList restoreState(android.os.Bundle);
    method public void resumeTimers();
    method public deprecated void savePassword(java.lang.String, java.lang.String, java.lang.String);
    method public android.webkit.WebBackForwardList saveState(android.os.Bundle);
    method public void saveWebArchive(java.lang.String);
    method public void saveWebArchive(java.lang.String, boolean, android.webkit.ValueCallback<java.lang.String>);
    method public deprecated void setCertificate(android.net.http.SslCertificate);
    method public static void setDataDirectorySuffix(java.lang.String);
    method public void setDownloadListener(android.webkit.DownloadListener);
    method public void setFindListener(android.webkit.WebView.FindListener);
    method public deprecated void setHorizontalScrollbarOverlay(boolean);
    method public deprecated void setHttpAuthUsernamePassword(java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public void setInitialScale(int);
    method public deprecated void setMapTrackballToArrowKeys(boolean);
    method public void setNetworkAvailable(boolean);
    method public deprecated void setPictureListener(android.webkit.WebView.PictureListener);
    method public void setRendererPriorityPolicy(int, boolean);
    method public static void setSafeBrowsingWhitelist(java.util.List<java.lang.String>, android.webkit.ValueCallback<java.lang.Boolean>);
    method public void setTextClassifier(android.view.textclassifier.TextClassifier);
    method public deprecated void setVerticalScrollbarOverlay(boolean);
    method public void setWebChromeClient(android.webkit.WebChromeClient);
    method public static void setWebContentsDebuggingEnabled(boolean);
    method public void setWebViewClient(android.webkit.WebViewClient);
    method public deprecated boolean shouldDelayChildPressedState();
    method public deprecated boolean showFindDialog(java.lang.String, boolean);
    method public static void startSafeBrowsing(android.content.Context, 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 java.lang.String SCHEME_GEO = "geo:0,0?q=";
    field public static final java.lang.String SCHEME_MAILTO = "mailto:";
    field public static final java.lang.String SCHEME_TEL = "tel:";
  }

  public static abstract interface WebView.FindListener {
    method public abstract void onFindResultReceived(int, int, boolean);
  }

  public static class WebView.HitTestResult {
    method public java.lang.String getExtra();
    method public int getType();
    field public static final deprecated 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 public static final deprecated 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
  }

  public static abstract deprecated interface WebView.PictureListener {
    method public abstract deprecated void onNewPicture(android.webkit.WebView, android.graphics.Picture);
  }

  public static abstract class WebView.VisualStateCallback {
    ctor public WebView.VisualStateCallback();
    method public abstract void onComplete(long);
  }

  public class WebView.WebViewTransport {
    ctor public WebView.WebViewTransport();
    method public synchronized android.webkit.WebView getWebView();
    method public synchronized void setWebView(android.webkit.WebView);
  }

  public class WebViewClient {
    ctor public WebViewClient();
    method public void doUpdateVisitedHistory(android.webkit.WebView, java.lang.String, boolean);
    method public void onFormResubmission(android.webkit.WebView, android.os.Message, android.os.Message);
    method public void onLoadResource(android.webkit.WebView, java.lang.String);
    method public void onPageCommitVisible(android.webkit.WebView, java.lang.String);
    method public void onPageFinished(android.webkit.WebView, java.lang.String);
    method public void onPageStarted(android.webkit.WebView, java.lang.String, android.graphics.Bitmap);
    method public void onReceivedClientCertRequest(android.webkit.WebView, android.webkit.ClientCertRequest);
    method public deprecated void onReceivedError(android.webkit.WebView, int, java.lang.String, java.lang.String);
    method public void onReceivedError(android.webkit.WebView, android.webkit.WebResourceRequest, android.webkit.WebResourceError);
    method public void onReceivedHttpAuthRequest(android.webkit.WebView, android.webkit.HttpAuthHandler, java.lang.String, java.lang.String);
    method public void onReceivedHttpError(android.webkit.WebView, android.webkit.WebResourceRequest, android.webkit.WebResourceResponse);
    method public void onReceivedLoginRequest(android.webkit.WebView, java.lang.String, java.lang.String, java.lang.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 public deprecated void onTooManyRedirects(android.webkit.WebView, android.os.Message, android.os.Message);
    method public void onUnhandledKeyEvent(android.webkit.WebView, android.view.KeyEvent);
    method public deprecated android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebView, java.lang.String);
    method public android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebView, android.webkit.WebResourceRequest);
    method public boolean shouldOverrideKeyEvent(android.webkit.WebView, android.view.KeyEvent);
    method public deprecated boolean shouldOverrideUrlLoading(android.webkit.WebView, java.lang.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 public abstract deprecated void clearFormData();
    method public abstract void clearHttpAuthUsernamePassword();
    method public abstract deprecated void clearUsernamePassword();
    method public abstract java.lang.String[] getHttpAuthUsernamePassword(java.lang.String, java.lang.String);
    method public static android.webkit.WebViewDatabase getInstance(android.content.Context);
    method public abstract deprecated boolean hasFormData();
    method public abstract boolean hasHttpAuthUsernamePassword();
    method public abstract deprecated boolean hasUsernamePassword();
    method public abstract void setHttpAuthUsernamePassword(java.lang.String, java.lang.String, java.lang.String, java.lang.String);
  }

  public deprecated class WebViewFragment extends android.app.Fragment {
    ctor public WebViewFragment();
    method public android.webkit.WebView getWebView();
  }

}

package android.widget {

  public abstract class AbsListView extends android.widget.AdapterView 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(java.lang.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 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 public android.view.View getSelectedView();
    method public android.graphics.drawable.Drawable getSelector();
    method public java.lang.CharSequence getTextFilter();
    method public int getTranscriptMode();
    method protected void handleDataChanged();
    method public boolean hasTextFilter();
    method public void invalidateViews();
    method public boolean isFastScrollAlwaysVisible();
    method public boolean isFastScrollEnabled();
    method protected boolean isInFilterMode();
    method public boolean isItemChecked(int);
    method public boolean isScrollingCacheEnabled();
    method public boolean isSmoothScrollbarEnabled();
    method public boolean isStackFromBottom();
    method 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(java.lang.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(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(java.lang.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(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(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 abstract interface AbsListView.MultiChoiceModeListener implements android.view.ActionMode.Callback {
    method public abstract void onItemCheckedStateChanged(android.view.ActionMode, int, long, boolean);
  }

  public static abstract interface AbsListView.OnScrollListener {
    method public abstract void onScroll(android.widget.AbsListView, int, int, int);
    method public abstract 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 abstract interface AbsListView.RecyclerListener {
    method public abstract void onMovedToScrapHeap(android.view.View);
  }

  public static abstract interface AbsListView.SelectionBoundsAdjuster {
    method public abstract 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 public android.content.res.ColorStateList getThumbTintList();
    method public android.graphics.PorterDuff.Mode getThumbTintMode();
    method public android.graphics.drawable.Drawable getTickMark();
    method public android.content.res.ColorStateList getTickMarkTintList();
    method 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(android.content.res.ColorStateList);
    method public void setThumbTintMode(android.graphics.PorterDuff.Mode);
    method public void setTickMark(android.graphics.drawable.Drawable);
    method public void setTickMarkTintList(android.content.res.ColorStateList);
    method public void setTickMarkTintMode(android.graphics.PorterDuff.Mode);
  }

  public abstract class AbsSpinner extends android.widget.AdapterView {
    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);
  }

  public deprecated class AbsoluteLayout extends android.view.ViewGroup {
    ctor public AbsoluteLayout(android.content.Context);
    ctor public AbsoluteLayout(android.content.Context, android.util.AttributeSet);
    ctor public AbsoluteLayout(android.content.Context, android.util.AttributeSet, int);
    ctor public AbsoluteLayout(android.content.Context, android.util.AttributeSet, int, int);
  }

  public static class AbsoluteLayout.LayoutParams extends android.view.ViewGroup.LayoutParams {
    ctor public AbsoluteLayout.LayoutParams(int, int, int, int);
    ctor public AbsoluteLayout.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public AbsoluteLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
    method public java.lang.String debug(java.lang.String);
    field public int x;
    field 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 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(android.graphics.drawable.Drawable);
    method public void setPopupTheme(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 abstract interface ActionMenuView.OnMenuItemClickListener {
    method public abstract boolean onMenuItemClick(android.view.MenuItem);
  }

  public abstract interface Adapter {
    method public default java.lang.CharSequence[] getAutofillOptions();
    method public abstract int getCount();
    method public abstract java.lang.Object getItem(int);
    method public abstract long getItemId(int);
    method public abstract int getItemViewType(int);
    method public abstract android.view.View getView(int, android.view.View, android.view.ViewGroup);
    method public abstract int getViewTypeCount();
    method public abstract boolean hasStableIds();
    method public abstract boolean isEmpty();
    method public abstract void registerDataSetObserver(android.database.DataSetObserver);
    method public abstract 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 public int getCount();
    method public android.view.View getEmptyView();
    method public int getFirstVisiblePosition();
    method public java.lang.Object getItemAtPosition(int);
    method public long getItemIdAtPosition(int);
    method public int getLastVisiblePosition();
    method public final android.widget.AdapterView.OnItemClickListener getOnItemClickListener();
    method public final android.widget.AdapterView.OnItemLongClickListener getOnItemLongClickListener();
    method public final android.widget.AdapterView.OnItemSelectedListener getOnItemSelectedListener();
    method public int getPositionForView(android.view.View);
    method public java.lang.Object getSelectedItem();
    method public long getSelectedItemId();
    method 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(android.widget.AdapterView.OnItemClickListener);
    method public void setOnItemLongClickListener(android.widget.AdapterView.OnItemLongClickListener);
    method public void setOnItemSelectedListener(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 abstract interface AdapterView.OnItemClickListener {
    method public abstract void onItemClick(android.widget.AdapterView<?>, android.view.View, int, long);
  }

  public static abstract interface AdapterView.OnItemLongClickListener {
    method public abstract boolean onItemLongClick(android.widget.AdapterView<?>, android.view.View, int, long);
  }

  public static abstract interface AdapterView.OnItemSelectedListener {
    method public abstract void onItemSelected(android.widget.AdapterView<?>, android.view.View, int, long);
    method public abstract void onNothingSelected(android.widget.AdapterView<?>);
  }

  public abstract class AdapterViewAnimator extends android.widget.AdapterView 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();
  }

  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 abstract interface Advanceable {
    method public abstract void advance();
    method public abstract void fyiWillBeAdvancedByHostKThx();
  }

  public class AlphabetIndexer extends android.database.DataSetObserver implements android.widget.SectionIndexer {
    ctor public AlphabetIndexer(android.database.Cursor, int, java.lang.CharSequence);
    method protected int compare(java.lang.String, java.lang.String);
    method public int getPositionForSection(int);
    method public int getSectionForPosition(int);
    method public java.lang.Object[] getSections();
    method public void setCursor(android.database.Cursor);
    field protected java.lang.CharSequence mAlphabet;
    field protected int mColumnIndex;
    field protected android.database.Cursor mDataCursor;
  }

  public deprecated class AnalogClock extends android.view.View {
    ctor public AnalogClock(android.content.Context);
    ctor public AnalogClock(android.content.Context, android.util.AttributeSet);
    ctor public AnalogClock(android.content.Context, android.util.AttributeSet, int);
    ctor 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(android.content.Context, int);
    ctor public ArrayAdapter(android.content.Context, int, int);
    ctor public ArrayAdapter(android.content.Context, int, T[]);
    ctor public ArrayAdapter(android.content.Context, int, int, T[]);
    ctor public ArrayAdapter(android.content.Context, int, java.util.List<T>);
    ctor public ArrayAdapter(android.content.Context, int, int, java.util.List<T>);
    method public void add(T);
    method public void addAll(java.util.Collection<? extends T>);
    method public void addAll(T...);
    method public void clear();
    method public static android.widget.ArrayAdapter<java.lang.CharSequence> createFromResource(android.content.Context, int, int);
    method public android.content.Context getContext();
    method public int getCount();
    method public android.content.res.Resources.Theme getDropDownViewTheme();
    method public android.widget.Filter getFilter();
    method public T getItem(int);
    method public long getItemId(int);
    method public int getPosition(T);
    method public android.view.View getView(int, android.view.View, android.view.ViewGroup);
    method public void insert(T, int);
    method public void remove(T);
    method public void setDropDownViewResource(int);
    method public void setDropDownViewTheme(android.content.res.Resources.Theme);
    method public void setNotifyOnChange(boolean);
    method public void sort(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 java.lang.CharSequence convertSelectionToString(java.lang.Object);
    method public void dismissDropDown();
    method public boolean enoughToFilter();
    method public android.widget.ListAdapter getAdapter();
    method public java.lang.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 public deprecated android.widget.AdapterView.OnItemClickListener getItemClickListener();
    method public deprecated 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(java.lang.CharSequence, int);
    method public void performValidation();
    method protected void replaceText(java.lang.CharSequence);
    method public <T extends android.widget.ListAdapter & android.widget.Filterable> void setAdapter(T);
    method public void setCompletionHint(java.lang.CharSequence);
    method public void setDropDownAnchor(int);
    method public void setDropDownBackgroundDrawable(android.graphics.drawable.Drawable);
    method public void setDropDownBackgroundResource(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(java.lang.CharSequence, boolean);
    method public void setThreshold(int);
    method public void setValidator(android.widget.AutoCompleteTextView.Validator);
    method public void showDropDown();
  }

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

  public static abstract interface AutoCompleteTextView.Validator {
    method public abstract java.lang.CharSequence fixText(java.lang.CharSequence);
    method public abstract boolean isValid(java.lang.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(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);
  }

  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(android.content.Context);
    ctor public CalendarView(android.content.Context, android.util.AttributeSet);
    ctor public CalendarView(android.content.Context, android.util.AttributeSet, int);
    ctor public CalendarView(android.content.Context, android.util.AttributeSet, int, int);
    method public long getDate();
    method public int getDateTextAppearance();
    method public int getFirstDayOfWeek();
    method public deprecated int getFocusedMonthDateColor();
    method public long getMaxDate();
    method public long getMinDate();
    method public deprecated android.graphics.drawable.Drawable getSelectedDateVerticalBar();
    method public deprecated int getSelectedWeekBackgroundColor();
    method public deprecated boolean getShowWeekNumber();
    method public deprecated int getShownWeekCount();
    method public deprecated int getUnfocusedMonthDateColor();
    method public int getWeekDayTextAppearance();
    method public deprecated int getWeekNumberColor();
    method public deprecated int getWeekSeparatorLineColor();
    method public void setDate(long);
    method public void setDate(long, boolean, boolean);
    method public void setDateTextAppearance(int);
    method public void setFirstDayOfWeek(int);
    method public deprecated void setFocusedMonthDateColor(int);
    method public void setMaxDate(long);
    method public void setMinDate(long);
    method public void setOnDateChangeListener(android.widget.CalendarView.OnDateChangeListener);
    method public deprecated void setSelectedDateVerticalBar(int);
    method public deprecated void setSelectedDateVerticalBar(android.graphics.drawable.Drawable);
    method public deprecated void setSelectedWeekBackgroundColor(int);
    method public deprecated void setShowWeekNumber(boolean);
    method public deprecated void setShownWeekCount(int);
    method public deprecated void setUnfocusedMonthDateColor(int);
    method public void setWeekDayTextAppearance(int);
    method public deprecated void setWeekNumberColor(int);
    method public deprecated void setWeekSeparatorLineColor(int);
  }

  public static abstract interface CalendarView.OnDateChangeListener {
    method public abstract void onSelectedDayChange(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 abstract interface Checkable {
    method public abstract boolean isChecked();
    method public abstract void setChecked(boolean);
    method public abstract 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 public android.content.res.ColorStateList getCheckMarkTintList();
    method public android.graphics.PorterDuff.Mode getCheckMarkTintMode();
    method public boolean isChecked();
    method public void setCheckMarkDrawable(int);
    method public void setCheckMarkDrawable(android.graphics.drawable.Drawable);
    method public void setCheckMarkTintList(android.content.res.ColorStateList);
    method public void setCheckMarkTintMode(android.graphics.PorterDuff.Mode);
    method public void setChecked(boolean);
    method public void toggle();
  }

  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 java.lang.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(java.lang.String);
    method public void setOnChronometerTickListener(android.widget.Chronometer.OnChronometerTickListener);
    method public void start();
    method public void stop();
  }

  public static abstract interface Chronometer.OnChronometerTickListener {
    method public abstract 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 public android.graphics.drawable.Drawable getButtonDrawable();
    method public android.content.res.ColorStateList getButtonTintList();
    method public android.graphics.PorterDuff.Mode getButtonTintMode();
    method public boolean isChecked();
    method public void setButtonDrawable(int);
    method public void setButtonDrawable(android.graphics.drawable.Drawable);
    method public void setButtonTintList(android.content.res.ColorStateList);
    method public void setButtonTintMode(android.graphics.PorterDuff.Mode);
    method public void setChecked(boolean);
    method public void setOnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener);
    method public void toggle();
  }

  public static abstract interface CompoundButton.OnCheckedChangeListener {
    method public abstract void onCheckedChanged(android.widget.CompoundButton, boolean);
  }

  public abstract class CursorAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.ThemedSpinnerAdapter {
    ctor public deprecated 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 java.lang.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 java.lang.Object getItem(int);
    method public long getItemId(int);
    method public android.view.View getView(int, android.view.View, android.view.ViewGroup);
    method protected deprecated 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 public android.database.Cursor runQueryOnBackgroundThread(java.lang.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 public static final deprecated 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 java.lang.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(java.lang.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 public deprecated android.widget.CalendarView getCalendarView();
    method public deprecated boolean getCalendarViewShown();
    method public int getDayOfMonth();
    method public int getFirstDayOfWeek();
    method public long getMaxDate();
    method public long getMinDate();
    method public int getMonth();
    method public deprecated boolean getSpinnersShown();
    method public int getYear();
    method public void init(int, int, int, android.widget.DatePicker.OnDateChangedListener);
    method public deprecated 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 public deprecated void setSpinnersShown(boolean);
    method public void updateDate(int, int, int);
  }

  public static abstract interface DatePicker.OnDateChangedListener {
    method public abstract void onDateChanged(android.widget.DatePicker, int, int, int);
  }

  public deprecated class DialerFilter extends android.widget.RelativeLayout {
    ctor public DialerFilter(android.content.Context);
    ctor public DialerFilter(android.content.Context, android.util.AttributeSet);
    method public void append(java.lang.String);
    method public void clearText();
    method public java.lang.CharSequence getDigits();
    method public java.lang.CharSequence getFilterText();
    method public java.lang.CharSequence getLetters();
    method public int getMode();
    method public boolean isQwertyKeyboard();
    method protected void onModeChange(int, int);
    method public void removeFilterWatcher(android.text.TextWatcher);
    method public void setDigitsWatcher(android.text.TextWatcher);
    method public void setFilterWatcher(android.text.TextWatcher);
    method public void setLettersWatcher(android.text.TextWatcher);
    method public void setMode(int);
    field public static final int DIGITS_AND_LETTERS = 1; // 0x1
    field public static final int DIGITS_AND_LETTERS_NO_DIGITS = 2; // 0x2
    field public static final int DIGITS_AND_LETTERS_NO_LETTERS = 3; // 0x3
    field public static final int DIGITS_ONLY = 4; // 0x4
    field public static final int LETTERS_ONLY = 5; // 0x5
  }

  public deprecated class DigitalClock extends android.widget.TextView {
    ctor public DigitalClock(android.content.Context);
    ctor 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 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(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 abstract interface ExpandableListAdapter {
    method public abstract boolean areAllItemsEnabled();
    method public abstract java.lang.Object getChild(int, int);
    method public abstract long getChildId(int, int);
    method public abstract android.view.View getChildView(int, int, boolean, android.view.View, android.view.ViewGroup);
    method public abstract int getChildrenCount(int);
    method public abstract long getCombinedChildId(long, long);
    method public abstract long getCombinedGroupId(long);
    method public abstract java.lang.Object getGroup(int);
    method public abstract int getGroupCount();
    method public abstract long getGroupId(int);
    method public abstract android.view.View getGroupView(int, boolean, android.view.View, android.view.ViewGroup);
    method public abstract boolean hasStableIds();
    method public abstract boolean isChildSelectable(int, int);
    method public abstract boolean isEmpty();
    method public abstract void onGroupCollapsed(int);
    method public abstract void onGroupExpanded(int);
    method public abstract void registerDataSetObserver(android.database.DataSetObserver);
    method public abstract 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 abstract interface ExpandableListView.OnChildClickListener {
    method public abstract boolean onChildClick(android.widget.ExpandableListView, android.view.View, int, int, long);
  }

  public static abstract interface ExpandableListView.OnGroupClickListener {
    method public abstract boolean onGroupClick(android.widget.ExpandableListView, android.view.View, int, long);
  }

  public static abstract interface ExpandableListView.OnGroupCollapseListener {
    method public abstract void onGroupCollapse(int);
  }

  public static abstract interface ExpandableListView.OnGroupExpandListener {
    method public abstract void onGroupExpand(int);
  }

  public abstract class Filter {
    ctor public Filter();
    method public java.lang.CharSequence convertResultToString(java.lang.Object);
    method public final void filter(java.lang.CharSequence);
    method public final void filter(java.lang.CharSequence, android.widget.Filter.FilterListener);
    method protected abstract android.widget.Filter.FilterResults performFiltering(java.lang.CharSequence);
    method protected abstract void publishResults(java.lang.CharSequence, android.widget.Filter.FilterResults);
  }

  public static abstract interface Filter.FilterListener {
    method public abstract void onFilterComplete(int);
  }

  protected static class Filter.FilterResults {
    ctor public Filter.FilterResults();
    field public int count;
    field public java.lang.Object values;
  }

  public abstract interface FilterQueryProvider {
    method public abstract android.database.Cursor runQuery(java.lang.CharSequence);
  }

  public abstract interface Filterable {
    method public abstract android.widget.Filter getFilter();
  }

  public class FrameLayout extends android.view.ViewGroup {
    ctor public FrameLayout(android.content.Context);
    ctor public FrameLayout(android.content.Context, android.util.AttributeSet);
    ctor public FrameLayout(android.content.Context, android.util.AttributeSet, int);
    ctor public FrameLayout(android.content.Context, android.util.AttributeSet, int, int);
    method protected android.widget.FrameLayout.LayoutParams generateDefaultLayoutParams();
    method public android.widget.FrameLayout.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method public deprecated 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(android.content.Context, android.util.AttributeSet);
    ctor public FrameLayout.LayoutParams(int, int);
    ctor public FrameLayout.LayoutParams(int, int, int);
    ctor public FrameLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
    ctor public FrameLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
    ctor public FrameLayout.LayoutParams(android.widget.FrameLayout.LayoutParams);
    field public static final int UNSPECIFIED_GRAVITY = -1; // 0xffffffff
    field public int gravity;
  }

  public deprecated class Gallery extends android.widget.AbsSpinner implements android.view.GestureDetector.OnGestureListener {
    ctor public Gallery(android.content.Context);
    ctor public Gallery(android.content.Context, android.util.AttributeSet);
    ctor public Gallery(android.content.Context, android.util.AttributeSet, int);
    ctor public Gallery(android.content.Context, android.util.AttributeSet, int, int);
    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);
    method public void setAnimationDuration(int);
    method public void setCallbackDuringFling(boolean);
    method public void setGravity(int);
    method public void setSpacing(int);
    method public void setUnselectedAlpha(float);
  }

  public static class Gallery.LayoutParams extends android.view.ViewGroup.LayoutParams {
    ctor public Gallery.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public Gallery.LayoutParams(int, int);
    ctor public Gallery.LayoutParams(android.view.ViewGroup.LayoutParams);
  }

  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 static abstract 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 {
  }

  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 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 java.lang.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 abstract interface HeterogeneousExpandableList {
    method public abstract int getChildType(int, int);
    method public abstract int getChildTypeCount();
    method public abstract int getGroupType(int);
    method public abstract 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);
  }

  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(int);
    method public void setImageURI(android.net.Uri);
  }

  public class ImageView extends android.view.View {
    ctor public ImageView(android.content.Context);
    ctor public ImageView(android.content.Context, android.util.AttributeSet);
    ctor public ImageView(android.content.Context, android.util.AttributeSet, int);
    ctor public ImageView(android.content.Context, 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 public android.content.res.ColorStateList getImageTintList();
    method 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 public deprecated 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(android.graphics.drawable.Drawable);
    method public void setImageIcon(android.graphics.drawable.Icon);
    method public void setImageLevel(int);
    method public void setImageMatrix(android.graphics.Matrix);
    method public void setImageResource(int);
    method public void setImageState(int[], boolean);
    method public void setImageTintList(android.content.res.ColorStateList);
    method public void setImageTintMode(android.graphics.PorterDuff.Mode);
    method public void setImageURI(android.net.Uri);
    method public void setMaxHeight(int);
    method public void setMaxWidth(int);
    method public void setScaleType(android.widget.ImageView.ScaleType);
  }

  public static final class ImageView.ScaleType extends java.lang.Enum {
    method public static android.widget.ImageView.ScaleType valueOf(java.lang.String);
    method public static final android.widget.ImageView.ScaleType[] values();
    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;
  }

  public class LinearLayout extends android.view.ViewGroup {
    ctor public LinearLayout(android.content.Context);
    ctor public LinearLayout(android.content.Context, android.util.AttributeSet);
    ctor public LinearLayout(android.content.Context, 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 java.lang.String debug(java.lang.String);
    field public int gravity;
    field public float weight;
  }

  public abstract interface ListAdapter implements android.widget.Adapter {
    method public abstract boolean areAllItemsEnabled();
    method public abstract boolean isEnabled(int);
  }

  public class ListPopupWindow {
    ctor public ListPopupWindow(android.content.Context);
    ctor public ListPopupWindow(android.content.Context, android.util.AttributeSet);
    ctor public ListPopupWindow(android.content.Context, android.util.AttributeSet, int);
    ctor public ListPopupWindow(android.content.Context, android.util.AttributeSet, int, int);
    method public void clearListSelection();
    method public android.view.View.OnTouchListener createDragToOpenListener(android.view.View);
    method public void dismiss();
    method public android.view.View getAnchorView();
    method public int getAnimationStyle();
    method public android.graphics.drawable.Drawable getBackground();
    method public int getHeight();
    method public int getHorizontalOffset();
    method public int getInputMethodMode();
    method public android.widget.ListView getListView();
    method public int getPromptPosition();
    method public java.lang.Object getSelectedItem();
    method public long getSelectedItemId();
    method public int getSelectedItemPosition();
    method 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, android.view.KeyEvent);
    method public boolean onKeyPreIme(int, android.view.KeyEvent);
    method public boolean onKeyUp(int, android.view.KeyEvent);
    method public boolean performItemClick(int);
    method public void postShow();
    method public void setAdapter(android.widget.ListAdapter);
    method public void setAnchorView(android.view.View);
    method public void setAnimationStyle(int);
    method public void setBackgroundDrawable(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(android.widget.PopupWindow.OnDismissListener);
    method public void setOnItemClickListener(android.widget.AdapterView.OnItemClickListener);
    method public void setOnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener);
    method public void setPromptPosition(int);
    method public void setPromptView(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
  }

  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, java.lang.Object, boolean);
    method public void addFooterView(android.view.View);
    method public void addHeaderView(android.view.View, java.lang.Object, boolean);
    method public void addHeaderView(android.view.View);
    method public boolean areFooterDividersEnabled();
    method public boolean areHeaderDividersEnabled();
    method public android.widget.ListAdapter getAdapter();
    method public deprecated long[] getCheckItemIds();
    method 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(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 java.lang.Object data;
    field public boolean isSelectable;
    field public android.view.View view;
  }

  public final class Magnifier {
    ctor public Magnifier(android.view.View);
    method public void dismiss();
    method public int getHeight();
    method public int getWidth();
    method public float getZoom();
    method public void show(float, 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 abstract interface MediaController.MediaPlayerControl {
    method public abstract boolean canPause();
    method public abstract boolean canSeekBackward();
    method public abstract boolean canSeekForward();
    method public abstract int getAudioSessionId();
    method public abstract int getBufferPercentage();
    method public abstract int getCurrentPosition();
    method public abstract int getDuration();
    method public abstract boolean isPlaying();
    method public abstract void pause();
    method public abstract void seekTo(int);
    method public abstract 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(java.lang.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(java.lang.CharSequence, int);
    method public int findTokenStart(java.lang.CharSequence, int);
    method public java.lang.CharSequence terminateToken(java.lang.CharSequence);
  }

  public static abstract interface MultiAutoCompleteTextView.Tokenizer {
    method public abstract int findTokenEnd(java.lang.CharSequence, int);
    method public abstract int findTokenStart(java.lang.CharSequence, int);
    method public abstract java.lang.CharSequence terminateToken(java.lang.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 java.lang.String[] getDisplayedValues();
    method public int getMaxValue();
    method public int getMinValue();
    method public int getValue();
    method public boolean getWrapSelectorWheel();
    method public void setDisplayedValues(java.lang.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 abstract interface NumberPicker.Formatter {
    method public abstract java.lang.String format(int);
  }

  public static abstract interface NumberPicker.OnScrollListener {
    method public abstract 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 abstract interface NumberPicker.OnValueChangeListener {
    method public abstract 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 public deprecated OverScroller(android.content.Context, android.view.animation.Interpolator, float, float);
    ctor public deprecated 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(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 abstract interface PopupMenu.OnDismissListener {
    method public abstract void onDismiss(android.widget.PopupMenu);
  }

  public static abstract interface PopupMenu.OnMenuItemClickListener {
    method public abstract 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 public android.transition.Transition getEnterTransition();
    method public android.transition.Transition getExitTransition();
    method public int getHeight();
    method public int getInputMethodMode();
    method public int getMaxAvailableHeight(android.view.View);
    method public int getMaxAvailableHeight(android.view.View, int);
    method public int getMaxAvailableHeight(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(android.transition.Transition);
    method public void setExitTransition(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 public deprecated 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 abstract interface PopupWindow.OnDismissListener {
    method public abstract void onDismiss();
  }

  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 public android.content.res.ColorStateList getIndeterminateTintList();
    method public android.graphics.PorterDuff.Mode getIndeterminateTintMode();
    method public android.view.animation.Interpolator getInterpolator();
    method public synchronized int getMax();
    method public synchronized int getMin();
    method public synchronized int getProgress();
    method public android.content.res.ColorStateList getProgressBackgroundTintList();
    method public android.graphics.PorterDuff.Mode getProgressBackgroundTintMode();
    method public android.graphics.drawable.Drawable getProgressDrawable();
    method public android.content.res.ColorStateList getProgressTintList();
    method public android.graphics.PorterDuff.Mode getProgressTintMode();
    method public synchronized int getSecondaryProgress();
    method public android.content.res.ColorStateList getSecondaryProgressTintList();
    method public android.graphics.PorterDuff.Mode getSecondaryProgressTintMode();
    method public final synchronized void incrementProgressBy(int);
    method public final synchronized void incrementSecondaryProgressBy(int);
    method public boolean isAnimating();
    method public synchronized boolean isIndeterminate();
    method protected synchronized void onDraw(android.graphics.Canvas);
    method protected synchronized void onMeasure(int, int);
    method public void onRestoreInstanceState(android.os.Parcelable);
    method public android.os.Parcelable onSaveInstanceState();
    method public synchronized void setIndeterminate(boolean);
    method public void setIndeterminateDrawable(android.graphics.drawable.Drawable);
    method public void setIndeterminateDrawableTiled(android.graphics.drawable.Drawable);
    method public void setIndeterminateTintList(android.content.res.ColorStateList);
    method public void setIndeterminateTintMode(android.graphics.PorterDuff.Mode);
    method public void setInterpolator(android.content.Context, int);
    method public void setInterpolator(android.view.animation.Interpolator);
    method public synchronized void setMax(int);
    method public synchronized void setMin(int);
    method public synchronized void setProgress(int);
    method public void setProgress(int, boolean);
    method public void setProgressBackgroundTintList(android.content.res.ColorStateList);
    method public void setProgressBackgroundTintMode(android.graphics.PorterDuff.Mode);
    method public void setProgressDrawable(android.graphics.drawable.Drawable);
    method public void setProgressDrawableTiled(android.graphics.drawable.Drawable);
    method public void setProgressTintList(android.content.res.ColorStateList);
    method public void setProgressTintMode(android.graphics.PorterDuff.Mode);
    method public synchronized void setSecondaryProgress(int);
    method public void setSecondaryProgressTintList(android.content.res.ColorStateList);
    method public void setSecondaryProgressTintMode(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(java.lang.String, boolean);
    method public void assignContactFromEmail(java.lang.String, boolean, android.os.Bundle);
    method public void assignContactFromPhone(java.lang.String, boolean);
    method public void assignContactFromPhone(java.lang.String, boolean, android.os.Bundle);
    method public void assignContactUri(android.net.Uri);
    method public void onClick(android.view.View);
    method public void setExcludeMimes(java.lang.String[]);
    method public void setImageToDefault();
    method public void setMode(int);
    method public void setOverlay(android.graphics.drawable.Drawable);
    method public void setPrioritizedMimeType(java.lang.String);
    field protected java.lang.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(int);
    method public void clearCheck();
    method public android.widget.RadioGroup.LayoutParams generateLayoutParams(android.util.AttributeSet);
    method 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 abstract interface RadioGroup.OnCheckedChangeListener {
    method public abstract void onCheckedChanged(android.widget.RadioGroup, 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 abstract interface RatingBar.OnRatingBarChangeListener {
    method public abstract void onRatingChanged(android.widget.RatingBar, float, boolean);
  }

  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 java.lang.String debug(java.lang.String);
    method public int getRule(int);
    method public int[] getRules();
    method public void removeRule(int);
    field public boolean alignWithParent;
  }

  public class RemoteViews implements android.view.LayoutInflater.Filter android.os.Parcelable {
    ctor public RemoteViews(java.lang.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 public deprecated android.widget.RemoteViews clone();
    method public int describeContents();
    method public int getLayoutId();
    method public java.lang.String getPackage();
    method public boolean onLoadClass(java.lang.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, java.lang.String, android.graphics.Bitmap);
    method public void setBoolean(int, java.lang.String, boolean);
    method public void setBundle(int, java.lang.String, android.os.Bundle);
    method public void setByte(int, java.lang.String, byte);
    method public void setChar(int, java.lang.String, char);
    method public void setCharSequence(int, java.lang.String, java.lang.CharSequence);
    method public void setChronometer(int, long, java.lang.String, boolean);
    method public void setChronometerCountDown(int, boolean);
    method public void setContentDescription(int, java.lang.CharSequence);
    method public void setDisplayedChild(int, int);
    method public void setDouble(int, java.lang.String, double);
    method public void setEmptyView(int, int);
    method public void setFloat(int, java.lang.String, float);
    method public void setIcon(int, java.lang.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, java.lang.String, int);
    method public void setIntent(int, java.lang.String, android.content.Intent);
    method public void setLabelFor(int, int);
    method public void setLong(int, java.lang.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 public deprecated 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, java.lang.String, short);
    method public void setString(int, java.lang.String, java.lang.String);
    method public void setTextColor(int, int);
    method public void setTextViewCompoundDrawables(int, int, int, int, int);
    method public void setTextViewCompoundDrawablesRelative(int, int, int, int, int);
    method public void setTextViewText(int, java.lang.CharSequence);
    method public void setTextViewTextSize(int, int, float);
    method public void setUri(int, java.lang.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(java.lang.Exception);
    ctor public RemoteViews.ActionException(java.lang.String);
  }

  public static abstract class RemoteViews.RemoteView implements java.lang.annotation.Annotation {
  }

  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 abstract interface RemoteViewsService.RemoteViewsFactory {
    method public abstract int getCount();
    method public abstract long getItemId(int);
    method public abstract android.widget.RemoteViews getLoadingView();
    method public abstract android.widget.RemoteViews getViewAt(int);
    method public abstract int getViewTypeCount();
    method public abstract boolean hasStableIds();
    method public abstract void onCreate();
    method public abstract void onDataSetChanged();
    method public abstract void onDestroy();
  }

  public abstract class ResourceCursorAdapter extends android.widget.CursorAdapter {
    ctor public deprecated 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 java.lang.CharSequence getQuery();
    method public java.lang.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(java.lang.CharSequence, boolean);
    method public void setQueryHint(java.lang.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 abstract interface SearchView.OnCloseListener {
    method public abstract boolean onClose();
  }

  public static abstract interface SearchView.OnQueryTextListener {
    method public abstract boolean onQueryTextChange(java.lang.String);
    method public abstract boolean onQueryTextSubmit(java.lang.String);
  }

  public static abstract interface SearchView.OnSuggestionListener {
    method public abstract boolean onSuggestionClick(int);
    method public abstract boolean onSuggestionSelect(int);
  }

  public abstract interface SectionIndexer {
    method public abstract int getPositionForSection(int);
    method public abstract int getSectionForPosition(int);
    method public abstract java.lang.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 abstract interface SeekBar.OnSeekBarChangeListener {
    method public abstract void onProgressChanged(android.widget.SeekBar, int, boolean);
    method public abstract void onStartTrackingTouch(android.widget.SeekBar);
    method public abstract 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(java.lang.String);
    method public void setShareIntent(android.content.Intent);
    field public static final java.lang.String DEFAULT_SHARE_HISTORY_FILE_NAME = "share_history.xml";
  }

  public static abstract interface ShareActionProvider.OnShareTargetSelectedListener {
    method public abstract 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, ?>>, int, java.lang.String[], int[]);
    method public int getCount();
    method public android.content.res.Resources.Theme getDropDownViewTheme();
    method public android.widget.Filter getFilter();
    method public java.lang.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, java.lang.String);
    method public void setViewText(android.widget.TextView, java.lang.String);
  }

  public static abstract interface SimpleAdapter.ViewBinder {
    method public abstract boolean setViewValue(android.view.View, java.lang.Object, java.lang.String);
  }

  public class SimpleCursorAdapter extends android.widget.ResourceCursorAdapter {
    ctor public deprecated SimpleCursorAdapter(android.content.Context, int, android.database.Cursor, java.lang.String[], int[]);
    ctor public SimpleCursorAdapter(android.content.Context, int, android.database.Cursor, java.lang.String[], int[], int);
    method public void bindView(android.view.View, android.content.Context, android.database.Cursor);
    method public void changeCursorAndColumns(android.database.Cursor, java.lang.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, java.lang.String);
    method public void setViewText(android.widget.TextView, java.lang.String);
  }

  public static abstract interface SimpleCursorAdapter.CursorToStringConverter {
    method public abstract java.lang.CharSequence convertToString(android.database.Cursor);
  }

  public static abstract interface SimpleCursorAdapter.ViewBinder {
    method public abstract 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, java.lang.String[], int[], int, int, java.lang.String[], int[]);
    ctor public SimpleCursorTreeAdapter(android.content.Context, android.database.Cursor, int, int, java.lang.String[], int[], int, java.lang.String[], int[]);
    ctor public SimpleCursorTreeAdapter(android.content.Context, android.database.Cursor, int, java.lang.String[], int[], int, java.lang.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, java.lang.String);
    method public void setViewText(android.widget.TextView, java.lang.String);
  }

  public static abstract interface SimpleCursorTreeAdapter.ViewBinder {
    method public abstract 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, java.lang.String[], int[], java.util.List<? extends java.util.List<? extends java.util.Map<java.lang.String, ?>>>, int, java.lang.String[], int[]);
    ctor public SimpleExpandableListAdapter(android.content.Context, java.util.List<? extends java.util.Map<java.lang.String, ?>>, int, int, java.lang.String[], int[], java.util.List<? extends java.util.List<? extends java.util.Map<java.lang.String, ?>>>, int, java.lang.String[], int[]);
    ctor public SimpleExpandableListAdapter(android.content.Context, java.util.List<? extends java.util.Map<java.lang.String, ?>>, int, int, java.lang.String[], int[], java.util.List<? extends java.util.List<? extends java.util.Map<java.lang.String, ?>>>, int, int, java.lang.String[], int[]);
    method public java.lang.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 java.lang.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);
  }

  public deprecated class SlidingDrawer extends android.view.ViewGroup {
    ctor public SlidingDrawer(android.content.Context, android.util.AttributeSet);
    ctor public SlidingDrawer(android.content.Context, android.util.AttributeSet, int);
    ctor public SlidingDrawer(android.content.Context, android.util.AttributeSet, int, int);
    method public void animateClose();
    method public void animateOpen();
    method public void animateToggle();
    method public void close();
    method public android.view.View getContent();
    method public android.view.View getHandle();
    method public boolean isMoving();
    method public boolean isOpened();
    method public void lock();
    method public void open();
    method public void setOnDrawerCloseListener(android.widget.SlidingDrawer.OnDrawerCloseListener);
    method public void setOnDrawerOpenListener(android.widget.SlidingDrawer.OnDrawerOpenListener);
    method public void setOnDrawerScrollListener(android.widget.SlidingDrawer.OnDrawerScrollListener);
    method public void toggle();
    method public void unlock();
    field public static final int ORIENTATION_HORIZONTAL = 0; // 0x0
    field public static final int ORIENTATION_VERTICAL = 1; // 0x1
  }

  public static abstract interface SlidingDrawer.OnDrawerCloseListener {
    method public abstract void onDrawerClosed();
  }

  public static abstract interface SlidingDrawer.OnDrawerOpenListener {
    method public abstract void onDrawerOpened();
  }

  public static abstract interface SlidingDrawer.OnDrawerScrollListener {
    method public abstract void onScrollEnded();
    method public abstract 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 java.lang.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(int);
    method public void setPrompt(java.lang.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 abstract interface SpinnerAdapter implements android.widget.Adapter {
    method public abstract android.view.View getDropDownView(int, android.view.View, android.view.ViewGroup);
  }

  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 java.lang.CharSequence getTextOff();
    method public java.lang.CharSequence getTextOn();
    method public android.graphics.drawable.Drawable getThumbDrawable();
    method public int getThumbTextPadding();
    method public android.content.res.ColorStateList getThumbTintList();
    method public android.graphics.PorterDuff.Mode getThumbTintMode();
    method public android.graphics.drawable.Drawable getTrackDrawable();
    method public android.content.res.ColorStateList getTrackTintList();
    method 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, int);
    method public void setSwitchTypeface(android.graphics.Typeface, int);
    method public void setSwitchTypeface(android.graphics.Typeface);
    method public void setTextOff(java.lang.CharSequence);
    method public void setTextOn(java.lang.CharSequence);
    method public void setThumbDrawable(android.graphics.drawable.Drawable);
    method public void setThumbResource(int);
    method public void setThumbTextPadding(int);
    method public void setThumbTintList(android.content.res.ColorStateList);
    method public void setThumbTintMode(android.graphics.PorterDuff.Mode);
    method public void setTrackDrawable(android.graphics.drawable.Drawable);
    method public void setTrackResource(int);
    method public void setTrackTintList(android.content.res.ColorStateList);
    method public void setTrackTintMode(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 public int getCurrentTab();
    method public java.lang.String getCurrentTabTag();
    method public android.view.View getCurrentTabView();
    method public android.view.View getCurrentView();
    method public android.widget.FrameLayout getTabContentView();
    method public android.widget.TabWidget getTabWidget();
    method public android.widget.TabHost.TabSpec newTabSpec(java.lang.String);
    method public void onTouchModeChanged(boolean);
    method public void setCurrentTab(int);
    method public void setCurrentTabByTag(java.lang.String);
    method public void setOnTabChangedListener(android.widget.TabHost.OnTabChangeListener);
    method public void setup();
    method public void setup(android.app.LocalActivityManager);
  }

  public static abstract interface TabHost.OnTabChangeListener {
    method public abstract void onTabChanged(java.lang.String);
  }

  public static abstract interface TabHost.TabContentFactory {
    method public abstract android.view.View createTabContent(java.lang.String);
  }

  public class TabHost.TabSpec {
    method public java.lang.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(java.lang.CharSequence);
    method public android.widget.TabHost.TabSpec setIndicator(java.lang.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 public android.graphics.drawable.Drawable getLeftStripDrawable();
    method 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(int);
    method public void setLeftStripDrawable(android.graphics.drawable.Drawable);
    method public void setLeftStripDrawable(int);
    method public void setRightStripDrawable(android.graphics.drawable.Drawable);
    method public void setRightStripDrawable(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 public int column;
    field public int span;
  }

  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 public java.lang.CharSequence getFormat12Hour();
    method public java.lang.CharSequence getFormat24Hour();
    method public java.lang.String getTimeZone();
    method public boolean is24HourModeEnabled();
    method public void setFormat12Hour(java.lang.CharSequence);
    method public void setFormat24Hour(java.lang.CharSequence);
    method public void setTimeZone(java.lang.String);
    field public static final deprecated java.lang.CharSequence DEFAULT_FORMAT_12_HOUR;
    field public static final deprecated java.lang.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(java.lang.CharSequence);
    method public void setText(java.lang.CharSequence);
  }

  public class TextView extends android.view.View implements android.view.ViewTreeObserver.OnPreDrawListener {
    ctor public TextView(android.content.Context);
    ctor public TextView(android.content.Context, android.util.AttributeSet);
    ctor public TextView(android.content.Context, android.util.AttributeSet, int);
    ctor public TextView(android.content.Context, android.util.AttributeSet, int, int);
    method public void addTextChangedListener(android.text.TextWatcher);
    method public final void append(java.lang.CharSequence);
    method public void append(java.lang.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 public android.graphics.drawable.Drawable[] getCompoundDrawables();
    method 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 public final int getCurrentHintTextColor();
    method 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 public android.text.TextUtils.TruncateAt getEllipsize();
    method public java.lang.CharSequence getError();
    method public int getExtendedPaddingBottom();
    method public int getExtendedPaddingTop();
    method public android.text.InputFilter[] getFilters();
    method public int getFirstBaselineToTopHeight();
    method public java.lang.String getFontFeatureSettings();
    method public java.lang.String getFontVariationSettings();
    method public boolean getFreezesText();
    method public int getGravity();
    method public int getHighlightColor();
    method public java.lang.CharSequence getHint();
    method public final android.content.res.ColorStateList getHintTextColors();
    method public int getHyphenationFrequency();
    method public int getImeActionId();
    method public java.lang.CharSequence getImeActionLabel();
    method 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 java.lang.String getPrivateImeOptions();
    method public int getSelectionEnd();
    method public int getSelectionStart();
    method public int getShadowColor();
    method public float getShadowDx();
    method public float getShadowDy();
    method public float getShadowRadius();
    method public final boolean getShowSoftInputOnFocus();
    method public java.lang.CharSequence getText();
    method public android.view.textclassifier.TextClassifier getTextClassifier();
    method public final android.content.res.ColorStateList getTextColors();
    method public java.util.Locale getTextLocale();
    method public android.os.LocaleList getTextLocales();
    method public android.text.PrecomputedText.Params getTextMetricsParams();
    method public float getTextScaleX();
    method 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(java.lang.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(java.lang.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(int[], int);
    method public void setAutoSizeTextTypeWithDefaults(int);
    method public void setBreakStrategy(int);
    method public void setCompoundDrawablePadding(int);
    method public void setCompoundDrawableTintList(android.content.res.ColorStateList);
    method public void setCompoundDrawableTintMode(android.graphics.PorterDuff.Mode);
    method public void setCompoundDrawables(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable);
    method public void setCompoundDrawablesRelative(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable);
    method public void setCompoundDrawablesRelativeWithIntrinsicBounds(int, int, int, int);
    method public void setCompoundDrawablesRelativeWithIntrinsicBounds(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable);
    method public void setCompoundDrawablesWithIntrinsicBounds(int, int, int, int);
    method public void setCompoundDrawablesWithIntrinsicBounds(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, 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(java.lang.CharSequence);
    method public void setError(java.lang.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(int);
    method public void setFontFeatureSettings(java.lang.String);
    method public boolean setFontVariationSettings(java.lang.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(int);
    method public final void setHint(java.lang.CharSequence);
    method public final void setHint(int);
    method public final void setHintTextColor(int);
    method public final void setHintTextColor(android.content.res.ColorStateList);
    method public void setHorizontallyScrolling(boolean);
    method public void setHyphenationFrequency(int);
    method public void setImeActionLabel(java.lang.CharSequence, int);
    method public void setImeHintLocales(android.os.LocaleList);
    method public void setImeOptions(int);
    method public void setIncludeFontPadding(boolean);
    method public void setInputExtras(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(int);
    method public void setLetterSpacing(float);
    method public void setLineHeight(int);
    method public void setLineSpacing(float, float);
    method public void setLines(int);
    method public final void setLinkTextColor(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(java.lang.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(java.lang.CharSequence);
    method public void setText(java.lang.CharSequence, android.widget.TextView.BufferType);
    method public final void setText(char[], int, int);
    method public final void setText(int);
    method public final void setText(int, android.widget.TextView.BufferType);
    method public void setTextAppearance(int);
    method public deprecated void setTextAppearance(android.content.Context, int);
    method public void setTextClassifier(android.view.textclassifier.TextClassifier);
    method public void setTextColor(int);
    method public void setTextColor(android.content.res.ColorStateList);
    method public void setTextIsSelectable(boolean);
    method public final void setTextKeepState(java.lang.CharSequence);
    method public final void setTextKeepState(java.lang.CharSequence, android.widget.TextView.BufferType);
    method public void setTextLocale(java.util.Locale);
    method public void setTextLocales(android.os.LocaleList);
    method public void setTextMetricsParams(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(android.graphics.Typeface, int);
    method public void setTypeface(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 static final class TextView.BufferType extends java.lang.Enum {
    method public static android.widget.TextView.BufferType valueOf(java.lang.String);
    method public static final android.widget.TextView.BufferType[] values();
    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 abstract interface TextView.OnEditorActionListener {
    method public abstract 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 abstract interface ThemedSpinnerAdapter implements android.widget.SpinnerAdapter {
    method public abstract android.content.res.Resources.Theme getDropDownViewTheme();
    method public abstract void setDropDownViewTheme(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 public deprecated java.lang.Integer getCurrentHour();
    method public deprecated java.lang.Integer getCurrentMinute();
    method public int getHour();
    method public int getMinute();
    method public boolean is24HourView();
    method public deprecated void setCurrentHour(java.lang.Integer);
    method public deprecated void setCurrentMinute(java.lang.Integer);
    method public void setHour(int);
    method public void setIs24HourView(java.lang.Boolean);
    method public void setMinute(int);
    method public void setOnTimeChangedListener(android.widget.TimePicker.OnTimeChangedListener);
    method public boolean validateInput();
  }

  public static abstract interface TimePicker.OnTimeChangedListener {
    method public abstract 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, java.lang.CharSequence, int);
    method public static android.widget.Toast makeText(android.content.Context, 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(int);
    method public void setText(java.lang.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 java.lang.CharSequence getTextOff();
    method public java.lang.CharSequence getTextOn();
    method public void setBackgroundDrawable(android.graphics.drawable.Drawable);
    method public void setTextOff(java.lang.CharSequence);
    method public void setTextOn(java.lang.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 java.lang.CharSequence getLogoDescription();
    method public android.view.Menu getMenu();
    method public java.lang.CharSequence getNavigationContentDescription();
    method public android.graphics.drawable.Drawable getNavigationIcon();
    method public android.graphics.drawable.Drawable getOverflowIcon();
    method public int getPopupTheme();
    method public java.lang.CharSequence getSubtitle();
    method public java.lang.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(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(int);
    method public void setLogo(android.graphics.drawable.Drawable);
    method public void setLogoDescription(int);
    method public void setLogoDescription(java.lang.CharSequence);
    method public void setNavigationContentDescription(int);
    method public void setNavigationContentDescription(java.lang.CharSequence);
    method public void setNavigationIcon(int);
    method public void setNavigationIcon(android.graphics.drawable.Drawable);
    method public void setNavigationOnClickListener(android.view.View.OnClickListener);
    method public void setOnMenuItemClickListener(android.widget.Toolbar.OnMenuItemClickListener);
    method public void setOverflowIcon(android.graphics.drawable.Drawable);
    method public void setPopupTheme(int);
    method public void setSubtitle(int);
    method public void setSubtitle(java.lang.CharSequence);
    method public void setSubtitleTextAppearance(android.content.Context, int);
    method public void setSubtitleTextColor(int);
    method public void setTitle(int);
    method public void setTitle(java.lang.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, int);
    method public void setTitleTextColor(int);
    method public boolean showOverflowMenu();
  }

  public static class Toolbar.LayoutParams extends android.app.ActionBar.LayoutParams {
    ctor public Toolbar.LayoutParams(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 abstract interface Toolbar.OnMenuItemClickListener {
    method public abstract boolean onMenuItemClick(android.view.MenuItem);
  }

  public deprecated class TwoLineListItem extends android.widget.RelativeLayout {
    ctor public TwoLineListItem(android.content.Context);
    ctor public TwoLineListItem(android.content.Context, android.util.AttributeSet);
    ctor public TwoLineListItem(android.content.Context, android.util.AttributeSet, int);
    ctor public TwoLineListItem(android.content.Context, android.util.AttributeSet, int, int);
    method public android.widget.TextView getText1();
    method 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(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(java.lang.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, int);
    method public void setOutAnimation(android.view.animation.Animation);
    method public void setOutAnimation(android.content.Context, int);
    method public void showNext();
    method public void showPrevious();
  }

  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 abstract interface ViewSwitcher.ViewFactory {
    method public abstract android.view.View makeView();
  }

  public abstract interface WrapperListAdapter implements android.widget.ListAdapter {
    method public abstract android.widget.ListAdapter getWrappedAdapter();
  }

  public deprecated class ZoomButton extends android.widget.ImageButton implements android.view.View.OnLongClickListener {
    ctor public ZoomButton(android.content.Context);
    ctor public ZoomButton(android.content.Context, android.util.AttributeSet);
    ctor public ZoomButton(android.content.Context, android.util.AttributeSet, int);
    ctor public ZoomButton(android.content.Context, android.util.AttributeSet, int, int);
    method public boolean onLongClick(android.view.View);
    method public void setZoomSpeed(long);
  }

  public deprecated class ZoomButtonsController implements android.view.View.OnTouchListener {
    ctor public ZoomButtonsController(android.view.View);
    method public android.view.ViewGroup getContainer();
    method public android.view.View getZoomControls();
    method public boolean isAutoDismissed();
    method public boolean isVisible();
    method public boolean onTouch(android.view.View, android.view.MotionEvent);
    method public void setAutoDismissed(boolean);
    method public void setFocusable(boolean);
    method public void setOnZoomListener(android.widget.ZoomButtonsController.OnZoomListener);
    method public void setVisible(boolean);
    method public void setZoomInEnabled(boolean);
    method public void setZoomOutEnabled(boolean);
    method public void setZoomSpeed(long);
  }

  public static abstract interface ZoomButtonsController.OnZoomListener {
    method public abstract void onVisibilityChanged(boolean);
    method public abstract 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 {

  public abstract deprecated class TestTarget implements java.lang.annotation.Annotation {
  }

  public abstract deprecated class TestTargetClass implements java.lang.annotation.Annotation {
  }

}

package dalvik.bytecode {

  public final class OpcodeInfo {
    field public static final int MAXIMUM_PACKED_VALUE;
    field public static final int MAXIMUM_VALUE;
  }

  public abstract 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 public static final deprecated 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 public static final deprecated int OP_EXECUTE_INLINE = 238; // 0xee
    field public static final deprecated 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 public static final deprecated int OP_IGET_OBJECT_QUICK = 244; // 0xf4
    field public static final deprecated 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 public static final deprecated int OP_IGET_WIDE_QUICK = 243; // 0xf3
    field public static final deprecated 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 public static final deprecated 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 public static final deprecated int OP_INVOKE_SUPER_QUICK = 250; // 0xfa
    field public static final deprecated 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 public static final deprecated int OP_INVOKE_VIRTUAL_QUICK = 248; // 0xf8
    field public static final deprecated 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 public static final deprecated int OP_IPUT_OBJECT_QUICK = 247; // 0xf7
    field public static final deprecated 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 public static final deprecated int OP_IPUT_WIDE_QUICK = 246; // 0xf6
    field public static final deprecated 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 public static final deprecated 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 public static final deprecated 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 public static final deprecated 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(java.lang.String, java.io.File, java.lang.String, java.lang.ClassLoader);
    method public java.lang.String findLibrary(java.lang.String);
    method protected java.util.Enumeration<java.net.URL> findResources(java.lang.String);
    method protected synchronized java.lang.Package getPackage(java.lang.String);
  }

  public final class DelegateLastClassLoader extends dalvik.system.PathClassLoader {
    ctor public DelegateLastClassLoader(java.lang.String, java.lang.ClassLoader);
    ctor public DelegateLastClassLoader(java.lang.String, java.lang.String, java.lang.ClassLoader);
  }

  public class DexClassLoader extends dalvik.system.BaseDexClassLoader {
    ctor public DexClassLoader(java.lang.String, java.lang.String, java.lang.String, java.lang.ClassLoader);
  }

  public final deprecated class DexFile {
    ctor public deprecated DexFile(java.io.File) throws java.io.IOException;
    ctor public deprecated DexFile(java.lang.String) throws java.io.IOException;
    method public void close() throws java.io.IOException;
    method public java.util.Enumeration<java.lang.String> entries();
    method public java.lang.String getName();
    method public static boolean isDexOptNeeded(java.lang.String) throws java.io.FileNotFoundException, java.io.IOException;
    method public java.lang.Class loadClass(java.lang.String, java.lang.ClassLoader);
    method public static deprecated dalvik.system.DexFile loadDex(java.lang.String, java.lang.String, int) throws java.io.IOException;
  }

  public final class InMemoryDexClassLoader extends dalvik.system.BaseDexClassLoader {
    ctor public InMemoryDexClassLoader(java.nio.ByteBuffer[], java.lang.ClassLoader);
    ctor public InMemoryDexClassLoader(java.nio.ByteBuffer, java.lang.ClassLoader);
  }

  public class PathClassLoader extends dalvik.system.BaseDexClassLoader {
    ctor public PathClassLoader(java.lang.String, java.lang.ClassLoader);
    ctor public PathClassLoader(java.lang.String, java.lang.String, java.lang.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 static class NumericShaper.Range extends java.lang.Enum {
    method public static java.awt.font.NumericShaper.Range valueOf(java.lang.String);
    method public static final java.awt.font.NumericShaper.Range[] values();
    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(java.lang.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 java.lang.Float JUSTIFICATION_FULL;
    field public static final java.lang.Float JUSTIFICATION_NONE;
    field public static final java.awt.font.TextAttribute KERNING;
    field public static final java.lang.Integer KERNING_ON;
    field public static final java.awt.font.TextAttribute LIGATURES;
    field public static final java.lang.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 java.lang.Float POSTURE_OBLIQUE;
    field public static final java.lang.Float POSTURE_REGULAR;
    field public static final java.awt.font.TextAttribute RUN_DIRECTION;
    field public static final java.lang.Boolean RUN_DIRECTION_LTR;
    field public static final java.lang.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 java.lang.Boolean STRIKETHROUGH_ON;
    field public static final java.awt.font.TextAttribute SUPERSCRIPT;
    field public static final java.lang.Integer SUPERSCRIPT_SUB;
    field public static final java.lang.Integer SUPERSCRIPT_SUPER;
    field public static final java.awt.font.TextAttribute SWAP_COLORS;
    field public static final java.lang.Boolean SWAP_COLORS_ON;
    field public static final java.awt.font.TextAttribute TRACKING;
    field public static final java.lang.Float TRACKING_LOOSE;
    field public static final java.lang.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 java.lang.Integer UNDERLINE_LOW_DASHED;
    field public static final java.lang.Integer UNDERLINE_LOW_DOTTED;
    field public static final java.lang.Integer UNDERLINE_LOW_GRAY;
    field public static final java.lang.Integer UNDERLINE_LOW_ONE_PIXEL;
    field public static final java.lang.Integer UNDERLINE_LOW_TWO_PIXEL;
    field public static final java.lang.Integer UNDERLINE_ON;
    field public static final java.awt.font.TextAttribute WEIGHT;
    field public static final java.lang.Float WEIGHT_BOLD;
    field public static final java.lang.Float WEIGHT_DEMIBOLD;
    field public static final java.lang.Float WEIGHT_DEMILIGHT;
    field public static final java.lang.Float WEIGHT_EXTRABOLD;
    field public static final java.lang.Float WEIGHT_EXTRA_LIGHT;
    field public static final java.lang.Float WEIGHT_HEAVY;
    field public static final java.lang.Float WEIGHT_LIGHT;
    field public static final java.lang.Float WEIGHT_MEDIUM;
    field public static final java.lang.Float WEIGHT_REGULAR;
    field public static final java.lang.Float WEIGHT_SEMIBOLD;
    field public static final java.lang.Float WEIGHT_ULTRABOLD;
    field public static final java.awt.font.TextAttribute WIDTH;
    field public static final java.lang.Float WIDTH_CONDENSED;
    field public static final java.lang.Float WIDTH_EXTENDED;
    field public static final java.lang.Float WIDTH_REGULAR;
    field public static final java.lang.Float WIDTH_SEMI_CONDENSED;
    field public static final java.lang.Float WIDTH_SEMI_EXTENDED;
  }

}

package java.beans {

  public class IndexedPropertyChangeEvent extends java.beans.PropertyChangeEvent {
    ctor public IndexedPropertyChangeEvent(java.lang.Object, java.lang.String, java.lang.Object, java.lang.Object, int);
    method public int getIndex();
  }

  public class PropertyChangeEvent extends java.util.EventObject {
    ctor public PropertyChangeEvent(java.lang.Object, java.lang.String, java.lang.Object, java.lang.Object);
    method public java.lang.Object getNewValue();
    method public java.lang.Object getOldValue();
    method public java.lang.Object getPropagationId();
    method public java.lang.String getPropertyName();
    method public void setPropagationId(java.lang.Object);
  }

  public abstract interface PropertyChangeListener implements java.util.EventListener {
    method public abstract void propertyChange(java.beans.PropertyChangeEvent);
  }

  public class PropertyChangeListenerProxy extends java.util.EventListenerProxy implements java.beans.PropertyChangeListener {
    ctor public PropertyChangeListenerProxy(java.lang.String, java.beans.PropertyChangeListener);
    method public java.lang.String getPropertyName();
    method public void propertyChange(java.beans.PropertyChangeEvent);
  }

  public class PropertyChangeSupport implements java.io.Serializable {
    ctor public PropertyChangeSupport(java.lang.Object);
    method public void addPropertyChangeListener(java.beans.PropertyChangeListener);
    method public void addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener);
    method public void fireIndexedPropertyChange(java.lang.String, int, java.lang.Object, java.lang.Object);
    method public void fireIndexedPropertyChange(java.lang.String, int, int, int);
    method public void fireIndexedPropertyChange(java.lang.String, int, boolean, boolean);
    method public void firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object);
    method public void firePropertyChange(java.lang.String, int, int);
    method public void firePropertyChange(java.lang.String, boolean, boolean);
    method public void firePropertyChange(java.beans.PropertyChangeEvent);
    method public java.beans.PropertyChangeListener[] getPropertyChangeListeners();
    method public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String);
    method public boolean hasListeners(java.lang.String);
    method public void removePropertyChangeListener(java.beans.PropertyChangeListener);
    method public void removePropertyChangeListener(java.lang.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);
    method public synchronized int available() throws java.io.IOException;
    method public synchronized int read() throws java.io.IOException;
    method public synchronized int read(byte[], int, int) throws java.io.IOException;
    method public synchronized long skip(long) throws java.io.IOException;
    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);
    method public synchronized void flush() throws java.io.IOException;
    method public synchronized void write(int) throws java.io.IOException;
    method public synchronized void write(byte[], int, int) throws java.io.IOException;
    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 java.lang.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 synchronized int available();
    method public void mark(int);
    method public synchronized int read();
    method public synchronized int read(byte[], int, int);
    method public synchronized void reset();
    method public synchronized 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 synchronized void reset();
    method public synchronized int size();
    method public synchronized byte[] toByteArray();
    method public synchronized java.lang.String toString();
    method public synchronized java.lang.String toString(java.lang.String) throws java.io.UnsupportedEncodingException;
    method public deprecated synchronized java.lang.String toString(int);
    method public synchronized void write(int);
    method public synchronized void write(byte[], int, int);
    method public synchronized void writeTo(java.io.OutputStream) throws java.io.IOException;
    field 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(java.lang.CharSequence);
    method public java.io.CharArrayWriter append(java.lang.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(java.lang.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(java.lang.String);
  }

  public abstract interface Closeable implements java.lang.AutoCloseable {
    method public abstract void close() throws java.io.IOException;
  }

  public final class Console implements java.io.Flushable {
    method public void flush();
    method public java.io.Console format(java.lang.String, java.lang.Object...);
    method public java.io.Console printf(java.lang.String, java.lang.Object...);
    method public java.lang.String readLine(java.lang.String, java.lang.Object...);
    method public java.lang.String readLine();
    method public char[] readPassword(java.lang.String, java.lang.Object...);
    method public char[] readPassword();
    method public java.io.Reader reader();
    method public java.io.PrintWriter writer();
  }

  public abstract interface DataInput {
    method public abstract boolean readBoolean() throws java.io.IOException;
    method public abstract byte readByte() throws java.io.IOException;
    method public abstract char readChar() throws java.io.IOException;
    method public abstract double readDouble() throws java.io.IOException;
    method public abstract float readFloat() throws java.io.IOException;
    method public abstract void readFully(byte[]) throws java.io.IOException;
    method public abstract void readFully(byte[], int, int) throws java.io.IOException;
    method public abstract int readInt() throws java.io.IOException;
    method public abstract java.lang.String readLine() throws java.io.IOException;
    method public abstract long readLong() throws java.io.IOException;
    method public abstract short readShort() throws java.io.IOException;
    method public abstract java.lang.String readUTF() throws java.io.IOException;
    method public abstract int readUnsignedByte() throws java.io.IOException;
    method public abstract int readUnsignedShort() throws java.io.IOException;
    method public abstract 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 public final deprecated java.lang.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 java.lang.String readUTF() throws java.io.IOException;
    method public static final java.lang.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 abstract interface DataOutput {
    method public abstract void write(int) throws java.io.IOException;
    method public abstract void write(byte[]) throws java.io.IOException;
    method public abstract void write(byte[], int, int) throws java.io.IOException;
    method public abstract void writeBoolean(boolean) throws java.io.IOException;
    method public abstract void writeByte(int) throws java.io.IOException;
    method public abstract void writeBytes(java.lang.String) throws java.io.IOException;
    method public abstract void writeChar(int) throws java.io.IOException;
    method public abstract void writeChars(java.lang.String) throws java.io.IOException;
    method public abstract void writeDouble(double) throws java.io.IOException;
    method public abstract void writeFloat(float) throws java.io.IOException;
    method public abstract void writeInt(int) throws java.io.IOException;
    method public abstract void writeLong(long) throws java.io.IOException;
    method public abstract void writeShort(int) throws java.io.IOException;
    method public abstract void writeUTF(java.lang.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 synchronized void write(int) throws java.io.IOException;
    method public synchronized 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(java.lang.String) throws java.io.IOException;
    method public final void writeChar(int) throws java.io.IOException;
    method public final void writeChars(java.lang.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(java.lang.String) throws java.io.IOException;
    field protected int written;
  }

  public class EOFException extends java.io.IOException {
    ctor public EOFException();
    ctor public EOFException(java.lang.String);
  }

  public abstract interface Externalizable implements java.io.Serializable {
    method public abstract void readExternal(java.io.ObjectInput) throws java.lang.ClassNotFoundException, java.io.IOException;
    method public abstract void writeExternal(java.io.ObjectOutput) throws java.io.IOException;
  }

  public class File implements java.lang.Comparable java.io.Serializable {
    ctor public File(java.lang.String);
    ctor public File(java.lang.String, java.lang.String);
    ctor public File(java.io.File, java.lang.String);
    ctor public File(java.net.URI);
    method public boolean canExecute();
    method public boolean canRead();
    method public boolean canWrite();
    method public int compareTo(java.io.File);
    method public boolean createNewFile() throws java.io.IOException;
    method public static java.io.File createTempFile(java.lang.String, java.lang.String, java.io.File) throws java.io.IOException;
    method public static java.io.File createTempFile(java.lang.String, java.lang.String) throws java.io.IOException;
    method public boolean delete();
    method public void deleteOnExit();
    method public boolean exists();
    method public java.io.File getAbsoluteFile();
    method public java.lang.String getAbsolutePath();
    method public java.io.File getCanonicalFile() throws java.io.IOException;
    method public java.lang.String getCanonicalPath() throws java.io.IOException;
    method public long getFreeSpace();
    method public java.lang.String getName();
    method public java.lang.String getParent();
    method public java.io.File getParentFile();
    method public java.lang.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 public java.lang.String[] list();
    method public java.lang.String[] list(java.io.FilenameFilter);
    method public java.io.File[] listFiles();
    method public java.io.File[] listFiles(java.io.FilenameFilter);
    method public java.io.File[] listFiles(java.io.FileFilter);
    method public static java.io.File[] listRoots();
    method public boolean mkdir();
    method public boolean mkdirs();
    method public boolean renameTo(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 public java.nio.file.Path toPath();
    method public java.net.URI toURI();
    method public deprecated java.net.URL toURL() throws java.net.MalformedURLException;
    field public static final java.lang.String pathSeparator;
    field public static final char pathSeparatorChar;
    field public static final java.lang.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;
  }

  public abstract interface FileFilter {
    method public abstract boolean accept(java.io.File);
  }

  public class FileInputStream extends java.io.InputStream {
    ctor public FileInputStream(java.lang.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(java.lang.String);
  }

  public class FileOutputStream extends java.io.OutputStream {
    ctor public FileOutputStream(java.lang.String) throws java.io.FileNotFoundException;
    ctor public FileOutputStream(java.lang.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(java.lang.String, java.lang.String);
    method public java.lang.String getActions();
    method public boolean implies(java.security.Permission);
  }

  public class FileReader extends java.io.InputStreamReader {
    ctor public FileReader(java.lang.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(java.lang.String) throws java.io.IOException;
    ctor public FileWriter(java.lang.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);
  }

  public abstract interface FilenameFilter {
    method public abstract boolean accept(java.io.File, java.lang.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 abstract interface Flushable {
    method public abstract void flush() throws java.io.IOException;
  }

  public class IOError extends java.lang.Error {
    ctor public IOError(java.lang.Throwable);
  }

  public class IOException extends java.lang.Exception {
    ctor public IOException();
    ctor public IOException(java.lang.String);
    ctor public IOException(java.lang.String, java.lang.Throwable);
    ctor public IOException(java.lang.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 synchronized 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 synchronized 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, java.lang.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 java.lang.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(java.lang.String);
    field public int bytesTransferred;
  }

  public class InvalidClassException extends java.io.ObjectStreamException {
    ctor public InvalidClassException(java.lang.String);
    ctor public InvalidClassException(java.lang.String, java.lang.String);
    field public java.lang.String classname;
  }

  public class InvalidObjectException extends java.io.ObjectStreamException {
    ctor public InvalidObjectException(java.lang.String);
  }

  public deprecated class LineNumberInputStream extends java.io.FilterInputStream {
    ctor public LineNumberInputStream(java.io.InputStream);
    method public int getLineNumber();
    method public void mark(int);
    method public void reset() throws java.io.IOException;
    method 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(java.lang.String);
    ctor public NotActiveException();
  }

  public class NotSerializableException extends java.io.ObjectStreamException {
    ctor public NotSerializableException(java.lang.String);
    ctor public NotSerializableException();
  }

  public abstract interface ObjectInput implements java.lang.AutoCloseable java.io.DataInput {
    method public abstract int available() throws java.io.IOException;
    method public abstract void close() throws java.io.IOException;
    method public abstract int read() throws java.io.IOException;
    method public abstract int read(byte[]) throws java.io.IOException;
    method public abstract int read(byte[], int, int) throws java.io.IOException;
    method public abstract java.lang.Object readObject() throws java.lang.ClassNotFoundException, java.io.IOException;
    method public abstract 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 public deprecated java.lang.String readLine() throws java.io.IOException;
    method public long readLong() throws java.io.IOException;
    method public final java.lang.Object readObject() throws java.lang.ClassNotFoundException, java.io.IOException;
    method protected java.lang.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 java.lang.String readUTF() throws java.io.IOException;
    method public java.lang.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 java.lang.Class<?> resolveClass(java.io.ObjectStreamClass) throws java.lang.ClassNotFoundException, java.io.IOException;
    method protected java.lang.Object resolveObject(java.lang.Object) throws java.io.IOException;
    method protected java.lang.Class<?> resolveProxyClass(java.lang.String[]) throws java.lang.ClassNotFoundException, java.io.IOException;
    method public int skipBytes(int) throws java.io.IOException;
  }

  public static abstract class ObjectInputStream.GetField {
    ctor public ObjectInputStream.GetField();
    method public abstract boolean defaulted(java.lang.String) throws java.io.IOException;
    method public abstract boolean get(java.lang.String, boolean) throws java.io.IOException;
    method public abstract byte get(java.lang.String, byte) throws java.io.IOException;
    method public abstract char get(java.lang.String, char) throws java.io.IOException;
    method public abstract short get(java.lang.String, short) throws java.io.IOException;
    method public abstract int get(java.lang.String, int) throws java.io.IOException;
    method public abstract long get(java.lang.String, long) throws java.io.IOException;
    method public abstract float get(java.lang.String, float) throws java.io.IOException;
    method public abstract double get(java.lang.String, double) throws java.io.IOException;
    method public abstract java.lang.Object get(java.lang.String, java.lang.Object) throws java.io.IOException;
    method public abstract java.io.ObjectStreamClass getObjectStreamClass();
  }

  public abstract interface ObjectInputValidation {
    method public abstract void validateObject() throws java.io.InvalidObjectException;
  }

  public abstract interface ObjectOutput implements java.lang.AutoCloseable java.io.DataOutput {
    method public abstract void close() throws java.io.IOException;
    method public abstract void flush() throws java.io.IOException;
    method public abstract void writeObject(java.lang.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(java.lang.Class<?>) throws java.io.IOException;
    method protected void annotateProxyClass(java.lang.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 java.lang.Object replaceObject(java.lang.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(java.lang.String) throws java.io.IOException;
    method public void writeChar(int) throws java.io.IOException;
    method public void writeChars(java.lang.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(java.lang.Object) throws java.io.IOException;
    method protected void writeObjectOverride(java.lang.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(java.lang.String) throws java.io.IOException;
    method public void writeUnshared(java.lang.Object) throws java.io.IOException;
  }

  public static abstract class ObjectOutputStream.PutField {
    ctor public ObjectOutputStream.PutField();
    method public abstract void put(java.lang.String, boolean);
    method public abstract void put(java.lang.String, byte);
    method public abstract void put(java.lang.String, char);
    method public abstract void put(java.lang.String, short);
    method public abstract void put(java.lang.String, int);
    method public abstract void put(java.lang.String, long);
    method public abstract void put(java.lang.String, float);
    method public abstract void put(java.lang.String, double);
    method public abstract void put(java.lang.String, java.lang.Object);
    method public abstract deprecated void write(java.io.ObjectOutput) throws java.io.IOException;
  }

  public class ObjectStreamClass implements java.io.Serializable {
    method public java.lang.Class<?> forClass();
    method public java.io.ObjectStreamField getField(java.lang.String);
    method public java.io.ObjectStreamField[] getFields();
    method public java.lang.String getName();
    method public long getSerialVersionUID();
    method public static java.io.ObjectStreamClass lookup(java.lang.Class<?>);
    method public static java.io.ObjectStreamClass lookupAny(java.lang.Class<?>);
    field public static final java.io.ObjectStreamField[] NO_FIELDS;
  }

  public abstract 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(java.lang.String);
    ctor protected ObjectStreamException();
  }

  public class ObjectStreamField implements java.lang.Comparable {
    ctor public ObjectStreamField(java.lang.String, java.lang.Class<?>);
    ctor public ObjectStreamField(java.lang.String, java.lang.Class<?>, boolean);
    method public int compareTo(java.lang.Object);
    method public java.lang.String getName();
    method public int getOffset();
    method public java.lang.Class<?> getType();
    method public char getTypeCode();
    method public java.lang.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, java.lang.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 java.lang.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 synchronized int available() throws java.io.IOException;
    method public void connect(java.io.PipedOutputStream) throws java.io.IOException;
    method public synchronized int read() throws java.io.IOException;
    method public synchronized int read(byte[], int, int) throws java.io.IOException;
    method protected synchronized 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 synchronized void connect(java.io.PipedInputStream) throws java.io.IOException;
    method public synchronized void flush() 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 synchronized int read() throws java.io.IOException;
    method public synchronized int read(char[], int, int) throws java.io.IOException;
    method public synchronized boolean ready() 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 synchronized void connect(java.io.PipedReader) throws java.io.IOException;
    method public synchronized 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, java.lang.String) throws java.io.UnsupportedEncodingException;
    ctor public PrintStream(java.lang.String) throws java.io.FileNotFoundException;
    ctor public PrintStream(java.lang.String, java.lang.String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    ctor public PrintStream(java.io.File) throws java.io.FileNotFoundException;
    ctor public PrintStream(java.io.File, java.lang.String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    method public java.io.PrintStream append(java.lang.CharSequence);
    method public java.io.PrintStream append(java.lang.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(java.lang.String, java.lang.Object...);
    method public java.io.PrintStream format(java.util.Locale, java.lang.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(java.lang.String);
    method public void print(java.lang.Object);
    method public java.io.PrintStream printf(java.lang.String, java.lang.Object...);
    method public java.io.PrintStream printf(java.util.Locale, java.lang.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(java.lang.String);
    method public void println(java.lang.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(java.io.Writer);
    ctor public PrintWriter(java.io.Writer, boolean);
    ctor public PrintWriter(java.io.OutputStream);
    ctor public PrintWriter(java.io.OutputStream, boolean);
    ctor public PrintWriter(java.lang.String) throws java.io.FileNotFoundException;
    ctor public PrintWriter(java.lang.String, java.lang.String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    ctor public PrintWriter(java.io.File) throws java.io.FileNotFoundException;
    ctor public PrintWriter(java.io.File, java.lang.String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    method public java.io.PrintWriter append(java.lang.CharSequence);
    method public java.io.PrintWriter append(java.lang.CharSequence, int, int);
    method public java.io.PrintWriter append(char);
    method public boolean checkError();
    method protected void clearError();
    method public void close();
    method public void flush();
    method public java.io.PrintWriter format(java.lang.String, java.lang.Object...);
    method public java.io.PrintWriter format(java.util.Locale, java.lang.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(java.lang.String);
    method public void print(java.lang.Object);
    method public java.io.PrintWriter printf(java.lang.String, java.lang.Object...);
    method public java.io.PrintWriter printf(java.util.Locale, java.lang.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(java.lang.String);
    method public void println(java.lang.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(java.lang.String, int, int);
    method public void write(java.lang.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 synchronized void close() throws java.io.IOException;
    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(java.lang.String, java.lang.String) throws java.io.FileNotFoundException;
    ctor public RandomAccessFile(java.io.File, java.lang.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 java.lang.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 java.lang.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(java.lang.String) throws java.io.IOException;
    method public final void writeChar(int) throws java.io.IOException;
    method public final void writeChars(java.lang.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(java.lang.String) throws java.io.IOException;
  }

  public abstract class Reader implements java.io.Closeable java.lang.Readable {
    ctor protected Reader();
    ctor protected Reader(java.lang.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 java.lang.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 abstract interface Serializable {
  }

  public final class SerializablePermission extends java.security.BasicPermission {
    ctor public SerializablePermission(java.lang.String);
    ctor public SerializablePermission(java.lang.String, java.lang.String);
  }

  public class StreamCorruptedException extends java.io.ObjectStreamException {
    ctor public StreamCorruptedException(java.lang.String);
    ctor public StreamCorruptedException();
  }

  public class StreamTokenizer {
    ctor public deprecated 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 java.lang.String sval;
    field public int ttype;
  }

  public deprecated class StringBufferInputStream extends java.io.InputStream {
    ctor public StringBufferInputStream(java.lang.String);
    method public synchronized int available();
    method public synchronized int read();
    method public synchronized int read(byte[], int, int);
    method public synchronized void reset();
    method public synchronized long skip(long);
    field protected java.lang.String buffer;
    field protected int count;
    field protected int pos;
  }

  public class StringReader extends java.io.Reader {
    ctor public StringReader(java.lang.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(java.lang.CharSequence);
    method public java.io.StringWriter append(java.lang.CharSequence, int, int);
    method public java.io.StringWriter append(char);
    method public void close() throws java.io.IOException;
    method public void flush();
    method public java.lang.StringBuffer getBuffer();
    method public void write(int);
    method public void write(char[], int, int);
    method public void write(java.lang.String);
    method public void write(java.lang.String, int, int);
  }

  public class SyncFailedException extends java.io.IOException {
    ctor public SyncFailedException(java.lang.String);
  }

  public class UTFDataFormatException extends java.io.IOException {
    ctor public UTFDataFormatException();
    ctor public UTFDataFormatException(java.lang.String);
  }

  public class UncheckedIOException extends java.lang.RuntimeException {
    ctor public UncheckedIOException(java.lang.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(java.lang.String);
  }

  public class WriteAbortedException extends java.io.ObjectStreamException {
    ctor public WriteAbortedException(java.lang.String, java.lang.Exception);
    method public java.lang.Throwable getCause();
    field public java.lang.Exception detail;
  }

  public abstract class Writer implements java.lang.Appendable java.io.Closeable java.io.Flushable {
    ctor protected Writer();
    ctor protected Writer(java.lang.Object);
    method public java.io.Writer append(java.lang.CharSequence) throws java.io.IOException;
    method public java.io.Writer append(java.lang.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(java.lang.String) throws java.io.IOException;
    method public void write(java.lang.String, int, int) throws java.io.IOException;
    field protected java.lang.Object lock;
  }

}

package java.lang {

  public class AbstractMethodError extends java.lang.IncompatibleClassChangeError {
    ctor public AbstractMethodError();
    ctor public AbstractMethodError(java.lang.String);
  }

  public abstract interface Appendable {
    method public abstract java.lang.Appendable append(java.lang.CharSequence) throws java.io.IOException;
    method public abstract java.lang.Appendable append(java.lang.CharSequence, int, int) throws java.io.IOException;
    method public abstract java.lang.Appendable append(char) throws java.io.IOException;
  }

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

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

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

  public class AssertionError extends java.lang.Error {
    ctor public AssertionError();
    ctor public AssertionError(java.lang.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(java.lang.String, java.lang.Throwable);
  }

  public abstract interface AutoCloseable {
    method public abstract void close() throws java.lang.Exception;
  }

  public final class Boolean implements java.lang.Comparable java.io.Serializable {
    ctor public Boolean(boolean);
    ctor public Boolean(java.lang.String);
    method public boolean booleanValue();
    method public static int compare(boolean, boolean);
    method public int compareTo(java.lang.Boolean);
    method public static boolean getBoolean(java.lang.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(java.lang.String);
    method public static java.lang.String toString(boolean);
    method public static java.lang.Boolean valueOf(boolean);
    method public static java.lang.Boolean valueOf(java.lang.String);
    field public static final java.lang.Boolean FALSE;
    field public static final java.lang.Boolean TRUE;
    field public static final java.lang.Class<java.lang.Boolean> TYPE;
  }

  public class BootstrapMethodError extends java.lang.LinkageError {
    ctor public BootstrapMethodError();
    ctor public BootstrapMethodError(java.lang.String);
    ctor public BootstrapMethodError(java.lang.String, java.lang.Throwable);
    ctor public BootstrapMethodError(java.lang.Throwable);
  }

  public final class Byte extends java.lang.Number implements java.lang.Comparable {
    ctor public Byte(byte);
    ctor public Byte(java.lang.String) throws java.lang.NumberFormatException;
    method public static int compare(byte, byte);
    method public int compareTo(java.lang.Byte);
    method public static java.lang.Byte decode(java.lang.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(java.lang.String, int) throws java.lang.NumberFormatException;
    method public static byte parseByte(java.lang.String) throws java.lang.NumberFormatException;
    method public static java.lang.String toString(byte);
    method public static int toUnsignedInt(byte);
    method public static long toUnsignedLong(byte);
    method public static java.lang.Byte valueOf(byte);
    method public static java.lang.Byte valueOf(java.lang.String, int) throws java.lang.NumberFormatException;
    method public static java.lang.Byte valueOf(java.lang.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 java.lang.Class<java.lang.Byte> TYPE;
  }

  public abstract interface CharSequence {
    method public abstract char charAt(int);
    method public default java.util.stream.IntStream chars();
    method public default java.util.stream.IntStream codePoints();
    method public abstract int length();
    method public abstract java.lang.CharSequence subSequence(int, int);
    method public abstract java.lang.String toString();
  }

  public final class Character implements java.lang.Comparable java.io.Serializable {
    ctor public Character(char);
    method public static int charCount(int);
    method public char charValue();
    method public static int codePointAt(java.lang.CharSequence, int);
    method public static int codePointAt(char[], int);
    method public static int codePointAt(char[], int, int);
    method public static int codePointBefore(java.lang.CharSequence, int);
    method public static int codePointBefore(char[], int);
    method public static int codePointBefore(char[], int, int);
    method public static int codePointCount(java.lang.CharSequence, int, int);
    method public static int codePointCount(char[], int, int);
    method public static int compare(char, char);
    method public int compareTo(java.lang.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 public static java.lang.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 public static deprecated boolean isJavaLetter(char);
    method public static deprecated 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 public static deprecated 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(java.lang.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 public static java.lang.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 public static java.lang.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 java.lang.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(java.lang.String);
    method public final boolean equals(java.lang.Object);
    method public final int hashCode();
    method public final java.lang.String toString();
  }

  public static final class Character.UnicodeBlock extends java.lang.Character.Subset {
    method public static java.lang.Character.UnicodeBlock forName(java.lang.String);
    method public static java.lang.Character.UnicodeBlock of(char);
    method 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 public static final deprecated 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 static final class Character.UnicodeScript extends java.lang.Enum {
    method public static java.lang.Character.UnicodeScript forName(java.lang.String);
    method public static java.lang.Character.UnicodeScript of(int);
    method public static java.lang.Character.UnicodeScript valueOf(java.lang.String);
    method public static final java.lang.Character.UnicodeScript[] values();
    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 public <U> java.lang.Class<? extends U> asSubclass(java.lang.Class<U>);
    method public T cast(java.lang.Object);
    method public boolean desiredAssertionStatus();
    method public static java.lang.Class<?> forName(java.lang.String) throws java.lang.ClassNotFoundException;
    method public static java.lang.Class<?> forName(java.lang.String, boolean, java.lang.ClassLoader) throws java.lang.ClassNotFoundException;
    method public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A>);
    method public java.lang.annotation.Annotation[] getAnnotations();
    method public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType(java.lang.Class<A>);
    method public java.lang.String getCanonicalName();
    method public java.lang.ClassLoader getClassLoader();
    method public java.lang.Class<?>[] getClasses();
    method public java.lang.Class<?> getComponentType();
    method public java.lang.reflect.Constructor<T> getConstructor(java.lang.Class<?>...) throws java.lang.NoSuchMethodException, java.lang.SecurityException;
    method public java.lang.reflect.Constructor<?>[] getConstructors() throws java.lang.SecurityException;
    method public <A extends java.lang.annotation.Annotation> A getDeclaredAnnotation(java.lang.Class<A>);
    method public java.lang.annotation.Annotation[] getDeclaredAnnotations();
    method public java.lang.Class<?>[] getDeclaredClasses();
    method public java.lang.reflect.Constructor<T> getDeclaredConstructor(java.lang.Class<?>...) throws java.lang.NoSuchMethodException, java.lang.SecurityException;
    method public java.lang.reflect.Constructor<?>[] getDeclaredConstructors() throws java.lang.SecurityException;
    method public java.lang.reflect.Field getDeclaredField(java.lang.String) throws java.lang.NoSuchFieldException;
    method public java.lang.reflect.Field[] getDeclaredFields();
    method public java.lang.reflect.Method getDeclaredMethod(java.lang.String, java.lang.Class<?>...) throws java.lang.NoSuchMethodException, java.lang.SecurityException;
    method public java.lang.reflect.Method[] getDeclaredMethods() throws java.lang.SecurityException;
    method public java.lang.Class<?> getDeclaringClass();
    method public java.lang.Class<?> getEnclosingClass();
    method public java.lang.reflect.Constructor<?> getEnclosingConstructor();
    method public java.lang.reflect.Method getEnclosingMethod();
    method public T[] getEnumConstants();
    method public java.lang.reflect.Field getField(java.lang.String) throws java.lang.NoSuchFieldException;
    method public java.lang.reflect.Field[] getFields() throws java.lang.SecurityException;
    method public java.lang.reflect.Type[] getGenericInterfaces();
    method public java.lang.reflect.Type getGenericSuperclass();
    method public java.lang.Class<?>[] getInterfaces();
    method public java.lang.reflect.Method getMethod(java.lang.String, java.lang.Class<?>...) throws java.lang.NoSuchMethodException, java.lang.SecurityException;
    method public java.lang.reflect.Method[] getMethods() throws java.lang.SecurityException;
    method public int getModifiers();
    method public java.lang.String getName();
    method public java.lang.Package getPackage();
    method public java.security.ProtectionDomain getProtectionDomain();
    method public java.net.URL getResource(java.lang.String);
    method public java.io.InputStream getResourceAsStream(java.lang.String);
    method public java.lang.Object[] getSigners();
    method public java.lang.String getSimpleName();
    method public java.lang.Class<? super T> getSuperclass();
    method public synchronized 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(java.lang.Class<?>);
    method public boolean isEnum();
    method public boolean isInstance(java.lang.Object);
    method public boolean isInterface();
    method public boolean isLocalClass();
    method public boolean isMemberClass();
    method public boolean isPrimitive();
    method public boolean isSynthetic();
    method public T newInstance() throws java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public java.lang.String toGenericString();
  }

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

  public class ClassCircularityError extends java.lang.LinkageError {
    ctor public ClassCircularityError();
    ctor public ClassCircularityError(java.lang.String);
  }

  public class ClassFormatError extends java.lang.LinkageError {
    ctor public ClassFormatError();
    ctor public ClassFormatError(java.lang.String);
  }

  public abstract class ClassLoader {
    ctor protected ClassLoader(java.lang.ClassLoader);
    ctor protected ClassLoader();
    method public void clearAssertionStatus();
    method protected final deprecated java.lang.Class<?> defineClass(byte[], int, int) throws java.lang.ClassFormatError;
    method protected final java.lang.Class<?> defineClass(java.lang.String, byte[], int, int) throws java.lang.ClassFormatError;
    method protected final java.lang.Class<?> defineClass(java.lang.String, byte[], int, int, java.security.ProtectionDomain) throws java.lang.ClassFormatError;
    method protected final java.lang.Class<?> defineClass(java.lang.String, java.nio.ByteBuffer, java.security.ProtectionDomain) throws java.lang.ClassFormatError;
    method protected java.lang.Package definePackage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.net.URL) throws java.lang.IllegalArgumentException;
    method protected java.lang.Class<?> findClass(java.lang.String) throws java.lang.ClassNotFoundException;
    method protected java.lang.String findLibrary(java.lang.String);
    method protected final java.lang.Class<?> findLoadedClass(java.lang.String);
    method protected java.net.URL findResource(java.lang.String);
    method protected java.util.Enumeration<java.net.URL> findResources(java.lang.String) throws java.io.IOException;
    method protected final java.lang.Class<?> findSystemClass(java.lang.String) throws java.lang.ClassNotFoundException;
    method protected java.lang.Package getPackage(java.lang.String);
    method protected java.lang.Package[] getPackages();
    method public final java.lang.ClassLoader getParent();
    method public java.net.URL getResource(java.lang.String);
    method public java.io.InputStream getResourceAsStream(java.lang.String);
    method public java.util.Enumeration<java.net.URL> getResources(java.lang.String) throws java.io.IOException;
    method public static java.lang.ClassLoader getSystemClassLoader();
    method public static java.net.URL getSystemResource(java.lang.String);
    method public static java.io.InputStream getSystemResourceAsStream(java.lang.String);
    method public static java.util.Enumeration<java.net.URL> getSystemResources(java.lang.String) throws java.io.IOException;
    method public java.lang.Class<?> loadClass(java.lang.String) throws java.lang.ClassNotFoundException;
    method protected java.lang.Class<?> loadClass(java.lang.String, boolean) throws java.lang.ClassNotFoundException;
    method protected static boolean registerAsParallelCapable();
    method protected final void resolveClass(java.lang.Class<?>);
    method public void setClassAssertionStatus(java.lang.String, boolean);
    method public void setDefaultAssertionStatus(boolean);
    method public void setPackageAssertionStatus(java.lang.String, boolean);
    method protected final void setSigners(java.lang.Class<?>, java.lang.Object[]);
  }

  public class ClassNotFoundException extends java.lang.ReflectiveOperationException {
    ctor public ClassNotFoundException();
    ctor public ClassNotFoundException(java.lang.String);
    ctor public ClassNotFoundException(java.lang.String, java.lang.Throwable);
    method public java.lang.Throwable getCause();
    method public java.lang.Throwable getException();
  }

  public class CloneNotSupportedException extends java.lang.Exception {
    ctor public CloneNotSupportedException();
    ctor public CloneNotSupportedException(java.lang.String);
  }

  public abstract interface Cloneable {
  }

  public abstract interface Comparable<T> {
    method public abstract int compareTo(T);
  }

  public final class Compiler {
    method public static java.lang.Object command(java.lang.Object);
    method public static boolean compileClass(java.lang.Class<?>);
    method public static boolean compileClasses(java.lang.String);
    method public static void disable();
    method public static void enable();
  }

  public abstract class Deprecated implements java.lang.annotation.Annotation {
  }

  public final class Double extends java.lang.Number implements java.lang.Comparable {
    ctor public Double(double);
    ctor public Double(java.lang.String) throws java.lang.NumberFormatException;
    method public static int compare(double, double);
    method public int compareTo(java.lang.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(java.lang.String) throws java.lang.NumberFormatException;
    method public static double sum(double, double);
    method public static java.lang.String toHexString(double);
    method public static java.lang.String toString(double);
    method public static java.lang.Double valueOf(java.lang.String) throws java.lang.NumberFormatException;
    method public static java.lang.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 java.lang.Class<java.lang.Double> TYPE;
  }

  public abstract class Enum<E extends java.lang.Enum<E>> implements java.lang.Comparable java.io.Serializable {
    ctor protected Enum(java.lang.String, int);
    method protected final java.lang.Object clone() throws java.lang.CloneNotSupportedException;
    method public final int compareTo(E);
    method public final boolean equals(java.lang.Object);
    method protected final void finalize();
    method public final java.lang.Class<E> getDeclaringClass();
    method public final int hashCode();
    method public final java.lang.String name();
    method public final int ordinal();
    method public static <T extends java.lang.Enum<T>> T valueOf(java.lang.Class<T>, java.lang.String);
  }

  public class EnumConstantNotPresentException extends java.lang.RuntimeException {
    ctor public EnumConstantNotPresentException(java.lang.Class<? extends java.lang.Enum>, java.lang.String);
    method public java.lang.String constantName();
    method public java.lang.Class<? extends java.lang.Enum> enumType();
  }

  public class Error extends java.lang.Throwable {
    ctor public Error();
    ctor public Error(java.lang.String);
    ctor public Error(java.lang.String, java.lang.Throwable);
    ctor public Error(java.lang.Throwable);
    ctor protected Error(java.lang.String, java.lang.Throwable, boolean, boolean);
  }

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

  public class ExceptionInInitializerError extends java.lang.LinkageError {
    ctor public ExceptionInInitializerError();
    ctor public ExceptionInInitializerError(java.lang.Throwable);
    ctor public ExceptionInInitializerError(java.lang.String);
    method public java.lang.Throwable getCause();
    method public java.lang.Throwable getException();
  }

  public final class Float extends java.lang.Number implements java.lang.Comparable {
    ctor public Float(float);
    ctor public Float(double);
    ctor public Float(java.lang.String) throws java.lang.NumberFormatException;
    method public static int compare(float, float);
    method public int compareTo(java.lang.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(java.lang.String) throws java.lang.NumberFormatException;
    method public static float sum(float, float);
    method public static java.lang.String toHexString(float);
    method public static java.lang.String toString(float);
    method public static java.lang.Float valueOf(java.lang.String) throws java.lang.NumberFormatException;
    method public static java.lang.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 java.lang.Class<java.lang.Float> TYPE;
  }

  public abstract class FunctionalInterface implements java.lang.annotation.Annotation {
  }

  public class IllegalAccessError extends java.lang.IncompatibleClassChangeError {
    ctor public IllegalAccessError();
    ctor public IllegalAccessError(java.lang.String);
  }

  public class IllegalAccessException extends java.lang.ReflectiveOperationException {
    ctor public IllegalAccessException();
    ctor public IllegalAccessException(java.lang.String);
  }

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

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

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

  public class IllegalThreadStateException extends java.lang.IllegalArgumentException {
    ctor public IllegalThreadStateException();
    ctor public IllegalThreadStateException(java.lang.String);
  }

  public class IncompatibleClassChangeError extends java.lang.LinkageError {
    ctor public IncompatibleClassChangeError();
    ctor public IncompatibleClassChangeError(java.lang.String);
  }

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

  public class InheritableThreadLocal<T> extends java.lang.ThreadLocal {
    ctor public InheritableThreadLocal();
    method protected T childValue(T);
  }

  public class InstantiationError extends java.lang.IncompatibleClassChangeError {
    ctor public InstantiationError();
    ctor public InstantiationError(java.lang.String);
  }

  public class InstantiationException extends java.lang.ReflectiveOperationException {
    ctor public InstantiationException();
    ctor public InstantiationException(java.lang.String);
  }

  public final class Integer extends java.lang.Number implements java.lang.Comparable {
    ctor public Integer(int);
    ctor public Integer(java.lang.String) throws java.lang.NumberFormatException;
    method public static int bitCount(int);
    method public static int compare(int, int);
    method public int compareTo(java.lang.Integer);
    method public static int compareUnsigned(int, int);
    method public static java.lang.Integer decode(java.lang.String) throws java.lang.NumberFormatException;
    method public static int divideUnsigned(int, int);
    method public double doubleValue();
    method public float floatValue();
    method public static java.lang.Integer getInteger(java.lang.String);
    method public static java.lang.Integer getInteger(java.lang.String, int);
    method public static java.lang.Integer getInteger(java.lang.String, java.lang.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(java.lang.String, int) throws java.lang.NumberFormatException;
    method public static int parseInt(java.lang.String) throws java.lang.NumberFormatException;
    method public static int parseUnsignedInt(java.lang.String, int) throws java.lang.NumberFormatException;
    method public static int parseUnsignedInt(java.lang.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 public static java.lang.String toBinaryString(int);
    method public static java.lang.String toHexString(int);
    method public static java.lang.String toOctalString(int);
    method public static java.lang.String toString(int, int);
    method public static java.lang.String toString(int);
    method public static long toUnsignedLong(int);
    method public static java.lang.String toUnsignedString(int, int);
    method public static java.lang.String toUnsignedString(int);
    method public static java.lang.Integer valueOf(java.lang.String, int) throws java.lang.NumberFormatException;
    method public static java.lang.Integer valueOf(java.lang.String) throws java.lang.NumberFormatException;
    method public static java.lang.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 java.lang.Class<java.lang.Integer> TYPE;
  }

  public class InternalError extends java.lang.VirtualMachineError {
    ctor public InternalError();
    ctor public InternalError(java.lang.String);
    ctor public InternalError(java.lang.String, java.lang.Throwable);
    ctor public InternalError(java.lang.Throwable);
  }

  public class InterruptedException extends java.lang.Exception {
    ctor public InterruptedException();
    ctor public InterruptedException(java.lang.String);
  }

  public abstract interface Iterable<T> {
    method public default void forEach(java.util.function.Consumer<? super T>);
    method public abstract java.util.Iterator<T> iterator();
    method public default java.util.Spliterator<T> spliterator();
  }

  public class LinkageError extends java.lang.Error {
    ctor public LinkageError();
    ctor public LinkageError(java.lang.String);
    ctor public LinkageError(java.lang.String, java.lang.Throwable);
  }

  public final class Long extends java.lang.Number implements java.lang.Comparable {
    ctor public Long(long);
    ctor public Long(java.lang.String) throws java.lang.NumberFormatException;
    method public static int bitCount(long);
    method public static int compare(long, long);
    method public int compareTo(java.lang.Long);
    method public static int compareUnsigned(long, long);
    method public static java.lang.Long decode(java.lang.String) throws java.lang.NumberFormatException;
    method public static long divideUnsigned(long, long);
    method public double doubleValue();
    method public float floatValue();
    method public static java.lang.Long getLong(java.lang.String);
    method public static java.lang.Long getLong(java.lang.String, long);
    method public static java.lang.Long getLong(java.lang.String, java.lang.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(java.lang.String, int) throws java.lang.NumberFormatException;
    method public static long parseLong(java.lang.String) throws java.lang.NumberFormatException;
    method public static long parseUnsignedLong(java.lang.String, int) throws java.lang.NumberFormatException;
    method public static long parseUnsignedLong(java.lang.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 public static java.lang.String toBinaryString(long);
    method public static java.lang.String toHexString(long);
    method public static java.lang.String toOctalString(long);
    method public static java.lang.String toString(long, int);
    method public static java.lang.String toString(long);
    method public static java.lang.String toUnsignedString(long, int);
    method public static java.lang.String toUnsignedString(long);
    method public static java.lang.Long valueOf(java.lang.String, int) throws java.lang.NumberFormatException;
    method public static java.lang.Long valueOf(java.lang.String) throws java.lang.NumberFormatException;
    method public static java.lang.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 java.lang.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(java.lang.String);
  }

  public class NoClassDefFoundError extends java.lang.LinkageError {
    ctor public NoClassDefFoundError();
    ctor public NoClassDefFoundError(java.lang.String);
  }

  public class NoSuchFieldError extends java.lang.IncompatibleClassChangeError {
    ctor public NoSuchFieldError();
    ctor public NoSuchFieldError(java.lang.String);
  }

  public class NoSuchFieldException extends java.lang.ReflectiveOperationException {
    ctor public NoSuchFieldException();
    ctor public NoSuchFieldException(java.lang.String);
  }

  public class NoSuchMethodError extends java.lang.IncompatibleClassChangeError {
    ctor public NoSuchMethodError();
    ctor public NoSuchMethodError(java.lang.String);
  }

  public class NoSuchMethodException extends java.lang.ReflectiveOperationException {
    ctor public NoSuchMethodException();
    ctor public NoSuchMethodException(java.lang.String);
  }

  public class NullPointerException extends java.lang.RuntimeException {
    ctor public NullPointerException();
    ctor public NullPointerException(java.lang.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(java.lang.String);
  }

  public class Object {
    ctor public Object();
    method protected java.lang.Object clone() throws java.lang.CloneNotSupportedException;
    method public boolean equals(java.lang.Object);
    method protected void finalize() throws java.lang.Throwable;
    method public final java.lang.Class<?> getClass();
    method public int hashCode();
    method public final void notify();
    method public final void notifyAll();
    method public java.lang.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(java.lang.String);
  }

  public abstract class Override implements java.lang.annotation.Annotation {
  }

  public class Package implements java.lang.reflect.AnnotatedElement {
    method public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A>);
    method public java.lang.annotation.Annotation[] getAnnotations();
    method public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType(java.lang.Class<A>);
    method public <A extends java.lang.annotation.Annotation> A getDeclaredAnnotation(java.lang.Class<A>);
    method public java.lang.annotation.Annotation[] getDeclaredAnnotations();
    method public <A extends java.lang.annotation.Annotation> A[] getDeclaredAnnotationsByType(java.lang.Class<A>);
    method public java.lang.String getImplementationTitle();
    method public java.lang.String getImplementationVendor();
    method public java.lang.String getImplementationVersion();
    method public java.lang.String getName();
    method public static java.lang.Package getPackage(java.lang.String);
    method public static java.lang.Package[] getPackages();
    method public java.lang.String getSpecificationTitle();
    method public java.lang.String getSpecificationVendor();
    method public java.lang.String getSpecificationVersion();
    method public boolean isCompatibleWith(java.lang.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 java.lang.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 java.lang.ProcessBuilder command(java.util.List<java.lang.String>);
    method public java.lang.ProcessBuilder command(java.lang.String...);
    method public java.util.List<java.lang.String> command();
    method public java.io.File directory();
    method public java.lang.ProcessBuilder directory(java.io.File);
    method public java.util.Map<java.lang.String, java.lang.String> environment();
    method public java.lang.ProcessBuilder inheritIO();
    method public java.lang.ProcessBuilder redirectError(java.lang.ProcessBuilder.Redirect);
    method public java.lang.ProcessBuilder redirectError(java.io.File);
    method public java.lang.ProcessBuilder.Redirect redirectError();
    method public boolean redirectErrorStream();
    method public java.lang.ProcessBuilder redirectErrorStream(boolean);
    method public java.lang.ProcessBuilder redirectInput(java.lang.ProcessBuilder.Redirect);
    method public java.lang.ProcessBuilder redirectInput(java.io.File);
    method public java.lang.ProcessBuilder.Redirect redirectInput();
    method public java.lang.ProcessBuilder redirectOutput(java.lang.ProcessBuilder.Redirect);
    method public java.lang.ProcessBuilder redirectOutput(java.io.File);
    method public java.lang.ProcessBuilder.Redirect redirectOutput();
    method public java.lang.Process start() throws java.io.IOException;
  }

  public static abstract 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 static final class ProcessBuilder.Redirect.Type extends java.lang.Enum {
    method public static java.lang.ProcessBuilder.Redirect.Type valueOf(java.lang.String);
    method public static final java.lang.ProcessBuilder.Redirect.Type[] values();
    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 abstract interface Readable {
    method public abstract int read(java.nio.CharBuffer) throws java.io.IOException;
  }

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

  public abstract interface Runnable {
    method public abstract void run();
  }

  public class Runtime {
    method public void addShutdownHook(java.lang.Thread);
    method public int availableProcessors();
    method public java.lang.Process exec(java.lang.String) throws java.io.IOException;
    method public java.lang.Process exec(java.lang.String, java.lang.String[]) throws java.io.IOException;
    method public java.lang.Process exec(java.lang.String, java.lang.String[], java.io.File) throws java.io.IOException;
    method public java.lang.Process exec(java.lang.String[]) throws java.io.IOException;
    method public java.lang.Process exec(java.lang.String[], java.lang.String[]) throws java.io.IOException;
    method public java.lang.Process exec(java.lang.String[], java.lang.String[], java.io.File) throws java.io.IOException;
    method public void exit(int);
    method public long freeMemory();
    method public void gc();
    method public deprecated java.io.InputStream getLocalizedInputStream(java.io.InputStream);
    method public deprecated java.io.OutputStream getLocalizedOutputStream(java.io.OutputStream);
    method public static java.lang.Runtime getRuntime();
    method public void halt(int);
    method public void load(java.lang.String);
    method public void loadLibrary(java.lang.String);
    method public long maxMemory();
    method public boolean removeShutdownHook(java.lang.Thread);
    method public void runFinalization();
    method public static deprecated 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(java.lang.String);
    ctor public RuntimeException(java.lang.String, java.lang.Throwable);
    ctor public RuntimeException(java.lang.Throwable);
    ctor protected RuntimeException(java.lang.String, java.lang.Throwable, boolean, boolean);
  }

  public final class RuntimePermission extends java.security.BasicPermission {
    ctor public RuntimePermission(java.lang.String);
    ctor public RuntimePermission(java.lang.String, java.lang.String);
  }

  public abstract class SafeVarargs implements java.lang.annotation.Annotation {
  }

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

  public class SecurityManager {
    ctor public SecurityManager();
    method public void checkAccept(java.lang.String, int);
    method public void checkAccess(java.lang.Thread);
    method public void checkAccess(java.lang.ThreadGroup);
    method public void checkAwtEventQueueAccess();
    method public void checkConnect(java.lang.String, int);
    method public void checkConnect(java.lang.String, int, java.lang.Object);
    method public void checkCreateClassLoader();
    method public void checkDelete(java.lang.String);
    method public void checkExec(java.lang.String);
    method public void checkExit(int);
    method public void checkLink(java.lang.String);
    method public void checkListen(int);
    method public void checkMemberAccess(java.lang.Class<?>, int);
    method public void checkMulticast(java.net.InetAddress);
    method public deprecated void checkMulticast(java.net.InetAddress, byte);
    method public void checkPackageAccess(java.lang.String);
    method public void checkPackageDefinition(java.lang.String);
    method public void checkPermission(java.security.Permission);
    method public void checkPermission(java.security.Permission, java.lang.Object);
    method public void checkPrintJobAccess();
    method public void checkPropertiesAccess();
    method public void checkPropertyAccess(java.lang.String);
    method public void checkRead(java.io.FileDescriptor);
    method public void checkRead(java.lang.String);
    method public void checkRead(java.lang.String, java.lang.Object);
    method public void checkSecurityAccess(java.lang.String);
    method public void checkSetFactory();
    method public void checkSystemClipboardAccess();
    method public boolean checkTopLevelWindow(java.lang.Object);
    method public void checkWrite(java.io.FileDescriptor);
    method public void checkWrite(java.lang.String);
    method protected deprecated int classDepth(java.lang.String);
    method protected deprecated int classLoaderDepth();
    method protected deprecated java.lang.ClassLoader currentClassLoader();
    method protected deprecated java.lang.Class<?> currentLoadedClass();
    method protected java.lang.Class[] getClassContext();
    method public deprecated boolean getInCheck();
    method public java.lang.Object getSecurityContext();
    method public java.lang.ThreadGroup getThreadGroup();
    method protected deprecated boolean inClass(java.lang.String);
    method protected deprecated boolean inClassLoader();
    field protected deprecated boolean inCheck;
  }

  public final class Short extends java.lang.Number implements java.lang.Comparable {
    ctor public Short(short);
    ctor public Short(java.lang.String) throws java.lang.NumberFormatException;
    method public static int compare(short, short);
    method public int compareTo(java.lang.Short);
    method public static java.lang.Short decode(java.lang.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(java.lang.String, int) throws java.lang.NumberFormatException;
    method public static short parseShort(java.lang.String) throws java.lang.NumberFormatException;
    method public static short reverseBytes(short);
    method public static java.lang.String toString(short);
    method public static int toUnsignedInt(short);
    method public static long toUnsignedLong(short);
    method public static java.lang.Short valueOf(java.lang.String, int) throws java.lang.NumberFormatException;
    method public static java.lang.Short valueOf(java.lang.String) throws java.lang.NumberFormatException;
    method public static java.lang.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 java.lang.Class<java.lang.Short> TYPE;
  }

  public class StackOverflowError extends java.lang.VirtualMachineError {
    ctor public StackOverflowError();
    ctor public StackOverflowError(java.lang.String);
  }

  public final class StackTraceElement implements java.io.Serializable {
    ctor public StackTraceElement(java.lang.String, java.lang.String, java.lang.String, int);
    method public java.lang.String getClassName();
    method public java.lang.String getFileName();
    method public int getLineNumber();
    method public java.lang.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.io.Serializable {
    ctor public String();
    ctor public String(java.lang.String);
    ctor public String(char[]);
    ctor public String(char[], int, int);
    ctor public String(int[], int, int);
    ctor public deprecated String(byte[], int, int, int);
    ctor public deprecated String(byte[], int);
    ctor public String(byte[], int, int, java.lang.String) throws java.io.UnsupportedEncodingException;
    ctor public String(byte[], int, int, java.nio.charset.Charset);
    ctor public String(byte[], java.lang.String) throws java.io.UnsupportedEncodingException;
    ctor public String(byte[], java.nio.charset.Charset);
    ctor public String(byte[], int, int);
    ctor public String(byte[]);
    ctor public String(java.lang.StringBuffer);
    ctor public String(java.lang.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(java.lang.String);
    method public int compareToIgnoreCase(java.lang.String);
    method public java.lang.String concat(java.lang.String);
    method public boolean contains(java.lang.CharSequence);
    method public boolean contentEquals(java.lang.StringBuffer);
    method public boolean contentEquals(java.lang.CharSequence);
    method public static java.lang.String copyValueOf(char[], int, int);
    method public static java.lang.String copyValueOf(char[]);
    method public boolean endsWith(java.lang.String);
    method public boolean equalsIgnoreCase(java.lang.String);
    method public static java.lang.String format(java.lang.String, java.lang.Object...);
    method public static java.lang.String format(java.util.Locale, java.lang.String, java.lang.Object...);
    method public deprecated void getBytes(int, int, byte[], int);
    method public byte[] getBytes(java.lang.String) throws java.io.UnsupportedEncodingException;
    method public byte[] getBytes(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(java.lang.String);
    method public int indexOf(java.lang.String, int);
    method public java.lang.String intern();
    method public boolean isEmpty();
    method public static java.lang.String join(java.lang.CharSequence, java.lang.CharSequence...);
    method public static java.lang.String join(java.lang.CharSequence, java.lang.Iterable<? extends java.lang.CharSequence>);
    method public int lastIndexOf(int);
    method public int lastIndexOf(int, int);
    method public int lastIndexOf(java.lang.String);
    method public int lastIndexOf(java.lang.String, int);
    method public int length();
    method public boolean matches(java.lang.String);
    method public int offsetByCodePoints(int, int);
    method public boolean regionMatches(int, java.lang.String, int, int);
    method public boolean regionMatches(boolean, int, java.lang.String, int, int);
    method public java.lang.String replace(char, char);
    method public java.lang.String replace(java.lang.CharSequence, java.lang.CharSequence);
    method public java.lang.String replaceAll(java.lang.String, java.lang.String);
    method public java.lang.String replaceFirst(java.lang.String, java.lang.String);
    method public java.lang.String[] split(java.lang.String, int);
    method public java.lang.String[] split(java.lang.String);
    method public boolean startsWith(java.lang.String, int);
    method public boolean startsWith(java.lang.String);
    method public java.lang.CharSequence subSequence(int, int);
    method public java.lang.String substring(int);
    method public java.lang.String substring(int, int);
    method public char[] toCharArray();
    method public java.lang.String toLowerCase(java.util.Locale);
    method public java.lang.String toLowerCase();
    method public java.lang.String toUpperCase(java.util.Locale);
    method public java.lang.String toUpperCase();
    method public java.lang.String trim();
    method public static java.lang.String valueOf(java.lang.Object);
    method public static java.lang.String valueOf(char[]);
    method public static java.lang.String valueOf(char[], int, int);
    method public static java.lang.String valueOf(boolean);
    method public static java.lang.String valueOf(char);
    method public static java.lang.String valueOf(int);
    method public static java.lang.String valueOf(long);
    method public static java.lang.String valueOf(float);
    method public static java.lang.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(java.lang.String);
    ctor public StringBuffer(java.lang.CharSequence);
    method public synchronized java.lang.StringBuffer append(java.lang.Object);
    method public synchronized java.lang.StringBuffer append(java.lang.String);
    method public synchronized java.lang.StringBuffer append(java.lang.StringBuffer);
    method public synchronized java.lang.StringBuffer append(java.lang.CharSequence);
    method public synchronized java.lang.StringBuffer append(java.lang.CharSequence, int, int);
    method public synchronized java.lang.StringBuffer append(char[]);
    method public synchronized java.lang.StringBuffer append(char[], int, int);
    method public synchronized java.lang.StringBuffer append(boolean);
    method public synchronized java.lang.StringBuffer append(char);
    method public synchronized java.lang.StringBuffer append(int);
    method public synchronized java.lang.StringBuffer append(long);
    method public synchronized java.lang.StringBuffer append(float);
    method public synchronized java.lang.StringBuffer append(double);
    method public synchronized java.lang.StringBuffer appendCodePoint(int);
    method public synchronized int capacity();
    method public synchronized char charAt(int);
    method public synchronized int codePointAt(int);
    method public synchronized int codePointBefore(int);
    method public synchronized int codePointCount(int, int);
    method public synchronized java.lang.StringBuffer delete(int, int);
    method public synchronized java.lang.StringBuffer deleteCharAt(int);
    method public synchronized void ensureCapacity(int);
    method public synchronized void getChars(int, int, char[], int);
    method public int indexOf(java.lang.String);
    method public synchronized int indexOf(java.lang.String, int);
    method public synchronized java.lang.StringBuffer insert(int, char[], int, int);
    method public synchronized java.lang.StringBuffer insert(int, java.lang.Object);
    method public synchronized java.lang.StringBuffer insert(int, java.lang.String);
    method public synchronized java.lang.StringBuffer insert(int, char[]);
    method public java.lang.StringBuffer insert(int, java.lang.CharSequence);
    method public synchronized java.lang.StringBuffer insert(int, java.lang.CharSequence, int, int);
    method public java.lang.StringBuffer insert(int, boolean);
    method public synchronized java.lang.StringBuffer insert(int, char);
    method public java.lang.StringBuffer insert(int, int);
    method public java.lang.StringBuffer insert(int, long);
    method public java.lang.StringBuffer insert(int, float);
    method public java.lang.StringBuffer insert(int, double);
    method public int lastIndexOf(java.lang.String);
    method public synchronized int lastIndexOf(java.lang.String, int);
    method public synchronized int length();
    method public synchronized int offsetByCodePoints(int, int);
    method public synchronized java.lang.StringBuffer replace(int, int, java.lang.String);
    method public synchronized java.lang.StringBuffer reverse();
    method public synchronized void setCharAt(int, char);
    method public synchronized void setLength(int);
    method public synchronized java.lang.CharSequence subSequence(int, int);
    method public synchronized java.lang.String substring(int);
    method public synchronized java.lang.String substring(int, int);
    method public synchronized java.lang.String toString();
    method public synchronized 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(java.lang.String);
    ctor public StringBuilder(java.lang.CharSequence);
    method public java.lang.StringBuilder append(java.lang.Object);
    method public java.lang.StringBuilder append(java.lang.String);
    method public java.lang.StringBuilder append(java.lang.StringBuffer);
    method public java.lang.StringBuilder append(java.lang.CharSequence);
    method public java.lang.StringBuilder append(java.lang.CharSequence, int, int);
    method public java.lang.StringBuilder append(char[]);
    method public java.lang.StringBuilder append(char[], int, int);
    method public java.lang.StringBuilder append(boolean);
    method public java.lang.StringBuilder append(char);
    method public java.lang.StringBuilder append(int);
    method public java.lang.StringBuilder append(long);
    method public java.lang.StringBuilder append(float);
    method public java.lang.StringBuilder append(double);
    method public java.lang.StringBuilder appendCodePoint(int);
    method public java.lang.StringBuilder delete(int, int);
    method public java.lang.StringBuilder deleteCharAt(int);
    method public int indexOf(java.lang.String);
    method public int indexOf(java.lang.String, int);
    method public java.lang.StringBuilder insert(int, char[], int, int);
    method public java.lang.StringBuilder insert(int, java.lang.Object);
    method public java.lang.StringBuilder insert(int, java.lang.String);
    method public java.lang.StringBuilder insert(int, char[]);
    method public java.lang.StringBuilder insert(int, java.lang.CharSequence);
    method public java.lang.StringBuilder insert(int, java.lang.CharSequence, int, int);
    method public java.lang.StringBuilder insert(int, boolean);
    method public java.lang.StringBuilder insert(int, char);
    method public java.lang.StringBuilder insert(int, int);
    method public java.lang.StringBuilder insert(int, long);
    method public java.lang.StringBuilder insert(int, float);
    method public java.lang.StringBuilder insert(int, double);
    method public int lastIndexOf(java.lang.String);
    method public int lastIndexOf(java.lang.String, int);
    method public java.lang.StringBuilder replace(int, int, java.lang.String);
    method public java.lang.StringBuilder reverse();
  }

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

  public abstract class SuppressWarnings implements java.lang.annotation.Annotation {
  }

  public final class System {
    method public static void arraycopy(java.lang.Object, int, java.lang.Object, int, int);
    method public static java.lang.String clearProperty(java.lang.String);
    method public static java.io.Console console();
    method public static long currentTimeMillis();
    method public static void exit(int);
    method public static void gc();
    method public static java.util.Properties getProperties();
    method public static java.lang.String getProperty(java.lang.String);
    method public static java.lang.String getProperty(java.lang.String, java.lang.String);
    method public static java.lang.SecurityManager getSecurityManager();
    method public static java.lang.String getenv(java.lang.String);
    method public static java.util.Map<java.lang.String, java.lang.String> getenv();
    method public static int identityHashCode(java.lang.Object);
    method public static java.nio.channels.Channel inheritedChannel() throws java.io.IOException;
    method public static java.lang.String lineSeparator();
    method public static void load(java.lang.String);
    method public static void loadLibrary(java.lang.String);
    method public static java.lang.String mapLibraryName(java.lang.String);
    method public static long nanoTime();
    method public static void runFinalization();
    method public static deprecated void runFinalizersOnExit(boolean);
    method public static void setErr(java.io.PrintStream);
    method public static void setIn(java.io.InputStream);
    method public static void setOut(java.io.PrintStream);
    method public static void setProperties(java.util.Properties);
    method public static java.lang.String setProperty(java.lang.String, java.lang.String);
    method public static void setSecurityManager(java.lang.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(java.lang.Runnable);
    ctor public Thread(java.lang.ThreadGroup, java.lang.Runnable);
    ctor public Thread(java.lang.String);
    ctor public Thread(java.lang.ThreadGroup, java.lang.String);
    ctor public Thread(java.lang.Runnable, java.lang.String);
    ctor public Thread(java.lang.ThreadGroup, java.lang.Runnable, java.lang.String);
    ctor public Thread(java.lang.ThreadGroup, java.lang.Runnable, java.lang.String, long);
    method public static int activeCount();
    method public final void checkAccess();
    method public deprecated int countStackFrames();
    method public static java.lang.Thread currentThread();
    method public deprecated void destroy();
    method public static void dumpStack();
    method public static int enumerate(java.lang.Thread[]);
    method public static java.util.Map<java.lang.Thread, java.lang.StackTraceElement[]> getAllStackTraces();
    method public java.lang.ClassLoader getContextClassLoader();
    method public static java.lang.Thread.UncaughtExceptionHandler getDefaultUncaughtExceptionHandler();
    method public long getId();
    method public final java.lang.String getName();
    method public final int getPriority();
    method public java.lang.StackTraceElement[] getStackTrace();
    method public java.lang.Thread.State getState();
    method public final java.lang.ThreadGroup getThreadGroup();
    method public java.lang.Thread.UncaughtExceptionHandler getUncaughtExceptionHandler();
    method public static boolean holdsLock(java.lang.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 public final deprecated void resume();
    method public void run();
    method public void setContextClassLoader(java.lang.ClassLoader);
    method public final void setDaemon(boolean);
    method public static void setDefaultUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler);
    method public final synchronized void setName(java.lang.String);
    method public final void setPriority(int);
    method public void setUncaughtExceptionHandler(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 synchronized void start();
    method public final deprecated void stop();
    method public final deprecated synchronized void stop(java.lang.Throwable);
    method public final deprecated 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 static final class Thread.State extends java.lang.Enum {
    method public static java.lang.Thread.State valueOf(java.lang.String);
    method public static final java.lang.Thread.State[] values();
    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;
  }

  public static abstract interface Thread.UncaughtExceptionHandler {
    method public abstract void uncaughtException(java.lang.Thread, java.lang.Throwable);
  }

  public class ThreadDeath extends java.lang.Error {
    ctor public ThreadDeath();
  }

  public class ThreadGroup implements java.lang.Thread.UncaughtExceptionHandler {
    ctor public ThreadGroup(java.lang.String);
    ctor public ThreadGroup(java.lang.ThreadGroup, java.lang.String);
    method public int activeCount();
    method public int activeGroupCount();
    method public deprecated boolean allowThreadSuspension(boolean);
    method public final void checkAccess();
    method public final void destroy();
    method public int enumerate(java.lang.Thread[]);
    method public int enumerate(java.lang.Thread[], boolean);
    method public int enumerate(java.lang.ThreadGroup[]);
    method public int enumerate(java.lang.ThreadGroup[], boolean);
    method public final int getMaxPriority();
    method public final java.lang.String getName();
    method public final java.lang.ThreadGroup getParent();
    method public final void interrupt();
    method public final boolean isDaemon();
    method public synchronized boolean isDestroyed();
    method public void list();
    method public final boolean parentOf(java.lang.ThreadGroup);
    method public final deprecated void resume();
    method public final void setDaemon(boolean);
    method public final void setMaxPriority(int);
    method public final deprecated void stop();
    method public final deprecated void suspend();
    method public void uncaughtException(java.lang.Thread, java.lang.Throwable);
  }

  public class ThreadLocal<T> {
    ctor public ThreadLocal();
    method public T get();
    method protected T initialValue();
    method public void remove();
    method public void set(T);
    method public static <S> java.lang.ThreadLocal<S> withInitial(java.util.function.Supplier<? extends S>);
  }

  public class Throwable implements java.io.Serializable {
    ctor public Throwable();
    ctor public Throwable(java.lang.String);
    ctor public Throwable(java.lang.String, java.lang.Throwable);
    ctor public Throwable(java.lang.Throwable);
    ctor protected Throwable(java.lang.String, java.lang.Throwable, boolean, boolean);
    method public final synchronized void addSuppressed(java.lang.Throwable);
    method public synchronized java.lang.Throwable fillInStackTrace();
    method public synchronized java.lang.Throwable getCause();
    method public java.lang.String getLocalizedMessage();
    method public java.lang.String getMessage();
    method public java.lang.StackTraceElement[] getStackTrace();
    method public final synchronized java.lang.Throwable[] getSuppressed();
    method public synchronized java.lang.Throwable initCause(java.lang.Throwable);
    method public void printStackTrace();
    method public void printStackTrace(java.io.PrintStream);
    method public void printStackTrace(java.io.PrintWriter);
    method public void setStackTrace(java.lang.StackTraceElement[]);
  }

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

  public class UnknownError extends java.lang.VirtualMachineError {
    ctor public UnknownError();
    ctor public UnknownError(java.lang.String);
  }

  public class UnsatisfiedLinkError extends java.lang.LinkageError {
    ctor public UnsatisfiedLinkError();
    ctor public UnsatisfiedLinkError(java.lang.String);
  }

  public class UnsupportedClassVersionError extends java.lang.ClassFormatError {
    ctor public UnsupportedClassVersionError();
    ctor public UnsupportedClassVersionError(java.lang.String);
  }

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

  public class VerifyError extends java.lang.LinkageError {
    ctor public VerifyError();
    ctor public VerifyError(java.lang.String);
  }

  public abstract class VirtualMachineError extends java.lang.Error {
    ctor public VirtualMachineError();
    ctor public VirtualMachineError(java.lang.String);
    ctor public VirtualMachineError(java.lang.String, java.lang.Throwable);
    ctor public VirtualMachineError(java.lang.Throwable);
  }

  public final class Void {
    field public static final java.lang.Class<java.lang.Void> TYPE;
  }

}

package java.lang.annotation {

  public abstract interface Annotation {
    method public abstract java.lang.Class<? extends java.lang.annotation.Annotation> annotationType();
    method public abstract boolean equals(java.lang.Object);
    method public abstract int hashCode();
    method public abstract java.lang.String toString();
  }

  public class AnnotationFormatError extends java.lang.Error {
    ctor public AnnotationFormatError(java.lang.String);
    ctor public AnnotationFormatError(java.lang.String, java.lang.Throwable);
    ctor public AnnotationFormatError(java.lang.Throwable);
  }

  public class AnnotationTypeMismatchException extends java.lang.RuntimeException {
    ctor public AnnotationTypeMismatchException(java.lang.reflect.Method, java.lang.String);
    method public java.lang.reflect.Method element();
    method public java.lang.String foundType();
  }

  public abstract class Documented implements java.lang.annotation.Annotation {
  }

  public final class ElementType extends java.lang.Enum {
    method public static java.lang.annotation.ElementType valueOf(java.lang.String);
    method public static final java.lang.annotation.ElementType[] values();
    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(java.lang.Class<? extends java.lang.annotation.Annotation>, java.lang.String);
    method public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType();
    method public java.lang.String elementName();
  }

  public abstract class Inherited implements java.lang.annotation.Annotation {
  }

  public abstract class Native implements java.lang.annotation.Annotation {
  }

  public abstract class Repeatable implements java.lang.annotation.Annotation {
  }

  public abstract class Retention implements java.lang.annotation.Annotation {
  }

  public final class RetentionPolicy extends java.lang.Enum {
    method public static java.lang.annotation.RetentionPolicy valueOf(java.lang.String);
    method public static final java.lang.annotation.RetentionPolicy[] values();
    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;
  }

  public abstract class Target implements java.lang.annotation.Annotation {
  }

}

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(java.lang.String);
    ctor public LambdaConversionException(java.lang.String, java.lang.Throwable);
    ctor public LambdaConversionException(java.lang.Throwable);
    ctor public LambdaConversionException(java.lang.String, java.lang.Throwable, boolean, boolean);
  }

  public abstract class MethodHandle {
    method public java.lang.invoke.MethodHandle asCollector(java.lang.Class<?>, int);
    method public java.lang.invoke.MethodHandle asFixedArity();
    method public java.lang.invoke.MethodHandle asSpreader(java.lang.Class<?>, int);
    method public java.lang.invoke.MethodHandle asType(java.lang.invoke.MethodType);
    method public java.lang.invoke.MethodHandle asVarargsCollector(java.lang.Class<?>);
    method public java.lang.invoke.MethodHandle bindTo(java.lang.Object);
    method public final java.lang.Object invoke(java.lang.Object...) throws java.lang.Throwable;
    method public final java.lang.Object invokeExact(java.lang.Object...) throws java.lang.Throwable;
    method public java.lang.Object invokeWithArguments(java.lang.Object...) throws java.lang.Throwable;
    method public java.lang.Object invokeWithArguments(java.util.List<?>) throws java.lang.Throwable;
    method public boolean isVarargsCollector();
    method public java.lang.invoke.MethodType type();
  }

  public abstract interface MethodHandleInfo {
    method public abstract java.lang.Class<?> getDeclaringClass();
    method public abstract java.lang.invoke.MethodType getMethodType();
    method public abstract int getModifiers();
    method public abstract java.lang.String getName();
    method public abstract int getReferenceKind();
    method public default boolean isVarArgs();
    method public static boolean refKindIsField(int);
    method public static boolean refKindIsValid(int);
    method public static java.lang.String refKindName(int);
    method public static java.lang.String referenceKindToString(int);
    method public abstract <T extends java.lang.reflect.Member> T reflectAs(java.lang.Class<T>, java.lang.invoke.MethodHandles.Lookup);
    method public static java.lang.String toString(int, java.lang.Class<?>, java.lang.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(java.lang.Class<?>) throws java.lang.IllegalArgumentException;
    method public static java.lang.invoke.MethodHandle arrayElementSetter(java.lang.Class<?>) throws java.lang.IllegalArgumentException;
    method public static java.lang.invoke.MethodHandle catchException(java.lang.invoke.MethodHandle, java.lang.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(java.lang.Class<?>, java.lang.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, java.lang.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(java.lang.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(java.lang.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(java.lang.Class<?>, java.lang.Class<? extends java.lang.Throwable>);
  }

  public static final class MethodHandles.Lookup {
    method public java.lang.invoke.MethodHandle bind(java.lang.Object, java.lang.String, java.lang.invoke.MethodType) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
    method public java.lang.invoke.MethodHandle findConstructor(java.lang.Class<?>, java.lang.invoke.MethodType) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
    method public java.lang.invoke.MethodHandle findGetter(java.lang.Class<?>, java.lang.String, java.lang.Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException;
    method public java.lang.invoke.MethodHandle findSetter(java.lang.Class<?>, java.lang.String, java.lang.Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException;
    method public java.lang.invoke.MethodHandle findSpecial(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType, java.lang.Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
    method public java.lang.invoke.MethodHandle findStatic(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
    method public java.lang.invoke.MethodHandle findStaticGetter(java.lang.Class<?>, java.lang.String, java.lang.Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException;
    method public java.lang.invoke.MethodHandle findStaticSetter(java.lang.Class<?>, java.lang.String, java.lang.Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException;
    method public java.lang.invoke.MethodHandle findVirtual(java.lang.Class<?>, java.lang.String, java.lang.invoke.MethodType) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
    method public java.lang.invoke.MethodHandles.Lookup in(java.lang.Class<?>);
    method public java.lang.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, java.lang.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(java.lang.Class<?>...);
    method public java.lang.invoke.MethodType appendParameterTypes(java.util.List<java.lang.Class<?>>);
    method public java.lang.invoke.MethodType changeParameterType(int, java.lang.Class<?>);
    method public java.lang.invoke.MethodType changeReturnType(java.lang.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(java.lang.String, java.lang.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, java.lang.Class<?>...);
    method public java.lang.invoke.MethodType insertParameterTypes(int, java.util.List<java.lang.Class<?>>);
    method public static java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.lang.Class<?>[]);
    method public static java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.util.List<java.lang.Class<?>>);
    method public static java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.lang.Class<?>, java.lang.Class<?>...);
    method public static java.lang.invoke.MethodType methodType(java.lang.Class<?>);
    method public static java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.lang.Class<?>);
    method public static java.lang.invoke.MethodType methodType(java.lang.Class<?>, java.lang.invoke.MethodType);
    method public java.lang.Class<?>[] parameterArray();
    method public int parameterCount();
    method public java.util.List<java.lang.Class<?>> parameterList();
    method public java.lang.Class<?> parameterType(int);
    method public java.lang.Class<?> returnType();
    method public java.lang.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(java.lang.String);
  }

}

package java.lang.ref {

  public class PhantomReference<T> extends java.lang.ref.Reference {
    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(java.lang.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 {
    ctor public SoftReference(T);
    ctor public SoftReference(T, java.lang.ref.ReferenceQueue<? super T>);
  }

  public class WeakReference<T> extends java.lang.ref.Reference {
    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 public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T>);
    method public java.lang.annotation.Annotation[] getAnnotations();
    method 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 abstract interface AnnotatedElement {
    method public abstract <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T>);
    method public abstract java.lang.annotation.Annotation[] getAnnotations();
    method public default <T extends java.lang.annotation.Annotation> T[] getAnnotationsByType(java.lang.Class<T>);
    method public default <T extends java.lang.annotation.Annotation> T getDeclaredAnnotation(java.lang.Class<T>);
    method public abstract java.lang.annotation.Annotation[] getDeclaredAnnotations();
    method public default <T extends java.lang.annotation.Annotation> T[] getDeclaredAnnotationsByType(java.lang.Class<T>);
    method public default boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation>);
  }

  public final class Array {
    method public static java.lang.Object get(java.lang.Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static boolean getBoolean(java.lang.Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static byte getByte(java.lang.Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static char getChar(java.lang.Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static double getDouble(java.lang.Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static float getFloat(java.lang.Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static int getInt(java.lang.Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static int getLength(java.lang.Object);
    method public static long getLong(java.lang.Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static short getShort(java.lang.Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static java.lang.Object newInstance(java.lang.Class<?>, int) throws java.lang.NegativeArraySizeException;
    method public static java.lang.Object newInstance(java.lang.Class<?>, int...) throws java.lang.IllegalArgumentException, java.lang.NegativeArraySizeException;
    method public static void set(java.lang.Object, int, java.lang.Object) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setBoolean(java.lang.Object, int, boolean);
    method public static void setByte(java.lang.Object, int, byte) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setChar(java.lang.Object, int, char) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setDouble(java.lang.Object, int, double) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setFloat(java.lang.Object, int, float) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setInt(java.lang.Object, int, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setLong(java.lang.Object, int, long) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
    method public static void setShort(java.lang.Object, int, short) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
  }

  public final class Constructor<T> extends java.lang.reflect.Executable {
    method public java.lang.Class<T> getDeclaringClass();
    method public java.lang.Class<?>[] getExceptionTypes();
    method public int getModifiers();
    method public java.lang.String getName();
    method public java.lang.annotation.Annotation[][] getParameterAnnotations();
    method public java.lang.Class<?>[] getParameterTypes();
    method public java.lang.reflect.TypeVariable<java.lang.reflect.Constructor<T>>[] getTypeParameters();
    method public T newInstance(java.lang.Object...) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException;
    method public java.lang.String toGenericString();
  }

  public abstract class Executable extends java.lang.reflect.AccessibleObject implements java.lang.reflect.GenericDeclaration java.lang.reflect.Member {
    method public abstract java.lang.Class<?>[] getExceptionTypes();
    method public java.lang.reflect.Type[] getGenericExceptionTypes();
    method public java.lang.reflect.Type[] getGenericParameterTypes();
    method public abstract java.lang.annotation.Annotation[][] getParameterAnnotations();
    method public int getParameterCount();
    method public abstract java.lang.Class<?>[] getParameterTypes();
    method public java.lang.reflect.Parameter[] getParameters();
    method public final boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation>);
    method public boolean isSynthetic();
    method public boolean isVarArgs();
    method public abstract java.lang.String toGenericString();
  }

  public final class Field extends java.lang.reflect.AccessibleObject implements java.lang.reflect.Member {
    method public java.lang.Object get(java.lang.Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public boolean getBoolean(java.lang.Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public byte getByte(java.lang.Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public char getChar(java.lang.Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public java.lang.Class<?> getDeclaringClass();
    method public double getDouble(java.lang.Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public float getFloat(java.lang.Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public java.lang.reflect.Type getGenericType();
    method public int getInt(java.lang.Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public long getLong(java.lang.Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public int getModifiers();
    method public java.lang.String getName();
    method public short getShort(java.lang.Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public java.lang.Class<?> getType();
    method public boolean isEnumConstant();
    method public boolean isSynthetic();
    method public void set(java.lang.Object, java.lang.Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setBoolean(java.lang.Object, boolean) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setByte(java.lang.Object, byte) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setChar(java.lang.Object, char) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setDouble(java.lang.Object, double) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setFloat(java.lang.Object, float) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setInt(java.lang.Object, int) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setLong(java.lang.Object, long) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public void setShort(java.lang.Object, short) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
    method public java.lang.String toGenericString();
  }

  public abstract interface GenericArrayType implements java.lang.reflect.Type {
    method public abstract java.lang.reflect.Type getGenericComponentType();
  }

  public abstract interface GenericDeclaration implements java.lang.reflect.AnnotatedElement {
    method public abstract java.lang.reflect.TypeVariable<?>[] getTypeParameters();
  }

  public class GenericSignatureFormatError extends java.lang.ClassFormatError {
    ctor public GenericSignatureFormatError();
    ctor public GenericSignatureFormatError(java.lang.String);
  }

  public abstract interface InvocationHandler {
    method public abstract java.lang.Object invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) throws java.lang.Throwable;
  }

  public class InvocationTargetException extends java.lang.ReflectiveOperationException {
    ctor protected InvocationTargetException();
    ctor public InvocationTargetException(java.lang.Throwable);
    ctor public InvocationTargetException(java.lang.Throwable, java.lang.String);
    method public java.lang.Throwable getCause();
    method public java.lang.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(java.lang.String);
  }

  public abstract interface Member {
    method public abstract java.lang.Class<?> getDeclaringClass();
    method public abstract int getModifiers();
    method public abstract java.lang.String getName();
    method public abstract 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 public java.lang.Class<?> getDeclaringClass();
    method public java.lang.Object getDefaultValue();
    method public java.lang.Class<?>[] getExceptionTypes();
    method public java.lang.reflect.Type getGenericReturnType();
    method public int getModifiers();
    method public java.lang.String getName();
    method public java.lang.annotation.Annotation[][] getParameterAnnotations();
    method public java.lang.Class<?>[] getParameterTypes();
    method public java.lang.Class<?> getReturnType();
    method public java.lang.reflect.TypeVariable<java.lang.reflect.Method>[] getTypeParameters();
    method public java.lang.Object invoke(java.lang.Object, java.lang.Object...) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException;
    method public boolean isBridge();
    method public boolean isDefault();
    method public java.lang.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 java.lang.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 public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T>);
    method public java.lang.annotation.Annotation[] getAnnotations();
    method public java.lang.annotation.Annotation[] getDeclaredAnnotations();
    method public java.lang.reflect.Executable getDeclaringExecutable();
    method public int getModifiers();
    method public java.lang.String getName();
    method public java.lang.reflect.Type getParameterizedType();
    method public java.lang.Class<?> getType();
    method public boolean isImplicit();
    method public boolean isNamePresent();
    method public boolean isSynthetic();
    method public boolean isVarArgs();
  }

  public abstract interface ParameterizedType implements java.lang.reflect.Type {
    method public abstract java.lang.reflect.Type[] getActualTypeArguments();
    method public abstract java.lang.reflect.Type getOwnerType();
    method public abstract java.lang.reflect.Type getRawType();
  }

  public class Proxy implements java.io.Serializable {
    ctor protected Proxy(java.lang.reflect.InvocationHandler);
    method public static java.lang.reflect.InvocationHandler getInvocationHandler(java.lang.Object) throws java.lang.IllegalArgumentException;
    method public static java.lang.Class<?> getProxyClass(java.lang.ClassLoader, java.lang.Class<?>...) throws java.lang.IllegalArgumentException;
    method public static boolean isProxyClass(java.lang.Class<?>);
    method public static java.lang.Object newProxyInstance(java.lang.ClassLoader, java.lang.Class<?>[], 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(java.lang.String);
    ctor public ReflectPermission(java.lang.String, java.lang.String);
  }

  public abstract interface Type {
    method public default java.lang.String getTypeName();
  }

  public abstract interface TypeVariable<D extends java.lang.reflect.GenericDeclaration> implements java.lang.reflect.Type {
    method public abstract java.lang.reflect.Type[] getBounds();
    method public abstract D getGenericDeclaration();
    method public abstract java.lang.String getName();
  }

  public class UndeclaredThrowableException extends java.lang.RuntimeException {
    ctor public UndeclaredThrowableException(java.lang.Throwable);
    ctor public UndeclaredThrowableException(java.lang.Throwable, java.lang.String);
    method public java.lang.Throwable getCause();
    method public java.lang.Throwable getUndeclaredThrowable();
  }

  public abstract interface WildcardType implements java.lang.reflect.Type {
    method public abstract java.lang.reflect.Type[] getLowerBounds();
    method public abstract java.lang.reflect.Type[] getUpperBounds();
  }

}

package java.math {

  public class BigDecimal extends java.lang.Number implements java.lang.Comparable 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(java.lang.String);
    ctor public BigDecimal(java.lang.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 java.lang.String toEngineeringString();
    method public java.lang.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.io.Serializable {
    ctor public BigInteger(int, java.util.Random);
    ctor public BigInteger(int, int, java.util.Random);
    ctor public BigInteger(java.lang.String);
    ctor public BigInteger(java.lang.String, int);
    ctor public BigInteger(int, byte[]);
    ctor public BigInteger(byte[]);
    method public java.math.BigInteger abs();
    method public java.math.BigInteger add(java.math.BigInteger);
    method public java.math.BigInteger and(java.math.BigInteger);
    method public java.math.BigInteger andNot(java.math.BigInteger);
    method public int bitCount();
    method public int bitLength();
    method public java.math.BigInteger clearBit(int);
    method public int compareTo(java.math.BigInteger);
    method public java.math.BigInteger divide(java.math.BigInteger);
    method public java.math.BigInteger[] divideAndRemainder(java.math.BigInteger);
    method public double doubleValue();
    method public java.math.BigInteger flipBit(int);
    method public float floatValue();
    method public java.math.BigInteger gcd(java.math.BigInteger);
    method public int getLowestSetBit();
    method public int intValue();
    method public boolean isProbablePrime(int);
    method public long longValue();
    method public java.math.BigInteger max(java.math.BigInteger);
    method public java.math.BigInteger min(java.math.BigInteger);
    method public java.math.BigInteger mod(java.math.BigInteger);
    method public java.math.BigInteger modInverse(java.math.BigInteger);
    method public java.math.BigInteger modPow(java.math.BigInteger, java.math.BigInteger);
    method public java.math.BigInteger multiply(java.math.BigInteger);
    method public java.math.BigInteger negate();
    method public java.math.BigInteger nextProbablePrime();
    method public java.math.BigInteger not();
    method public java.math.BigInteger or(java.math.BigInteger);
    method public java.math.BigInteger pow(int);
    method public static java.math.BigInteger probablePrime(int, java.util.Random);
    method public java.math.BigInteger remainder(java.math.BigInteger);
    method public java.math.BigInteger setBit(int);
    method public java.math.BigInteger shiftLeft(int);
    method public java.math.BigInteger shiftRight(int);
    method public int signum();
    method public java.math.BigInteger subtract(java.math.BigInteger);
    method public boolean testBit(int);
    method public byte[] toByteArray();
    method public java.lang.String toString(int);
    method public static java.math.BigInteger valueOf(long);
    method public java.math.BigInteger xor(java.math.BigInteger);
    field public static final java.math.BigInteger ONE;
    field public static final java.math.BigInteger TEN;
    field 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(java.lang.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 final class RoundingMode extends java.lang.Enum {
    method public static java.math.RoundingMode valueOf(java.lang.String);
    method public static java.math.RoundingMode valueOf(int);
    method public static final java.math.RoundingMode[] values();
    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 java.lang.String getRequestingHost();
    method protected final int getRequestingPort();
    method protected final java.lang.String getRequestingPrompt();
    method protected final java.lang.String getRequestingProtocol();
    method protected final java.lang.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, java.lang.String, java.lang.String, java.lang.String);
    method public static java.net.PasswordAuthentication requestPasswordAuthentication(java.lang.String, java.net.InetAddress, int, java.lang.String, java.lang.String, java.lang.String);
    method public static java.net.PasswordAuthentication requestPasswordAuthentication(java.lang.String, java.net.InetAddress, int, java.lang.String, java.lang.String, java.lang.String, java.net.URL, java.net.Authenticator.RequestorType);
    method public static synchronized void setDefault(java.net.Authenticator);
  }

  public static final class Authenticator.RequestorType extends java.lang.Enum {
    method public static java.net.Authenticator.RequestorType valueOf(java.lang.String);
    method public static final java.net.Authenticator.RequestorType[] values();
    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(java.lang.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(java.lang.String);
    ctor public ConnectException();
  }

  public abstract class ContentHandler {
    ctor public ContentHandler();
    method public abstract java.lang.Object getContent(java.net.URLConnection) throws java.io.IOException;
    method public java.lang.Object getContent(java.net.URLConnection, java.lang.Class[]) throws java.io.IOException;
  }

  public abstract interface ContentHandlerFactory {
    method public abstract java.net.ContentHandler createContentHandler(java.lang.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 synchronized 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 synchronized 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 abstract interface CookiePolicy {
    method public abstract 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 abstract interface CookieStore {
    method public abstract void add(java.net.URI, java.net.HttpCookie);
    method public abstract java.util.List<java.net.HttpCookie> get(java.net.URI);
    method public abstract java.util.List<java.net.HttpCookie> getCookies();
    method public abstract java.util.List<java.net.URI> getURIs();
    method public abstract boolean remove(java.net.URI, java.net.HttpCookie);
    method public abstract 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 synchronized java.net.InetAddress getAddress();
    method public synchronized byte[] getData();
    method public synchronized int getLength();
    method public synchronized int getOffset();
    method public synchronized int getPort();
    method public synchronized java.net.SocketAddress getSocketAddress();
    method public synchronized void setAddress(java.net.InetAddress);
    method public synchronized void setData(byte[], int, int);
    method public synchronized void setData(byte[]);
    method public synchronized void setLength(int);
    method public synchronized void setPort(int);
    method public synchronized 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 synchronized 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 synchronized 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 synchronized int getReceiveBufferSize() throws java.net.SocketException;
    method public java.net.SocketAddress getRemoteSocketAddress();
    method public synchronized boolean getReuseAddress() throws java.net.SocketException;
    method public synchronized int getSendBufferSize() throws java.net.SocketException;
    method public synchronized int getSoTimeout() throws java.net.SocketException;
    method public synchronized int getTrafficClass() throws java.net.SocketException;
    method public boolean isBound();
    method public boolean isClosed();
    method public boolean isConnected();
    method public synchronized void receive(java.net.DatagramPacket) throws java.io.IOException;
    method public void send(java.net.DatagramPacket) throws java.io.IOException;
    method public synchronized void setBroadcast(boolean) throws java.net.SocketException;
    method public static synchronized void setDatagramSocketImplFactory(java.net.DatagramSocketImplFactory) throws java.io.IOException;
    method public synchronized void setReceiveBufferSize(int) throws java.net.SocketException;
    method public synchronized void setReuseAddress(boolean) throws java.net.SocketException;
    method public synchronized void setSendBufferSize(int) throws java.net.SocketException;
    method public synchronized void setSoTimeout(int) throws java.net.SocketException;
    method public synchronized 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 protected abstract deprecated 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 protected abstract deprecated 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 abstract interface DatagramSocketImplFactory {
    method public abstract java.net.DatagramSocketImpl createDatagramSocketImpl();
  }

  public abstract interface FileNameMap {
    method public abstract java.lang.String getContentTypeFor(java.lang.String);
  }

  public final class HttpCookie implements java.lang.Cloneable {
    ctor public HttpCookie(java.lang.String, java.lang.String);
    method public java.lang.Object clone();
    method public static boolean domainMatches(java.lang.String, java.lang.String);
    method public java.lang.String getComment();
    method public java.lang.String getCommentURL();
    method public boolean getDiscard();
    method public java.lang.String getDomain();
    method public long getMaxAge();
    method public java.lang.String getName();
    method public java.lang.String getPath();
    method public java.lang.String getPortlist();
    method public boolean getSecure();
    method public java.lang.String getValue();
    method public int getVersion();
    method public boolean hasExpired();
    method public boolean isHttpOnly();
    method public static java.util.List<java.net.HttpCookie> parse(java.lang.String);
    method public void setComment(java.lang.String);
    method public void setCommentURL(java.lang.String);
    method public void setDiscard(boolean);
    method public void setDomain(java.lang.String);
    method public void setHttpOnly(boolean);
    method public void setMaxAge(long);
    method public void setPath(java.lang.String);
    method public void setPortlist(java.lang.String);
    method public void setSecure(boolean);
    method public void setValue(java.lang.String);
    method public void setVersion(int);
  }

  public class HttpRetryException extends java.io.IOException {
    ctor public HttpRetryException(java.lang.String, int);
    ctor public HttpRetryException(java.lang.String, int, java.lang.String);
    method public java.lang.String getLocation();
    method public java.lang.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 java.lang.String getRequestMethod();
    method public int getResponseCode() throws java.io.IOException;
    method public java.lang.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(java.lang.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 public static final deprecated 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 java.lang.String method;
    field protected int responseCode;
    field protected java.lang.String responseMessage;
  }

  public final class IDN {
    method public static java.lang.String toASCII(java.lang.String, int);
    method public static java.lang.String toASCII(java.lang.String);
    method public static java.lang.String toUnicode(java.lang.String, int);
    method public static java.lang.String toUnicode(java.lang.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(java.lang.String, byte[], java.net.NetworkInterface) throws java.net.UnknownHostException;
    method public static java.net.Inet6Address getByAddress(java.lang.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(java.lang.String) throws java.net.UnknownHostException;
    method public static java.net.InetAddress getByAddress(java.lang.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(java.lang.String) throws java.net.UnknownHostException;
    method public java.lang.String getCanonicalHostName();
    method public java.lang.String getHostAddress();
    method public java.lang.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(java.lang.String, int);
    method public static java.net.InetSocketAddress createUnresolved(java.lang.String, int);
    method public final boolean equals(java.lang.Object);
    method public final java.net.InetAddress getAddress();
    method public final java.lang.String getHostName();
    method public final java.lang.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 java.lang.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(java.lang.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 public deprecated 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 public deprecated 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 public deprecated 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(java.lang.String);
    ctor public NetPermission(java.lang.String, java.lang.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(java.lang.String) throws java.net.SocketException;
    method public java.lang.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 java.lang.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(java.lang.String);
    ctor public NoRouteToHostException();
  }

  public final class PasswordAuthentication {
    ctor public PasswordAuthentication(java.lang.String, char[]);
    method public char[] getPassword();
    method public java.lang.String getUserName();
  }

  public class PortUnreachableException extends java.net.SocketException {
    ctor public PortUnreachableException(java.lang.String);
    ctor public PortUnreachableException();
  }

  public class ProtocolException extends java.io.IOException {
    ctor public ProtocolException(java.lang.String);
    ctor public ProtocolException();
  }

  public abstract interface ProtocolFamily {
    method public abstract java.lang.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(java.lang.Object);
    method public final int hashCode();
    method public java.net.Proxy.Type type();
    field public static final java.net.Proxy NO_PROXY;
  }

  public static final class Proxy.Type extends java.lang.Enum {
    method public static java.net.Proxy.Type valueOf(java.lang.String);
    method public static final java.net.Proxy.Type[] values();
    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, java.lang.String, java.util.Map<java.lang.String, java.util.List<java.lang.String>>) throws java.io.IOException;
    method public static synchronized java.net.ResponseCache getDefault();
    method public abstract java.net.CacheRequest put(java.net.URI, java.net.URLConnection) throws java.io.IOException;
    method public static synchronized void setDefault(java.net.ResponseCache);
  }

  public abstract class SecureCacheResponse extends java.net.CacheResponse {
    ctor public SecureCacheResponse();
    method public abstract java.lang.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 synchronized int getReceiveBufferSize() throws java.net.SocketException;
    method public boolean getReuseAddress() throws java.net.SocketException;
    method public synchronized 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 synchronized void setReceiveBufferSize(int) throws java.net.SocketException;
    method public void setReuseAddress(boolean) throws java.net.SocketException;
    method public synchronized void setSoTimeout(int) throws java.net.SocketException;
    method public static synchronized 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(java.lang.String, int) throws java.io.IOException, java.net.UnknownHostException;
    ctor public Socket(java.net.InetAddress, int) throws java.io.IOException;
    ctor public Socket(java.lang.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 public deprecated Socket(java.lang.String, int, boolean) throws java.io.IOException;
    ctor public deprecated Socket(java.net.InetAddress, int, boolean) throws java.io.IOException;
    method public void bind(java.net.SocketAddress) throws java.io.IOException;
    method public synchronized 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 synchronized int getReceiveBufferSize() throws java.net.SocketException;
    method public java.net.SocketAddress getRemoteSocketAddress();
    method public boolean getReuseAddress() throws java.net.SocketException;
    method public synchronized int getSendBufferSize() throws java.net.SocketException;
    method public int getSoLinger() throws java.net.SocketException;
    method public synchronized 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 synchronized void setReceiveBufferSize(int) throws java.net.SocketException;
    method public void setReuseAddress(boolean) throws java.net.SocketException;
    method public synchronized void setSendBufferSize(int) throws java.net.SocketException;
    method public void setSoLinger(boolean, int) throws java.net.SocketException;
    method public synchronized void setSoTimeout(int) throws java.net.SocketException;
    method public static synchronized 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(java.lang.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(java.lang.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 abstract interface SocketImplFactory {
    method public abstract java.net.SocketImpl createSocketImpl();
  }

  public abstract interface SocketOption<T> {
    method public abstract java.lang.String name();
    method public abstract java.lang.Class<T> type();
  }

  public abstract interface SocketOptions {
    method public abstract java.lang.Object getOption(int) throws java.net.SocketException;
    method public abstract void setOption(int, java.lang.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(java.lang.String, java.lang.String);
    method public java.lang.String getActions();
    method public boolean implies(java.security.Permission);
  }

  public class SocketTimeoutException extends java.io.InterruptedIOException {
    ctor public SocketTimeoutException(java.lang.String);
    ctor public SocketTimeoutException();
  }

  public final class StandardProtocolFamily extends java.lang.Enum implements java.net.ProtocolFamily {
    method public static java.net.StandardProtocolFamily valueOf(java.lang.String);
    method public static final java.net.StandardProtocolFamily[] values();
    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.io.Serializable {
    ctor public URI(java.lang.String) throws java.net.URISyntaxException;
    ctor public URI(java.lang.String, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String) throws java.net.URISyntaxException;
    ctor public URI(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws java.net.URISyntaxException;
    ctor public URI(java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws java.net.URISyntaxException;
    ctor public URI(java.lang.String, java.lang.String, java.lang.String) throws java.net.URISyntaxException;
    method public int compareTo(java.net.URI);
    method public static java.net.URI create(java.lang.String);
    method public java.lang.String getAuthority();
    method public java.lang.String getFragment();
    method public java.lang.String getHost();
    method public java.lang.String getPath();
    method public int getPort();
    method public java.lang.String getQuery();
    method public java.lang.String getRawAuthority();
    method public java.lang.String getRawFragment();
    method public java.lang.String getRawPath();
    method public java.lang.String getRawQuery();
    method public java.lang.String getRawSchemeSpecificPart();
    method public java.lang.String getRawUserInfo();
    method public java.lang.String getScheme();
    method public java.lang.String getSchemeSpecificPart();
    method public java.lang.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(java.lang.String);
    method public java.lang.String toASCIIString();
    method public java.net.URL toURL() throws java.net.MalformedURLException;
  }

  public class URISyntaxException extends java.lang.Exception {
    ctor public URISyntaxException(java.lang.String, java.lang.String, int);
    ctor public URISyntaxException(java.lang.String, java.lang.String);
    method public int getIndex();
    method public java.lang.String getInput();
    method public java.lang.String getReason();
  }

  public final class URL implements java.io.Serializable {
    ctor public URL(java.lang.String, java.lang.String, int, java.lang.String) throws java.net.MalformedURLException;
    ctor public URL(java.lang.String, java.lang.String, java.lang.String) throws java.net.MalformedURLException;
    ctor public URL(java.lang.String, java.lang.String, int, java.lang.String, java.net.URLStreamHandler) throws java.net.MalformedURLException;
    ctor public URL(java.lang.String) throws java.net.MalformedURLException;
    ctor public URL(java.net.URL, java.lang.String) throws java.net.MalformedURLException;
    ctor public URL(java.net.URL, java.lang.String, java.net.URLStreamHandler) throws java.net.MalformedURLException;
    method public java.lang.String getAuthority();
    method public java.lang.Object getContent() throws java.io.IOException;
    method public java.lang.Object getContent(java.lang.Class[]) throws java.io.IOException;
    method public int getDefaultPort();
    method public java.lang.String getFile();
    method public java.lang.String getHost();
    method public java.lang.String getPath();
    method public int getPort();
    method public java.lang.String getProtocol();
    method public java.lang.String getQuery();
    method public java.lang.String getRef();
    method public java.lang.String getUserInfo();
    method public synchronized int hashCode();
    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 java.lang.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[], java.lang.ClassLoader);
    ctor public URLClassLoader(java.net.URL[]);
    ctor public URLClassLoader(java.net.URL[], java.lang.ClassLoader, java.net.URLStreamHandlerFactory);
    method protected void addURL(java.net.URL);
    method public void close() throws java.io.IOException;
    method protected java.lang.Package definePackage(java.lang.String, java.util.jar.Manifest, java.net.URL) throws java.lang.IllegalArgumentException;
    method public java.net.URL findResource(java.lang.String);
    method public java.util.Enumeration<java.net.URL> findResources(java.lang.String) throws java.io.IOException;
    method public java.net.URL[] getURLs();
    method public static java.net.URLClassLoader newInstance(java.net.URL[], java.lang.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(java.lang.String, java.lang.String);
    method public abstract void connect() throws java.io.IOException;
    method public boolean getAllowUserInteraction();
    method public int getConnectTimeout();
    method public java.lang.Object getContent() throws java.io.IOException;
    method public java.lang.Object getContent(java.lang.Class[]) throws java.io.IOException;
    method public java.lang.String getContentEncoding();
    method public int getContentLength();
    method public long getContentLengthLong();
    method public java.lang.String getContentType();
    method public long getDate();
    method public static boolean getDefaultAllowUserInteraction();
    method public static deprecated java.lang.String getDefaultRequestProperty(java.lang.String);
    method public boolean getDefaultUseCaches();
    method public boolean getDoInput();
    method public boolean getDoOutput();
    method public long getExpiration();
    method public static synchronized java.net.FileNameMap getFileNameMap();
    method public java.lang.String getHeaderField(java.lang.String);
    method public java.lang.String getHeaderField(int);
    method public long getHeaderFieldDate(java.lang.String, long);
    method public int getHeaderFieldInt(java.lang.String, int);
    method public java.lang.String getHeaderFieldKey(int);
    method public long getHeaderFieldLong(java.lang.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 java.lang.String getRequestProperty(java.lang.String);
    method public java.net.URL getURL();
    method public boolean getUseCaches();
    method public static java.lang.String guessContentTypeFromName(java.lang.String);
    method public static java.lang.String guessContentTypeFromStream(java.io.InputStream) throws java.io.IOException;
    method public void setAllowUserInteraction(boolean);
    method public void setConnectTimeout(int);
    method public static synchronized void setContentHandlerFactory(java.net.ContentHandlerFactory);
    method public static void setDefaultAllowUserInteraction(boolean);
    method public static deprecated void setDefaultRequestProperty(java.lang.String, java.lang.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(java.lang.String, java.lang.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 public static deprecated java.lang.String decode(java.lang.String);
    method public static java.lang.String decode(java.lang.String, java.lang.String) throws java.io.UnsupportedEncodingException;
  }

  public class URLEncoder {
    method public static deprecated java.lang.String encode(java.lang.String);
    method public static java.lang.String encode(java.lang.String, java.lang.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 synchronized 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, java.lang.String, int, int);
    method protected boolean sameFile(java.net.URL, java.net.URL);
    method protected void setURL(java.net.URL, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method protected deprecated void setURL(java.net.URL, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String);
    method protected java.lang.String toExternalForm(java.net.URL);
  }

  public abstract interface URLStreamHandlerFactory {
    method public abstract java.net.URLStreamHandler createURLStreamHandler(java.lang.String);
  }

  public class UnknownHostException extends java.io.IOException {
    ctor public UnknownHostException(java.lang.String);
    ctor public UnknownHostException();
  }

  public class UnknownServiceException extends java.io.IOException {
    ctor public UnknownServiceException();
    ctor public UnknownServiceException(java.lang.String);
  }

}

package java.nio {

  public abstract class Buffer {
    method public abstract java.lang.Object array();
    method public abstract int arrayOffset();
    method public final int capacity();
    method public final java.nio.Buffer clear();
    method public final 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 final java.nio.Buffer limit(int);
    method public final java.nio.Buffer mark();
    method public final int position();
    method public final java.nio.Buffer position(int);
    method public final int remaining();
    method public final java.nio.Buffer reset();
    method public final 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 {
    method public static java.nio.ByteBuffer allocate(int);
    method public static java.nio.ByteBuffer allocateDirect(int);
    method public final byte[] array();
    method public final int arrayOffset();
    method public abstract java.nio.CharBuffer asCharBuffer();
    method public abstract java.nio.DoubleBuffer asDoubleBuffer();
    method public abstract java.nio.FloatBuffer asFloatBuffer();
    method public abstract java.nio.IntBuffer asIntBuffer();
    method public abstract java.nio.LongBuffer asLongBuffer();
    method public abstract java.nio.ByteBuffer asReadOnlyBuffer();
    method public abstract java.nio.ShortBuffer asShortBuffer();
    method public abstract java.nio.ByteBuffer compact();
    method public int compareTo(java.nio.ByteBuffer);
    method public abstract java.nio.ByteBuffer duplicate();
    method public abstract byte get();
    method public abstract byte get(int);
    method public java.nio.ByteBuffer get(byte[], int, int);
    method public java.nio.ByteBuffer get(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 public final java.nio.ByteOrder order();
    method public final java.nio.ByteBuffer order(java.nio.ByteOrder);
    method public abstract java.nio.ByteBuffer put(byte);
    method public abstract java.nio.ByteBuffer put(int, byte);
    method public java.nio.ByteBuffer put(java.nio.ByteBuffer);
    method public java.nio.ByteBuffer put(byte[], int, int);
    method public final java.nio.ByteBuffer put(byte[]);
    method public abstract java.nio.ByteBuffer putChar(char);
    method public abstract java.nio.ByteBuffer putChar(int, char);
    method public abstract java.nio.ByteBuffer putDouble(double);
    method public abstract java.nio.ByteBuffer putDouble(int, double);
    method public abstract java.nio.ByteBuffer putFloat(float);
    method public abstract java.nio.ByteBuffer putFloat(int, float);
    method public abstract java.nio.ByteBuffer putInt(int);
    method public abstract java.nio.ByteBuffer putInt(int, int);
    method public abstract java.nio.ByteBuffer putLong(long);
    method public abstract java.nio.ByteBuffer putLong(int, long);
    method public abstract java.nio.ByteBuffer putShort(short);
    method public abstract java.nio.ByteBuffer putShort(int, short);
    method public abstract java.nio.ByteBuffer slice();
    method public static java.nio.ByteBuffer wrap(byte[], int, int);
    method public static java.nio.ByteBuffer wrap(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.lang.Readable {
    method public static java.nio.CharBuffer allocate(int);
    method public java.nio.CharBuffer append(java.lang.CharSequence);
    method public java.nio.CharBuffer append(java.lang.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(java.lang.String, int, int);
    method public final java.nio.CharBuffer put(java.lang.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(java.lang.CharSequence, int, int);
    method public static java.nio.CharBuffer wrap(java.lang.CharSequence);
  }

  public abstract class DoubleBuffer extends java.nio.Buffer implements java.lang.Comparable {
    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 {
    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 {
    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 {
    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 {
    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 abstract interface AsynchronousByteChannel implements java.nio.channels.AsynchronousChannel {
    method public abstract <A> void read(java.nio.ByteBuffer, A, java.nio.channels.CompletionHandler<java.lang.Integer, ? super A>);
    method public abstract java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer);
    method public abstract <A> void write(java.nio.ByteBuffer, A, java.nio.channels.CompletionHandler<java.lang.Integer, ? super A>);
    method public abstract java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer);
  }

  public abstract interface AsynchronousChannel implements 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 abstract interface ByteChannel implements java.nio.channels.ReadableByteChannel java.nio.channels.WritableByteChannel {
  }

  public class CancelledKeyException extends java.lang.IllegalStateException {
    ctor public CancelledKeyException();
  }

  public abstract interface Channel implements java.io.Closeable {
    method public abstract 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, java.lang.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, java.lang.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 abstract interface CompletionHandler<V, A> {
    method public abstract void completed(V, A);
    method public abstract void failed(java.lang.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 java.lang.String toString();
  }

  public class FileLockInterruptionException extends java.io.IOException {
    ctor public FileLockInterruptionException();
  }

  public abstract interface GatheringByteChannel implements java.nio.channels.WritableByteChannel {
    method public abstract long write(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
    method public abstract 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 abstract interface InterruptibleChannel implements 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 abstract interface MulticastChannel implements java.nio.channels.NetworkChannel {
    method public abstract java.nio.channels.MembershipKey join(java.net.InetAddress, java.net.NetworkInterface) throws java.io.IOException;
    method public abstract java.nio.channels.MembershipKey join(java.net.InetAddress, java.net.NetworkInterface, java.net.InetAddress) throws java.io.IOException;
  }

  public abstract interface NetworkChannel implements java.nio.channels.Channel {
    method public abstract java.nio.channels.NetworkChannel bind(java.net.SocketAddress) throws java.io.IOException;
    method public abstract java.net.SocketAddress getLocalAddress() throws java.io.IOException;
    method public abstract <T> T getOption(java.net.SocketOption<T>) throws java.io.IOException;
    method public abstract <T> java.nio.channels.NetworkChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
    method public abstract 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 static abstract 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 static abstract 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 abstract interface ReadableByteChannel implements java.nio.channels.Channel {
    method public abstract int read(java.nio.ByteBuffer) throws java.io.IOException;
  }

  public abstract interface ScatteringByteChannel implements java.nio.channels.ReadableByteChannel {
    method public abstract long read(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
    method public abstract long read(java.nio.ByteBuffer[]) throws java.io.IOException;
  }

  public abstract interface SeekableByteChannel implements java.nio.channels.ByteChannel {
    method public abstract long position() throws java.io.IOException;
    method public abstract java.nio.channels.SeekableByteChannel position(long) throws java.io.IOException;
    method public abstract long size() throws java.io.IOException;
    method public abstract 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 java.lang.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, java.lang.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 java.lang.Object attach(java.lang.Object);
    method public final java.lang.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 abstract interface WritableByteChannel implements java.nio.channels.Channel {
    method public abstract 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 java.lang.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, java.lang.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, java.lang.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 {
    ctor protected Charset(java.lang.String, java.lang.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 java.lang.String displayName();
    method public java.lang.String displayName(java.util.Locale);
    method public final java.nio.ByteBuffer encode(java.nio.CharBuffer);
    method public final java.nio.ByteBuffer encode(java.lang.String);
    method public final boolean equals(java.lang.Object);
    method public static java.nio.charset.Charset forName(java.lang.String);
    method public final int hashCode();
    method public final boolean isRegistered();
    method public static boolean isSupported(java.lang.String);
    method public final java.lang.String name();
    method public abstract java.nio.charset.CharsetDecoder newDecoder();
    method public abstract java.nio.charset.CharsetEncoder newEncoder();
    method public final java.lang.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(java.lang.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(java.lang.String);
    method public final java.lang.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(java.lang.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(java.lang.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(java.lang.String);
    method public java.lang.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(java.lang.String);
    method public java.lang.String getCharsetName();
  }

}

package java.nio.charset.spi {

  public abstract class CharsetProvider {
    ctor protected CharsetProvider();
    method public abstract java.nio.charset.Charset charsetForName(java.lang.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(java.lang.String);
    ctor public AccessDeniedException(java.lang.String, java.lang.String, java.lang.String);
  }

  public final class AccessMode extends java.lang.Enum {
    method public static java.nio.file.AccessMode valueOf(java.lang.String);
    method public static final java.nio.file.AccessMode[] values();
    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(java.lang.String, java.lang.String, java.lang.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 abstract 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(java.lang.String);
  }

  public abstract interface DirectoryStream<T> implements java.io.Closeable java.lang.Iterable {
  }

  public static abstract interface DirectoryStream.Filter<T> {
    method public abstract boolean accept(T) throws java.io.IOException;
  }

  public class FileAlreadyExistsException extends java.nio.file.FileSystemException {
    ctor public FileAlreadyExistsException(java.lang.String);
    ctor public FileAlreadyExistsException(java.lang.String, java.lang.String, java.lang.String);
  }

  public abstract class FileStore {
    ctor protected FileStore();
    method public abstract java.lang.Object getAttribute(java.lang.String) throws java.io.IOException;
    method public abstract <V extends java.nio.file.attribute.FileStoreAttributeView> V getFileStoreAttributeView(java.lang.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 java.lang.String name();
    method public abstract boolean supportsFileAttributeView(java.lang.Class<? extends java.nio.file.attribute.FileAttributeView>);
    method public abstract boolean supportsFileAttributeView(java.lang.String);
    method public abstract java.lang.String type();
  }

  public abstract class FileSystem implements java.io.Closeable {
    ctor protected FileSystem();
    method public abstract java.lang.Iterable<java.nio.file.FileStore> getFileStores();
    method public abstract java.nio.file.Path getPath(java.lang.String, java.lang.String...);
    method public abstract java.nio.file.PathMatcher getPathMatcher(java.lang.String);
    method public abstract java.lang.Iterable<java.nio.file.Path> getRootDirectories();
    method public abstract java.lang.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(java.lang.String);
  }

  public class FileSystemException extends java.io.IOException {
    ctor public FileSystemException(java.lang.String);
    ctor public FileSystemException(java.lang.String, java.lang.String, java.lang.String);
    method public java.lang.String getFile();
    method public java.lang.String getOtherFile();
    method public java.lang.String getReason();
  }

  public class FileSystemLoopException extends java.nio.file.FileSystemException {
    ctor public FileSystemLoopException(java.lang.String);
  }

  public class FileSystemNotFoundException extends java.lang.RuntimeException {
    ctor public FileSystemNotFoundException();
    ctor public FileSystemNotFoundException(java.lang.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, ?>, java.lang.ClassLoader) throws java.io.IOException;
    method public static java.nio.file.FileSystem newFileSystem(java.nio.file.Path, java.lang.ClassLoader) throws java.io.IOException;
  }

  public final class FileVisitOption extends java.lang.Enum {
    method public static java.nio.file.FileVisitOption valueOf(java.lang.String);
    method public static final java.nio.file.FileVisitOption[] values();
    enum_constant public static final java.nio.file.FileVisitOption FOLLOW_LINKS;
  }

  public final class FileVisitResult extends java.lang.Enum {
    method public static java.nio.file.FileVisitResult valueOf(java.lang.String);
    method public static final java.nio.file.FileVisitResult[] values();
    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 abstract interface FileVisitor<T> {
    method public abstract java.nio.file.FileVisitResult postVisitDirectory(T, java.io.IOException) throws java.io.IOException;
    method public abstract java.nio.file.FileVisitResult preVisitDirectory(T, java.nio.file.attribute.BasicFileAttributes) throws java.io.IOException;
    method public abstract java.nio.file.FileVisitResult visitFile(T, java.nio.file.attribute.BasicFileAttributes) throws java.io.IOException;
    method public abstract 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, java.lang.String, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.file.Path createTempDirectory(java.lang.String, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.file.Path createTempFile(java.nio.file.Path, java.lang.String, java.lang.String, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
    method public static java.nio.file.Path createTempFile(java.lang.String, java.lang.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 java.lang.Object getAttribute(java.nio.file.Path, java.lang.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, java.lang.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, java.lang.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 java.lang.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, java.lang.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, java.lang.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, java.lang.String, java.lang.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, java.lang.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, java.lang.Iterable<? extends java.lang.CharSequence>, java.nio.file.OpenOption...) throws java.io.IOException;
  }

  public class InvalidPathException extends java.lang.IllegalArgumentException {
    ctor public InvalidPathException(java.lang.String, java.lang.String, int);
    ctor public InvalidPathException(java.lang.String, java.lang.String);
    method public int getIndex();
    method public java.lang.String getInput();
    method public java.lang.String getReason();
  }

  public final class LinkOption extends java.lang.Enum implements java.nio.file.CopyOption java.nio.file.OpenOption {
    method public static java.nio.file.LinkOption valueOf(java.lang.String);
    method public static final java.nio.file.LinkOption[] values();
    enum_constant public static final java.nio.file.LinkOption NOFOLLOW_LINKS;
  }

  public final class LinkPermission extends java.security.BasicPermission {
    ctor public LinkPermission(java.lang.String);
    ctor public LinkPermission(java.lang.String, java.lang.String);
  }

  public class NoSuchFileException extends java.nio.file.FileSystemException {
    ctor public NoSuchFileException(java.lang.String);
    ctor public NoSuchFileException(java.lang.String, java.lang.String, java.lang.String);
  }

  public class NotDirectoryException extends java.nio.file.FileSystemException {
    ctor public NotDirectoryException(java.lang.String);
  }

  public class NotLinkException extends java.nio.file.FileSystemException {
    ctor public NotLinkException(java.lang.String);
    ctor public NotLinkException(java.lang.String, java.lang.String, java.lang.String);
  }

  public abstract interface OpenOption {
  }

  public abstract interface Path implements java.lang.Comparable java.lang.Iterable java.nio.file.Watchable {
    method public abstract int compareTo(java.nio.file.Path);
    method public abstract boolean endsWith(java.nio.file.Path);
    method public abstract boolean endsWith(java.lang.String);
    method public abstract boolean equals(java.lang.Object);
    method public abstract java.nio.file.Path getFileName();
    method public abstract java.nio.file.FileSystem getFileSystem();
    method public abstract java.nio.file.Path getName(int);
    method public abstract int getNameCount();
    method public abstract java.nio.file.Path getParent();
    method public abstract java.nio.file.Path getRoot();
    method public abstract int hashCode();
    method public abstract boolean isAbsolute();
    method public abstract java.util.Iterator<java.nio.file.Path> iterator();
    method public abstract java.nio.file.Path normalize();
    method public abstract java.nio.file.Path relativize(java.nio.file.Path);
    method public abstract java.nio.file.Path resolve(java.nio.file.Path);
    method public abstract java.nio.file.Path resolve(java.lang.String);
    method public abstract java.nio.file.Path resolveSibling(java.nio.file.Path);
    method public abstract java.nio.file.Path resolveSibling(java.lang.String);
    method public abstract boolean startsWith(java.nio.file.Path);
    method public abstract boolean startsWith(java.lang.String);
    method public abstract java.nio.file.Path subpath(int, int);
    method public abstract java.nio.file.Path toAbsolutePath();
    method public abstract java.io.File toFile();
    method public abstract java.nio.file.Path toRealPath(java.nio.file.LinkOption...) throws java.io.IOException;
    method public abstract java.lang.String toString();
    method public abstract java.net.URI toUri();
  }

  public abstract interface PathMatcher {
    method public abstract boolean matches(java.nio.file.Path);
  }

  public final class Paths {
    method public static java.nio.file.Path get(java.lang.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(java.lang.String);
  }

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

  public class ReadOnlyFileSystemException extends java.lang.UnsupportedOperationException {
    ctor public ReadOnlyFileSystemException();
  }

  public abstract interface SecureDirectoryStream<T> implements java.nio.file.DirectoryStream {
    method public abstract void deleteDirectory(T) throws java.io.IOException;
    method public abstract void deleteFile(T) throws java.io.IOException;
    method public abstract <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(java.lang.Class<V>);
    method public abstract <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(T, java.lang.Class<V>, java.nio.file.LinkOption...);
    method public abstract void move(T, java.nio.file.SecureDirectoryStream<T>, T) throws java.io.IOException;
    method public abstract 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 abstract java.nio.file.SecureDirectoryStream<T> newDirectoryStream(T, java.nio.file.LinkOption...) throws java.io.IOException;
  }

  public class SimpleFileVisitor<T> implements java.nio.file.FileVisitor {
    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 final class StandardCopyOption extends java.lang.Enum implements java.nio.file.CopyOption {
    method public static java.nio.file.StandardCopyOption valueOf(java.lang.String);
    method public static final java.nio.file.StandardCopyOption[] values();
    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 final class StandardOpenOption extends java.lang.Enum implements java.nio.file.OpenOption {
    method public static java.nio.file.StandardOpenOption valueOf(java.lang.String);
    method public static final java.nio.file.StandardOpenOption[] values();
    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 abstract interface WatchEvent<T> {
    method public abstract T context();
    method public abstract int count();
    method public abstract java.nio.file.WatchEvent.Kind<T> kind();
  }

  public static abstract interface WatchEvent.Kind<T> {
    method public abstract java.lang.String name();
    method public abstract java.lang.Class<T> type();
  }

  public static abstract interface WatchEvent.Modifier {
    method public abstract java.lang.String name();
  }

  public abstract interface WatchKey {
    method public abstract void cancel();
    method public abstract boolean isValid();
    method public abstract java.util.List<java.nio.file.WatchEvent<?>> pollEvents();
    method public abstract boolean reset();
    method public abstract java.nio.file.Watchable watchable();
  }

  public abstract interface WatchService implements java.io.Closeable {
    method public abstract java.nio.file.WatchKey poll();
    method public abstract java.nio.file.WatchKey poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract java.nio.file.WatchKey take() throws java.lang.InterruptedException;
  }

  public abstract interface Watchable {
    method public abstract 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 abstract 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 final class AclEntryFlag extends java.lang.Enum {
    method public static java.nio.file.attribute.AclEntryFlag valueOf(java.lang.String);
    method public static final java.nio.file.attribute.AclEntryFlag[] values();
    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 final class AclEntryPermission extends java.lang.Enum {
    method public static java.nio.file.attribute.AclEntryPermission valueOf(java.lang.String);
    method public static final java.nio.file.attribute.AclEntryPermission[] values();
    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 final class AclEntryType extends java.lang.Enum {
    method public static java.nio.file.attribute.AclEntryType valueOf(java.lang.String);
    method public static final java.nio.file.attribute.AclEntryType[] values();
    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 abstract interface AclFileAttributeView implements java.nio.file.attribute.FileOwnerAttributeView {
    method public abstract java.util.List<java.nio.file.attribute.AclEntry> getAcl() throws java.io.IOException;
    method public abstract void setAcl(java.util.List<java.nio.file.attribute.AclEntry>) throws java.io.IOException;
  }

  public abstract interface AttributeView {
    method public abstract java.lang.String name();
  }

  public abstract interface BasicFileAttributeView implements java.nio.file.attribute.FileAttributeView {
    method public abstract java.nio.file.attribute.BasicFileAttributes readAttributes() throws java.io.IOException;
    method public abstract void setTimes(java.nio.file.attribute.FileTime, java.nio.file.attribute.FileTime, java.nio.file.attribute.FileTime) throws java.io.IOException;
  }

  public abstract interface BasicFileAttributes {
    method public abstract java.nio.file.attribute.FileTime creationTime();
    method public abstract java.lang.Object fileKey();
    method public abstract boolean isDirectory();
    method public abstract boolean isOther();
    method public abstract boolean isRegularFile();
    method public abstract boolean isSymbolicLink();
    method public abstract java.nio.file.attribute.FileTime lastAccessTime();
    method public abstract java.nio.file.attribute.FileTime lastModifiedTime();
    method public abstract long size();
  }

  public abstract interface DosFileAttributeView implements java.nio.file.attribute.BasicFileAttributeView {
    method public abstract java.nio.file.attribute.DosFileAttributes readAttributes() throws java.io.IOException;
    method public abstract void setArchive(boolean) throws java.io.IOException;
    method public abstract void setHidden(boolean) throws java.io.IOException;
    method public abstract void setReadOnly(boolean) throws java.io.IOException;
    method public abstract void setSystem(boolean) throws java.io.IOException;
  }

  public abstract interface DosFileAttributes implements java.nio.file.attribute.BasicFileAttributes {
    method public abstract boolean isArchive();
    method public abstract boolean isHidden();
    method public abstract boolean isReadOnly();
    method public abstract boolean isSystem();
  }

  public abstract interface FileAttribute<T> {
    method public abstract java.lang.String name();
    method public abstract T value();
  }

  public abstract interface FileAttributeView implements java.nio.file.attribute.AttributeView {
  }

  public abstract interface FileOwnerAttributeView implements java.nio.file.attribute.FileAttributeView {
    method public abstract java.nio.file.attribute.UserPrincipal getOwner() throws java.io.IOException;
    method public abstract void setOwner(java.nio.file.attribute.UserPrincipal) throws java.io.IOException;
  }

  public abstract interface FileStoreAttributeView implements java.nio.file.attribute.AttributeView {
  }

  public final class FileTime implements java.lang.Comparable {
    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 abstract interface GroupPrincipal implements java.nio.file.attribute.UserPrincipal {
  }

  public abstract interface PosixFileAttributeView implements java.nio.file.attribute.BasicFileAttributeView java.nio.file.attribute.FileOwnerAttributeView {
    method public abstract java.nio.file.attribute.PosixFileAttributes readAttributes() throws java.io.IOException;
    method public abstract void setGroup(java.nio.file.attribute.GroupPrincipal) throws java.io.IOException;
    method public abstract void setPermissions(java.util.Set<java.nio.file.attribute.PosixFilePermission>) throws java.io.IOException;
  }

  public abstract interface PosixFileAttributes implements java.nio.file.attribute.BasicFileAttributes {
    method public abstract java.nio.file.attribute.GroupPrincipal group();
    method public abstract java.nio.file.attribute.UserPrincipal owner();
    method public abstract java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions();
  }

  public final class PosixFilePermission extends java.lang.Enum {
    method public static java.nio.file.attribute.PosixFilePermission valueOf(java.lang.String);
    method public static final java.nio.file.attribute.PosixFilePermission[] values();
    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(java.lang.String);
    method public static java.lang.String toString(java.util.Set<java.nio.file.attribute.PosixFilePermission>);
  }

  public abstract interface UserDefinedFileAttributeView implements java.nio.file.attribute.FileAttributeView {
    method public abstract void delete(java.lang.String) throws java.io.IOException;
    method public abstract java.util.List<java.lang.String> list() throws java.io.IOException;
    method public abstract int read(java.lang.String, java.nio.ByteBuffer) throws java.io.IOException;
    method public abstract int size(java.lang.String) throws java.io.IOException;
    method public abstract int write(java.lang.String, java.nio.ByteBuffer) throws java.io.IOException;
  }

  public abstract interface UserPrincipal implements java.security.Principal {
  }

  public abstract class UserPrincipalLookupService {
    ctor protected UserPrincipalLookupService();
    method public abstract java.nio.file.attribute.GroupPrincipal lookupPrincipalByGroupName(java.lang.String) throws java.io.IOException;
    method public abstract java.nio.file.attribute.UserPrincipal lookupPrincipalByName(java.lang.String) throws java.io.IOException;
  }

  public class UserPrincipalNotFoundException extends java.io.IOException {
    ctor public UserPrincipalNotFoundException(java.lang.String);
    method public java.lang.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, java.lang.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 java.lang.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, java.lang.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, java.lang.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, java.lang.String, java.lang.Object, java.nio.file.LinkOption...) throws java.io.IOException;
  }

  public abstract class FileTypeDetector {
    ctor protected FileTypeDetector();
    method public abstract java.lang.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(java.lang.String);
    ctor public AccessControlException(java.lang.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 abstract interface AlgorithmConstraints {
    method public abstract boolean permits(java.util.Set<java.security.CryptoPrimitive>, java.lang.String, java.security.AlgorithmParameters);
    method public abstract boolean permits(java.util.Set<java.security.CryptoPrimitive>, java.security.Key);
    method public abstract boolean permits(java.util.Set<java.security.CryptoPrimitive>, java.lang.String, java.security.Key, java.security.AlgorithmParameters);
  }

  public class AlgorithmParameterGenerator {
    ctor protected AlgorithmParameterGenerator(java.security.AlgorithmParameterGeneratorSpi, java.security.Provider, java.lang.String);
    method public final java.security.AlgorithmParameters generateParameters();
    method public final java.lang.String getAlgorithm();
    method public static java.security.AlgorithmParameterGenerator getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.AlgorithmParameterGenerator getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.AlgorithmParameterGenerator getInstance(java.lang.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, java.lang.String);
    method public final java.lang.String getAlgorithm();
    method public final byte[] getEncoded() throws java.io.IOException;
    method public final byte[] getEncoded(java.lang.String) throws java.io.IOException;
    method public static java.security.AlgorithmParameters getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.AlgorithmParameters getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.AlgorithmParameters getInstance(java.lang.String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final <T extends java.security.spec.AlgorithmParameterSpec> T getParameterSpec(java.lang.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[], java.lang.String) throws java.io.IOException;
    method public final java.lang.String toString();
  }

  public abstract class AlgorithmParametersSpi {
    ctor public AlgorithmParametersSpi();
    method protected abstract byte[] engineGetEncoded() throws java.io.IOException;
    method protected abstract byte[] engineGetEncoded(java.lang.String) throws java.io.IOException;
    method protected abstract <T extends java.security.spec.AlgorithmParameterSpec> T engineGetParameterSpec(java.lang.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[], java.lang.String) throws java.io.IOException;
    method protected abstract java.lang.String engineToString();
  }

  public final class AllPermission extends java.security.Permission {
    ctor public AllPermission();
    ctor public AllPermission(java.lang.String, java.lang.String);
    method public java.lang.String getActions();
    method public boolean implies(java.security.Permission);
  }

  public abstract class AuthProvider extends java.security.Provider {
    ctor protected AuthProvider(java.lang.String, double, java.lang.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(java.lang.String);
    ctor public BasicPermission(java.lang.String, java.lang.String);
    method public java.lang.String getActions();
    method public boolean implies(java.security.Permission);
  }

  public abstract deprecated interface Certificate {
    method public abstract void decode(java.io.InputStream) throws java.io.IOException, java.security.KeyException;
    method public abstract void encode(java.io.OutputStream) throws java.io.IOException, java.security.KeyException;
    method public abstract java.lang.String getFormat();
    method public abstract java.security.Principal getGuarantor();
    method public abstract java.security.Principal getPrincipal();
    method public abstract java.security.PublicKey getPublicKey();
    method public abstract java.lang.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 final class CryptoPrimitive extends java.lang.Enum {
    method public static java.security.CryptoPrimitive valueOf(java.lang.String);
    method public static final java.security.CryptoPrimitive[] values();
    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(java.lang.String);
    ctor public DigestException(java.lang.String, java.lang.Throwable);
    ctor public DigestException(java.lang.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 abstract interface DomainCombiner {
    method public abstract 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(java.lang.String);
    ctor public GeneralSecurityException(java.lang.String, java.lang.Throwable);
    ctor public GeneralSecurityException(java.lang.Throwable);
  }

  public abstract interface Guard {
    method public abstract void checkGuard(java.lang.Object) throws java.lang.SecurityException;
  }

  public class GuardedObject implements java.io.Serializable {
    ctor public GuardedObject(java.lang.Object, java.security.Guard);
    method public java.lang.Object getObject() throws java.lang.SecurityException;
  }

  public abstract deprecated class Identity implements java.security.Principal java.io.Serializable {
    ctor protected Identity();
    ctor public Identity(java.lang.String, java.security.IdentityScope) throws java.security.KeyManagementException;
    ctor public Identity(java.lang.String);
    method public void addCertificate(java.security.Certificate) throws java.security.KeyManagementException;
    method public java.security.Certificate[] certificates();
    method public final boolean equals(java.lang.Object);
    method public java.lang.String getInfo();
    method public final java.lang.String getName();
    method public java.security.PublicKey getPublicKey();
    method public final java.security.IdentityScope getScope();
    method protected boolean identityEquals(java.security.Identity);
    method public void removeCertificate(java.security.Certificate) throws java.security.KeyManagementException;
    method public void setInfo(java.lang.String);
    method public void setPublicKey(java.security.PublicKey) throws java.security.KeyManagementException;
    method public java.lang.String toString(boolean);
  }

  public abstract deprecated class IdentityScope extends java.security.Identity {
    ctor protected IdentityScope();
    ctor public IdentityScope(java.lang.String);
    ctor public IdentityScope(java.lang.String, java.security.IdentityScope) throws java.security.KeyManagementException;
    method public abstract void addIdentity(java.security.Identity) throws java.security.KeyManagementException;
    method public abstract java.security.Identity getIdentity(java.lang.String);
    method public java.security.Identity getIdentity(java.security.Principal);
    method public abstract java.security.Identity getIdentity(java.security.PublicKey);
    method public static java.security.IdentityScope getSystemScope();
    method public abstract java.util.Enumeration<java.security.Identity> identities();
    method public abstract void removeIdentity(java.security.Identity) throws java.security.KeyManagementException;
    method protected static void setSystemScope(java.security.IdentityScope);
    method public abstract int size();
  }

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

  public class InvalidKeyException extends java.security.KeyException {
    ctor public InvalidKeyException();
    ctor public InvalidKeyException(java.lang.String);
    ctor public InvalidKeyException(java.lang.String, java.lang.Throwable);
    ctor public InvalidKeyException(java.lang.Throwable);
  }

  public class InvalidParameterException extends java.lang.IllegalArgumentException {
    ctor public InvalidParameterException();
    ctor public InvalidParameterException(java.lang.String);
  }

  public abstract interface Key implements java.io.Serializable {
    method public abstract java.lang.String getAlgorithm();
    method public abstract byte[] getEncoded();
    method public abstract java.lang.String getFormat();
    field public static final long serialVersionUID = 6603384152749567654L; // 0x5ba3eee69414eea6L
  }

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

  public class KeyFactory {
    ctor protected KeyFactory(java.security.KeyFactorySpi, java.security.Provider, java.lang.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 java.lang.String getAlgorithm();
    method public static java.security.KeyFactory getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.KeyFactory getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.KeyFactory getInstance(java.lang.String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final <T extends java.security.spec.KeySpec> T getKeySpec(java.security.Key, java.lang.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, java.lang.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(java.lang.String);
    ctor public KeyManagementException(java.lang.String, java.lang.Throwable);
    ctor public KeyManagementException(java.lang.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(java.lang.String);
    method public final java.security.KeyPair genKeyPair();
    method public java.security.KeyPair generateKeyPair();
    method public java.lang.String getAlgorithm();
    method public static java.security.KeyPairGenerator getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.KeyPairGenerator getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.KeyPairGenerator getInstance(java.lang.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, java.lang.String, java.lang.String, byte[]);
    method protected java.lang.Object readResolve() throws java.io.ObjectStreamException;
  }

  public static final class KeyRep.Type extends java.lang.Enum {
    method public static java.security.KeyRep.Type valueOf(java.lang.String);
    method public static final java.security.KeyRep.Type[] values();
    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, java.lang.String);
    method public final java.util.Enumeration<java.lang.String> aliases() throws java.security.KeyStoreException;
    method public final boolean containsAlias(java.lang.String) throws java.security.KeyStoreException;
    method public final void deleteEntry(java.lang.String) throws java.security.KeyStoreException;
    method public final boolean entryInstanceOf(java.lang.String, java.lang.Class<? extends java.security.KeyStore.Entry>) throws java.security.KeyStoreException;
    method public final java.security.cert.Certificate getCertificate(java.lang.String) throws java.security.KeyStoreException;
    method public final java.lang.String getCertificateAlias(java.security.cert.Certificate) throws java.security.KeyStoreException;
    method public final java.security.cert.Certificate[] getCertificateChain(java.lang.String) throws java.security.KeyStoreException;
    method public final java.util.Date getCreationDate(java.lang.String) throws java.security.KeyStoreException;
    method public static final java.lang.String getDefaultType();
    method public final java.security.KeyStore.Entry getEntry(java.lang.String, java.security.KeyStore.ProtectionParameter) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableEntryException;
    method public static java.security.KeyStore getInstance(java.lang.String) throws java.security.KeyStoreException;
    method public static java.security.KeyStore getInstance(java.lang.String, java.lang.String) throws java.security.KeyStoreException, java.security.NoSuchProviderException;
    method public static java.security.KeyStore getInstance(java.lang.String, java.security.Provider) throws java.security.KeyStoreException;
    method public final java.security.Key getKey(java.lang.String, char[]) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    method public final java.security.Provider getProvider();
    method public final java.lang.String getType();
    method public final boolean isCertificateEntry(java.lang.String) throws java.security.KeyStoreException;
    method public final boolean isKeyEntry(java.lang.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(java.lang.String, java.security.cert.Certificate) throws java.security.KeyStoreException;
    method public final void setEntry(java.lang.String, java.security.KeyStore.Entry, java.security.KeyStore.ProtectionParameter) throws java.security.KeyStoreException;
    method public final void setKeyEntry(java.lang.String, java.security.Key, char[], java.security.cert.Certificate[]) throws java.security.KeyStoreException;
    method public final void setKeyEntry(java.lang.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 static abstract 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(java.lang.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(java.lang.String, java.security.Provider, java.io.File, java.security.KeyStore.ProtectionParameter);
    method public static java.security.KeyStore.Builder newInstance(java.lang.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 abstract interface KeyStore.Entry {
    method public default java.util.Set<java.security.KeyStore.Entry.Attribute> getAttributes();
  }

  public static abstract interface KeyStore.Entry.Attribute {
    method public abstract java.lang.String getName();
    method public abstract java.lang.String getValue();
  }

  public static abstract interface KeyStore.LoadStoreParameter {
    method public abstract 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[], java.lang.String, java.security.spec.AlgorithmParameterSpec);
    method public synchronized void destroy() throws javax.security.auth.DestroyFailedException;
    method public synchronized char[] getPassword();
    method public java.lang.String getProtectionAlgorithm();
    method public java.security.spec.AlgorithmParameterSpec getProtectionParameters();
    method public synchronized boolean isDestroyed();
  }

  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 abstract 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(java.lang.String);
    ctor public KeyStoreException(java.lang.String, java.lang.Throwable);
    ctor public KeyStoreException(java.lang.Throwable);
  }

  public abstract class KeyStoreSpi {
    ctor public KeyStoreSpi();
    method public abstract java.util.Enumeration<java.lang.String> engineAliases();
    method public abstract boolean engineContainsAlias(java.lang.String);
    method public abstract void engineDeleteEntry(java.lang.String) throws java.security.KeyStoreException;
    method public boolean engineEntryInstanceOf(java.lang.String, java.lang.Class<? extends java.security.KeyStore.Entry>);
    method public abstract java.security.cert.Certificate engineGetCertificate(java.lang.String);
    method public abstract java.lang.String engineGetCertificateAlias(java.security.cert.Certificate);
    method public abstract java.security.cert.Certificate[] engineGetCertificateChain(java.lang.String);
    method public abstract java.util.Date engineGetCreationDate(java.lang.String);
    method public java.security.KeyStore.Entry engineGetEntry(java.lang.String, java.security.KeyStore.ProtectionParameter) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableEntryException;
    method public abstract java.security.Key engineGetKey(java.lang.String, char[]) throws java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    method public abstract boolean engineIsCertificateEntry(java.lang.String);
    method public abstract boolean engineIsKeyEntry(java.lang.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(java.lang.String, java.security.cert.Certificate) throws java.security.KeyStoreException;
    method public void engineSetEntry(java.lang.String, java.security.KeyStore.Entry, java.security.KeyStore.ProtectionParameter) throws java.security.KeyStoreException;
    method public abstract void engineSetKeyEntry(java.lang.String, java.security.Key, char[], java.security.cert.Certificate[]) throws java.security.KeyStoreException;
    method public abstract void engineSetKeyEntry(java.lang.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(java.lang.String);
    method public byte[] digest();
    method public int digest(byte[], int, int) throws java.security.DigestException;
    method public byte[] digest(byte[]);
    method public final java.lang.String getAlgorithm();
    method public final int getDigestLength();
    method public static java.security.MessageDigest getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.MessageDigest getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.MessageDigest getInstance(java.lang.String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final java.security.Provider getProvider();
    method public static boolean isEqual(byte[], byte[]);
    method public void reset();
    method public void update(byte);
    method public void update(byte[], int, int);
    method public void update(byte[]);
    method public final void update(java.nio.ByteBuffer);
  }

  public abstract class MessageDigestSpi {
    ctor public MessageDigestSpi();
    method public java.lang.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(java.lang.String);
    ctor public NoSuchAlgorithmException(java.lang.String, java.lang.Throwable);
    ctor public NoSuchAlgorithmException(java.lang.Throwable);
  }

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

  public final class PKCS12Attribute implements java.security.KeyStore.Entry.Attribute {
    ctor public PKCS12Attribute(java.lang.String, java.lang.String);
    ctor public PKCS12Attribute(byte[]);
    method public byte[] getEncoded();
    method public java.lang.String getName();
    method public java.lang.String getValue();
  }

  public abstract class Permission implements java.security.Guard java.io.Serializable {
    ctor public Permission(java.lang.String);
    method public void checkGuard(java.lang.Object) throws java.lang.SecurityException;
    method public abstract java.lang.String getActions();
    method public final java.lang.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(java.lang.String, java.security.Policy.Parameters) throws java.security.NoSuchAlgorithmException;
    method public static java.security.Policy getInstance(java.lang.String, java.security.Policy.Parameters, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.Policy getInstance(java.lang.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 java.lang.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 abstract 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 abstract interface Principal {
    method public abstract boolean equals(java.lang.Object);
    method public abstract java.lang.String getName();
    method public abstract int hashCode();
    method public default boolean implies(javax.security.auth.Subject);
    method public abstract java.lang.String toString();
  }

  public abstract interface PrivateKey implements javax.security.auth.Destroyable java.security.Key {
    field public static final long serialVersionUID = 6034044314589513430L; // 0x53bd3b559a12c6d6L
  }

  public abstract interface PrivilegedAction<T> {
    method public abstract T run();
  }

  public class PrivilegedActionException extends java.lang.Exception {
    ctor public PrivilegedActionException(java.lang.Exception);
    method public java.lang.Throwable getCause();
    method public java.lang.Exception getException();
  }

  public abstract interface PrivilegedExceptionAction<T> {
    method public abstract 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, java.lang.ClassLoader, java.security.Principal[]);
    method public final java.lang.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(java.lang.String, double, java.lang.String);
    method public synchronized java.lang.Object compute(java.lang.Object, java.util.function.BiFunction<? super java.lang.Object, ? super java.lang.Object, ? extends java.lang.Object>);
    method public synchronized java.lang.Object computeIfAbsent(java.lang.Object, java.util.function.Function<? super java.lang.Object, ? extends java.lang.Object>);
    method public synchronized java.lang.Object computeIfPresent(java.lang.Object, java.util.function.BiFunction<? super java.lang.Object, ? super java.lang.Object, ? extends java.lang.Object>);
    method public java.util.Enumeration<java.lang.Object> elements();
    method public synchronized java.util.Set<java.util.Map.Entry<java.lang.Object, java.lang.Object>> entrySet();
    method public synchronized void forEach(java.util.function.BiConsumer<? super java.lang.Object, ? super java.lang.Object>);
    method public java.lang.Object get(java.lang.Object);
    method public java.lang.String getInfo();
    method public java.lang.String getName();
    method public synchronized java.lang.Object getOrDefault(java.lang.Object, java.lang.Object);
    method public synchronized java.security.Provider.Service getService(java.lang.String, java.lang.String);
    method public synchronized 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 synchronized java.lang.Object merge(java.lang.Object, java.lang.Object, java.util.function.BiFunction<? super java.lang.Object, ? super java.lang.Object, ? extends java.lang.Object>);
    method public synchronized java.lang.Object put(java.lang.Object, java.lang.Object);
    method public synchronized void putAll(java.util.Map<?, ?>);
    method public synchronized java.lang.Object putIfAbsent(java.lang.Object, java.lang.Object);
    method protected synchronized void putService(java.security.Provider.Service);
    method public synchronized java.lang.Object remove(java.lang.Object);
    method protected synchronized void removeService(java.security.Provider.Service);
    method public synchronized boolean replace(java.lang.Object, java.lang.Object, java.lang.Object);
    method public synchronized java.lang.Object replace(java.lang.Object, java.lang.Object);
    method public synchronized void replaceAll(java.util.function.BiFunction<? super java.lang.Object, ? super java.lang.Object, ? extends java.lang.Object>);
    method public java.util.Collection<java.lang.Object> values();
  }

  public static class Provider.Service {
    ctor public Provider.Service(java.security.Provider, java.lang.String, java.lang.String, java.lang.String, java.util.List<java.lang.String>, java.util.Map<java.lang.String, java.lang.String>);
    method public final java.lang.String getAlgorithm();
    method public final java.lang.String getAttribute(java.lang.String);
    method public final java.lang.String getClassName();
    method public final java.security.Provider getProvider();
    method public final java.lang.String getType();
    method public java.lang.Object newInstance(java.lang.Object) throws java.security.NoSuchAlgorithmException;
    method public boolean supportsParameter(java.lang.Object);
  }

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

  public abstract interface PublicKey implements java.security.Key {
    field public static final long serialVersionUID = 7187392471159151072L; // 0x63bebf5f40c219e0L
  }

  public class SecureClassLoader extends java.lang.ClassLoader {
    ctor protected SecureClassLoader(java.lang.ClassLoader);
    ctor protected SecureClassLoader();
    method protected final java.lang.Class<?> defineClass(java.lang.String, byte[], int, int, java.security.CodeSource);
    method protected final java.lang.Class<?> defineClass(java.lang.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 java.lang.String getAlgorithm();
    method public static java.security.SecureRandom getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.SecureRandom getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.SecureRandom getInstance(java.lang.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 synchronized void nextBytes(byte[]);
    method public synchronized void setSeed(byte[]);
    method public void setSeed(long);
  }

  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 public static deprecated java.lang.String getAlgorithmProperty(java.lang.String, java.lang.String);
    method public static java.util.Set<java.lang.String> getAlgorithms(java.lang.String);
    method public static java.lang.String getProperty(java.lang.String);
    method public static java.security.Provider getProvider(java.lang.String);
    method public static java.security.Provider[] getProviders();
    method public static java.security.Provider[] getProviders(java.lang.String);
    method public static java.security.Provider[] getProviders(java.util.Map<java.lang.String, java.lang.String>);
    method public static synchronized int insertProviderAt(java.security.Provider, int);
    method public static synchronized void removeProvider(java.lang.String);
    method public static void setProperty(java.lang.String, java.lang.String);
  }

  public final class SecurityPermission extends java.security.BasicPermission {
    ctor public SecurityPermission(java.lang.String);
    ctor public SecurityPermission(java.lang.String, java.lang.String);
  }

  public abstract class Signature extends java.security.SignatureSpi {
    ctor protected Signature(java.lang.String);
    method public final java.lang.String getAlgorithm();
    method public static java.security.Signature getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.Signature getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.Signature getInstance(java.lang.String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final deprecated java.lang.Object getParameter(java.lang.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 public final deprecated void setParameter(java.lang.String, java.lang.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(java.lang.String);
    ctor public SignatureException(java.lang.String, java.lang.Throwable);
    ctor public SignatureException(java.lang.Throwable);
  }

  public abstract class SignatureSpi {
    ctor public SignatureSpi();
    method public java.lang.Object clone() throws java.lang.CloneNotSupportedException;
    method protected abstract deprecated java.lang.Object engineGetParameter(java.lang.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 protected abstract deprecated void engineSetParameter(java.lang.String, java.lang.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 java.lang.String getAlgorithm();
    method public java.lang.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;
  }

  public abstract deprecated class Signer extends java.security.Identity {
    ctor protected Signer();
    ctor public Signer(java.lang.String);
    ctor public Signer(java.lang.String, java.security.IdentityScope) throws java.security.KeyManagementException;
    method public java.security.PrivateKey getPrivateKey();
    method 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(java.lang.String);
  }

  public class UnrecoverableKeyException extends java.security.UnrecoverableEntryException {
    ctor public UnrecoverableKeyException();
    ctor public UnrecoverableKeyException(java.lang.String);
  }

  public final class UnresolvedPermission extends java.security.Permission implements java.io.Serializable {
    ctor public UnresolvedPermission(java.lang.String, java.lang.String, java.lang.String, java.security.cert.Certificate[]);
    method public java.lang.String getActions();
    method public java.lang.String getUnresolvedActions();
    method public java.security.cert.Certificate[] getUnresolvedCerts();
    method public java.lang.String getUnresolvedName();
    method public java.lang.String getUnresolvedType();
    method public boolean implies(java.security.Permission);
  }

}

package java.security.acl {

  public abstract interface Acl implements java.security.acl.Owner {
    method public abstract boolean addEntry(java.security.Principal, java.security.acl.AclEntry) throws java.security.acl.NotOwnerException;
    method public abstract boolean checkPermission(java.security.Principal, java.security.acl.Permission);
    method public abstract java.util.Enumeration<java.security.acl.AclEntry> entries();
    method public abstract java.lang.String getName();
    method public abstract java.util.Enumeration<java.security.acl.Permission> getPermissions(java.security.Principal);
    method public abstract boolean removeEntry(java.security.Principal, java.security.acl.AclEntry) throws java.security.acl.NotOwnerException;
    method public abstract void setName(java.security.Principal, java.lang.String) throws java.security.acl.NotOwnerException;
    method public abstract java.lang.String toString();
  }

  public abstract interface AclEntry implements java.lang.Cloneable {
    method public abstract boolean addPermission(java.security.acl.Permission);
    method public abstract boolean checkPermission(java.security.acl.Permission);
    method public abstract java.lang.Object clone();
    method public abstract java.security.Principal getPrincipal();
    method public abstract boolean isNegative();
    method public abstract java.util.Enumeration<java.security.acl.Permission> permissions();
    method public abstract boolean removePermission(java.security.acl.Permission);
    method public abstract void setNegativePermissions();
    method public abstract boolean setPrincipal(java.security.Principal);
    method public abstract java.lang.String toString();
  }

  public class AclNotFoundException extends java.lang.Exception {
    ctor public AclNotFoundException();
  }

  public abstract interface Group implements java.security.Principal {
    method public abstract boolean addMember(java.security.Principal);
    method public abstract boolean isMember(java.security.Principal);
    method public abstract java.util.Enumeration<? extends java.security.Principal> members();
    method public abstract 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 abstract interface Owner {
    method public abstract boolean addOwner(java.security.Principal, java.security.Principal) throws java.security.acl.NotOwnerException;
    method public abstract boolean deleteOwner(java.security.Principal, java.security.Principal) throws java.security.acl.LastOwnerException, java.security.acl.NotOwnerException;
    method public abstract boolean isOwner(java.security.Principal);
  }

  public abstract interface Permission {
  }

}

package java.security.cert {

  public abstract class CRL {
    ctor protected CRL(java.lang.String);
    method public final java.lang.String getType();
    method public abstract boolean isRevoked(java.security.cert.Certificate);
    method public abstract java.lang.String toString();
  }

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

  public final class CRLReason extends java.lang.Enum {
    method public static java.security.cert.CRLReason valueOf(java.lang.String);
    method public static final java.security.cert.CRLReason[] values();
    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 abstract interface CRLSelector implements java.lang.Cloneable {
    method public abstract java.lang.Object clone();
    method public abstract boolean match(java.security.cert.CRL);
  }

  public abstract class CertPath implements java.io.Serializable {
    ctor protected CertPath(java.lang.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(java.lang.String) throws java.security.cert.CertificateEncodingException;
    method public abstract java.util.Iterator<java.lang.String> getEncodings();
    method public java.lang.String getType();
    method protected java.lang.Object writeReplace() throws java.io.ObjectStreamException;
  }

  protected static class CertPath.CertPathRep implements java.io.Serializable {
    ctor protected CertPath.CertPathRep(java.lang.String, byte[]);
    method protected java.lang.Object readResolve() throws java.io.ObjectStreamException;
  }

  public class CertPathBuilder {
    ctor protected CertPathBuilder(java.security.cert.CertPathBuilderSpi, java.security.Provider, java.lang.String);
    method public final java.security.cert.CertPathBuilderResult build(java.security.cert.CertPathParameters) throws java.security.cert.CertPathBuilderException, java.security.InvalidAlgorithmParameterException;
    method public final java.lang.String getAlgorithm();
    method public static final java.lang.String getDefaultType();
    method public static java.security.cert.CertPathBuilder getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.cert.CertPathBuilder getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.cert.CertPathBuilder getInstance(java.lang.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(java.lang.String);
    ctor public CertPathBuilderException(java.lang.Throwable);
    ctor public CertPathBuilderException(java.lang.String, java.lang.Throwable);
  }

  public abstract interface CertPathBuilderResult implements java.lang.Cloneable {
    method public abstract java.lang.Object clone();
    method public abstract 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 abstract interface CertPathChecker {
    method public abstract void check(java.security.cert.Certificate) throws java.security.cert.CertPathValidatorException;
    method public abstract void init(boolean) throws java.security.cert.CertPathValidatorException;
    method public abstract boolean isForwardCheckingSupported();
  }

  public abstract interface CertPathParameters implements java.lang.Cloneable {
    method public abstract java.lang.Object clone();
  }

  public class CertPathValidator {
    ctor protected CertPathValidator(java.security.cert.CertPathValidatorSpi, java.security.Provider, java.lang.String);
    method public final java.lang.String getAlgorithm();
    method public static final java.lang.String getDefaultType();
    method public static java.security.cert.CertPathValidator getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static java.security.cert.CertPathValidator getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.cert.CertPathValidator getInstance(java.lang.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(java.lang.String);
    ctor public CertPathValidatorException(java.lang.Throwable);
    ctor public CertPathValidatorException(java.lang.String, java.lang.Throwable);
    ctor public CertPathValidatorException(java.lang.String, java.lang.Throwable, java.security.cert.CertPath, int);
    ctor public CertPathValidatorException(java.lang.String, java.lang.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 static final class CertPathValidatorException.BasicReason extends java.lang.Enum implements java.security.cert.CertPathValidatorException.Reason {
    method public static java.security.cert.CertPathValidatorException.BasicReason valueOf(java.lang.String);
    method public static final java.security.cert.CertPathValidatorException.BasicReason[] values();
    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 abstract interface CertPathValidatorException.Reason implements java.io.Serializable {
  }

  public abstract interface CertPathValidatorResult implements java.lang.Cloneable {
    method public abstract java.lang.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 abstract interface CertSelector implements java.lang.Cloneable {
    method public abstract java.lang.Object clone();
    method public abstract boolean match(java.security.cert.Certificate);
  }

  public class CertStore {
    ctor protected CertStore(java.security.cert.CertStoreSpi, java.security.Provider, java.lang.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 java.lang.String getDefaultType();
    method public static java.security.cert.CertStore getInstance(java.lang.String, java.security.cert.CertStoreParameters) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException;
    method public static java.security.cert.CertStore getInstance(java.lang.String, java.security.cert.CertStoreParameters, java.lang.String) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static java.security.cert.CertStore getInstance(java.lang.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 java.lang.String getType();
  }

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

  public abstract interface CertStoreParameters implements java.lang.Cloneable {
    method public abstract java.lang.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(java.lang.String);
    method public abstract byte[] getEncoded() throws java.security.cert.CertificateEncodingException;
    method public abstract java.security.PublicKey getPublicKey();
    method public final java.lang.String getType();
    method public abstract java.lang.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, java.lang.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 java.lang.Object writeReplace() throws java.io.ObjectStreamException;
  }

  protected static class Certificate.CertificateRep implements java.io.Serializable {
    ctor protected Certificate.CertificateRep(java.lang.String, byte[]);
    method protected java.lang.Object readResolve() throws java.io.ObjectStreamException;
  }

  public class CertificateEncodingException extends java.security.cert.CertificateException {
    ctor public CertificateEncodingException();
    ctor public CertificateEncodingException(java.lang.String);
    ctor public CertificateEncodingException(java.lang.String, java.lang.Throwable);
    ctor public CertificateEncodingException(java.lang.Throwable);
  }

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

  public class CertificateExpiredException extends java.security.cert.CertificateException {
    ctor public CertificateExpiredException();
    ctor public CertificateExpiredException(java.lang.String);
  }

  public class CertificateFactory {
    ctor protected CertificateFactory(java.security.cert.CertificateFactorySpi, java.security.Provider, java.lang.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, java.lang.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(java.lang.String) throws java.security.cert.CertificateException;
    method public static final java.security.cert.CertificateFactory getInstance(java.lang.String, java.lang.String) throws java.security.cert.CertificateException, java.security.NoSuchProviderException;
    method public static final java.security.cert.CertificateFactory getInstance(java.lang.String, java.security.Provider) throws java.security.cert.CertificateException;
    method public final java.security.Provider getProvider();
    method public final java.lang.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, java.lang.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(java.lang.String);
  }

  public class CertificateParsingException extends java.security.cert.CertificateException {
    ctor public CertificateParsingException();
    ctor public CertificateParsingException(java.lang.String);
    ctor public CertificateParsingException(java.lang.String, java.lang.Throwable);
    ctor public CertificateParsingException(java.lang.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 java.lang.Object clone();
    method public java.util.Collection<?> getCollection();
  }

  public abstract interface Extension {
    method public abstract void encode(java.io.OutputStream) throws java.io.IOException;
    method public abstract java.lang.String getId();
    method public abstract byte[] getValue();
    method public abstract boolean isCritical();
  }

  public class LDAPCertStoreParameters implements java.security.cert.CertStoreParameters {
    ctor public LDAPCertStoreParameters(java.lang.String, int);
    ctor public LDAPCertStoreParameters(java.lang.String);
    ctor public LDAPCertStoreParameters();
    method public java.lang.Object clone();
    method public int getPort();
    method public java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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(java.lang.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 final class PKIXReason extends java.lang.Enum implements java.security.cert.CertPathValidatorException.Reason {
    method public static java.security.cert.PKIXReason valueOf(java.lang.String);
    method public static final java.security.cert.PKIXReason[] values();
    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 static final class PKIXRevocationChecker.Option extends java.lang.Enum {
    method public static java.security.cert.PKIXRevocationChecker.Option valueOf(java.lang.String);
    method public static final java.security.cert.PKIXRevocationChecker.Option[] values();
    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 abstract interface PolicyNode {
    method public abstract java.util.Iterator<? extends java.security.cert.PolicyNode> getChildren();
    method public abstract int getDepth();
    method public abstract java.util.Set<java.lang.String> getExpectedPolicies();
    method public abstract java.security.cert.PolicyNode getParent();
    method public abstract java.util.Set<? extends java.security.cert.PolicyQualifierInfo> getPolicyQualifiers();
    method public abstract java.lang.String getValidPolicy();
    method public abstract 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 java.lang.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(java.lang.String, java.security.PublicKey, byte[]);
    method public final javax.security.auth.x500.X500Principal getCA();
    method public final java.lang.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 java.lang.String getSigAlgName();
    method public abstract java.lang.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, java.lang.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 java.lang.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(java.lang.String) throws java.io.IOException;
    method public void addIssuerName(byte[]) throws java.io.IOException;
    method public java.lang.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, java.lang.String) throws java.io.IOException;
    method public void addPathToName(int, byte[]) throws java.io.IOException;
    method public void addSubjectAlternativeName(int, java.lang.String) throws java.io.IOException;
    method public void addSubjectAlternativeName(int, byte[]) throws java.io.IOException;
    method public java.lang.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 java.lang.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 java.lang.String getSubjectAsString();
    method public byte[] getSubjectKeyIdentifier();
    method public java.security.PublicKey getSubjectPublicKey();
    method public java.lang.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(java.lang.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(java.lang.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(java.lang.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 java.lang.String getSigAlgName();
    method public abstract java.lang.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 abstract interface X509Extension {
    method public abstract java.util.Set<java.lang.String> getCriticalExtensionOIDs();
    method public abstract byte[] getExtensionValue(java.lang.String);
    method public abstract java.util.Set<java.lang.String> getNonCriticalExtensionOIDs();
    method public abstract boolean hasUnsupportedCriticalExtension();
  }

}

package java.security.interfaces {

  public abstract interface DSAKey {
    method public abstract java.security.interfaces.DSAParams getParams();
  }

  public abstract interface DSAKeyPairGenerator {
    method public abstract void initialize(java.security.interfaces.DSAParams, java.security.SecureRandom) throws java.security.InvalidParameterException;
    method public abstract void initialize(int, boolean, java.security.SecureRandom) throws java.security.InvalidParameterException;
  }

  public abstract interface DSAParams {
    method public abstract java.math.BigInteger getG();
    method public abstract java.math.BigInteger getP();
    method public abstract java.math.BigInteger getQ();
  }

  public abstract interface DSAPrivateKey implements java.security.interfaces.DSAKey java.security.PrivateKey {
    method public abstract java.math.BigInteger getX();
    field public static final long serialVersionUID = 7776497482533790279L; // 0x6bebab423b256247L
  }

  public abstract interface DSAPublicKey implements java.security.interfaces.DSAKey java.security.PublicKey {
    method public abstract java.math.BigInteger getY();
    field public static final long serialVersionUID = 1234526332779022332L; // 0x1121eb28ab28c7fcL
  }

  public abstract interface ECKey {
    method public abstract java.security.spec.ECParameterSpec getParams();
  }

  public abstract interface ECPrivateKey implements java.security.interfaces.ECKey java.security.PrivateKey {
    method public abstract java.math.BigInteger getS();
    field public static final long serialVersionUID = -7896394956925609184L; // 0x926a5e9fa2435b20L
  }

  public abstract interface ECPublicKey implements java.security.interfaces.ECKey java.security.PublicKey {
    method public abstract java.security.spec.ECPoint getW();
    field public static final long serialVersionUID = -3314988629879632826L; // 0xd1fecb679990cc46L
  }

  public abstract interface RSAKey {
    method public abstract java.math.BigInteger getModulus();
  }

  public abstract interface RSAMultiPrimePrivateCrtKey implements java.security.interfaces.RSAPrivateKey {
    method public abstract java.math.BigInteger getCrtCoefficient();
    method public abstract java.security.spec.RSAOtherPrimeInfo[] getOtherPrimeInfo();
    method public abstract java.math.BigInteger getPrimeExponentP();
    method public abstract java.math.BigInteger getPrimeExponentQ();
    method public abstract java.math.BigInteger getPrimeP();
    method public abstract java.math.BigInteger getPrimeQ();
    method public abstract java.math.BigInteger getPublicExponent();
    field public static final long serialVersionUID = 618058533534628008L; // 0x893c8f62dbaf8a8L
  }

  public abstract interface RSAPrivateCrtKey implements java.security.interfaces.RSAPrivateKey {
    method public abstract java.math.BigInteger getCrtCoefficient();
    method public abstract java.math.BigInteger getPrimeExponentP();
    method public abstract java.math.BigInteger getPrimeExponentQ();
    method public abstract java.math.BigInteger getPrimeP();
    method public abstract java.math.BigInteger getPrimeQ();
    method public abstract java.math.BigInteger getPublicExponent();
    field public static final long serialVersionUID = -5682214253527700368L; // 0xb124b83df8d1ec70L
  }

  public abstract interface RSAPrivateKey implements java.security.PrivateKey java.security.interfaces.RSAKey {
    method public abstract java.math.BigInteger getPrivateExponent();
    field public static final long serialVersionUID = 5187144804936595022L; // 0x47fc70b7a8c2364eL
  }

  public abstract interface RSAPublicKey implements java.security.PublicKey java.security.interfaces.RSAKey {
    method public abstract java.math.BigInteger getPublicExponent();
    field public static final long serialVersionUID = -8727434096241101194L; // 0x86e1ecedeceab676L
  }

}

package java.security.spec {

  public abstract 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 abstract interface ECField {
    method public abstract 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(java.lang.String);
    method public java.lang.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 java.lang.String getFormat();
  }

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

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

  public abstract interface KeySpec {
  }

  public class MGF1ParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public MGF1ParameterSpec(java.lang.String);
    method public java.lang.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 java.lang.String getFormat();
  }

  public class PSSParameterSpec implements java.security.spec.AlgorithmParameterSpec {
    ctor public PSSParameterSpec(java.lang.String, java.lang.String, java.security.spec.AlgorithmParameterSpec, int, int);
    ctor public PSSParameterSpec(int);
    method public java.lang.String getDigestAlgorithm();
    method public java.lang.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 java.lang.String getFormat();
  }

}

package java.sql {

  public abstract interface Array {
    method public abstract void free() throws java.sql.SQLException;
    method public abstract java.lang.Object getArray() throws java.sql.SQLException;
    method public abstract java.lang.Object getArray(java.util.Map<java.lang.String, java.lang.Class<?>>) throws java.sql.SQLException;
    method public abstract java.lang.Object getArray(long, int) throws java.sql.SQLException;
    method public abstract java.lang.Object getArray(long, int, java.util.Map<java.lang.String, java.lang.Class<?>>) throws java.sql.SQLException;
    method public abstract int getBaseType() throws java.sql.SQLException;
    method public abstract java.lang.String getBaseTypeName() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getResultSet() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getResultSet(java.util.Map<java.lang.String, java.lang.Class<?>>) throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getResultSet(long, int) throws java.sql.SQLException;
    method public abstract 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(java.lang.String, java.lang.String, int, int[]);
    ctor public BatchUpdateException(java.lang.String, java.lang.String, int[]);
    ctor public BatchUpdateException(java.lang.String, int[]);
    ctor public BatchUpdateException(int[]);
    ctor public BatchUpdateException();
    ctor public BatchUpdateException(java.lang.Throwable);
    ctor public BatchUpdateException(int[], java.lang.Throwable);
    ctor public BatchUpdateException(java.lang.String, int[], java.lang.Throwable);
    ctor public BatchUpdateException(java.lang.String, java.lang.String, int[], java.lang.Throwable);
    ctor public BatchUpdateException(java.lang.String, java.lang.String, int, int[], java.lang.Throwable);
    method public int[] getUpdateCounts();
  }

  public abstract interface Blob {
    method public abstract void free() throws java.sql.SQLException;
    method public abstract java.io.InputStream getBinaryStream() throws java.sql.SQLException;
    method public abstract java.io.InputStream getBinaryStream(long, long) throws java.sql.SQLException;
    method public abstract byte[] getBytes(long, int) throws java.sql.SQLException;
    method public abstract long length() throws java.sql.SQLException;
    method public abstract long position(byte[], long) throws java.sql.SQLException;
    method public abstract long position(java.sql.Blob, long) throws java.sql.SQLException;
    method public abstract java.io.OutputStream setBinaryStream(long) throws java.sql.SQLException;
    method public abstract int setBytes(long, byte[]) throws java.sql.SQLException;
    method public abstract int setBytes(long, byte[], int, int) throws java.sql.SQLException;
    method public abstract void truncate(long) throws java.sql.SQLException;
  }

  public abstract interface CallableStatement implements java.sql.PreparedStatement {
    method public abstract java.sql.Array getArray(int) throws java.sql.SQLException;
    method public abstract java.sql.Array getArray(java.lang.String) throws java.sql.SQLException;
    method public abstract deprecated java.math.BigDecimal getBigDecimal(int, int) throws java.sql.SQLException;
    method public abstract java.math.BigDecimal getBigDecimal(int) throws java.sql.SQLException;
    method public abstract java.math.BigDecimal getBigDecimal(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Blob getBlob(int) throws java.sql.SQLException;
    method public abstract java.sql.Blob getBlob(java.lang.String) throws java.sql.SQLException;
    method public abstract boolean getBoolean(int) throws java.sql.SQLException;
    method public abstract boolean getBoolean(java.lang.String) throws java.sql.SQLException;
    method public abstract byte getByte(int) throws java.sql.SQLException;
    method public abstract byte getByte(java.lang.String) throws java.sql.SQLException;
    method public abstract byte[] getBytes(int) throws java.sql.SQLException;
    method public abstract byte[] getBytes(java.lang.String) throws java.sql.SQLException;
    method public abstract java.io.Reader getCharacterStream(int) throws java.sql.SQLException;
    method public abstract java.io.Reader getCharacterStream(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Clob getClob(int) throws java.sql.SQLException;
    method public abstract java.sql.Clob getClob(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Date getDate(int) throws java.sql.SQLException;
    method public abstract java.sql.Date getDate(int, java.util.Calendar) throws java.sql.SQLException;
    method public abstract java.sql.Date getDate(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Date getDate(java.lang.String, java.util.Calendar) throws java.sql.SQLException;
    method public abstract double getDouble(int) throws java.sql.SQLException;
    method public abstract double getDouble(java.lang.String) throws java.sql.SQLException;
    method public abstract float getFloat(int) throws java.sql.SQLException;
    method public abstract float getFloat(java.lang.String) throws java.sql.SQLException;
    method public abstract int getInt(int) throws java.sql.SQLException;
    method public abstract int getInt(java.lang.String) throws java.sql.SQLException;
    method public abstract long getLong(int) throws java.sql.SQLException;
    method public abstract long getLong(java.lang.String) throws java.sql.SQLException;
    method public abstract java.io.Reader getNCharacterStream(int) throws java.sql.SQLException;
    method public abstract java.io.Reader getNCharacterStream(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.NClob getNClob(int) throws java.sql.SQLException;
    method public abstract java.sql.NClob getNClob(java.lang.String) throws java.sql.SQLException;
    method public abstract java.lang.String getNString(int) throws java.sql.SQLException;
    method public abstract java.lang.String getNString(java.lang.String) throws java.sql.SQLException;
    method public abstract java.lang.Object getObject(int) throws java.sql.SQLException;
    method public abstract java.lang.Object getObject(int, java.util.Map<java.lang.String, java.lang.Class<?>>) throws java.sql.SQLException;
    method public abstract java.lang.Object getObject(java.lang.String) throws java.sql.SQLException;
    method public abstract java.lang.Object getObject(java.lang.String, java.util.Map<java.lang.String, java.lang.Class<?>>) throws java.sql.SQLException;
    method public abstract java.sql.Ref getRef(int) throws java.sql.SQLException;
    method public abstract java.sql.Ref getRef(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.RowId getRowId(int) throws java.sql.SQLException;
    method public abstract java.sql.RowId getRowId(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.SQLXML getSQLXML(int) throws java.sql.SQLException;
    method public abstract java.sql.SQLXML getSQLXML(java.lang.String) throws java.sql.SQLException;
    method public abstract short getShort(int) throws java.sql.SQLException;
    method public abstract short getShort(java.lang.String) throws java.sql.SQLException;
    method public abstract java.lang.String getString(int) throws java.sql.SQLException;
    method public abstract java.lang.String getString(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Time getTime(int) throws java.sql.SQLException;
    method public abstract java.sql.Time getTime(int, java.util.Calendar) throws java.sql.SQLException;
    method public abstract java.sql.Time getTime(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Time getTime(java.lang.String, java.util.Calendar) throws java.sql.SQLException;
    method public abstract java.sql.Timestamp getTimestamp(int) throws java.sql.SQLException;
    method public abstract java.sql.Timestamp getTimestamp(int, java.util.Calendar) throws java.sql.SQLException;
    method public abstract java.sql.Timestamp getTimestamp(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Timestamp getTimestamp(java.lang.String, java.util.Calendar) throws java.sql.SQLException;
    method public abstract java.net.URL getURL(int) throws java.sql.SQLException;
    method public abstract java.net.URL getURL(java.lang.String) throws java.sql.SQLException;
    method public abstract void registerOutParameter(int, int) throws java.sql.SQLException;
    method public abstract void registerOutParameter(int, int, int) throws java.sql.SQLException;
    method public abstract void registerOutParameter(int, int, java.lang.String) throws java.sql.SQLException;
    method public abstract void registerOutParameter(java.lang.String, int) throws java.sql.SQLException;
    method public abstract void registerOutParameter(java.lang.String, int, int) throws java.sql.SQLException;
    method public abstract void registerOutParameter(java.lang.String, int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setAsciiStream(java.lang.String, java.io.InputStream, int) throws java.sql.SQLException;
    method public abstract void setAsciiStream(java.lang.String, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void setAsciiStream(java.lang.String, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void setBigDecimal(java.lang.String, java.math.BigDecimal) throws java.sql.SQLException;
    method public abstract void setBinaryStream(java.lang.String, java.io.InputStream, int) throws java.sql.SQLException;
    method public abstract void setBinaryStream(java.lang.String, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void setBinaryStream(java.lang.String, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void setBlob(java.lang.String, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void setBlob(java.lang.String, java.sql.Blob) throws java.sql.SQLException;
    method public abstract void setBlob(java.lang.String, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void setBoolean(java.lang.String, boolean) throws java.sql.SQLException;
    method public abstract void setByte(java.lang.String, byte) throws java.sql.SQLException;
    method public abstract void setBytes(java.lang.String, byte[]) throws java.sql.SQLException;
    method public abstract void setCharacterStream(java.lang.String, java.io.Reader, int) throws java.sql.SQLException;
    method public abstract void setCharacterStream(java.lang.String, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setCharacterStream(java.lang.String, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setClob(java.lang.String, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setClob(java.lang.String, java.sql.Clob) throws java.sql.SQLException;
    method public abstract void setClob(java.lang.String, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setDate(java.lang.String, java.sql.Date) throws java.sql.SQLException;
    method public abstract void setDate(java.lang.String, java.sql.Date, java.util.Calendar) throws java.sql.SQLException;
    method public abstract void setDouble(java.lang.String, double) throws java.sql.SQLException;
    method public abstract void setFloat(java.lang.String, float) throws java.sql.SQLException;
    method public abstract void setInt(java.lang.String, int) throws java.sql.SQLException;
    method public abstract void setLong(java.lang.String, long) throws java.sql.SQLException;
    method public abstract void setNCharacterStream(java.lang.String, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setNCharacterStream(java.lang.String, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setNClob(java.lang.String, java.sql.NClob) throws java.sql.SQLException;
    method public abstract void setNClob(java.lang.String, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setNClob(java.lang.String, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setNString(java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract void setNull(java.lang.String, int) throws java.sql.SQLException;
    method public abstract void setNull(java.lang.String, int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setObject(java.lang.String, java.lang.Object, int, int) throws java.sql.SQLException;
    method public abstract void setObject(java.lang.String, java.lang.Object, int) throws java.sql.SQLException;
    method public abstract void setObject(java.lang.String, java.lang.Object) throws java.sql.SQLException;
    method public abstract void setRowId(java.lang.String, java.sql.RowId) throws java.sql.SQLException;
    method public abstract void setSQLXML(java.lang.String, java.sql.SQLXML) throws java.sql.SQLException;
    method public abstract void setShort(java.lang.String, short) throws java.sql.SQLException;
    method public abstract void setString(java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract void setTime(java.lang.String, java.sql.Time) throws java.sql.SQLException;
    method public abstract void setTime(java.lang.String, java.sql.Time, java.util.Calendar) throws java.sql.SQLException;
    method public abstract void setTimestamp(java.lang.String, java.sql.Timestamp) throws java.sql.SQLException;
    method public abstract void setTimestamp(java.lang.String, java.sql.Timestamp, java.util.Calendar) throws java.sql.SQLException;
    method public abstract void setURL(java.lang.String, java.net.URL) throws java.sql.SQLException;
    method public abstract boolean wasNull() throws java.sql.SQLException;
  }

  public final class ClientInfoStatus extends java.lang.Enum {
    method public static java.sql.ClientInfoStatus valueOf(java.lang.String);
    method public static final java.sql.ClientInfoStatus[] values();
    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 abstract interface Clob {
    method public abstract void free() throws java.sql.SQLException;
    method public abstract java.io.InputStream getAsciiStream() throws java.sql.SQLException;
    method public abstract java.io.Reader getCharacterStream() throws java.sql.SQLException;
    method public abstract java.io.Reader getCharacterStream(long, long) throws java.sql.SQLException;
    method public abstract java.lang.String getSubString(long, int) throws java.sql.SQLException;
    method public abstract long length() throws java.sql.SQLException;
    method public abstract long position(java.lang.String, long) throws java.sql.SQLException;
    method public abstract long position(java.sql.Clob, long) throws java.sql.SQLException;
    method public abstract java.io.OutputStream setAsciiStream(long) throws java.sql.SQLException;
    method public abstract java.io.Writer setCharacterStream(long) throws java.sql.SQLException;
    method public abstract int setString(long, java.lang.String) throws java.sql.SQLException;
    method public abstract int setString(long, java.lang.String, int, int) throws java.sql.SQLException;
    method public abstract void truncate(long) throws java.sql.SQLException;
  }

  public abstract interface Connection implements java.lang.AutoCloseable java.sql.Wrapper {
    method public abstract void clearWarnings() throws java.sql.SQLException;
    method public abstract void close() throws java.sql.SQLException;
    method public abstract void commit() throws java.sql.SQLException;
    method public abstract java.sql.Array createArrayOf(java.lang.String, java.lang.Object[]) throws java.sql.SQLException;
    method public abstract java.sql.Blob createBlob() throws java.sql.SQLException;
    method public abstract java.sql.Clob createClob() throws java.sql.SQLException;
    method public abstract java.sql.NClob createNClob() throws java.sql.SQLException;
    method public abstract java.sql.SQLXML createSQLXML() throws java.sql.SQLException;
    method public abstract java.sql.Statement createStatement() throws java.sql.SQLException;
    method public abstract java.sql.Statement createStatement(int, int) throws java.sql.SQLException;
    method public abstract java.sql.Statement createStatement(int, int, int) throws java.sql.SQLException;
    method public abstract java.sql.Struct createStruct(java.lang.String, java.lang.Object[]) throws java.sql.SQLException;
    method public abstract boolean getAutoCommit() throws java.sql.SQLException;
    method public abstract java.lang.String getCatalog() throws java.sql.SQLException;
    method public abstract java.lang.String getClientInfo(java.lang.String) throws java.sql.SQLException;
    method public abstract java.util.Properties getClientInfo() throws java.sql.SQLException;
    method public abstract int getHoldability() throws java.sql.SQLException;
    method public abstract java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException;
    method public abstract int getTransactionIsolation() throws java.sql.SQLException;
    method public abstract java.util.Map<java.lang.String, java.lang.Class<?>> getTypeMap() throws java.sql.SQLException;
    method public abstract java.sql.SQLWarning getWarnings() throws java.sql.SQLException;
    method public abstract boolean isClosed() throws java.sql.SQLException;
    method public abstract boolean isReadOnly() throws java.sql.SQLException;
    method public abstract boolean isValid(int) throws java.sql.SQLException;
    method public abstract java.lang.String nativeSQL(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.CallableStatement prepareCall(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.CallableStatement prepareCall(java.lang.String, int, int) throws java.sql.SQLException;
    method public abstract java.sql.CallableStatement prepareCall(java.lang.String, int, int, int) throws java.sql.SQLException;
    method public abstract java.sql.PreparedStatement prepareStatement(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.PreparedStatement prepareStatement(java.lang.String, int, int) throws java.sql.SQLException;
    method public abstract java.sql.PreparedStatement prepareStatement(java.lang.String, int, int, int) throws java.sql.SQLException;
    method public abstract java.sql.PreparedStatement prepareStatement(java.lang.String, int) throws java.sql.SQLException;
    method public abstract java.sql.PreparedStatement prepareStatement(java.lang.String, int[]) throws java.sql.SQLException;
    method public abstract java.sql.PreparedStatement prepareStatement(java.lang.String, java.lang.String[]) throws java.sql.SQLException;
    method public abstract void releaseSavepoint(java.sql.Savepoint) throws java.sql.SQLException;
    method public abstract void rollback() throws java.sql.SQLException;
    method public abstract void rollback(java.sql.Savepoint) throws java.sql.SQLException;
    method public abstract void setAutoCommit(boolean) throws java.sql.SQLException;
    method public abstract void setCatalog(java.lang.String) throws java.sql.SQLException;
    method public abstract void setClientInfo(java.lang.String, java.lang.String) throws java.sql.SQLClientInfoException;
    method public abstract void setClientInfo(java.util.Properties) throws java.sql.SQLClientInfoException;
    method public abstract void setHoldability(int) throws java.sql.SQLException;
    method public abstract void setReadOnly(boolean) throws java.sql.SQLException;
    method public abstract java.sql.Savepoint setSavepoint() throws java.sql.SQLException;
    method public abstract java.sql.Savepoint setSavepoint(java.lang.String) throws java.sql.SQLException;
    method public abstract void setTransactionIsolation(int) throws java.sql.SQLException;
    method public abstract 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, java.lang.Throwable);
    method public int getDataSize();
    method public int getIndex();
    method public boolean getParameter();
    method public boolean getRead();
    method public int getTransferSize();
  }

  public abstract interface DatabaseMetaData implements java.sql.Wrapper {
    method public abstract boolean allProceduresAreCallable() throws java.sql.SQLException;
    method public abstract boolean allTablesAreSelectable() throws java.sql.SQLException;
    method public abstract boolean autoCommitFailureClosesAllResultSets() throws java.sql.SQLException;
    method public abstract boolean dataDefinitionCausesTransactionCommit() throws java.sql.SQLException;
    method public abstract boolean dataDefinitionIgnoredInTransactions() throws java.sql.SQLException;
    method public abstract boolean deletesAreDetected(int) throws java.sql.SQLException;
    method public abstract boolean doesMaxRowSizeIncludeBlobs() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getAttributes(java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getBestRowIdentifier(java.lang.String, java.lang.String, java.lang.String, int, boolean) throws java.sql.SQLException;
    method public abstract java.lang.String getCatalogSeparator() throws java.sql.SQLException;
    method public abstract java.lang.String getCatalogTerm() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getCatalogs() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getClientInfoProperties() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getColumnPrivileges(java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Connection getConnection() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getCrossReference(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract int getDatabaseMajorVersion() throws java.sql.SQLException;
    method public abstract int getDatabaseMinorVersion() throws java.sql.SQLException;
    method public abstract java.lang.String getDatabaseProductName() throws java.sql.SQLException;
    method public abstract java.lang.String getDatabaseProductVersion() throws java.sql.SQLException;
    method public abstract int getDefaultTransactionIsolation() throws java.sql.SQLException;
    method public abstract int getDriverMajorVersion();
    method public abstract int getDriverMinorVersion();
    method public abstract java.lang.String getDriverName() throws java.sql.SQLException;
    method public abstract java.lang.String getDriverVersion() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getExportedKeys(java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.lang.String getExtraNameCharacters() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getFunctionColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getFunctions(java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.lang.String getIdentifierQuoteString() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getImportedKeys(java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getIndexInfo(java.lang.String, java.lang.String, java.lang.String, boolean, boolean) throws java.sql.SQLException;
    method public abstract int getJDBCMajorVersion() throws java.sql.SQLException;
    method public abstract int getJDBCMinorVersion() throws java.sql.SQLException;
    method public abstract int getMaxBinaryLiteralLength() throws java.sql.SQLException;
    method public abstract int getMaxCatalogNameLength() throws java.sql.SQLException;
    method public abstract int getMaxCharLiteralLength() throws java.sql.SQLException;
    method public abstract int getMaxColumnNameLength() throws java.sql.SQLException;
    method public abstract int getMaxColumnsInGroupBy() throws java.sql.SQLException;
    method public abstract int getMaxColumnsInIndex() throws java.sql.SQLException;
    method public abstract int getMaxColumnsInOrderBy() throws java.sql.SQLException;
    method public abstract int getMaxColumnsInSelect() throws java.sql.SQLException;
    method public abstract int getMaxColumnsInTable() throws java.sql.SQLException;
    method public abstract int getMaxConnections() throws java.sql.SQLException;
    method public abstract int getMaxCursorNameLength() throws java.sql.SQLException;
    method public abstract int getMaxIndexLength() throws java.sql.SQLException;
    method public abstract int getMaxProcedureNameLength() throws java.sql.SQLException;
    method public abstract int getMaxRowSize() throws java.sql.SQLException;
    method public abstract int getMaxSchemaNameLength() throws java.sql.SQLException;
    method public abstract int getMaxStatementLength() throws java.sql.SQLException;
    method public abstract int getMaxStatements() throws java.sql.SQLException;
    method public abstract int getMaxTableNameLength() throws java.sql.SQLException;
    method public abstract int getMaxTablesInSelect() throws java.sql.SQLException;
    method public abstract int getMaxUserNameLength() throws java.sql.SQLException;
    method public abstract java.lang.String getNumericFunctions() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getPrimaryKeys(java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getProcedureColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.lang.String getProcedureTerm() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getProcedures(java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract int getResultSetHoldability() throws java.sql.SQLException;
    method public abstract java.sql.RowIdLifetime getRowIdLifetime() throws java.sql.SQLException;
    method public abstract java.lang.String getSQLKeywords() throws java.sql.SQLException;
    method public abstract int getSQLStateType() throws java.sql.SQLException;
    method public abstract java.lang.String getSchemaTerm() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getSchemas() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getSchemas(java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.lang.String getSearchStringEscape() throws java.sql.SQLException;
    method public abstract java.lang.String getStringFunctions() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getSuperTables(java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getSuperTypes(java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.lang.String getSystemFunctions() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getTablePrivileges(java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getTableTypes() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]) throws java.sql.SQLException;
    method public abstract java.lang.String getTimeDateFunctions() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getTypeInfo() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getUDTs(java.lang.String, java.lang.String, java.lang.String, int[]) throws java.sql.SQLException;
    method public abstract java.lang.String getURL() throws java.sql.SQLException;
    method public abstract java.lang.String getUserName() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getVersionColumns(java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract boolean insertsAreDetected(int) throws java.sql.SQLException;
    method public abstract boolean isCatalogAtStart() throws java.sql.SQLException;
    method public abstract boolean isReadOnly() throws java.sql.SQLException;
    method public abstract boolean locatorsUpdateCopy() throws java.sql.SQLException;
    method public abstract boolean nullPlusNonNullIsNull() throws java.sql.SQLException;
    method public abstract boolean nullsAreSortedAtEnd() throws java.sql.SQLException;
    method public abstract boolean nullsAreSortedAtStart() throws java.sql.SQLException;
    method public abstract boolean nullsAreSortedHigh() throws java.sql.SQLException;
    method public abstract boolean nullsAreSortedLow() throws java.sql.SQLException;
    method public abstract boolean othersDeletesAreVisible(int) throws java.sql.SQLException;
    method public abstract boolean othersInsertsAreVisible(int) throws java.sql.SQLException;
    method public abstract boolean othersUpdatesAreVisible(int) throws java.sql.SQLException;
    method public abstract boolean ownDeletesAreVisible(int) throws java.sql.SQLException;
    method public abstract boolean ownInsertsAreVisible(int) throws java.sql.SQLException;
    method public abstract boolean ownUpdatesAreVisible(int) throws java.sql.SQLException;
    method public abstract boolean storesLowerCaseIdentifiers() throws java.sql.SQLException;
    method public abstract boolean storesLowerCaseQuotedIdentifiers() throws java.sql.SQLException;
    method public abstract boolean storesMixedCaseIdentifiers() throws java.sql.SQLException;
    method public abstract boolean storesMixedCaseQuotedIdentifiers() throws java.sql.SQLException;
    method public abstract boolean storesUpperCaseIdentifiers() throws java.sql.SQLException;
    method public abstract boolean storesUpperCaseQuotedIdentifiers() throws java.sql.SQLException;
    method public abstract boolean supportsANSI92EntryLevelSQL() throws java.sql.SQLException;
    method public abstract boolean supportsANSI92FullSQL() throws java.sql.SQLException;
    method public abstract boolean supportsANSI92IntermediateSQL() throws java.sql.SQLException;
    method public abstract boolean supportsAlterTableWithAddColumn() throws java.sql.SQLException;
    method public abstract boolean supportsAlterTableWithDropColumn() throws java.sql.SQLException;
    method public abstract boolean supportsBatchUpdates() throws java.sql.SQLException;
    method public abstract boolean supportsCatalogsInDataManipulation() throws java.sql.SQLException;
    method public abstract boolean supportsCatalogsInIndexDefinitions() throws java.sql.SQLException;
    method public abstract boolean supportsCatalogsInPrivilegeDefinitions() throws java.sql.SQLException;
    method public abstract boolean supportsCatalogsInProcedureCalls() throws java.sql.SQLException;
    method public abstract boolean supportsCatalogsInTableDefinitions() throws java.sql.SQLException;
    method public abstract boolean supportsColumnAliasing() throws java.sql.SQLException;
    method public abstract boolean supportsConvert() throws java.sql.SQLException;
    method public abstract boolean supportsConvert(int, int) throws java.sql.SQLException;
    method public abstract boolean supportsCoreSQLGrammar() throws java.sql.SQLException;
    method public abstract boolean supportsCorrelatedSubqueries() throws java.sql.SQLException;
    method public abstract boolean supportsDataDefinitionAndDataManipulationTransactions() throws java.sql.SQLException;
    method public abstract boolean supportsDataManipulationTransactionsOnly() throws java.sql.SQLException;
    method public abstract boolean supportsDifferentTableCorrelationNames() throws java.sql.SQLException;
    method public abstract boolean supportsExpressionsInOrderBy() throws java.sql.SQLException;
    method public abstract boolean supportsExtendedSQLGrammar() throws java.sql.SQLException;
    method public abstract boolean supportsFullOuterJoins() throws java.sql.SQLException;
    method public abstract boolean supportsGetGeneratedKeys() throws java.sql.SQLException;
    method public abstract boolean supportsGroupBy() throws java.sql.SQLException;
    method public abstract boolean supportsGroupByBeyondSelect() throws java.sql.SQLException;
    method public abstract boolean supportsGroupByUnrelated() throws java.sql.SQLException;
    method public abstract boolean supportsIntegrityEnhancementFacility() throws java.sql.SQLException;
    method public abstract boolean supportsLikeEscapeClause() throws java.sql.SQLException;
    method public abstract boolean supportsLimitedOuterJoins() throws java.sql.SQLException;
    method public abstract boolean supportsMinimumSQLGrammar() throws java.sql.SQLException;
    method public abstract boolean supportsMixedCaseIdentifiers() throws java.sql.SQLException;
    method public abstract boolean supportsMixedCaseQuotedIdentifiers() throws java.sql.SQLException;
    method public abstract boolean supportsMultipleOpenResults() throws java.sql.SQLException;
    method public abstract boolean supportsMultipleResultSets() throws java.sql.SQLException;
    method public abstract boolean supportsMultipleTransactions() throws java.sql.SQLException;
    method public abstract boolean supportsNamedParameters() throws java.sql.SQLException;
    method public abstract boolean supportsNonNullableColumns() throws java.sql.SQLException;
    method public abstract boolean supportsOpenCursorsAcrossCommit() throws java.sql.SQLException;
    method public abstract boolean supportsOpenCursorsAcrossRollback() throws java.sql.SQLException;
    method public abstract boolean supportsOpenStatementsAcrossCommit() throws java.sql.SQLException;
    method public abstract boolean supportsOpenStatementsAcrossRollback() throws java.sql.SQLException;
    method public abstract boolean supportsOrderByUnrelated() throws java.sql.SQLException;
    method public abstract boolean supportsOuterJoins() throws java.sql.SQLException;
    method public abstract boolean supportsPositionedDelete() throws java.sql.SQLException;
    method public abstract boolean supportsPositionedUpdate() throws java.sql.SQLException;
    method public abstract boolean supportsResultSetConcurrency(int, int) throws java.sql.SQLException;
    method public abstract boolean supportsResultSetHoldability(int) throws java.sql.SQLException;
    method public abstract boolean supportsResultSetType(int) throws java.sql.SQLException;
    method public abstract boolean supportsSavepoints() throws java.sql.SQLException;
    method public abstract boolean supportsSchemasInDataManipulation() throws java.sql.SQLException;
    method public abstract boolean supportsSchemasInIndexDefinitions() throws java.sql.SQLException;
    method public abstract boolean supportsSchemasInPrivilegeDefinitions() throws java.sql.SQLException;
    method public abstract boolean supportsSchemasInProcedureCalls() throws java.sql.SQLException;
    method public abstract boolean supportsSchemasInTableDefinitions() throws java.sql.SQLException;
    method public abstract boolean supportsSelectForUpdate() throws java.sql.SQLException;
    method public abstract boolean supportsStatementPooling() throws java.sql.SQLException;
    method public abstract boolean supportsStoredFunctionsUsingCallSyntax() throws java.sql.SQLException;
    method public abstract boolean supportsStoredProcedures() throws java.sql.SQLException;
    method public abstract boolean supportsSubqueriesInComparisons() throws java.sql.SQLException;
    method public abstract boolean supportsSubqueriesInExists() throws java.sql.SQLException;
    method public abstract boolean supportsSubqueriesInIns() throws java.sql.SQLException;
    method public abstract boolean supportsSubqueriesInQuantifieds() throws java.sql.SQLException;
    method public abstract boolean supportsTableCorrelationNames() throws java.sql.SQLException;
    method public abstract boolean supportsTransactionIsolationLevel(int) throws java.sql.SQLException;
    method public abstract boolean supportsTransactions() throws java.sql.SQLException;
    method public abstract boolean supportsUnion() throws java.sql.SQLException;
    method public abstract boolean supportsUnionAll() throws java.sql.SQLException;
    method public abstract boolean updatesAreDetected(int) throws java.sql.SQLException;
    method public abstract boolean usesLocalFilePerTable() throws java.sql.SQLException;
    method public abstract 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 public deprecated Date(int, int, int);
    ctor public Date(long);
    method public static java.sql.Date valueOf(java.lang.String);
  }

  public abstract interface Driver {
    method public abstract boolean acceptsURL(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Connection connect(java.lang.String, java.util.Properties) throws java.sql.SQLException;
    method public abstract int getMajorVersion();
    method public abstract int getMinorVersion();
    method public abstract java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String, java.util.Properties) throws java.sql.SQLException;
    method public abstract boolean jdbcCompliant();
  }

  public class DriverManager {
    method public static synchronized void deregisterDriver(java.sql.Driver) throws java.sql.SQLException;
    method public static java.sql.Connection getConnection(java.lang.String, java.util.Properties) throws java.sql.SQLException;
    method public static java.sql.Connection getConnection(java.lang.String, java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public static java.sql.Connection getConnection(java.lang.String) throws java.sql.SQLException;
    method public static java.sql.Driver getDriver(java.lang.String) throws java.sql.SQLException;
    method public static java.util.Enumeration<java.sql.Driver> getDrivers();
    method public static deprecated java.io.PrintStream getLogStream();
    method public static java.io.PrintWriter getLogWriter();
    method public static int getLoginTimeout();
    method public static void println(java.lang.String);
    method public static synchronized void registerDriver(java.sql.Driver) throws java.sql.SQLException;
    method public static deprecated 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(java.lang.String, java.lang.String);
    field public java.lang.String[] choices;
    field public java.lang.String description;
    field public java.lang.String name;
    field public boolean required;
    field public java.lang.String value;
  }

  public abstract interface NClob implements java.sql.Clob {
  }

  public abstract interface ParameterMetaData implements java.sql.Wrapper {
    method public abstract java.lang.String getParameterClassName(int) throws java.sql.SQLException;
    method public abstract int getParameterCount() throws java.sql.SQLException;
    method public abstract int getParameterMode(int) throws java.sql.SQLException;
    method public abstract int getParameterType(int) throws java.sql.SQLException;
    method public abstract java.lang.String getParameterTypeName(int) throws java.sql.SQLException;
    method public abstract int getPrecision(int) throws java.sql.SQLException;
    method public abstract int getScale(int) throws java.sql.SQLException;
    method public abstract int isNullable(int) throws java.sql.SQLException;
    method public abstract 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 abstract interface PreparedStatement implements java.sql.Statement {
    method public abstract void addBatch() throws java.sql.SQLException;
    method public abstract void clearParameters() throws java.sql.SQLException;
    method public abstract boolean execute() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet executeQuery() throws java.sql.SQLException;
    method public abstract int executeUpdate() throws java.sql.SQLException;
    method public abstract java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException;
    method public abstract java.sql.ParameterMetaData getParameterMetaData() throws java.sql.SQLException;
    method public abstract void setArray(int, java.sql.Array) throws java.sql.SQLException;
    method public abstract void setAsciiStream(int, java.io.InputStream, int) throws java.sql.SQLException;
    method public abstract void setAsciiStream(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void setAsciiStream(int, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void setBigDecimal(int, java.math.BigDecimal) throws java.sql.SQLException;
    method public abstract void setBinaryStream(int, java.io.InputStream, int) throws java.sql.SQLException;
    method public abstract void setBinaryStream(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void setBinaryStream(int, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void setBlob(int, java.sql.Blob) throws java.sql.SQLException;
    method public abstract void setBlob(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void setBlob(int, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void setBoolean(int, boolean) throws java.sql.SQLException;
    method public abstract void setByte(int, byte) throws java.sql.SQLException;
    method public abstract void setBytes(int, byte[]) throws java.sql.SQLException;
    method public abstract void setCharacterStream(int, java.io.Reader, int) throws java.sql.SQLException;
    method public abstract void setCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setClob(int, java.sql.Clob) throws java.sql.SQLException;
    method public abstract void setClob(int, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setClob(int, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setDate(int, java.sql.Date) throws java.sql.SQLException;
    method public abstract void setDate(int, java.sql.Date, java.util.Calendar) throws java.sql.SQLException;
    method public abstract void setDouble(int, double) throws java.sql.SQLException;
    method public abstract void setFloat(int, float) throws java.sql.SQLException;
    method public abstract void setInt(int, int) throws java.sql.SQLException;
    method public abstract void setLong(int, long) throws java.sql.SQLException;
    method public abstract void setNCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setNCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setNClob(int, java.sql.NClob) throws java.sql.SQLException;
    method public abstract void setNClob(int, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setNClob(int, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setNString(int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setNull(int, int) throws java.sql.SQLException;
    method public abstract void setNull(int, int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setObject(int, java.lang.Object, int) throws java.sql.SQLException;
    method public abstract void setObject(int, java.lang.Object) throws java.sql.SQLException;
    method public abstract void setObject(int, java.lang.Object, int, int) throws java.sql.SQLException;
    method public abstract void setRef(int, java.sql.Ref) throws java.sql.SQLException;
    method public abstract void setRowId(int, java.sql.RowId) throws java.sql.SQLException;
    method public abstract void setSQLXML(int, java.sql.SQLXML) throws java.sql.SQLException;
    method public abstract void setShort(int, short) throws java.sql.SQLException;
    method public abstract void setString(int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setTime(int, java.sql.Time) throws java.sql.SQLException;
    method public abstract void setTime(int, java.sql.Time, java.util.Calendar) throws java.sql.SQLException;
    method public abstract void setTimestamp(int, java.sql.Timestamp) throws java.sql.SQLException;
    method public abstract void setTimestamp(int, java.sql.Timestamp, java.util.Calendar) throws java.sql.SQLException;
    method public abstract void setURL(int, java.net.URL) throws java.sql.SQLException;
    method public abstract deprecated void setUnicodeStream(int, java.io.InputStream, int) throws java.sql.SQLException;
  }

  public abstract interface Ref {
    method public abstract java.lang.String getBaseTypeName() throws java.sql.SQLException;
    method public abstract java.lang.Object getObject(java.util.Map<java.lang.String, java.lang.Class<?>>) throws java.sql.SQLException;
    method public abstract java.lang.Object getObject() throws java.sql.SQLException;
    method public abstract void setObject(java.lang.Object) throws java.sql.SQLException;
  }

  public abstract interface ResultSet implements java.lang.AutoCloseable java.sql.Wrapper {
    method public abstract boolean absolute(int) throws java.sql.SQLException;
    method public abstract void afterLast() throws java.sql.SQLException;
    method public abstract void beforeFirst() throws java.sql.SQLException;
    method public abstract void cancelRowUpdates() throws java.sql.SQLException;
    method public abstract void clearWarnings() throws java.sql.SQLException;
    method public abstract void close() throws java.sql.SQLException;
    method public abstract void deleteRow() throws java.sql.SQLException;
    method public abstract int findColumn(java.lang.String) throws java.sql.SQLException;
    method public abstract boolean first() throws java.sql.SQLException;
    method public abstract java.sql.Array getArray(int) throws java.sql.SQLException;
    method public abstract java.sql.Array getArray(java.lang.String) throws java.sql.SQLException;
    method public abstract java.io.InputStream getAsciiStream(int) throws java.sql.SQLException;
    method public abstract java.io.InputStream getAsciiStream(java.lang.String) throws java.sql.SQLException;
    method public abstract deprecated java.math.BigDecimal getBigDecimal(int, int) throws java.sql.SQLException;
    method public abstract deprecated java.math.BigDecimal getBigDecimal(java.lang.String, int) throws java.sql.SQLException;
    method public abstract java.math.BigDecimal getBigDecimal(int) throws java.sql.SQLException;
    method public abstract java.math.BigDecimal getBigDecimal(java.lang.String) throws java.sql.SQLException;
    method public abstract java.io.InputStream getBinaryStream(int) throws java.sql.SQLException;
    method public abstract java.io.InputStream getBinaryStream(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Blob getBlob(int) throws java.sql.SQLException;
    method public abstract java.sql.Blob getBlob(java.lang.String) throws java.sql.SQLException;
    method public abstract boolean getBoolean(int) throws java.sql.SQLException;
    method public abstract boolean getBoolean(java.lang.String) throws java.sql.SQLException;
    method public abstract byte getByte(int) throws java.sql.SQLException;
    method public abstract byte getByte(java.lang.String) throws java.sql.SQLException;
    method public abstract byte[] getBytes(int) throws java.sql.SQLException;
    method public abstract byte[] getBytes(java.lang.String) throws java.sql.SQLException;
    method public abstract java.io.Reader getCharacterStream(int) throws java.sql.SQLException;
    method public abstract java.io.Reader getCharacterStream(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Clob getClob(int) throws java.sql.SQLException;
    method public abstract java.sql.Clob getClob(java.lang.String) throws java.sql.SQLException;
    method public abstract int getConcurrency() throws java.sql.SQLException;
    method public abstract java.lang.String getCursorName() throws java.sql.SQLException;
    method public abstract java.sql.Date getDate(int) throws java.sql.SQLException;
    method public abstract java.sql.Date getDate(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Date getDate(int, java.util.Calendar) throws java.sql.SQLException;
    method public abstract java.sql.Date getDate(java.lang.String, java.util.Calendar) throws java.sql.SQLException;
    method public abstract double getDouble(int) throws java.sql.SQLException;
    method public abstract double getDouble(java.lang.String) throws java.sql.SQLException;
    method public abstract int getFetchDirection() throws java.sql.SQLException;
    method public abstract int getFetchSize() throws java.sql.SQLException;
    method public abstract float getFloat(int) throws java.sql.SQLException;
    method public abstract float getFloat(java.lang.String) throws java.sql.SQLException;
    method public abstract int getHoldability() throws java.sql.SQLException;
    method public abstract int getInt(int) throws java.sql.SQLException;
    method public abstract int getInt(java.lang.String) throws java.sql.SQLException;
    method public abstract long getLong(int) throws java.sql.SQLException;
    method public abstract long getLong(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException;
    method public abstract java.io.Reader getNCharacterStream(int) throws java.sql.SQLException;
    method public abstract java.io.Reader getNCharacterStream(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.NClob getNClob(int) throws java.sql.SQLException;
    method public abstract java.sql.NClob getNClob(java.lang.String) throws java.sql.SQLException;
    method public abstract java.lang.String getNString(int) throws java.sql.SQLException;
    method public abstract java.lang.String getNString(java.lang.String) throws java.sql.SQLException;
    method public abstract java.lang.Object getObject(int) throws java.sql.SQLException;
    method public abstract java.lang.Object getObject(java.lang.String) throws java.sql.SQLException;
    method public abstract java.lang.Object getObject(int, java.util.Map<java.lang.String, java.lang.Class<?>>) throws java.sql.SQLException;
    method public abstract java.lang.Object getObject(java.lang.String, java.util.Map<java.lang.String, java.lang.Class<?>>) throws java.sql.SQLException;
    method public abstract java.sql.Ref getRef(int) throws java.sql.SQLException;
    method public abstract java.sql.Ref getRef(java.lang.String) throws java.sql.SQLException;
    method public abstract int getRow() throws java.sql.SQLException;
    method public abstract java.sql.RowId getRowId(int) throws java.sql.SQLException;
    method public abstract java.sql.RowId getRowId(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.SQLXML getSQLXML(int) throws java.sql.SQLException;
    method public abstract java.sql.SQLXML getSQLXML(java.lang.String) throws java.sql.SQLException;
    method public abstract short getShort(int) throws java.sql.SQLException;
    method public abstract short getShort(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Statement getStatement() throws java.sql.SQLException;
    method public abstract java.lang.String getString(int) throws java.sql.SQLException;
    method public abstract java.lang.String getString(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Time getTime(int) throws java.sql.SQLException;
    method public abstract java.sql.Time getTime(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Time getTime(int, java.util.Calendar) throws java.sql.SQLException;
    method public abstract java.sql.Time getTime(java.lang.String, java.util.Calendar) throws java.sql.SQLException;
    method public abstract java.sql.Timestamp getTimestamp(int) throws java.sql.SQLException;
    method public abstract java.sql.Timestamp getTimestamp(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.Timestamp getTimestamp(int, java.util.Calendar) throws java.sql.SQLException;
    method public abstract java.sql.Timestamp getTimestamp(java.lang.String, java.util.Calendar) throws java.sql.SQLException;
    method public abstract int getType() throws java.sql.SQLException;
    method public abstract java.net.URL getURL(int) throws java.sql.SQLException;
    method public abstract java.net.URL getURL(java.lang.String) throws java.sql.SQLException;
    method public abstract deprecated java.io.InputStream getUnicodeStream(int) throws java.sql.SQLException;
    method public abstract deprecated java.io.InputStream getUnicodeStream(java.lang.String) throws java.sql.SQLException;
    method public abstract java.sql.SQLWarning getWarnings() throws java.sql.SQLException;
    method public abstract void insertRow() throws java.sql.SQLException;
    method public abstract boolean isAfterLast() throws java.sql.SQLException;
    method public abstract boolean isBeforeFirst() throws java.sql.SQLException;
    method public abstract boolean isClosed() throws java.sql.SQLException;
    method public abstract boolean isFirst() throws java.sql.SQLException;
    method public abstract boolean isLast() throws java.sql.SQLException;
    method public abstract boolean last() throws java.sql.SQLException;
    method public abstract void moveToCurrentRow() throws java.sql.SQLException;
    method public abstract void moveToInsertRow() throws java.sql.SQLException;
    method public abstract boolean next() throws java.sql.SQLException;
    method public abstract boolean previous() throws java.sql.SQLException;
    method public abstract void refreshRow() throws java.sql.SQLException;
    method public abstract boolean relative(int) throws java.sql.SQLException;
    method public abstract boolean rowDeleted() throws java.sql.SQLException;
    method public abstract boolean rowInserted() throws java.sql.SQLException;
    method public abstract boolean rowUpdated() throws java.sql.SQLException;
    method public abstract void setFetchDirection(int) throws java.sql.SQLException;
    method public abstract void setFetchSize(int) throws java.sql.SQLException;
    method public abstract void updateArray(int, java.sql.Array) throws java.sql.SQLException;
    method public abstract void updateArray(java.lang.String, java.sql.Array) throws java.sql.SQLException;
    method public abstract void updateAsciiStream(int, java.io.InputStream, int) throws java.sql.SQLException;
    method public abstract void updateAsciiStream(java.lang.String, java.io.InputStream, int) throws java.sql.SQLException;
    method public abstract void updateAsciiStream(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void updateAsciiStream(java.lang.String, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void updateAsciiStream(int, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void updateAsciiStream(java.lang.String, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void updateBigDecimal(int, java.math.BigDecimal) throws java.sql.SQLException;
    method public abstract void updateBigDecimal(java.lang.String, java.math.BigDecimal) throws java.sql.SQLException;
    method public abstract void updateBinaryStream(int, java.io.InputStream, int) throws java.sql.SQLException;
    method public abstract void updateBinaryStream(java.lang.String, java.io.InputStream, int) throws java.sql.SQLException;
    method public abstract void updateBinaryStream(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void updateBinaryStream(java.lang.String, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void updateBinaryStream(int, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void updateBinaryStream(java.lang.String, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void updateBlob(int, java.sql.Blob) throws java.sql.SQLException;
    method public abstract void updateBlob(java.lang.String, java.sql.Blob) throws java.sql.SQLException;
    method public abstract void updateBlob(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void updateBlob(java.lang.String, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void updateBlob(int, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void updateBlob(java.lang.String, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void updateBoolean(int, boolean) throws java.sql.SQLException;
    method public abstract void updateBoolean(java.lang.String, boolean) throws java.sql.SQLException;
    method public abstract void updateByte(int, byte) throws java.sql.SQLException;
    method public abstract void updateByte(java.lang.String, byte) throws java.sql.SQLException;
    method public abstract void updateBytes(int, byte[]) throws java.sql.SQLException;
    method public abstract void updateBytes(java.lang.String, byte[]) throws java.sql.SQLException;
    method public abstract void updateCharacterStream(int, java.io.Reader, int) throws java.sql.SQLException;
    method public abstract void updateCharacterStream(java.lang.String, java.io.Reader, int) throws java.sql.SQLException;
    method public abstract void updateCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void updateCharacterStream(java.lang.String, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void updateCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
    method public abstract void updateCharacterStream(java.lang.String, java.io.Reader) throws java.sql.SQLException;
    method public abstract void updateClob(int, java.sql.Clob) throws java.sql.SQLException;
    method public abstract void updateClob(java.lang.String, java.sql.Clob) throws java.sql.SQLException;
    method public abstract void updateClob(int, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void updateClob(java.lang.String, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void updateClob(int, java.io.Reader) throws java.sql.SQLException;
    method public abstract void updateClob(java.lang.String, java.io.Reader) throws java.sql.SQLException;
    method public abstract void updateDate(int, java.sql.Date) throws java.sql.SQLException;
    method public abstract void updateDate(java.lang.String, java.sql.Date) throws java.sql.SQLException;
    method public abstract void updateDouble(int, double) throws java.sql.SQLException;
    method public abstract void updateDouble(java.lang.String, double) throws java.sql.SQLException;
    method public abstract void updateFloat(int, float) throws java.sql.SQLException;
    method public abstract void updateFloat(java.lang.String, float) throws java.sql.SQLException;
    method public abstract void updateInt(int, int) throws java.sql.SQLException;
    method public abstract void updateInt(java.lang.String, int) throws java.sql.SQLException;
    method public abstract void updateLong(int, long) throws java.sql.SQLException;
    method public abstract void updateLong(java.lang.String, long) throws java.sql.SQLException;
    method public abstract void updateNCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void updateNCharacterStream(java.lang.String, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void updateNCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
    method public abstract void updateNCharacterStream(java.lang.String, java.io.Reader) throws java.sql.SQLException;
    method public abstract void updateNClob(int, java.sql.NClob) throws java.sql.SQLException;
    method public abstract void updateNClob(java.lang.String, java.sql.NClob) throws java.sql.SQLException;
    method public abstract void updateNClob(int, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void updateNClob(java.lang.String, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void updateNClob(int, java.io.Reader) throws java.sql.SQLException;
    method public abstract void updateNClob(java.lang.String, java.io.Reader) throws java.sql.SQLException;
    method public abstract void updateNString(int, java.lang.String) throws java.sql.SQLException;
    method public abstract void updateNString(java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract void updateNull(int) throws java.sql.SQLException;
    method public abstract void updateNull(java.lang.String) throws java.sql.SQLException;
    method public abstract void updateObject(int, java.lang.Object, int) throws java.sql.SQLException;
    method public abstract void updateObject(int, java.lang.Object) throws java.sql.SQLException;
    method public abstract void updateObject(java.lang.String, java.lang.Object, int) throws java.sql.SQLException;
    method public abstract void updateObject(java.lang.String, java.lang.Object) throws java.sql.SQLException;
    method public abstract void updateRef(int, java.sql.Ref) throws java.sql.SQLException;
    method public abstract void updateRef(java.lang.String, java.sql.Ref) throws java.sql.SQLException;
    method public abstract void updateRow() throws java.sql.SQLException;
    method public abstract void updateRowId(int, java.sql.RowId) throws java.sql.SQLException;
    method public abstract void updateRowId(java.lang.String, java.sql.RowId) throws java.sql.SQLException;
    method public abstract void updateSQLXML(int, java.sql.SQLXML) throws java.sql.SQLException;
    method public abstract void updateSQLXML(java.lang.String, java.sql.SQLXML) throws java.sql.SQLException;
    method public abstract void updateShort(int, short) throws java.sql.SQLException;
    method public abstract void updateShort(java.lang.String, short) throws java.sql.SQLException;
    method public abstract void updateString(int, java.lang.String) throws java.sql.SQLException;
    method public abstract void updateString(java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract void updateTime(int, java.sql.Time) throws java.sql.SQLException;
    method public abstract void updateTime(java.lang.String, java.sql.Time) throws java.sql.SQLException;
    method public abstract void updateTimestamp(int, java.sql.Timestamp) throws java.sql.SQLException;
    method public abstract void updateTimestamp(java.lang.String, java.sql.Timestamp) throws java.sql.SQLException;
    method public abstract 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 abstract interface ResultSetMetaData implements java.sql.Wrapper {
    method public abstract java.lang.String getCatalogName(int) throws java.sql.SQLException;
    method public abstract java.lang.String getColumnClassName(int) throws java.sql.SQLException;
    method public abstract int getColumnCount() throws java.sql.SQLException;
    method public abstract int getColumnDisplaySize(int) throws java.sql.SQLException;
    method public abstract java.lang.String getColumnLabel(int) throws java.sql.SQLException;
    method public abstract java.lang.String getColumnName(int) throws java.sql.SQLException;
    method public abstract int getColumnType(int) throws java.sql.SQLException;
    method public abstract java.lang.String getColumnTypeName(int) throws java.sql.SQLException;
    method public abstract int getPrecision(int) throws java.sql.SQLException;
    method public abstract int getScale(int) throws java.sql.SQLException;
    method public abstract java.lang.String getSchemaName(int) throws java.sql.SQLException;
    method public abstract java.lang.String getTableName(int) throws java.sql.SQLException;
    method public abstract boolean isAutoIncrement(int) throws java.sql.SQLException;
    method public abstract boolean isCaseSensitive(int) throws java.sql.SQLException;
    method public abstract boolean isCurrency(int) throws java.sql.SQLException;
    method public abstract boolean isDefinitelyWritable(int) throws java.sql.SQLException;
    method public abstract int isNullable(int) throws java.sql.SQLException;
    method public abstract boolean isReadOnly(int) throws java.sql.SQLException;
    method public abstract boolean isSearchable(int) throws java.sql.SQLException;
    method public abstract boolean isSigned(int) throws java.sql.SQLException;
    method public abstract 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 abstract interface RowId {
    method public abstract boolean equals(java.lang.Object);
    method public abstract byte[] getBytes();
    method public abstract int hashCode();
    method public abstract java.lang.String toString();
  }

  public final class RowIdLifetime extends java.lang.Enum {
    method public static java.sql.RowIdLifetime valueOf(java.lang.String);
    method public static final java.sql.RowIdLifetime[] values();
    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>, java.lang.Throwable);
    ctor public SQLClientInfoException(java.lang.String, java.util.Map<java.lang.String, java.sql.ClientInfoStatus>);
    ctor public SQLClientInfoException(java.lang.String, java.util.Map<java.lang.String, java.sql.ClientInfoStatus>, java.lang.Throwable);
    ctor public SQLClientInfoException(java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.sql.ClientInfoStatus>);
    ctor public SQLClientInfoException(java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.sql.ClientInfoStatus>, java.lang.Throwable);
    ctor public SQLClientInfoException(java.lang.String, java.lang.String, int, java.util.Map<java.lang.String, java.sql.ClientInfoStatus>);
    ctor public SQLClientInfoException(java.lang.String, java.lang.String, int, java.util.Map<java.lang.String, java.sql.ClientInfoStatus>, java.lang.Throwable);
    method public java.util.Map<java.lang.String, java.sql.ClientInfoStatus> getFailedProperties();
  }

  public abstract interface SQLData {
    method public abstract java.lang.String getSQLTypeName() throws java.sql.SQLException;
    method public abstract void readSQL(java.sql.SQLInput, java.lang.String) throws java.sql.SQLException;
    method public abstract void writeSQL(java.sql.SQLOutput) throws java.sql.SQLException;
  }

  public class SQLDataException extends java.sql.SQLNonTransientException {
    ctor public SQLDataException();
    ctor public SQLDataException(java.lang.String);
    ctor public SQLDataException(java.lang.String, java.lang.String);
    ctor public SQLDataException(java.lang.String, java.lang.String, int);
    ctor public SQLDataException(java.lang.Throwable);
    ctor public SQLDataException(java.lang.String, java.lang.Throwable);
    ctor public SQLDataException(java.lang.String, java.lang.String, java.lang.Throwable);
    ctor public SQLDataException(java.lang.String, java.lang.String, int, java.lang.Throwable);
  }

  public class SQLException extends java.lang.Exception implements java.lang.Iterable {
    ctor public SQLException(java.lang.String, java.lang.String, int);
    ctor public SQLException(java.lang.String, java.lang.String);
    ctor public SQLException(java.lang.String);
    ctor public SQLException();
    ctor public SQLException(java.lang.Throwable);
    ctor public SQLException(java.lang.String, java.lang.Throwable);
    ctor public SQLException(java.lang.String, java.lang.String, java.lang.Throwable);
    ctor public SQLException(java.lang.String, java.lang.String, int, java.lang.Throwable);
    method public int getErrorCode();
    method public java.sql.SQLException getNextException();
    method public java.lang.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(java.lang.String);
    ctor public SQLFeatureNotSupportedException(java.lang.String, java.lang.String);
    ctor public SQLFeatureNotSupportedException(java.lang.String, java.lang.String, int);
    ctor public SQLFeatureNotSupportedException(java.lang.Throwable);
    ctor public SQLFeatureNotSupportedException(java.lang.String, java.lang.Throwable);
    ctor public SQLFeatureNotSupportedException(java.lang.String, java.lang.String, java.lang.Throwable);
    ctor public SQLFeatureNotSupportedException(java.lang.String, java.lang.String, int, java.lang.Throwable);
  }

  public abstract interface SQLInput {
    method public abstract java.sql.Array readArray() throws java.sql.SQLException;
    method public abstract java.io.InputStream readAsciiStream() throws java.sql.SQLException;
    method public abstract java.math.BigDecimal readBigDecimal() throws java.sql.SQLException;
    method public abstract java.io.InputStream readBinaryStream() throws java.sql.SQLException;
    method public abstract java.sql.Blob readBlob() throws java.sql.SQLException;
    method public abstract boolean readBoolean() throws java.sql.SQLException;
    method public abstract byte readByte() throws java.sql.SQLException;
    method public abstract byte[] readBytes() throws java.sql.SQLException;
    method public abstract java.io.Reader readCharacterStream() throws java.sql.SQLException;
    method public abstract java.sql.Clob readClob() throws java.sql.SQLException;
    method public abstract java.sql.Date readDate() throws java.sql.SQLException;
    method public abstract double readDouble() throws java.sql.SQLException;
    method public abstract float readFloat() throws java.sql.SQLException;
    method public abstract int readInt() throws java.sql.SQLException;
    method public abstract long readLong() throws java.sql.SQLException;
    method public abstract java.sql.NClob readNClob() throws java.sql.SQLException;
    method public abstract java.lang.String readNString() throws java.sql.SQLException;
    method public abstract java.lang.Object readObject() throws java.sql.SQLException;
    method public abstract java.sql.Ref readRef() throws java.sql.SQLException;
    method public abstract java.sql.RowId readRowId() throws java.sql.SQLException;
    method public abstract java.sql.SQLXML readSQLXML() throws java.sql.SQLException;
    method public abstract short readShort() throws java.sql.SQLException;
    method public abstract java.lang.String readString() throws java.sql.SQLException;
    method public abstract java.sql.Time readTime() throws java.sql.SQLException;
    method public abstract java.sql.Timestamp readTimestamp() throws java.sql.SQLException;
    method public abstract java.net.URL readURL() throws java.sql.SQLException;
    method public abstract boolean wasNull() throws java.sql.SQLException;
  }

  public class SQLIntegrityConstraintViolationException extends java.sql.SQLNonTransientException {
    ctor public SQLIntegrityConstraintViolationException();
    ctor public SQLIntegrityConstraintViolationException(java.lang.String);
    ctor public SQLIntegrityConstraintViolationException(java.lang.String, java.lang.String);
    ctor public SQLIntegrityConstraintViolationException(java.lang.String, java.lang.String, int);
    ctor public SQLIntegrityConstraintViolationException(java.lang.Throwable);
    ctor public SQLIntegrityConstraintViolationException(java.lang.String, java.lang.Throwable);
    ctor public SQLIntegrityConstraintViolationException(java.lang.String, java.lang.String, java.lang.Throwable);
    ctor public SQLIntegrityConstraintViolationException(java.lang.String, java.lang.String, int, java.lang.Throwable);
  }

  public class SQLInvalidAuthorizationSpecException extends java.sql.SQLNonTransientException {
    ctor public SQLInvalidAuthorizationSpecException();
    ctor public SQLInvalidAuthorizationSpecException(java.lang.String);
    ctor public SQLInvalidAuthorizationSpecException(java.lang.String, java.lang.String);
    ctor public SQLInvalidAuthorizationSpecException(java.lang.String, java.lang.String, int);
    ctor public SQLInvalidAuthorizationSpecException(java.lang.Throwable);
    ctor public SQLInvalidAuthorizationSpecException(java.lang.String, java.lang.Throwable);
    ctor public SQLInvalidAuthorizationSpecException(java.lang.String, java.lang.String, java.lang.Throwable);
    ctor public SQLInvalidAuthorizationSpecException(java.lang.String, java.lang.String, int, java.lang.Throwable);
  }

  public class SQLNonTransientConnectionException extends java.sql.SQLNonTransientException {
    ctor public SQLNonTransientConnectionException();
    ctor public SQLNonTransientConnectionException(java.lang.String);
    ctor public SQLNonTransientConnectionException(java.lang.String, java.lang.String);
    ctor public SQLNonTransientConnectionException(java.lang.String, java.lang.String, int);
    ctor public SQLNonTransientConnectionException(java.lang.Throwable);
    ctor public SQLNonTransientConnectionException(java.lang.String, java.lang.Throwable);
    ctor public SQLNonTransientConnectionException(java.lang.String, java.lang.String, java.lang.Throwable);
    ctor public SQLNonTransientConnectionException(java.lang.String, java.lang.String, int, java.lang.Throwable);
  }

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

  public abstract interface SQLOutput {
    method public abstract void writeArray(java.sql.Array) throws java.sql.SQLException;
    method public abstract void writeAsciiStream(java.io.InputStream) throws java.sql.SQLException;
    method public abstract void writeBigDecimal(java.math.BigDecimal) throws java.sql.SQLException;
    method public abstract void writeBinaryStream(java.io.InputStream) throws java.sql.SQLException;
    method public abstract void writeBlob(java.sql.Blob) throws java.sql.SQLException;
    method public abstract void writeBoolean(boolean) throws java.sql.SQLException;
    method public abstract void writeByte(byte) throws java.sql.SQLException;
    method public abstract void writeBytes(byte[]) throws java.sql.SQLException;
    method public abstract void writeCharacterStream(java.io.Reader) throws java.sql.SQLException;
    method public abstract void writeClob(java.sql.Clob) throws java.sql.SQLException;
    method public abstract void writeDate(java.sql.Date) throws java.sql.SQLException;
    method public abstract void writeDouble(double) throws java.sql.SQLException;
    method public abstract void writeFloat(float) throws java.sql.SQLException;
    method public abstract void writeInt(int) throws java.sql.SQLException;
    method public abstract void writeLong(long) throws java.sql.SQLException;
    method public abstract void writeNClob(java.sql.NClob) throws java.sql.SQLException;
    method public abstract void writeNString(java.lang.String) throws java.sql.SQLException;
    method public abstract void writeObject(java.sql.SQLData) throws java.sql.SQLException;
    method public abstract void writeRef(java.sql.Ref) throws java.sql.SQLException;
    method public abstract void writeRowId(java.sql.RowId) throws java.sql.SQLException;
    method public abstract void writeSQLXML(java.sql.SQLXML) throws java.sql.SQLException;
    method public abstract void writeShort(short) throws java.sql.SQLException;
    method public abstract void writeString(java.lang.String) throws java.sql.SQLException;
    method public abstract void writeStruct(java.sql.Struct) throws java.sql.SQLException;
    method public abstract void writeTime(java.sql.Time) throws java.sql.SQLException;
    method public abstract void writeTimestamp(java.sql.Timestamp) throws java.sql.SQLException;
    method public abstract void writeURL(java.net.URL) throws java.sql.SQLException;
  }

  public final class SQLPermission extends java.security.BasicPermission {
    ctor public SQLPermission(java.lang.String);
    ctor public SQLPermission(java.lang.String, java.lang.String);
  }

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

  public class SQLSyntaxErrorException extends java.sql.SQLNonTransientException {
    ctor public SQLSyntaxErrorException();
    ctor public SQLSyntaxErrorException(java.lang.String);
    ctor public SQLSyntaxErrorException(java.lang.String, java.lang.String);
    ctor public SQLSyntaxErrorException(java.lang.String, java.lang.String, int);
    ctor public SQLSyntaxErrorException(java.lang.Throwable);
    ctor public SQLSyntaxErrorException(java.lang.String, java.lang.Throwable);
    ctor public SQLSyntaxErrorException(java.lang.String, java.lang.String, java.lang.Throwable);
    ctor public SQLSyntaxErrorException(java.lang.String, java.lang.String, int, java.lang.Throwable);
  }

  public class SQLTimeoutException extends java.sql.SQLTransientException {
    ctor public SQLTimeoutException();
    ctor public SQLTimeoutException(java.lang.String);
    ctor public SQLTimeoutException(java.lang.String, java.lang.String);
    ctor public SQLTimeoutException(java.lang.String, java.lang.String, int);
    ctor public SQLTimeoutException(java.lang.Throwable);
    ctor public SQLTimeoutException(java.lang.String, java.lang.Throwable);
    ctor public SQLTimeoutException(java.lang.String, java.lang.String, java.lang.Throwable);
    ctor public SQLTimeoutException(java.lang.String, java.lang.String, int, java.lang.Throwable);
  }

  public class SQLTransactionRollbackException extends java.sql.SQLTransientException {
    ctor public SQLTransactionRollbackException();
    ctor public SQLTransactionRollbackException(java.lang.String);
    ctor public SQLTransactionRollbackException(java.lang.String, java.lang.String);
    ctor public SQLTransactionRollbackException(java.lang.String, java.lang.String, int);
    ctor public SQLTransactionRollbackException(java.lang.Throwable);
    ctor public SQLTransactionRollbackException(java.lang.String, java.lang.Throwable);
    ctor public SQLTransactionRollbackException(java.lang.String, java.lang.String, java.lang.Throwable);
    ctor public SQLTransactionRollbackException(java.lang.String, java.lang.String, int, java.lang.Throwable);
  }

  public class SQLTransientConnectionException extends java.sql.SQLTransientException {
    ctor public SQLTransientConnectionException();
    ctor public SQLTransientConnectionException(java.lang.String);
    ctor public SQLTransientConnectionException(java.lang.String, java.lang.String);
    ctor public SQLTransientConnectionException(java.lang.String, java.lang.String, int);
    ctor public SQLTransientConnectionException(java.lang.Throwable);
    ctor public SQLTransientConnectionException(java.lang.String, java.lang.Throwable);
    ctor public SQLTransientConnectionException(java.lang.String, java.lang.String, java.lang.Throwable);
    ctor public SQLTransientConnectionException(java.lang.String, java.lang.String, int, java.lang.Throwable);
  }

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

  public class SQLWarning extends java.sql.SQLException {
    ctor public SQLWarning(java.lang.String, java.lang.String, int);
    ctor public SQLWarning(java.lang.String, java.lang.String);
    ctor public SQLWarning(java.lang.String);
    ctor public SQLWarning();
    ctor public SQLWarning(java.lang.Throwable);
    ctor public SQLWarning(java.lang.String, java.lang.Throwable);
    ctor public SQLWarning(java.lang.String, java.lang.String, java.lang.Throwable);
    ctor public SQLWarning(java.lang.String, java.lang.String, int, java.lang.Throwable);
    method public java.sql.SQLWarning getNextWarning();
    method public void setNextWarning(java.sql.SQLWarning);
  }

  public abstract interface SQLXML {
    method public abstract void free() throws java.sql.SQLException;
    method public abstract java.io.InputStream getBinaryStream() throws java.sql.SQLException;
    method public abstract java.io.Reader getCharacterStream() throws java.sql.SQLException;
    method public abstract <T extends javax.xml.transform.Source> T getSource(java.lang.Class<T>) throws java.sql.SQLException;
    method public abstract java.lang.String getString() throws java.sql.SQLException;
    method public abstract java.io.OutputStream setBinaryStream() throws java.sql.SQLException;
    method public abstract java.io.Writer setCharacterStream() throws java.sql.SQLException;
    method public abstract <T extends javax.xml.transform.Result> T setResult(java.lang.Class<T>) throws java.sql.SQLException;
    method public abstract void setString(java.lang.String) throws java.sql.SQLException;
  }

  public abstract interface Savepoint {
    method public abstract int getSavepointId() throws java.sql.SQLException;
    method public abstract java.lang.String getSavepointName() throws java.sql.SQLException;
  }

  public abstract interface Statement implements java.lang.AutoCloseable java.sql.Wrapper {
    method public abstract void addBatch(java.lang.String) throws java.sql.SQLException;
    method public abstract void cancel() throws java.sql.SQLException;
    method public abstract void clearBatch() throws java.sql.SQLException;
    method public abstract void clearWarnings() throws java.sql.SQLException;
    method public abstract void close() throws java.sql.SQLException;
    method public abstract boolean execute(java.lang.String) throws java.sql.SQLException;
    method public abstract boolean execute(java.lang.String, int) throws java.sql.SQLException;
    method public abstract boolean execute(java.lang.String, int[]) throws java.sql.SQLException;
    method public abstract boolean execute(java.lang.String, java.lang.String[]) throws java.sql.SQLException;
    method public abstract int[] executeBatch() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet executeQuery(java.lang.String) throws java.sql.SQLException;
    method public abstract int executeUpdate(java.lang.String) throws java.sql.SQLException;
    method public abstract int executeUpdate(java.lang.String, int) throws java.sql.SQLException;
    method public abstract int executeUpdate(java.lang.String, int[]) throws java.sql.SQLException;
    method public abstract int executeUpdate(java.lang.String, java.lang.String[]) throws java.sql.SQLException;
    method public abstract java.sql.Connection getConnection() throws java.sql.SQLException;
    method public abstract int getFetchDirection() throws java.sql.SQLException;
    method public abstract int getFetchSize() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException;
    method public abstract int getMaxFieldSize() throws java.sql.SQLException;
    method public abstract int getMaxRows() throws java.sql.SQLException;
    method public abstract boolean getMoreResults() throws java.sql.SQLException;
    method public abstract boolean getMoreResults(int) throws java.sql.SQLException;
    method public abstract int getQueryTimeout() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getResultSet() throws java.sql.SQLException;
    method public abstract int getResultSetConcurrency() throws java.sql.SQLException;
    method public abstract int getResultSetHoldability() throws java.sql.SQLException;
    method public abstract int getResultSetType() throws java.sql.SQLException;
    method public abstract int getUpdateCount() throws java.sql.SQLException;
    method public abstract java.sql.SQLWarning getWarnings() throws java.sql.SQLException;
    method public abstract boolean isClosed() throws java.sql.SQLException;
    method public abstract boolean isPoolable() throws java.sql.SQLException;
    method public abstract void setCursorName(java.lang.String) throws java.sql.SQLException;
    method public abstract void setEscapeProcessing(boolean) throws java.sql.SQLException;
    method public abstract void setFetchDirection(int) throws java.sql.SQLException;
    method public abstract void setFetchSize(int) throws java.sql.SQLException;
    method public abstract void setMaxFieldSize(int) throws java.sql.SQLException;
    method public abstract void setMaxRows(int) throws java.sql.SQLException;
    method public abstract void setPoolable(boolean) throws java.sql.SQLException;
    method public abstract 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 abstract interface Struct {
    method public abstract java.lang.Object[] getAttributes() throws java.sql.SQLException;
    method public abstract java.lang.Object[] getAttributes(java.util.Map<java.lang.String, java.lang.Class<?>>) throws java.sql.SQLException;
    method public abstract java.lang.String getSQLTypeName() throws java.sql.SQLException;
  }

  public class Time extends java.util.Date {
    ctor public deprecated Time(int, int, int);
    ctor public Time(long);
    method public static java.sql.Time valueOf(java.lang.String);
  }

  public class Timestamp extends java.util.Date {
    ctor public deprecated 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(java.lang.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 abstract interface Wrapper {
    method public abstract boolean isWrapperFor(java.lang.Class<?>) throws java.sql.SQLException;
    method public abstract <T> T unwrap(java.lang.Class<T>) throws java.sql.SQLException;
  }

}

package java.text {

  public class Annotation {
    ctor public Annotation(java.lang.Object);
    method public java.lang.Object getValue();
  }

  public abstract interface AttributedCharacterIterator implements java.text.CharacterIterator {
    method public abstract java.util.Set<java.text.AttributedCharacterIterator.Attribute> getAllAttributeKeys();
    method public abstract java.lang.Object getAttribute(java.text.AttributedCharacterIterator.Attribute);
    method public abstract java.util.Map<java.text.AttributedCharacterIterator.Attribute, java.lang.Object> getAttributes();
    method public abstract int getRunLimit();
    method public abstract int getRunLimit(java.text.AttributedCharacterIterator.Attribute);
    method public abstract int getRunLimit(java.util.Set<? extends java.text.AttributedCharacterIterator.Attribute>);
    method public abstract int getRunStart();
    method public abstract int getRunStart(java.text.AttributedCharacterIterator.Attribute);
    method public abstract int getRunStart(java.util.Set<? extends java.text.AttributedCharacterIterator.Attribute>);
  }

  public static class AttributedCharacterIterator.Attribute implements java.io.Serializable {
    ctor protected AttributedCharacterIterator.Attribute(java.lang.String);
    method public final boolean equals(java.lang.Object);
    method protected java.lang.String getName();
    method public final int hashCode();
    method protected java.lang.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(java.lang.String);
    ctor public AttributedString(java.lang.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, java.lang.Object);
    method public void addAttribute(java.text.AttributedCharacterIterator.Attribute, java.lang.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(java.lang.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, java.lang.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 java.lang.Object clone();
    method public abstract int current();
    method public abstract int first();
    method public abstract int following(int);
    method public static synchronized 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(java.lang.String);
    method public abstract void setText(java.text.CharacterIterator);
    field public static final int DONE = -1; // 0xffffffff
  }

  public abstract interface CharacterIterator implements java.lang.Cloneable {
    method public abstract java.lang.Object clone();
    method public abstract char current();
    method public abstract char first();
    method public abstract int getBeginIndex();
    method public abstract int getEndIndex();
    method public abstract int getIndex();
    method public abstract char last();
    method public abstract char next();
    method public abstract char previous();
    method public abstract char setIndex(int);
    field public static final char DONE = 65535; // 0xffff '\uffff'
  }

  public class ChoiceFormat extends java.text.NumberFormat {
    ctor public ChoiceFormat(java.lang.String);
    ctor public ChoiceFormat(double[], java.lang.String[]);
    method public void applyPattern(java.lang.String);
    method public java.lang.StringBuffer format(long, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.StringBuffer format(double, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.Object[] getFormats();
    method public double[] getLimits();
    method public static final double nextDouble(double);
    method public static double nextDouble(double, boolean);
    method public java.lang.Number parse(java.lang.String, java.text.ParsePosition);
    method public static final double previousDouble(double);
    method public void setChoices(double[], java.lang.String[]);
    method public java.lang.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(java.lang.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 {
    ctor protected CollationKey(java.lang.String);
    method public abstract int compareTo(java.text.CollationKey);
    method public java.lang.String getSourceString();
    method public abstract byte[] toByteArray();
  }

  public abstract class Collator implements java.lang.Cloneable java.util.Comparator {
    ctor protected Collator();
    method public java.lang.Object clone();
    method public abstract int compare(java.lang.String, java.lang.String);
    method public int compare(java.lang.Object, java.lang.Object);
    method public boolean equals(java.lang.String, java.lang.String);
    method public static synchronized java.util.Locale[] getAvailableLocales();
    method public abstract java.text.CollationKey getCollationKey(java.lang.String);
    method public synchronized int getDecomposition();
    method public static synchronized java.text.Collator getInstance();
    method public static synchronized java.text.Collator getInstance(java.util.Locale);
    method public synchronized int getStrength();
    method public abstract int hashCode();
    method public synchronized void setDecomposition(int);
    method public synchronized 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 public final java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition);
    method public abstract java.lang.StringBuffer format(java.util.Date, java.lang.StringBuffer, java.text.FieldPosition);
    method public final java.lang.String format(java.util.Date);
    method public static java.util.Locale[] getAvailableLocales();
    method public java.util.Calendar getCalendar();
    method public static final java.text.DateFormat getDateInstance();
    method public static final java.text.DateFormat getDateInstance(int);
    method public static final java.text.DateFormat getDateInstance(int, java.util.Locale);
    method public static final java.text.DateFormat getDateTimeInstance();
    method public static final java.text.DateFormat getDateTimeInstance(int, int);
    method public static final java.text.DateFormat getDateTimeInstance(int, int, java.util.Locale);
    method public static final java.text.DateFormat getInstance();
    method public java.text.NumberFormat getNumberFormat();
    method public static final java.text.DateFormat getTimeInstance();
    method public static final java.text.DateFormat getTimeInstance(int);
    method public static final java.text.DateFormat getTimeInstance(int, java.util.Locale);
    method public java.util.TimeZone getTimeZone();
    method public boolean isLenient();
    method public java.util.Date parse(java.lang.String) throws java.text.ParseException;
    method public abstract java.util.Date parse(java.lang.String, java.text.ParsePosition);
    method public java.lang.Object parseObject(java.lang.String, java.text.ParsePosition);
    method public void setCalendar(java.util.Calendar);
    method public void setLenient(boolean);
    method public void setNumberFormat(java.text.NumberFormat);
    method public void setTimeZone(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 protected java.util.Calendar calendar;
    field protected java.text.NumberFormat numberFormat;
  }

  public static class DateFormat.Field extends java.text.Format.Field {
    ctor protected DateFormat.Field(java.lang.String, int);
    method public int getCalendarField();
    method public static java.text.DateFormat.Field ofCalendarField(int);
    field public static final java.text.DateFormat.Field AM_PM;
    field public static final java.text.DateFormat.Field DAY_OF_MONTH;
    field public static final java.text.DateFormat.Field DAY_OF_WEEK;
    field public static final java.text.DateFormat.Field DAY_OF_WEEK_IN_MONTH;
    field public static final java.text.DateFormat.Field DAY_OF_YEAR;
    field public static final java.text.DateFormat.Field ERA;
    field public static final java.text.DateFormat.Field HOUR0;
    field public static final java.text.DateFormat.Field HOUR1;
    field public static final java.text.DateFormat.Field HOUR_OF_DAY0;
    field public static final java.text.DateFormat.Field HOUR_OF_DAY1;
    field public static final java.text.DateFormat.Field MILLISECOND;
    field public static final java.text.DateFormat.Field MINUTE;
    field public static final java.text.DateFormat.Field MONTH;
    field public static final java.text.DateFormat.Field SECOND;
    field public static final java.text.DateFormat.Field TIME_ZONE;
    field public static final java.text.DateFormat.Field WEEK_OF_MONTH;
    field public static final java.text.DateFormat.Field WEEK_OF_YEAR;
    field 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 java.lang.Object clone();
    method public java.lang.String[] getAmPmStrings();
    method public static java.util.Locale[] getAvailableLocales();
    method public java.lang.String[] getEras();
    method public static final java.text.DateFormatSymbols getInstance();
    method public static final java.text.DateFormatSymbols getInstance(java.util.Locale);
    method public java.lang.String getLocalPatternChars();
    method public java.lang.String[] getMonths();
    method public java.lang.String[] getShortMonths();
    method public java.lang.String[] getShortWeekdays();
    method public java.lang.String[] getWeekdays();
    method public java.lang.String[][] getZoneStrings();
    method public void setAmPmStrings(java.lang.String[]);
    method public void setEras(java.lang.String[]);
    method public void setLocalPatternChars(java.lang.String);
    method public void setMonths(java.lang.String[]);
    method public void setShortMonths(java.lang.String[]);
    method public void setShortWeekdays(java.lang.String[]);
    method public void setWeekdays(java.lang.String[]);
    method public void setZoneStrings(java.lang.String[][]);
  }

  public class DecimalFormat extends java.text.NumberFormat {
    ctor public DecimalFormat();
    ctor public DecimalFormat(java.lang.String);
    ctor public DecimalFormat(java.lang.String, java.text.DecimalFormatSymbols);
    method public void applyLocalizedPattern(java.lang.String);
    method public void applyPattern(java.lang.String);
    method public final java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.StringBuffer format(double, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.lang.StringBuffer format(long, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.text.DecimalFormatSymbols getDecimalFormatSymbols();
    method public int getGroupingSize();
    method public int getMultiplier();
    method public java.lang.String getNegativePrefix();
    method public java.lang.String getNegativeSuffix();
    method public java.lang.String getPositivePrefix();
    method public java.lang.String getPositiveSuffix();
    method public boolean isDecimalSeparatorAlwaysShown();
    method public boolean isParseBigDecimal();
    method public java.lang.Number parse(java.lang.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(java.lang.String);
    method public void setNegativeSuffix(java.lang.String);
    method public void setParseBigDecimal(boolean);
    method public void setPositivePrefix(java.lang.String);
    method public void setPositiveSuffix(java.lang.String);
    method public java.lang.String toLocalizedPattern();
    method public java.lang.String toPattern();
  }

  public class DecimalFormatSymbols implements java.lang.Cloneable java.io.Serializable {
    ctor public DecimalFormatSymbols();
    ctor public DecimalFormatSymbols(java.util.Locale);
    method public java.lang.Object clone();
    method public static java.util.Locale[] getAvailableLocales();
    method public java.util.Currency getCurrency();
    method public java.lang.String getCurrencySymbol();
    method public char getDecimalSeparator();
    method public char getDigit();
    method public java.lang.String getExponentSeparator();
    method public char getGroupingSeparator();
    method public java.lang.String getInfinity();
    method public static final java.text.DecimalFormatSymbols getInstance();
    method public static final java.text.DecimalFormatSymbols getInstance(java.util.Locale);
    method public java.lang.String getInternationalCurrencySymbol();
    method public char getMinusSign();
    method public char getMonetaryDecimalSeparator();
    method public java.lang.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(java.lang.String);
    method public void setDecimalSeparator(char);
    method public void setDigit(char);
    method public void setExponentSeparator(java.lang.String);
    method public void setGroupingSeparator(char);
    method public void setInfinity(java.lang.String);
    method public void setInternationalCurrencySymbol(java.lang.String);
    method public void setMinusSign(char);
    method public void setMonetaryDecimalSeparator(char);
    method public void setNaN(java.lang.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 java.lang.Object clone();
    method public final java.lang.String format(java.lang.Object);
    method public abstract java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.text.AttributedCharacterIterator formatToCharacterIterator(java.lang.Object);
    method public abstract java.lang.Object parseObject(java.lang.String, java.text.ParsePosition);
    method public java.lang.Object parseObject(java.lang.String) throws java.text.ParseException;
  }

  public static class Format.Field extends java.text.AttributedCharacterIterator.Attribute {
    ctor protected Format.Field(java.lang.String);
  }

  public class MessageFormat extends java.text.Format {
    ctor public MessageFormat(java.lang.String);
    ctor public MessageFormat(java.lang.String, java.util.Locale);
    method public void applyPattern(java.lang.String);
    method public final java.lang.StringBuffer format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition);
    method public static java.lang.String format(java.lang.String, java.lang.Object...);
    method public final java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.text.Format[] getFormats();
    method public java.text.Format[] getFormatsByArgumentIndex();
    method public java.util.Locale getLocale();
    method public java.lang.Object[] parse(java.lang.String, java.text.ParsePosition);
    method public java.lang.Object[] parse(java.lang.String) throws java.text.ParseException;
    method public java.lang.Object parseObject(java.lang.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 java.lang.String toPattern();
  }

  public static class MessageFormat.Field extends java.text.Format.Field {
    ctor protected MessageFormat.Field(java.lang.String);
    field public static final java.text.MessageFormat.Field ARGUMENT;
  }

  public final class Normalizer {
    method public static boolean isNormalized(java.lang.CharSequence, java.text.Normalizer.Form);
    method public static java.lang.String normalize(java.lang.CharSequence, java.text.Normalizer.Form);
  }

  public static final class Normalizer.Form extends java.lang.Enum {
    method public static java.text.Normalizer.Form valueOf(java.lang.String);
    method public static final java.text.Normalizer.Form[] values();
    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 public java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition);
    method public final java.lang.String format(double);
    method public final java.lang.String format(long);
    method public abstract java.lang.StringBuffer format(double, java.lang.StringBuffer, java.text.FieldPosition);
    method public abstract java.lang.StringBuffer format(long, java.lang.StringBuffer, java.text.FieldPosition);
    method public static java.util.Locale[] getAvailableLocales();
    method public java.util.Currency getCurrency();
    method public static final java.text.NumberFormat getCurrencyInstance();
    method public static java.text.NumberFormat getCurrencyInstance(java.util.Locale);
    method public static final java.text.NumberFormat getInstance();
    method public static java.text.NumberFormat getInstance(java.util.Locale);
    method public static final java.text.NumberFormat getIntegerInstance();
    method public static java.text.NumberFormat getIntegerInstance(java.util.Locale);
    method public int getMaximumFractionDigits();
    method public int getMaximumIntegerDigits();
    method public int getMinimumFractionDigits();
    method public int getMinimumIntegerDigits();
    method public static final java.text.NumberFormat getNumberInstance();
    method public static java.text.NumberFormat getNumberInstance(java.util.Locale);
    method public static final java.text.NumberFormat getPercentInstance();
    method public static java.text.NumberFormat getPercentInstance(java.util.Locale);
    method public java.math.RoundingMode getRoundingMode();
    method public boolean isGroupingUsed();
    method public boolean isParseIntegerOnly();
    method public abstract java.lang.Number parse(java.lang.String, java.text.ParsePosition);
    method public java.lang.Number parse(java.lang.String) throws java.text.ParseException;
    method public final java.lang.Object parseObject(java.lang.String, java.text.ParsePosition);
    method public void setCurrency(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(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(java.lang.String);
    field public static final java.text.NumberFormat.Field CURRENCY;
    field public static final java.text.NumberFormat.Field DECIMAL_SEPARATOR;
    field public static final java.text.NumberFormat.Field EXPONENT;
    field public static final java.text.NumberFormat.Field EXPONENT_SIGN;
    field public static final java.text.NumberFormat.Field EXPONENT_SYMBOL;
    field public static final java.text.NumberFormat.Field FRACTION;
    field public static final java.text.NumberFormat.Field GROUPING_SEPARATOR;
    field public static final java.text.NumberFormat.Field INTEGER;
    field public static final java.text.NumberFormat.Field PERCENT;
    field public static final java.text.NumberFormat.Field PERMILLE;
    field public static final java.text.NumberFormat.Field SIGN;
  }

  public class ParseException extends java.lang.Exception {
    ctor public ParseException(java.lang.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(java.lang.String) throws java.text.ParseException;
    method public synchronized int compare(java.lang.String, java.lang.String);
    method public java.text.CollationElementIterator getCollationElementIterator(java.lang.String);
    method public java.text.CollationElementIterator getCollationElementIterator(java.text.CharacterIterator);
    method public synchronized java.text.CollationKey getCollationKey(java.lang.String);
    method public java.lang.String getRules();
  }

  public class SimpleDateFormat extends java.text.DateFormat {
    ctor public SimpleDateFormat();
    ctor public SimpleDateFormat(java.lang.String);
    ctor public SimpleDateFormat(java.lang.String, java.util.Locale);
    ctor public SimpleDateFormat(java.lang.String, java.text.DateFormatSymbols);
    method public void applyLocalizedPattern(java.lang.String);
    method public void applyPattern(java.lang.String);
    method public java.lang.StringBuffer format(java.util.Date, java.lang.StringBuffer, java.text.FieldPosition);
    method public java.util.Date get2DigitYearStart();
    method public java.text.DateFormatSymbols getDateFormatSymbols();
    method public java.util.Date parse(java.lang.String, java.text.ParsePosition);
    method public void set2DigitYearStart(java.util.Date);
    method public void setDateFormatSymbols(java.text.DateFormatSymbols);
    method public java.lang.String toLocalizedPattern();
    method public java.lang.String toPattern();
  }

  public final class StringCharacterIterator implements java.text.CharacterIterator {
    ctor public StringCharacterIterator(java.lang.String);
    ctor public StringCharacterIterator(java.lang.String, int);
    ctor public StringCharacterIterator(java.lang.String, int, int, int);
    method public java.lang.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(java.lang.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(java.lang.String);
    ctor public DateTimeException(java.lang.String, java.lang.Throwable);
  }

  public final class DayOfWeek extends java.lang.Enum 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 java.lang.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);
    method public static java.time.DayOfWeek valueOf(java.lang.String);
    method public static final java.time.DayOfWeek[] values();
    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.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(java.lang.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.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(java.lang.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(java.lang.CharSequence);
    method public static java.time.LocalDate parse(java.lang.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.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(java.lang.CharSequence);
    method public static java.time.LocalDateTime parse(java.lang.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.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 java.lang.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(java.lang.CharSequence);
    method public static java.time.LocalTime parse(java.lang.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 final class Month extends java.lang.Enum 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 java.lang.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);
    method public static java.time.Month valueOf(java.lang.String);
    method public static final java.time.Month[] values();
    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.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 java.lang.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(java.lang.CharSequence);
    method public static java.time.MonthDay parse(java.lang.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.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 java.lang.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(java.lang.CharSequence);
    method public static java.time.OffsetDateTime parse(java.lang.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.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 java.lang.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(java.lang.CharSequence);
    method public static java.time.OffsetTime parse(java.lang.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(java.lang.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.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 java.lang.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(java.lang.CharSequence);
    method public static java.time.Year parse(java.lang.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.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 java.lang.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(java.lang.CharSequence);
    method public static java.time.YearMonth parse(java.lang.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 java.lang.String getDisplayName(java.time.format.TextStyle, java.util.Locale);
    method public abstract java.lang.String getId();
    method public abstract java.time.zone.ZoneRules getRules();
    method public java.time.ZoneId normalized();
    method public static java.time.ZoneId of(java.lang.String, java.util.Map<java.lang.String, java.lang.String>);
    method public static java.time.ZoneId of(java.lang.String);
    method public static java.time.ZoneId ofOffset(java.lang.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.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 java.lang.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(java.lang.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.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(java.lang.CharSequence);
    method public static java.time.ZonedDateTime parse(java.lang.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 abstract interface ChronoLocalDate implements java.lang.Comparable java.time.temporal.Temporal 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 abstract boolean equals(java.lang.Object);
    method public default java.lang.String format(java.time.format.DateTimeFormatter);
    method public static java.time.chrono.ChronoLocalDate from(java.time.temporal.TemporalAccessor);
    method public abstract java.time.chrono.Chronology getChronology();
    method public default java.time.chrono.Era getEra();
    method public abstract 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 abstract 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 abstract java.lang.String toString();
    method public abstract 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 abstract interface ChronoLocalDateTime<D extends java.time.chrono.ChronoLocalDate> implements java.lang.Comparable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
    method public default java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public abstract java.time.chrono.ChronoZonedDateTime<D> atZone(java.time.ZoneId);
    method public default int compareTo(java.time.chrono.ChronoLocalDateTime<?>);
    method public abstract boolean equals(java.lang.Object);
    method public default java.lang.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 abstract 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 abstract 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 abstract D toLocalDate();
    method public abstract java.time.LocalTime toLocalTime();
    method public abstract java.lang.String toString();
    method public default java.time.chrono.ChronoLocalDateTime<D> with(java.time.temporal.TemporalAdjuster);
    method public abstract java.time.chrono.ChronoLocalDateTime<D> with(java.time.temporal.TemporalField, long);
  }

  public abstract interface ChronoPeriod implements java.time.temporal.TemporalAmount {
    method public static java.time.chrono.ChronoPeriod between(java.time.chrono.ChronoLocalDate, java.time.chrono.ChronoLocalDate);
    method public abstract boolean equals(java.lang.Object);
    method public abstract java.time.chrono.Chronology getChronology();
    method public abstract int hashCode();
    method public default boolean isNegative();
    method public default boolean isZero();
    method public abstract java.time.chrono.ChronoPeriod minus(java.time.temporal.TemporalAmount);
    method public abstract java.time.chrono.ChronoPeriod multipliedBy(int);
    method public default java.time.chrono.ChronoPeriod negated();
    method public abstract java.time.chrono.ChronoPeriod normalized();
    method public abstract java.time.chrono.ChronoPeriod plus(java.time.temporal.TemporalAmount);
    method public abstract java.lang.String toString();
  }

  public abstract interface ChronoZonedDateTime<D extends java.time.chrono.ChronoLocalDate> implements java.lang.Comparable java.time.temporal.Temporal {
    method public default int compareTo(java.time.chrono.ChronoZonedDateTime<?>);
    method public abstract boolean equals(java.lang.Object);
    method public default java.lang.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 abstract java.time.ZoneOffset getOffset();
    method public abstract java.time.ZoneId getZone();
    method public abstract 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 abstract 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 abstract java.time.chrono.ChronoLocalDateTime<D> toLocalDateTime();
    method public default java.time.LocalTime toLocalTime();
    method public abstract java.lang.String toString();
    method public default java.time.chrono.ChronoZonedDateTime<D> with(java.time.temporal.TemporalAdjuster);
    method public abstract java.time.chrono.ChronoZonedDateTime<D> with(java.time.temporal.TemporalField, long);
    method public abstract java.time.chrono.ChronoZonedDateTime<D> withEarlierOffsetAtOverlap();
    method public abstract java.time.chrono.ChronoZonedDateTime<D> withLaterOffsetAtOverlap();
    method public abstract java.time.chrono.ChronoZonedDateTime<D> withZoneSameInstant(java.time.ZoneId);
    method public abstract java.time.chrono.ChronoZonedDateTime<D> withZoneSameLocal(java.time.ZoneId);
  }

  public abstract interface Chronology implements java.lang.Comparable {
    method public abstract int compareTo(java.time.chrono.Chronology);
    method public default java.time.chrono.ChronoLocalDate date(java.time.chrono.Era, int, int, int);
    method public abstract java.time.chrono.ChronoLocalDate date(int, int, int);
    method public abstract java.time.chrono.ChronoLocalDate date(java.time.temporal.TemporalAccessor);
    method public abstract 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 abstract java.time.chrono.ChronoLocalDate dateYearDay(int, int);
    method public abstract boolean equals(java.lang.Object);
    method public abstract java.time.chrono.Era eraOf(int);
    method public abstract 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 abstract java.lang.String getCalendarType();
    method public default java.lang.String getDisplayName(java.time.format.TextStyle, java.util.Locale);
    method public abstract java.lang.String getId();
    method public abstract int hashCode();
    method public abstract 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(java.lang.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 abstract int prolepticYear(java.time.chrono.Era, int);
    method public abstract java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
    method public abstract java.time.chrono.ChronoLocalDate resolveDate(java.util.Map<java.time.temporal.TemporalField, java.lang.Long>, java.time.format.ResolverStyle);
    method public abstract java.lang.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 abstract interface Era implements java.time.temporal.TemporalAccessor java.time.temporal.TemporalAdjuster {
    method public default java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
    method public default java.lang.String getDisplayName(java.time.format.TextStyle, java.util.Locale);
    method public default long getLong(java.time.temporal.TemporalField);
    method public abstract 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 java.lang.String getCalendarType();
    method public java.lang.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 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 final class HijrahEra extends java.lang.Enum implements java.time.chrono.Era {
    method public int getValue();
    method public static java.time.chrono.HijrahEra of(int);
    method public static java.time.chrono.HijrahEra valueOf(java.lang.String);
    method public static final java.time.chrono.HijrahEra[] values();
    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 java.lang.String getCalendarType();
    method public java.lang.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 final class IsoEra extends java.lang.Enum implements java.time.chrono.Era {
    method public int getValue();
    method public static java.time.chrono.IsoEra of(int);
    method public static java.time.chrono.IsoEra valueOf(java.lang.String);
    method public static final java.time.chrono.IsoEra[] values();
    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 java.lang.String getCalendarType();
    method public java.lang.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 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(java.lang.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 java.lang.String getCalendarType();
    method public java.lang.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 java.time.chrono.MinguoDate with(java.time.temporal.TemporalField, long);
    method public java.time.chrono.MinguoDate with(java.time.temporal.TemporalAdjuster);
  }

  public final class MinguoEra extends java.lang.Enum implements java.time.chrono.Era {
    method public int getValue();
    method public static java.time.chrono.MinguoEra of(int);
    method public static java.time.chrono.MinguoEra valueOf(java.lang.String);
    method public static final java.time.chrono.MinguoEra[] values();
    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 java.lang.String getCalendarType();
    method public java.lang.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 java.time.chrono.ThaiBuddhistDate with(java.time.temporal.TemporalField, long);
    method public java.time.chrono.ThaiBuddhistDate with(java.time.temporal.TemporalAdjuster);
  }

  public final class ThaiBuddhistEra extends java.lang.Enum implements java.time.chrono.Era {
    method public int getValue();
    method public static java.time.chrono.ThaiBuddhistEra of(int);
    method public static java.time.chrono.ThaiBuddhistEra valueOf(java.lang.String);
    method public static final java.time.chrono.ThaiBuddhistEra[] values();
    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 java.lang.String format(java.time.temporal.TemporalAccessor);
    method public void formatTo(java.time.temporal.TemporalAccessor, java.lang.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(java.lang.String);
    method public static java.time.format.DateTimeFormatter ofPattern(java.lang.String, java.util.Locale);
    method public java.time.temporal.TemporalAccessor parse(java.lang.CharSequence);
    method public java.time.temporal.TemporalAccessor parse(java.lang.CharSequence, java.text.ParsePosition);
    method public <T> T parse(java.lang.CharSequence, java.time.temporal.TemporalQuery<T>);
    method public java.time.temporal.TemporalAccessor parseBest(java.lang.CharSequence, java.time.temporal.TemporalQuery<?>...);
    method public java.time.temporal.TemporalAccessor parseUnresolved(java.lang.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(java.lang.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(java.lang.String, java.lang.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(java.lang.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 java.lang.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(java.lang.String, java.lang.CharSequence, int);
    ctor public DateTimeParseException(java.lang.String, java.lang.CharSequence, int, java.lang.Throwable);
    method public int getErrorIndex();
    method public java.lang.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 final class FormatStyle extends java.lang.Enum {
    method public static java.time.format.FormatStyle valueOf(java.lang.String);
    method public static final java.time.format.FormatStyle[] values();
    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 final class ResolverStyle extends java.lang.Enum {
    method public static java.time.format.ResolverStyle valueOf(java.lang.String);
    method public static final java.time.format.ResolverStyle[] values();
    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 final class SignStyle extends java.lang.Enum {
    method public static java.time.format.SignStyle valueOf(java.lang.String);
    method public static final java.time.format.SignStyle[] values();
    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 final class TextStyle extends java.lang.Enum {
    method public java.time.format.TextStyle asNormal();
    method public java.time.format.TextStyle asStandalone();
    method public boolean isStandalone();
    method public static java.time.format.TextStyle valueOf(java.lang.String);
    method public static final java.time.format.TextStyle[] values();
    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 final class ChronoField extends java.lang.Enum 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);
    method public static java.time.temporal.ChronoField valueOf(java.lang.String);
    method public static final java.time.temporal.ChronoField[] values();
    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 final class ChronoUnit extends java.lang.Enum 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();
    method public static java.time.temporal.ChronoUnit valueOf(java.lang.String);
    method public static final java.time.temporal.ChronoUnit[] values();
    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 abstract interface Temporal implements java.time.temporal.TemporalAccessor {
    method public abstract 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 abstract java.time.temporal.Temporal plus(long, java.time.temporal.TemporalUnit);
    method public abstract long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
    method public default java.time.temporal.Temporal with(java.time.temporal.TemporalAdjuster);
    method public abstract java.time.temporal.Temporal with(java.time.temporal.TemporalField, long);
  }

  public abstract interface TemporalAccessor {
    method public default int get(java.time.temporal.TemporalField);
    method public abstract long getLong(java.time.temporal.TemporalField);
    method public abstract 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);
  }

  public abstract interface TemporalAdjuster {
    method public abstract 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 abstract interface TemporalAmount {
    method public abstract java.time.temporal.Temporal addTo(java.time.temporal.Temporal);
    method public abstract long get(java.time.temporal.TemporalUnit);
    method public abstract java.util.List<java.time.temporal.TemporalUnit> getUnits();
    method public abstract java.time.temporal.Temporal subtractFrom(java.time.temporal.Temporal);
  }

  public abstract interface TemporalField {
    method public abstract <R extends java.time.temporal.Temporal> R adjustInto(R, long);
    method public abstract java.time.temporal.TemporalUnit getBaseUnit();
    method public default java.lang.String getDisplayName(java.util.Locale);
    method public abstract long getFrom(java.time.temporal.TemporalAccessor);
    method public abstract java.time.temporal.TemporalUnit getRangeUnit();
    method public abstract boolean isDateBased();
    method public abstract boolean isSupportedBy(java.time.temporal.TemporalAccessor);
    method public abstract boolean isTimeBased();
    method public abstract java.time.temporal.ValueRange range();
    method public abstract 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 abstract java.lang.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();
  }

  public abstract interface TemporalQuery<R> {
    method public abstract R queryFrom(java.time.temporal.TemporalAccessor);
  }

  public abstract interface TemporalUnit {
    method public abstract <R extends java.time.temporal.Temporal> R addTo(R, long);
    method public abstract long between(java.time.temporal.Temporal, java.time.temporal.Temporal);
    method public abstract java.time.Duration getDuration();
    method public abstract boolean isDateBased();
    method public abstract boolean isDurationEstimated();
    method public default boolean isSupportedBy(java.time.temporal.Temporal);
    method public abstract boolean isTimeBased();
    method public abstract java.lang.String toString();
  }

  public class UnsupportedTemporalTypeException extends java.time.DateTimeException {
    ctor public UnsupportedTemporalTypeException(java.lang.String);
    ctor public UnsupportedTemporalTypeException(java.lang.String, java.lang.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.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 static final class ZoneOffsetTransitionRule.TimeDefinition extends java.lang.Enum {
    method public java.time.LocalDateTime createDateTime(java.time.LocalDateTime, java.time.ZoneOffset, java.time.ZoneOffset);
    method public static java.time.zone.ZoneOffsetTransitionRule.TimeDefinition valueOf(java.lang.String);
    method public static final java.time.zone.ZoneOffsetTransitionRule.TimeDefinition[] values();
    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(java.lang.String);
    ctor public ZoneRulesException(java.lang.String, java.lang.Throwable);
  }

}

package java.util {

  public abstract class AbstractCollection<E> implements java.util.Collection {
    ctor protected AbstractCollection();
    method public boolean add(E);
    method public boolean addAll(java.util.Collection<? extends E>);
    method public void clear();
    method public boolean contains(java.lang.Object);
    method public boolean containsAll(java.util.Collection<?>);
    method public boolean isEmpty();
    method public boolean remove(java.lang.Object);
    method public boolean removeAll(java.util.Collection<?>);
    method public boolean retainAll(java.util.Collection<?>);
    method public java.lang.Object[] toArray();
    method public <T> T[] toArray(T[]);
  }

  public abstract class AbstractList<E> extends java.util.AbstractCollection implements java.util.List {
    ctor protected AbstractList();
    method public void add(int, E);
    method public boolean addAll(int, java.util.Collection<? extends E>);
    method public int indexOf(java.lang.Object);
    method public java.util.Iterator<E> iterator();
    method public int lastIndexOf(java.lang.Object);
    method public java.util.ListIterator<E> listIterator();
    method 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 public java.util.List<E> subList(int, int);
    field protected transient int modCount;
  }

  public abstract class AbstractMap<K, V> implements java.util.Map {
    ctor protected AbstractMap();
    method public void clear();
    method public boolean containsKey(java.lang.Object);
    method public boolean containsValue(java.lang.Object);
    method public V get(java.lang.Object);
    method public boolean isEmpty();
    method public java.util.Set<K> keySet();
    method public V put(K, V);
    method public void putAll(java.util.Map<? extends K, ? extends V>);
    method public V remove(java.lang.Object);
    method public int size();
    method public java.util.Collection<V> values();
  }

  public static class AbstractMap.SimpleEntry<K, V> implements java.util.Map.Entry java.io.Serializable {
    ctor public AbstractMap.SimpleEntry(K, V);
    ctor public AbstractMap.SimpleEntry(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 java.io.Serializable {
    ctor public AbstractMap.SimpleImmutableEntry(K, V);
    ctor public AbstractMap.SimpleImmutableEntry(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 implements java.util.Queue {
    ctor protected AbstractQueue();
    method public E element();
    method public E remove();
  }

  public abstract class AbstractSequentialList<E> extends java.util.AbstractList {
    ctor protected AbstractSequentialList();
    method public E get(int);
  }

  public abstract class AbstractSet<E> extends java.util.AbstractCollection implements java.util.Set {
    ctor protected AbstractSet();
  }

  public class ArrayDeque<E> extends java.util.AbstractCollection implements java.lang.Cloneable java.util.Deque java.io.Serializable {
    ctor public ArrayDeque();
    ctor public ArrayDeque(int);
    ctor public ArrayDeque(java.util.Collection<? extends E>);
    method public void addFirst(E);
    method public void addLast(E);
    method public java.util.ArrayDeque<E> clone();
    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(java.lang.Object);
    method public E removeLast();
    method public boolean removeLastOccurrence(java.lang.Object);
    method public int size();
  }

  public class ArrayList<E> extends java.util.AbstractList implements java.lang.Cloneable java.util.List java.util.RandomAccess java.io.Serializable {
    ctor public ArrayList(int);
    ctor public ArrayList();
    ctor public ArrayList(java.util.Collection<? extends E>);
    method public java.lang.Object clone();
    method public void ensureCapacity(int);
    method public void forEach(java.util.function.Consumer<? super E>);
    method public E get(int);
    method public int size();
    method public void trimToSize();
  }

  public class Arrays {
    method public static <T> java.util.List<T> asList(T...);
    method public static int binarySearch(long[], long);
    method public static int binarySearch(long[], int, int, long);
    method public static int binarySearch(int[], int);
    method public static int binarySearch(int[], int, int, int);
    method public static int binarySearch(short[], short);
    method public static int binarySearch(short[], int, int, short);
    method public static int binarySearch(char[], char);
    method public static int binarySearch(char[], int, int, char);
    method public static int binarySearch(byte[], byte);
    method public static int binarySearch(byte[], int, int, byte);
    method public static int binarySearch(double[], double);
    method public static int binarySearch(double[], int, int, double);
    method public static int binarySearch(float[], float);
    method public static int binarySearch(float[], int, int, float);
    method public static int binarySearch(java.lang.Object[], java.lang.Object);
    method public static int binarySearch(java.lang.Object[], int, int, java.lang.Object);
    method public static <T> int binarySearch(T[], T, java.util.Comparator<? super T>);
    method public static <T> int binarySearch(T[], int, int, T, java.util.Comparator<? super T>);
    method public static <T> T[] copyOf(T[], int);
    method public static <T, U> T[] copyOf(U[], int, java.lang.Class<? extends T[]>);
    method public static byte[] copyOf(byte[], int);
    method public static short[] copyOf(short[], int);
    method public static int[] copyOf(int[], int);
    method public static long[] copyOf(long[], int);
    method public static char[] copyOf(char[], int);
    method public static float[] copyOf(float[], int);
    method public static double[] copyOf(double[], int);
    method public static boolean[] copyOf(boolean[], int);
    method public static <T> T[] copyOfRange(T[], int, int);
    method public static <T, U> T[] copyOfRange(U[], int, int, java.lang.Class<? extends T[]>);
    method public static byte[] copyOfRange(byte[], int, int);
    method public static short[] copyOfRange(short[], int, int);
    method public static int[] copyOfRange(int[], int, int);
    method public static long[] copyOfRange(long[], int, int);
    method public static char[] copyOfRange(char[], int, int);
    method public static float[] copyOfRange(float[], int, int);
    method public static double[] copyOfRange(double[], int, int);
    method public static boolean[] copyOfRange(boolean[], int, int);
    method public static boolean deepEquals(java.lang.Object[], java.lang.Object[]);
    method public static int deepHashCode(java.lang.Object[]);
    method public static java.lang.String deepToString(java.lang.Object[]);
    method public static boolean equals(long[], long[]);
    method public static boolean equals(int[], int[]);
    method public static boolean equals(short[], short[]);
    method public static boolean equals(char[], char[]);
    method public static boolean equals(byte[], byte[]);
    method public static boolean equals(boolean[], boolean[]);
    method public static boolean equals(double[], double[]);
    method public static boolean equals(float[], float[]);
    method public static boolean equals(java.lang.Object[], java.lang.Object[]);
    method public static void fill(long[], long);
    method public static void fill(long[], int, int, long);
    method public static void fill(int[], int);
    method public static void fill(int[], int, int, int);
    method public static void fill(short[], short);
    method public static void fill(short[], int, int, short);
    method public static void fill(char[], char);
    method public static void fill(char[], int, int, char);
    method public static void fill(byte[], byte);
    method public static void fill(byte[], int, int, byte);
    method public static void fill(boolean[], boolean);
    method public static void fill(boolean[], int, int, boolean);
    method public static void fill(double[], double);
    method public static void fill(double[], int, int, double);
    method public static void fill(float[], float);
    method public static void fill(float[], int, int, float);
    method public static void fill(java.lang.Object[], java.lang.Object);
    method public static void fill(java.lang.Object[], int, int, java.lang.Object);
    method public static int hashCode(long[]);
    method public static int hashCode(int[]);
    method public static int hashCode(short[]);
    method public static int hashCode(char[]);
    method public static int hashCode(byte[]);
    method public static int hashCode(boolean[]);
    method public static int hashCode(float[]);
    method public static int hashCode(double[]);
    method public static int hashCode(java.lang.Object[]);
    method public static <T> void parallelPrefix(T[], java.util.function.BinaryOperator<T>);
    method public static <T> void parallelPrefix(T[], int, int, java.util.function.BinaryOperator<T>);
    method public static void parallelPrefix(long[], java.util.function.LongBinaryOperator);
    method public static void parallelPrefix(long[], int, int, java.util.function.LongBinaryOperator);
    method public static void parallelPrefix(double[], java.util.function.DoubleBinaryOperator);
    method public static void parallelPrefix(double[], int, int, java.util.function.DoubleBinaryOperator);
    method public static void parallelPrefix(int[], java.util.function.IntBinaryOperator);
    method public static void parallelPrefix(int[], int, int, java.util.function.IntBinaryOperator);
    method public static <T> void parallelSetAll(T[], java.util.function.IntFunction<? extends T>);
    method public static void parallelSetAll(int[], java.util.function.IntUnaryOperator);
    method public static void parallelSetAll(long[], java.util.function.IntToLongFunction);
    method public static void parallelSetAll(double[], java.util.function.IntToDoubleFunction);
    method public static void parallelSort(byte[]);
    method public static void parallelSort(byte[], int, int);
    method public static void parallelSort(char[]);
    method public static void parallelSort(char[], int, int);
    method public static void parallelSort(short[]);
    method public static void parallelSort(short[], int, int);
    method public static void parallelSort(int[]);
    method public static void parallelSort(int[], int, int);
    method public static void parallelSort(long[]);
    method public static void parallelSort(long[], int, int);
    method public static void parallelSort(float[]);
    method public static void parallelSort(float[], int, int);
    method public static void parallelSort(double[]);
    method public static void parallelSort(double[], int, int);
    method public static <T extends java.lang.Comparable<? super T>> void parallelSort(T[]);
    method public static <T extends java.lang.Comparable<? super T>> void parallelSort(T[], int, int);
    method public static <T> void parallelSort(T[], java.util.Comparator<? super T>);
    method public static <T> void parallelSort(T[], int, int, java.util.Comparator<? super T>);
    method public static <T> void setAll(T[], java.util.function.IntFunction<? extends T>);
    method public static void setAll(int[], java.util.function.IntUnaryOperator);
    method public static void setAll(long[], java.util.function.IntToLongFunction);
    method public static void setAll(double[], java.util.function.IntToDoubleFunction);
    method public static void sort(int[]);
    method public static void sort(int[], int, int);
    method public static void sort(long[]);
    method public static void sort(long[], int, int);
    method public static void sort(short[]);
    method public static void sort(short[], int, int);
    method public static void sort(char[]);
    method public static void sort(char[], int, int);
    method public static void sort(byte[]);
    method public static void sort(byte[], int, int);
    method public static void sort(float[]);
    method public static void sort(float[], int, int);
    method public static void sort(double[]);
    method public static void sort(double[], int, int);
    method public static void sort(java.lang.Object[]);
    method public static void sort(java.lang.Object[], int, int);
    method public static <T> void sort(T[], java.util.Comparator<? super T>);
    method public static <T> void sort(T[], int, int, java.util.Comparator<? super T>);
    method public static <T> java.util.Spliterator<T> spliterator(T[]);
    method public static <T> java.util.Spliterator<T> spliterator(T[], int, int);
    method public static java.util.Spliterator.OfInt spliterator(int[]);
    method public static java.util.Spliterator.OfInt spliterator(int[], int, int);
    method public static java.util.Spliterator.OfLong spliterator(long[]);
    method public static java.util.Spliterator.OfLong spliterator(long[], int, int);
    method public static java.util.Spliterator.OfDouble spliterator(double[]);
    method public static java.util.Spliterator.OfDouble spliterator(double[], int, int);
    method public static <T> java.util.stream.Stream<T> stream(T[]);
    method public static <T> java.util.stream.Stream<T> stream(T[], int, int);
    method public static java.util.stream.IntStream stream(int[]);
    method public static java.util.stream.IntStream stream(int[], int, int);
    method public static java.util.stream.LongStream stream(long[]);
    method public static java.util.stream.LongStream stream(long[], int, int);
    method public static java.util.stream.DoubleStream stream(double[]);
    method public static java.util.stream.DoubleStream stream(double[], int, int);
    method public static java.lang.String toString(long[]);
    method public static java.lang.String toString(int[]);
    method public static java.lang.String toString(short[]);
    method public static java.lang.String toString(char[]);
    method public static java.lang.String toString(byte[]);
    method public static java.lang.String toString(boolean[]);
    method public static java.lang.String toString(float[]);
    method public static java.lang.String toString(double[]);
    method public static java.lang.String toString(java.lang.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(java.lang.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 java.lang.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 java.lang.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.io.Serializable {
    ctor protected Calendar();
    ctor protected Calendar(java.util.TimeZone, java.util.Locale);
    method public abstract void add(int, int);
    method public boolean after(java.lang.Object);
    method public boolean before(java.lang.Object);
    method public final void clear();
    method public final void clear(int);
    method public java.lang.Object clone();
    method public int compareTo(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 public static java.util.Set<java.lang.String> getAvailableCalendarTypes();
    method public static synchronized java.util.Locale[] getAvailableLocales();
    method public java.lang.String getCalendarType();
    method public java.lang.String getDisplayName(int, int, java.util.Locale);
    method public java.util.Map<java.lang.String, java.lang.Integer> getDisplayNames(int, int, java.util.Locale);
    method public int getFirstDayOfWeek();
    method public abstract int getGreatestMinimum(int);
    method public static java.util.Calendar getInstance();
    method public static java.util.Calendar getInstance(java.util.TimeZone);
    method public static java.util.Calendar getInstance(java.util.Locale);
    method public static java.util.Calendar getInstance(java.util.TimeZone, 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 public final java.util.Date getTime();
    method public long getTimeInMillis();
    method 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(java.util.Date);
    method public void setTimeInMillis(long);
    method public void setTimeZone(java.util.TimeZone);
    method public void setWeekDate(int, int, int);
    method 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 protected int[] fields;
    field protected boolean[] isSet;
    field protected boolean isTimeSet;
    field protected long time;
  }

  public static class Calendar.Builder {
    ctor public Calendar.Builder();
    method public java.util.Calendar build();
    method public java.util.Calendar.Builder set(int, int);
    method public java.util.Calendar.Builder setCalendarType(java.lang.String);
    method public java.util.Calendar.Builder setDate(int, int, int);
    method public java.util.Calendar.Builder setFields(int...);
    method public java.util.Calendar.Builder setInstant(long);
    method public java.util.Calendar.Builder setInstant(java.util.Date);
    method public java.util.Calendar.Builder setLenient(boolean);
    method public java.util.Calendar.Builder setLocale(java.util.Locale);
    method public java.util.Calendar.Builder setTimeOfDay(int, int, int);
    method public java.util.Calendar.Builder setTimeOfDay(int, int, int, int);
    method public java.util.Calendar.Builder setTimeZone(java.util.TimeZone);
    method public java.util.Calendar.Builder setWeekDate(int, int, int);
    method public java.util.Calendar.Builder setWeekDefinition(int, int);
  }

  public abstract interface Collection<E> implements java.lang.Iterable {
    method public abstract boolean add(E);
    method public abstract boolean addAll(java.util.Collection<? extends E>);
    method public abstract void clear();
    method public abstract boolean contains(java.lang.Object);
    method public abstract boolean containsAll(java.util.Collection<?>);
    method public abstract boolean equals(java.lang.Object);
    method public abstract int hashCode();
    method public abstract boolean isEmpty();
    method public abstract java.util.Iterator<E> iterator();
    method public default java.util.stream.Stream<E> parallelStream();
    method public abstract boolean remove(java.lang.Object);
    method public abstract boolean removeAll(java.util.Collection<?>);
    method public default boolean removeIf(java.util.function.Predicate<? super E>);
    method public abstract boolean retainAll(java.util.Collection<?>);
    method public abstract int size();
    method public default java.util.Spliterator<E> spliterator();
    method public default java.util.stream.Stream<E> stream();
    method public abstract java.lang.Object[] toArray();
    method public abstract <T> T[] toArray(T[]);
  }

  public class Collections {
    method public static <T> boolean addAll(java.util.Collection<? super T>, T...);
    method public static <T> java.util.Queue<T> asLifoQueue(java.util.Deque<T>);
    method public static <T> int binarySearch(java.util.List<? extends java.lang.Comparable<? super T>>, T);
    method public static <T> int binarySearch(java.util.List<? extends T>, T, java.util.Comparator<? super T>);
    method public static <E> java.util.Collection<E> checkedCollection(java.util.Collection<E>, java.lang.Class<E>);
    method public static <E> java.util.List<E> checkedList(java.util.List<E>, java.lang.Class<E>);
    method public static <K, V> java.util.Map<K, V> checkedMap(java.util.Map<K, V>, java.lang.Class<K>, java.lang.Class<V>);
    method public static <K, V> java.util.NavigableMap<K, V> checkedNavigableMap(java.util.NavigableMap<K, V>, java.lang.Class<K>, java.lang.Class<V>);
    method public static <E> java.util.NavigableSet<E> checkedNavigableSet(java.util.NavigableSet<E>, java.lang.Class<E>);
    method public static <E> java.util.Queue<E> checkedQueue(java.util.Queue<E>, java.lang.Class<E>);
    method public static <E> java.util.Set<E> checkedSet(java.util.Set<E>, java.lang.Class<E>);
    method public static <K, V> java.util.SortedMap<K, V> checkedSortedMap(java.util.SortedMap<K, V>, java.lang.Class<K>, java.lang.Class<V>);
    method public static <E> java.util.SortedSet<E> checkedSortedSet(java.util.SortedSet<E>, java.lang.Class<E>);
    method public static <T> void copy(java.util.List<? super T>, java.util.List<? extends T>);
    method public static boolean disjoint(java.util.Collection<?>, java.util.Collection<?>);
    method public static <T> java.util.Enumeration<T> emptyEnumeration();
    method public static <T> java.util.Iterator<T> emptyIterator();
    method public static final <T> java.util.List<T> emptyList();
    method public static <T> java.util.ListIterator<T> emptyListIterator();
    method public static final <K, V> java.util.Map<K, V> emptyMap();
    method public static final <K, V> java.util.NavigableMap<K, V> emptyNavigableMap();
    method public static <E> java.util.NavigableSet<E> emptyNavigableSet();
    method public static final <T> java.util.Set<T> emptySet();
    method public static final <K, V> java.util.SortedMap<K, V> emptySortedMap();
    method public static <E> java.util.SortedSet<E> emptySortedSet();
    method public static <T> java.util.Enumeration<T> enumeration(java.util.Collection<T>);
    method public static <T> void fill(java.util.List<? super T>, T);
    method public static int frequency(java.util.Collection<?>, java.lang.Object);
    method public static int indexOfSubList(java.util.List<?>, java.util.List<?>);
    method public static int lastIndexOfSubList(java.util.List<?>, java.util.List<?>);
    method public static <T> java.util.ArrayList<T> list(java.util.Enumeration<T>);
    method public static <T extends java.lang.Object & java.lang.Comparable<? super T>> T max(java.util.Collection<? extends T>);
    method public static <T> T max(java.util.Collection<? extends T>, java.util.Comparator<? super T>);
    method public static <T extends java.lang.Object & java.lang.Comparable<? super T>> T min(java.util.Collection<? extends T>);
    method public static <T> T min(java.util.Collection<? extends T>, java.util.Comparator<? super T>);
    method public static <T> java.util.List<T> nCopies(int, T);
    method public static <E> java.util.Set<E> newSetFromMap(java.util.Map<E, java.lang.Boolean>);
    method public static <T> boolean replaceAll(java.util.List<T>, T, T);
    method public static void reverse(java.util.List<?>);
    method public static <T> java.util.Comparator<T> reverseOrder();
    method public static <T> java.util.Comparator<T> reverseOrder(java.util.Comparator<T>);
    method public static void rotate(java.util.List<?>, int);
    method public static void shuffle(java.util.List<?>);
    method public static void shuffle(java.util.List<?>, java.util.Random);
    method public static <T> java.util.Set<T> singleton(T);
    method public static <T> java.util.List<T> singletonList(T);
    method public static <K, V> java.util.Map<K, V> singletonMap(K, V);
    method public static <T extends java.lang.Comparable<? super T>> void sort(java.util.List<T>);
    method public static <T> void sort(java.util.List<T>, java.util.Comparator<? super T>);
    method public static void swap(java.util.List<?>, int, int);
    method public static <T> java.util.Collection<T> synchronizedCollection(java.util.Collection<T>);
    method public static <T> java.util.List<T> synchronizedList(java.util.List<T>);
    method public static <K, V> java.util.Map<K, V> synchronizedMap(java.util.Map<K, V>);
    method public static <K, V> java.util.NavigableMap<K, V> synchronizedNavigableMap(java.util.NavigableMap<K, V>);
    method public static <T> java.util.NavigableSet<T> synchronizedNavigableSet(java.util.NavigableSet<T>);
    method public static <T> java.util.Set<T> synchronizedSet(java.util.Set<T>);
    method public static <K, V> java.util.SortedMap<K, V> synchronizedSortedMap(java.util.SortedMap<K, V>);
    method public static <T> java.util.SortedSet<T> synchronizedSortedSet(java.util.SortedSet<T>);
    method public static <T> java.util.Collection<T> unmodifiableCollection(java.util.Collection<? extends T>);
    method public static <T> java.util.List<T> unmodifiableList(java.util.List<? extends T>);
    method public static <K, V> java.util.Map<K, V> unmodifiableMap(java.util.Map<? extends K, ? extends V>);
    method public static <K, V> java.util.NavigableMap<K, V> unmodifiableNavigableMap(java.util.NavigableMap<K, ? extends V>);
    method public static <T> java.util.NavigableSet<T> unmodifiableNavigableSet(java.util.NavigableSet<T>);
    method public static <T> java.util.Set<T> unmodifiableSet(java.util.Set<? extends T>);
    method public static <K, V> java.util.SortedMap<K, V> unmodifiableSortedMap(java.util.SortedMap<K, ? extends V>);
    method public static <T> java.util.SortedSet<T> unmodifiableSortedSet(java.util.SortedSet<T>);
    field public static final java.util.List EMPTY_LIST;
    field public static final java.util.Map EMPTY_MAP;
    field public static final java.util.Set EMPTY_SET;
  }

  public abstract interface Comparator<T> {
    method public abstract 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 abstract boolean equals(java.lang.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(java.lang.String);
    ctor public ConcurrentModificationException(java.lang.Throwable);
    ctor public ConcurrentModificationException(java.lang.String, java.lang.Throwable);
  }

  public final class Currency implements java.io.Serializable {
    method public static java.util.Set<java.util.Currency> getAvailableCurrencies();
    method public java.lang.String getCurrencyCode();
    method public int getDefaultFractionDigits();
    method public java.lang.String getDisplayName();
    method public java.lang.String getDisplayName(java.util.Locale);
    method public static java.util.Currency getInstance(java.lang.String);
    method public static java.util.Currency getInstance(java.util.Locale);
    method public int getNumericCode();
    method public java.lang.String getSymbol();
    method public java.lang.String getSymbol(java.util.Locale);
  }

  public class Date implements java.lang.Cloneable java.lang.Comparable java.io.Serializable {
    ctor public Date();
    ctor public Date(long);
    ctor public deprecated Date(int, int, int);
    ctor public deprecated Date(int, int, int, int, int);
    ctor public deprecated Date(int, int, int, int, int, int);
    ctor public deprecated Date(java.lang.String);
    method public static deprecated long UTC(int, int, int, int, int, int);
    method public boolean after(java.util.Date);
    method public boolean before(java.util.Date);
    method public java.lang.Object clone();
    method public int compareTo(java.util.Date);
    method public static java.util.Date from(java.time.Instant);
    method public deprecated int getDate();
    method public deprecated int getDay();
    method public deprecated int getHours();
    method public deprecated int getMinutes();
    method public deprecated int getMonth();
    method public deprecated int getSeconds();
    method public long getTime();
    method public deprecated int getTimezoneOffset();
    method public deprecated int getYear();
    method public static deprecated long parse(java.lang.String);
    method public deprecated void setDate(int);
    method public deprecated void setHours(int);
    method public deprecated void setMinutes(int);
    method public deprecated void setMonth(int);
    method public deprecated void setSeconds(int);
    method public void setTime(long);
    method public deprecated void setYear(int);
    method public deprecated java.lang.String toGMTString();
    method public java.time.Instant toInstant();
    method public deprecated java.lang.String toLocaleString();
  }

  public abstract interface Deque<E> implements java.util.Queue {
    method public abstract void addFirst(E);
    method public abstract void addLast(E);
    method public abstract java.util.Iterator<E> descendingIterator();
    method public abstract E getFirst();
    method public abstract E getLast();
    method public abstract boolean offerFirst(E);
    method public abstract boolean offerLast(E);
    method public abstract E peekFirst();
    method public abstract E peekLast();
    method public abstract E pollFirst();
    method public abstract E pollLast();
    method public abstract E pop();
    method public abstract void push(E);
    method public abstract E removeFirst();
    method public abstract boolean removeFirstOccurrence(java.lang.Object);
    method public abstract E removeLast();
    method public abstract boolean removeLastOccurrence(java.lang.Object);
  }

  public abstract class Dictionary<K, V> {
    ctor public Dictionary();
    method public abstract java.util.Enumeration<V> elements();
    method public abstract V get(java.lang.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(java.lang.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(java.lang.String);
    method public java.lang.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 implements java.lang.Cloneable java.io.Serializable {
    ctor public EnumMap(java.lang.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 implements java.lang.Cloneable java.io.Serializable {
    method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> allOf(java.lang.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(java.lang.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 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 abstract interface Enumeration<E> {
    method public abstract boolean hasMoreElements();
    method public abstract E nextElement();
  }

  public abstract 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(java.lang.Object);
    method public java.lang.Object getSource();
    field protected transient java.lang.Object source;
  }

  public class FormatFlagsConversionMismatchException extends java.util.IllegalFormatException {
    ctor public FormatFlagsConversionMismatchException(java.lang.String, char);
    method public char getConversion();
    method public java.lang.String getFlags();
  }

  public abstract interface Formattable {
    method public abstract 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(java.lang.Appendable);
    ctor public Formatter(java.util.Locale);
    ctor public Formatter(java.lang.Appendable, java.util.Locale);
    ctor public Formatter(java.lang.String) throws java.io.FileNotFoundException;
    ctor public Formatter(java.lang.String, java.lang.String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    ctor public Formatter(java.lang.String, java.lang.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, java.lang.String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
    ctor public Formatter(java.io.File, java.lang.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, java.lang.String) throws java.io.UnsupportedEncodingException;
    ctor public Formatter(java.io.OutputStream, java.lang.String, java.util.Locale) throws java.io.UnsupportedEncodingException;
    method public void close();
    method public void flush();
    method public java.util.Formatter format(java.lang.String, java.lang.Object...);
    method public java.util.Formatter format(java.util.Locale, java.lang.String, java.lang.Object...);
    method public java.io.IOException ioException();
    method public java.util.Locale locale();
    method public java.lang.Appendable out();
  }

  public static final class Formatter.BigDecimalLayoutForm extends java.lang.Enum {
    method public static java.util.Formatter.BigDecimalLayoutForm valueOf(java.lang.String);
    method public static final java.util.Formatter.BigDecimalLayoutForm[] values();
    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 implements java.lang.Cloneable java.util.Map java.io.Serializable {
    ctor public HashMap(int, float);
    ctor public HashMap(int);
    ctor public HashMap();
    ctor public HashMap(java.util.Map<? extends K, ? extends V>);
    method public java.lang.Object clone();
    method public java.util.Set<java.util.Map.Entry<K, V>> entrySet();
  }

  public class HashSet<E> extends java.util.AbstractSet implements java.lang.Cloneable java.io.Serializable java.util.Set {
    ctor public HashSet();
    ctor public HashSet(java.util.Collection<? extends E>);
    ctor public HashSet(int, float);
    ctor public HashSet(int);
    method public java.lang.Object clone();
    method public java.util.Iterator<E> iterator();
    method public int size();
  }

  public class Hashtable<K, V> extends java.util.Dictionary implements java.lang.Cloneable java.util.Map 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 synchronized void clear();
    method public synchronized java.lang.Object clone();
    method public synchronized V compute(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    method public synchronized V computeIfAbsent(K, java.util.function.Function<? super K, ? extends V>);
    method public synchronized V computeIfPresent(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    method public synchronized boolean contains(java.lang.Object);
    method public synchronized boolean containsKey(java.lang.Object);
    method public boolean containsValue(java.lang.Object);
    method public synchronized java.util.Enumeration<V> elements();
    method public java.util.Set<java.util.Map.Entry<K, V>> entrySet();
    method public synchronized boolean equals(java.lang.Object);
    method public synchronized void forEach(java.util.function.BiConsumer<? super K, ? super V>);
    method public synchronized V get(java.lang.Object);
    method public synchronized V getOrDefault(java.lang.Object, V);
    method public synchronized int hashCode();
    method public synchronized boolean isEmpty();
    method public java.util.Set<K> keySet();
    method public synchronized java.util.Enumeration<K> keys();
    method public synchronized V merge(K, V, java.util.function.BiFunction<? super V, ? super V, ? extends V>);
    method public synchronized V put(K, V);
    method public synchronized void putAll(java.util.Map<? extends K, ? extends V>);
    method public synchronized V putIfAbsent(K, V);
    method protected void rehash();
    method public synchronized V remove(java.lang.Object);
    method public synchronized boolean remove(java.lang.Object, java.lang.Object);
    method public synchronized boolean replace(K, V, V);
    method public synchronized V replace(K, V);
    method public synchronized void replaceAll(java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    method public synchronized int size();
    method public synchronized java.lang.String toString();
    method public java.util.Collection<V> values();
  }

  public class IdentityHashMap<K, V> extends java.util.AbstractMap implements java.lang.Cloneable java.util.Map java.io.Serializable {
    ctor public IdentityHashMap();
    ctor public IdentityHashMap(int);
    ctor public IdentityHashMap(java.util.Map<? extends K, ? extends V>);
    method public java.lang.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, java.lang.Class<?>);
    method public java.lang.Class<?> getArgumentClass();
    method public char getConversion();
  }

  public class IllegalFormatException extends java.lang.IllegalArgumentException {
  }

  public class IllegalFormatFlagsException extends java.util.IllegalFormatException {
    ctor public IllegalFormatFlagsException(java.lang.String);
    method public java.lang.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(java.lang.String);
    ctor public IllformedLocaleException(java.lang.String, int);
    method public int getErrorIndex();
  }

  public class InputMismatchException extends java.util.NoSuchElementException {
    ctor public InputMismatchException();
    ctor public InputMismatchException(java.lang.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(java.lang.Throwable);
    ctor public InvalidPropertiesFormatException(java.lang.String);
  }

  public abstract interface Iterator<E> {
    method public default void forEachRemaining(java.util.function.Consumer<? super E>);
    method public abstract boolean hasNext();
    method public abstract E next();
    method public default void remove();
  }

  public class LinkedHashMap<K, V> extends java.util.HashMap implements java.util.Map {
    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 implements java.lang.Cloneable java.io.Serializable java.util.Set {
    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 implements java.lang.Cloneable java.util.Deque java.util.List java.io.Serializable {
    ctor public LinkedList();
    ctor public LinkedList(java.util.Collection<? extends E>);
    method public void addFirst(E);
    method public void addLast(E);
    method public java.lang.Object clone();
    method 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 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(java.lang.Object);
    method public E removeLast();
    method public boolean removeLastOccurrence(java.lang.Object);
    method public int size();
  }

  public abstract interface List<E> implements java.util.Collection {
    method public abstract void add(int, E);
    method public abstract boolean addAll(int, java.util.Collection<? extends E>);
    method public abstract E get(int);
    method public abstract int indexOf(java.lang.Object);
    method public abstract int lastIndexOf(java.lang.Object);
    method public abstract java.util.ListIterator<E> listIterator();
    method public abstract java.util.ListIterator<E> listIterator(int);
    method public abstract E remove(int);
    method public default void replaceAll(java.util.function.UnaryOperator<E>);
    method public abstract E set(int, E);
    method public default void sort(java.util.Comparator<? super E>);
    method public abstract java.util.List<E> subList(int, int);
  }

  public abstract interface ListIterator<E> implements java.util.Iterator {
    method public abstract void add(E);
    method public abstract boolean hasPrevious();
    method public abstract int nextIndex();
    method public abstract E previous();
    method public abstract int previousIndex();
    method public abstract void remove();
    method public abstract void set(E);
  }

  public abstract class ListResourceBundle extends java.util.ResourceBundle {
    ctor public ListResourceBundle();
    method protected abstract java.lang.Object[][] getContents();
    method public java.util.Enumeration<java.lang.String> getKeys();
    method public final java.lang.Object handleGetObject(java.lang.String);
  }

  public final class Locale implements java.lang.Cloneable java.io.Serializable {
    ctor public Locale(java.lang.String, java.lang.String, java.lang.String);
    ctor public Locale(java.lang.String, java.lang.String);
    ctor public Locale(java.lang.String);
    method public java.lang.Object clone();
    method public static java.util.List<java.util.Locale> filter(java.util.List<java.util.Locale.LanguageRange>, java.util.Collection<java.util.Locale>, java.util.Locale.FilteringMode);
    method public static java.util.List<java.util.Locale> filter(java.util.List<java.util.Locale.LanguageRange>, java.util.Collection<java.util.Locale>);
    method public static java.util.List<java.lang.String> filterTags(java.util.List<java.util.Locale.LanguageRange>, java.util.Collection<java.lang.String>, java.util.Locale.FilteringMode);
    method public static java.util.List<java.lang.String> filterTags(java.util.List<java.util.Locale.LanguageRange>, java.util.Collection<java.lang.String>);
    method public static java.util.Locale forLanguageTag(java.lang.String);
    method public static java.util.Locale[] getAvailableLocales();
    method public java.lang.String getCountry();
    method public static java.util.Locale getDefault();
    method public static java.util.Locale getDefault(java.util.Locale.Category);
    method public java.lang.String getDisplayCountry();
    method public java.lang.String getDisplayCountry(java.util.Locale);
    method public java.lang.String getDisplayLanguage();
    method public java.lang.String getDisplayLanguage(java.util.Locale);
    method public java.lang.String getDisplayName();
    method public java.lang.String getDisplayName(java.util.Locale);
    method public java.lang.String getDisplayScript();
    method public java.lang.String getDisplayScript(java.util.Locale);
    method public java.lang.String getDisplayVariant();
    method public java.lang.String getDisplayVariant(java.util.Locale);
    method public java.lang.String getExtension(char);
    method public java.util.Set<java.lang.Character> getExtensionKeys();
    method public java.lang.String getISO3Country() throws java.util.MissingResourceException;
    method public java.lang.String getISO3Language() throws java.util.MissingResourceException;
    method public static java.lang.String[] getISOCountries();
    method public static java.lang.String[] getISOLanguages();
    method public java.lang.String getLanguage();
    method public java.lang.String getScript();
    method public java.util.Set<java.lang.String> getUnicodeLocaleAttributes();
    method public java.util.Set<java.lang.String> getUnicodeLocaleKeys();
    method public java.lang.String getUnicodeLocaleType(java.lang.String);
    method public java.lang.String getVariant();
    method public boolean hasExtensions();
    method public static java.util.Locale lookup(java.util.List<java.util.Locale.LanguageRange>, java.util.Collection<java.util.Locale>);
    method public static java.lang.String lookupTag(java.util.List<java.util.Locale.LanguageRange>, java.util.Collection<java.lang.String>);
    method public static synchronized void setDefault(java.util.Locale);
    method public static synchronized void setDefault(java.util.Locale.Category, java.util.Locale);
    method public java.util.Locale stripExtensions();
    method public java.lang.String toLanguageTag();
    field public static final java.util.Locale CANADA;
    field public static final java.util.Locale CANADA_FRENCH;
    field public static final java.util.Locale CHINA;
    field public static final java.util.Locale CHINESE;
    field public static final java.util.Locale ENGLISH;
    field public static final java.util.Locale FRANCE;
    field public static final java.util.Locale FRENCH;
    field public static final java.util.Locale GERMAN;
    field public static final java.util.Locale GERMANY;
    field public static final java.util.Locale ITALIAN;
    field public static final java.util.Locale ITALY;
    field public static final java.util.Locale JAPAN;
    field public static final java.util.Locale JAPANESE;
    field public static final java.util.Locale KOREA;
    field public static final java.util.Locale KOREAN;
    field public static final java.util.Locale PRC;
    field public static final char PRIVATE_USE_EXTENSION = 120; // 0x0078 'x'
    field public static final java.util.Locale ROOT;
    field public static final java.util.Locale SIMPLIFIED_CHINESE;
    field public static final java.util.Locale TAIWAN;
    field public static final java.util.Locale TRADITIONAL_CHINESE;
    field public static final java.util.Locale UK;
    field public static final char UNICODE_LOCALE_EXTENSION = 117; // 0x0075 'u'
    field public static final java.util.Locale US;
  }

  public static final class Locale.Builder {
    ctor public Locale.Builder();
    method public java.util.Locale.Builder addUnicodeLocaleAttribute(java.lang.String);
    method public java.util.Locale build();
    method public java.util.Locale.Builder clear();
    method public java.util.Locale.Builder clearExtensions();
    method public java.util.Locale.Builder removeUnicodeLocaleAttribute(java.lang.String);
    method public java.util.Locale.Builder setExtension(char, java.lang.String);
    method public java.util.Locale.Builder setLanguage(java.lang.String);
    method public java.util.Locale.Builder setLanguageTag(java.lang.String);
    method public java.util.Locale.Builder setLocale(java.util.Locale);
    method public java.util.Locale.Builder setRegion(java.lang.String);
    method public java.util.Locale.Builder setScript(java.lang.String);
    method public java.util.Locale.Builder setUnicodeLocaleKeyword(java.lang.String, java.lang.String);
    method public java.util.Locale.Builder setVariant(java.lang.String);
  }

  public static final class Locale.Category extends java.lang.Enum {
    method public static java.util.Locale.Category valueOf(java.lang.String);
    method public static final java.util.Locale.Category[] values();
    enum_constant public static final java.util.Locale.Category DISPLAY;
    enum_constant public static final java.util.Locale.Category FORMAT;
  }

  public static final class Locale.FilteringMode extends java.lang.Enum {
    method public static java.util.Locale.FilteringMode valueOf(java.lang.String);
    method public static final java.util.Locale.FilteringMode[] values();
    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(java.lang.String);
    ctor public Locale.LanguageRange(java.lang.String, double);
    method public java.lang.String getRange();
    method public double getWeight();
    method public static java.util.List<java.util.Locale.LanguageRange> mapEquivalents(java.util.List<java.util.Locale.LanguageRange>, java.util.Map<java.lang.String, java.util.List<java.lang.String>>);
    method public static java.util.List<java.util.Locale.LanguageRange> parse(java.lang.String);
    method public static java.util.List<java.util.Locale.LanguageRange> parse(java.lang.String, 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 abstract interface Map<K, V> {
    method public abstract void clear();
    method public default V compute(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    method public default V computeIfAbsent(K, java.util.function.Function<? super K, ? extends V>);
    method public default V computeIfPresent(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    method public abstract boolean containsKey(java.lang.Object);
    method public abstract boolean containsValue(java.lang.Object);
    method public abstract java.util.Set<java.util.Map.Entry<K, V>> entrySet();
    method public abstract boolean equals(java.lang.Object);
    method public default void forEach(java.util.function.BiConsumer<? super K, ? super V>);
    method public abstract V get(java.lang.Object);
    method public default V getOrDefault(java.lang.Object, V);
    method public abstract int hashCode();
    method public abstract boolean isEmpty();
    method public abstract java.util.Set<K> keySet();
    method public default V merge(K, V, java.util.function.BiFunction<? super V, ? super V, ? extends V>);
    method public abstract V put(K, V);
    method public abstract void putAll(java.util.Map<? extends K, ? extends V>);
    method public default V putIfAbsent(K, V);
    method public abstract V remove(java.lang.Object);
    method public default boolean remove(java.lang.Object, java.lang.Object);
    method public default boolean replace(K, V, V);
    method public default V replace(K, V);
    method public default void replaceAll(java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    method public abstract int size();
    method public abstract java.util.Collection<V> values();
  }

  public static abstract interface Map.Entry<K, V> {
    method public static <K extends java.lang.Comparable<? super K>, V> java.util.Comparator<java.util.Map.Entry<K, V>> comparingByKey();
    method public static <K, V> java.util.Comparator<java.util.Map.Entry<K, V>> comparingByKey(java.util.Comparator<? super K>);
    method public static <K, V extends java.lang.Comparable<? super V>> java.util.Comparator<java.util.Map.Entry<K, V>> comparingByValue();
    method public static <K, V> java.util.Comparator<java.util.Map.Entry<K, V>> comparingByValue(java.util.Comparator<? super V>);
    method public abstract boolean equals(java.lang.Object);
    method public abstract K getKey();
    method public abstract V getValue();
    method public abstract int hashCode();
    method public abstract V setValue(V);
  }

  public class MissingFormatArgumentException extends java.util.IllegalFormatException {
    ctor public MissingFormatArgumentException(java.lang.String);
    method public java.lang.String getFormatSpecifier();
  }

  public class MissingFormatWidthException extends java.util.IllegalFormatException {
    ctor public MissingFormatWidthException(java.lang.String);
    method public java.lang.String getFormatSpecifier();
  }

  public class MissingResourceException extends java.lang.RuntimeException {
    ctor public MissingResourceException(java.lang.String, java.lang.String, java.lang.String);
    method public java.lang.String getClassName();
    method public java.lang.String getKey();
  }

  public abstract interface NavigableMap<K, V> implements java.util.SortedMap {
    method public abstract java.util.Map.Entry<K, V> ceilingEntry(K);
    method public abstract K ceilingKey(K);
    method public abstract java.util.NavigableSet<K> descendingKeySet();
    method public abstract java.util.NavigableMap<K, V> descendingMap();
    method public abstract java.util.Map.Entry<K, V> firstEntry();
    method public abstract java.util.Map.Entry<K, V> floorEntry(K);
    method public abstract K floorKey(K);
    method public abstract java.util.NavigableMap<K, V> headMap(K, boolean);
    method public abstract java.util.Map.Entry<K, V> higherEntry(K);
    method public abstract K higherKey(K);
    method public abstract java.util.Map.Entry<K, V> lastEntry();
    method public abstract java.util.Map.Entry<K, V> lowerEntry(K);
    method public abstract K lowerKey(K);
    method public abstract java.util.NavigableSet<K> navigableKeySet();
    method public abstract java.util.Map.Entry<K, V> pollFirstEntry();
    method public abstract java.util.Map.Entry<K, V> pollLastEntry();
    method public abstract java.util.NavigableMap<K, V> subMap(K, boolean, K, boolean);
    method public abstract java.util.NavigableMap<K, V> tailMap(K, boolean);
  }

  public abstract interface NavigableSet<E> implements java.util.SortedSet {
    method public abstract E ceiling(E);
    method public abstract java.util.Iterator<E> descendingIterator();
    method public abstract java.util.NavigableSet<E> descendingSet();
    method public abstract E floor(E);
    method public abstract java.util.NavigableSet<E> headSet(E, boolean);
    method public abstract E higher(E);
    method public abstract E lower(E);
    method public abstract E pollFirst();
    method public abstract E pollLast();
    method public abstract java.util.NavigableSet<E> subSet(E, boolean, E, boolean);
    method public abstract java.util.NavigableSet<E> tailSet(E, boolean);
  }

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

  public final class Objects {
    method public static <T> int compare(T, T, java.util.Comparator<? super T>);
    method public static boolean deepEquals(java.lang.Object, java.lang.Object);
    method public static boolean equals(java.lang.Object, java.lang.Object);
    method public static int hash(java.lang.Object...);
    method public static int hashCode(java.lang.Object);
    method public static boolean isNull(java.lang.Object);
    method public static boolean nonNull(java.lang.Object);
    method public static <T> T requireNonNull(T);
    method public static <T> T requireNonNull(T, java.lang.String);
    method public static <T> T requireNonNull(T, java.util.function.Supplier<java.lang.String>);
    method public static java.lang.String toString(java.lang.Object);
    method public static java.lang.String toString(java.lang.Object, java.lang.String);
  }

  public class Observable {
    ctor public Observable();
    method public synchronized void addObserver(java.util.Observer);
    method protected synchronized void clearChanged();
    method public synchronized int countObservers();
    method public synchronized void deleteObserver(java.util.Observer);
    method public synchronized void deleteObservers();
    method public synchronized boolean hasChanged();
    method public void notifyObservers();
    method public void notifyObservers(java.lang.Object);
    method protected synchronized void setChanged();
  }

  public abstract interface Observer {
    method public abstract void update(java.util.Observable, java.lang.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 java.lang.Throwable;
  }

  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 java.lang.Throwable;
  }

  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 java.lang.Throwable;
  }

  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 java.lang.Throwable;
  }

  public abstract interface PrimitiveIterator<T, T_CONS> implements java.util.Iterator {
    method public abstract void forEachRemaining(T_CONS);
  }

  public static abstract interface PrimitiveIterator.OfDouble implements java.util.PrimitiveIterator {
    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 java.lang.Double next();
    method public abstract double nextDouble();
  }

  public static abstract interface PrimitiveIterator.OfInt implements java.util.PrimitiveIterator {
    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 java.lang.Integer next();
    method public abstract int nextInt();
  }

  public static abstract interface PrimitiveIterator.OfLong implements java.util.PrimitiveIterator {
    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 java.lang.Long next();
    method public abstract long nextLong();
  }

  public class PriorityQueue<E> extends java.util.AbstractQueue 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 {
    ctor public Properties();
    ctor public Properties(java.util.Properties);
    method public java.lang.String getProperty(java.lang.String);
    method public java.lang.String getProperty(java.lang.String, java.lang.String);
    method public void list(java.io.PrintStream);
    method public void list(java.io.PrintWriter);
    method public synchronized void load(java.io.Reader) throws java.io.IOException;
    method public synchronized void load(java.io.InputStream) throws java.io.IOException;
    method public synchronized void loadFromXML(java.io.InputStream) throws java.io.IOException, java.util.InvalidPropertiesFormatException;
    method public java.util.Enumeration<?> propertyNames();
    method public deprecated void save(java.io.OutputStream, java.lang.String);
    method public synchronized java.lang.Object setProperty(java.lang.String, java.lang.String);
    method public void store(java.io.Writer, java.lang.String) throws java.io.IOException;
    method public void store(java.io.OutputStream, java.lang.String) throws java.io.IOException;
    method public void storeToXML(java.io.OutputStream, java.lang.String) throws java.io.IOException;
    method public void storeToXML(java.io.OutputStream, java.lang.String, java.lang.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(java.lang.String, java.lang.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 java.lang.Object handleGetObject(java.lang.String);
  }

  public abstract interface Queue<E> implements java.util.Collection {
    method public abstract E element();
    method public abstract boolean offer(E);
    method public abstract E peek();
    method public abstract E poll();
    method public abstract 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 synchronized double nextGaussian();
    method public int nextInt();
    method public int nextInt(int);
    method public long nextLong();
    method public synchronized void setSeed(long);
  }

  public abstract interface RandomAccess {
  }

  public abstract class ResourceBundle {
    ctor public ResourceBundle();
    method public static final void clearCache();
    method public static final void clearCache(java.lang.ClassLoader);
    method public boolean containsKey(java.lang.String);
    method public java.lang.String getBaseBundleName();
    method public static final java.util.ResourceBundle getBundle(java.lang.String);
    method public static final java.util.ResourceBundle getBundle(java.lang.String, java.util.ResourceBundle.Control);
    method public static final java.util.ResourceBundle getBundle(java.lang.String, java.util.Locale);
    method public static final java.util.ResourceBundle getBundle(java.lang.String, java.util.Locale, java.util.ResourceBundle.Control);
    method public static java.util.ResourceBundle getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader);
    method public static java.util.ResourceBundle getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader, java.util.ResourceBundle.Control);
    method public abstract java.util.Enumeration<java.lang.String> getKeys();
    method public java.util.Locale getLocale();
    method public final java.lang.Object getObject(java.lang.String);
    method public final java.lang.String getString(java.lang.String);
    method public final java.lang.String[] getStringArray(java.lang.String);
    method protected abstract java.lang.Object handleGetObject(java.lang.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(java.lang.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(java.lang.String, java.util.Locale);
    method public java.util.List<java.lang.String> getFormats(java.lang.String);
    method public static final java.util.ResourceBundle.Control getNoFallbackControl(java.util.List<java.lang.String>);
    method public long getTimeToLive(java.lang.String, java.util.Locale);
    method public boolean needsReload(java.lang.String, java.util.Locale, java.lang.String, java.lang.ClassLoader, java.util.ResourceBundle, long);
    method public java.util.ResourceBundle newBundle(java.lang.String, java.util.Locale, java.lang.String, java.lang.ClassLoader, boolean) throws java.io.IOException, java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public java.lang.String toBundleName(java.lang.String, java.util.Locale);
    method public final java.lang.String toResourceName(java.lang.String, java.lang.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 {
    ctor public Scanner(java.lang.Readable);
    ctor public Scanner(java.io.InputStream);
    ctor public Scanner(java.io.InputStream, java.lang.String);
    ctor public Scanner(java.io.File) throws java.io.FileNotFoundException;
    ctor public Scanner(java.io.File, java.lang.String) throws java.io.FileNotFoundException;
    ctor public Scanner(java.nio.file.Path) throws java.io.IOException;
    ctor public Scanner(java.nio.file.Path, java.lang.String) throws java.io.IOException;
    ctor public Scanner(java.lang.String);
    ctor public Scanner(java.nio.channels.ReadableByteChannel);
    ctor public Scanner(java.nio.channels.ReadableByteChannel, java.lang.String);
    method public void close();
    method public java.util.regex.Pattern delimiter();
    method public java.lang.String findInLine(java.lang.String);
    method public java.lang.String findInLine(java.util.regex.Pattern);
    method public java.lang.String findWithinHorizon(java.lang.String, int);
    method public java.lang.String findWithinHorizon(java.util.regex.Pattern, int);
    method public boolean hasNext();
    method public boolean hasNext(java.lang.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 java.lang.String next();
    method public java.lang.String next(java.lang.String);
    method public java.lang.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 java.lang.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(java.lang.String);
    method public java.util.Scanner useDelimiter(java.util.regex.Pattern);
    method public java.util.Scanner useDelimiter(java.lang.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(java.lang.String);
    ctor public ServiceConfigurationError(java.lang.String, java.lang.Throwable);
  }

  public final class ServiceLoader<S> implements java.lang.Iterable {
    method public java.util.Iterator<S> iterator();
    method public static <S> java.util.ServiceLoader<S> load(java.lang.Class<S>, java.lang.ClassLoader);
    method public static <S> java.util.ServiceLoader<S> load(java.lang.Class<S>);
    method public static <S> java.util.ServiceLoader<S> loadInstalled(java.lang.Class<S>);
    method public void reload();
  }

  public abstract interface Set<E> implements java.util.Collection {
  }

  public class SimpleTimeZone extends java.util.TimeZone {
    ctor public SimpleTimeZone(int, java.lang.String);
    ctor public SimpleTimeZone(int, java.lang.String, int, int, int, int, int, int, int, int);
    ctor public SimpleTimeZone(int, java.lang.String, int, int, int, int, int, int, int, int, int);
    ctor public SimpleTimeZone(int, java.lang.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 synchronized int hashCode();
    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 abstract interface SortedMap<K, V> implements java.util.Map {
    method public abstract java.util.Comparator<? super K> comparator();
    method public abstract K firstKey();
    method public abstract java.util.SortedMap<K, V> headMap(K);
    method public abstract K lastKey();
    method public abstract java.util.SortedMap<K, V> subMap(K, K);
    method public abstract java.util.SortedMap<K, V> tailMap(K);
  }

  public abstract interface SortedSet<E> implements java.util.Set {
    method public abstract java.util.Comparator<? super E> comparator();
    method public abstract E first();
    method public abstract java.util.SortedSet<E> headSet(E);
    method public abstract E last();
    method public abstract java.util.SortedSet<E> subSet(E, E);
    method public abstract java.util.SortedSet<E> tailSet(E);
  }

  public abstract interface Spliterator<T> {
    method public abstract int characteristics();
    method public abstract 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 abstract boolean tryAdvance(java.util.function.Consumer<? super T>);
    method public abstract 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 abstract interface Spliterator.OfDouble implements java.util.Spliterator.OfPrimitive {
    method public default void forEachRemaining(java.util.function.DoubleConsumer);
    method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Double>);
    method public abstract boolean tryAdvance(java.util.function.DoubleConsumer);
    method public default boolean tryAdvance(java.util.function.Consumer<? super java.lang.Double>);
    method public abstract java.util.Spliterator.OfDouble trySplit();
  }

  public static abstract interface Spliterator.OfInt implements java.util.Spliterator.OfPrimitive {
    method public default void forEachRemaining(java.util.function.IntConsumer);
    method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Integer>);
    method public abstract boolean tryAdvance(java.util.function.IntConsumer);
    method public default boolean tryAdvance(java.util.function.Consumer<? super java.lang.Integer>);
    method public abstract java.util.Spliterator.OfInt trySplit();
  }

  public static abstract interface Spliterator.OfLong implements java.util.Spliterator.OfPrimitive {
    method public default void forEachRemaining(java.util.function.LongConsumer);
    method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Long>);
    method public abstract boolean tryAdvance(java.util.function.LongConsumer);
    method public default boolean tryAdvance(java.util.function.Consumer<? super java.lang.Long>);
    method public abstract java.util.Spliterator.OfLong trySplit();
  }

  public static abstract interface Spliterator.OfPrimitive<T, T_CONS, T_SPLITR extends java.util.Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> implements java.util.Spliterator {
    method public default void forEachRemaining(T_CONS);
    method public abstract boolean tryAdvance(T_CONS);
    method public abstract 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(java.lang.Object[], int);
    method public static <T> java.util.Spliterator<T> spliterator(java.lang.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 static abstract 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 static abstract 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 static abstract 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 static abstract class Spliterators.AbstractSpliterator<T> implements java.util.Spliterator {
    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 {
    ctor public Stack();
    method public boolean empty();
    method public synchronized E peek();
    method public synchronized E pop();
    method public E push(E);
    method public synchronized int search(java.lang.Object);
  }

  public final class StringJoiner {
    ctor public StringJoiner(java.lang.CharSequence);
    ctor public StringJoiner(java.lang.CharSequence, java.lang.CharSequence, java.lang.CharSequence);
    method public java.util.StringJoiner add(java.lang.CharSequence);
    method public int length();
    method public java.util.StringJoiner merge(java.util.StringJoiner);
    method public java.util.StringJoiner setEmptyValue(java.lang.CharSequence);
  }

  public class StringTokenizer implements java.util.Enumeration {
    ctor public StringTokenizer(java.lang.String, java.lang.String, boolean);
    ctor public StringTokenizer(java.lang.String, java.lang.String);
    ctor public StringTokenizer(java.lang.String);
    method public int countTokens();
    method public boolean hasMoreElements();
    method public boolean hasMoreTokens();
    method public java.lang.Object nextElement();
    method public java.lang.String nextToken();
    method public java.lang.String nextToken(java.lang.String);
  }

  public abstract class TimeZone implements java.lang.Cloneable java.io.Serializable {
    ctor public TimeZone();
    method public java.lang.Object clone();
    method public static synchronized java.lang.String[] getAvailableIDs(int);
    method public static synchronized java.lang.String[] getAvailableIDs();
    method public int getDSTSavings();
    method public static java.util.TimeZone getDefault();
    method public final java.lang.String getDisplayName();
    method public final java.lang.String getDisplayName(java.util.Locale);
    method public final java.lang.String getDisplayName(boolean, int);
    method public java.lang.String getDisplayName(boolean, int, java.util.Locale);
    method public java.lang.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 synchronized java.util.TimeZone getTimeZone(java.lang.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 synchronized void setDefault(java.util.TimeZone);
    method public void setID(java.lang.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(java.lang.String);
    ctor public Timer(java.lang.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(java.lang.String);
  }

  public class TreeMap<K, V> extends java.util.AbstractMap implements java.lang.Cloneable java.util.NavigableMap java.io.Serializable {
    ctor public TreeMap();
    ctor public TreeMap(java.util.Comparator<? super K>);
    ctor public TreeMap(java.util.Map<? extends K, ? extends V>);
    ctor public TreeMap(java.util.SortedMap<K, ? extends V>);
    method public java.util.Map.Entry<K, V> ceilingEntry(K);
    method public K ceilingKey(K);
    method public java.lang.Object clone();
    method public java.util.Comparator<? super K> comparator();
    method public java.util.NavigableSet<K> descendingKeySet();
    method public java.util.NavigableMap<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.NavigableMap<K, V> headMap(K, boolean);
    method public java.util.SortedMap<K, V> headMap(K);
    method public java.util.Map.Entry<K, V> higherEntry(K);
    method public K higherKey(K);
    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.NavigableMap<K, V> subMap(K, boolean, K, boolean);
    method public java.util.SortedMap<K, V> subMap(K, K);
    method public java.util.NavigableMap<K, V> tailMap(K, boolean);
    method public java.util.SortedMap<K, V> tailMap(K);
  }

  public class TreeSet<E> extends java.util.AbstractSet implements java.lang.Cloneable java.util.NavigableSet 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 java.lang.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.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(java.lang.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(java.lang.String);
    method public java.lang.String getConversion();
  }

  public class UnknownFormatFlagsException extends java.util.IllegalFormatException {
    ctor public UnknownFormatFlagsException(java.lang.String);
    method public java.lang.String getFlags();
  }

  public class Vector<E> extends java.util.AbstractList implements java.lang.Cloneable java.util.List java.util.RandomAccess java.io.Serializable {
    ctor public Vector(int, int);
    ctor public Vector(int);
    ctor public Vector();
    ctor public Vector(java.util.Collection<? extends E>);
    method public synchronized boolean add(E);
    method public synchronized boolean addAll(java.util.Collection<? extends E>);
    method public synchronized boolean addAll(int, java.util.Collection<? extends E>);
    method public synchronized void addElement(E);
    method public synchronized int capacity();
    method public synchronized java.lang.Object clone();
    method public synchronized boolean containsAll(java.util.Collection<?>);
    method public synchronized void copyInto(java.lang.Object[]);
    method public synchronized E elementAt(int);
    method public java.util.Enumeration<E> elements();
    method public synchronized void ensureCapacity(int);
    method public synchronized boolean equals(java.lang.Object);
    method public synchronized E firstElement();
    method public synchronized void forEach(java.util.function.Consumer<? super E>);
    method public synchronized E get(int);
    method public synchronized int hashCode();
    method public synchronized int indexOf(java.lang.Object, int);
    method public synchronized void insertElementAt(E, int);
    method public synchronized boolean isEmpty();
    method public synchronized java.util.Iterator<E> iterator();
    method public synchronized E lastElement();
    method public synchronized int lastIndexOf(java.lang.Object);
    method public synchronized int lastIndexOf(java.lang.Object, int);
    method public synchronized java.util.ListIterator<E> listIterator(int);
    method public synchronized java.util.ListIterator<E> listIterator();
    method public synchronized E remove(int);
    method public synchronized boolean removeAll(java.util.Collection<?>);
    method public synchronized void removeAllElements();
    method public synchronized boolean removeElement(java.lang.Object);
    method public synchronized void removeElementAt(int);
    method public synchronized boolean removeIf(java.util.function.Predicate<? super E>);
    method protected synchronized void removeRange(int, int);
    method public synchronized void replaceAll(java.util.function.UnaryOperator<E>);
    method public synchronized boolean retainAll(java.util.Collection<?>);
    method public synchronized E set(int, E);
    method public synchronized void setElementAt(E, int);
    method public synchronized void setSize(int);
    method public synchronized int size();
    method public synchronized void sort(java.util.Comparator<? super E>);
    method public synchronized java.util.List<E> subList(int, int);
    method public synchronized java.lang.Object[] toArray();
    method public synchronized <T> T[] toArray(T[]);
    method public synchronized java.lang.String toString();
    method public synchronized void trimToSize();
    field protected int capacityIncrement;
    field protected int elementCount;
    field protected java.lang.Object[] elementData;
  }

  public class WeakHashMap<K, V> extends java.util.AbstractMap implements java.util.Map {
    ctor public WeakHashMap(int, float);
    ctor public WeakHashMap(int);
    ctor public WeakHashMap();
    ctor public WeakHashMap(java.util.Map<? extends K, ? extends V>);
    method 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(java.lang.Runnable, T);
    method protected <T> java.util.concurrent.RunnableFuture<T> newTaskFor(java.util.concurrent.Callable<T>);
    method public java.util.concurrent.Future<?> submit(java.lang.Runnable);
    method public <T> java.util.concurrent.Future<T> submit(java.lang.Runnable, T);
    method public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T>);
  }

  public class ArrayBlockingQueue<E> extends java.util.AbstractQueue implements java.util.concurrent.BlockingQueue 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 abstract interface BlockingDeque<E> implements java.util.concurrent.BlockingQueue java.util.Deque {
    method public abstract boolean offerFirst(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract boolean offerLast(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract E pollFirst(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract E pollLast(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract void putFirst(E) throws java.lang.InterruptedException;
    method public abstract void putLast(E) throws java.lang.InterruptedException;
    method public abstract E takeFirst() throws java.lang.InterruptedException;
    method public abstract E takeLast() throws java.lang.InterruptedException;
  }

  public abstract interface BlockingQueue<E> implements java.util.Queue {
    method public abstract int drainTo(java.util.Collection<? super E>);
    method public abstract int drainTo(java.util.Collection<? super E>, int);
    method public abstract boolean offer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract void put(E) throws java.lang.InterruptedException;
    method public abstract int remainingCapacity();
    method public abstract E take() throws java.lang.InterruptedException;
  }

  public class BrokenBarrierException extends java.lang.Exception {
    ctor public BrokenBarrierException();
    ctor public BrokenBarrierException(java.lang.String);
  }

  public abstract interface Callable<V> {
    method public abstract V call() throws java.lang.Exception;
  }

  public class CancellationException extends java.lang.IllegalStateException {
    ctor public CancellationException();
    ctor public CancellationException(java.lang.String);
  }

  public class CompletableFuture<T> implements java.util.concurrent.CompletionStage java.util.concurrent.Future {
    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(java.lang.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(java.lang.Throwable);
    method public void obtrudeValue(T);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterBoth(java.util.concurrent.CompletionStage<?>, java.lang.Runnable);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?>, java.lang.Runnable);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?>, java.lang.Runnable, java.util.concurrent.Executor);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterEither(java.util.concurrent.CompletionStage<?>, java.lang.Runnable);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?>, java.lang.Runnable);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?>, java.lang.Runnable, java.util.concurrent.Executor);
    method public static java.util.concurrent.CompletableFuture<java.lang.Void> runAsync(java.lang.Runnable);
    method public static java.util.concurrent.CompletableFuture<java.lang.Void> runAsync(java.lang.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(java.lang.Runnable);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> thenRunAsync(java.lang.Runnable);
    method public java.util.concurrent.CompletableFuture<java.lang.Void> thenRunAsync(java.lang.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 abstract interface CompletableFuture.AsynchronousCompletionTask {
  }

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

  public abstract interface CompletionService<V> {
    method public abstract java.util.concurrent.Future<V> poll();
    method public abstract java.util.concurrent.Future<V> poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract java.util.concurrent.Future<V> submit(java.util.concurrent.Callable<V>);
    method public abstract java.util.concurrent.Future<V> submit(java.lang.Runnable, V);
    method public abstract java.util.concurrent.Future<V> take() throws java.lang.InterruptedException;
  }

  public abstract interface CompletionStage<T> {
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> acceptEither(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>);
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>);
    method public abstract 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 abstract <U> java.util.concurrent.CompletionStage<U> applyToEither(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T, U>);
    method public abstract <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T, U>);
    method public abstract <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 abstract java.util.concurrent.CompletionStage<T> exceptionally(java.util.function.Function<java.lang.Throwable, ? extends T>);
    method public abstract <U> java.util.concurrent.CompletionStage<U> handle(java.util.function.BiFunction<? super T, java.lang.Throwable, ? extends U>);
    method public abstract <U> java.util.concurrent.CompletionStage<U> handleAsync(java.util.function.BiFunction<? super T, java.lang.Throwable, ? extends U>);
    method public abstract <U> java.util.concurrent.CompletionStage<U> handleAsync(java.util.function.BiFunction<? super T, java.lang.Throwable, ? extends U>, java.util.concurrent.Executor);
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> runAfterBoth(java.util.concurrent.CompletionStage<?>, java.lang.Runnable);
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?>, java.lang.Runnable);
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?>, java.lang.Runnable, java.util.concurrent.Executor);
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> runAfterEither(java.util.concurrent.CompletionStage<?>, java.lang.Runnable);
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?>, java.lang.Runnable);
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?>, java.lang.Runnable, java.util.concurrent.Executor);
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> thenAccept(java.util.function.Consumer<? super T>);
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T>);
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T>, java.util.concurrent.Executor);
    method public abstract <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 abstract <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 abstract <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 abstract <U> java.util.concurrent.CompletionStage<U> thenApply(java.util.function.Function<? super T, ? extends U>);
    method public abstract <U> java.util.concurrent.CompletionStage<U> thenApplyAsync(java.util.function.Function<? super T, ? extends U>);
    method public abstract <U> java.util.concurrent.CompletionStage<U> thenApplyAsync(java.util.function.Function<? super T, ? extends U>, java.util.concurrent.Executor);
    method public abstract <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 abstract <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 abstract <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 abstract <U> java.util.concurrent.CompletionStage<U> thenCompose(java.util.function.Function<? super T, ? extends java.util.concurrent.CompletionStage<U>>);
    method public abstract <U> java.util.concurrent.CompletionStage<U> thenComposeAsync(java.util.function.Function<? super T, ? extends java.util.concurrent.CompletionStage<U>>);
    method public abstract <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 abstract java.util.concurrent.CompletionStage<java.lang.Void> thenRun(java.lang.Runnable);
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync(java.lang.Runnable);
    method public abstract java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync(java.lang.Runnable, java.util.concurrent.Executor);
    method public abstract java.util.concurrent.CompletableFuture<T> toCompletableFuture();
    method public abstract java.util.concurrent.CompletionStage<T> whenComplete(java.util.function.BiConsumer<? super T, ? super java.lang.Throwable>);
    method public abstract java.util.concurrent.CompletionStage<T> whenCompleteAsync(java.util.function.BiConsumer<? super T, ? super java.lang.Throwable>);
    method public abstract 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 implements java.util.concurrent.ConcurrentMap java.io.Serializable {
    ctor public ConcurrentHashMap();
    ctor public ConcurrentHashMap(int);
    ctor public ConcurrentHashMap(java.util.Map<? extends K, ? extends V>);
    ctor public ConcurrentHashMap(int, float);
    ctor public ConcurrentHashMap(int, float, int);
    method public boolean contains(java.lang.Object);
    method public java.util.Enumeration<V> elements();
    method public java.util.Set<java.util.Map.Entry<K, V>> entrySet();
    method public void forEach(long, java.util.function.BiConsumer<? super K, ? super V>);
    method public <U> void forEach(long, java.util.function.BiFunction<? super K, ? super V, ? extends U>, java.util.function.Consumer<? super U>);
    method public void forEachEntry(long, java.util.function.Consumer<? super java.util.Map.Entry<K, V>>);
    method public <U> void forEachEntry(long, java.util.function.Function<java.util.Map.Entry<K, V>, ? extends U>, java.util.function.Consumer<? super U>);
    method public void forEachKey(long, java.util.function.Consumer<? super K>);
    method public <U> void forEachKey(long, java.util.function.Function<? super K, ? extends U>, java.util.function.Consumer<? super U>);
    method public void forEachValue(long, java.util.function.Consumer<? super V>);
    method public <U> void forEachValue(long, java.util.function.Function<? super V, ? extends U>, java.util.function.Consumer<? super U>);
    method public java.util.concurrent.ConcurrentHashMap.KeySetView<K, V> keySet(V);
    method public java.util.Enumeration<K> keys();
    method public long mappingCount();
    method public static <K> java.util.concurrent.ConcurrentHashMap.KeySetView<K, java.lang.Boolean> newKeySet();
    method public static <K> java.util.concurrent.ConcurrentHashMap.KeySetView<K, java.lang.Boolean> newKeySet(int);
    method public <U> U reduce(long, java.util.function.BiFunction<? super K, ? super V, ? extends U>, java.util.function.BiFunction<? super U, ? super U, ? extends U>);
    method public java.util.Map.Entry<K, V> reduceEntries(long, java.util.function.BiFunction<java.util.Map.Entry<K, V>, java.util.Map.Entry<K, V>, ? extends java.util.Map.Entry<K, V>>);
    method public <U> U reduceEntries(long, java.util.function.Function<java.util.Map.Entry<K, V>, ? extends U>, java.util.function.BiFunction<? super U, ? super U, ? extends U>);
    method public double reduceEntriesToDouble(long, java.util.function.ToDoubleFunction<java.util.Map.Entry<K, V>>, double, java.util.function.DoubleBinaryOperator);
    method public int reduceEntriesToInt(long, java.util.function.ToIntFunction<java.util.Map.Entry<K, V>>, int, java.util.function.IntBinaryOperator);
    method public long reduceEntriesToLong(long, java.util.function.ToLongFunction<java.util.Map.Entry<K, V>>, long, java.util.function.LongBinaryOperator);
    method public K reduceKeys(long, java.util.function.BiFunction<? super K, ? super K, ? extends K>);
    method public <U> U reduceKeys(long, java.util.function.Function<? super K, ? extends U>, java.util.function.BiFunction<? super U, ? super U, ? extends U>);
    method public double reduceKeysToDouble(long, java.util.function.ToDoubleFunction<? super K>, double, java.util.function.DoubleBinaryOperator);
    method public int reduceKeysToInt(long, java.util.function.ToIntFunction<? super K>, int, java.util.function.IntBinaryOperator);
    method public long reduceKeysToLong(long, java.util.function.ToLongFunction<? super K>, long, java.util.function.LongBinaryOperator);
    method public double reduceToDouble(long, java.util.function.ToDoubleBiFunction<? super K, ? super V>, double, java.util.function.DoubleBinaryOperator);
    method public int reduceToInt(long, java.util.function.ToIntBiFunction<? super K, ? super V>, int, java.util.function.IntBinaryOperator);
    method public long reduceToLong(long, java.util.function.ToLongBiFunction<? super K, ? super V>, long, java.util.function.LongBinaryOperator);
    method public V reduceValues(long, java.util.function.BiFunction<? super V, ? super V, ? extends V>);
    method public <U> U reduceValues(long, java.util.function.Function<? super V, ? extends U>, java.util.function.BiFunction<? super U, ? super U, ? extends U>);
    method public double reduceValuesToDouble(long, java.util.function.ToDoubleFunction<? super V>, double, java.util.function.DoubleBinaryOperator);
    method public int reduceValuesToInt(long, java.util.function.ToIntFunction<? super V>, int, java.util.function.IntBinaryOperator);
    method public long reduceValuesToLong(long, java.util.function.ToLongFunction<? super V>, long, java.util.function.LongBinaryOperator);
    method public <U> U search(long, java.util.function.BiFunction<? super K, ? super V, ? extends U>);
    method public <U> U searchEntries(long, java.util.function.Function<java.util.Map.Entry<K, V>, ? extends U>);
    method public <U> U searchKeys(long, java.util.function.Function<? super K, ? extends U>);
    method public <U> U searchValues(long, java.util.function.Function<? super V, ? extends U>);
  }

  public static class ConcurrentHashMap.KeySetView<K, V> implements java.util.Collection java.io.Serializable java.util.Set {
    method public boolean add(K);
    method public boolean addAll(java.util.Collection<? extends K>);
    method public boolean contains(java.lang.Object);
    method public void forEach(java.util.function.Consumer<? super K>);
    method public V getMappedValue();
    method public java.util.Iterator<K> iterator();
    method public boolean remove(java.lang.Object);
    method public java.util.Spliterator<K> spliterator();
  }

  public class ConcurrentLinkedDeque<E> extends java.util.AbstractCollection implements java.util.Deque 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(java.lang.Object);
    method public E removeLast();
    method public boolean removeLastOccurrence(java.lang.Object);
    method public int size();
  }

  public class ConcurrentLinkedQueue<E> extends java.util.AbstractQueue implements java.util.Queue 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 abstract interface ConcurrentMap<K, V> implements java.util.Map {
    method public abstract V putIfAbsent(K, V);
    method public abstract boolean remove(java.lang.Object, java.lang.Object);
    method public abstract boolean replace(K, V, V);
    method public abstract V replace(K, V);
  }

  public abstract interface ConcurrentNavigableMap<K, V> implements java.util.concurrent.ConcurrentMap java.util.NavigableMap {
    method public abstract java.util.concurrent.ConcurrentNavigableMap<K, V> descendingMap();
    method public abstract java.util.concurrent.ConcurrentNavigableMap<K, V> headMap(K, boolean);
    method public abstract java.util.concurrent.ConcurrentNavigableMap<K, V> headMap(K);
    method public abstract java.util.NavigableSet<K> keySet();
    method public abstract java.util.concurrent.ConcurrentNavigableMap<K, V> subMap(K, boolean, K, boolean);
    method public abstract java.util.concurrent.ConcurrentNavigableMap<K, V> subMap(K, K);
    method public abstract java.util.concurrent.ConcurrentNavigableMap<K, V> tailMap(K, boolean);
    method public abstract java.util.concurrent.ConcurrentNavigableMap<K, V> tailMap(K);
  }

  public class ConcurrentSkipListMap<K, V> extends java.util.AbstractMap implements java.lang.Cloneable java.util.concurrent.ConcurrentNavigableMap 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 implements java.lang.Cloneable java.util.NavigableSet 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 java.util.RandomAccess java.io.Serializable {
    ctor public CopyOnWriteArrayList();
    ctor public CopyOnWriteArrayList(java.util.Collection<? extends E>);
    ctor public CopyOnWriteArrayList(E[]);
    method public boolean add(E);
    method public void add(int, E);
    method public boolean addAll(java.util.Collection<? extends E>);
    method public boolean addAll(int, java.util.Collection<? extends E>);
    method public int addAllAbsent(java.util.Collection<? extends E>);
    method public boolean addIfAbsent(E);
    method public void clear();
    method public java.lang.Object clone();
    method public boolean contains(java.lang.Object);
    method public boolean containsAll(java.util.Collection<?>);
    method public void forEach(java.util.function.Consumer<? super E>);
    method public E get(int);
    method public int indexOf(java.lang.Object);
    method public int indexOf(E, int);
    method public boolean isEmpty();
    method public java.util.Iterator<E> iterator();
    method public int lastIndexOf(java.lang.Object);
    method public int lastIndexOf(E, int);
    method public java.util.ListIterator<E> listIterator();
    method public java.util.ListIterator<E> listIterator(int);
    method public E remove(int);
    method public boolean remove(java.lang.Object);
    method public boolean removeAll(java.util.Collection<?>);
    method public boolean retainAll(java.util.Collection<?>);
    method public E set(int, E);
    method public int size();
    method public java.util.List<E> subList(int, int);
    method public java.lang.Object[] toArray();
    method public <T> T[] toArray(T[]);
  }

  public class CopyOnWriteArraySet<E> extends java.util.AbstractSet 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 {
    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(java.lang.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, java.lang.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 implements java.util.concurrent.BlockingQueue {
    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 abstract interface Delayed implements java.lang.Comparable {
    method public abstract 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(java.lang.String);
    ctor public ExecutionException(java.lang.String, java.lang.Throwable);
    ctor public ExecutionException(java.lang.Throwable);
  }

  public abstract interface Executor {
    method public abstract void execute(java.lang.Runnable);
  }

  public class ExecutorCompletionService<V> implements java.util.concurrent.CompletionService {
    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(java.lang.Runnable, V);
    method public java.util.concurrent.Future<V> take() throws java.lang.InterruptedException;
  }

  public abstract interface ExecutorService implements java.util.concurrent.Executor {
    method public abstract boolean awaitTermination(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract <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 abstract <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 abstract <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
    method public abstract <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 abstract boolean isShutdown();
    method public abstract boolean isTerminated();
    method public abstract void shutdown();
    method public abstract java.util.List<java.lang.Runnable> shutdownNow();
    method public abstract <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T>);
    method public abstract <T> java.util.concurrent.Future<T> submit(java.lang.Runnable, T);
    method public abstract java.util.concurrent.Future<?> submit(java.lang.Runnable);
  }

  public class Executors {
    method public static <T> java.util.concurrent.Callable<T> callable(java.lang.Runnable, T);
    method public static java.util.concurrent.Callable<java.lang.Object> callable(java.lang.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(java.lang.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(java.lang.Runnable, T);
    method public java.util.concurrent.ForkJoinTask<?> submit(java.lang.Runnable);
    field public static final java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory defaultForkJoinWorkerThreadFactory;
  }

  public static abstract interface ForkJoinPool.ForkJoinWorkerThreadFactory {
    method public abstract java.util.concurrent.ForkJoinWorkerThread newThread(java.util.concurrent.ForkJoinPool);
  }

  public static abstract interface ForkJoinPool.ManagedBlocker {
    method public abstract boolean block() throws java.lang.InterruptedException;
    method public abstract boolean isReleasable();
  }

  public abstract class ForkJoinTask<V> implements java.util.concurrent.Future java.io.Serializable {
    ctor public ForkJoinTask();
    method public static java.util.concurrent.ForkJoinTask<?> adapt(java.lang.Runnable);
    method public static <T> java.util.concurrent.ForkJoinTask<T> adapt(java.lang.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(java.lang.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 java.lang.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(java.lang.Throwable);
  }

  public abstract interface Future<V> {
    method public abstract boolean cancel(boolean);
    method public abstract V get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
    method public abstract V get(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
    method public abstract boolean isCancelled();
    method public abstract boolean isDone();
  }

  public class FutureTask<V> implements java.util.concurrent.RunnableFuture {
    ctor public FutureTask(java.util.concurrent.Callable<V>);
    ctor public FutureTask(java.lang.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(java.lang.Throwable);
  }

  public class LinkedBlockingDeque<E> extends java.util.AbstractQueue implements java.util.concurrent.BlockingDeque 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(java.lang.Object);
    method public E removeLast();
    method public boolean removeLastOccurrence(java.lang.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 implements java.util.concurrent.BlockingQueue 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 implements java.io.Serializable java.util.concurrent.TransferQueue {
    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 implements java.util.concurrent.BlockingQueue 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 {
    ctor public RecursiveAction();
    method protected abstract void compute();
    method protected final boolean exec();
    method public final java.lang.Void getRawResult();
    method protected final void setRawResult(java.lang.Void);
  }

  public abstract class RecursiveTask<V> extends java.util.concurrent.ForkJoinTask {
    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(java.lang.String);
    ctor public RejectedExecutionException(java.lang.String, java.lang.Throwable);
    ctor public RejectedExecutionException(java.lang.Throwable);
  }

  public abstract interface RejectedExecutionHandler {
    method public abstract void rejectedExecution(java.lang.Runnable, java.util.concurrent.ThreadPoolExecutor);
  }

  public abstract interface RunnableFuture<V> implements java.util.concurrent.Future java.lang.Runnable {
  }

  public abstract interface RunnableScheduledFuture<V> implements java.util.concurrent.RunnableFuture java.util.concurrent.ScheduledFuture {
    method public abstract boolean isPeriodic();
  }

  public abstract interface ScheduledExecutorService implements java.util.concurrent.ExecutorService {
    method public abstract java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable, long, java.util.concurrent.TimeUnit);
    method public abstract <V> java.util.concurrent.ScheduledFuture<V> schedule(java.util.concurrent.Callable<V>, long, java.util.concurrent.TimeUnit);
    method public abstract java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit);
    method public abstract java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit);
  }

  public abstract interface ScheduledFuture<V> implements java.util.concurrent.Delayed java.util.concurrent.Future {
  }

  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(java.lang.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(java.lang.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(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit);
    method public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.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 implements java.util.concurrent.BlockingQueue 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 abstract interface ThreadFactory {
    method public abstract java.lang.Thread newThread(java.lang.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 double nextGaussian();
    method public int nextInt(int, int);
    method public long nextLong(long);
    method public long nextLong(long, long);
    method public void setSeed(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(java.lang.Runnable, java.lang.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(java.lang.Thread, java.lang.Runnable);
    method public void execute(java.lang.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(java.lang.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(java.lang.Runnable, java.util.concurrent.ThreadPoolExecutor);
  }

  public static class ThreadPoolExecutor.CallerRunsPolicy implements java.util.concurrent.RejectedExecutionHandler {
    ctor public ThreadPoolExecutor.CallerRunsPolicy();
    method public void rejectedExecution(java.lang.Runnable, java.util.concurrent.ThreadPoolExecutor);
  }

  public static class ThreadPoolExecutor.DiscardOldestPolicy implements java.util.concurrent.RejectedExecutionHandler {
    ctor public ThreadPoolExecutor.DiscardOldestPolicy();
    method public void rejectedExecution(java.lang.Runnable, java.util.concurrent.ThreadPoolExecutor);
  }

  public static class ThreadPoolExecutor.DiscardPolicy implements java.util.concurrent.RejectedExecutionHandler {
    ctor public ThreadPoolExecutor.DiscardPolicy();
    method public void rejectedExecution(java.lang.Runnable, java.util.concurrent.ThreadPoolExecutor);
  }

  public class TimeUnit extends java.lang.Enum {
    method public long convert(long, java.util.concurrent.TimeUnit);
    method public void sleep(long) throws java.lang.InterruptedException;
    method public void timedJoin(java.lang.Thread, long) throws java.lang.InterruptedException;
    method public void timedWait(java.lang.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);
    method public static java.util.concurrent.TimeUnit valueOf(java.lang.String);
    method public static final java.util.concurrent.TimeUnit[] values();
    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(java.lang.String);
  }

  public abstract interface TransferQueue<E> implements java.util.concurrent.BlockingQueue {
    method public abstract int getWaitingConsumerCount();
    method public abstract boolean hasWaitingConsumer();
    method public abstract void transfer(E) throws java.lang.InterruptedException;
    method public abstract boolean tryTransfer(E);
    method public abstract 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(java.lang.Class<U>, java.lang.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(java.lang.Class<U>, java.lang.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(java.lang.Class<U>, java.lang.Class<W>, java.lang.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 java.lang.Thread getExclusiveOwnerThread();
    method protected final void setExclusiveOwnerThread(java.lang.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 java.lang.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(java.lang.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 java.lang.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(java.lang.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 abstract interface Condition {
    method public abstract void await() throws java.lang.InterruptedException;
    method public abstract boolean await(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract long awaitNanos(long) throws java.lang.InterruptedException;
    method public abstract void awaitUninterruptibly();
    method public abstract boolean awaitUntil(java.util.Date) throws java.lang.InterruptedException;
    method public abstract void signal();
    method public abstract void signalAll();
  }

  public abstract interface Lock {
    method public abstract void lock();
    method public abstract void lockInterruptibly() throws java.lang.InterruptedException;
    method public abstract java.util.concurrent.locks.Condition newCondition();
    method public abstract boolean tryLock();
    method public abstract boolean tryLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract void unlock();
  }

  public class LockSupport {
    method public static java.lang.Object getBlocker(java.lang.Thread);
    method public static void park(java.lang.Object);
    method public static void park();
    method public static void parkNanos(java.lang.Object, long);
    method public static void parkNanos(long);
    method public static void parkUntil(java.lang.Object, long);
    method public static void parkUntil(long);
    method public static void unpark(java.lang.Thread);
  }

  public abstract interface ReadWriteLock {
    method public abstract java.util.concurrent.locks.Lock readLock();
    method public abstract 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 java.lang.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(java.lang.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 java.lang.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(java.lang.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 {

  public abstract interface BiConsumer<T, U> {
    method public abstract void accept(T, U);
    method public default java.util.function.BiConsumer<T, U> andThen(java.util.function.BiConsumer<? super T, ? super U>);
  }

  public abstract 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 abstract R apply(T, U);
  }

  public abstract 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 abstract boolean test(T, U);
  }

  public abstract interface BinaryOperator<T> implements java.util.function.BiFunction {
    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>);
  }

  public abstract interface BooleanSupplier {
    method public abstract boolean getAsBoolean();
  }

  public abstract interface Consumer<T> {
    method public abstract void accept(T);
    method public default java.util.function.Consumer<T> andThen(java.util.function.Consumer<? super T>);
  }

  public abstract interface DoubleBinaryOperator {
    method public abstract double applyAsDouble(double, double);
  }

  public abstract interface DoubleConsumer {
    method public abstract void accept(double);
    method public default java.util.function.DoubleConsumer andThen(java.util.function.DoubleConsumer);
  }

  public abstract interface DoubleFunction<R> {
    method public abstract R apply(double);
  }

  public abstract 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 abstract boolean test(double);
  }

  public abstract interface DoubleSupplier {
    method public abstract double getAsDouble();
  }

  public abstract interface DoubleToIntFunction {
    method public abstract int applyAsInt(double);
  }

  public abstract interface DoubleToLongFunction {
    method public abstract long applyAsLong(double);
  }

  public abstract interface DoubleUnaryOperator {
    method public default java.util.function.DoubleUnaryOperator andThen(java.util.function.DoubleUnaryOperator);
    method public abstract double applyAsDouble(double);
    method public default java.util.function.DoubleUnaryOperator compose(java.util.function.DoubleUnaryOperator);
    method public static java.util.function.DoubleUnaryOperator identity();
  }

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

  public abstract interface IntBinaryOperator {
    method public abstract int applyAsInt(int, int);
  }

  public abstract interface IntConsumer {
    method public abstract void accept(int);
    method public default java.util.function.IntConsumer andThen(java.util.function.IntConsumer);
  }

  public abstract interface IntFunction<R> {
    method public abstract R apply(int);
  }

  public abstract 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 abstract boolean test(int);
  }

  public abstract interface IntSupplier {
    method public abstract int getAsInt();
  }

  public abstract interface IntToDoubleFunction {
    method public abstract double applyAsDouble(int);
  }

  public abstract interface IntToLongFunction {
    method public abstract long applyAsLong(int);
  }

  public abstract interface IntUnaryOperator {
    method public default java.util.function.IntUnaryOperator andThen(java.util.function.IntUnaryOperator);
    method public abstract int applyAsInt(int);
    method public default java.util.function.IntUnaryOperator compose(java.util.function.IntUnaryOperator);
    method public static java.util.function.IntUnaryOperator identity();
  }

  public abstract interface LongBinaryOperator {
    method public abstract long applyAsLong(long, long);
  }

  public abstract interface LongConsumer {
    method public abstract void accept(long);
    method public default java.util.function.LongConsumer andThen(java.util.function.LongConsumer);
  }

  public abstract interface LongFunction<R> {
    method public abstract R apply(long);
  }

  public abstract 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 abstract boolean test(long);
  }

  public abstract interface LongSupplier {
    method public abstract long getAsLong();
  }

  public abstract interface LongToDoubleFunction {
    method public abstract double applyAsDouble(long);
  }

  public abstract interface LongToIntFunction {
    method public abstract int applyAsInt(long);
  }

  public abstract interface LongUnaryOperator {
    method public default java.util.function.LongUnaryOperator andThen(java.util.function.LongUnaryOperator);
    method public abstract long applyAsLong(long);
    method public default java.util.function.LongUnaryOperator compose(java.util.function.LongUnaryOperator);
    method public static java.util.function.LongUnaryOperator identity();
  }

  public abstract interface ObjDoubleConsumer<T> {
    method public abstract void accept(T, double);
  }

  public abstract interface ObjIntConsumer<T> {
    method public abstract void accept(T, int);
  }

  public abstract interface ObjLongConsumer<T> {
    method public abstract void accept(T, long);
  }

  public abstract 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(java.lang.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 abstract boolean test(T);
  }

  public abstract interface Supplier<T> {
    method public abstract T get();
  }

  public abstract interface ToDoubleBiFunction<T, U> {
    method public abstract double applyAsDouble(T, U);
  }

  public abstract interface ToDoubleFunction<T> {
    method public abstract double applyAsDouble(T);
  }

  public abstract interface ToIntBiFunction<T, U> {
    method public abstract int applyAsInt(T, U);
  }

  public abstract interface ToIntFunction<T> {
    method public abstract int applyAsInt(T);
  }

  public abstract interface ToLongBiFunction<T, U> {
    method public abstract long applyAsLong(T, U);
  }

  public abstract interface ToLongFunction<T> {
    method public abstract long applyAsLong(T);
  }

  public abstract interface UnaryOperator<T> implements java.util.function.Function {
    method public static <T> java.util.function.UnaryOperator<T> identity();
  }

}

package java.util.jar {

  public class Attributes implements java.lang.Cloneable java.util.Map {
    ctor public Attributes();
    ctor public Attributes(int);
    ctor public Attributes(java.util.jar.Attributes);
    method public void clear();
    method public java.lang.Object clone();
    method public boolean containsKey(java.lang.Object);
    method public boolean containsValue(java.lang.Object);
    method public java.util.Set<java.util.Map.Entry<java.lang.Object, java.lang.Object>> entrySet();
    method public java.lang.Object get(java.lang.Object);
    method public java.lang.String getValue(java.lang.String);
    method public java.lang.String getValue(java.util.jar.Attributes.Name);
    method public boolean isEmpty();
    method public java.util.Set<java.lang.Object> keySet();
    method public java.lang.Object put(java.lang.Object, java.lang.Object);
    method public void putAll(java.util.Map<?, ?>);
    method public java.lang.String putValue(java.lang.String, java.lang.String);
    method public java.lang.Object remove(java.lang.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(java.lang.String);
    field public static final java.util.jar.Attributes.Name CLASS_PATH;
    field public static final java.util.jar.Attributes.Name CONTENT_TYPE;
    field public static final deprecated 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 public static final deprecated java.util.jar.Attributes.Name IMPLEMENTATION_URL;
    field public static final java.util.jar.Attributes.Name IMPLEMENTATION_VENDOR;
    field public static final deprecated 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(java.lang.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(java.lang.String);
  }

  public class JarFile extends java.util.zip.ZipFile {
    ctor public JarFile(java.lang.String) throws java.io.IOException;
    ctor public JarFile(java.lang.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 synchronized java.io.InputStream getInputStream(java.util.zip.ZipEntry) throws java.io.IOException;
    method public java.util.jar.JarEntry getJarEntry(java.lang.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 java.lang.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 java.lang.Object clone();
    method public java.util.jar.Attributes getAttributes(java.lang.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 synchronized java.util.jar.Pack200.Packer newPacker();
    method public static java.util.jar.Pack200.Unpacker newUnpacker();
  }

  public static abstract interface Pack200.Packer {
    method public default deprecated void addPropertyChangeListener(java.beans.PropertyChangeListener);
    method public abstract void pack(java.util.jar.JarFile, java.io.OutputStream) throws java.io.IOException;
    method public abstract void pack(java.util.jar.JarInputStream, java.io.OutputStream) throws java.io.IOException;
    method public abstract java.util.SortedMap<java.lang.String, java.lang.String> properties();
    method public default deprecated void removePropertyChangeListener(java.beans.PropertyChangeListener);
    field public static final java.lang.String CLASS_ATTRIBUTE_PFX = "pack.class.attribute.";
    field public static final java.lang.String CODE_ATTRIBUTE_PFX = "pack.code.attribute.";
    field public static final java.lang.String DEFLATE_HINT = "pack.deflate.hint";
    field public static final java.lang.String EFFORT = "pack.effort";
    field public static final java.lang.String ERROR = "error";
    field public static final java.lang.String FALSE = "false";
    field public static final java.lang.String FIELD_ATTRIBUTE_PFX = "pack.field.attribute.";
    field public static final java.lang.String KEEP = "keep";
    field public static final java.lang.String KEEP_FILE_ORDER = "pack.keep.file.order";
    field public static final java.lang.String LATEST = "latest";
    field public static final java.lang.String METHOD_ATTRIBUTE_PFX = "pack.method.attribute.";
    field public static final java.lang.String MODIFICATION_TIME = "pack.modification.time";
    field public static final java.lang.String PASS = "pass";
    field public static final java.lang.String PASS_FILE_PFX = "pack.pass.file.";
    field public static final java.lang.String PROGRESS = "pack.progress";
    field public static final java.lang.String SEGMENT_LIMIT = "pack.segment.limit";
    field public static final java.lang.String STRIP = "strip";
    field public static final java.lang.String TRUE = "true";
    field public static final java.lang.String UNKNOWN_ATTRIBUTE = "pack.unknown.attribute";
  }

  public static abstract interface Pack200.Unpacker {
    method public default deprecated void addPropertyChangeListener(java.beans.PropertyChangeListener);
    method public abstract java.util.SortedMap<java.lang.String, java.lang.String> properties();
    method public default deprecated void removePropertyChangeListener(java.beans.PropertyChangeListener);
    method public abstract void unpack(java.io.InputStream, java.util.jar.JarOutputStream) throws java.io.IOException;
    method public abstract void unpack(java.io.File, java.util.jar.JarOutputStream) throws java.io.IOException;
    field public static final java.lang.String DEFLATE_HINT = "unpack.deflate.hint";
    field public static final java.lang.String FALSE = "false";
    field public static final java.lang.String KEEP = "keep";
    field public static final java.lang.String PROGRESS = "unpack.progress";
    field public static final java.lang.String TRUE = "true";
  }

}

package java.util.logging {

  public class ConsoleHandler extends java.util.logging.StreamHandler {
    ctor public ConsoleHandler();
    method public void close();
    method public void publish(java.util.logging.LogRecord);
  }

  public class ErrorManager {
    ctor public ErrorManager();
    method public synchronized void error(java.lang.String, java.lang.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(java.lang.String) throws java.io.IOException, java.lang.SecurityException;
    ctor public FileHandler(java.lang.String, boolean) throws java.io.IOException, java.lang.SecurityException;
    ctor public FileHandler(java.lang.String, int, int) throws java.io.IOException, java.lang.SecurityException;
    ctor public FileHandler(java.lang.String, int, int, boolean) throws java.io.IOException, java.lang.SecurityException;
  }

  public abstract interface Filter {
    method public abstract boolean isLoggable(java.util.logging.LogRecord);
  }

  public abstract class Formatter {
    ctor protected Formatter();
    method public abstract java.lang.String format(java.util.logging.LogRecord);
    method public synchronized java.lang.String formatMessage(java.util.logging.LogRecord);
    method public java.lang.String getHead(java.util.logging.Handler);
    method public java.lang.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 java.lang.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(java.lang.String, java.lang.Exception, int);
    method public synchronized void setEncoding(java.lang.String) throws java.lang.SecurityException, java.io.UnsupportedEncodingException;
    method public synchronized void setErrorManager(java.util.logging.ErrorManager);
    method public synchronized void setFilter(java.util.logging.Filter) throws java.lang.SecurityException;
    method public synchronized void setFormatter(java.util.logging.Formatter) throws java.lang.SecurityException;
    method public synchronized void setLevel(java.util.logging.Level) throws java.lang.SecurityException;
  }

  public class Level implements java.io.Serializable {
    ctor protected Level(java.lang.String, int);
    ctor protected Level(java.lang.String, int, java.lang.String);
    method public java.lang.String getLocalizedName();
    method public java.lang.String getName();
    method public java.lang.String getResourceBundleName();
    method public final int intValue();
    method public static synchronized java.util.logging.Level parse(java.lang.String) throws java.lang.IllegalArgumentException;
    method public final java.lang.String toString();
    field public static final java.util.logging.Level ALL;
    field public static final java.util.logging.Level CONFIG;
    field public static final java.util.logging.Level FINE;
    field public static final java.util.logging.Level FINER;
    field public static final java.util.logging.Level FINEST;
    field public static final java.util.logging.Level INFO;
    field public static final java.util.logging.Level OFF;
    field public static final java.util.logging.Level SEVERE;
    field public static final java.util.logging.Level WARNING;
  }

  public class LogManager {
    ctor protected LogManager();
    method public boolean addLogger(java.util.logging.Logger);
    method public deprecated 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(java.lang.String);
    method public java.util.Enumeration<java.lang.String> getLoggerNames();
    method public static synchronized java.util.logging.LoggingMXBean getLoggingMXBean();
    method public java.lang.String getProperty(java.lang.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 public deprecated void removePropertyChangeListener(java.beans.PropertyChangeListener) throws java.lang.SecurityException;
    method public void reset() throws java.lang.SecurityException;
    field public static final java.lang.String LOGGING_MXBEAN_NAME = "java.util.logging:type=Logging";
  }

  public class LogRecord implements java.io.Serializable {
    ctor public LogRecord(java.util.logging.Level, java.lang.String);
    method public java.util.logging.Level getLevel();
    method public java.lang.String getLoggerName();
    method public java.lang.String getMessage();
    method public long getMillis();
    method public java.lang.Object[] getParameters();
    method public java.util.ResourceBundle getResourceBundle();
    method public java.lang.String getResourceBundleName();
    method public long getSequenceNumber();
    method public java.lang.String getSourceClassName();
    method public java.lang.String getSourceMethodName();
    method public int getThreadID();
    method public java.lang.Throwable getThrown();
    method public void setLevel(java.util.logging.Level);
    method public void setLoggerName(java.lang.String);
    method public void setMessage(java.lang.String);
    method public void setMillis(long);
    method public void setParameters(java.lang.Object[]);
    method public void setResourceBundle(java.util.ResourceBundle);
    method public void setResourceBundleName(java.lang.String);
    method public void setSequenceNumber(long);
    method public void setSourceClassName(java.lang.String);
    method public void setSourceMethodName(java.lang.String);
    method public void setThreadID(int);
    method public void setThrown(java.lang.Throwable);
  }

  public class Logger {
    ctor protected Logger(java.lang.String, java.lang.String);
    method public void addHandler(java.util.logging.Handler) throws java.lang.SecurityException;
    method public void config(java.lang.String);
    method public void config(java.util.function.Supplier<java.lang.String>);
    method public void entering(java.lang.String, java.lang.String);
    method public void entering(java.lang.String, java.lang.String, java.lang.Object);
    method public void entering(java.lang.String, java.lang.String, java.lang.Object[]);
    method public void exiting(java.lang.String, java.lang.String);
    method public void exiting(java.lang.String, java.lang.String, java.lang.Object);
    method public void fine(java.lang.String);
    method public void fine(java.util.function.Supplier<java.lang.String>);
    method public void finer(java.lang.String);
    method public void finer(java.util.function.Supplier<java.lang.String>);
    method public void finest(java.lang.String);
    method public void finest(java.util.function.Supplier<java.lang.String>);
    method public static java.util.logging.Logger getAnonymousLogger();
    method public static java.util.logging.Logger getAnonymousLogger(java.lang.String);
    method public java.util.logging.Filter getFilter();
    method public static final java.util.logging.Logger getGlobal();
    method public java.util.logging.Handler[] getHandlers();
    method public java.util.logging.Level getLevel();
    method public static java.util.logging.Logger getLogger(java.lang.String);
    method public static java.util.logging.Logger getLogger(java.lang.String, java.lang.String);
    method public java.lang.String getName();
    method public java.util.logging.Logger getParent();
    method public java.util.ResourceBundle getResourceBundle();
    method public java.lang.String getResourceBundleName();
    method public boolean getUseParentHandlers();
    method public void info(java.lang.String);
    method public void info(java.util.function.Supplier<java.lang.String>);
    method public boolean isLoggable(java.util.logging.Level);
    method public void log(java.util.logging.LogRecord);
    method public void log(java.util.logging.Level, java.lang.String);
    method public void log(java.util.logging.Level, java.util.function.Supplier<java.lang.String>);
    method public void log(java.util.logging.Level, java.lang.String, java.lang.Object);
    method public void log(java.util.logging.Level, java.lang.String, java.lang.Object[]);
    method public void log(java.util.logging.Level, java.lang.String, java.lang.Throwable);
    method public void log(java.util.logging.Level, java.lang.Throwable, java.util.function.Supplier<java.lang.String>);
    method public void logp(java.util.logging.Level, java.lang.String, java.lang.String, java.lang.String);
    method public void logp(java.util.logging.Level, java.lang.String, java.lang.String, java.util.function.Supplier<java.lang.String>);
    method public void logp(java.util.logging.Level, java.lang.String, java.lang.String, java.lang.String, java.lang.Object);
    method public void logp(java.util.logging.Level, java.lang.String, java.lang.String, java.lang.String, java.lang.Object[]);
    method public void logp(java.util.logging.Level, java.lang.String, java.lang.String, java.lang.String, java.lang.Throwable);
    method public void logp(java.util.logging.Level, java.lang.String, java.lang.String, java.lang.Throwable, java.util.function.Supplier<java.lang.String>);
    method public deprecated void logrb(java.util.logging.Level, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public deprecated void logrb(java.util.logging.Level, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Object);
    method public deprecated void logrb(java.util.logging.Level, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Object[]);
    method public void logrb(java.util.logging.Level, java.lang.String, java.lang.String, java.util.ResourceBundle, java.lang.String, java.lang.Object...);
    method public deprecated void logrb(java.util.logging.Level, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Throwable);
    method public void logrb(java.util.logging.Level, java.lang.String, java.lang.String, java.util.ResourceBundle, java.lang.String, java.lang.Throwable);
    method public void removeHandler(java.util.logging.Handler) throws java.lang.SecurityException;
    method public void setFilter(java.util.logging.Filter) throws java.lang.SecurityException;
    method public void setLevel(java.util.logging.Level) throws java.lang.SecurityException;
    method public void setParent(java.util.logging.Logger);
    method public void setResourceBundle(java.util.ResourceBundle);
    method public void setUseParentHandlers(boolean);
    method public void severe(java.lang.String);
    method public void severe(java.util.function.Supplier<java.lang.String>);
    method public void throwing(java.lang.String, java.lang.String, java.lang.Throwable);
    method public void warning(java.lang.String);
    method public void warning(java.util.function.Supplier<java.lang.String>);
    field public static final java.lang.String GLOBAL_LOGGER_NAME = "global";
    field public static final deprecated java.util.logging.Logger global;
  }

  public abstract interface LoggingMXBean {
    method public abstract java.lang.String getLoggerLevel(java.lang.String);
    method public abstract java.util.List<java.lang.String> getLoggerNames();
    method public abstract java.lang.String getParentLoggerName(java.lang.String);
    method public abstract void setLoggerLevel(java.lang.String, java.lang.String);
  }

  public final class LoggingPermission extends java.security.BasicPermission {
    ctor public LoggingPermission(java.lang.String, java.lang.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 synchronized void publish(java.util.logging.LogRecord);
    method public synchronized void push();
    method public synchronized void setPushLevel(java.util.logging.Level) throws java.lang.SecurityException;
  }

  public class SimpleFormatter extends java.util.logging.Formatter {
    ctor public SimpleFormatter();
    method public synchronized java.lang.String format(java.util.logging.LogRecord);
  }

  public class SocketHandler extends java.util.logging.StreamHandler {
    ctor public SocketHandler() throws java.io.IOException;
    ctor public SocketHandler(java.lang.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 synchronized void close() throws java.lang.SecurityException;
    method public synchronized void flush();
    method public synchronized void publish(java.util.logging.LogRecord);
    method protected synchronized void setOutputStream(java.io.OutputStream) throws java.lang.SecurityException;
  }

  public class XMLFormatter extends java.util.logging.Formatter {
    ctor public XMLFormatter();
    method public java.lang.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, java.lang.String);
    method public java.lang.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(java.lang.String);
    method public java.lang.String[] childrenNames() throws java.util.prefs.BackingStoreException;
    method protected abstract java.lang.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 java.lang.String get(java.lang.String, java.lang.String);
    method public boolean getBoolean(java.lang.String, boolean);
    method public byte[] getByteArray(java.lang.String, byte[]);
    method protected java.util.prefs.AbstractPreferences getChild(java.lang.String) throws java.util.prefs.BackingStoreException;
    method public double getDouble(java.lang.String, double);
    method public float getFloat(java.lang.String, float);
    method public int getInt(java.lang.String, int);
    method public long getLong(java.lang.String, long);
    method protected abstract java.lang.String getSpi(java.lang.String);
    method protected boolean isRemoved();
    method public boolean isUserNode();
    method public java.lang.String[] keys() throws java.util.prefs.BackingStoreException;
    method protected abstract java.lang.String[] keysSpi() throws java.util.prefs.BackingStoreException;
    method public java.lang.String name();
    method public java.util.prefs.Preferences node(java.lang.String);
    method public boolean nodeExists(java.lang.String) throws java.util.prefs.BackingStoreException;
    method public java.util.prefs.Preferences parent();
    method public void put(java.lang.String, java.lang.String);
    method public void putBoolean(java.lang.String, boolean);
    method public void putByteArray(java.lang.String, byte[]);
    method public void putDouble(java.lang.String, double);
    method public void putFloat(java.lang.String, float);
    method public void putInt(java.lang.String, int);
    method public void putLong(java.lang.String, long);
    method protected abstract void putSpi(java.lang.String, java.lang.String);
    method public void remove(java.lang.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(java.lang.String);
    method public void sync() throws java.util.prefs.BackingStoreException;
    method protected abstract void syncSpi() throws java.util.prefs.BackingStoreException;
    field protected final java.lang.Object lock;
    field protected boolean newNode;
  }

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

  public class InvalidPreferencesFormatException extends java.lang.Exception {
    ctor public InvalidPreferencesFormatException(java.lang.Throwable);
    ctor public InvalidPreferencesFormatException(java.lang.String);
    ctor public InvalidPreferencesFormatException(java.lang.String, java.lang.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 abstract interface NodeChangeListener implements java.util.EventListener {
    method public abstract void childAdded(java.util.prefs.NodeChangeEvent);
    method public abstract void childRemoved(java.util.prefs.NodeChangeEvent);
  }

  public class PreferenceChangeEvent extends java.util.EventObject {
    ctor public PreferenceChangeEvent(java.util.prefs.Preferences, java.lang.String, java.lang.String);
    method public java.lang.String getKey();
    method public java.lang.String getNewValue();
    method public java.util.prefs.Preferences getNode();
  }

  public abstract interface PreferenceChangeListener implements java.util.EventListener {
    method public abstract void preferenceChange(java.util.prefs.PreferenceChangeEvent);
  }

  public abstract class Preferences {
    ctor protected Preferences();
    method public abstract java.lang.String absolutePath();
    method public abstract void addNodeChangeListener(java.util.prefs.NodeChangeListener);
    method public abstract void addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener);
    method public abstract java.lang.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 java.lang.String get(java.lang.String, java.lang.String);
    method public abstract boolean getBoolean(java.lang.String, boolean);
    method public abstract byte[] getByteArray(java.lang.String, byte[]);
    method public abstract double getDouble(java.lang.String, double);
    method public abstract float getFloat(java.lang.String, float);
    method public abstract int getInt(java.lang.String, int);
    method public abstract long getLong(java.lang.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 java.lang.String[] keys() throws java.util.prefs.BackingStoreException;
    method public abstract java.lang.String name();
    method public abstract java.util.prefs.Preferences node(java.lang.String);
    method public abstract boolean nodeExists(java.lang.String) throws java.util.prefs.BackingStoreException;
    method public abstract java.util.prefs.Preferences parent();
    method public abstract void put(java.lang.String, java.lang.String);
    method public abstract void putBoolean(java.lang.String, boolean);
    method public abstract void putByteArray(java.lang.String, byte[]);
    method public abstract void putDouble(java.lang.String, double);
    method public abstract void putFloat(java.lang.String, float);
    method public abstract void putInt(java.lang.String, int);
    method public abstract void putLong(java.lang.String, long);
    method public abstract void remove(java.lang.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(java.lang.Class<?>);
    method public static java.util.prefs.Preferences systemRoot();
    method public abstract java.lang.String toString();
    method public static java.util.prefs.Preferences userNodeForPackage(java.lang.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 abstract interface PreferencesFactory {
    method public abstract java.util.prefs.Preferences systemRoot();
    method public abstract java.util.prefs.Preferences userRoot();
  }

}

package java.util.regex {

  public abstract interface MatchResult {
    method public abstract int end();
    method public abstract int end(int);
    method public abstract java.lang.String group();
    method public abstract java.lang.String group(int);
    method public abstract int groupCount();
    method public abstract int start();
    method public abstract int start(int);
  }

  public final class Matcher implements java.util.regex.MatchResult {
    method public java.util.regex.Matcher appendReplacement(java.lang.StringBuffer, java.lang.String);
    method public java.lang.StringBuffer appendTail(java.lang.StringBuffer);
    method public int end();
    method public int end(int);
    method public int end(java.lang.String);
    method public boolean find();
    method public boolean find(int);
    method public java.lang.String group();
    method public java.lang.String group(int);
    method public java.lang.String group(java.lang.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 public java.util.regex.Pattern pattern();
    method public static java.lang.String quoteReplacement(java.lang.String);
    method public java.util.regex.Matcher region(int, int);
    method public int regionEnd();
    method public int regionStart();
    method public java.lang.String replaceAll(java.lang.String);
    method public java.lang.String replaceFirst(java.lang.String);
    method public boolean requireEnd();
    method public java.util.regex.Matcher reset();
    method public java.util.regex.Matcher reset(java.lang.CharSequence);
    method public int start();
    method public int start(int);
    method public int start(java.lang.String);
    method public java.util.regex.MatchResult toMatchResult();
    method public java.util.regex.Matcher useAnchoringBounds(boolean);
    method public java.util.regex.Matcher usePattern(java.util.regex.Pattern);
    method public java.util.regex.Matcher useTransparentBounds(boolean);
  }

  public final class Pattern implements java.io.Serializable {
    method public java.util.function.Predicate<java.lang.String> asPredicate();
    method public static java.util.regex.Pattern compile(java.lang.String);
    method public static java.util.regex.Pattern compile(java.lang.String, int);
    method public int flags();
    method public java.util.regex.Matcher matcher(java.lang.CharSequence);
    method public static boolean matches(java.lang.String, java.lang.CharSequence);
    method public java.lang.String pattern();
    method public static java.lang.String quote(java.lang.String);
    method public java.lang.String[] split(java.lang.CharSequence, int);
    method public java.lang.String[] split(java.lang.CharSequence);
    method public java.util.stream.Stream<java.lang.String> splitAsStream(java.lang.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(java.lang.String, java.lang.String, int);
    method public java.lang.String getDescription();
    method public int getIndex();
    method public java.lang.String getPattern();
  }

}

package java.util.stream {

  public abstract interface BaseStream<T, S extends java.util.stream.BaseStream<T, S>> implements java.lang.AutoCloseable {
    method public abstract void close();
    method public abstract boolean isParallel();
    method public abstract java.util.Iterator<T> iterator();
    method public abstract S onClose(java.lang.Runnable);
    method public abstract S parallel();
    method public abstract S sequential();
    method public abstract java.util.Spliterator<T> spliterator();
    method public abstract S unordered();
  }

  public abstract interface Collector<T, A, R> {
    method public abstract java.util.function.BiConsumer<A, T> accumulator();
    method public abstract java.util.Set<java.util.stream.Collector.Characteristics> characteristics();
    method public abstract java.util.function.BinaryOperator<A> combiner();
    method public abstract 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 abstract java.util.function.Supplier<A> supplier();
  }

  public static final class Collector.Characteristics extends java.lang.Enum {
    method public static java.util.stream.Collector.Characteristics valueOf(java.lang.String);
    method public static final java.util.stream.Collector.Characteristics[] values();
    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(java.lang.CharSequence);
    method public static java.util.stream.Collector<java.lang.CharSequence, ?, java.lang.String> joining(java.lang.CharSequence, java.lang.CharSequence, java.lang.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 abstract interface DoubleStream implements java.util.stream.BaseStream {
    method public abstract boolean allMatch(java.util.function.DoublePredicate);
    method public abstract boolean anyMatch(java.util.function.DoublePredicate);
    method public abstract java.util.OptionalDouble average();
    method public abstract java.util.stream.Stream<java.lang.Double> boxed();
    method public static java.util.stream.DoubleStream.Builder builder();
    method public abstract <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 abstract long count();
    method public abstract java.util.stream.DoubleStream distinct();
    method public static java.util.stream.DoubleStream empty();
    method public abstract java.util.stream.DoubleStream filter(java.util.function.DoublePredicate);
    method public abstract java.util.OptionalDouble findAny();
    method public abstract java.util.OptionalDouble findFirst();
    method public abstract java.util.stream.DoubleStream flatMap(java.util.function.DoubleFunction<? extends java.util.stream.DoubleStream>);
    method public abstract void forEach(java.util.function.DoubleConsumer);
    method public abstract 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 abstract java.util.PrimitiveIterator.OfDouble iterator();
    method public abstract java.util.stream.DoubleStream limit(long);
    method public abstract java.util.stream.DoubleStream map(java.util.function.DoubleUnaryOperator);
    method public abstract java.util.stream.IntStream mapToInt(java.util.function.DoubleToIntFunction);
    method public abstract java.util.stream.LongStream mapToLong(java.util.function.DoubleToLongFunction);
    method public abstract <U> java.util.stream.Stream<U> mapToObj(java.util.function.DoubleFunction<? extends U>);
    method public abstract java.util.OptionalDouble max();
    method public abstract java.util.OptionalDouble min();
    method public abstract 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 abstract java.util.stream.DoubleStream parallel();
    method public abstract java.util.stream.DoubleStream peek(java.util.function.DoubleConsumer);
    method public abstract double reduce(double, java.util.function.DoubleBinaryOperator);
    method public abstract java.util.OptionalDouble reduce(java.util.function.DoubleBinaryOperator);
    method public abstract java.util.stream.DoubleStream sequential();
    method public abstract java.util.stream.DoubleStream skip(long);
    method public abstract java.util.stream.DoubleStream sorted();
    method public abstract java.util.Spliterator.OfDouble spliterator();
    method public abstract double sum();
    method public abstract java.util.DoubleSummaryStatistics summaryStatistics();
    method public abstract double[] toArray();
  }

  public static abstract interface DoubleStream.Builder implements java.util.function.DoubleConsumer {
    method public default java.util.stream.DoubleStream.Builder add(double);
    method public abstract java.util.stream.DoubleStream build();
  }

  public abstract interface IntStream implements java.util.stream.BaseStream {
    method public abstract boolean allMatch(java.util.function.IntPredicate);
    method public abstract boolean anyMatch(java.util.function.IntPredicate);
    method public abstract java.util.stream.DoubleStream asDoubleStream();
    method public abstract java.util.stream.LongStream asLongStream();
    method public abstract java.util.OptionalDouble average();
    method public abstract java.util.stream.Stream<java.lang.Integer> boxed();
    method public static java.util.stream.IntStream.Builder builder();
    method public abstract <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 abstract long count();
    method public abstract java.util.stream.IntStream distinct();
    method public static java.util.stream.IntStream empty();
    method public abstract java.util.stream.IntStream filter(java.util.function.IntPredicate);
    method public abstract java.util.OptionalInt findAny();
    method public abstract java.util.OptionalInt findFirst();
    method public abstract java.util.stream.IntStream flatMap(java.util.function.IntFunction<? extends java.util.stream.IntStream>);
    method public abstract void forEach(java.util.function.IntConsumer);
    method public abstract 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 abstract java.util.PrimitiveIterator.OfInt iterator();
    method public abstract java.util.stream.IntStream limit(long);
    method public abstract java.util.stream.IntStream map(java.util.function.IntUnaryOperator);
    method public abstract java.util.stream.DoubleStream mapToDouble(java.util.function.IntToDoubleFunction);
    method public abstract java.util.stream.LongStream mapToLong(java.util.function.IntToLongFunction);
    method public abstract <U> java.util.stream.Stream<U> mapToObj(java.util.function.IntFunction<? extends U>);
    method public abstract java.util.OptionalInt max();
    method public abstract java.util.OptionalInt min();
    method public abstract 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 abstract java.util.stream.IntStream parallel();
    method public abstract 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 abstract int reduce(int, java.util.function.IntBinaryOperator);
    method public abstract java.util.OptionalInt reduce(java.util.function.IntBinaryOperator);
    method public abstract java.util.stream.IntStream sequential();
    method public abstract java.util.stream.IntStream skip(long);
    method public abstract java.util.stream.IntStream sorted();
    method public abstract java.util.Spliterator.OfInt spliterator();
    method public abstract int sum();
    method public abstract java.util.IntSummaryStatistics summaryStatistics();
    method public abstract int[] toArray();
  }

  public static abstract interface IntStream.Builder implements java.util.function.IntConsumer {
    method public default java.util.stream.IntStream.Builder add(int);
    method public abstract java.util.stream.IntStream build();
  }

  public abstract interface LongStream implements java.util.stream.BaseStream {
    method public abstract boolean allMatch(java.util.function.LongPredicate);
    method public abstract boolean anyMatch(java.util.function.LongPredicate);
    method public abstract java.util.stream.DoubleStream asDoubleStream();
    method public abstract java.util.OptionalDouble average();
    method public abstract java.util.stream.Stream<java.lang.Long> boxed();
    method public static java.util.stream.LongStream.Builder builder();
    method public abstract <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 abstract long count();
    method public abstract java.util.stream.LongStream distinct();
    method public static java.util.stream.LongStream empty();
    method public abstract java.util.stream.LongStream filter(java.util.function.LongPredicate);
    method public abstract java.util.OptionalLong findAny();
    method public abstract java.util.OptionalLong findFirst();
    method public abstract java.util.stream.LongStream flatMap(java.util.function.LongFunction<? extends java.util.stream.LongStream>);
    method public abstract void forEach(java.util.function.LongConsumer);
    method public abstract 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 abstract java.util.PrimitiveIterator.OfLong iterator();
    method public abstract java.util.stream.LongStream limit(long);
    method public abstract java.util.stream.LongStream map(java.util.function.LongUnaryOperator);
    method public abstract java.util.stream.DoubleStream mapToDouble(java.util.function.LongToDoubleFunction);
    method public abstract java.util.stream.IntStream mapToInt(java.util.function.LongToIntFunction);
    method public abstract <U> java.util.stream.Stream<U> mapToObj(java.util.function.LongFunction<? extends U>);
    method public abstract java.util.OptionalLong max();
    method public abstract java.util.OptionalLong min();
    method public abstract 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 abstract java.util.stream.LongStream parallel();
    method public abstract 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 abstract long reduce(long, java.util.function.LongBinaryOperator);
    method public abstract java.util.OptionalLong reduce(java.util.function.LongBinaryOperator);
    method public abstract java.util.stream.LongStream sequential();
    method public abstract java.util.stream.LongStream skip(long);
    method public abstract java.util.stream.LongStream sorted();
    method public abstract java.util.Spliterator.OfLong spliterator();
    method public abstract long sum();
    method public abstract java.util.LongSummaryStatistics summaryStatistics();
    method public abstract long[] toArray();
  }

  public static abstract interface LongStream.Builder implements java.util.function.LongConsumer {
    method public default java.util.stream.LongStream.Builder add(long);
    method public abstract java.util.stream.LongStream build();
  }

  public abstract interface Stream<T> implements java.util.stream.BaseStream {
    method public abstract boolean allMatch(java.util.function.Predicate<? super T>);
    method public abstract boolean anyMatch(java.util.function.Predicate<? super T>);
    method public static <T> java.util.stream.Stream.Builder<T> builder();
    method public abstract <R> R collect(java.util.function.Supplier<R>, java.util.function.BiConsumer<R, ? super T>, java.util.function.BiConsumer<R, R>);
    method public abstract <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 abstract long count();
    method public abstract java.util.stream.Stream<T> distinct();
    method public static <T> java.util.stream.Stream<T> empty();
    method public abstract java.util.stream.Stream<T> filter(java.util.function.Predicate<? super T>);
    method public abstract java.util.Optional<T> findAny();
    method public abstract java.util.Optional<T> findFirst();
    method public abstract <R> java.util.stream.Stream<R> flatMap(java.util.function.Function<? super T, ? extends java.util.stream.Stream<? extends R>>);
    method public abstract java.util.stream.DoubleStream flatMapToDouble(java.util.function.Function<? super T, ? extends java.util.stream.DoubleStream>);
    method public abstract java.util.stream.IntStream flatMapToInt(java.util.function.Function<? super T, ? extends java.util.stream.IntStream>);
    method public abstract java.util.stream.LongStream flatMapToLong(java.util.function.Function<? super T, ? extends java.util.stream.LongStream>);
    method public abstract void forEach(java.util.function.Consumer<? super T>);
    method public abstract 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 abstract java.util.stream.Stream<T> limit(long);
    method public abstract <R> java.util.stream.Stream<R> map(java.util.function.Function<? super T, ? extends R>);
    method public abstract java.util.stream.DoubleStream mapToDouble(java.util.function.ToDoubleFunction<? super T>);
    method public abstract java.util.stream.IntStream mapToInt(java.util.function.ToIntFunction<? super T>);
    method public abstract java.util.stream.LongStream mapToLong(java.util.function.ToLongFunction<? super T>);
    method public abstract java.util.Optional<T> max(java.util.Comparator<? super T>);
    method public abstract java.util.Optional<T> min(java.util.Comparator<? super T>);
    method public abstract boolean noneMatch(java.util.function.Predicate<? super T>);
    method public static <T> java.util.stream.Stream<T> of(T);
    method public static <T> java.util.stream.Stream<T> of(T...);
    method public abstract java.util.stream.Stream<T> peek(java.util.function.Consumer<? super T>);
    method public abstract T reduce(T, java.util.function.BinaryOperator<T>);
    method public abstract java.util.Optional<T> reduce(java.util.function.BinaryOperator<T>);
    method public abstract <U> U reduce(U, java.util.function.BiFunction<U, ? super T, U>, java.util.function.BinaryOperator<U>);
    method public abstract java.util.stream.Stream<T> skip(long);
    method public abstract java.util.stream.Stream<T> sorted();
    method public abstract java.util.stream.Stream<T> sorted(java.util.Comparator<? super T>);
    method public abstract java.lang.Object[] toArray();
    method public abstract <A> A[] toArray(java.util.function.IntFunction<A[]>);
  }

  public static abstract interface Stream.Builder<T> implements java.util.function.Consumer {
    method public default java.util.stream.Stream.Builder<T> add(T);
    method public abstract 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 abstract interface Checksum {
    method public abstract long getValue();
    method public abstract void reset();
    method public abstract void update(int);
    method public abstract void update(byte[], int, int);
  }

  public class DataFormatException extends java.lang.Exception {
    ctor public DataFormatException();
    ctor public DataFormatException(java.lang.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);
    method public void mark(int);
    method public void reset() throws java.io.IOException;
    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;
    method public synchronized void write(byte[], int, int) 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 protected deprecated 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(java.lang.String);
    ctor public ZipEntry(java.util.zip.ZipEntry);
    method public java.lang.Object clone();
    method public java.lang.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 java.lang.String getName();
    method public long getSize();
    method public long getTime();
    method public boolean isDirectory();
    method public void setComment(java.lang.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(java.lang.String);
  }

  public class ZipException extends java.io.IOException {
    ctor public ZipException();
    ctor public ZipException(java.lang.String);
  }

  public class ZipFile implements java.io.Closeable {
    ctor public ZipFile(java.lang.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(java.lang.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 java.lang.String getComment();
    method public java.util.zip.ZipEntry getEntry(java.lang.String);
    method public java.io.InputStream getInputStream(java.util.zip.ZipEntry) throws java.io.IOException;
    method public java.lang.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(java.lang.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(java.lang.String);
    method public void setLevel(int);
    method public void setMethod(int);
    method public synchronized void write(byte[], int, int) 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 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(java.lang.String);
  }

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

  public class Cipher {
    ctor protected Cipher(javax.crypto.CipherSpi, java.security.Provider, java.lang.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 java.lang.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(java.lang.String) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException;
    method public static final javax.crypto.Cipher getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException, java.security.NoSuchProviderException;
    method public static final javax.crypto.Cipher getInstance(java.lang.String, java.security.Provider) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException;
    method public static final int getMaxAllowedKeyLength(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static final java.security.spec.AlgorithmParameterSpec getMaxAllowedParameterSpec(java.lang.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[], java.lang.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(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method protected abstract void engineSetPadding(java.lang.String) throws javax.crypto.NoSuchPaddingException;
    method protected java.security.Key engineUnwrap(byte[], java.lang.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(java.lang.String, byte[]) throws java.security.NoSuchAlgorithmException;
    ctor public EncryptedPrivateKeyInfo(java.security.AlgorithmParameters, byte[]) throws java.security.NoSuchAlgorithmException;
    method public java.lang.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, java.lang.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, java.lang.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(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.crypto.ExemptionMechanism getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.crypto.ExemptionMechanism getInstance(java.lang.String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final java.lang.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(java.lang.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(java.lang.String);
  }

  public class KeyAgreement {
    ctor protected KeyAgreement(javax.crypto.KeyAgreementSpi, java.security.Provider, java.lang.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(java.lang.String) throws java.lang.IllegalStateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
    method public final java.lang.String getAlgorithm();
    method public static final javax.crypto.KeyAgreement getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.crypto.KeyAgreement getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.crypto.KeyAgreement getInstance(java.lang.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(java.lang.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, java.lang.String);
    method public final javax.crypto.SecretKey generateKey();
    method public final java.lang.String getAlgorithm();
    method public static final javax.crypto.KeyGenerator getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.crypto.KeyGenerator getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.crypto.KeyGenerator getInstance(java.lang.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, java.lang.String);
    method public final java.lang.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 java.lang.String getAlgorithm();
    method public static final javax.crypto.Mac getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.crypto.Mac getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.crypto.Mac getInstance(java.lang.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 java.lang.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(java.lang.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 java.lang.String getAlgorithm();
    method public final java.lang.Object getObject(java.security.Key) throws java.lang.ClassNotFoundException, java.io.IOException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
    method public final java.lang.Object getObject(javax.crypto.Cipher) throws javax.crypto.BadPaddingException, java.lang.ClassNotFoundException, java.io.IOException, javax.crypto.IllegalBlockSizeException;
    method public final java.lang.Object getObject(java.security.Key, java.lang.String) throws java.lang.ClassNotFoundException, java.io.IOException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    field protected byte[] encodedParams;
  }

  public abstract interface SecretKey implements javax.security.auth.Destroyable java.security.Key {
    field public static final long serialVersionUID = -4795878709595146952L; // 0xbd719db928b8f538L
  }

  public class SecretKeyFactory {
    ctor protected SecretKeyFactory(javax.crypto.SecretKeyFactorySpi, java.security.Provider, java.lang.String);
    method public final javax.crypto.SecretKey generateSecret(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
    method public final java.lang.String getAlgorithm();
    method public static final javax.crypto.SecretKeyFactory getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.crypto.SecretKeyFactory getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.crypto.SecretKeyFactory getInstance(java.lang.String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final java.security.spec.KeySpec getKeySpec(javax.crypto.SecretKey, java.lang.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, java.lang.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(java.lang.String);
  }

}

package javax.crypto.interfaces {

  public abstract interface DHKey {
    method public abstract javax.crypto.spec.DHParameterSpec getParams();
  }

  public abstract interface DHPrivateKey implements javax.crypto.interfaces.DHKey java.security.PrivateKey {
    method public abstract java.math.BigInteger getX();
    field public static final long serialVersionUID = 2211791113380396553L; // 0x1eb1dc4c8e677e09L
  }

  public abstract interface DHPublicKey implements javax.crypto.interfaces.DHKey java.security.PublicKey {
    method public abstract java.math.BigInteger getY();
    field public static final long serialVersionUID = -6628103563352519193L; // 0xa4043eed23df4de7L
  }

  public abstract interface PBEKey implements javax.crypto.SecretKey {
    method public abstract int getIterationCount();
    method public abstract char[] getPassword();
    method public abstract 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(java.lang.String, java.lang.String, java.security.spec.AlgorithmParameterSpec, javax.crypto.spec.PSource);
    method public java.lang.String getDigestAlgorithm();
    method public java.lang.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(java.lang.String);
    method public java.lang.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[], java.lang.String);
    ctor public SecretKeySpec(byte[], int, int, java.lang.String);
    method public java.lang.String getAlgorithm();
    method public byte[] getEncoded();
    method public java.lang.String getFormat();
  }

}

package javax.microedition.khronos.egl {

  public abstract interface EGL {
  }

  public abstract interface EGL10 implements javax.microedition.khronos.egl.EGL {
    method public abstract boolean eglChooseConfig(javax.microedition.khronos.egl.EGLDisplay, int[], javax.microedition.khronos.egl.EGLConfig[], int, int[]);
    method public abstract boolean eglCopyBuffers(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLSurface, java.lang.Object);
    method public abstract javax.microedition.khronos.egl.EGLContext eglCreateContext(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig, javax.microedition.khronos.egl.EGLContext, int[]);
    method public abstract javax.microedition.khronos.egl.EGLSurface eglCreatePbufferSurface(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig, int[]);
    method public abstract deprecated javax.microedition.khronos.egl.EGLSurface eglCreatePixmapSurface(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig, java.lang.Object, int[]);
    method public abstract javax.microedition.khronos.egl.EGLSurface eglCreateWindowSurface(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig, java.lang.Object, int[]);
    method public abstract boolean eglDestroyContext(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLContext);
    method public abstract boolean eglDestroySurface(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLSurface);
    method public abstract boolean eglGetConfigAttrib(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig, int, int[]);
    method public abstract boolean eglGetConfigs(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLConfig[], int, int[]);
    method public abstract javax.microedition.khronos.egl.EGLContext eglGetCurrentContext();
    method public abstract javax.microedition.khronos.egl.EGLDisplay eglGetCurrentDisplay();
    method public abstract javax.microedition.khronos.egl.EGLSurface eglGetCurrentSurface(int);
    method public abstract javax.microedition.khronos.egl.EGLDisplay eglGetDisplay(java.lang.Object);
    method public abstract int eglGetError();
    method public abstract boolean eglInitialize(javax.microedition.khronos.egl.EGLDisplay, int[]);
    method public abstract boolean eglMakeCurrent(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLSurface, javax.microedition.khronos.egl.EGLSurface, javax.microedition.khronos.egl.EGLContext);
    method public abstract boolean eglQueryContext(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLContext, int, int[]);
    method public abstract java.lang.String eglQueryString(javax.microedition.khronos.egl.EGLDisplay, int);
    method public abstract boolean eglQuerySurface(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLSurface, int, int[]);
    method public abstract boolean eglSwapBuffers(javax.microedition.khronos.egl.EGLDisplay, javax.microedition.khronos.egl.EGLSurface);
    method public abstract boolean eglTerminate(javax.microedition.khronos.egl.EGLDisplay);
    method public abstract boolean eglWaitGL();
    method public abstract boolean eglWaitNative(int, java.lang.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 java.lang.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 abstract interface EGL11 implements 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 abstract interface GL {
  }

  public abstract interface GL10 implements javax.microedition.khronos.opengles.GL {
    method public abstract void glActiveTexture(int);
    method public abstract void glAlphaFunc(int, float);
    method public abstract void glAlphaFuncx(int, int);
    method public abstract void glBindTexture(int, int);
    method public abstract void glBlendFunc(int, int);
    method public abstract void glClear(int);
    method public abstract void glClearColor(float, float, float, float);
    method public abstract void glClearColorx(int, int, int, int);
    method public abstract void glClearDepthf(float);
    method public abstract void glClearDepthx(int);
    method public abstract void glClearStencil(int);
    method public abstract void glClientActiveTexture(int);
    method public abstract void glColor4f(float, float, float, float);
    method public abstract void glColor4x(int, int, int, int);
    method public abstract void glColorMask(boolean, boolean, boolean, boolean);
    method public abstract void glColorPointer(int, int, int, java.nio.Buffer);
    method public abstract void glCompressedTexImage2D(int, int, int, int, int, int, int, java.nio.Buffer);
    method public abstract void glCompressedTexSubImage2D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public abstract void glCopyTexImage2D(int, int, int, int, int, int, int, int);
    method public abstract void glCopyTexSubImage2D(int, int, int, int, int, int, int, int);
    method public abstract void glCullFace(int);
    method public abstract void glDeleteTextures(int, int[], int);
    method public abstract void glDeleteTextures(int, java.nio.IntBuffer);
    method public abstract void glDepthFunc(int);
    method public abstract void glDepthMask(boolean);
    method public abstract void glDepthRangef(float, float);
    method public abstract void glDepthRangex(int, int);
    method public abstract void glDisable(int);
    method public abstract void glDisableClientState(int);
    method public abstract void glDrawArrays(int, int, int);
    method public abstract void glDrawElements(int, int, int, java.nio.Buffer);
    method public abstract void glEnable(int);
    method public abstract void glEnableClientState(int);
    method public abstract void glFinish();
    method public abstract void glFlush();
    method public abstract void glFogf(int, float);
    method public abstract void glFogfv(int, float[], int);
    method public abstract void glFogfv(int, java.nio.FloatBuffer);
    method public abstract void glFogx(int, int);
    method public abstract void glFogxv(int, int[], int);
    method public abstract void glFogxv(int, java.nio.IntBuffer);
    method public abstract void glFrontFace(int);
    method public abstract void glFrustumf(float, float, float, float, float, float);
    method public abstract void glFrustumx(int, int, int, int, int, int);
    method public abstract void glGenTextures(int, int[], int);
    method public abstract void glGenTextures(int, java.nio.IntBuffer);
    method public abstract int glGetError();
    method public abstract void glGetIntegerv(int, int[], int);
    method public abstract void glGetIntegerv(int, java.nio.IntBuffer);
    method public abstract java.lang.String glGetString(int);
    method public abstract void glHint(int, int);
    method public abstract void glLightModelf(int, float);
    method public abstract void glLightModelfv(int, float[], int);
    method public abstract void glLightModelfv(int, java.nio.FloatBuffer);
    method public abstract void glLightModelx(int, int);
    method public abstract void glLightModelxv(int, int[], int);
    method public abstract void glLightModelxv(int, java.nio.IntBuffer);
    method public abstract void glLightf(int, int, float);
    method public abstract void glLightfv(int, int, float[], int);
    method public abstract void glLightfv(int, int, java.nio.FloatBuffer);
    method public abstract void glLightx(int, int, int);
    method public abstract void glLightxv(int, int, int[], int);
    method public abstract void glLightxv(int, int, java.nio.IntBuffer);
    method public abstract void glLineWidth(float);
    method public abstract void glLineWidthx(int);
    method public abstract void glLoadIdentity();
    method public abstract void glLoadMatrixf(float[], int);
    method public abstract void glLoadMatrixf(java.nio.FloatBuffer);
    method public abstract void glLoadMatrixx(int[], int);
    method public abstract void glLoadMatrixx(java.nio.IntBuffer);
    method public abstract void glLogicOp(int);
    method public abstract void glMaterialf(int, int, float);
    method public abstract void glMaterialfv(int, int, float[], int);
    method public abstract void glMaterialfv(int, int, java.nio.FloatBuffer);
    method public abstract void glMaterialx(int, int, int);
    method public abstract void glMaterialxv(int, int, int[], int);
    method public abstract void glMaterialxv(int, int, java.nio.IntBuffer);
    method public abstract void glMatrixMode(int);
    method public abstract void glMultMatrixf(float[], int);
    method public abstract void glMultMatrixf(java.nio.FloatBuffer);
    method public abstract void glMultMatrixx(int[], int);
    method public abstract void glMultMatrixx(java.nio.IntBuffer);
    method public abstract void glMultiTexCoord4f(int, float, float, float, float);
    method public abstract void glMultiTexCoord4x(int, int, int, int, int);
    method public abstract void glNormal3f(float, float, float);
    method public abstract void glNormal3x(int, int, int);
    method public abstract void glNormalPointer(int, int, java.nio.Buffer);
    method public abstract void glOrthof(float, float, float, float, float, float);
    method public abstract void glOrthox(int, int, int, int, int, int);
    method public abstract void glPixelStorei(int, int);
    method public abstract void glPointSize(float);
    method public abstract void glPointSizex(int);
    method public abstract void glPolygonOffset(float, float);
    method public abstract void glPolygonOffsetx(int, int);
    method public abstract void glPopMatrix();
    method public abstract void glPushMatrix();
    method public abstract void glReadPixels(int, int, int, int, int, int, java.nio.Buffer);
    method public abstract void glRotatef(float, float, float, float);
    method public abstract void glRotatex(int, int, int, int);
    method public abstract void glSampleCoverage(float, boolean);
    method public abstract void glSampleCoveragex(int, boolean);
    method public abstract void glScalef(float, float, float);
    method public abstract void glScalex(int, int, int);
    method public abstract void glScissor(int, int, int, int);
    method public abstract void glShadeModel(int);
    method public abstract void glStencilFunc(int, int, int);
    method public abstract void glStencilMask(int);
    method public abstract void glStencilOp(int, int, int);
    method public abstract void glTexCoordPointer(int, int, int, java.nio.Buffer);
    method public abstract void glTexEnvf(int, int, float);
    method public abstract void glTexEnvfv(int, int, float[], int);
    method public abstract void glTexEnvfv(int, int, java.nio.FloatBuffer);
    method public abstract void glTexEnvx(int, int, int);
    method public abstract void glTexEnvxv(int, int, int[], int);
    method public abstract void glTexEnvxv(int, int, java.nio.IntBuffer);
    method public abstract void glTexImage2D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public abstract void glTexParameterf(int, int, float);
    method public abstract void glTexParameterx(int, int, int);
    method public abstract void glTexSubImage2D(int, int, int, int, int, int, int, int, java.nio.Buffer);
    method public abstract void glTranslatef(float, float, float);
    method public abstract void glTranslatex(int, int, int);
    method public abstract void glVertexPointer(int, int, int, java.nio.Buffer);
    method public abstract 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 abstract interface GL10Ext implements javax.microedition.khronos.opengles.GL {
    method public abstract int glQueryMatrixxOES(int[], int, int[], int);
    method public abstract int glQueryMatrixxOES(java.nio.IntBuffer, java.nio.IntBuffer);
  }

  public abstract interface GL11 implements javax.microedition.khronos.opengles.GL10 {
    method public abstract void glBindBuffer(int, int);
    method public abstract void glBufferData(int, int, java.nio.Buffer, int);
    method public abstract void glBufferSubData(int, int, int, java.nio.Buffer);
    method public abstract void glClipPlanef(int, float[], int);
    method public abstract void glClipPlanef(int, java.nio.FloatBuffer);
    method public abstract void glClipPlanex(int, int[], int);
    method public abstract void glClipPlanex(int, java.nio.IntBuffer);
    method public abstract void glColor4ub(byte, byte, byte, byte);
    method public abstract void glColorPointer(int, int, int, int);
    method public abstract void glDeleteBuffers(int, int[], int);
    method public abstract void glDeleteBuffers(int, java.nio.IntBuffer);
    method public abstract void glDrawElements(int, int, int, int);
    method public abstract void glGenBuffers(int, int[], int);
    method public abstract void glGenBuffers(int, java.nio.IntBuffer);
    method public abstract void glGetBooleanv(int, boolean[], int);
    method public abstract void glGetBooleanv(int, java.nio.IntBuffer);
    method public abstract void glGetBufferParameteriv(int, int, int[], int);
    method public abstract void glGetBufferParameteriv(int, int, java.nio.IntBuffer);
    method public abstract void glGetClipPlanef(int, float[], int);
    method public abstract void glGetClipPlanef(int, java.nio.FloatBuffer);
    method public abstract void glGetClipPlanex(int, int[], int);
    method public abstract void glGetClipPlanex(int, java.nio.IntBuffer);
    method public abstract void glGetFixedv(int, int[], int);
    method public abstract void glGetFixedv(int, java.nio.IntBuffer);
    method public abstract void glGetFloatv(int, float[], int);
    method public abstract void glGetFloatv(int, java.nio.FloatBuffer);
    method public abstract void glGetLightfv(int, int, float[], int);
    method public abstract void glGetLightfv(int, int, java.nio.FloatBuffer);
    method public abstract void glGetLightxv(int, int, int[], int);
    method public abstract void glGetLightxv(int, int, java.nio.IntBuffer);
    method public abstract void glGetMaterialfv(int, int, float[], int);
    method public abstract void glGetMaterialfv(int, int, java.nio.FloatBuffer);
    method public abstract void glGetMaterialxv(int, int, int[], int);
    method public abstract void glGetMaterialxv(int, int, java.nio.IntBuffer);
    method public abstract void glGetPointerv(int, java.nio.Buffer[]);
    method public abstract void glGetTexEnviv(int, int, int[], int);
    method public abstract void glGetTexEnviv(int, int, java.nio.IntBuffer);
    method public abstract void glGetTexEnvxv(int, int, int[], int);
    method public abstract void glGetTexEnvxv(int, int, java.nio.IntBuffer);
    method public abstract void glGetTexParameterfv(int, int, float[], int);
    method public abstract void glGetTexParameterfv(int, int, java.nio.FloatBuffer);
    method public abstract void glGetTexParameteriv(int, int, int[], int);
    method public abstract void glGetTexParameteriv(int, int, java.nio.IntBuffer);
    method public abstract void glGetTexParameterxv(int, int, int[], int);
    method public abstract void glGetTexParameterxv(int, int, java.nio.IntBuffer);
    method public abstract boolean glIsBuffer(int);
    method public abstract boolean glIsEnabled(int);
    method public abstract boolean glIsTexture(int);
    method public abstract void glNormalPointer(int, int, int);
    method public abstract void glPointParameterf(int, float);
    method public abstract void glPointParameterfv(int, float[], int);
    method public abstract void glPointParameterfv(int, java.nio.FloatBuffer);
    method public abstract void glPointParameterx(int, int);
    method public abstract void glPointParameterxv(int, int[], int);
    method public abstract void glPointParameterxv(int, java.nio.IntBuffer);
    method public abstract void glPointSizePointerOES(int, int, java.nio.Buffer);
    method public abstract void glTexCoordPointer(int, int, int, int);
    method public abstract void glTexEnvi(int, int, int);
    method public abstract void glTexEnviv(int, int, int[], int);
    method public abstract void glTexEnviv(int, int, java.nio.IntBuffer);
    method public abstract void glTexParameterfv(int, int, float[], int);
    method public abstract void glTexParameterfv(int, int, java.nio.FloatBuffer);
    method public abstract void glTexParameteri(int, int, int);
    method public abstract void glTexParameteriv(int, int, int[], int);
    method public abstract void glTexParameteriv(int, int, java.nio.IntBuffer);
    method public abstract void glTexParameterxv(int, int, int[], int);
    method public abstract void glTexParameterxv(int, int, java.nio.IntBuffer);
    method public abstract 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 abstract interface GL11Ext implements javax.microedition.khronos.opengles.GL {
    method public abstract void glCurrentPaletteMatrixOES(int);
    method public abstract void glDrawTexfOES(float, float, float, float, float);
    method public abstract void glDrawTexfvOES(float[], int);
    method public abstract void glDrawTexfvOES(java.nio.FloatBuffer);
    method public abstract void glDrawTexiOES(int, int, int, int, int);
    method public abstract void glDrawTexivOES(int[], int);
    method public abstract void glDrawTexivOES(java.nio.IntBuffer);
    method public abstract void glDrawTexsOES(short, short, short, short, short);
    method public abstract void glDrawTexsvOES(short[], int);
    method public abstract void glDrawTexsvOES(java.nio.ShortBuffer);
    method public abstract void glDrawTexxOES(int, int, int, int, int);
    method public abstract void glDrawTexxvOES(int[], int);
    method public abstract void glDrawTexxvOES(java.nio.IntBuffer);
    method public abstract void glEnable(int);
    method public abstract void glEnableClientState(int);
    method public abstract void glLoadPaletteFromModelViewMatrixOES();
    method public abstract void glMatrixIndexPointerOES(int, int, int, java.nio.Buffer);
    method public abstract void glMatrixIndexPointerOES(int, int, int, int);
    method public abstract void glTexParameterfv(int, int, float[], int);
    method public abstract void glWeightPointerOES(int, int, int, java.nio.Buffer);
    method public abstract 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 abstract interface GL11ExtensionPack implements javax.microedition.khronos.opengles.GL {
    method public abstract void glBindFramebufferOES(int, int);
    method public abstract void glBindRenderbufferOES(int, int);
    method public abstract void glBindTexture(int, int);
    method public abstract void glBlendEquation(int);
    method public abstract void glBlendEquationSeparate(int, int);
    method public abstract void glBlendFuncSeparate(int, int, int, int);
    method public abstract int glCheckFramebufferStatusOES(int);
    method public abstract void glCompressedTexImage2D(int, int, int, int, int, int, int, java.nio.Buffer);
    method public abstract void glCopyTexImage2D(int, int, int, int, int, int, int, int);
    method public abstract void glDeleteFramebuffersOES(int, int[], int);
    method public abstract void glDeleteFramebuffersOES(int, java.nio.IntBuffer);
    method public abstract void glDeleteRenderbuffersOES(int, int[], int);
    method public abstract void glDeleteRenderbuffersOES(int, java.nio.IntBuffer);
    method public abstract void glEnable(int);
    method public abstract void glFramebufferRenderbufferOES(int, int, int, int);
    method public abstract void glFramebufferTexture2DOES(int, int, int, int, int);
    method public abstract void glGenFramebuffersOES(int, int[], int);
    method public abstract void glGenFramebuffersOES(int, java.nio.IntBuffer);
    method public abstract void glGenRenderbuffersOES(int, int[], int);
    method public abstract void glGenRenderbuffersOES(int, java.nio.IntBuffer);
    method public abstract void glGenerateMipmapOES(int);
    method public abstract void glGetFramebufferAttachmentParameterivOES(int, int, int, int[], int);
    method public abstract void glGetFramebufferAttachmentParameterivOES(int, int, int, java.nio.IntBuffer);
    method public abstract void glGetIntegerv(int, int[], int);
    method public abstract void glGetIntegerv(int, java.nio.IntBuffer);
    method public abstract void glGetRenderbufferParameterivOES(int, int, int[], int);
    method public abstract void glGetRenderbufferParameterivOES(int, int, java.nio.IntBuffer);
    method public abstract void glGetTexGenfv(int, int, float[], int);
    method public abstract void glGetTexGenfv(int, int, java.nio.FloatBuffer);
    method public abstract void glGetTexGeniv(int, int, int[], int);
    method public abstract void glGetTexGeniv(int, int, java.nio.IntBuffer);
    method public abstract void glGetTexGenxv(int, int, int[], int);
    method public abstract void glGetTexGenxv(int, int, java.nio.IntBuffer);
    method public abstract boolean glIsFramebufferOES(int);
    method public abstract boolean glIsRenderbufferOES(int);
    method public abstract void glRenderbufferStorageOES(int, int, int, int);
    method public abstract void glStencilOp(int, int, int);
    method public abstract void glTexEnvf(int, int, float);
    method public abstract void glTexEnvfv(int, int, float[], int);
    method public abstract void glTexEnvfv(int, int, java.nio.FloatBuffer);
    method public abstract void glTexEnvx(int, int, int);
    method public abstract void glTexEnvxv(int, int, int[], int);
    method public abstract void glTexEnvxv(int, int, java.nio.IntBuffer);
    method public abstract void glTexGenf(int, int, float);
    method public abstract void glTexGenfv(int, int, float[], int);
    method public abstract void glTexGenfv(int, int, java.nio.FloatBuffer);
    method public abstract void glTexGeni(int, int, int);
    method public abstract void glTexGeniv(int, int, int[], int);
    method public abstract void glTexGeniv(int, int, java.nio.IntBuffer);
    method public abstract void glTexGenx(int, int, int);
    method public abstract void glTexGenxv(int, int, int[], int);
    method public abstract void glTexGenxv(int, int, java.nio.IntBuffer);
    method public abstract 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(java.lang.String, int) throws java.io.IOException, java.net.UnknownHostException;
    method public abstract java.net.Socket createSocket(java.lang.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 java.lang.String[] getLocalSupportedSignatureAlgorithms();
    method public abstract java.lang.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 java.lang.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 abstract interface HandshakeCompletedListener implements java.util.EventListener {
    method public abstract void handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent);
  }

  public abstract interface HostnameVerifier {
    method public abstract boolean verify(java.lang.String, javax.net.ssl.SSLSession);
  }

  public abstract class HttpsURLConnection extends java.net.HttpURLConnection {
    ctor protected HttpsURLConnection(java.net.URL);
    method public abstract java.lang.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 abstract interface KeyManager {
  }

  public class KeyManagerFactory {
    ctor protected KeyManagerFactory(javax.net.ssl.KeyManagerFactorySpi, java.security.Provider, java.lang.String);
    method public final java.lang.String getAlgorithm();
    method public static final java.lang.String getDefaultAlgorithm();
    method public static final javax.net.ssl.KeyManagerFactory getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.net.ssl.KeyManagerFactory getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.net.ssl.KeyManagerFactory getInstance(java.lang.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 abstract interface ManagerFactoryParameters {
  }

  public final class SNIHostName extends javax.net.ssl.SNIServerName {
    ctor public SNIHostName(java.lang.String);
    ctor public SNIHostName(byte[]);
    method public static javax.net.ssl.SNIMatcher createSNIMatcher(java.lang.String);
    method public java.lang.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, java.lang.String);
    method public final javax.net.ssl.SSLEngine createSSLEngine();
    method public final javax.net.ssl.SSLEngine createSSLEngine(java.lang.String, int);
    method public final javax.net.ssl.SSLSessionContext getClientSessionContext();
    method public static synchronized 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(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static javax.net.ssl.SSLContext getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static javax.net.ssl.SSLContext getInstance(java.lang.String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
    method public final java.lang.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 synchronized 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(java.lang.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(java.lang.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 abstract java.lang.Runnable getDelegatedTask();
    method public abstract boolean getEnableSessionCreation();
    method public abstract java.lang.String[] getEnabledCipherSuites();
    method public abstract java.lang.String[] getEnabledProtocols();
    method public javax.net.ssl.SSLSession getHandshakeSession();
    method public abstract javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus();
    method public abstract boolean getNeedClientAuth();
    method public java.lang.String getPeerHost();
    method public int getPeerPort();
    method public javax.net.ssl.SSLParameters getSSLParameters();
    method public abstract javax.net.ssl.SSLSession getSession();
    method public abstract java.lang.String[] getSupportedCipherSuites();
    method public abstract java.lang.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(java.lang.String[]);
    method public abstract void setEnabledProtocols(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 static final class SSLEngineResult.HandshakeStatus extends java.lang.Enum {
    method public static javax.net.ssl.SSLEngineResult.HandshakeStatus valueOf(java.lang.String);
    method public static final javax.net.ssl.SSLEngineResult.HandshakeStatus[] values();
    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 static final class SSLEngineResult.Status extends java.lang.Enum {
    method public static javax.net.ssl.SSLEngineResult.Status valueOf(java.lang.String);
    method public static final javax.net.ssl.SSLEngineResult.Status[] values();
    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(java.lang.String);
    ctor public SSLException(java.lang.String, java.lang.Throwable);
    ctor public SSLException(java.lang.Throwable);
  }

  public class SSLHandshakeException extends javax.net.ssl.SSLException {
    ctor public SSLHandshakeException(java.lang.String);
  }

  public class SSLKeyException extends javax.net.ssl.SSLException {
    ctor public SSLKeyException(java.lang.String);
  }

  public class SSLParameters {
    ctor public SSLParameters();
    ctor public SSLParameters(java.lang.String[]);
    ctor public SSLParameters(java.lang.String[], java.lang.String[]);
    method public java.security.AlgorithmConstraints getAlgorithmConstraints();
    method public java.lang.String[] getCipherSuites();
    method public java.lang.String getEndpointIdentificationAlgorithm();
    method public boolean getNeedClientAuth();
    method public java.lang.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 setCipherSuites(java.lang.String[]);
    method public void setEndpointIdentificationAlgorithm(java.lang.String);
    method public void setNeedClientAuth(boolean);
    method public void setProtocols(java.lang.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(java.lang.String);
  }

  public final class SSLPermission extends java.security.BasicPermission {
    ctor public SSLPermission(java.lang.String);
    ctor public SSLPermission(java.lang.String, java.lang.String);
  }

  public class SSLProtocolException extends javax.net.ssl.SSLException {
    ctor public SSLProtocolException(java.lang.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 java.lang.String[] getEnabledCipherSuites();
    method public abstract java.lang.String[] getEnabledProtocols();
    method public abstract boolean getNeedClientAuth();
    method public javax.net.ssl.SSLParameters getSSLParameters();
    method public abstract java.lang.String[] getSupportedCipherSuites();
    method public abstract java.lang.String[] getSupportedProtocols();
    method public abstract boolean getUseClientMode();
    method public abstract boolean getWantClientAuth();
    method public abstract void setEnableSessionCreation(boolean);
    method public abstract void setEnabledCipherSuites(java.lang.String[]);
    method public abstract void setEnabledProtocols(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);
  }

  public abstract class SSLServerSocketFactory extends javax.net.ServerSocketFactory {
    ctor protected SSLServerSocketFactory();
    method public static synchronized javax.net.ServerSocketFactory getDefault();
    method public abstract java.lang.String[] getDefaultCipherSuites();
    method public abstract java.lang.String[] getSupportedCipherSuites();
  }

  public abstract interface SSLSession {
    method public abstract int getApplicationBufferSize();
    method public abstract java.lang.String getCipherSuite();
    method public abstract long getCreationTime();
    method public abstract byte[] getId();
    method public abstract long getLastAccessedTime();
    method public abstract java.security.cert.Certificate[] getLocalCertificates();
    method public abstract java.security.Principal getLocalPrincipal();
    method public abstract int getPacketBufferSize();
    method public abstract javax.security.cert.X509Certificate[] getPeerCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedException;
    method public abstract java.security.cert.Certificate[] getPeerCertificates() throws javax.net.ssl.SSLPeerUnverifiedException;
    method public abstract java.lang.String getPeerHost();
    method public abstract int getPeerPort();
    method public abstract java.security.Principal getPeerPrincipal() throws javax.net.ssl.SSLPeerUnverifiedException;
    method public abstract java.lang.String getProtocol();
    method public abstract javax.net.ssl.SSLSessionContext getSessionContext();
    method public abstract java.lang.Object getValue(java.lang.String);
    method public abstract java.lang.String[] getValueNames();
    method public abstract void invalidate();
    method public abstract boolean isValid();
    method public abstract void putValue(java.lang.String, java.lang.Object);
    method public abstract void removeValue(java.lang.String);
  }

  public class SSLSessionBindingEvent extends java.util.EventObject {
    ctor public SSLSessionBindingEvent(javax.net.ssl.SSLSession, java.lang.String);
    method public java.lang.String getName();
    method public javax.net.ssl.SSLSession getSession();
  }

  public abstract interface SSLSessionBindingListener implements java.util.EventListener {
    method public abstract void valueBound(javax.net.ssl.SSLSessionBindingEvent);
    method public abstract void valueUnbound(javax.net.ssl.SSLSessionBindingEvent);
  }

  public abstract interface SSLSessionContext {
    method public abstract java.util.Enumeration<byte[]> getIds();
    method public abstract javax.net.ssl.SSLSession getSession(byte[]);
    method public abstract int getSessionCacheSize();
    method public abstract int getSessionTimeout();
    method public abstract void setSessionCacheSize(int) throws java.lang.IllegalArgumentException;
    method public abstract void setSessionTimeout(int) throws java.lang.IllegalArgumentException;
  }

  public abstract class SSLSocket extends java.net.Socket {
    ctor protected SSLSocket();
    ctor protected SSLSocket(java.lang.String, int) throws java.io.IOException, java.net.UnknownHostException;
    ctor protected SSLSocket(java.net.InetAddress, int) throws java.io.IOException;
    ctor protected SSLSocket(java.lang.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 abstract boolean getEnableSessionCreation();
    method public abstract java.lang.String[] getEnabledCipherSuites();
    method public abstract java.lang.String[] getEnabledProtocols();
    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 java.lang.String[] getSupportedCipherSuites();
    method public abstract java.lang.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(java.lang.String[]);
    method public abstract void setEnabledProtocols(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, java.lang.String, int, boolean) throws java.io.IOException;
    method public static synchronized javax.net.SocketFactory getDefault();
    method public abstract java.lang.String[] getDefaultCipherSuites();
    method public abstract java.lang.String[] getSupportedCipherSuites();
  }

  public final class StandardConstants {
    field public static final int SNI_HOST_NAME = 0; // 0x0
  }

  public abstract interface TrustManager {
  }

  public class TrustManagerFactory {
    ctor protected TrustManagerFactory(javax.net.ssl.TrustManagerFactorySpi, java.security.Provider, java.lang.String);
    method public final java.lang.String getAlgorithm();
    method public static final java.lang.String getDefaultAlgorithm();
    method public static final javax.net.ssl.TrustManagerFactory getInstance(java.lang.String) throws java.security.NoSuchAlgorithmException;
    method public static final javax.net.ssl.TrustManagerFactory getInstance(java.lang.String, java.lang.String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
    method public static final javax.net.ssl.TrustManagerFactory getInstance(java.lang.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 java.lang.String chooseEngineClientAlias(java.lang.String[], java.security.Principal[], javax.net.ssl.SSLEngine);
    method public java.lang.String chooseEngineServerAlias(java.lang.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[], java.lang.String, java.net.Socket) throws java.security.cert.CertificateException;
    method public abstract void checkClientTrusted(java.security.cert.X509Certificate[], java.lang.String, javax.net.ssl.SSLEngine) throws java.security.cert.CertificateException;
    method public abstract void checkServerTrusted(java.security.cert.X509Certificate[], java.lang.String, java.net.Socket) throws java.security.cert.CertificateException;
    method public abstract void checkServerTrusted(java.security.cert.X509Certificate[], java.lang.String, javax.net.ssl.SSLEngine) throws java.security.cert.CertificateException;
  }

  public abstract interface X509KeyManager implements javax.net.ssl.KeyManager {
    method public abstract java.lang.String chooseClientAlias(java.lang.String[], java.security.Principal[], java.net.Socket);
    method public abstract java.lang.String chooseServerAlias(java.lang.String, java.security.Principal[], java.net.Socket);
    method public abstract java.security.cert.X509Certificate[] getCertificateChain(java.lang.String);
    method public abstract java.lang.String[] getClientAliases(java.lang.String, java.security.Principal[]);
    method public abstract java.security.PrivateKey getPrivateKey(java.lang.String);
    method public abstract java.lang.String[] getServerAliases(java.lang.String, java.security.Principal[]);
  }

  public abstract interface X509TrustManager implements javax.net.ssl.TrustManager {
    method public abstract void checkClientTrusted(java.security.cert.X509Certificate[], java.lang.String) throws java.security.cert.CertificateException;
    method public abstract void checkServerTrusted(java.security.cert.X509Certificate[], java.lang.String) throws java.security.cert.CertificateException;
    method public abstract java.security.cert.X509Certificate[] getAcceptedIssuers();
  }

}

package javax.security.auth {

  public final class AuthPermission extends java.security.BasicPermission {
    ctor public AuthPermission(java.lang.String);
    ctor public AuthPermission(java.lang.String, java.lang.String);
  }

  public class DestroyFailedException extends java.lang.Exception {
    ctor public DestroyFailedException();
    ctor public DestroyFailedException(java.lang.String);
  }

  public abstract 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(java.lang.String, java.lang.String);
    method public java.lang.String getActions();
    method public java.lang.String getCredentialClass();
    method public java.lang.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(java.lang.Class<T>);
    method public java.util.Set<java.lang.Object> getPrivateCredentials();
    method public <T> java.util.Set<T> getPrivateCredentials(java.lang.Class<T>);
    method public java.util.Set<java.lang.Object> getPublicCredentials();
    method public <T> java.util.Set<T> getPublicCredentials(java.lang.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 abstract interface Callback {
  }

  public abstract interface CallbackHandler {
    method public abstract 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(java.lang.String, boolean);
    method public void clearPassword();
    method public char[] getPassword();
    method public java.lang.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, java.lang.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(java.lang.String);
  }

}

package javax.security.auth.x500 {

  public final class X500Principal implements java.security.Principal java.io.Serializable {
    ctor public X500Principal(java.lang.String);
    ctor public X500Principal(java.lang.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 java.lang.String getName();
    method public java.lang.String getName(java.lang.String);
    method public java.lang.String getName(java.lang.String, java.util.Map<java.lang.String, java.lang.String>);
    field public static final java.lang.String CANONICAL = "CANONICAL";
    field public static final java.lang.String RFC1779 = "RFC1779";
    field public static final java.lang.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 java.lang.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, java.lang.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(java.lang.String);
  }

  public class CertificateException extends java.lang.Exception {
    ctor public CertificateException();
    ctor public CertificateException(java.lang.String);
  }

  public class CertificateExpiredException extends javax.security.cert.CertificateException {
    ctor public CertificateExpiredException();
    ctor public CertificateExpiredException(java.lang.String);
  }

  public class CertificateNotYetValidException extends javax.security.cert.CertificateException {
    ctor public CertificateNotYetValidException();
    ctor public CertificateNotYetValidException(java.lang.String);
  }

  public class CertificateParsingException extends javax.security.cert.CertificateException {
    ctor public CertificateParsingException();
    ctor public CertificateParsingException(java.lang.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 java.lang.String getSigAlgName();
    method public abstract java.lang.String getSigAlgOID();
    method public abstract byte[] getSigAlgParams();
    method public abstract java.security.Principal getSubjectDN();
    method public abstract int getVersion();
  }

}

package javax.sql {

  public abstract interface CommonDataSource {
    method public abstract java.io.PrintWriter getLogWriter() throws java.sql.SQLException;
    method public abstract int getLoginTimeout() throws java.sql.SQLException;
    method public abstract java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException;
    method public abstract void setLogWriter(java.io.PrintWriter) throws java.sql.SQLException;
    method public abstract 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 abstract interface ConnectionEventListener implements java.util.EventListener {
    method public abstract void connectionClosed(javax.sql.ConnectionEvent);
    method public abstract void connectionErrorOccurred(javax.sql.ConnectionEvent);
  }

  public abstract interface ConnectionPoolDataSource implements javax.sql.CommonDataSource {
    method public abstract javax.sql.PooledConnection getPooledConnection() throws java.sql.SQLException;
    method public abstract javax.sql.PooledConnection getPooledConnection(java.lang.String, java.lang.String) throws java.sql.SQLException;
  }

  public abstract interface DataSource implements javax.sql.CommonDataSource java.sql.Wrapper {
    method public abstract java.sql.Connection getConnection() throws java.sql.SQLException;
    method public abstract java.sql.Connection getConnection(java.lang.String, java.lang.String) throws java.sql.SQLException;
  }

  public abstract interface PooledConnection {
    method public abstract void addConnectionEventListener(javax.sql.ConnectionEventListener);
    method public abstract void addStatementEventListener(javax.sql.StatementEventListener);
    method public abstract void close() throws java.sql.SQLException;
    method public abstract java.sql.Connection getConnection() throws java.sql.SQLException;
    method public abstract void removeConnectionEventListener(javax.sql.ConnectionEventListener);
    method public abstract void removeStatementEventListener(javax.sql.StatementEventListener);
  }

  public abstract interface RowSet implements java.sql.ResultSet {
    method public abstract void addRowSetListener(javax.sql.RowSetListener);
    method public abstract void clearParameters() throws java.sql.SQLException;
    method public abstract void execute() throws java.sql.SQLException;
    method public abstract java.lang.String getCommand();
    method public abstract java.lang.String getDataSourceName();
    method public abstract boolean getEscapeProcessing() throws java.sql.SQLException;
    method public abstract int getMaxFieldSize() throws java.sql.SQLException;
    method public abstract int getMaxRows() throws java.sql.SQLException;
    method public abstract java.lang.String getPassword();
    method public abstract int getQueryTimeout() throws java.sql.SQLException;
    method public abstract int getTransactionIsolation();
    method public abstract java.util.Map<java.lang.String, java.lang.Class<?>> getTypeMap() throws java.sql.SQLException;
    method public abstract java.lang.String getUrl() throws java.sql.SQLException;
    method public abstract java.lang.String getUsername();
    method public abstract boolean isReadOnly();
    method public abstract void removeRowSetListener(javax.sql.RowSetListener);
    method public abstract void setArray(int, java.sql.Array) throws java.sql.SQLException;
    method public abstract void setAsciiStream(int, java.io.InputStream, int) throws java.sql.SQLException;
    method public abstract void setAsciiStream(java.lang.String, java.io.InputStream, int) throws java.sql.SQLException;
    method public abstract void setAsciiStream(int, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void setAsciiStream(java.lang.String, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void setBigDecimal(int, java.math.BigDecimal) throws java.sql.SQLException;
    method public abstract void setBigDecimal(java.lang.String, java.math.BigDecimal) throws java.sql.SQLException;
    method public abstract void setBinaryStream(int, java.io.InputStream, int) throws java.sql.SQLException;
    method public abstract void setBinaryStream(java.lang.String, java.io.InputStream, int) throws java.sql.SQLException;
    method public abstract void setBinaryStream(int, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void setBinaryStream(java.lang.String, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void setBlob(int, java.sql.Blob) throws java.sql.SQLException;
    method public abstract void setBlob(int, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void setBlob(int, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void setBlob(java.lang.String, java.io.InputStream, long) throws java.sql.SQLException;
    method public abstract void setBlob(java.lang.String, java.sql.Blob) throws java.sql.SQLException;
    method public abstract void setBlob(java.lang.String, java.io.InputStream) throws java.sql.SQLException;
    method public abstract void setBoolean(int, boolean) throws java.sql.SQLException;
    method public abstract void setBoolean(java.lang.String, boolean) throws java.sql.SQLException;
    method public abstract void setByte(int, byte) throws java.sql.SQLException;
    method public abstract void setByte(java.lang.String, byte) throws java.sql.SQLException;
    method public abstract void setBytes(int, byte[]) throws java.sql.SQLException;
    method public abstract void setBytes(java.lang.String, byte[]) throws java.sql.SQLException;
    method public abstract void setCharacterStream(int, java.io.Reader, int) throws java.sql.SQLException;
    method public abstract void setCharacterStream(java.lang.String, java.io.Reader, int) throws java.sql.SQLException;
    method public abstract void setCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setCharacterStream(java.lang.String, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setClob(int, java.sql.Clob) throws java.sql.SQLException;
    method public abstract void setClob(int, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setClob(int, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setClob(java.lang.String, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setClob(java.lang.String, java.sql.Clob) throws java.sql.SQLException;
    method public abstract void setClob(java.lang.String, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setCommand(java.lang.String) throws java.sql.SQLException;
    method public abstract void setConcurrency(int) throws java.sql.SQLException;
    method public abstract void setDataSourceName(java.lang.String) throws java.sql.SQLException;
    method public abstract void setDate(int, java.sql.Date) throws java.sql.SQLException;
    method public abstract void setDate(int, java.sql.Date, java.util.Calendar) throws java.sql.SQLException;
    method public abstract void setDate(java.lang.String, java.sql.Date) throws java.sql.SQLException;
    method public abstract void setDate(java.lang.String, java.sql.Date, java.util.Calendar) throws java.sql.SQLException;
    method public abstract void setDouble(int, double) throws java.sql.SQLException;
    method public abstract void setDouble(java.lang.String, double) throws java.sql.SQLException;
    method public abstract void setEscapeProcessing(boolean) throws java.sql.SQLException;
    method public abstract void setFloat(int, float) throws java.sql.SQLException;
    method public abstract void setFloat(java.lang.String, float) throws java.sql.SQLException;
    method public abstract void setInt(int, int) throws java.sql.SQLException;
    method public abstract void setInt(java.lang.String, int) throws java.sql.SQLException;
    method public abstract void setLong(int, long) throws java.sql.SQLException;
    method public abstract void setLong(java.lang.String, long) throws java.sql.SQLException;
    method public abstract void setMaxFieldSize(int) throws java.sql.SQLException;
    method public abstract void setMaxRows(int) throws java.sql.SQLException;
    method public abstract void setNCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setNCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setNCharacterStream(java.lang.String, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setNCharacterStream(java.lang.String, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setNClob(java.lang.String, java.sql.NClob) throws java.sql.SQLException;
    method public abstract void setNClob(java.lang.String, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setNClob(java.lang.String, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setNClob(int, java.io.Reader, long) throws java.sql.SQLException;
    method public abstract void setNClob(int, java.sql.NClob) throws java.sql.SQLException;
    method public abstract void setNClob(int, java.io.Reader) throws java.sql.SQLException;
    method public abstract void setNString(int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setNString(java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract void setNull(int, int) throws java.sql.SQLException;
    method public abstract void setNull(java.lang.String, int) throws java.sql.SQLException;
    method public abstract void setNull(int, int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setNull(java.lang.String, int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setObject(int, java.lang.Object, int, int) throws java.sql.SQLException;
    method public abstract void setObject(java.lang.String, java.lang.Object, int, int) throws java.sql.SQLException;
    method public abstract void setObject(int, java.lang.Object, int) throws java.sql.SQLException;
    method public abstract void setObject(java.lang.String, java.lang.Object, int) throws java.sql.SQLException;
    method public abstract void setObject(java.lang.String, java.lang.Object) throws java.sql.SQLException;
    method public abstract void setObject(int, java.lang.Object) throws java.sql.SQLException;
    method public abstract void setPassword(java.lang.String) throws java.sql.SQLException;
    method public abstract void setQueryTimeout(int) throws java.sql.SQLException;
    method public abstract void setReadOnly(boolean) throws java.sql.SQLException;
    method public abstract void setRef(int, java.sql.Ref) throws java.sql.SQLException;
    method public abstract void setRowId(int, java.sql.RowId) throws java.sql.SQLException;
    method public abstract void setRowId(java.lang.String, java.sql.RowId) throws java.sql.SQLException;
    method public abstract void setSQLXML(int, java.sql.SQLXML) throws java.sql.SQLException;
    method public abstract void setSQLXML(java.lang.String, java.sql.SQLXML) throws java.sql.SQLException;
    method public abstract void setShort(int, short) throws java.sql.SQLException;
    method public abstract void setShort(java.lang.String, short) throws java.sql.SQLException;
    method public abstract void setString(int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setString(java.lang.String, java.lang.String) throws java.sql.SQLException;
    method public abstract void setTime(int, java.sql.Time) throws java.sql.SQLException;
    method public abstract void setTime(int, java.sql.Time, java.util.Calendar) throws java.sql.SQLException;
    method public abstract void setTime(java.lang.String, java.sql.Time) throws java.sql.SQLException;
    method public abstract void setTime(java.lang.String, java.sql.Time, java.util.Calendar) throws java.sql.SQLException;
    method public abstract void setTimestamp(int, java.sql.Timestamp) throws java.sql.SQLException;
    method public abstract void setTimestamp(java.lang.String, java.sql.Timestamp) throws java.sql.SQLException;
    method public abstract void setTimestamp(int, java.sql.Timestamp, java.util.Calendar) throws java.sql.SQLException;
    method public abstract void setTimestamp(java.lang.String, java.sql.Timestamp, java.util.Calendar) throws java.sql.SQLException;
    method public abstract void setTransactionIsolation(int) throws java.sql.SQLException;
    method public abstract void setType(int) throws java.sql.SQLException;
    method public abstract void setTypeMap(java.util.Map<java.lang.String, java.lang.Class<?>>) throws java.sql.SQLException;
    method public abstract void setURL(int, java.net.URL) throws java.sql.SQLException;
    method public abstract void setUrl(java.lang.String) throws java.sql.SQLException;
    method public abstract void setUsername(java.lang.String) throws java.sql.SQLException;
  }

  public class RowSetEvent extends java.util.EventObject {
    ctor public RowSetEvent(javax.sql.RowSet);
  }

  public abstract interface RowSetInternal {
    method public abstract java.sql.Connection getConnection() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getOriginal() throws java.sql.SQLException;
    method public abstract java.sql.ResultSet getOriginalRow() throws java.sql.SQLException;
    method public abstract java.lang.Object[] getParams() throws java.sql.SQLException;
    method public abstract void setMetaData(javax.sql.RowSetMetaData) throws java.sql.SQLException;
  }

  public abstract interface RowSetListener implements java.util.EventListener {
    method public abstract void cursorMoved(javax.sql.RowSetEvent);
    method public abstract void rowChanged(javax.sql.RowSetEvent);
    method public abstract void rowSetChanged(javax.sql.RowSetEvent);
  }

  public abstract interface RowSetMetaData implements java.sql.ResultSetMetaData {
    method public abstract void setAutoIncrement(int, boolean) throws java.sql.SQLException;
    method public abstract void setCaseSensitive(int, boolean) throws java.sql.SQLException;
    method public abstract void setCatalogName(int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setColumnCount(int) throws java.sql.SQLException;
    method public abstract void setColumnDisplaySize(int, int) throws java.sql.SQLException;
    method public abstract void setColumnLabel(int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setColumnName(int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setColumnType(int, int) throws java.sql.SQLException;
    method public abstract void setColumnTypeName(int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setCurrency(int, boolean) throws java.sql.SQLException;
    method public abstract void setNullable(int, int) throws java.sql.SQLException;
    method public abstract void setPrecision(int, int) throws java.sql.SQLException;
    method public abstract void setScale(int, int) throws java.sql.SQLException;
    method public abstract void setSchemaName(int, java.lang.String) throws java.sql.SQLException;
    method public abstract void setSearchable(int, boolean) throws java.sql.SQLException;
    method public abstract void setSigned(int, boolean) throws java.sql.SQLException;
    method public abstract void setTableName(int, java.lang.String) throws java.sql.SQLException;
  }

  public abstract interface RowSetReader {
    method public abstract void readData(javax.sql.RowSetInternal) throws java.sql.SQLException;
  }

  public abstract interface RowSetWriter {
    method public abstract 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 abstract interface StatementEventListener implements java.util.EventListener {
    method public abstract void statementClosed(javax.sql.StatementEvent);
    method public abstract void statementErrorOccurred(javax.sql.StatementEvent);
  }

}

package javax.xml {

  public final class XMLConstants {
    field public static final java.lang.String DEFAULT_NS_PREFIX = "";
    field public static final java.lang.String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing";
    field public static final java.lang.String NULL_NS_URI = "";
    field public static final java.lang.String RELAXNG_NS_URI = "http://relaxng.org/ns/structure/1.0";
    field public static final java.lang.String W3C_XML_SCHEMA_INSTANCE_NS_URI = "http://www.w3.org/2001/XMLSchema-instance";
    field public static final java.lang.String W3C_XML_SCHEMA_NS_URI = "http://www.w3.org/2001/XMLSchema";
    field public static final java.lang.String W3C_XPATH_DATATYPE_NS_URI = "http://www.w3.org/2003/11/xpath-datatypes";
    field public static final java.lang.String XMLNS_ATTRIBUTE = "xmlns";
    field public static final java.lang.String XMLNS_ATTRIBUTE_NS_URI = "http://www.w3.org/2000/xmlns/";
    field public static final java.lang.String XML_DTD_NS_URI = "http://www.w3.org/TR/REC-xml";
    field public static final java.lang.String XML_NS_PREFIX = "xml";
    field public static final java.lang.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(java.lang.String);
    ctor public DatatypeConfigurationException(java.lang.String, java.lang.Throwable);
    ctor public DatatypeConfigurationException(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String, java.lang.ClassLoader) throws javax.xml.datatype.DatatypeConfigurationException;
    method public abstract javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar();
    method public abstract javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(java.lang.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 java.lang.String DATATYPEFACTORY_IMPLEMENTATION_CLASS;
    field public static final java.lang.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 java.lang.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 java.lang.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 java.lang.String toXMLFormat();
  }

}

package javax.xml.namespace {

  public abstract interface NamespaceContext {
    method public abstract java.lang.String getNamespaceURI(java.lang.String);
    method public abstract java.lang.String getPrefix(java.lang.String);
    method public abstract java.util.Iterator getPrefixes(java.lang.String);
  }

  public class QName implements java.io.Serializable {
    ctor public QName(java.lang.String, java.lang.String);
    ctor public QName(java.lang.String, java.lang.String, java.lang.String);
    ctor public QName(java.lang.String);
    method public final boolean equals(java.lang.Object);
    method public java.lang.String getLocalPart();
    method public java.lang.String getNamespaceURI();
    method public java.lang.String getPrefix();
    method public final int hashCode();
    method public static javax.xml.namespace.QName valueOf(java.lang.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, java.lang.String) throws java.io.IOException, org.xml.sax.SAXException;
    method public org.w3c.dom.Document parse(java.lang.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 java.lang.Object getAttribute(java.lang.String) throws java.lang.IllegalArgumentException;
    method public abstract boolean getFeature(java.lang.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(java.lang.String, java.lang.ClassLoader);
    method public abstract void setAttribute(java.lang.String, java.lang.Object) throws java.lang.IllegalArgumentException;
    method public void setCoalescing(boolean);
    method public void setExpandEntityReferences(boolean);
    method public abstract void setFeature(java.lang.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(java.lang.String);
    ctor public FactoryConfigurationError(java.lang.Exception);
    ctor public FactoryConfigurationError(java.lang.Exception, java.lang.String);
    method public java.lang.Exception getException();
  }

  public class ParserConfigurationException extends java.lang.Exception {
    ctor public ParserConfigurationException();
    ctor public ParserConfigurationException(java.lang.String);
  }

  public abstract class SAXParser {
    ctor protected SAXParser();
    method public abstract org.xml.sax.Parser getParser() throws org.xml.sax.SAXException;
    method public abstract java.lang.Object getProperty(java.lang.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, java.lang.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, java.lang.String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(java.lang.String, org.xml.sax.HandlerBase) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(java.lang.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(java.lang.String, java.lang.Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
  }

  public abstract class SAXParserFactory {
    ctor protected SAXParserFactory();
    method public abstract boolean getFeature(java.lang.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(java.lang.String, java.lang.ClassLoader);
    method public abstract javax.xml.parsers.SAXParser newSAXParser() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException;
    method public abstract void setFeature(java.lang.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 abstract interface ErrorListener {
    method public abstract void error(javax.xml.transform.TransformerException) throws javax.xml.transform.TransformerException;
    method public abstract void fatalError(javax.xml.transform.TransformerException) throws javax.xml.transform.TransformerException;
    method public abstract void warning(javax.xml.transform.TransformerException) throws javax.xml.transform.TransformerException;
  }

  public class OutputKeys {
    field public static final java.lang.String CDATA_SECTION_ELEMENTS = "cdata-section-elements";
    field public static final java.lang.String DOCTYPE_PUBLIC = "doctype-public";
    field public static final java.lang.String DOCTYPE_SYSTEM = "doctype-system";
    field public static final java.lang.String ENCODING = "encoding";
    field public static final java.lang.String INDENT = "indent";
    field public static final java.lang.String MEDIA_TYPE = "media-type";
    field public static final java.lang.String METHOD = "method";
    field public static final java.lang.String OMIT_XML_DECLARATION = "omit-xml-declaration";
    field public static final java.lang.String STANDALONE = "standalone";
    field public static final java.lang.String VERSION = "version";
  }

  public abstract interface Result {
    method public abstract java.lang.String getSystemId();
    method public abstract void setSystemId(java.lang.String);
    field public static final java.lang.String PI_DISABLE_OUTPUT_ESCAPING = "javax.xml.transform.disable-output-escaping";
    field public static final java.lang.String PI_ENABLE_OUTPUT_ESCAPING = "javax.xml.transform.enable-output-escaping";
  }

  public abstract interface Source {
    method public abstract java.lang.String getSystemId();
    method public abstract void setSystemId(java.lang.String);
  }

  public abstract interface SourceLocator {
    method public abstract int getColumnNumber();
    method public abstract int getLineNumber();
    method public abstract java.lang.String getPublicId();
    method public abstract java.lang.String getSystemId();
  }

  public abstract interface Templates {
    method public abstract java.util.Properties getOutputProperties();
    method public abstract 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 java.lang.String getOutputProperty(java.lang.String) throws java.lang.IllegalArgumentException;
    method public abstract java.lang.Object getParameter(java.lang.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(java.lang.String, java.lang.String) throws java.lang.IllegalArgumentException;
    method public abstract void setParameter(java.lang.String, java.lang.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(java.lang.String);
    ctor public TransformerConfigurationException(java.lang.Throwable);
    ctor public TransformerConfigurationException(java.lang.String, java.lang.Throwable);
    ctor public TransformerConfigurationException(java.lang.String, javax.xml.transform.SourceLocator);
    ctor public TransformerConfigurationException(java.lang.String, javax.xml.transform.SourceLocator, java.lang.Throwable);
  }

  public class TransformerException extends java.lang.Exception {
    ctor public TransformerException(java.lang.String);
    ctor public TransformerException(java.lang.Throwable);
    ctor public TransformerException(java.lang.String, java.lang.Throwable);
    ctor public TransformerException(java.lang.String, javax.xml.transform.SourceLocator);
    ctor public TransformerException(java.lang.String, javax.xml.transform.SourceLocator, java.lang.Throwable);
    method public java.lang.Throwable getCause();
    method public java.lang.Throwable getException();
    method public java.lang.String getLocationAsString();
    method public javax.xml.transform.SourceLocator getLocator();
    method public java.lang.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, java.lang.String, java.lang.String, java.lang.String) throws javax.xml.transform.TransformerConfigurationException;
    method public abstract java.lang.Object getAttribute(java.lang.String);
    method public abstract javax.xml.transform.ErrorListener getErrorListener();
    method public abstract boolean getFeature(java.lang.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(java.lang.String, java.lang.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(java.lang.String, java.lang.Object);
    method public abstract void setErrorListener(javax.xml.transform.ErrorListener);
    method public abstract void setFeature(java.lang.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(java.lang.String);
    ctor public TransformerFactoryConfigurationError(java.lang.Exception);
    ctor public TransformerFactoryConfigurationError(java.lang.Exception, java.lang.String);
    method public java.lang.Exception getException();
  }

  public abstract interface URIResolver {
    method public abstract javax.xml.transform.Source resolve(java.lang.String, java.lang.String) throws javax.xml.transform.TransformerException;
  }

}

package javax.xml.transform.dom {

  public abstract interface DOMLocator implements javax.xml.transform.SourceLocator {
    method public abstract 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, java.lang.String);
    ctor public DOMResult(org.w3c.dom.Node, org.w3c.dom.Node);
    ctor public DOMResult(org.w3c.dom.Node, org.w3c.dom.Node, java.lang.String);
    method public org.w3c.dom.Node getNextSibling();
    method public org.w3c.dom.Node getNode();
    method public java.lang.String getSystemId();
    method public void setNextSibling(org.w3c.dom.Node);
    method public void setNode(org.w3c.dom.Node);
    method public void setSystemId(java.lang.String);
    field public static final java.lang.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, java.lang.String);
    method public org.w3c.dom.Node getNode();
    method public java.lang.String getSystemId();
    method public void setNode(org.w3c.dom.Node);
    method public void setSystemId(java.lang.String);
    field public static final java.lang.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 java.lang.String getSystemId();
    method public void setHandler(org.xml.sax.ContentHandler);
    method public void setLexicalHandler(org.xml.sax.ext.LexicalHandler);
    method public void setSystemId(java.lang.String);
    field public static final java.lang.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 java.lang.String getSystemId();
    method public org.xml.sax.XMLReader getXMLReader();
    method public void setInputSource(org.xml.sax.InputSource);
    method public void setSystemId(java.lang.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 java.lang.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 java.lang.String FEATURE = "http://javax.xml.transform.sax.SAXTransformerFactory/feature";
    field public static final java.lang.String FEATURE_XMLFILTER = "http://javax.xml.transform.sax.SAXTransformerFactory/feature/xmlfilter";
  }

  public abstract interface TemplatesHandler implements org.xml.sax.ContentHandler {
    method public abstract java.lang.String getSystemId();
    method public abstract javax.xml.transform.Templates getTemplates();
    method public abstract void setSystemId(java.lang.String);
  }

  public abstract interface TransformerHandler implements org.xml.sax.ContentHandler org.xml.sax.DTDHandler org.xml.sax.ext.LexicalHandler {
    method public abstract java.lang.String getSystemId();
    method public abstract javax.xml.transform.Transformer getTransformer();
    method public abstract void setResult(javax.xml.transform.Result) throws java.lang.IllegalArgumentException;
    method public abstract void setSystemId(java.lang.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(java.lang.String);
    ctor public StreamResult(java.io.File);
    method public java.io.OutputStream getOutputStream();
    method public java.lang.String getSystemId();
    method public java.io.Writer getWriter();
    method public void setOutputStream(java.io.OutputStream);
    method public void setSystemId(java.lang.String);
    method public void setSystemId(java.io.File);
    method public void setWriter(java.io.Writer);
    field public static final java.lang.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, java.lang.String);
    ctor public StreamSource(java.io.Reader);
    ctor public StreamSource(java.io.Reader, java.lang.String);
    ctor public StreamSource(java.lang.String);
    ctor public StreamSource(java.io.File);
    method public java.io.InputStream getInputStream();
    method public java.lang.String getPublicId();
    method public java.io.Reader getReader();
    method public java.lang.String getSystemId();
    method public void setInputStream(java.io.InputStream);
    method public void setPublicId(java.lang.String);
    method public void setReader(java.io.Reader);
    method public void setSystemId(java.lang.String);
    method public void setSystemId(java.io.File);
    field public static final java.lang.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(java.lang.String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public java.lang.Object getProperty(java.lang.String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public abstract org.w3c.dom.ls.LSResourceResolver getResourceResolver();
    method public abstract boolean isSchemaLanguageSupported(java.lang.String);
    method public static javax.xml.validation.SchemaFactory newInstance(java.lang.String);
    method public static javax.xml.validation.SchemaFactory newInstance(java.lang.String, java.lang.String, java.lang.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(java.lang.String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setProperty(java.lang.String, java.lang.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(java.lang.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(java.lang.String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public java.lang.Object getProperty(java.lang.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(java.lang.String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setProperty(java.lang.String, java.lang.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(java.lang.String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public java.lang.Object getProperty(java.lang.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(java.lang.String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setProperty(java.lang.String, java.lang.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 abstract interface XPath {
    method public abstract javax.xml.xpath.XPathExpression compile(java.lang.String) throws javax.xml.xpath.XPathExpressionException;
    method public abstract java.lang.Object evaluate(java.lang.String, java.lang.Object, javax.xml.namespace.QName) throws javax.xml.xpath.XPathExpressionException;
    method public abstract java.lang.String evaluate(java.lang.String, java.lang.Object) throws javax.xml.xpath.XPathExpressionException;
    method public abstract java.lang.Object evaluate(java.lang.String, org.xml.sax.InputSource, javax.xml.namespace.QName) throws javax.xml.xpath.XPathExpressionException;
    method public abstract java.lang.String evaluate(java.lang.String, org.xml.sax.InputSource) throws javax.xml.xpath.XPathExpressionException;
    method public abstract javax.xml.namespace.NamespaceContext getNamespaceContext();
    method public abstract javax.xml.xpath.XPathFunctionResolver getXPathFunctionResolver();
    method public abstract javax.xml.xpath.XPathVariableResolver getXPathVariableResolver();
    method public abstract void reset();
    method public abstract void setNamespaceContext(javax.xml.namespace.NamespaceContext);
    method public abstract void setXPathFunctionResolver(javax.xml.xpath.XPathFunctionResolver);
    method public abstract void setXPathVariableResolver(javax.xml.xpath.XPathVariableResolver);
  }

  public class XPathConstants {
    field public static final javax.xml.namespace.QName BOOLEAN;
    field public static final java.lang.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(java.lang.String);
    ctor public XPathException(java.lang.Throwable);
    method public java.lang.Throwable getCause();
  }

  public abstract interface XPathExpression {
    method public abstract java.lang.Object evaluate(java.lang.Object, javax.xml.namespace.QName) throws javax.xml.xpath.XPathExpressionException;
    method public abstract java.lang.String evaluate(java.lang.Object) throws javax.xml.xpath.XPathExpressionException;
    method public abstract java.lang.Object evaluate(org.xml.sax.InputSource, javax.xml.namespace.QName) throws javax.xml.xpath.XPathExpressionException;
    method public abstract java.lang.String evaluate(org.xml.sax.InputSource) throws javax.xml.xpath.XPathExpressionException;
  }

  public class XPathExpressionException extends javax.xml.xpath.XPathException {
    ctor public XPathExpressionException(java.lang.String);
    ctor public XPathExpressionException(java.lang.Throwable);
  }

  public abstract class XPathFactory {
    ctor protected XPathFactory();
    method public abstract boolean getFeature(java.lang.String) throws javax.xml.xpath.XPathFactoryConfigurationException;
    method public abstract boolean isObjectModelSupported(java.lang.String);
    method public static final javax.xml.xpath.XPathFactory newInstance();
    method public static final javax.xml.xpath.XPathFactory newInstance(java.lang.String) throws javax.xml.xpath.XPathFactoryConfigurationException;
    method public static javax.xml.xpath.XPathFactory newInstance(java.lang.String, java.lang.String, java.lang.ClassLoader) throws javax.xml.xpath.XPathFactoryConfigurationException;
    method public abstract javax.xml.xpath.XPath newXPath();
    method public abstract void setFeature(java.lang.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 java.lang.String DEFAULT_OBJECT_MODEL_URI = "http://java.sun.com/jaxp/xpath/dom";
    field public static final java.lang.String DEFAULT_PROPERTY_NAME = "javax.xml.xpath.XPathFactory";
  }

  public class XPathFactoryConfigurationException extends javax.xml.xpath.XPathException {
    ctor public XPathFactoryConfigurationException(java.lang.String);
    ctor public XPathFactoryConfigurationException(java.lang.Throwable);
  }

  public abstract interface XPathFunction {
    method public abstract java.lang.Object evaluate(java.util.List) throws javax.xml.xpath.XPathFunctionException;
  }

  public class XPathFunctionException extends javax.xml.xpath.XPathExpressionException {
    ctor public XPathFunctionException(java.lang.String);
    ctor public XPathFunctionException(java.lang.Throwable);
  }

  public abstract interface XPathFunctionResolver {
    method public abstract javax.xml.xpath.XPathFunction resolveFunction(javax.xml.namespace.QName, int);
  }

  public abstract interface XPathVariableResolver {
    method public abstract java.lang.Object resolveVariable(javax.xml.namespace.QName);
  }

}

package org.apache.http.conn {

  public deprecated class ConnectTimeoutException extends java.io.InterruptedIOException {
    ctor public ConnectTimeoutException();
    ctor public ConnectTimeoutException(java.lang.String);
  }

}

package org.apache.http.conn.scheme {

  public abstract deprecated interface HostNameResolver {
    method public abstract java.net.InetAddress resolve(java.lang.String) throws java.io.IOException;
  }

  public abstract deprecated interface LayeredSocketFactory implements org.apache.http.conn.scheme.SocketFactory {
    method public abstract java.net.Socket createSocket(java.net.Socket, java.lang.String, int, boolean) throws java.io.IOException, java.net.UnknownHostException;
  }

  public abstract deprecated interface SocketFactory {
    method public abstract java.net.Socket connectSocket(java.net.Socket, java.lang.String, int, java.net.InetAddress, int, org.apache.http.params.HttpParams) throws org.apache.http.conn.ConnectTimeoutException, java.io.IOException, java.net.UnknownHostException;
    method public abstract java.net.Socket createSocket() throws java.io.IOException;
    method public abstract boolean isSecure(java.net.Socket) throws java.lang.IllegalArgumentException;
  }

}

package org.apache.http.conn.ssl {

  public abstract deprecated class AbstractVerifier implements org.apache.http.conn.ssl.X509HostnameVerifier {
    ctor public AbstractVerifier();
    method public static boolean acceptableCountryWildcard(java.lang.String);
    method public static int countDots(java.lang.String);
    method public static java.lang.String[] getCNs(java.security.cert.X509Certificate);
    method public static java.lang.String[] getDNSSubjectAlts(java.security.cert.X509Certificate);
    method public final void verify(java.lang.String, javax.net.ssl.SSLSocket) throws java.io.IOException;
    method public final boolean verify(java.lang.String, javax.net.ssl.SSLSession);
    method public final void verify(java.lang.String, java.security.cert.X509Certificate) throws javax.net.ssl.SSLException;
    method public final void verify(java.lang.String, java.lang.String[], java.lang.String[], boolean) throws javax.net.ssl.SSLException;
  }

  public deprecated class AllowAllHostnameVerifier extends org.apache.http.conn.ssl.AbstractVerifier {
    ctor public AllowAllHostnameVerifier();
    method public final java.lang.String toString();
    method public final void verify(java.lang.String, java.lang.String[], java.lang.String[]);
  }

  public deprecated class BrowserCompatHostnameVerifier extends org.apache.http.conn.ssl.AbstractVerifier {
    ctor public BrowserCompatHostnameVerifier();
    method public final java.lang.String toString();
    method public final void verify(java.lang.String, java.lang.String[], java.lang.String[]) throws javax.net.ssl.SSLException;
  }

  public deprecated class SSLSocketFactory implements org.apache.http.conn.scheme.LayeredSocketFactory {
    ctor public SSLSocketFactory(java.lang.String, java.security.KeyStore, java.lang.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 public SSLSocketFactory(java.security.KeyStore, java.lang.String, java.security.KeyStore) throws java.security.KeyManagementException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    ctor public SSLSocketFactory(java.security.KeyStore, java.lang.String) throws java.security.KeyManagementException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    ctor public SSLSocketFactory(java.security.KeyStore) throws java.security.KeyManagementException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
    method public java.net.Socket connectSocket(java.net.Socket, java.lang.String, int, java.net.InetAddress, int, org.apache.http.params.HttpParams) throws java.io.IOException;
    method public java.net.Socket createSocket() throws java.io.IOException;
    method public java.net.Socket createSocket(java.net.Socket, java.lang.String, int, boolean) throws java.io.IOException, java.net.UnknownHostException;
    method public org.apache.http.conn.ssl.X509HostnameVerifier getHostnameVerifier();
    method public static org.apache.http.conn.ssl.SSLSocketFactory getSocketFactory();
    method public boolean isSecure(java.net.Socket) throws java.lang.IllegalArgumentException;
    method public void setHostnameVerifier(org.apache.http.conn.ssl.X509HostnameVerifier);
    field public static final org.apache.http.conn.ssl.X509HostnameVerifier ALLOW_ALL_HOSTNAME_VERIFIER;
    field public static final org.apache.http.conn.ssl.X509HostnameVerifier BROWSER_COMPATIBLE_HOSTNAME_VERIFIER;
    field public static final java.lang.String SSL = "SSL";
    field public static final java.lang.String SSLV2 = "SSLv2";
    field public static final org.apache.http.conn.ssl.X509HostnameVerifier STRICT_HOSTNAME_VERIFIER;
    field public static final java.lang.String TLS = "TLS";
  }

  public deprecated class StrictHostnameVerifier extends org.apache.http.conn.ssl.AbstractVerifier {
    ctor public StrictHostnameVerifier();
    method public final java.lang.String toString();
    method public final void verify(java.lang.String, java.lang.String[], java.lang.String[]) throws javax.net.ssl.SSLException;
  }

  public abstract deprecated interface X509HostnameVerifier implements javax.net.ssl.HostnameVerifier {
    method public abstract void verify(java.lang.String, javax.net.ssl.SSLSocket) throws java.io.IOException;
    method public abstract void verify(java.lang.String, java.security.cert.X509Certificate) throws javax.net.ssl.SSLException;
    method public abstract void verify(java.lang.String, java.lang.String[], java.lang.String[]) throws javax.net.ssl.SSLException;
  }

}

package org.apache.http.params {

  public abstract deprecated interface CoreConnectionPNames {
    field public static final java.lang.String CONNECTION_TIMEOUT = "http.connection.timeout";
    field public static final java.lang.String MAX_HEADER_COUNT = "http.connection.max-header-count";
    field public static final java.lang.String MAX_LINE_LENGTH = "http.connection.max-line-length";
    field public static final java.lang.String SOCKET_BUFFER_SIZE = "http.socket.buffer-size";
    field public static final java.lang.String SO_LINGER = "http.socket.linger";
    field public static final java.lang.String SO_TIMEOUT = "http.socket.timeout";
    field public static final java.lang.String STALE_CONNECTION_CHECK = "http.connection.stalecheck";
    field public static final java.lang.String TCP_NODELAY = "http.tcp.nodelay";
  }

  public final deprecated class HttpConnectionParams implements org.apache.http.params.CoreConnectionPNames {
    method public static int getConnectionTimeout(org.apache.http.params.HttpParams);
    method public static int getLinger(org.apache.http.params.HttpParams);
    method public static int getSoTimeout(org.apache.http.params.HttpParams);
    method public static int getSocketBufferSize(org.apache.http.params.HttpParams);
    method public static boolean getTcpNoDelay(org.apache.http.params.HttpParams);
    method public static boolean isStaleCheckingEnabled(org.apache.http.params.HttpParams);
    method public static void setConnectionTimeout(org.apache.http.params.HttpParams, int);
    method public static void setLinger(org.apache.http.params.HttpParams, int);
    method public static void setSoTimeout(org.apache.http.params.HttpParams, int);
    method public static void setSocketBufferSize(org.apache.http.params.HttpParams, int);
    method public static void setStaleCheckingEnabled(org.apache.http.params.HttpParams, boolean);
    method public static void setTcpNoDelay(org.apache.http.params.HttpParams, boolean);
  }

  public abstract deprecated interface HttpParams {
    method public abstract org.apache.http.params.HttpParams copy();
    method public abstract boolean getBooleanParameter(java.lang.String, boolean);
    method public abstract double getDoubleParameter(java.lang.String, double);
    method public abstract int getIntParameter(java.lang.String, int);
    method public abstract long getLongParameter(java.lang.String, long);
    method public abstract java.lang.Object getParameter(java.lang.String);
    method public abstract boolean isParameterFalse(java.lang.String);
    method public abstract boolean isParameterTrue(java.lang.String);
    method public abstract boolean removeParameter(java.lang.String);
    method public abstract org.apache.http.params.HttpParams setBooleanParameter(java.lang.String, boolean);
    method public abstract org.apache.http.params.HttpParams setDoubleParameter(java.lang.String, double);
    method public abstract org.apache.http.params.HttpParams setIntParameter(java.lang.String, int);
    method public abstract org.apache.http.params.HttpParams setLongParameter(java.lang.String, long);
    method public abstract org.apache.http.params.HttpParams setParameter(java.lang.String, java.lang.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(java.lang.String) throws org.json.JSONException;
    ctor public JSONArray(java.lang.Object) throws org.json.JSONException;
    method public java.lang.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 java.lang.String getString(int) throws org.json.JSONException;
    method public boolean isNull(int);
    method public java.lang.String join(java.lang.String) throws org.json.JSONException;
    method public int length();
    method public java.lang.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 java.lang.String optString(int);
    method public java.lang.String optString(int, java.lang.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(java.lang.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, java.lang.Object) throws org.json.JSONException;
    method public java.lang.Object remove(int);
    method public org.json.JSONObject toJSONObject(org.json.JSONArray) throws org.json.JSONException;
    method public java.lang.String toString(int) throws org.json.JSONException;
  }

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

  public class JSONObject {
    ctor public JSONObject();
    ctor public JSONObject(java.util.Map);
    ctor public JSONObject(org.json.JSONTokener) throws org.json.JSONException;
    ctor public JSONObject(java.lang.String) throws org.json.JSONException;
    ctor public JSONObject(org.json.JSONObject, java.lang.String[]) throws org.json.JSONException;
    method public org.json.JSONObject accumulate(java.lang.String, java.lang.Object) throws org.json.JSONException;
    method public java.lang.Object get(java.lang.String) throws org.json.JSONException;
    method public boolean getBoolean(java.lang.String) throws org.json.JSONException;
    method public double getDouble(java.lang.String) throws org.json.JSONException;
    method public int getInt(java.lang.String) throws org.json.JSONException;
    method public org.json.JSONArray getJSONArray(java.lang.String) throws org.json.JSONException;
    method public org.json.JSONObject getJSONObject(java.lang.String) throws org.json.JSONException;
    method public long getLong(java.lang.String) throws org.json.JSONException;
    method public java.lang.String getString(java.lang.String) throws org.json.JSONException;
    method public boolean has(java.lang.String);
    method public boolean isNull(java.lang.String);
    method public java.util.Iterator<java.lang.String> keys();
    method public int length();
    method public org.json.JSONArray names();
    method public static java.lang.String numberToString(java.lang.Number) throws org.json.JSONException;
    method public java.lang.Object opt(java.lang.String);
    method public boolean optBoolean(java.lang.String);
    method public boolean optBoolean(java.lang.String, boolean);
    method public double optDouble(java.lang.String);
    method public double optDouble(java.lang.String, double);
    method public int optInt(java.lang.String);
    method public int optInt(java.lang.String, int);
    method public org.json.JSONArray optJSONArray(java.lang.String);
    method public org.json.JSONObject optJSONObject(java.lang.String);
    method public long optLong(java.lang.String);
    method public long optLong(java.lang.String, long);
    method public java.lang.String optString(java.lang.String);
    method public java.lang.String optString(java.lang.String, java.lang.String);
    method public org.json.JSONObject put(java.lang.String, boolean) throws org.json.JSONException;
    method public org.json.JSONObject put(java.lang.String, double) throws org.json.JSONException;
    method public org.json.JSONObject put(java.lang.String, int) throws org.json.JSONException;
    method public org.json.JSONObject put(java.lang.String, long) throws org.json.JSONException;
    method public org.json.JSONObject put(java.lang.String, java.lang.Object) throws org.json.JSONException;
    method public org.json.JSONObject putOpt(java.lang.String, java.lang.Object) throws org.json.JSONException;
    method public static java.lang.String quote(java.lang.String);
    method public java.lang.Object remove(java.lang.String);
    method public org.json.JSONArray toJSONArray(org.json.JSONArray) throws org.json.JSONException;
    method public java.lang.String toString(int) throws org.json.JSONException;
    method public static java.lang.Object wrap(java.lang.Object);
    field public static final java.lang.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(java.lang.String) throws org.json.JSONException;
    method public org.json.JSONStringer object() throws org.json.JSONException;
    method public org.json.JSONStringer value(java.lang.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(java.lang.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 java.lang.String next(int) throws org.json.JSONException;
    method public char nextClean() throws org.json.JSONException;
    method public java.lang.String nextString(char) throws org.json.JSONException;
    method public java.lang.String nextTo(java.lang.String);
    method public java.lang.String nextTo(char);
    method public java.lang.Object nextValue() throws org.json.JSONException;
    method public void skipPast(java.lang.String);
    method public char skipTo(char);
    method public org.json.JSONException syntaxError(java.lang.String);
  }

}

package org.w3c.dom {

  public abstract interface Attr implements org.w3c.dom.Node {
    method public abstract java.lang.String getName();
    method public abstract org.w3c.dom.Element getOwnerElement();
    method public abstract org.w3c.dom.TypeInfo getSchemaTypeInfo();
    method public abstract boolean getSpecified();
    method public abstract java.lang.String getValue();
    method public abstract boolean isId();
    method public abstract void setValue(java.lang.String) throws org.w3c.dom.DOMException;
  }

  public abstract interface CDATASection implements org.w3c.dom.Text {
  }

  public abstract interface CharacterData implements org.w3c.dom.Node {
    method public abstract void appendData(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract void deleteData(int, int) throws org.w3c.dom.DOMException;
    method public abstract java.lang.String getData() throws org.w3c.dom.DOMException;
    method public abstract int getLength();
    method public abstract void insertData(int, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract void replaceData(int, int, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract void setData(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract java.lang.String substringData(int, int) throws org.w3c.dom.DOMException;
  }

  public abstract interface Comment implements org.w3c.dom.CharacterData {
  }

  public abstract interface DOMConfiguration {
    method public abstract boolean canSetParameter(java.lang.String, java.lang.Object);
    method public abstract java.lang.Object getParameter(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.DOMStringList getParameterNames();
    method public abstract void setParameter(java.lang.String, java.lang.Object) throws org.w3c.dom.DOMException;
  }

  public abstract interface DOMError {
    method public abstract org.w3c.dom.DOMLocator getLocation();
    method public abstract java.lang.String getMessage();
    method public abstract java.lang.Object getRelatedData();
    method public abstract java.lang.Object getRelatedException();
    method public abstract short getSeverity();
    method public abstract java.lang.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 abstract interface DOMErrorHandler {
    method public abstract boolean handleError(org.w3c.dom.DOMError);
  }

  public class DOMException extends java.lang.RuntimeException {
    ctor public DOMException(short, java.lang.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 abstract interface DOMImplementation {
    method public abstract org.w3c.dom.Document createDocument(java.lang.String, java.lang.String, org.w3c.dom.DocumentType) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.DocumentType createDocumentType(java.lang.String, java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract java.lang.Object getFeature(java.lang.String, java.lang.String);
    method public abstract boolean hasFeature(java.lang.String, java.lang.String);
  }

  public abstract interface DOMImplementationList {
    method public abstract int getLength();
    method public abstract org.w3c.dom.DOMImplementation item(int);
  }

  public abstract interface DOMImplementationSource {
    method public abstract org.w3c.dom.DOMImplementation getDOMImplementation(java.lang.String);
    method public abstract org.w3c.dom.DOMImplementationList getDOMImplementationList(java.lang.String);
  }

  public abstract interface DOMLocator {
    method public abstract int getByteOffset();
    method public abstract int getColumnNumber();
    method public abstract int getLineNumber();
    method public abstract org.w3c.dom.Node getRelatedNode();
    method public abstract java.lang.String getUri();
    method public abstract int getUtf16Offset();
  }

  public abstract interface DOMStringList {
    method public abstract boolean contains(java.lang.String);
    method public abstract int getLength();
    method public abstract java.lang.String item(int);
  }

  public abstract interface Document implements org.w3c.dom.Node {
    method public abstract org.w3c.dom.Node adoptNode(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Attr createAttribute(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Attr createAttributeNS(java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.CDATASection createCDATASection(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Comment createComment(java.lang.String);
    method public abstract org.w3c.dom.DocumentFragment createDocumentFragment();
    method public abstract org.w3c.dom.Element createElement(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Element createElementNS(java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.EntityReference createEntityReference(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Text createTextNode(java.lang.String);
    method public abstract org.w3c.dom.DocumentType getDoctype();
    method public abstract org.w3c.dom.Element getDocumentElement();
    method public abstract java.lang.String getDocumentURI();
    method public abstract org.w3c.dom.DOMConfiguration getDomConfig();
    method public abstract org.w3c.dom.Element getElementById(java.lang.String);
    method public abstract org.w3c.dom.NodeList getElementsByTagName(java.lang.String);
    method public abstract org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String, java.lang.String);
    method public abstract org.w3c.dom.DOMImplementation getImplementation();
    method public abstract java.lang.String getInputEncoding();
    method public abstract boolean getStrictErrorChecking();
    method public abstract java.lang.String getXmlEncoding();
    method public abstract boolean getXmlStandalone();
    method public abstract java.lang.String getXmlVersion();
    method public abstract org.w3c.dom.Node importNode(org.w3c.dom.Node, boolean) throws org.w3c.dom.DOMException;
    method public abstract void normalizeDocument();
    method public abstract org.w3c.dom.Node renameNode(org.w3c.dom.Node, java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract void setDocumentURI(java.lang.String);
    method public abstract void setStrictErrorChecking(boolean);
    method public abstract void setXmlStandalone(boolean) throws org.w3c.dom.DOMException;
    method public abstract void setXmlVersion(java.lang.String) throws org.w3c.dom.DOMException;
  }

  public abstract interface DocumentFragment implements org.w3c.dom.Node {
  }

  public abstract interface DocumentType implements org.w3c.dom.Node {
    method public abstract org.w3c.dom.NamedNodeMap getEntities();
    method public abstract java.lang.String getInternalSubset();
    method public abstract java.lang.String getName();
    method public abstract org.w3c.dom.NamedNodeMap getNotations();
    method public abstract java.lang.String getPublicId();
    method public abstract java.lang.String getSystemId();
  }

  public abstract interface Element implements org.w3c.dom.Node {
    method public abstract java.lang.String getAttribute(java.lang.String);
    method public abstract java.lang.String getAttributeNS(java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Attr getAttributeNode(java.lang.String);
    method public abstract org.w3c.dom.Attr getAttributeNodeNS(java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.NodeList getElementsByTagName(java.lang.String);
    method public abstract org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.TypeInfo getSchemaTypeInfo();
    method public abstract java.lang.String getTagName();
    method public abstract boolean hasAttribute(java.lang.String);
    method public abstract boolean hasAttributeNS(java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract void removeAttribute(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract void removeAttributeNS(java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr) throws org.w3c.dom.DOMException;
    method public abstract void setAttribute(java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract void setAttributeNS(java.lang.String, java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr) throws org.w3c.dom.DOMException;
    method public abstract void setIdAttribute(java.lang.String, boolean) throws org.w3c.dom.DOMException;
    method public abstract void setIdAttributeNS(java.lang.String, java.lang.String, boolean) throws org.w3c.dom.DOMException;
    method public abstract void setIdAttributeNode(org.w3c.dom.Attr, boolean) throws org.w3c.dom.DOMException;
  }

  public abstract interface Entity implements org.w3c.dom.Node {
    method public abstract java.lang.String getInputEncoding();
    method public abstract java.lang.String getNotationName();
    method public abstract java.lang.String getPublicId();
    method public abstract java.lang.String getSystemId();
    method public abstract java.lang.String getXmlEncoding();
    method public abstract java.lang.String getXmlVersion();
  }

  public abstract interface EntityReference implements org.w3c.dom.Node {
  }

  public abstract interface NameList {
    method public abstract boolean contains(java.lang.String);
    method public abstract boolean containsNS(java.lang.String, java.lang.String);
    method public abstract int getLength();
    method public abstract java.lang.String getName(int);
    method public abstract java.lang.String getNamespaceURI(int);
  }

  public abstract interface NamedNodeMap {
    method public abstract int getLength();
    method public abstract org.w3c.dom.Node getNamedItem(java.lang.String);
    method public abstract org.w3c.dom.Node getNamedItemNS(java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Node item(int);
    method public abstract org.w3c.dom.Node removeNamedItem(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Node removeNamedItemNS(java.lang.String, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Node setNamedItem(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Node setNamedItemNS(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
  }

  public abstract interface Node {
    method public abstract org.w3c.dom.Node appendChild(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Node cloneNode(boolean);
    method public abstract short compareDocumentPosition(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.NamedNodeMap getAttributes();
    method public abstract java.lang.String getBaseURI();
    method public abstract org.w3c.dom.NodeList getChildNodes();
    method public abstract java.lang.Object getFeature(java.lang.String, java.lang.String);
    method public abstract org.w3c.dom.Node getFirstChild();
    method public abstract org.w3c.dom.Node getLastChild();
    method public abstract java.lang.String getLocalName();
    method public abstract java.lang.String getNamespaceURI();
    method public abstract org.w3c.dom.Node getNextSibling();
    method public abstract java.lang.String getNodeName();
    method public abstract short getNodeType();
    method public abstract java.lang.String getNodeValue() throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Document getOwnerDocument();
    method public abstract org.w3c.dom.Node getParentNode();
    method public abstract java.lang.String getPrefix();
    method public abstract org.w3c.dom.Node getPreviousSibling();
    method public abstract java.lang.String getTextContent() throws org.w3c.dom.DOMException;
    method public abstract java.lang.Object getUserData(java.lang.String);
    method public abstract boolean hasAttributes();
    method public abstract boolean hasChildNodes();
    method public abstract org.w3c.dom.Node insertBefore(org.w3c.dom.Node, org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public abstract boolean isDefaultNamespace(java.lang.String);
    method public abstract boolean isEqualNode(org.w3c.dom.Node);
    method public abstract boolean isSameNode(org.w3c.dom.Node);
    method public abstract boolean isSupported(java.lang.String, java.lang.String);
    method public abstract java.lang.String lookupNamespaceURI(java.lang.String);
    method public abstract java.lang.String lookupPrefix(java.lang.String);
    method public abstract void normalize();
    method public abstract org.w3c.dom.Node removeChild(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Node replaceChild(org.w3c.dom.Node, org.w3c.dom.Node) throws org.w3c.dom.DOMException;
    method public abstract void setNodeValue(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract void setPrefix(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract void setTextContent(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract java.lang.Object setUserData(java.lang.String, java.lang.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 abstract interface NodeList {
    method public abstract int getLength();
    method public abstract org.w3c.dom.Node item(int);
  }

  public abstract interface Notation implements org.w3c.dom.Node {
    method public abstract java.lang.String getPublicId();
    method public abstract java.lang.String getSystemId();
  }

  public abstract interface ProcessingInstruction implements org.w3c.dom.Node {
    method public abstract java.lang.String getData();
    method public abstract java.lang.String getTarget();
    method public abstract void setData(java.lang.String) throws org.w3c.dom.DOMException;
  }

  public abstract interface Text implements org.w3c.dom.CharacterData {
    method public abstract java.lang.String getWholeText();
    method public abstract boolean isElementContentWhitespace();
    method public abstract org.w3c.dom.Text replaceWholeText(java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract org.w3c.dom.Text splitText(int) throws org.w3c.dom.DOMException;
  }

  public abstract interface TypeInfo {
    method public abstract java.lang.String getTypeName();
    method public abstract java.lang.String getTypeNamespace();
    method public abstract boolean isDerivedFrom(java.lang.String, java.lang.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 abstract interface UserDataHandler {
    method public abstract void handle(short, java.lang.String, java.lang.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 abstract interface DOMImplementationLS {
    method public abstract org.w3c.dom.ls.LSInput createLSInput();
    method public abstract org.w3c.dom.ls.LSOutput createLSOutput();
    method public abstract org.w3c.dom.ls.LSParser createLSParser(short, java.lang.String) throws org.w3c.dom.DOMException;
    method public abstract 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, java.lang.String);
    field public static final short PARSE_ERR = 81; // 0x51
    field public static final short SERIALIZE_ERR = 82; // 0x52
    field public short code;
  }

  public abstract interface LSInput {
    method public abstract java.lang.String getBaseURI();
    method public abstract java.io.InputStream getByteStream();
    method public abstract boolean getCertifiedText();
    method public abstract java.io.Reader getCharacterStream();
    method public abstract java.lang.String getEncoding();
    method public abstract java.lang.String getPublicId();
    method public abstract java.lang.String getStringData();
    method public abstract java.lang.String getSystemId();
    method public abstract void setBaseURI(java.lang.String);
    method public abstract void setByteStream(java.io.InputStream);
    method public abstract void setCertifiedText(boolean);
    method public abstract void setCharacterStream(java.io.Reader);
    method public abstract void setEncoding(java.lang.String);
    method public abstract void setPublicId(java.lang.String);
    method public abstract void setStringData(java.lang.String);
    method public abstract void setSystemId(java.lang.String);
  }

  public abstract interface LSOutput {
    method public abstract java.io.OutputStream getByteStream();
    method public abstract java.io.Writer getCharacterStream();
    method public abstract java.lang.String getEncoding();
    method public abstract java.lang.String getSystemId();
    method public abstract void setByteStream(java.io.OutputStream);
    method public abstract void setCharacterStream(java.io.Writer);
    method public abstract void setEncoding(java.lang.String);
    method public abstract void setSystemId(java.lang.String);
  }

  public abstract interface LSParser {
    method public abstract void abort();
    method public abstract boolean getAsync();
    method public abstract boolean getBusy();
    method public abstract org.w3c.dom.DOMConfiguration getDomConfig();
    method public abstract org.w3c.dom.ls.LSParserFilter getFilter();
    method public abstract org.w3c.dom.Document parse(org.w3c.dom.ls.LSInput) throws org.w3c.dom.DOMException, org.w3c.dom.ls.LSException;
    method public abstract org.w3c.dom.Document parseURI(java.lang.String) throws org.w3c.dom.DOMException, org.w3c.dom.ls.LSException;
    method public abstract 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 abstract 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 abstract interface LSParserFilter {
    method public abstract short acceptNode(org.w3c.dom.Node);
    method public abstract int getWhatToShow();
    method public abstract 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 abstract interface LSResourceResolver {
    method public abstract org.w3c.dom.ls.LSInput resolveResource(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
  }

  public abstract interface LSSerializer {
    method public abstract org.w3c.dom.DOMConfiguration getDomConfig();
    method public abstract java.lang.String getNewLine();
    method public abstract void setNewLine(java.lang.String);
    method public abstract boolean write(org.w3c.dom.Node, org.w3c.dom.ls.LSOutput) throws org.w3c.dom.ls.LSException;
    method public abstract java.lang.String writeToString(org.w3c.dom.Node) throws org.w3c.dom.DOMException, org.w3c.dom.ls.LSException;
    method public abstract boolean writeToURI(org.w3c.dom.Node, java.lang.String) throws org.w3c.dom.ls.LSException;
  }

}

package org.xml.sax {

  public abstract deprecated interface AttributeList {
    method public abstract int getLength();
    method public abstract java.lang.String getName(int);
    method public abstract java.lang.String getType(int);
    method public abstract java.lang.String getType(java.lang.String);
    method public abstract java.lang.String getValue(int);
    method public abstract java.lang.String getValue(java.lang.String);
  }

  public abstract interface Attributes {
    method public abstract int getIndex(java.lang.String, java.lang.String);
    method public abstract int getIndex(java.lang.String);
    method public abstract int getLength();
    method public abstract java.lang.String getLocalName(int);
    method public abstract java.lang.String getQName(int);
    method public abstract java.lang.String getType(int);
    method public abstract java.lang.String getType(java.lang.String, java.lang.String);
    method public abstract java.lang.String getType(java.lang.String);
    method public abstract java.lang.String getURI(int);
    method public abstract java.lang.String getValue(int);
    method public abstract java.lang.String getValue(java.lang.String, java.lang.String);
    method public abstract java.lang.String getValue(java.lang.String);
  }

  public abstract interface ContentHandler {
    method public abstract void characters(char[], int, int) throws org.xml.sax.SAXException;
    method public abstract void endDocument() throws org.xml.sax.SAXException;
    method public abstract void endElement(java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public abstract void endPrefixMapping(java.lang.String) throws org.xml.sax.SAXException;
    method public abstract void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
    method public abstract void processingInstruction(java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public abstract void setDocumentLocator(org.xml.sax.Locator);
    method public abstract void skippedEntity(java.lang.String) throws org.xml.sax.SAXException;
    method public abstract void startDocument() throws org.xml.sax.SAXException;
    method public abstract void startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) throws org.xml.sax.SAXException;
    method public abstract void startPrefixMapping(java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
  }

  public abstract interface DTDHandler {
    method public abstract void notationDecl(java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public abstract void unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
  }

  public abstract deprecated interface DocumentHandler {
    method public abstract void characters(char[], int, int) throws org.xml.sax.SAXException;
    method public abstract void endDocument() throws org.xml.sax.SAXException;
    method public abstract void endElement(java.lang.String) throws org.xml.sax.SAXException;
    method public abstract void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
    method public abstract void processingInstruction(java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public abstract void setDocumentLocator(org.xml.sax.Locator);
    method public abstract void startDocument() throws org.xml.sax.SAXException;
    method public abstract void startElement(java.lang.String, org.xml.sax.AttributeList) throws org.xml.sax.SAXException;
  }

  public abstract interface EntityResolver {
    method public abstract org.xml.sax.InputSource resolveEntity(java.lang.String, java.lang.String) throws java.io.IOException, org.xml.sax.SAXException;
  }

  public abstract interface ErrorHandler {
    method public abstract void error(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
    method public abstract void fatalError(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
    method public abstract void warning(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
  }

  public deprecated class HandlerBase implements org.xml.sax.DTDHandler org.xml.sax.DocumentHandler org.xml.sax.EntityResolver org.xml.sax.ErrorHandler {
    ctor public HandlerBase();
    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(java.lang.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(java.lang.String, java.lang.String, java.lang.String);
    method public void processingInstruction(java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public org.xml.sax.InputSource resolveEntity(java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public void setDocumentLocator(org.xml.sax.Locator);
    method public void startDocument() throws org.xml.sax.SAXException;
    method public void startElement(java.lang.String, org.xml.sax.AttributeList) throws org.xml.sax.SAXException;
    method public void unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public void warning(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
  }

  public class InputSource {
    ctor public InputSource();
    ctor public InputSource(java.lang.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 java.lang.String getEncoding();
    method public java.lang.String getPublicId();
    method public java.lang.String getSystemId();
    method public void setByteStream(java.io.InputStream);
    method public void setCharacterStream(java.io.Reader);
    method public void setEncoding(java.lang.String);
    method public void setPublicId(java.lang.String);
    method public void setSystemId(java.lang.String);
  }

  public abstract interface Locator {
    method public abstract int getColumnNumber();
    method public abstract int getLineNumber();
    method public abstract java.lang.String getPublicId();
    method public abstract java.lang.String getSystemId();
  }

  public abstract deprecated interface Parser {
    method public abstract void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
    method public abstract void parse(java.lang.String) throws java.io.IOException, org.xml.sax.SAXException;
    method public abstract void setDTDHandler(org.xml.sax.DTDHandler);
    method public abstract void setDocumentHandler(org.xml.sax.DocumentHandler);
    method public abstract void setEntityResolver(org.xml.sax.EntityResolver);
    method public abstract void setErrorHandler(org.xml.sax.ErrorHandler);
    method public abstract void setLocale(java.util.Locale) throws org.xml.sax.SAXException;
  }

  public class SAXException extends java.lang.Exception {
    ctor public SAXException();
    ctor public SAXException(java.lang.String);
    ctor public SAXException(java.lang.Exception);
    ctor public SAXException(java.lang.String, java.lang.Exception);
    method public java.lang.Exception getException();
  }

  public class SAXNotRecognizedException extends org.xml.sax.SAXException {
    ctor public SAXNotRecognizedException();
    ctor public SAXNotRecognizedException(java.lang.String);
  }

  public class SAXNotSupportedException extends org.xml.sax.SAXException {
    ctor public SAXNotSupportedException();
    ctor public SAXNotSupportedException(java.lang.String);
  }

  public class SAXParseException extends org.xml.sax.SAXException {
    ctor public SAXParseException(java.lang.String, org.xml.sax.Locator);
    ctor public SAXParseException(java.lang.String, org.xml.sax.Locator, java.lang.Exception);
    ctor public SAXParseException(java.lang.String, java.lang.String, java.lang.String, int, int);
    ctor public SAXParseException(java.lang.String, java.lang.String, java.lang.String, int, int, java.lang.Exception);
    method public int getColumnNumber();
    method public int getLineNumber();
    method public java.lang.String getPublicId();
    method public java.lang.String getSystemId();
  }

  public abstract interface XMLFilter implements org.xml.sax.XMLReader {
    method public abstract org.xml.sax.XMLReader getParent();
    method public abstract void setParent(org.xml.sax.XMLReader);
  }

  public abstract interface XMLReader {
    method public abstract org.xml.sax.ContentHandler getContentHandler();
    method public abstract org.xml.sax.DTDHandler getDTDHandler();
    method public abstract org.xml.sax.EntityResolver getEntityResolver();
    method public abstract org.xml.sax.ErrorHandler getErrorHandler();
    method public abstract boolean getFeature(java.lang.String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public abstract java.lang.Object getProperty(java.lang.String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public abstract void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
    method public abstract void parse(java.lang.String) throws java.io.IOException, org.xml.sax.SAXException;
    method public abstract void setContentHandler(org.xml.sax.ContentHandler);
    method public abstract void setDTDHandler(org.xml.sax.DTDHandler);
    method public abstract void setEntityResolver(org.xml.sax.EntityResolver);
    method public abstract void setErrorHandler(org.xml.sax.ErrorHandler);
    method public abstract void setFeature(java.lang.String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public abstract void setProperty(java.lang.String, java.lang.Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
  }

}

package org.xml.sax.ext {

  public abstract interface Attributes2 implements org.xml.sax.Attributes {
    method public abstract boolean isDeclared(int);
    method public abstract boolean isDeclared(java.lang.String);
    method public abstract boolean isDeclared(java.lang.String, java.lang.String);
    method public abstract boolean isSpecified(int);
    method public abstract boolean isSpecified(java.lang.String, java.lang.String);
    method public abstract boolean isSpecified(java.lang.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(java.lang.String, java.lang.String);
    method public boolean isDeclared(java.lang.String);
    method public boolean isSpecified(int);
    method public boolean isSpecified(java.lang.String, java.lang.String);
    method public boolean isSpecified(java.lang.String);
    method public void setDeclared(int, boolean);
    method public void setSpecified(int, boolean);
  }

  public abstract interface DeclHandler {
    method public abstract void attributeDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public abstract void elementDecl(java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public abstract void externalEntityDecl(java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public abstract void internalEntityDecl(java.lang.String, java.lang.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(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public void comment(char[], int, int) throws org.xml.sax.SAXException;
    method public void elementDecl(java.lang.String, java.lang.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(java.lang.String) throws org.xml.sax.SAXException;
    method public void externalEntityDecl(java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public org.xml.sax.InputSource getExternalSubset(java.lang.String, java.lang.String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void internalEntityDecl(java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public org.xml.sax.InputSource resolveEntity(java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void startCDATA() throws org.xml.sax.SAXException;
    method public void startDTD(java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public void startEntity(java.lang.String) throws org.xml.sax.SAXException;
  }

  public abstract interface EntityResolver2 implements org.xml.sax.EntityResolver {
    method public abstract org.xml.sax.InputSource getExternalSubset(java.lang.String, java.lang.String) throws java.io.IOException, org.xml.sax.SAXException;
    method public abstract org.xml.sax.InputSource resolveEntity(java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws java.io.IOException, org.xml.sax.SAXException;
  }

  public abstract interface LexicalHandler {
    method public abstract void comment(char[], int, int) throws org.xml.sax.SAXException;
    method public abstract void endCDATA() throws org.xml.sax.SAXException;
    method public abstract void endDTD() throws org.xml.sax.SAXException;
    method public abstract void endEntity(java.lang.String) throws org.xml.sax.SAXException;
    method public abstract void startCDATA() throws org.xml.sax.SAXException;
    method public abstract void startDTD(java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public abstract void startEntity(java.lang.String) throws org.xml.sax.SAXException;
  }

  public abstract interface Locator2 implements org.xml.sax.Locator {
    method public abstract java.lang.String getEncoding();
    method public abstract java.lang.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 java.lang.String getEncoding();
    method public java.lang.String getXMLVersion();
    method public void setEncoding(java.lang.String);
    method public void setXMLVersion(java.lang.String);
  }

}

package org.xml.sax.helpers {

  public deprecated class AttributeListImpl implements org.xml.sax.AttributeList {
    ctor public AttributeListImpl();
    ctor public AttributeListImpl(org.xml.sax.AttributeList);
    method public void addAttribute(java.lang.String, java.lang.String, java.lang.String);
    method public void clear();
    method public int getLength();
    method public java.lang.String getName(int);
    method public java.lang.String getType(int);
    method public java.lang.String getType(java.lang.String);
    method public java.lang.String getValue(int);
    method public java.lang.String getValue(java.lang.String);
    method public void removeAttribute(java.lang.String);
    method 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(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public void clear();
    method public int getIndex(java.lang.String, java.lang.String);
    method public int getIndex(java.lang.String);
    method public int getLength();
    method public java.lang.String getLocalName(int);
    method public java.lang.String getQName(int);
    method public java.lang.String getType(int);
    method public java.lang.String getType(java.lang.String, java.lang.String);
    method public java.lang.String getType(java.lang.String);
    method public java.lang.String getURI(int);
    method public java.lang.String getValue(int);
    method public java.lang.String getValue(java.lang.String, java.lang.String);
    method public java.lang.String getValue(java.lang.String);
    method public void removeAttribute(int);
    method public void setAttribute(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public void setAttributes(org.xml.sax.Attributes);
    method public void setLocalName(int, java.lang.String);
    method public void setQName(int, java.lang.String);
    method public void setType(int, java.lang.String);
    method public void setURI(int, java.lang.String);
    method public void setValue(int, java.lang.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(java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public void endPrefixMapping(java.lang.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(java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public void processingInstruction(java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public org.xml.sax.InputSource resolveEntity(java.lang.String, java.lang.String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void setDocumentLocator(org.xml.sax.Locator);
    method public void skippedEntity(java.lang.String) throws org.xml.sax.SAXException;
    method public void startDocument() throws org.xml.sax.SAXException;
    method public void startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) throws org.xml.sax.SAXException;
    method public void startPrefixMapping(java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public void unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.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 java.lang.String getPublicId();
    method public java.lang.String getSystemId();
    method public void setColumnNumber(int);
    method public void setLineNumber(int);
    method public void setPublicId(java.lang.String);
    method public void setSystemId(java.lang.String);
  }

  public class NamespaceSupport {
    ctor public NamespaceSupport();
    method public boolean declarePrefix(java.lang.String, java.lang.String);
    method public java.util.Enumeration getDeclaredPrefixes();
    method public java.lang.String getPrefix(java.lang.String);
    method public java.util.Enumeration getPrefixes();
    method public java.util.Enumeration getPrefixes(java.lang.String);
    method public java.lang.String getURI(java.lang.String);
    method public boolean isNamespaceDeclUris();
    method public void popContext();
    method public java.lang.String[] processName(java.lang.String, java.lang.String[], boolean);
    method public void pushContext();
    method public void reset();
    method public void setNamespaceDeclUris(boolean);
    field public static final java.lang.String NSDECL = "http://www.w3.org/xmlns/2000/";
    field public static final java.lang.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(java.lang.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(java.lang.String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public java.lang.Object getProperty(java.lang.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(java.lang.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(java.lang.String, java.lang.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(java.lang.String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setProperty(java.lang.String, java.lang.Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void startDocument() throws org.xml.sax.SAXException;
    method public void startElement(java.lang.String, org.xml.sax.AttributeList) throws org.xml.sax.SAXException;
  }

  public deprecated class ParserFactory {
    method public static org.xml.sax.Parser makeParser() throws java.lang.ClassCastException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.NullPointerException;
    method public static org.xml.sax.Parser makeParser(java.lang.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(java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public void endPrefixMapping(java.lang.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(java.lang.String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public org.xml.sax.XMLReader getParent();
    method public java.lang.Object getProperty(java.lang.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(java.lang.String, java.lang.String, java.lang.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(java.lang.String) throws java.io.IOException, org.xml.sax.SAXException;
    method public void processingInstruction(java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public org.xml.sax.InputSource resolveEntity(java.lang.String, java.lang.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(java.lang.String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setParent(org.xml.sax.XMLReader);
    method public void setProperty(java.lang.String, java.lang.Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void skippedEntity(java.lang.String) throws org.xml.sax.SAXException;
    method public void startDocument() throws org.xml.sax.SAXException;
    method public void startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) throws org.xml.sax.SAXException;
    method public void startPrefixMapping(java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public void unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.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(java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    method public void endPrefixMapping(java.lang.String);
    method public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
    method public void parse(java.lang.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(java.lang.String, java.lang.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(java.lang.String) throws org.xml.sax.SAXException;
    method public void startDocument() throws org.xml.sax.SAXException;
    method public void startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) throws org.xml.sax.SAXException;
    method public void startPrefixMapping(java.lang.String, java.lang.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(java.lang.String) throws org.xml.sax.SAXException;
  }

}

package org.xmlpull.v1 {

  public abstract interface XmlPullParser {
    method public abstract void defineEntityReplacementText(java.lang.String, java.lang.String) throws org.xmlpull.v1.XmlPullParserException;
    method public abstract int getAttributeCount();
    method public abstract java.lang.String getAttributeName(int);
    method public abstract java.lang.String getAttributeNamespace(int);
    method public abstract java.lang.String getAttributePrefix(int);
    method public abstract java.lang.String getAttributeType(int);
    method public abstract java.lang.String getAttributeValue(int);
    method public abstract java.lang.String getAttributeValue(java.lang.String, java.lang.String);
    method public abstract int getColumnNumber();
    method public abstract int getDepth();
    method public abstract int getEventType() throws org.xmlpull.v1.XmlPullParserException;
    method public abstract boolean getFeature(java.lang.String);
    method public abstract java.lang.String getInputEncoding();
    method public abstract int getLineNumber();
    method public abstract java.lang.String getName();
    method public abstract java.lang.String getNamespace(java.lang.String);
    method public abstract java.lang.String getNamespace();
    method public abstract int getNamespaceCount(int) throws org.xmlpull.v1.XmlPullParserException;
    method public abstract java.lang.String getNamespacePrefix(int) throws org.xmlpull.v1.XmlPullParserException;
    method public abstract java.lang.String getNamespaceUri(int) throws org.xmlpull.v1.XmlPullParserException;
    method public abstract java.lang.String getPositionDescription();
    method public abstract java.lang.String getPrefix();
    method public abstract java.lang.Object getProperty(java.lang.String);
    method public abstract java.lang.String getText();
    method public abstract char[] getTextCharacters(int[]);
    method public abstract boolean isAttributeDefault(int);
    method public abstract boolean isEmptyElementTag() throws org.xmlpull.v1.XmlPullParserException;
    method public abstract boolean isWhitespace() throws org.xmlpull.v1.XmlPullParserException;
    method public abstract int next() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public abstract int nextTag() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public abstract java.lang.String nextText() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public abstract int nextToken() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public abstract void require(int, java.lang.String, java.lang.String) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public abstract void setFeature(java.lang.String, boolean) throws org.xmlpull.v1.XmlPullParserException;
    method public abstract void setInput(java.io.Reader) throws org.xmlpull.v1.XmlPullParserException;
    method public abstract void setInput(java.io.InputStream, java.lang.String) throws org.xmlpull.v1.XmlPullParserException;
    method public abstract void setProperty(java.lang.String, java.lang.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 java.lang.String FEATURE_PROCESS_DOCDECL = "http://xmlpull.org/v1/doc/features.html#process-docdecl";
    field public static final java.lang.String FEATURE_PROCESS_NAMESPACES = "http://xmlpull.org/v1/doc/features.html#process-namespaces";
    field public static final java.lang.String FEATURE_REPORT_NAMESPACE_ATTRIBUTES = "http://xmlpull.org/v1/doc/features.html#report-namespace-prefixes";
    field public static final java.lang.String FEATURE_VALIDATION = "http://xmlpull.org/v1/doc/features.html#validation";
    field public static final int IGNORABLE_WHITESPACE = 7; // 0x7
    field public static final java.lang.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 java.lang.String[] TYPES;
  }

  public class XmlPullParserException extends java.lang.Exception {
    ctor public XmlPullParserException(java.lang.String);
    ctor public XmlPullParserException(java.lang.String, org.xmlpull.v1.XmlPullParser, java.lang.Throwable);
    method public int getColumnNumber();
    method public java.lang.Throwable getDetail();
    method public int getLineNumber();
    field protected int column;
    field protected java.lang.Throwable detail;
    field protected int row;
  }

  public class XmlPullParserFactory {
    ctor protected XmlPullParserFactory();
    method public boolean getFeature(java.lang.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(java.lang.String, java.lang.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(java.lang.String, boolean) throws org.xmlpull.v1.XmlPullParserException;
    method public void setNamespaceAware(boolean);
    method public void setValidating(boolean);
    field public static final java.lang.String PROPERTY_NAME = "org.xmlpull.v1.XmlPullParserFactory";
    field protected java.lang.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 abstract interface XmlSerializer {
    method public abstract org.xmlpull.v1.XmlSerializer attribute(java.lang.String, java.lang.String, java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void cdsect(java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void comment(java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void docdecl(java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void endDocument() throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract org.xmlpull.v1.XmlSerializer endTag(java.lang.String, java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void entityRef(java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void flush() throws java.io.IOException;
    method public abstract int getDepth();
    method public abstract boolean getFeature(java.lang.String);
    method public abstract java.lang.String getName();
    method public abstract java.lang.String getNamespace();
    method public abstract java.lang.String getPrefix(java.lang.String, boolean) throws java.lang.IllegalArgumentException;
    method public abstract java.lang.Object getProperty(java.lang.String);
    method public abstract void ignorableWhitespace(java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void processingInstruction(java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void setFeature(java.lang.String, boolean) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void setOutput(java.io.OutputStream, java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void setOutput(java.io.Writer) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void setPrefix(java.lang.String, java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void setProperty(java.lang.String, java.lang.Object) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract void startDocument(java.lang.String, java.lang.Boolean) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract org.xmlpull.v1.XmlSerializer startTag(java.lang.String, java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract org.xmlpull.v1.XmlSerializer text(java.lang.String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public abstract 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(java.lang.String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public int getIndex(java.lang.String, java.lang.String);
    method public int getIndex(java.lang.String);
    method public int getLength();
    method public int getLineNumber();
    method public java.lang.String getLocalName(int);
    method public java.lang.Object getProperty(java.lang.String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public java.lang.String getPublicId();
    method public java.lang.String getQName(int);
    method public java.lang.String getSystemId();
    method public java.lang.String getType(int);
    method public java.lang.String getType(java.lang.String, java.lang.String);
    method public java.lang.String getType(java.lang.String);
    method public java.lang.String getURI(int);
    method public java.lang.String getValue(int);
    method public java.lang.String getValue(java.lang.String, java.lang.String);
    method public java.lang.String getValue(java.lang.String);
    method public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
    method public void parse(java.lang.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(java.lang.String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method public void setProperty(java.lang.String, java.lang.Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
    method protected void startElement(java.lang.String, java.lang.String, java.lang.String) throws org.xml.sax.SAXException;
    field protected static final java.lang.String APACHE_DYNAMIC_VALIDATION_FEATURE = "http://apache.org/xml/features/validation/dynamic";
    field protected static final java.lang.String APACHE_SCHEMA_VALIDATION_FEATURE = "http://apache.org/xml/features/validation/schema";
    field protected static final java.lang.String DECLARATION_HANDLER_PROPERTY = "http://xml.org/sax/properties/declaration-handler";
    field protected static final java.lang.String LEXICAL_HANDLER_PROPERTY = "http://xml.org/sax/properties/lexical-handler";
    field protected static final java.lang.String NAMESPACES_FEATURE = "http://xml.org/sax/features/namespaces";
    field protected static final java.lang.String NAMESPACE_PREFIXES_FEATURE = "http://xml.org/sax/features/namespace-prefixes";
    field protected static final java.lang.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 java.lang.String systemId;
  }

}

