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 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 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 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_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 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 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 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 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_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_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_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 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 accessibilityLiveRegion = 16843758; // 0x10103ee
    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 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 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 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 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 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 int canRequestEnhancedWebAccessibility = 16843736; // 0x10103d8
    field public static final int canRequestFilterKeyEvents = 16843737; // 0x10103d9
    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 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 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 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 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 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 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 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 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 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 deprecated int focusedMonthDateColor = 16843587; // 0x1010343
    field public static final int fontFamily = 16843692; // 0x10103ac
    field public static final int fontFeatureSettings = 16843959; // 0x10104b7
    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 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 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 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 isSticky = 16843335; // 0x1010247
    field public static final int isolatedProcess = 16843689; // 0x10103a9
    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 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 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 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_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_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 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 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 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 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 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 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 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 outlineProvider = 16843960; // 0x10104b8
    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 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 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 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 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 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 requiredForAllUsers = 16843728; // 0x10103d0
    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 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 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 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 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 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 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 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 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 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 tunerCount = 16844061; // 0x101051d
    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 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 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 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 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 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 int primary_text_dark = 17170433; // 0x1060001
    field public static final int primary_text_dark_nodisable = 17170434; // 0x1060002
    field public static final int primary_text_light = 17170435; // 0x1060003
    field public static final int primary_text_light_nodisable = 17170436; // 0x1060004
    field public static final int secondary_text_dark = 17170437; // 0x1060005
    field public static final int secondary_text_dark_nodisable = 17170438; // 0x1060006
    field public static final int secondary_text_light = 17170439; // 0x1060007
    field public static final int secondary_text_light_nodisable = 17170440; // 0x1060008
    field public static final int tab_indicator_text = 17170441; // 0x1060009
    field public static final int tertiary_text_dark = 17170448; // 0x1060010
    field public static final int tertiary_text_light = 17170449; // 0x1060011
    field public static final int transparent = 17170445; // 0x106000d
    field public static final int white = 17170443; // 0x106000b
    field public static final int widget_edittext_dark = 17170442; // 0x106000a
  }

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

  public static final class R.drawable {
    ctor public R.drawable();
    field public static final int alert_dark_frame = 17301504; // 0x1080000
    field public static final int alert_light_frame = 17301505; // 0x1080001
    field public static final int arrow_down_float = 17301506; // 0x1080002
    field public static final int arrow_up_float = 17301507; // 0x1080003
    field public static final int bottom_bar = 17301658; // 0x108009a
    field public static final int btn_default = 17301508; // 0x1080004
    field public static final int btn_default_small = 17301509; // 0x1080005
    field public static final int btn_dialog = 17301527; // 0x1080017
    field public static final int btn_dropdown = 17301510; // 0x1080006
    field public static final int btn_minus = 17301511; // 0x1080007
    field public static final int btn_plus = 17301512; // 0x1080008
    field public static final int btn_radio = 17301513; // 0x1080009
    field public static final int btn_star = 17301514; // 0x108000a
    field public static final int btn_star_big_off = 17301515; // 0x108000b
    field public static final int btn_star_big_on = 17301516; // 0x108000c
    field public static final int button_onoff_indicator_off = 17301518; // 0x108000e
    field public static final int button_onoff_indicator_on = 17301517; // 0x108000d
    field public static final int checkbox_off_background = 17301519; // 0x108000f
    field public static final int checkbox_on_background = 17301520; // 0x1080010
    field public static final int dark_header = 17301669; // 0x10800a5
    field public static final int dialog_frame = 17301521; // 0x1080011
    field public static final int dialog_holo_dark_frame = 17301682; // 0x10800b2
    field public static final int dialog_holo_light_frame = 17301683; // 0x10800b3
    field public static final int divider_horizontal_bright = 17301522; // 0x1080012
    field public static final int divider_horizontal_dark = 17301524; // 0x1080014
    field public static final int divider_horizontal_dim_dark = 17301525; // 0x1080015
    field public static final int divider_horizontal_textfield = 17301523; // 0x1080013
    field public static final int edit_text = 17301526; // 0x1080016
    field public static final int editbox_background = 17301528; // 0x1080018
    field public static final int editbox_background_normal = 17301529; // 0x1080019
    field public static final int editbox_dropdown_dark_frame = 17301530; // 0x108001a
    field public static final int editbox_dropdown_light_frame = 17301531; // 0x108001b
    field public static final int gallery_thumb = 17301532; // 0x108001c
    field public static final int ic_btn_speak_now = 17301668; // 0x10800a4
    field public static final int ic_delete = 17301533; // 0x108001d
    field public static final int ic_dialog_alert = 17301543; // 0x1080027
    field public static final int ic_dialog_dialer = 17301544; // 0x1080028
    field public static final int ic_dialog_email = 17301545; // 0x1080029
    field public static final int ic_dialog_info = 17301659; // 0x108009b
    field public static final int ic_dialog_map = 17301546; // 0x108002a
    field public static final int ic_input_add = 17301547; // 0x108002b
    field public static final int ic_input_delete = 17301548; // 0x108002c
    field public static final int ic_input_get = 17301549; // 0x108002d
    field public static final int ic_lock_idle_alarm = 17301550; // 0x108002e
    field public static final int ic_lock_idle_charging = 17301534; // 0x108001e
    field public static final int ic_lock_idle_lock = 17301535; // 0x108001f
    field public static final int ic_lock_idle_low_battery = 17301536; // 0x1080020
    field public static final int ic_lock_lock = 17301551; // 0x108002f
    field public static final int ic_lock_power_off = 17301552; // 0x1080030
    field public static final int ic_lock_silent_mode = 17301553; // 0x1080031
    field public static final int ic_lock_silent_mode_off = 17301554; // 0x1080032
    field public static final int ic_media_ff = 17301537; // 0x1080021
    field public static final int ic_media_next = 17301538; // 0x1080022
    field public static final int ic_media_pause = 17301539; // 0x1080023
    field public static final int ic_media_play = 17301540; // 0x1080024
    field public static final int ic_media_previous = 17301541; // 0x1080025
    field public static final int ic_media_rew = 17301542; // 0x1080026
    field public static final int ic_menu_add = 17301555; // 0x1080033
    field public static final int ic_menu_agenda = 17301556; // 0x1080034
    field public static final int ic_menu_always_landscape_portrait = 17301557; // 0x1080035
    field public static final int ic_menu_call = 17301558; // 0x1080036
    field public static final int ic_menu_camera = 17301559; // 0x1080037
    field public static final int ic_menu_close_clear_cancel = 17301560; // 0x1080038
    field public static final int ic_menu_compass = 17301561; // 0x1080039
    field public static final int ic_menu_crop = 17301562; // 0x108003a
    field public static final int ic_menu_day = 17301563; // 0x108003b
    field public static final int ic_menu_delete = 17301564; // 0x108003c
    field public static final int ic_menu_directions = 17301565; // 0x108003d
    field public static final int ic_menu_edit = 17301566; // 0x108003e
    field public static final int ic_menu_gallery = 17301567; // 0x108003f
    field public static final int ic_menu_help = 17301568; // 0x1080040
    field public static final int ic_menu_info_details = 17301569; // 0x1080041
    field public static final int ic_menu_manage = 17301570; // 0x1080042
    field public static final int ic_menu_mapmode = 17301571; // 0x1080043
    field public static final int ic_menu_month = 17301572; // 0x1080044
    field public static final int ic_menu_more = 17301573; // 0x1080045
    field public static final int ic_menu_my_calendar = 17301574; // 0x1080046
    field public static final int ic_menu_mylocation = 17301575; // 0x1080047
    field public static final int ic_menu_myplaces = 17301576; // 0x1080048
    field public static final int ic_menu_preferences = 17301577; // 0x1080049
    field public static final int ic_menu_recent_history = 17301578; // 0x108004a
    field public static final int ic_menu_report_image = 17301579; // 0x108004b
    field public static final int ic_menu_revert = 17301580; // 0x108004c
    field public static final int ic_menu_rotate = 17301581; // 0x108004d
    field public static final int ic_menu_save = 17301582; // 0x108004e
    field public static final int ic_menu_search = 17301583; // 0x108004f
    field public static final int ic_menu_send = 17301584; // 0x1080050
    field public static final int ic_menu_set_as = 17301585; // 0x1080051
    field public static final int ic_menu_share = 17301586; // 0x1080052
    field public static final int ic_menu_slideshow = 17301587; // 0x1080053
    field public static final int ic_menu_sort_alphabetically = 17301660; // 0x108009c
    field public static final int ic_menu_sort_by_size = 17301661; // 0x108009d
    field public static final int ic_menu_today = 17301588; // 0x1080054
    field public static final int ic_menu_upload = 17301589; // 0x1080055
    field public static final int ic_menu_upload_you_tube = 17301590; // 0x1080056
    field public static final int ic_menu_view = 17301591; // 0x1080057
    field public static final int ic_menu_week = 17301592; // 0x1080058
    field public static final int ic_menu_zoom = 17301593; // 0x1080059
    field public static final int ic_notification_clear_all = 17301594; // 0x108005a
    field public static final int ic_notification_overlay = 17301595; // 0x108005b
    field public static final int ic_partial_secure = 17301596; // 0x108005c
    field public static final int ic_popup_disk_full = 17301597; // 0x108005d
    field public static final int ic_popup_reminder = 17301598; // 0x108005e
    field public static final int ic_popup_sync = 17301599; // 0x108005f
    field public static final int ic_search_category_default = 17301600; // 0x1080060
    field public static final int ic_secure = 17301601; // 0x1080061
    field public static final int list_selector_background = 17301602; // 0x1080062
    field public static final int menu_frame = 17301603; // 0x1080063
    field public static final int menu_full_frame = 17301604; // 0x1080064
    field public static final int menuitem_background = 17301605; // 0x1080065
    field public static final int picture_frame = 17301606; // 0x1080066
    field public static final int presence_audio_away = 17301679; // 0x10800af
    field public static final int presence_audio_busy = 17301680; // 0x10800b0
    field public static final int presence_audio_online = 17301681; // 0x10800b1
    field public static final int presence_away = 17301607; // 0x1080067
    field public static final int presence_busy = 17301608; // 0x1080068
    field public static final int presence_invisible = 17301609; // 0x1080069
    field public static final int presence_offline = 17301610; // 0x108006a
    field public static final int presence_online = 17301611; // 0x108006b
    field public static final int presence_video_away = 17301676; // 0x10800ac
    field public static final int presence_video_busy = 17301677; // 0x10800ad
    field public static final int presence_video_online = 17301678; // 0x10800ae
    field public static final int progress_horizontal = 17301612; // 0x108006c
    field public static final int progress_indeterminate_horizontal = 17301613; // 0x108006d
    field public static final int radiobutton_off_background = 17301614; // 0x108006e
    field public static final int radiobutton_on_background = 17301615; // 0x108006f
    field public static final int screen_background_dark = 17301656; // 0x1080098
    field public static final int screen_background_dark_transparent = 17301673; // 0x10800a9
    field public static final int screen_background_light = 17301657; // 0x1080099
    field public static final int screen_background_light_transparent = 17301674; // 0x10800aa
    field public static final int spinner_background = 17301616; // 0x1080070
    field public static final int spinner_dropdown_background = 17301617; // 0x1080071
    field public static final int star_big_off = 17301619; // 0x1080073
    field public static final int star_big_on = 17301618; // 0x1080072
    field public static final int star_off = 17301621; // 0x1080075
    field public static final int star_on = 17301620; // 0x1080074
    field public static final int stat_notify_call_mute = 17301622; // 0x1080076
    field public static final int stat_notify_chat = 17301623; // 0x1080077
    field public static final int stat_notify_error = 17301624; // 0x1080078
    field public static final int stat_notify_missed_call = 17301631; // 0x108007f
    field public static final int stat_notify_more = 17301625; // 0x1080079
    field public static final int stat_notify_sdcard = 17301626; // 0x108007a
    field public static final int stat_notify_sdcard_prepare = 17301675; // 0x10800ab
    field public static final int stat_notify_sdcard_usb = 17301627; // 0x108007b
    field public static final int stat_notify_sync = 17301628; // 0x108007c
    field public static final int stat_notify_sync_noanim = 17301629; // 0x108007d
    field public static final int stat_notify_voicemail = 17301630; // 0x108007e
    field public static final int stat_sys_data_bluetooth = 17301632; // 0x1080080
    field public static final int stat_sys_download = 17301633; // 0x1080081
    field public static final int stat_sys_download_done = 17301634; // 0x1080082
    field public static final int stat_sys_headset = 17301635; // 0x1080083
    field 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 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 addToDictionary = 16908330; // 0x102002a
    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 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_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 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 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 int Theme_Holo = 16973931; // 0x103006b
    field public static final int Theme_Holo_Dialog = 16973935; // 0x103006f
    field public static final int Theme_Holo_DialogWhenLarge = 16973943; // 0x1030077
    field public static final int Theme_Holo_DialogWhenLarge_NoActionBar = 16973944; // 0x1030078
    field public static final int Theme_Holo_Dialog_MinWidth = 16973936; // 0x1030070
    field public static final int Theme_Holo_Dialog_NoActionBar = 16973937; // 0x1030071
    field public static final int Theme_Holo_Dialog_NoActionBar_MinWidth = 16973938; // 0x1030072
    field public static final int Theme_Holo_InputMethod = 16973951; // 0x103007f
    field public static final int Theme_Holo_Light = 16973934; // 0x103006e
    field public static final int Theme_Holo_Light_DarkActionBar = 16974105; // 0x1030119
    field public static final int Theme_Holo_Light_Dialog = 16973939; // 0x1030073
    field public static final int Theme_Holo_Light_DialogWhenLarge = 16973945; // 0x1030079
    field public static final int Theme_Holo_Light_DialogWhenLarge_NoActionBar = 16973946; // 0x103007a
    field public static final int Theme_Holo_Light_Dialog_MinWidth = 16973940; // 0x1030074
    field public static final int Theme_Holo_Light_Dialog_NoActionBar = 16973941; // 0x1030075
    field public static final int Theme_Holo_Light_Dialog_NoActionBar_MinWidth = 16973942; // 0x1030076
    field public static final int Theme_Holo_Light_NoActionBar = 16974064; // 0x10300f0
    field public static final int Theme_Holo_Light_NoActionBar_Fullscreen = 16974065; // 0x10300f1
    field public static final int Theme_Holo_Light_NoActionBar_Overscan = 16974302; // 0x10301de
    field public static final int Theme_Holo_Light_NoActionBar_TranslucentDecor = 16974306; // 0x10301e2
    field public static final int Theme_Holo_Light_Panel = 16973948; // 0x103007c
    field public static final int Theme_Holo_NoActionBar = 16973932; // 0x103006c
    field public static final int Theme_Holo_NoActionBar_Fullscreen = 16973933; // 0x103006d
    field public static final int Theme_Holo_NoActionBar_Overscan = 16974301; // 0x10301dd
    field public static final int Theme_Holo_NoActionBar_TranslucentDecor = 16974305; // 0x10301e1
    field public static final int Theme_Holo_Panel = 16973947; // 0x103007b
    field public static final int Theme_Holo_Wallpaper = 16973949; // 0x103007d
    field public static final int Theme_Holo_Wallpaper_NoTitleBar = 16973950; // 0x103007e
    field public static final int Theme_InputMethod = 16973908; // 0x1030054
    field public static final int Theme_Light = 16973836; // 0x103000c
    field public static final int Theme_Light_NoTitleBar = 16973837; // 0x103000d
    field public static final int Theme_Light_NoTitleBar_Fullscreen = 16973838; // 0x103000e
    field public static final int Theme_Light_Panel = 16973914; // 0x103005a
    field public static final int Theme_Light_WallpaperSettings = 16973922; // 0x1030062
    field public static final int Theme_Material = 16974372; // 0x1030224
    field public static final int Theme_Material_Dialog = 16974373; // 0x1030225
    field public static final int Theme_Material_DialogWhenLarge = 16974379; // 0x103022b
    field public static final int Theme_Material_DialogWhenLarge_NoActionBar = 16974380; // 0x103022c
    field public static final int Theme_Material_Dialog_Alert = 16974374; // 0x1030226
    field public static final int Theme_Material_Dialog_MinWidth = 16974375; // 0x1030227
    field public static final int Theme_Material_Dialog_NoActionBar = 16974376; // 0x1030228
    field public static final int Theme_Material_Dialog_NoActionBar_MinWidth = 16974377; // 0x1030229
    field public static final int Theme_Material_Dialog_Presentation = 16974378; // 0x103022a
    field public static final int Theme_Material_InputMethod = 16974381; // 0x103022d
    field public static final int Theme_Material_Light = 16974391; // 0x1030237
    field public static final int Theme_Material_Light_DarkActionBar = 16974392; // 0x1030238
    field public static final int Theme_Material_Light_Dialog = 16974393; // 0x1030239
    field public static final int Theme_Material_Light_DialogWhenLarge = 16974399; // 0x103023f
    field public static final int Theme_Material_Light_DialogWhenLarge_DarkActionBar = 16974552; // 0x10302d8
    field public static final int Theme_Material_Light_DialogWhenLarge_NoActionBar = 16974400; // 0x1030240
    field public static final int Theme_Material_Light_Dialog_Alert = 16974394; // 0x103023a
    field public static final int Theme_Material_Light_Dialog_MinWidth = 16974395; // 0x103023b
    field public static final int Theme_Material_Light_Dialog_NoActionBar = 16974396; // 0x103023c
    field public static final int Theme_Material_Light_Dialog_NoActionBar_MinWidth = 16974397; // 0x103023d
    field public static final int Theme_Material_Light_Dialog_Presentation = 16974398; // 0x103023e
    field public static final int Theme_Material_Light_LightStatusBar = 16974549; // 0x10302d5
    field public static final int Theme_Material_Light_NoActionBar = 16974401; // 0x1030241
    field public static final int Theme_Material_Light_NoActionBar_Fullscreen = 16974402; // 0x1030242
    field public static final int Theme_Material_Light_NoActionBar_Overscan = 16974403; // 0x1030243
    field public static final int Theme_Material_Light_NoActionBar_TranslucentDecor = 16974404; // 0x1030244
    field public static final int Theme_Material_Light_Panel = 16974405; // 0x1030245
    field public static final int Theme_Material_Light_Voice = 16974406; // 0x1030246
    field public static final int Theme_Material_NoActionBar = 16974382; // 0x103022e
    field public static final int Theme_Material_NoActionBar_Fullscreen = 16974383; // 0x103022f
    field public static final int Theme_Material_NoActionBar_Overscan = 16974384; // 0x1030230
    field public static final int Theme_Material_NoActionBar_TranslucentDecor = 16974385; // 0x1030231
    field public static final int Theme_Material_Panel = 16974386; // 0x1030232
    field public static final int Theme_Material_Settings = 16974387; // 0x1030233
    field public static final int Theme_Material_Voice = 16974388; // 0x1030234
    field public static final int Theme_Material_Wallpaper = 16974389; // 0x1030235
    field public static final int Theme_Material_Wallpaper_NoTitleBar = 16974390; // 0x1030236
    field public static final int Theme_NoDisplay = 16973909; // 0x1030055
    field public static final int Theme_NoTitleBar = 16973830; // 0x1030006
    field public static final int Theme_NoTitleBar_Fullscreen = 16973831; // 0x1030007
    field public static final int Theme_NoTitleBar_OverlayActionModes = 16973930; // 0x103006a
    field public static final int Theme_Panel = 16973913; // 0x1030059
    field public static final int Theme_Translucent = 16973839; // 0x103000f
    field public static final int Theme_Translucent_NoTitleBar = 16973840; // 0x1030010
    field public static final int Theme_Translucent_NoTitleBar_Fullscreen = 16973841; // 0x1030011
    field public static final int Theme_Wallpaper = 16973918; // 0x103005e
    field public static final int Theme_WallpaperSettings = 16973921; // 0x1030061
    field public static final int Theme_Wallpaper_NoTitleBar = 16973919; // 0x103005f
    field public static final int Theme_Wallpaper_NoTitleBar_Fullscreen = 16973920; // 0x1030060
    field public static final int Theme_WithActionBar = 16973929; // 0x1030069
    field public static final int Widget = 16973842; // 0x1030012
    field public static final int Widget_AbsListView = 16973843; // 0x1030013
    field public static final int Widget_ActionBar = 16973954; // 0x1030082
    field public static final int Widget_ActionBar_TabBar = 16974068; // 0x10300f4
    field public static final int Widget_ActionBar_TabText = 16974067; // 0x10300f3
    field public static final int Widget_ActionBar_TabView = 16974066; // 0x10300f2
    field public static final int Widget_ActionButton = 16973956; // 0x1030084
    field public static final int Widget_ActionButton_CloseMode = 16973960; // 0x1030088
    field public static final int Widget_ActionButton_Overflow = 16973959; // 0x1030087
    field public static final int Widget_AutoCompleteTextView = 16973863; // 0x1030027
    field public static final int Widget_Button = 16973844; // 0x1030014
    field public static final int Widget_Button_Inset = 16973845; // 0x1030015
    field public static final int Widget_Button_Small = 16973846; // 0x1030016
    field public static final int Widget_Button_Toggle = 16973847; // 0x1030017
    field public static final int Widget_CalendarView = 16974059; // 0x10300eb
    field public static final int Widget_CompoundButton = 16973848; // 0x1030018
    field public static final int Widget_CompoundButton_CheckBox = 16973849; // 0x1030019
    field public static final int Widget_CompoundButton_RadioButton = 16973850; // 0x103001a
    field public static final int Widget_CompoundButton_Star = 16973851; // 0x103001b
    field public static final int Widget_DatePicker = 16974062; // 0x10300ee
    field public static final int Widget_DeviceDefault = 16974144; // 0x1030140
    field public static final int Widget_DeviceDefault_ActionBar = 16974187; // 0x103016b
    field public static final int Widget_DeviceDefault_ActionBar_Solid = 16974195; // 0x1030173
    field public static final int Widget_DeviceDefault_ActionBar_TabBar = 16974194; // 0x1030172
    field public static final int Widget_DeviceDefault_ActionBar_TabText = 16974193; // 0x1030171
    field public static final int Widget_DeviceDefault_ActionBar_TabView = 16974192; // 0x1030170
    field public static final int Widget_DeviceDefault_ActionButton = 16974182; // 0x1030166
    field public static final int Widget_DeviceDefault_ActionButton_CloseMode = 16974186; // 0x103016a
    field public static final int Widget_DeviceDefault_ActionButton_Overflow = 16974183; // 0x1030167
    field public static final int Widget_DeviceDefault_ActionButton_TextButton = 16974184; // 0x1030168
    field public static final int Widget_DeviceDefault_ActionMode = 16974185; // 0x1030169
    field public static final int Widget_DeviceDefault_AutoCompleteTextView = 16974151; // 0x1030147
    field public static final int Widget_DeviceDefault_Button = 16974145; // 0x1030141
    field public static final int Widget_DeviceDefault_Button_Borderless = 16974188; // 0x103016c
    field public static final int Widget_DeviceDefault_Button_Borderless_Small = 16974149; // 0x1030145
    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 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.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_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_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 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 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_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_INCLUDE_NOT_IMPORTANT_VIEWS = 2; // 0x2
    field public static final int FLAG_REPORT_VIEW_IDS = 16; // 0x10
    field public static final int FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 8; // 0x8
    field public static final int FLAG_REQUEST_FILTER_KEY_EVENTS = 32; // 0x20
    field public static final int FLAG_REQUEST_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 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);
    method public long getDuration();
    method public android.graphics.Path getPath();
    method public long getStartTime();
  }

}

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 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 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 void addOnAccountsUpdatedListener(android.accounts.OnAccountsUpdateListener, android.os.Handler, boolean);
    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 static android.accounts.AccountManager get(android.content.Context);
    method public android.accounts.Account[] getAccounts();
    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.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 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 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> 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_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_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 java.lang.String LOGIN_ACCOUNTS_CHANGED_ACTION = "android.accounts.LOGIN_ACCOUNTS_CHANGED";
  }

  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 abstract void onAnimationEnd(android.animation.Animator);
    method public abstract void onAnimationRepeat(android.animation.Animator);
    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 java.util.ArrayList<android.animation.Animator> getChildAnimations();
    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 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 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 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 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 float getDurationScale();
    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 static void setDurationScale(float);
    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 void enterPictureInPictureMode();
    method public android.view.View 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 android.app.FragmentManager getFragmentManager();
    method public android.content.Intent getIntent();
    method public java.lang.Object getLastNonConfigurationInstance();
    method public android.view.LayoutInflater getLayoutInflater();
    method public android.app.LoaderManager getLoaderManager();
    method public java.lang.String getLocalClassName();
    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 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 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 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);
    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);
    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 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 boolean requestVisibleBehind(boolean);
    method public final boolean requestWindowFeature(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 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 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 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 void startActivityFromFragment(android.app.Fragment, android.content.Intent, int);
    method public 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 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 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 int IMPORTANCE_BACKGROUND = 400; // 0x190
    field public static final int IMPORTANCE_EMPTY = 500; // 0x1f4
    field public static final int IMPORTANCE_FOREGROUND = 100; // 0x64
    field public static final int IMPORTANCE_FOREGROUND_SERVICE = 125; // 0x7d
    field public static final int IMPORTANCE_GONE = 1000; // 0x3e8
    field public static final int IMPORTANCE_PERCEPTIBLE = 130; // 0x82
    field public static final int IMPORTANCE_SERVICE = 300; // 0x12c
    field public static final int IMPORTANCE_TOP_SLEEPING = 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 ActivityManager.TaskDescription(java.lang.String, android.graphics.Bitmap, int);
    ctor public ActivityManager.TaskDescription(java.lang.String, android.graphics.Bitmap);
    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 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 setLaunchBounds(android.graphics.Rect);
    method public void setLaunchStackId(int);
    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 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_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_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_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 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 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 android.view.View 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 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 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 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 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 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 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);
    method public boolean onOptionsItemSelected(android.view.MenuItem);
    method public void onOptionsMenuClosed(android.view.Menu);
    method public void onPause();
    method public 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 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 unregisterForContextMenu(android.view.View);
  }

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

  public static 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 protected void onLayout(boolean, int, int, int, int);
    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 interface FragmentBreadCrumbs.OnBreadCrumbClickListener {
    method public abstract boolean onBreadCrumbClick(android.app.FragmentManager.BackStackEntry, int);
  }

  public abstract class FragmentContainer {
    ctor public FragmentContainer();
    method public abstract android.view.View onFindViewById(int);
    method public abstract boolean onHasView();
  }

  public 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 void dispatchMultiWindowModeChanged(boolean);
    method public boolean dispatchOptionsItemSelected(android.view.MenuItem);
    method public void dispatchOptionsMenuClosed(android.view.Menu);
    method public void dispatchPause();
    method public void dispatchPictureInPictureModeChanged(boolean);
    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 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 android.view.View 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 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 void invalidateOptionsMenu();
    method public abstract boolean isDestroyed();
    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 removeOnBackStackChangedListener(android.app.FragmentManager.OnBackStackChangedListener);
    method public abstract android.app.Fragment.SavedState saveFragmentInstanceState(android.app.Fragment);
    field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
  }

  public static abstract 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 interface FragmentManager.OnBackStackChangedListener {
    method public abstract void onBackStackChanged();
  }

  public class FragmentManagerNonConfig {
  }

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

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

  public static abstract 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 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 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 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 java.lang.String getGroup();
    method public android.graphics.drawable.Icon getLargeIcon();
    method public android.graphics.drawable.Icon getSmallIcon();
    method public java.lang.String getSortKey();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT;
    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_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_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_CHRONOMETER_COUNT_DOWN = "android.chronometerCountDown";
    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_INFO_TEXT = "android.infoText";
    field public static final 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_PEOPLE = "android.people";
    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_HISTORY = "android.remoteInputHistory";
    field public static final 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 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 int FLAG_SHOW_LIGHTS = 1; // 0x1
    field public static final java.lang.String INTENT_CATEGORY_NOTIFICATION_PREFERENCES = "android.intent.category.NOTIFICATION_PREFERENCES";
    field public static final int PRIORITY_DEFAULT = 0; // 0x0
    field public static final int PRIORITY_HIGH = 1; // 0x1
    field public static final int PRIORITY_LOW = -1; // 0xffffffff
    field public static final int PRIORITY_MAX = 2; // 0x2
    field public static final 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 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 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 int ledARGB;
    field public int ledOffMS;
    field public int ledOnMS;
    field public deprecated int number;
    field public int priority;
    field public android.app.Notification publicVersion;
    field public android.net.Uri sound;
    field public java.lang.CharSequence tickerText;
    field public deprecated android.widget.RemoteViews tickerView;
    field public 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.os.Bundle getExtras();
    method public android.graphics.drawable.Icon getIcon();
    method public android.app.RemoteInput[] getRemoteInputs();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.Notification.Action> CREATOR;
    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);
  }

  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 java.lang.CharSequence getCancelLabel();
    method public java.lang.CharSequence getConfirmLabel();
    method public boolean getHintDisplayActionInline();
    method public boolean getHintLaunchesActivity();
    method public java.lang.CharSequence getInProgressLabel();
    method public boolean isAvailableOffline();
    method public android.app.Notification.Action.WearableExtender setAvailableOffline(boolean);
    method public android.app.Notification.Action.WearableExtender setCancelLabel(java.lang.CharSequence);
    method public 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 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);
    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 android.app.Notification.Builder addPerson(java.lang.String);
    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 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 setCategory(java.lang.String);
    method public android.app.Notification.Builder setChronometerCountDown(boolean);
    method public android.app.Notification.Builder setColor(int);
    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 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 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 android.app.Notification.Builder setLights(int, int, int);
    method public android.app.Notification.Builder setLocalOnly(boolean);
    method public deprecated android.app.Notification.Builder setNumber(int);
    method public android.app.Notification.Builder setOngoing(boolean);
    method public android.app.Notification.Builder setOnlyAlertOnce(boolean);
    method public android.app.Notification.Builder setPriority(int);
    method public android.app.Notification.Builder setProgress(int, int, boolean);
    method public android.app.Notification.Builder setPublicVersion(android.app.Notification);
    method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]);
    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 android.app.Notification.Builder setSound(android.net.Uri);
    method public deprecated android.app.Notification.Builder setSound(android.net.Uri, int);
    method public android.app.Notification.Builder setSound(android.net.Uri, android.media.AudioAttributes);
    method public android.app.Notification.Builder setStyle(android.app.Notification.Style);
    method public android.app.Notification.Builder setSubText(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 setUsesChronometer(boolean);
    method public android.app.Notification.Builder setVibrate(long[]);
    method public android.app.Notification.Builder setVisibility(int);
    method public android.app.Notification.Builder setWhen(long);
  }

  public static final class Notification.CarExtender implements android.app.Notification.Extender {
    ctor public Notification.CarExtender();
    ctor public Notification.CarExtender(android.app.Notification);
    method public android.app.Notification.Builder extend(android.app.Notification.Builder);
    method 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 Notification.MessagingStyle(java.lang.CharSequence);
    method public android.app.Notification.MessagingStyle addMessage(java.lang.CharSequence, long, java.lang.CharSequence);
    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> getMessages();
    method public java.lang.CharSequence getUserDisplayName();
    method public android.app.Notification.MessagingStyle setConversationTitle(java.lang.CharSequence);
    field public static final int MAXIMUM_RETAINED_MESSAGES = 25; // 0x19
  }

  public static final class Notification.MessagingStyle.Message {
    ctor public Notification.MessagingStyle.Message(java.lang.CharSequence, long, java.lang.CharSequence);
    method public java.lang.String getDataMimeType();
    method public android.net.Uri getDataUri();
    method public java.lang.CharSequence getSender();
    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 int getContentAction();
    method public int getContentIcon();
    method public int getContentIconGravity();
    method public boolean getContentIntentAvailableOffline();
    method public int getCustomContentHeight();
    method public int getCustomSizePreset();
    method public java.lang.String getDismissalId();
    method public android.app.PendingIntent getDisplayIntent();
    method public int getGravity();
    method public boolean getHintAmbientBigPicture();
    method public boolean getHintAvoidBackgroundClipping();
    method public boolean getHintContentIntentLaunchesActivity();
    method public boolean getHintHideIcon();
    method public int getHintScreenTimeout();
    method public boolean getHintShowBackgroundOnly();
    method public java.util.List<android.app.Notification> getPages();
    method public boolean getStartScrollBottom();
    method public android.app.Notification.WearableExtender setBackground(android.graphics.Bitmap);
    method public android.app.Notification.WearableExtender setContentAction(int);
    method public android.app.Notification.WearableExtender setContentIcon(int);
    method public android.app.Notification.WearableExtender setContentIconGravity(int);
    method public android.app.Notification.WearableExtender setContentIntentAvailableOffline(boolean);
    method public android.app.Notification.WearableExtender setCustomContentHeight(int);
    method public 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 android.app.Notification.WearableExtender setGravity(int);
    method public android.app.Notification.WearableExtender setHintAmbientBigPicture(boolean);
    method public android.app.Notification.WearableExtender setHintAvoidBackgroundClipping(boolean);
    method public android.app.Notification.WearableExtender setHintContentIntentLaunchesActivity(boolean);
    method public android.app.Notification.WearableExtender setHintHideIcon(boolean);
    method public android.app.Notification.WearableExtender setHintScreenTimeout(int);
    method public android.app.Notification.WearableExtender setHintShowBackgroundOnly(boolean);
    method public android.app.Notification.WearableExtender setStartScrollBottom(boolean);
    field public static final int SCREEN_TIMEOUT_LONG = -1; // 0xffffffff
    field public static final int SCREEN_TIMEOUT_SHORT = 0; // 0x0
    field public static final int SIZE_DEFAULT = 0; // 0x0
    field public static final int SIZE_FULL_SCREEN = 5; // 0x5
    field public static final int SIZE_LARGE = 4; // 0x4
    field public static final int SIZE_MEDIUM = 3; // 0x3
    field public static final int SIZE_SMALL = 2; // 0x2
    field public static final int SIZE_XSMALL = 1; // 0x1
    field public static final int UNSET_ACTION_INDEX = -1; // 0xffffffff
  }

  public 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 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.NotificationManager.Policy getNotificationPolicy();
    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_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_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 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_CALLS = 8; // 0x8
    field public static final int PRIORITY_CATEGORY_EVENTS = 2; // 0x2
    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_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_SCREEN_OFF = 1; // 0x1
    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 2; // 0x2
    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 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 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 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 RemoteInput implements android.os.Parcelable {
    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.lang.CharSequence[] getChoices();
    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 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";
  }

  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 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 android.widget.TimePicker getTimePicker();
    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 void destroy();
    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 final 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 boolean grantRuntimePermission(java.lang.String, java.lang.String, android.os.UserHandle);
    method public boolean injectInputEvent(android.view.InputEvent, boolean);
    method public final boolean performGlobalAction(int);
    method public boolean revokeRuntimePermission(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 final 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 boolean isNightModeLocked();
    method public boolean isUiModeLocked();
    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 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 clear() throws java.io.IOException;
    method public void clear(int) throws java.io.IOException;
    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.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 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 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";
  }

}

package android.app.admin {

  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 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 onPasswordChanged(android.content.Context, android.content.Intent);
    method public void onPasswordExpiring(android.content.Context, android.content.Intent);
    method public void onPasswordFailed(android.content.Context, android.content.Intent);
    method public void onPasswordSucceeded(android.content.Context, android.content.Intent);
    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);
    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";
  }

  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 void addPersistentPreferredActivity(android.content.ComponentName, android.content.IntentFilter, android.content.ComponentName);
    method public void addUserRestriction(android.content.ComponentName, java.lang.String);
    method public void clearCrossProfileIntentFilters(android.content.ComponentName);
    method public void clearDeviceOwnerApp(java.lang.String);
    method public void clearPackagePersistentPreferredActivities(android.content.ComponentName, java.lang.String);
    method public void clearProfileOwner(android.content.ComponentName);
    method public void clearUserRestriction(android.content.ComponentName, 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 java.lang.String[] getAccountTypesWithManagementDisabled();
    method public java.util.List<android.content.ComponentName> getActiveAdmins();
    method public java.lang.String getAlwaysOnVpnPackage(android.content.ComponentName);
    method public android.os.Bundle getApplicationRestrictions(android.content.ComponentName, java.lang.String);
    method public java.lang.String getApplicationRestrictionsManagingPackage(android.content.ComponentName);
    method public boolean getAutoTimeRequired();
    method public boolean getBluetoothContactSharingDisabled(android.content.ComponentName);
    method public boolean getCameraDisabled(android.content.ComponentName);
    method public 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.lang.CharSequence getDeviceOwnerLockScreenInfo();
    method public java.util.List<byte[]> getInstalledCaCerts(android.content.ComponentName);
    method public int getKeyguardDisabledFeatures(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 int getOrganizationColor(android.content.ComponentName);
    method public java.lang.CharSequence getOrganizationName(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 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> getPermittedInputMethods(android.content.ComponentName);
    method public boolean getScreenCaptureDisabled(android.content.ComponentName);
    method public java.lang.CharSequence getShortSupportMessage(android.content.ComponentName);
    method public boolean getStorageEncryption(android.content.ComponentName);
    method public int getStorageEncryptionStatus();
    method public android.app.admin.SystemUpdatePolicy getSystemUpdatePolicy();
    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 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 isActivePasswordSufficient();
    method public boolean isAdminActive(android.content.ComponentName);
    method public boolean isApplicationHidden(android.content.ComponentName, java.lang.String);
    method public boolean isCallerApplicationRestrictionsManagingPackage();
    method public boolean isDeviceOwnerApp(java.lang.String);
    method public boolean isLockTaskPermitted(java.lang.String);
    method public boolean isManagedProfile(android.content.ComponentName);
    method public boolean isMasterVolumeMuted(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 isSecurityLoggingEnabled(android.content.ComponentName);
    method public boolean isUninstallBlocked(android.content.ComponentName, java.lang.String);
    method public void lockNow();
    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 removeUser(android.content.ComponentName, android.os.UserHandle);
    method public boolean requestBugreport(android.content.ComponentName);
    method public boolean resetPassword(java.lang.String, int);
    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 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 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 setBluetoothContactSharingDisabled(android.content.ComponentName, boolean);
    method public void setCameraDisabled(android.content.ComponentName, boolean);
    method public 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 setDeviceOwnerLockScreenInfo(android.content.ComponentName, java.lang.CharSequence);
    method public void setGlobalSetting(android.content.ComponentName, java.lang.String, java.lang.String);
    method public boolean setKeyguardDisabled(android.content.ComponentName, boolean);
    method public void setKeyguardDisabledFeatures(android.content.ComponentName, int);
    method public void setLockTaskPackages(android.content.ComponentName, java.lang.String[]) throws java.lang.SecurityException;
    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 void setOrganizationColor(android.content.ComponentName, int);
    method public void setOrganizationName(android.content.ComponentName, java.lang.CharSequence);
    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 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 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 boolean setStatusBarDisabled(android.content.ComponentName, boolean);
    method public int setStorageEncryption(android.content.ComponentName, boolean);
    method public void setSystemUpdatePolicy(android.content.ComponentName, android.app.admin.SystemUpdatePolicy);
    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 boolean switchUser(android.content.ComponentName, android.os.UserHandle);
    method public void uninstallAllUserCaCerts(android.content.ComponentName);
    method public void uninstallCaCert(android.content.ComponentName, byte[]);
    method public void wipeData(int);
    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_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_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 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_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_EMAIL_ADDRESS = "android.app.extra.PROVISIONING_EMAIL_ADDRESS";
    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_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_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2
    field public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 1; // 0x1
    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_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 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 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_EXTERNAL_STORAGE = 1; // 0x1
    field public static final int WIPE_RESET_PROTECTION_DATA = 2; // 0x2
  }

  public class SecurityLog {
    ctor public SecurityLog();
    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_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_SYNC_RECV_FILE = 210003; // 0x33453
    field public static final int TAG_SYNC_SEND_FILE = 210004; // 0x33454
  }

  public static final class SecurityLog.SecurityEvent implements android.os.Parcelable {
    method public int describeContents();
    method public java.lang.Object getData();
    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 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 int getInstallWindowEnd();
    method public int getInstallWindowStart();
    method public int getPolicyType();
    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
  }

}

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 android.content.ComponentName getActivityComponent();
    method public android.app.assist.AssistStructure.WindowNode getWindowNodeAt(int);
    method public int getWindowNodeCount();
    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 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 int getId();
    method public java.lang.String getIdEntry();
    method public java.lang.String getIdPackage();
    method public java.lang.String getIdType();
    method public int getLeft();
    method public int getScrollX();
    method public int getScrollY();
    method public java.lang.CharSequence getText();
    method public int getTextBackgroundColor();
    method public int getTextColor();
    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 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 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 onRestoreFile(android.os.ParcelFileDescriptor, long, java.io.File, int, long, long) throws java.io.IOException;
    method public void onRestoreFinished();
    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 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 int requestRestore(android.app.backup.RestoreObserver);
  }

  public class FileBackupHelper extends android.app.backup.FileBackupHelperBase 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);
  }

   class FileBackupHelperBase {
    method public void writeNewStateDescription(android.os.ParcelFileDescriptor);
  }

  public class FullBackupDataOutput {
  }

  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 extends android.app.backup.FileBackupHelperBase 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.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 int getNetworkType();
    method public android.content.ComponentName getService();
    method public long getTriggerContentMaxDelay();
    method public long getTriggerContentUpdateDelay();
    method public android.app.job.JobInfo.TriggerContentUri[] getTriggerContentUris();
    method public boolean isPeriodic();
    method public boolean isPersisted();
    method public boolean isRequireCharging();
    method public boolean isRequireDeviceIdle();
    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_TYPE_ANY = 1; // 0x1
    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 setExtras(android.os.PersistableBundle);
    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 setRequiredNetworkType(int);
    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 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 int describeContents();
    method public android.os.PersistableBundle getExtras();
    method public int getJobId();
    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 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";
  }

}

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 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 long getEndTimeStamp();
    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 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 android.os.RemoteException, 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 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 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 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 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 SHORTCUT_INVOCATION = 8; // 0x8
    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 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 android.app.usage.UsageEvents queryEvents(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
  }

}

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 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 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> getInstalledProvidersForProfile(android.os.UserHandle);
    method public static android.appwidget.AppWidgetManager getInstance(android.content.Context);
    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 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);
    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_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 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;
  }

}

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 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 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 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 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 boolean readRemoteRssi();
    method public boolean requestConnectionPriority(int);
    method public boolean requestMtu(int);
    method public boolean setCharacteristicNotification(android.bluetooth.BluetoothGattCharacteristic, boolean);
    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 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 boolean removeService(android.bluetooth.BluetoothGattService);
    method public boolean sendResponse(android.bluetooth.BluetoothDevice, int, int, int, byte[]);
  }

  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 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 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 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 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 stopAdvertising(android.bluetooth.le.AdvertiseCallback);
  }

  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 void stopScan(android.bluetooth.le.ScanCallback);
  }

  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 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 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> getServiceUuids();
    method public int getTxPowerLevel();
  }

  public final class ScanResult implements android.os.Parcelable {
    ctor public ScanResult(android.bluetooth.BluetoothDevice, android.bluetooth.le.ScanRecord, int, long);
    method public int describeContents();
    method public android.bluetooth.BluetoothDevice getDevice();
    method public int getRssi();
    method public android.bluetooth.le.ScanRecord getScanRecord();
    method public long getTimestampNanos();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.le.ScanResult> CREATOR;
  }

  public final class ScanSettings implements android.os.Parcelable {
    method public int describeContents();
    method public int getCallbackType();
    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 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 setMatchMode(int);
    method public android.bluetooth.le.ScanSettings.Builder setNumOfMatches(int);
    method public android.bluetooth.le.ScanSettings.Builder setReportDelay(long);
    method public android.bluetooth.le.ScanSettings.Builder setScanMode(int);
  }

}

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);
    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 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 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 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 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 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 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 java.lang.String[] getSyncAdapterPackagesForAuthorityAsUser(java.lang.String, int);
    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 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_SIZE = "android.content.extra.SIZE";
    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 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 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 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 int getUserId();
    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, java.lang.String, android.os.Handler);
    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 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 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 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 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 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 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 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 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_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_P2P_SERVICE = "wifip2p";
    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 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 int getUserId();
    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, java.lang.String, android.os.Handler);
    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 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 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 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 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_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 java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
    field public static final 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_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_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_UNIT_TEST = "android.intent.category.UNIT_TEST";
    field public static final java.lang.String CATEGORY_VOICE = "android.intent.category.VOICE";
    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_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_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_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 java.lang.String EXTRA_SHORTCUT_ICON = "android.intent.extra.shortcut.ICON";
    field public static final java.lang.String EXTRA_SHORTCUT_ICON_RESOURCE = "android.intent.extra.shortcut.ICON_RESOURCE";
    field public static final java.lang.String EXTRA_SHORTCUT_INTENT = "android.intent.extra.shortcut.INTENT";
    field public static final 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_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_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_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 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 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 class Loader.ForceLoadContentObserver extends android.database.ContentObserver {
    ctor public Loader.ForceLoadContentObserver();
  }

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

  public static abstract 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 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 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 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 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 boolean isPrivilegedApp();
    method public boolean isSystemApp();
    method public java.lang.CharSequence loadDescription(android.content.pm.PackageManager);
    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 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 backupAgentName;
    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[] splitPublicSourceDirs;
    field public java.lang.String[] splitSourceDirs;
    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 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;
  }

  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 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[] splitPublicSourceDirs;
    field public java.lang.String[] splitSourceDirs;
    field public java.lang.String targetPackage;
  }

  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 {
    ctor public LauncherApps(android.content.Context);
    method public java.util.List<android.content.pm.LauncherActivityInfo> getActivityList(java.lang.String, android.os.UserHandle);
    method public android.graphics.drawable.Drawable getShortcutBadgedIconDrawable(android.content.pm.ShortcutInfo, int);
    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 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);
  }

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

  public class PackageInfo implements android.os.Parcelable {
    ctor public PackageInfo();
    method public int describeContents();
    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 android.content.pm.Signature[] signatures;
    field public java.lang.String[] splitNames;
    field public int[] splitRevisionCodes;
    field public 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 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_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_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);
  }

  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 java.lang.String getInstallerPackageName();
    method public float getProgress();
    method public int getSessionId();
    method public boolean isActive();
    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 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 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 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 int getComponentEnabledSetting(android.content.ComponentName);
    method public abstract android.graphics.drawable.Drawable getDefaultActivityIcon();
    method public abstract java.lang.String getDefaultBrowserPackageNameAsUser(int);
    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 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.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 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 abstract boolean hasSystemFeature(java.lang.String);
    method public abstract boolean hasSystemFeature(java.lang.String, int);
    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 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 verifyPendingInstall(int, int);
    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_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_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_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_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_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_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_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_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_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_GSM = "android.hardware.telephony.gsm";
    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_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_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_DIRECT = "android.hardware.wifi.direct";
    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 int GET_SIGNATURES = 64; // 0x40
    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 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
  }

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

  public 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 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_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_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 int PROTECTION_MASK_BASE = 15; // 0xf
    field public static final int PROTECTION_MASK_FLAGS = 4080; // 0xff0
    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 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 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 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 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 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 {
    ctor public ShortcutManager(android.content.Context);
    method public boolean addDynamicShortcuts(java.util.List<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 void removeAllDynamicShortcuts();
    method public void removeDynamicShortcuts(java.util.List<java.lang.String>);
    method public void reportShortcutUsed(java.lang.String);
    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;
  }

}

package android.content.res {

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

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

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

  public final class AssetManager implements java.lang.AutoCloseable {
    method public void close();
    method public final java.lang.String[] getLocales();
    method public final java.lang.String[] list(java.lang.String) throws java.io.IOException;
    method public final java.io.InputStream open(java.lang.String) throws java.io.IOException;
    method public final java.io.InputStream open(java.lang.String, int) throws java.io.IOException;
    method public final android.content.res.AssetFileDescriptor openFd(java.lang.String) throws java.io.IOException;
    method public final android.content.res.AssetFileDescriptor openNonAssetFd(java.lang.String) throws java.io.IOException;
    method public final android.content.res.AssetFileDescriptor openNonAssetFd(int, java.lang.String) throws java.io.IOException;
    method public final android.content.res.XmlResourceParser openXmlResourceParser(java.lang.String) throws java.io.IOException;
    method public final 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 final int available() throws java.io.IOException;
    method public final void close() throws java.io.IOException;
    method public final void mark(int);
    method public final boolean markSupported();
    method public final int read() throws java.io.IOException;
    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 void reset() throws java.io.IOException;
    method public final long skip(long) 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 isScreenRound();
    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 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_WATCH = 6; // 0x6
    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 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 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 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 abstract java.lang.String[] getColumnNames();
    method public abstract int getCount();
    method public abstract double getDouble(int);
    method public android.os.Bundle getExtras();
    method public abstract float getFloat(int);
    method public abstract int getInt(int);
    method public abstract long getLong(int);
    method public android.net.Uri getNotificationUri();
    method public final int getPosition();
    method public abstract short getShort(int);
    method public abstract java.lang.String getString(int);
    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 abstract boolean isNull(int);
    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 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 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 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 final 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.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 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);
    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 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, 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 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 final int getAllocationByteCount();
    method public final int getByteCount();
    method public final android.graphics.Bitmap.Config getConfig();
    method public int getDensity();
    method public int getGenerationId();
    method public final 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 final 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 final int getWidth();
    method public final boolean hasAlpha();
    method public final boolean hasMipMap();
    method public final boolean isMutable();
    method public final boolean isPremultiplied();
    method public final 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 final 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 final 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 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.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 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 final 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 clipPath(android.graphics.Path, android.graphics.Region.Op);
    method public boolean clipPath(android.graphics.Path);
    method public boolean clipRect(android.graphics.RectF, android.graphics.Region.Op);
    method public 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 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 deprecated boolean clipRegion(android.graphics.Region, android.graphics.Region.Op);
    method public deprecated boolean clipRegion(android.graphics.Region);
    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 int save(int);
    method public int saveLayer(android.graphics.RectF, android.graphics.Paint, int);
    method public int saveLayer(android.graphics.RectF, android.graphics.Paint);
    method public int saveLayer(float, float, float, float, android.graphics.Paint, int);
    method public int saveLayer(float, float, float, float, android.graphics.Paint);
    method public int saveLayerAlpha(android.graphics.RectF, int, int);
    method public int saveLayerAlpha(android.graphics.RectF, int);
    method public int saveLayerAlpha(float, float, float, float, int, int);
    method public int saveLayerAlpha(float, float, float, float, int);
    method public void scale(float, float);
    method public final void scale(float, float, float, float);
    method public void setBitmap(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
    field public static final int CLIP_SAVE_FLAG = 2; // 0x2
    field public static final int CLIP_TO_LAYER_SAVE_FLAG = 16; // 0x10
    field public static final int FULL_COLOR_LAYER_SAVE_FLAG = 8; // 0x8
    field public static final int HAS_ALPHA_LAYER_SAVE_FLAG = 4; // 0x4
    field public static final int MATRIX_SAVE_FLAG = 1; // 0x1
  }

  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 static int alpha(int);
    method public static int argb(int, int, int, int);
    method public static int blue(int);
    method public static void colorToHSV(int, float[]);
    method public static int green(int);
    method public static float luminance(int);
    method public static int parseColor(java.lang.String);
    method public static int red(int);
    method public static int rgb(int, int, int);
    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 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[]);
  }

  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 EmbossMaskFilter(float[], float, float, float);
  }

  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 deprecated class LayerRasterizer extends android.graphics.Rasterizer {
    ctor public LayerRasterizer();
    method public void addLayer(android.graphics.Paint, float, float);
    method public void addLayer(android.graphics.Paint);
  }

  public class LightingColorFilter extends android.graphics.ColorFilter {
    ctor public LightingColorFilter(int, int);
  }

  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 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 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 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 deprecated android.graphics.Rasterizer getRasterizer();
    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 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 deprecated android.graphics.Rasterizer setRasterizer(android.graphics.Rasterizer);
    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 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 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 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 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 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 deprecated class Rasterizer {
    ctor public Rasterizer();
  }

  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 final int centerX();
    method public final 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 final float exactCenterX();
    method public final float exactCenterY();
    method public java.lang.String flattenToString();
    method public final 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 final 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 final 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 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);
    method public void attachToGLContext(int);
    method public void detachFromGLContext();
    method public long getTimestamp();
    method public void getTransformMatrix(float[]);
    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 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 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 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 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 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 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 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 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 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 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 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;
  }

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

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

  public class OvalShape extends android.graphics.drawable.shapes.RectShape {
    ctor public OvalShape();
  }

  public class PathShape extends android.graphics.drawable.shapes.Shape {
    ctor public PathShape(android.graphics.Path, float, float);
    method public void draw(android.graphics.Canvas, android.graphics.Paint);
  }

  public class RectShape extends android.graphics.drawable.shapes.Shape {
    ctor public RectShape();
    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[]);
  }

  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.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 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 deprecated java.lang.String ACTION_NEW_PICTURE = "android.hardware.action.NEW_PICTURE";
    field public static final deprecated 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 Sensor {
    method public int getFifoMaxEventCount();
    method public int getFifoReservedEventCount();
    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 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_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_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_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_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 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 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.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 abstract void close();
    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 abstract int setRepeatingRequest(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract void stopRepeating() 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 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();
    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[]> 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<android.util.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES;
    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<float[]> LENS_POSE_ROTATION;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<float[]> LENS_POSE_TRANSLATION;
    field public static final android.hardware.camera2.CameraCharacteristics.Key<float[]> LENS_RADIAL_DISTORTION;
    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<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 final boolean equals(java.lang.Object);
    method public java.lang.String getName();
    method public final int hashCode();
  }

  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 abstract void createCaptureSession(java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler) 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 registerAvailabilityCallback(android.hardware.camera2.CameraManager.AvailabilityCallback, android.os.Handler);
    method public void registerTorchCallback(android.hardware.camera2.CameraManager.TorchCallback, android.os.Handler);
    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_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_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_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 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_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_STATE_MOVING = 1; // 0x1
    field public static final int LENS_STATE_STATIONARY = 0; // 0x0
    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_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_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_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.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.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> 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<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 void removeTarget(android.view.Surface);
    method public <T> void set(android.hardware.camera2.CaptureRequest.Key<T>, T);
    method public void setTag(java.lang.Object);
  }

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

  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 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_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.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> 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<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 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_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 final boolean equals(java.lang.Object);
    method public java.lang.String getName();
    method public final int hashCode();
  }

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

}

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 OutputConfiguration implements android.os.Parcelable {
    ctor public OutputConfiguration(android.view.Surface);
    ctor public OutputConfiguration(int, android.view.Surface);
    method public int describeContents();
    method public android.view.Surface getSurface();
    method public int getSurfaceGroupId();
    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 final 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 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 final int[] getInputFormats();
    method public android.util.Size[] getInputSizes(int);
    method public final 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 final 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 class FingerprintManager {
    method public void authenticate(android.hardware.fingerprint.FingerprintManager.CryptoObject, android.os.CancellationSignal, int, android.hardware.fingerprint.FingerprintManager.AuthenticationCallback, android.os.Handler);
    method public boolean hasEnrolledFingerprints();
    method public boolean isHardwareDetected();
    field public static final int FINGERPRINT_ACQUIRED_GOOD = 0; // 0x0
    field public static final int FINGERPRINT_ACQUIRED_IMAGER_DIRTY = 3; // 0x3
    field public static final int FINGERPRINT_ACQUIRED_INSUFFICIENT = 2; // 0x2
    field public static final int FINGERPRINT_ACQUIRED_PARTIAL = 1; // 0x1
    field public static final int FINGERPRINT_ACQUIRED_TOO_FAST = 5; // 0x5
    field public static final int FINGERPRINT_ACQUIRED_TOO_SLOW = 4; // 0x4
    field public static final int FINGERPRINT_ERROR_CANCELED = 5; // 0x5
    field public static final int FINGERPRINT_ERROR_HW_UNAVAILABLE = 1; // 0x1
    field public static final int FINGERPRINT_ERROR_LOCKOUT = 7; // 0x7
    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
  }

  public static abstract 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 class FingerprintManager.AuthenticationResult {
    method public android.hardware.fingerprint.FingerprintManager.CryptoObject getCryptoObject();
  }

  public static final 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 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 boolean queue(java.nio.ByteBuffer, int);
    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 final int codePointAt(java.lang.CharSequence, int);
    method public static final int codePointAt(char[], int);
    method public static final int codePointAt(char[], int, int);
    method public static final int codePointBefore(java.lang.CharSequence, int);
    method public static final int codePointBefore(char[], int);
    method public static final 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 final 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 final boolean isSupplementaryCodePoint(int);
    method public static final 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 final 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 final int toChars(int, char[], int);
    method public static final char[] toChars(int);
    method public static final 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 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
  }

  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 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 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 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 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 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 final 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 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 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 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 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 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 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 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 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 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 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 IMPERIAL_ARAMAIC;
    field public static final int IMPERIAL_ARAMAIC_ID = 186; // 0xba
    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_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 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 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 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 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 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 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_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 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 SORA_SOMPENG;
    field public static final int SORA_SOMPENG_ID = 218; // 0xda
    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 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 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
  }

  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 FORMAT = 2; // 0x2
    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
  }

  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 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 QUOTATION_MARK = 25; // 0x19
    field public static final int RADICAL = 26; // 0x1a
    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 final boolean breaksBetweenLetters(int);
    method public static final int[] getCode(java.util.Locale);
    method public static final int[] getCode(android.icu.util.ULocale);
    method public static final int[] getCode(java.lang.String);
    method public static final int getCodeFromName(java.lang.String);
    method public static final java.lang.String getName(int);
    method public static final java.lang.String getSampleString(int);
    method public static final int getScript(int);
    method public static final int getScriptExtensions(int, java.util.BitSet);
    method public static final java.lang.String getShortName(int);
    method public static final android.icu.lang.UScript.ScriptUsage getUsage(int);
    method public static final boolean hasScript(int, int);
    method public static final boolean isCased(int);
    method public static final boolean isRightToLeft(int);
    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 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 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 GURMUKHI = 16; // 0x10
    field public static final int HAN = 17; // 0x11
    field public static final int HANGUL = 18; // 0x12
    field public static final int HANUNOO = 43; // 0x2b
    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 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 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 MATHEMATICAL_NOTATION = 128; // 0x80
    field public static final int MAYAN_HIEROGLYPHS = 85; // 0x55
    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 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_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 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 SORA_SOMPENG = 152; // 0x98
    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 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
  }

  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 int next();
    method public int previous();
    method public static final int primaryOrder(int);
    method public void reset();
    method public static final 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 final 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 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 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 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;
  }

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

  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 void applyLocalizedPattern(java.lang.String);
    method public void applyPattern(java.lang.String);
    method public boolean areSignificantDigitsUsed();
    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 android.icu.text.CurrencyPluralInfo getCurrencyPluralInfo();
    method public android.icu.util.Currency.CurrencyUsage getCurrencyUsage();
    method public android.icu.text.DecimalFormatSymbols getDecimalFormatSymbols();
    method public int getFormatWidth();
    method public int getGroupingSize();
    method public java.math.MathContext getMathContext();
    method public android.icu.math.MathContext getMathContextICU();
    method public int getMaximumSignificantDigits();
    method public byte getMinimumExponentDigits();
    method public int getMinimumSignificantDigits();
    method public int getMultiplier();
    method public java.lang.String getNegativePrefix();
    method public java.lang.String getNegativeSuffix();
    method public char getPadCharacter();
    method public int getPadPosition();
    method public int getParseMaxDigits();
    method public java.lang.String getPositivePrefix();
    method public java.lang.String getPositiveSuffix();
    method public java.math.BigDecimal getRoundingIncrement();
    method public int getSecondaryGroupingSize();
    method public boolean isDecimalPatternMatchRequired();
    method public boolean isDecimalSeparatorAlwaysShown();
    method public boolean isExponentSignAlwaysShown();
    method public boolean isParseBigDecimal();
    method public boolean isScientificNotation();
    method public java.lang.Number parse(java.lang.String, java.text.ParsePosition);
    method public void setCurrencyPluralInfo(android.icu.text.CurrencyPluralInfo);
    method public void setCurrencyUsage(android.icu.util.Currency.CurrencyUsage);
    method public void setDecimalFormatSymbols(android.icu.text.DecimalFormatSymbols);
    method public void setDecimalPatternMatchRequired(boolean);
    method public void setDecimalSeparatorAlwaysShown(boolean);
    method public void setExponentSignAlwaysShown(boolean);
    method public void setFormatWidth(int);
    method public void setGroupingSize(int);
    method public void setMathContext(java.math.MathContext);
    method public void setMathContextICU(android.icu.math.MathContext);
    method public void setMaximumSignificantDigits(int);
    method public void setMinimumExponentDigits(byte);
    method public void setMinimumSignificantDigits(int);
    method public void setMultiplier(int);
    method public void setNegativePrefix(java.lang.String);
    method public void setNegativeSuffix(java.lang.String);
    method public void setPadCharacter(char);
    method public void setPadPosition(int);
    method public void setParseBigDecimal(boolean);
    method public void setParseMaxDigits(int);
    method public void setPositivePrefix(java.lang.String);
    method public void setPositiveSuffix(java.lang.String);
    method public void setRoundingIncrement(java.math.BigDecimal);
    method public void setRoundingIncrement(android.icu.math.BigDecimal);
    method public void setRoundingIncrement(double);
    method public void setScientificNotation(boolean);
    method public void setSecondaryGroupingSize(int);
    method public void setSignificantDigitsUsed(boolean);
    method public java.lang.String toLocalizedPattern();
    method public 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 char getDigit();
    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 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 char getMonetaryDecimalSeparator();
    method public char getMonetaryGroupingSeparator();
    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 char getPercent();
    method public char getPlusSign();
    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 setDigit(char);
    method public void setExponentMultiplicationSign(java.lang.String);
    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 setMonetaryGroupingSeparator(char);
    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 setPercent(char);
    method public void setPlusSign(char);
    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 STANDARD_NAMES;
  }

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

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

  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 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 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.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 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 final 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 void setNumericCollation(boolean);
    method public void setNumericCollationDefault();
    method public void setStrengthDefault();
    method public void setUpperCaseFirst(boolean);
  }

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

   abstract class CECalendar extends android.icu.util.Calendar {
    ctor protected CECalendar();
    ctor protected CECalendar(android.icu.util.TimeZone);
    ctor protected CECalendar(java.util.Locale);
    ctor protected CECalendar(android.icu.util.ULocale);
    ctor protected CECalendar(android.icu.util.TimeZone, java.util.Locale);
    ctor protected CECalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
    ctor protected CECalendar(int, int, int);
    ctor protected CECalendar(java.util.Date);
    ctor protected CECalendar(int, int, int, int, int, int);
    method protected int handleComputeMonthStart(int, int, boolean);
    method protected int handleGetLimit(int, int);
  }

  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 int computeMillisInDay();
    method protected void computeTime();
    method protected 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 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 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.CECalendar {
    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 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 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);
    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 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 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 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.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 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 LIGHT_YEAR;
    field public static final android.icu.util.MeasureUnit LITER;
    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_HOUR;
    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 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 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 PICOMETER;
    field public static final android.icu.util.MeasureUnit PINT;
    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.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 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();
  }

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

}

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 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 void showStatusIcon(int);
    method public void showWindow(boolean);
    method public void switchInputMethod(java.lang.String);
    method public void updateFullscreenMode();
    method public void updateInputViewShown();
    field public static final int BACK_DISPOSITION_DEFAULT = 0; // 0x0
    field public static final int BACK_DISPOSITION_WILL_DISMISS = 2; // 0x2
    field public static final int BACK_DISPOSITION_WILL_NOT_DISMISS = 1; // 0x1
  }

  public class InputMethodService.InputMethodImpl extends android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl {
    ctor public InputMethodService.InputMethodImpl();
    method 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 {
    ctor public GnssClock();
    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 reset();
    method public void resetBiasNanos();
    method public void resetBiasUncertaintyNanos();
    method public void resetDriftNanosPerSecond();
    method public void resetDriftUncertaintyNanosPerSecond();
    method public void resetFullBiasNanos();
    method public void resetLeapSecond();
    method public void resetTimeUncertaintyNanos();
    method public void set(android.location.GnssClock);
    method public void setBiasNanos(double);
    method public void setBiasUncertaintyNanos(double);
    method public void setDriftNanosPerSecond(double);
    method public void setDriftUncertaintyNanosPerSecond(double);
    method public void setFullBiasNanos(long);
    method public void setHardwareClockDiscontinuityCount(int);
    method public void setLeapSecond(int);
    method public void setTimeNanos(long);
    method public void setTimeUncertaintyNanos(double);
    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 {
    ctor public GnssMeasurement();
    method public int describeContents();
    method public double getAccumulatedDeltaRangeMeters();
    method public int getAccumulatedDeltaRangeState();
    method public double getAccumulatedDeltaRangeUncertaintyMeters();
    method public long getCarrierCycles();
    method public float getCarrierFrequencyHz();
    method public double getCarrierPhase();
    method public double getCarrierPhaseUncertainty();
    method public double getCn0DbHz();
    method public int getConstellationType();
    method public int getMultipathIndicator();
    method public double getPseudorangeRateMetersPerSecond();
    method public double getPseudorangeRateUncertaintyMetersPerSecond();
    method public long getReceivedSvTimeNanos();
    method public long getReceivedSvTimeUncertaintyNanos();
    method public double getSnrInDb();
    method public int getState();
    method public int getSvid();
    method public double getTimeOffsetNanos();
    method public boolean hasCarrierCycles();
    method public boolean hasCarrierFrequencyHz();
    method public boolean hasCarrierPhase();
    method public boolean hasCarrierPhaseUncertainty();
    method public boolean hasSnrInDb();
    method public void reset();
    method public void resetCarrierCycles();
    method public void resetCarrierFrequencyHz();
    method public void resetCarrierPhase();
    method public void resetCarrierPhaseUncertainty();
    method public void resetSnrInDb();
    method public void set(android.location.GnssMeasurement);
    method public void setAccumulatedDeltaRangeMeters(double);
    method public void setAccumulatedDeltaRangeState(int);
    method public void setAccumulatedDeltaRangeUncertaintyMeters(double);
    method public void setCarrierCycles(long);
    method public void setCarrierFrequencyHz(float);
    method public void setCarrierPhase(double);
    method public void setCarrierPhaseUncertainty(double);
    method public void setCn0DbHz(double);
    method public void setConstellationType(int);
    method public void setMultipathIndicator(int);
    method public void setPseudorangeRateMetersPerSecond(double);
    method public void setPseudorangeRateUncertaintyMetersPerSecond(double);
    method public void setReceivedSvTimeNanos(long);
    method public void setReceivedSvTimeUncertaintyNanos(long);
    method public void setSnrInDb(double);
    method public void setState(int);
    method public void setSvid(int);
    method public void setTimeOffsetNanos(double);
    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_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_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_UNKNOWN = 0; // 0x0
  }

  public final class GnssMeasurementsEvent implements android.os.Parcelable {
    ctor public GnssMeasurementsEvent(android.location.GnssClock, android.location.GnssMeasurement[]);
    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_SUPPORTED = 0; // 0x0
    field public static final int STATUS_READY = 1; // 0x1
  }

  public final class GnssNavigationMessage implements android.os.Parcelable {
    ctor public GnssNavigationMessage();
    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 reset();
    method public void set(android.location.GnssNavigationMessage);
    method public void setData(byte[]);
    method public void setMessageId(int);
    method public void setStatus(int);
    method public void setSubmessageId(int);
    method public void setSvid(int);
    method public void setType(int);
    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 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 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 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 long getTime();
    method public boolean hasAccuracy();
    method public boolean hasAltitude();
    method public boolean hasBearing();
    method public boolean hasSpeed();
    method public boolean isFromMockProvider();
    method public void removeAccuracy();
    method public void removeAltitude();
    method public void removeBearing();
    method public void removeSpeed();
    method public void reset();
    method public void set(android.location.Location);
    method public void setAccuracy(float);
    method public void setAltitude(double);
    method public void setBearing(float);
    method public void 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 setTime(long);
    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 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 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 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 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_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 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_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_WIRED_HEADPHONES = 4; // 0x4
    field public static final int TYPE_WIRED_HEADSET = 3; // 0x3
  }

  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_AC3 = 5; // 0x5
    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_IEC61937 = 13; // 0xd
    field public static final int ENCODING_INVALID = 0; // 0x0
    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 int abandonAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener);
    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.AudioRecordingConfiguration> getActiveRecordingConfigurations();
    method public android.media.AudioDeviceInfo[] getDevices(int);
    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 getStreamVolume(int);
    method public deprecated int getVibrateSetting(int);
    method public boolean isBluetoothA2dpOn();
    method public boolean isBluetoothScoAvailableOffCall();
    method public boolean isBluetoothScoOn();
    method public boolean isMicrophoneMute();
    method public boolean isMusicActive();
    method public boolean isSpeakerphoneOn();
    method public boolean isStreamMute(int);
    method public boolean isVolumeFixed();
    method 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 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 int requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, int, int);
    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 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 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_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_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.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 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 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 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 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 {
    ctor public AudioTrack(int, int, int, int, int, int) throws java.lang.IllegalArgumentException;
    ctor public AudioTrack(int, int, int, int, int, int, int) throws java.lang.IllegalArgumentException;
    ctor public AudioTrack(android.media.AudioAttributes, android.media.AudioFormat, int, int, int) throws java.lang.IllegalArgumentException;
    method public void addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler);
    method public deprecated void addOnRoutingChangedListener(android.media.AudioTrack.OnRoutingChangedListener, android.os.Handler);
    method public int attachAuxEffect(int);
    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 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 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 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 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 setSessionId(int) throws java.lang.IllegalArgumentException;
    method public android.media.AudioTrack.Builder setTransferMode(int) throws java.lang.IllegalArgumentException;
  }

  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 long[] getThumbnailRange();
    method public boolean hasThumbnail();
    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_DEVICE_SETTING_DESCRIPTION = "DeviceSettingDescription";
    field public static final java.lang.String TAG_DIGITAL_ZOOM_RATIO = "DigitalZoomRatio";
    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_OECF = "OECF";
    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_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_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 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 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 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 MediaCodec {
    method public void configure(android.media.MediaFormat, android.view.Surface, android.media.MediaCrypto, int);
    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 final android.view.Surface createInputSurface();
    method public static android.view.Surface createPersistentInputSurface();
    method public final int dequeueInputBuffer(long);
    method public final int dequeueOutputBuffer(android.media.MediaCodec.BufferInfo, long);
    method public final void flush();
    method public android.media.MediaCodecInfo getCodecInfo();
    method public java.nio.ByteBuffer getInputBuffer(int);
    method public deprecated java.nio.ByteBuffer[] getInputBuffers();
    method public final android.media.MediaFormat getInputFormat();
    method public android.media.Image getInputImage(int);
    method public final java.lang.String getName();
    method public java.nio.ByteBuffer getOutputBuffer(int);
    method public deprecated java.nio.ByteBuffer[] getOutputBuffers();
    method public final android.media.MediaFormat getOutputFormat();
    method public final android.media.MediaFormat getOutputFormat(int);
    method public android.media.Image getOutputImage(int);
    method public final void queueInputBuffer(int, int, int, long, int) throws android.media.MediaCodec.CryptoException;
    method public final void queueSecureInputBuffer(int, int, android.media.MediaCodec.CryptoInfo, long, int) throws android.media.MediaCodec.CryptoException;
    method public final void release();
    method public final void releaseOutputBuffer(int, boolean);
    method public final void releaseOutputBuffer(int, long);
    method public final 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 final void setParameters(android.os.Bundle);
    method public final void setVideoScalingMode(int);
    method public final void signalEndOfInputStream();
    method public final void start();
    method public final 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 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 abstract interface MediaCodec.OnFrameRenderedListener {
    method public abstract void onFrameRendered(android.media.MediaCodec, long, long);
  }

  public final class MediaCodecInfo {
    method public final android.media.MediaCodecInfo.CodecCapabilities getCapabilitiesForType(java.lang.String);
    method public final java.lang.String getName();
    method public final java.lang.String[] getSupportedTypes();
    method public final 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 final boolean isFeatureRequired(java.lang.String);
    method public final boolean isFeatureSupported(java.lang.String);
    method public final 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_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 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 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 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 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 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 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 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 final java.lang.String findDecoderForFormat(android.media.MediaFormat);
    method public final java.lang.String findEncoderForFormat(android.media.MediaFormat);
    method public static final deprecated int getCodecCount();
    method public static final deprecated android.media.MediaCodecInfo getCodecInfoAt(int);
    method public final 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 public static final boolean isCryptoSchemeSupported(java.util.UUID);
    method public final void release();
    method public final boolean requiresSecureDecoderComponent(java.lang.String);
    method public final 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 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 android.os.Parcelable.Creator<android.media.MediaDescription> CREATOR;
  }

  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 {
    ctor public MediaDrm(java.util.UUID) throws android.media.UnsupportedSchemeException;
    method public void closeSession(byte[]);
    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 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[]> getSecureStops();
    method public static final boolean isCryptoSchemeSupported(java.util.UUID);
    method public static final boolean isCryptoSchemeSupported(java.util.UUID, java.lang.String);
    method public byte[] openSession() 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 final void release();
    method public void releaseAllSecureStops();
    method public void releaseSecureStops(byte[]);
    method public void removeKeys(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 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 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";
  }

  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 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_RELEASE = 2; // 0x2
    field public static final int REQUEST_TYPE_RENEWAL = 1; // 0x1
  }

  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 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 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 public long getCachedDuration();
    method public android.media.DrmInitData getDrmInitData();
    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 getSampleTime();
    method public int getSampleTrackIndex();
    method public final int getTrackCount();
    method public android.media.MediaFormat getTrackFormat(int);
    method public boolean hasCacheReachedEndOfStream();
    method public int readSampleData(java.nio.ByteBuffer, int);
    method public final void release();
    method public void seekTo(long, int);
    method public void selectTrack(int);
    method public final void setDataSource(android.media.MediaDataSource) throws java.io.IOException;
    method public final void setDataSource(android.content.Context, android.net.Uri, java.util.Map<java.lang.String, java.lang.String>) throws java.io.IOException;
    method public final void setDataSource(java.lang.String, java.util.Map<java.lang.String, java.lang.String>) throws java.io.IOException;
    method public final void setDataSource(java.lang.String) throws java.io.IOException;
    method public final void setDataSource(android.content.res.AssetFileDescriptor) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public final void setDataSource(java.io.FileDescriptor) throws java.io.IOException;
    method public final void setDataSource(java.io.FileDescriptor, long, long) throws java.io.IOException;
    method public void unselectTrack(int);
    field public static final int SAMPLE_FLAG_ENCRYPTED = 2; // 0x2
    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 final class MediaFormat {
    ctor public MediaFormat();
    method public final boolean containsKey(java.lang.String);
    method public static final android.media.MediaFormat createAudioFormat(java.lang.String, int, int);
    method public static final android.media.MediaFormat createSubtitleFormat(java.lang.String, java.lang.String);
    method public static final android.media.MediaFormat createVideoFormat(java.lang.String, int, int);
    method public final java.nio.ByteBuffer getByteBuffer(java.lang.String);
    method public boolean getFeatureEnabled(java.lang.String);
    method public final float getFloat(java.lang.String);
    method public final int getInteger(java.lang.String);
    method public final long getLong(java.lang.String);
    method public final java.lang.String getString(java.lang.String);
    method public final void setByteBuffer(java.lang.String, java.nio.ByteBuffer);
    method public void setFeatureEnabled(java.lang.String, boolean);
    method public final void setFloat(java.lang.String, float);
    method public final void setInteger(java.lang.String, int);
    method public final void setLong(java.lang.String, long);
    method public final 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_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_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_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_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_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_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_VORBIS = "audio/vorbis";
    field public static final java.lang.String MIMETYPE_TEXT_CEA_608 = "text/cea-608";
    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_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_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_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 getFrameAtTime(long, int);
    method public android.graphics.Bitmap getFrameAtTime(long);
    method public android.graphics.Bitmap getFrameAtTime();
    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_VIDEO = 17; // 0x11
    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_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 final class MediaMuxer {
    ctor public MediaMuxer(java.lang.String, 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_MPEG_4 = 0; // 0x0
    field public static final int MUXER_OUTPUT_WEBM = 1; // 0x1
  }

  public class MediaPlayer {
    ctor public MediaPlayer();
    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 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 void deselectTrack(int) throws java.lang.IllegalStateException;
    method public int getAudioSessionId();
    method public int getCurrentPosition();
    method public int getDuration();
    method public android.media.PlaybackParams getPlaybackParams();
    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 release();
    method public void reset();
    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 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>) 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 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 setOnErrorListener(android.media.MediaPlayer.OnErrorListener);
    method public void setOnInfoListener(android.media.MediaPlayer.OnInfoListener);
    method public void setOnPreparedListener(android.media.MediaPlayer.OnPreparedListener);
    method public void setOnSeekCompleteListener(android.media.MediaPlayer.OnSeekCompleteListener);
    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 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_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_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_RENDERING_START = 3; // 0x3
    field public static final int MEDIA_INFO_VIDEO_TRACK_LAGGING = 700; // 0x2bc
    field public static final java.lang.String MEDIA_MIMETYPE_TEXT_SUBRIP = "application/x-subrip";
    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 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.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.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.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 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 {
    ctor public MediaRecorder();
    method public static final int getAudioSourceMax();
    method public int getMaxAmplitude() throws java.lang.IllegalStateException;
    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 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 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.lang.String) throws java.lang.IllegalStateException;
    method public void setOutputFormat(int) throws java.lang.IllegalStateException;
    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 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_REACHED = 801; // 0x321
    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 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_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();
    method public abstract void onScanCompleted(java.lang.String, android.net.Uri);
  }

  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 final android.view.Surface createInputSurface();
    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 final 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();
  }

  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();
    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 public android.media.AudioAttributes getAudioAttributes();
    method public deprecated int getStreamType();
    method public java.lang.String getTitle(android.content.Context);
    method public boolean isPlaying();
    method public void play();
    method public void setAudioAttributes(android.media.AudioAttributes) throws java.lang.IllegalArgumentException;
    method public deprecated void setStreamType(int);
    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 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 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 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 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
  }

}

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 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_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 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 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 final 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 final 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.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 int FLAG_HANDLES_MEDIA_BUTTONS = 1; // 0x1
    field public static final 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 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 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 final 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 final android.net.Uri buildChannelLogoUri(long);
    method public static final android.net.Uri buildChannelLogoUri(android.net.Uri);
    method public static final android.net.Uri buildChannelUri(long);
    method public static final android.net.Uri buildChannelUriForPassthroughInput(java.lang.String);
    method public static final android.net.Uri buildChannelsUriForInput(java.lang.String);
    method public static final java.lang.String buildInputId(android.content.ComponentName);
    method public static final android.net.Uri buildProgramUri(long);
    method public static final android.net.Uri buildProgramsUriForChannel(long);
    method public static final android.net.Uri buildProgramsUriForChannel(android.net.Uri);
    method public static final android.net.Uri buildProgramsUriForChannel(long, long, long);
    method public static final android.net.Uri buildProgramsUriForChannel(android.net.Uri, long, long);
    method public static final android.net.Uri buildRecordedProgramUri(long);
    method public static final boolean isChannelUri(android.net.Uri);
    method public static final boolean isChannelUriForPassthroughInput(android.net.Uri);
    method public static final boolean isChannelUriForTunerInput(android.net.Uri);
    method public static final boolean isProgramUri(android.net.Uri);
    field public static final java.lang.String AUTHORITY = "android.media.tv";
  }

  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 final 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_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_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_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_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.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_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;
  }

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

  public final class TvInputInfo implements android.os.Parcelable {
    method public boolean canRecord();
    method public 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 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 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 final int getAudioChannelCount();
    method public final int getAudioSampleRate();
    method public final java.lang.CharSequence getDescription();
    method public final android.os.Bundle getExtra();
    method public final java.lang.String getId();
    method public final java.lang.String getLanguage();
    method public final int getType();
    method public final byte getVideoActiveFormatDescription();
    method public final float getVideoFrameRate();
    method public final int getVideoHeight();
    method public final float getVideoPixelAspectRatio();
    method public final 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 final android.media.tv.TvTrackInfo.Builder setAudioChannelCount(int);
    method public final android.media.tv.TvTrackInfo.Builder setAudioSampleRate(int);
    method public final android.media.tv.TvTrackInfo.Builder setDescription(java.lang.CharSequence);
    method public final android.media.tv.TvTrackInfo.Builder setExtra(android.os.Bundle);
    method public final android.media.tv.TvTrackInfo.Builder setLanguage(java.lang.String);
    method public final android.media.tv.TvTrackInfo.Builder setVideoActiveFormatDescription(byte);
    method public final android.media.tv.TvTrackInfo.Builder setVideoFrameRate(float);
    method public final android.media.tv.TvTrackInfo.Builder setVideoHeight(int);
    method public final android.media.tv.TvTrackInfo.Builder setVideoPixelAspectRatio(float);
    method public final 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 protected void onLayout(boolean, int, int, int, 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 final int getAssociationDesc();
    method public final int getAssociationType();
    method public final int getCompressedSize();
    method public final long getCompressedSizeLong();
    method public final long getDateCreated();
    method public final long getDateModified();
    method public final int getFormat();
    method public final int getImagePixDepth();
    method public final long getImagePixDepthLong();
    method public final int getImagePixHeight();
    method public final long getImagePixHeightLong();
    method public final int getImagePixWidth();
    method public final long getImagePixWidthLong();
    method public final java.lang.String getKeywords();
    method public final java.lang.String getName();
    method public final int getObjectHandle();
    method public final int getParent();
    method public final int getProtectionStatus();
    method public final int getSequenceNumber();
    method public final long getSequenceNumberLong();
    method public final int getStorageId();
    method public final int getThumbCompressedSize();
    method public final long getThumbCompressedSizeLong();
    method public final int getThumbFormat();
    method public final int getThumbPixHeight();
    method public final long getThumbPixHeightLong();
    method public final int getThumbPixWidth();
    method public final 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 final java.lang.String getDescription();
    method public final long getFreeSpace();
    method public final long getMaxCapacity();
    method public final int getStorageId();
    method public final 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 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 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 registerNetworkCallback(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback);
    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.app.PendingIntent);
    method public deprecated boolean requestRouteToHost(int, int);
    method public deprecated void setNetworkPreference(int);
    method public static deprecated boolean setProcessDefaultNetwork(android.net.Network);
    method public deprecated int startUsingNetworkFeature(int, java.lang.String);
    method public deprecated int stopUsingNetworkFeature(int, java.lang.String);
    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 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 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 int TYPE_BLUETOOTH = 7; // 0x7
    field public static final int TYPE_DUMMY = 8; // 0x8
    field public static final int TYPE_ETHERNET = 9; // 0x9
    field public static final int TYPE_MOBILE = 0; // 0x0
    field public static final 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 int TYPE_VPN = 17; // 0x11
    field public static final int TYPE_WIFI = 1; // 0x1
    field public static final int TYPE_WIMAX = 6; // 0x6
  }

  public static class ConnectivityManager.NetworkCallback {
    ctor public ConnectivityManager.NetworkCallback();
    method public void onAvailable(android.net.Network);
    method public void 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);
  }

  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 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.util.List<android.net.RouteInfo> getRoutes();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.LinkProperties> CREATOR;
  }

  public class LocalServerSocket {
    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 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 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_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_METERED = 11; // 0xb
    field public static final int NET_CAPABILITY_NOT_RESTRICTED = 13; // 0xd
    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_VPN = 4; // 0x4
    field public static final int TRANSPORT_WIFI = 1; // 0x1
  }

  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 java.lang.String getReason();
    method public android.net.NetworkInfo.State getState();
    method public int getSubtype();
    method public java.lang.String getSubtypeName();
    method public int getType();
    method public java.lang.String getTypeName();
    method public boolean isAvailable();
    method public boolean isConnected();
    method public boolean isConnectedOrConnecting();
    method public boolean isFailover();
    method public 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 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);
  }

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

  public final class Proxy {
    ctor public Proxy();
    method public static final deprecated java.lang.String getDefaultHost();
    method public static final deprecated int getDefaultPort();
    method public static final deprecated java.lang.String getHost(android.content.Context);
    method public static final 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 abstract class PskKeyManager {
    ctor public PskKeyManager();
    method public java.lang.String chooseClientKeyIdentity(java.lang.String, java.net.Socket);
    method public java.lang.String chooseClientKeyIdentity(java.lang.String, javax.net.ssl.SSLEngine);
    method public java.lang.String chooseServerKeyIdentityHint(java.net.Socket);
    method public java.lang.String chooseServerKeyIdentityHint(javax.net.ssl.SSLEngine);
    method public javax.crypto.SecretKey getKey(java.lang.String, java.lang.String, java.net.Socket);
    method public javax.crypto.SecretKey getKey(java.lang.String, java.lang.String, javax.net.ssl.SSLEngine);
    field public static final int MAX_IDENTITY_HINT_LENGTH_BYTES = 128; // 0x80
    field public static final int MAX_IDENTITY_LENGTH_BYTES = 128; // 0x80
    field public static final int MAX_KEY_LENGTH_BYTES = 256; // 0x100
  }

  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 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 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 tagDatagramSocket(java.net.DatagramSocket) throws java.net.SocketException;
    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 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";
  }

  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 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 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 boolean isPasspoint();
    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 int networkId;
    field public java.lang.String preSharedKey;
    field public int priority;
    field public java.lang.String providerFriendlyName;
    field public long[] roamingConsortiumIds;
    field public int status;
    field public java.lang.String[] wepKeys;
    field public int wepTxKeyIndex;
  }

  public static class WifiConfiguration.AuthAlgorithm {
    field public static final int LEAP = 2; // 0x2
    field public static final int OPEN = 0; // 0x0
    field public static final 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 int WEP104 = 1; // 0x1
    field public static final 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 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 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.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 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 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
  }

  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 static int calculateSignalLevel(int, int);
    method public 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.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 boolean pingSupplicant();
    method public boolean reassociate();
    method public boolean reconnect();
    method public boolean removeNetwork(int);
    method public 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 boolean startScan();
    method public 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 int ERROR_AUTHENTICATING = 1; // 0x1
    field public static final 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 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 java.lang.String EXTRA_SUPPLICANT_CONNECTED = "connected";
    field public static final java.lang.String EXTRA_SUPPLICANT_ERROR = "supplicantError";
    field public static final 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 java.lang.String SUPPLICANT_CONNECTION_CHANGE_ACTION = "android.net.wifi.supplicant.CONNECTION_CHANGE";
    field public static final 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 int WPS_AUTH_FAILURE = 6; // 0x6
    field public static final int WPS_OVERLAP_ERROR = 3; // 0x3
    field public static final int WPS_TIMED_OUT = 7; // 0x7
    field public static final int WPS_TKIP_ONLY_PROHIBITED = 5; // 0x5
    field public static final int WPS_WEP_PROHIBITED = 4; // 0x4
  }

  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 class WifiManager.WpsCallback {
    ctor public WifiManager.WpsCallback();
    method public abstract void onFailed(int);
    method public abstract void onStarted(java.lang.String);
    method public abstract void onSucceeded();
  }

  public class WpsInfo implements android.os.Parcelable {
    ctor public WpsInfo();
    ctor public WpsInfo(android.net.wifi.WpsInfo);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public java.lang.String BSSID;
    field public static final android.os.Parcelable.Creator<android.net.wifi.WpsInfo> CREATOR;
    field public static final int DISPLAY = 1; // 0x1
    field public static final int INVALID = 4; // 0x4
    field public static final int KEYPAD = 2; // 0x2
    field public static final int LABEL = 3; // 0x3
    field public static final int PBC = 0; // 0x0
    field public java.lang.String pin;
    field public int setup;
  }

}

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 {
  }

  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.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 EXTRA_ADAPTER_STATE = "android.nfc.extra.ADAPTER_STATE";
    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_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();
    method public abstract android.os.IBinder onBind(android.content.Intent);
    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 {

   abstract class BasicTagTechnology implements android.nfc.tech.TagTechnology {
    method public void close() throws java.io.IOException;
    method public void connect() throws java.io.IOException;
    method public android.nfc.Tag getTag();
    method public boolean isConnected();
  }

  public final class IsoDep extends android.nfc.tech.BasicTagTechnology {
    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 extends android.nfc.tech.BasicTagTechnology {
    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 extends android.nfc.tech.BasicTagTechnology {
    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 extends android.nfc.tech.BasicTagTechnology {
    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 extends android.nfc.tech.BasicTagTechnology {
    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 extends android.nfc.tech.BasicTagTechnology {
    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 extends android.nfc.tech.BasicTagTechnology {
    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 extends android.nfc.tech.BasicTagTechnology {
    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 extends android.nfc.tech.BasicTagTechnology {
    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 extends android.nfc.tech.BasicTagTechnology {
    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 close() throws java.io.IOException;
    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 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
  }

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

  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 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 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 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 final int getBinderDeathObjectCount();
    method public static final int getBinderLocalObjectCount();
    method public static final 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 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 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 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 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 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 final void appendFrom(android.os.Parcel, int, int);
    method public final android.os.IBinder[] createBinderArray();
    method public final java.util.ArrayList<android.os.IBinder> createBinderArrayList();
    method public final boolean[] createBooleanArray();
    method public final byte[] createByteArray();
    method public final char[] createCharArray();
    method public final double[] createDoubleArray();
    method public final float[] createFloatArray();
    method public final int[] createIntArray();
    method public final long[] createLongArray();
    method public final java.lang.String[] createStringArray();
    method public final java.util.ArrayList<java.lang.String> createStringArrayList();
    method public final <T> T[] createTypedArray(android.os.Parcelable.Creator<T>);
    method public final <T> java.util.ArrayList<T> createTypedArrayList(android.os.Parcelable.Creator<T>);
    method public final int dataAvail();
    method public final int dataCapacity();
    method public final int dataPosition();
    method public final int dataSize();
    method public final void enforceInterface(java.lang.String);
    method public final boolean hasFileDescriptors();
    method public final byte[] marshall();
    method public static android.os.Parcel obtain();
    method public final java.lang.Object[] readArray(java.lang.ClassLoader);
    method public final java.util.ArrayList readArrayList(java.lang.ClassLoader);
    method public final void readBinderArray(android.os.IBinder[]);
    method public final void readBinderList(java.util.List<android.os.IBinder>);
    method public final void readBooleanArray(boolean[]);
    method public final android.os.Bundle readBundle();
    method public final android.os.Bundle readBundle(java.lang.ClassLoader);
    method public final byte readByte();
    method public final void readByteArray(byte[]);
    method public final void readCharArray(char[]);
    method public final double readDouble();
    method public final void readDoubleArray(double[]);
    method public final void readException();
    method public final void readException(int, java.lang.String);
    method public final android.os.ParcelFileDescriptor readFileDescriptor();
    method public final float readFloat();
    method public final void readFloatArray(float[]);
    method public final java.util.HashMap readHashMap(java.lang.ClassLoader);
    method public final int readInt();
    method public final void readIntArray(int[]);
    method public final void readList(java.util.List, java.lang.ClassLoader);
    method public final long readLong();
    method public final void readLongArray(long[]);
    method public final void readMap(java.util.Map, java.lang.ClassLoader);
    method public final <T extends android.os.Parcelable> T readParcelable(java.lang.ClassLoader);
    method public final android.os.Parcelable[] readParcelableArray(java.lang.ClassLoader);
    method public final android.os.PersistableBundle readPersistableBundle();
    method public final android.os.PersistableBundle readPersistableBundle(java.lang.ClassLoader);
    method public final java.io.Serializable readSerializable();
    method public final android.util.Size readSize();
    method public final android.util.SizeF readSizeF();
    method public final android.util.SparseArray readSparseArray(java.lang.ClassLoader);
    method public final android.util.SparseBooleanArray readSparseBooleanArray();
    method public final java.lang.String readString();
    method public final void readStringArray(java.lang.String[]);
    method public final void readStringList(java.util.List<java.lang.String>);
    method public final android.os.IBinder readStrongBinder();
    method public final <T> void readTypedArray(T[], android.os.Parcelable.Creator<T>);
    method public final <T> void readTypedList(java.util.List<T>, android.os.Parcelable.Creator<T>);
    method public final <T> T readTypedObject(android.os.Parcelable.Creator<T>);
    method public final java.lang.Object readValue(java.lang.ClassLoader);
    method public final void recycle();
    method public final void setDataCapacity(int);
    method public final void setDataPosition(int);
    method public final void setDataSize(int);
    method public final void unmarshall(byte[], int, int);
    method public final void writeArray(java.lang.Object[]);
    method public final void writeBinderArray(android.os.IBinder[]);
    method public final void writeBinderList(java.util.List<android.os.IBinder>);
    method public final void writeBooleanArray(boolean[]);
    method public final void writeBundle(android.os.Bundle);
    method public final void writeByte(byte);
    method public final void writeByteArray(byte[]);
    method public final void writeByteArray(byte[], int, int);
    method public final void writeCharArray(char[]);
    method public final void writeDouble(double);
    method public final void writeDoubleArray(double[]);
    method public final void writeException(java.lang.Exception);
    method public final void writeFileDescriptor(java.io.FileDescriptor);
    method public final void writeFloat(float);
    method public final void writeFloatArray(float[]);
    method public final void writeInt(int);
    method public final void writeIntArray(int[]);
    method public final void writeInterfaceToken(java.lang.String);
    method public final void writeList(java.util.List);
    method public final void writeLong(long);
    method public final void writeLongArray(long[]);
    method public final void writeMap(java.util.Map);
    method public final void writeNoException();
    method public final void writeParcelable(android.os.Parcelable, int);
    method public final <T extends android.os.Parcelable> void writeParcelableArray(T[], int);
    method public final void writePersistableBundle(android.os.PersistableBundle);
    method public final void writeSerializable(java.io.Serializable);
    method public final void writeSize(android.util.Size);
    method public final void writeSizeF(android.util.SizeF);
    method public final void writeSparseArray(android.util.SparseArray<java.lang.Object>);
    method public final void writeSparseBooleanArray(android.util.SparseBooleanArray);
    method public final void writeString(java.lang.String);
    method public final void writeStringArray(java.lang.String[]);
    method public final void writeStringList(java.util.List<java.lang.String>);
    method public final void writeStrongBinder(android.os.IBinder);
    method public final void writeStrongInterface(android.os.IInterface);
    method public final <T extends android.os.Parcelable> void writeTypedArray(T[], int);
    method public final <T extends android.os.Parcelable> void writeTypedList(java.util.List<T>);
    method public final <T extends android.os.Parcelable> void writeTypedObject(T, int);
    method public final 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_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 int describeContents();
    method public android.os.PersistableBundle getPersistableBundle(java.lang.String);
    method public void putPersistableBundle(java.lang.String, android.os.PersistableBundle);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.PersistableBundle> CREATOR;
    field public static final android.os.PersistableBundle EMPTY;
  }

  public final class PowerManager {
    method public 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 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 getThreadScheduler(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 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
  }

  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 int getRegisteredCallbackCount();
    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 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 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 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 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 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 penaltyLog();
    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 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 int getAppId(int);
    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 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_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_APPS_CONTROL = "no_control_apps";
    field public static final java.lang.String DISALLOW_BLUETOOTH = "no_bluetooth";
    field public static final java.lang.String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth";
    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_MOBILE_NETWORKS = "no_config_mobile_networks";
    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_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_LOCATION = "no_share_location";
    field public static final java.lang.String DISALLOW_SMS = "no_sms";
    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 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
  }

  public abstract class Vibrator {
    method public abstract void cancel();
    method public abstract boolean hasVibrator();
    method public void vibrate(long);
    method public void vibrate(long, android.media.AudioAttributes);
    method public void vibrate(long[], int);
    method public void vibrate(long[], int, 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 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 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 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 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";
  }

  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.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 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.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 isPersistent();
    method public boolean isSelectable();
    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 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 setSelectable(boolean);
    method public void setShouldDisableView(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 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 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.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 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 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 float getProgress();
    method public int getState();
    method public java.lang.CharSequence getStatus(android.content.pm.PackageManager);
    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 android.graphics.drawable.Drawable loadIcon(android.content.Context);
    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_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 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_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_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 final 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 final 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 final android.database.Cursor query(android.content.ContentResolver, java.lang.String[], long, long);
    method public static final 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 final 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_PULLED_EXTERNALLY = 2; // 0x2
    field public static final int FEATURES_VIDEO = 1; // 0x1
    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 final 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 final 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 final deprecated java.lang.CharSequence getDisplayLabel(android.content.Context, int, java.lang.CharSequence, java.lang.CharSequence[]);
    method public static final 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 final java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static final 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 final 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 final java.lang.CharSequence getProtocolLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static final int getProtocolLabelResource(int);
    method public static final java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static final 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 final java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static final 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 final java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static final 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 final java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static final 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 final java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static final 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 final java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
    method public static final 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 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 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.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 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);
    method public static android.net.Uri createDocument(android.content.ContentResolver, android.net.Uri, java.lang.String, java.lang.String);
    method public static boolean deleteDocument(android.content.ContentResolver, android.net.Uri);
    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);
    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);
    method public static boolean removeDocument(android.content.ContentResolver, android.net.Uri, android.net.Uri);
    method public static android.net.Uri renameDocument(android.content.ContentResolver, android.net.Uri, java.lang.String);
    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_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_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 java.lang.String MIME_TYPE_DIR = "vnd.android.document/directory";
  }

  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_IS_CHILD = 16; // 0x10
    field public static final int FLAG_SUPPORTS_RECENTS = 4; // 0x4
    field public static final int FLAG_SUPPORTS_SEARCH = 8; // 0x8
  }

  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 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 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 abstract android.database.Cursor queryChildDocuments(java.lang.String, java.lang.String[], java.lang.String) 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 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 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 final 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 final 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 final android.net.Uri getContentUri(java.lang.String, long);
    method public static final 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 final 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 final 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 final java.lang.String insertImage(android.content.ContentResolver, java.lang.String, java.lang.String, java.lang.String) throws java.io.FileNotFoundException;
    method public static final java.lang.String insertImage(android.content.ContentResolver, android.graphics.Bitmap, java.lang.String, java.lang.String);
    method public static final android.database.Cursor query(android.content.ContentResolver, android.net.Uri, java.lang.String[]);
    method public static final android.database.Cursor query(android.content.ContentResolver, android.net.Uri, java.lang.String[], java.lang.String, java.lang.String);
    method public static final 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 final 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_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_DATA_ROAMING_SETTINGS = "android.settings.DATA_ROAMING_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_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_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_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_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_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 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_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_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 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 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 final 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 final 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 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 java.lang.String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = "enabled_notification_policy_access_packages";
    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 java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
    field public static final java.lang.String LOCATION_MODE = "location_mode";
    field public static final int LOCATION_MODE_BATTERY_SAVING = 2; // 0x2
    field public static final int LOCATION_MODE_HIGH_ACCURACY = 3; // 0x3
    field public static final int LOCATION_MODE_OFF = 0; // 0x0
    field public static final 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 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 java.lang.String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
    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 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.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 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 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.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 java.lang.String SIM_FULL_ACTION = "android.provider.Telephony.SIM_FULL";
    field public static final java.lang.String SMS_CARRIER_PROVISION_ACTION = "android.provider.Telephony.SMS_CARRIER_PROVISION";
    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 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 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_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 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 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 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.security {

  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_STORAGE_CHANGED = "android.security.STORAGE_CHANGED";
    field public static final java.lang.String EXTRA_CERTIFICATE = "CERT";
    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 void handleTrustStorageUpdate();
    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 isUserAuthenticationRequired();
    method public boolean isUserAuthenticationValidWhileOnBody();
  }

  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 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 setUserAuthenticationRequired(boolean);
    method public android.security.keystore.KeyGenParameterSpec.Builder setUserAuthenticationValidWhileOnBody(boolean);
    method public android.security.keystore.KeyGenParameterSpec.Builder setUserAuthenticationValidityDurationSeconds(int);
  }

  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 isUserAuthenticationRequired();
    method public boolean isUserAuthenticationRequirementEnforcedBySecureHardware();
    method public boolean isUserAuthenticationValidWhileOnBody();
  }

  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 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_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 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 isUserAuthenticationRequired();
    method public boolean isUserAuthenticationValidWhileOnBody();
  }

  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 setUserAuthenticationRequired(boolean);
    method public android.security.keystore.KeyProtection.Builder setUserAuthenticationValidWhileOnBody(boolean);
    method public android.security.keystore.KeyProtection.Builder setUserAuthenticationValidityDurationSeconds(int);
  }

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

}

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);
    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 android.view.View 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 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 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);
    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 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 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 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[]);
    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 java.lang.String SERVICE_INTERFACE = "android.service.notification.NotificationListenerService";
    field public static final int SUPPRESSED_EFFECT_SCREEN_OFF = 1; // 0x1
    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 2; // 0x2
  }

  public static class NotificationListenerService.Ranking {
    ctor public NotificationListenerService.Ranking();
    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 boolean isAmbient();
    method public boolean matchesInterruptionFilter();
  }

  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 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 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 show(android.os.Bundle, int);
    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 onApplyWindowInsets(android.view.WindowInsets);
    method public android.os.Bundle onCommand(java.lang.String, int, int, int, android.os.Bundle, boolean);
    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 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 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 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.util.MutableLong, 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 waitpid(int, android.util.MutableInt, int) 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_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_CREAT;
    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);
    field public final long st_atime;
    field public final long st_blksize;
    field public final long st_blocks;
    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 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 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 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 int getState();
    method public android.telecom.InCallService.VideoCall getVideoCall();
    method public void hold();
    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 final 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 final void removeExtras(java.util.List<java.lang.String>);
    method public final void removeExtras(java.lang.String...);
    method public void sendCallEvent(java.lang.String, android.os.Bundle);
    method public void splitFromConference();
    method public void stopDtmfTone();
    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 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 onParentChanged(android.telecom.Call, android.telecom.Call);
    method public void onPostDialWait(android.telecom.Call, java.lang.String);
    method public void onStateChanged(android.telecom.Call, int);
    method public void onVideoCallChanged(android.telecom.Call, android.telecom.InCallService.VideoCall);
  }

  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 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_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_WIFI = 8; // 0x8
  }

  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 int getRoute();
    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 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 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 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 onDisconnect();
    method public void onExtrasChanged(android.os.Bundle);
    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 onStateChanged(int);
    method public void onStopDtmfTone();
    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 sendConnectionEvent(java.lang.String, android.os.Bundle);
    method public final void setActive();
    method public final void setAddress(android.net.Uri, int);
    method public final void setAudioModeIsVoip(boolean);
    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_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_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 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 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_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 int getVideoState();
    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 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 android.telecom.Connection onCreateIncomingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateOutgoingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    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 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_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 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 final int getConnectionCapabilities();
    method public final int getConnectionProperties();
    method public final java.util.List<android.telecom.RemoteConnection> getConnections();
    method public android.telecom.DisconnectCause getDisconnectCause();
    method public final android.os.Bundle getExtras();
    method public final int getState();
    method public void hold();
    method public void merge();
    method public void playDtmfTone(char);
    method public final void registerCallback(android.telecom.RemoteConference.Callback);
    method public final 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 final 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 final android.os.Bundle getExtras();
    method public int getState();
    method public android.telecom.StatusHints getStatusHints();
    method public final 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 addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
    method public void cancelMissedCallsNotification();
    method public android.content.Intent createManageBlockedNumbersIntent();
    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 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 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 java.lang.String ACTION_INCOMING_CALL = "android.telecom.action.INCOMING_CALL";
    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_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_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_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 class CarrierConfigManager {
    method public android.os.PersistableBundle getConfig();
    method public android.os.PersistableBundle getConfigForSubId(int);
    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 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_CARRIER_ALLOW_TURNOFF_IMS_BOOL = "carrier_allow_turnoff_ims_bool";
    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_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_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 java.lang.String KEY_CARRIER_VVM_PACKAGE_NAME_STRING = "carrier_vvm_package_name_string";
    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_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_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_CSP_ENABLED_BOOL = "csp_enabled_bool";
    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_DISABLE_CDMA_ACTIVATION_CODE_BOOL = "disable_cdma_activation_code_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_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_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_DTMF_TONE_DELAY_INT = "ims_dtmf_tone_delay_int";
    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_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_REQUIRE_ENTITLEMENT_CHECKS_BOOL = "require_entitlement_checks_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_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL = "sim_network_unlock_allow_dismiss_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_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_DESTINATION_NUMBER_STRING = "vvm_destination_number_string";
    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_TYPE_STRING = "vvm_type_string";
    field public static final java.lang.String KEY_WORLD_PHONE_BOOL = "world_phone_bool";
  }

  public final class CellIdentityCdma implements android.os.Parcelable {
    method public int describeContents();
    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 implements android.os.Parcelable {
    method public int describeContents();
    method public int getArfcn();
    method public int getBsic();
    method public int getCid();
    method public int getLac();
    method public int getMcc();
    method public int getMnc();
    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 implements android.os.Parcelable {
    method public int describeContents();
    method public int getCi();
    method public int getEarfcn();
    method public int getMcc();
    method public int getMnc();
    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 CellIdentityWcdma implements android.os.Parcelable {
    method public int describeContents();
    method public int getCid();
    method public int getLac();
    method public int getMcc();
    method public int getMnc();
    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 long getTimeStamp();
    method public boolean isRegistered();
    method public abstract void writeToParcel(android.os.Parcel, int);
    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 boolean equals(java.lang.Object);
    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 int hashCode();
    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 boolean equals(java.lang.Object);
    method public int getAsuLevel();
    method public int getDbm();
    method public int getLevel();
    method public int getTimingAdvance();
    method public int hashCode();
    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 boolean equals(java.lang.Object);
    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 int hashCode();
    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 boolean equals(java.lang.Object);
    method public int getAsuLevel();
    method public int getDbm();
    method public int getLevel();
    method public int hashCode();
    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 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 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 java.lang.String calledPartyBCDFragmentToString(byte[], int, int);
    method public static java.lang.String calledPartyBCDToString(byte[], 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 byte[] numberToCalledPartyBCD(java.lang.String);
    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 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);
    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
  }

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

  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.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);
    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_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 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 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 int getMcc();
    method public int getMnc();
    method public java.lang.String getNumber();
    method public int getSimSlotIndex();
    method public int getSubscriptionId();
    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 static android.telephony.SubscriptionManager from(android.content.Context);
    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 boolean isNetworkRoaming(int);
    method public void removeOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
    field public static final int DATA_ROAMING_DISABLE = 0; // 0x0
    field public static final int DATA_ROAMING_ENABLE = 1; // 0x1
    field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff
  }

  public static class SubscriptionManager.OnSubscriptionsChangedListener {
    ctor public SubscriptionManager.OnSubscriptionsChangedListener();
    method public void onSubscriptionsChanged();
  }

  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.telephony.CellLocation getCellLocation();
    method public int getDataActivity();
    method public boolean getDataEnabled();
    method public int getDataNetworkType();
    method public int getDataState();
    method public java.lang.String getDeviceId();
    method public java.lang.String getDeviceId(int);
    method public java.lang.String getDeviceSoftwareVersion();
    method public java.lang.String getGroupIdLevel1();
    method public java.lang.String getIccAuthentication(int, int, java.lang.String);
    method public java.lang.String getLine1Number();
    method public java.lang.String getMmsUAProfUrl();
    method public java.lang.String getMmsUserAgent();
    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 int getNetworkType();
    method public int getPhoneCount();
    method public int getPhoneType();
    method public android.telephony.ServiceState getServiceState();
    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 java.lang.String getSubscriberId();
    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 android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String);
    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 isHearingAidCompatibilitySupported();
    method public boolean isNetworkRoaming();
    method public boolean isSmsCapable();
    method public boolean isTtyModeSupported();
    method public boolean isVoiceCapable();
    method public boolean isVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle);
    method public boolean isWorldPhone();
    method public void listen(android.telephony.PhoneStateListener, int);
    method public java.lang.String sendEnvelopeWithStatus(java.lang.String);
    method public void setDataEnabled(boolean);
    method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String);
    method public boolean setOperatorBrandOverride(java.lang.String);
    method public boolean setPreferredNetworkTypeToGlobal();
    method public boolean setVoiceMailNumber(java.lang.String, java.lang.String);
    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_SHOW_VOICEMAIL_NOTIFICATION = "android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION";
    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 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_INCOMING_NUMBER = "incoming_number";
    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_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_VOICEMAIL_NUMBER = "android.telephony.extra.VOICEMAIL_NUMBER";
    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_NETWORK_LOCKED = 4; // 0x4
    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 java.lang.String VVM_TYPE_CVVM = "vvm_type_cvvm";
    field public static final java.lang.String VVM_TYPE_OMTP = "vvm_type_omtp";
  }

}

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.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 final deprecated java.util.ArrayList<java.lang.String> divideMessage(java.lang.String);
    method public static final deprecated android.telephony.gsm.SmsManager getDefault();
    method public final deprecated void sendDataMessage(java.lang.String, java.lang.String, short, byte[], android.app.PendingIntent, android.app.PendingIntent);
    method public final 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 final 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();
    field public deprecated byte[] encodedMessage;
    field public deprecated byte[] encodedScAddress;
  }

}

package android.test {

  public abstract deprecated class ActivityInstrumentationTestCase<T extends android.app.Activity> extends android.test.ActivityTestCase {
    ctor public ActivityInstrumentationTestCase(java.lang.String, java.lang.Class<T>);
    ctor public ActivityInstrumentationTestCase(java.lang.String, java.lang.Class<T>, boolean);
    method public T getActivity();
    method public void testActivityTestCaseSetUpProperly() throws java.lang.Exception;
  }

  public abstract deprecated class ActivityInstrumentationTestCase2<T extends android.app.Activity> extends android.test.ActivityTestCase {
    ctor public deprecated ActivityInstrumentationTestCase2(java.lang.String, java.lang.Class<T>);
    ctor public ActivityInstrumentationTestCase2(java.lang.Class<T>);
    method public T getActivity();
    method public void setActivityInitialTouchMode(boolean);
    method public void setActivityIntent(android.content.Intent);
  }

  public abstract deprecated class ActivityTestCase extends android.test.InstrumentationTestCase {
    ctor public ActivityTestCase();
    method protected android.app.Activity getActivity();
    method protected void scrubClass(java.lang.Class<?>) throws java.lang.IllegalAccessException;
    method protected void setActivity(android.app.Activity);
  }

  public abstract deprecated class ActivityUnitTestCase<T extends android.app.Activity> extends android.test.ActivityTestCase {
    ctor public ActivityUnitTestCase(java.lang.Class<T>);
    method public T getActivity();
    method public int getFinishedActivityRequest();
    method public int getRequestedOrientation();
    method public android.content.Intent getStartedActivityIntent();
    method public int getStartedActivityRequest();
    method public boolean isFinishCalled();
    method public void setActivityContext(android.content.Context);
    method public void setApplication(android.app.Application);
    method protected T startActivity(android.content.Intent, android.os.Bundle, java.lang.Object);
  }

  public deprecated class AndroidTestCase extends junit.framework.TestCase {
    ctor public AndroidTestCase();
    method public void assertActivityRequiresPermission(java.lang.String, java.lang.String, java.lang.String);
    method public void assertReadingContentUriRequiresPermission(android.net.Uri, java.lang.String);
    method public void assertWritingContentUriRequiresPermission(android.net.Uri, java.lang.String);
    method public android.content.Context getContext();
    method protected void scrubClass(java.lang.Class<?>) throws java.lang.IllegalAccessException;
    method public void setContext(android.content.Context);
    method public void testAndroidTestCaseSetupProperly();
    field protected android.content.Context mContext;
  }

  public deprecated class AndroidTestRunner extends junit.runner.BaseTestRunner {
    ctor public AndroidTestRunner();
    method public void addTestListener(junit.framework.TestListener);
    method public void clearTestListeners();
    method protected junit.framework.TestResult createTestResult();
    method public java.util.List<junit.framework.TestCase> getTestCases();
    method public java.lang.String getTestClassName();
    method public junit.framework.TestResult getTestResult();
    method protected void runFailed(java.lang.String);
    method public void runTest();
    method public void runTest(junit.framework.TestResult);
    method public void setContext(android.content.Context);
    method public deprecated void setInstrumentaiton(android.app.Instrumentation);
    method public void setInstrumentation(android.app.Instrumentation);
    method public void setTest(junit.framework.Test);
    method public void setTestClassName(java.lang.String, java.lang.String);
    method public void testEnded(java.lang.String);
    method public void testFailed(int, junit.framework.Test, java.lang.Throwable);
    method public void testStarted(java.lang.String);
  }

  public abstract deprecated class ApplicationTestCase<T extends android.app.Application> extends android.test.AndroidTestCase {
    ctor public ApplicationTestCase(java.lang.Class<T>);
    method protected final void createApplication();
    method public T getApplication();
    method public android.content.Context getSystemContext();
    method protected final void terminateApplication();
    method public final void testApplicationTestCaseSetUpProperly() throws java.lang.Exception;
  }

  public deprecated class AssertionFailedError extends java.lang.Error {
    ctor public AssertionFailedError();
    ctor public AssertionFailedError(java.lang.String);
  }

  public deprecated class ComparisonFailure extends android.test.AssertionFailedError {
    ctor public ComparisonFailure(java.lang.String, java.lang.String, java.lang.String);
  }

  public abstract deprecated class FlakyTest implements java.lang.annotation.Annotation {
  }

  public deprecated class InstrumentationTestCase extends junit.framework.TestCase {
    ctor public InstrumentationTestCase();
    method public android.app.Instrumentation getInstrumentation();
    method public deprecated void injectInsrumentation(android.app.Instrumentation);
    method public void injectInstrumentation(android.app.Instrumentation);
    method public final <T extends android.app.Activity> T launchActivity(java.lang.String, java.lang.Class<T>, android.os.Bundle);
    method public final <T extends android.app.Activity> T launchActivityWithIntent(java.lang.String, java.lang.Class<T>, android.content.Intent);
    method public void runTestOnUiThread(java.lang.Runnable) throws java.lang.Throwable;
    method public void sendKeys(java.lang.String);
    method public void sendKeys(int...);
    method public void sendRepeatedKeys(int...);
  }

  public deprecated class InstrumentationTestRunner extends android.app.Instrumentation implements android.test.TestSuiteProvider {
    ctor public InstrumentationTestRunner();
    method public junit.framework.TestSuite getAllTests();
    method protected android.test.AndroidTestRunner getAndroidTestRunner();
    method public android.os.Bundle getArguments();
    method public java.lang.ClassLoader getLoader();
    method public junit.framework.TestSuite getTestSuite();
    field public static final java.lang.String REPORT_KEY_NAME_CLASS = "class";
    field public static final java.lang.String REPORT_KEY_NAME_TEST = "test";
    field public static final java.lang.String REPORT_KEY_NUM_CURRENT = "current";
    field public static final java.lang.String REPORT_KEY_NUM_TOTAL = "numtests";
    field public static final java.lang.String REPORT_KEY_STACK = "stack";
    field public static final java.lang.String REPORT_VALUE_ID = "InstrumentationTestRunner";
    field public static final int REPORT_VALUE_RESULT_ERROR = -1; // 0xffffffff
    field public static final int REPORT_VALUE_RESULT_FAILURE = -2; // 0xfffffffe
    field public static final int REPORT_VALUE_RESULT_OK = 0; // 0x0
    field public static final int REPORT_VALUE_RESULT_START = 1; // 0x1
  }

  public deprecated class InstrumentationTestSuite extends junit.framework.TestSuite {
    ctor public InstrumentationTestSuite(android.app.Instrumentation);
    ctor public InstrumentationTestSuite(java.lang.String, android.app.Instrumentation);
    ctor public InstrumentationTestSuite(java.lang.Class, android.app.Instrumentation);
    method public void addTestSuite(java.lang.Class);
  }

  public deprecated class IsolatedContext extends android.content.ContextWrapper {
    ctor public IsolatedContext(android.content.ContentResolver, android.content.Context);
    method public java.util.List<android.content.Intent> getAndClearBroadcastIntents();
  }

  public class LoaderTestCase extends android.test.AndroidTestCase {
    ctor public LoaderTestCase();
    method public <T> T getLoaderResultSynchronously(android.content.Loader<T>);
  }

  public final deprecated class MoreAsserts {
    method public static void assertAssignableFrom(java.lang.Class<?>, java.lang.Object);
    method public static void assertAssignableFrom(java.lang.Class<?>, java.lang.Class<?>);
    method public static java.util.regex.MatchResult assertContainsRegex(java.lang.String, java.lang.String, java.lang.String);
    method public static java.util.regex.MatchResult assertContainsRegex(java.lang.String, java.lang.String);
    method public static void assertContentsInAnyOrder(java.lang.String, java.lang.Iterable<?>, java.lang.Object...);
    method public static void assertContentsInAnyOrder(java.lang.Iterable<?>, java.lang.Object...);
    method public static void assertContentsInOrder(java.lang.String, java.lang.Iterable<?>, java.lang.Object...);
    method public static void assertContentsInOrder(java.lang.Iterable<?>, java.lang.Object...);
    method public static void assertEmpty(java.lang.String, java.lang.Iterable<?>);
    method public static void assertEmpty(java.lang.Iterable<?>);
    method public static void assertEmpty(java.lang.String, java.util.Map<?, ?>);
    method public static void assertEmpty(java.util.Map<?, ?>);
    method public static void assertEquals(java.lang.String, byte[], byte[]);
    method public static void assertEquals(byte[], byte[]);
    method public static void assertEquals(java.lang.String, int[], int[]);
    method public static void assertEquals(int[], int[]);
    method public static void assertEquals(java.lang.String, double[], double[]);
    method public static void assertEquals(double[], double[]);
    method public static void assertEquals(java.lang.String, java.lang.Object[], java.lang.Object[]);
    method public static void assertEquals(java.lang.Object[], java.lang.Object[]);
    method public static void assertEquals(java.lang.String, java.util.Set<? extends java.lang.Object>, java.util.Set<? extends java.lang.Object>);
    method public static void assertEquals(java.util.Set<? extends java.lang.Object>, java.util.Set<? extends java.lang.Object>);
    method public static java.util.regex.MatchResult assertMatchesRegex(java.lang.String, java.lang.String, java.lang.String);
    method public static java.util.regex.MatchResult assertMatchesRegex(java.lang.String, java.lang.String);
    method public static void assertNotContainsRegex(java.lang.String, java.lang.String, java.lang.String);
    method public static void assertNotContainsRegex(java.lang.String, java.lang.String);
    method public static void assertNotEmpty(java.lang.String, java.lang.Iterable<?>);
    method public static void assertNotEmpty(java.lang.Iterable<?>);
    method public static void assertNotEmpty(java.lang.String, java.util.Map<?, ?>);
    method public static void assertNotEmpty(java.util.Map<?, ?>);
    method public static void assertNotEqual(java.lang.String, java.lang.Object, java.lang.Object);
    method public static void assertNotEqual(java.lang.Object, java.lang.Object);
    method public static void assertNotMatchesRegex(java.lang.String, java.lang.String, java.lang.String);
    method public static void assertNotMatchesRegex(java.lang.String, java.lang.String);
    method public static void checkEqualsAndHashCodeMethods(java.lang.String, java.lang.Object, java.lang.Object, boolean);
    method public static void checkEqualsAndHashCodeMethods(java.lang.Object, java.lang.Object, boolean);
  }

  public abstract deprecated interface PerformanceTestCase {
    method public abstract boolean isPerformanceOnly();
    method public abstract int startPerformance(android.test.PerformanceTestCase.Intermediates);
  }

  public static abstract interface PerformanceTestCase.Intermediates {
    method public abstract void addIntermediate(java.lang.String);
    method public abstract void addIntermediate(java.lang.String, long);
    method public abstract void finishTiming(boolean);
    method public abstract void setInternalIterations(int);
    method public abstract void startTiming(boolean);
  }

  public abstract deprecated class ProviderTestCase<T extends android.content.ContentProvider> extends android.test.InstrumentationTestCase {
    ctor public ProviderTestCase(java.lang.Class<T>, java.lang.String);
    method public android.test.mock.MockContentResolver getMockContentResolver();
    method public android.test.IsolatedContext getMockContext();
    method public T getProvider();
    method public static <T extends android.content.ContentProvider> android.content.ContentResolver newResolverWithContentProviderFromSql(android.content.Context, java.lang.Class<T>, java.lang.String, java.lang.String, int, java.lang.String) throws java.lang.IllegalAccessException, java.lang.InstantiationException;
  }

  public abstract class ProviderTestCase2<T extends android.content.ContentProvider> extends android.test.AndroidTestCase {
    ctor public ProviderTestCase2(java.lang.Class<T>, java.lang.String);
    method public android.test.mock.MockContentResolver getMockContentResolver();
    method public android.test.IsolatedContext getMockContext();
    method public T getProvider();
    method public static <T extends android.content.ContentProvider> android.content.ContentResolver newResolverWithContentProviderFromSql(android.content.Context, java.lang.String, java.lang.Class<T>, java.lang.String, java.lang.String, int, java.lang.String) throws java.lang.IllegalAccessException, java.lang.InstantiationException;
  }

  public deprecated class RenamingDelegatingContext extends android.content.ContextWrapper {
    ctor public RenamingDelegatingContext(android.content.Context, java.lang.String);
    ctor public RenamingDelegatingContext(android.content.Context, android.content.Context, java.lang.String);
    method public java.lang.String getDatabasePrefix();
    method public void makeExistingFilesAndDbsAccessible();
    method public static <T extends android.content.ContentProvider> T providerWithRenamedContext(java.lang.Class<T>, android.content.Context, java.lang.String) throws java.lang.IllegalAccessException, java.lang.InstantiationException;
    method public static <T extends android.content.ContentProvider> T providerWithRenamedContext(java.lang.Class<T>, android.content.Context, java.lang.String, boolean) throws java.lang.IllegalAccessException, java.lang.InstantiationException;
  }

  public abstract deprecated class ServiceTestCase<T extends android.app.Service> extends android.test.AndroidTestCase {
    ctor public ServiceTestCase(java.lang.Class<T>);
    method protected android.os.IBinder bindService(android.content.Intent);
    method public android.app.Application getApplication();
    method public T getService();
    method public android.content.Context getSystemContext();
    method public void setApplication(android.app.Application);
    method protected void setupService();
    method protected void shutdownService();
    method protected void startService(android.content.Intent);
    method public void testServiceTestCaseSetUpProperly() throws java.lang.Exception;
  }

  public abstract deprecated class SingleLaunchActivityTestCase<T extends android.app.Activity> extends android.test.InstrumentationTestCase {
    ctor public SingleLaunchActivityTestCase(java.lang.String, java.lang.Class<T>);
    method public T getActivity();
    method public void testActivityTestCaseSetUpProperly() throws java.lang.Exception;
  }

  public deprecated class SyncBaseInstrumentation extends android.test.InstrumentationTestCase {
    ctor public SyncBaseInstrumentation();
    method protected void cancelSyncsandDisableAutoSync();
    method protected void syncProvider(android.net.Uri, java.lang.String, java.lang.String) throws java.lang.Exception;
  }

  public abstract deprecated interface TestSuiteProvider {
    method public abstract junit.framework.TestSuite getTestSuite();
  }

  public deprecated class TouchUtils {
    ctor public TouchUtils();
    method public static void clickView(android.test.InstrumentationTestCase, android.view.View);
    method public static deprecated void drag(android.test.ActivityInstrumentationTestCase, float, float, float, float, int);
    method public static void drag(android.test.InstrumentationTestCase, float, float, float, float, int);
    method public static deprecated void dragQuarterScreenDown(android.test.ActivityInstrumentationTestCase);
    method public static void dragQuarterScreenDown(android.test.InstrumentationTestCase, android.app.Activity);
    method public static deprecated void dragQuarterScreenUp(android.test.ActivityInstrumentationTestCase);
    method public static void dragQuarterScreenUp(android.test.InstrumentationTestCase, android.app.Activity);
    method public static deprecated int dragViewBy(android.test.ActivityInstrumentationTestCase, android.view.View, int, int, int);
    method public static deprecated int dragViewBy(android.test.InstrumentationTestCase, android.view.View, int, int, int);
    method public static deprecated int dragViewTo(android.test.ActivityInstrumentationTestCase, android.view.View, int, int, int);
    method public static int dragViewTo(android.test.InstrumentationTestCase, android.view.View, int, int, int);
    method public static deprecated void dragViewToBottom(android.test.ActivityInstrumentationTestCase, android.view.View);
    method public static void dragViewToBottom(android.test.InstrumentationTestCase, android.app.Activity, android.view.View);
    method public static deprecated void dragViewToBottom(android.test.ActivityInstrumentationTestCase, android.view.View, int);
    method public static void dragViewToBottom(android.test.InstrumentationTestCase, android.app.Activity, android.view.View, int);
    method public static deprecated void dragViewToTop(android.test.ActivityInstrumentationTestCase, android.view.View);
    method public static deprecated void dragViewToTop(android.test.ActivityInstrumentationTestCase, android.view.View, int);
    method public static void dragViewToTop(android.test.InstrumentationTestCase, android.view.View);
    method public static void dragViewToTop(android.test.InstrumentationTestCase, android.view.View, int);
    method public static deprecated int dragViewToX(android.test.ActivityInstrumentationTestCase, android.view.View, int, int);
    method public static int dragViewToX(android.test.InstrumentationTestCase, android.view.View, int, int);
    method public static deprecated int dragViewToY(android.test.ActivityInstrumentationTestCase, android.view.View, int, int);
    method public static int dragViewToY(android.test.InstrumentationTestCase, android.view.View, int, int);
    method public static deprecated void longClickView(android.test.ActivityInstrumentationTestCase, android.view.View);
    method public static void longClickView(android.test.InstrumentationTestCase, android.view.View);
    method public static deprecated void scrollToBottom(android.test.ActivityInstrumentationTestCase, android.view.ViewGroup);
    method public static void scrollToBottom(android.test.InstrumentationTestCase, android.app.Activity, android.view.ViewGroup);
    method public static deprecated void scrollToTop(android.test.ActivityInstrumentationTestCase, android.view.ViewGroup);
    method public static void scrollToTop(android.test.InstrumentationTestCase, android.app.Activity, android.view.ViewGroup);
    method public static void tapView(android.test.InstrumentationTestCase, android.view.View);
    method public static void touchAndCancelView(android.test.InstrumentationTestCase, android.view.View);
  }

  public abstract deprecated class UiThreadTest implements java.lang.annotation.Annotation {
  }

  public deprecated class ViewAsserts {
    method public static void assertBaselineAligned(android.view.View, android.view.View);
    method public static void assertBottomAligned(android.view.View, android.view.View);
    method public static void assertBottomAligned(android.view.View, android.view.View, int);
    method public static void assertGroupContains(android.view.ViewGroup, android.view.View);
    method public static void assertGroupIntegrity(android.view.ViewGroup);
    method public static void assertGroupNotContains(android.view.ViewGroup, android.view.View);
    method public static void assertHasScreenCoordinates(android.view.View, android.view.View, int, int);
    method public static void assertHorizontalCenterAligned(android.view.View, android.view.View);
    method public static void assertLeftAligned(android.view.View, android.view.View);
    method public static void assertLeftAligned(android.view.View, android.view.View, int);
    method public static void assertOffScreenAbove(android.view.View, android.view.View);
    method public static void assertOffScreenBelow(android.view.View, android.view.View);
    method public static void assertOnScreen(android.view.View, android.view.View);
    method public static void assertRightAligned(android.view.View, android.view.View);
    method public static void assertRightAligned(android.view.View, android.view.View, int);
    method public static void assertTopAligned(android.view.View, android.view.View);
    method public static void assertTopAligned(android.view.View, android.view.View, int);
    method public static void assertVerticalCenterAligned(android.view.View, android.view.View);
  }

}

package android.test.mock {

  public deprecated class MockApplication extends android.app.Application {
    ctor public MockApplication();
  }

  public class MockContentProvider extends android.content.ContentProvider {
    ctor protected MockContentProvider();
    ctor public MockContentProvider(android.content.Context);
    ctor public MockContentProvider(android.content.Context, java.lang.String, java.lang.String, android.content.pm.PathPermission[]);
    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 public int update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]);
  }

  public class MockContentResolver extends android.content.ContentResolver {
    ctor public MockContentResolver();
    ctor public MockContentResolver(android.content.Context);
    method public void addProvider(java.lang.String, android.content.ContentProvider);
  }

  public class MockContext extends android.content.Context {
    ctor public MockContext();
    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 void clearWallpaper();
    method public android.content.Context createConfigurationContext(android.content.res.Configuration);
    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 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 int getUserId();
    method public android.graphics.drawable.Drawable getWallpaper();
    method public int getWallpaperDesiredMinimumHeight();
    method public 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 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, java.lang.String, android.os.Handler);
    method public void removeStickyBroadcast(android.content.Intent);
    method public void removeStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle);
    method public void revokeUriPermission(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 void sendStickyBroadcast(android.content.Intent);
    method public void sendStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle);
    method public void sendStickyOrderedBroadcast(android.content.Intent, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
    method public 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 void setWallpaper(android.graphics.Bitmap) throws java.io.IOException;
    method public void setWallpaper(java.io.InputStream) throws java.io.IOException;
    method public void startActivities(android.content.Intent[]);
    method public void startActivities(android.content.Intent[], android.os.Bundle);
    method public void startActivity(android.content.Intent);
    method public void startActivity(android.content.Intent, android.os.Bundle);
    method public 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 MockCursor implements android.database.Cursor {
    ctor public MockCursor();
    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);
    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 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 deprecated class MockDialogInterface implements android.content.DialogInterface {
    ctor public MockDialogInterface();
    method public void cancel();
    method public void dismiss();
  }

  public deprecated class MockPackageManager extends android.content.pm.PackageManager {
    ctor public MockPackageManager();
    method public void addPackageToPreferred(java.lang.String);
    method public boolean addPermission(android.content.pm.PermissionInfo);
    method public boolean addPermissionAsync(android.content.pm.PermissionInfo);
    method public void addPreferredActivity(android.content.IntentFilter, int, android.content.ComponentName[], android.content.ComponentName);
    method public java.lang.String[] canonicalToCurrentPackageNames(java.lang.String[]);
    method public int checkPermission(java.lang.String, java.lang.String);
    method public int checkSignatures(java.lang.String, java.lang.String);
    method public int checkSignatures(int, int);
    method public void clearPackagePreferredActivities(java.lang.String);
    method public java.lang.String[] currentToCanonicalPackageNames(java.lang.String[]);
    method public void extendVerificationTimeout(int, int, long);
    method public android.graphics.drawable.Drawable getActivityBanner(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.graphics.drawable.Drawable getActivityBanner(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.graphics.drawable.Drawable getActivityIcon(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.graphics.drawable.Drawable getActivityIcon(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.pm.ActivityInfo getActivityInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.graphics.drawable.Drawable getActivityLogo(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.graphics.drawable.Drawable getActivityLogo(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException;
    method public java.util.List<android.content.IntentFilter> getAllIntentFilters(java.lang.String);
    method public java.util.List<android.content.pm.PermissionGroupInfo> getAllPermissionGroups(int);
    method public android.graphics.drawable.Drawable getApplicationBanner(android.content.pm.ApplicationInfo);
    method public android.graphics.drawable.Drawable getApplicationBanner(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public int getApplicationEnabledSetting(java.lang.String);
    method public android.graphics.drawable.Drawable getApplicationIcon(android.content.pm.ApplicationInfo);
    method public android.graphics.drawable.Drawable getApplicationIcon(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.pm.ApplicationInfo getApplicationInfo(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public java.lang.CharSequence getApplicationLabel(android.content.pm.ApplicationInfo);
    method public android.graphics.drawable.Drawable getApplicationLogo(android.content.pm.ApplicationInfo);
    method public android.graphics.drawable.Drawable getApplicationLogo(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public int getComponentEnabledSetting(android.content.ComponentName);
    method public android.graphics.drawable.Drawable getDefaultActivityIcon();
    method public java.lang.String getDefaultBrowserPackageNameAsUser(int);
    method public android.graphics.drawable.Drawable getDrawable(java.lang.String, int, android.content.pm.ApplicationInfo);
    method public java.util.List<android.content.pm.ApplicationInfo> getInstalledApplications(int);
    method public java.util.List<android.content.pm.PackageInfo> getInstalledPackages(int);
    method public java.lang.String getInstallerPackageName(java.lang.String);
    method public android.content.pm.InstrumentationInfo getInstrumentationInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.Intent getLaunchIntentForPackage(java.lang.String);
    method public android.content.Intent getLeanbackLaunchIntentForPackage(java.lang.String);
    method public java.lang.String getNameForUid(int);
    method public int[] getPackageGids(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public int[] getPackageGids(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.pm.PackageInfo getPackageInfo(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.pm.PackageInstaller getPackageInstaller();
    method public int getPackageUid(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public java.lang.String[] getPackagesForUid(int);
    method public java.util.List<android.content.pm.PackageInfo> getPackagesHoldingPermissions(java.lang.String[], int);
    method public android.content.pm.PermissionGroupInfo getPermissionGroupInfo(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.pm.PermissionInfo getPermissionInfo(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public int getPreferredActivities(java.util.List<android.content.IntentFilter>, java.util.List<android.content.ComponentName>, java.lang.String);
    method public java.util.List<android.content.pm.PackageInfo> getPreferredPackages(int);
    method public android.content.pm.ProviderInfo getProviderInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.pm.ActivityInfo getReceiverInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.res.Resources getResourcesForActivity(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.res.Resources getResourcesForApplication(android.content.pm.ApplicationInfo);
    method public android.content.res.Resources getResourcesForApplication(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.pm.ServiceInfo getServiceInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.pm.FeatureInfo[] getSystemAvailableFeatures();
    method public java.lang.String[] getSystemSharedLibraryNames();
    method public java.lang.CharSequence getText(java.lang.String, int, android.content.pm.ApplicationInfo);
    method public android.graphics.drawable.Drawable getUserBadgedDrawableForDensity(android.graphics.drawable.Drawable, android.os.UserHandle, android.graphics.Rect, int);
    method public android.graphics.drawable.Drawable getUserBadgedIcon(android.graphics.drawable.Drawable, android.os.UserHandle);
    method public java.lang.CharSequence getUserBadgedLabel(java.lang.CharSequence, android.os.UserHandle);
    method public android.content.res.XmlResourceParser getXml(java.lang.String, int, android.content.pm.ApplicationInfo);
    method public boolean hasSystemFeature(java.lang.String);
    method public boolean hasSystemFeature(java.lang.String, int);
    method public boolean isPermissionRevokedByPolicy(java.lang.String, java.lang.String);
    method public boolean isSafeMode();
    method public java.util.List<android.content.pm.ResolveInfo> queryBroadcastReceivers(android.content.Intent, int);
    method public java.util.List<android.content.pm.ProviderInfo> queryContentProviders(java.lang.String, int, int);
    method public java.util.List<android.content.pm.InstrumentationInfo> queryInstrumentation(java.lang.String, int);
    method public java.util.List<android.content.pm.ResolveInfo> queryIntentActivities(android.content.Intent, int);
    method public java.util.List<android.content.pm.ResolveInfo> queryIntentActivityOptions(android.content.ComponentName, android.content.Intent[], android.content.Intent, int);
    method public java.util.List<android.content.pm.ResolveInfo> queryIntentContentProviders(android.content.Intent, int);
    method public java.util.List<android.content.pm.ResolveInfo> queryIntentServices(android.content.Intent, int);
    method public java.util.List<android.content.pm.PermissionInfo> queryPermissionsByGroup(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public void removePackageFromPreferred(java.lang.String);
    method public void removePermission(java.lang.String);
    method public android.content.pm.ResolveInfo resolveActivity(android.content.Intent, int);
    method public android.content.pm.ProviderInfo resolveContentProvider(java.lang.String, int);
    method public android.content.pm.ResolveInfo resolveService(android.content.Intent, int);
    method public void setApplicationEnabledSetting(java.lang.String, int, int);
    method public void setComponentEnabledSetting(android.content.ComponentName, int, int);
    method public void setInstallerPackageName(java.lang.String, java.lang.String);
    method public void verifyPendingInstall(int, int);
  }

  public deprecated class MockResources extends android.content.res.Resources {
    ctor public MockResources();
  }

}

package android.test.suitebuilder {

  public class TestMethod {
    ctor public TestMethod(java.lang.reflect.Method, java.lang.Class<? extends junit.framework.TestCase>);
    ctor public TestMethod(java.lang.String, java.lang.Class<? extends junit.framework.TestCase>);
    ctor public TestMethod(junit.framework.TestCase);
    method public junit.framework.TestCase createTest() throws java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException;
    method public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T>);
    method public java.lang.Class<? extends junit.framework.TestCase> getEnclosingClass();
    method public java.lang.String getEnclosingClassname();
    method public java.lang.String getName();
  }

  public class TestSuiteBuilder {
    ctor public TestSuiteBuilder(java.lang.Class);
    ctor public TestSuiteBuilder(java.lang.String, java.lang.ClassLoader);
    method public android.test.suitebuilder.TestSuiteBuilder addRequirements(java.util.List<com.android.internal.util.Predicate<android.test.suitebuilder.TestMethod>>);
    method public final android.test.suitebuilder.TestSuiteBuilder addRequirements(com.android.internal.util.Predicate<android.test.suitebuilder.TestMethod>...);
    method public final junit.framework.TestSuite build();
    method public android.test.suitebuilder.TestSuiteBuilder excludePackages(java.lang.String...);
    method protected java.lang.String getSuiteName();
    method public final android.test.suitebuilder.TestSuiteBuilder includeAllPackagesUnderHere();
    method public android.test.suitebuilder.TestSuiteBuilder includePackages(java.lang.String...);
    method public android.test.suitebuilder.TestSuiteBuilder named(java.lang.String);
  }

  public static class TestSuiteBuilder.FailedToCreateTests extends junit.framework.TestCase {
    ctor public TestSuiteBuilder.FailedToCreateTests(java.lang.Exception);
    method public void testSuiteConstructionFailed();
  }

}

package android.test.suitebuilder.annotation {

  public abstract deprecated class LargeTest implements java.lang.annotation.Annotation {
  }

  public abstract deprecated class MediumTest implements java.lang.annotation.Annotation {
  }

  public abstract deprecated class SmallTest implements java.lang.annotation.Annotation {
  }

  public abstract deprecated class Smoke implements java.lang.annotation.Annotation {
  }

  public abstract deprecated class Suppress implements java.lang.annotation.Annotation {
  }

}

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 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 isRtlContext();
    method public java.lang.String unicodeWrap(java.lang.String, android.text.TextDirectionHeuristic, boolean);
    method public java.lang.String unicodeWrap(java.lang.String, android.text.TextDirectionHeuristic);
    method public java.lang.String unicodeWrap(java.lang.String, boolean);
    method public java.lang.String unicodeWrap(java.lang.String);
  }

  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 DynamicLayout(java.lang.CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, boolean);
    ctor public DynamicLayout(java.lang.CharSequence, java.lang.CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, boolean);
    ctor public 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 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();
    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 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
  }

  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 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 extends android.text.SpannableStringInternal 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);
  }

   abstract class SpannableStringInternal {
    method public final char charAt(int);
    method public final void getChars(int, int, char[], int);
    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 final int length();
    method public int nextSpanTransition(int, int, java.lang.Class);
    method public final java.lang.String toString();
  }

  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 extends android.text.SpannableStringInternal 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 StaticLayout(java.lang.CharSequence, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, boolean);
    ctor public StaticLayout(java.lang.CharSequence, int, int, android.text.TextPaint, int, android.text.Layout.Alignment, float, float, boolean);
    ctor public 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 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);
  }

  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 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 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 DateKeyListener();
    method protected char[] getAcceptedChars();
    method public int getInputType();
    method public static android.text.method.DateKeyListener getInstance();
    field public static final char[] CHARACTERS;
  }

  public class DateTimeKeyListener extends android.text.method.NumberKeyListener {
    ctor public DateTimeKeyListener();
    method protected char[] getAcceptedChars();
    method public int getInputType();
    method public static android.text.method.DateTimeKeyListener getInstance();
    field public static final char[] CHARACTERS;
  }

  public class DialerKeyListener extends android.text.method.NumberKeyListener {
    ctor public DialerKeyListener();
    method protected char[] getAcceptedChars();
    method public int getInputType();
    method public static android.text.method.DialerKeyListener getInstance();
    field public static final char[] CHARACTERS;
  }

  public class DigitsKeyListener extends android.text.method.NumberKeyListener {
    ctor public DigitsKeyListener();
    ctor public DigitsKeyListener(boolean, boolean);
    method protected char[] getAcceptedChars();
    method public int getInputType();
    method public static android.text.method.DigitsKeyListener getInstance();
    method public static android.text.method.DigitsKeyListener getInstance(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 TimeKeyListener();
    method protected char[] getAcceptedChars();
    method public int getInputType();
    method public static android.text.method.TimeKeyListener getInstance();
    field public static final char[] CHARACTERS;
  }

  public class Touch {
    method public static int getInitialScrollX(android.widget.TextView, android.text.Spannable);
    method public static int getInitialScrollY(android.widget.TextView, android.text.Spannable);
    method public static boolean onTouchEvent(android.widget.TextView, android.text.Spannable, android.view.MotionEvent);
    method public static void scrollTo(android.widget.TextView, android.text.Layout, int, int);
  }

  public 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(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);
    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 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(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 getLeadingMargin(boolean);
    method public int getSpanTypeId();
    method public void writeToParcel(android.os.Parcel, int);
  }

  public class RasterizerSpan extends android.text.style.CharacterStyle implements android.text.style.UpdateAppearance {
    ctor public RasterizerSpan(android.graphics.Rasterizer);
    method public android.graphics.Rasterizer getRasterizer();
    method public void updateDrawState(android.text.TextPaint);
  }

  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.os.Parcel);
    method public int describeContents();
    method public java.lang.String getFamily();
    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 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 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 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 addTransition(android.transition.Transition);
    method public void captureEndValues(android.transition.TransitionValues);
    method public void captureStartValues(android.transition.TransitionValues);
    method public int getOrdering();
    method public android.transition.Transition getTransitionAt(int);
    method public int getTransitionCount();
    method public android.transition.TransitionSet removeTransition(android.transition.Transition);
    method public android.transition.TransitionSet setOrdering(int);
    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 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);
  }

  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_560 = 560; // 0x230
    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 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 class MutableBoolean {
    ctor public MutableBoolean(boolean);
    field public boolean value;
  }

  public final class MutableByte {
    ctor public MutableByte(byte);
    field public byte value;
  }

  public final class MutableChar {
    ctor public MutableChar(char);
    field public char value;
  }

  public final class MutableDouble {
    ctor public MutableDouble(double);
    field public double value;
  }

  public final class MutableFloat {
    ctor public MutableFloat(float);
    field public float value;
  }

  public final class MutableInt {
    ctor public MutableInt(int);
    field public int value;
  }

  public final class MutableLong {
    ctor public MutableLong(long);
    field public long value;
  }

  public final 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 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 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 isValid();
    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_UNKNOWN = 0; // 0x0
  }

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

  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_TAP = 3; // 0x3
    field public static final int LONG_PRESS = 0; // 0x0
    field public static final int VIRTUAL_KEY = 1; // 0x1
  }

  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 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_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_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_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 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
  }

  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 abstract char getAlphabeticShortcut();
    method public abstract int getGroupId();
    method public abstract android.graphics.drawable.Drawable getIcon();
    method public abstract android.content.Intent getIntent();
    method public abstract int getItemId();
    method public abstract android.view.ContextMenu.ContextMenuInfo getMenuInfo();
    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 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 abstract android.view.MenuItem setCheckable(boolean);
    method public abstract android.view.MenuItem setChecked(boolean);
    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 abstract android.view.MenuItem setIntent(android.content.Intent);
    method public abstract android.view.MenuItem setNumericShortcut(char);
    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 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 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 final void addBatch(long, float, float, float, float, int);
    method public final 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 final int findPointerIndex(int);
    method public final int getAction();
    method public final int getActionButton();
    method public final int getActionIndex();
    method public final int getActionMasked();
    method public final float getAxisValue(int);
    method public final float getAxisValue(int, int);
    method public final int getButtonState();
    method public final int getDeviceId();
    method public final long getDownTime();
    method public final int getEdgeFlags();
    method public final long getEventTime();
    method public final int getFlags();
    method public final float getHistoricalAxisValue(int, int);
    method public final float getHistoricalAxisValue(int, int, int);
    method public final long getHistoricalEventTime(int);
    method public final float getHistoricalOrientation(int);
    method public final float getHistoricalOrientation(int, int);
    method public final void getHistoricalPointerCoords(int, int, android.view.MotionEvent.PointerCoords);
    method public final float getHistoricalPressure(int);
    method public final float getHistoricalPressure(int, int);
    method public final float getHistoricalSize(int);
    method public final float getHistoricalSize(int, int);
    method public final float getHistoricalToolMajor(int);
    method public final float getHistoricalToolMajor(int, int);
    method public final float getHistoricalToolMinor(int);
    method public final float getHistoricalToolMinor(int, int);
    method public final float getHistoricalTouchMajor(int);
    method public final float getHistoricalTouchMajor(int, int);
    method public final float getHistoricalTouchMinor(int);
    method public final float getHistoricalTouchMinor(int, int);
    method public final float getHistoricalX(int);
    method public final float getHistoricalX(int, int);
    method public final float getHistoricalY(int);
    method public final float getHistoricalY(int, int);
    method public final int getHistorySize();
    method public final int getMetaState();
    method public final float getOrientation();
    method public final float getOrientation(int);
    method public final void getPointerCoords(int, android.view.MotionEvent.PointerCoords);
    method public final int getPointerCount();
    method public final int getPointerId(int);
    method public final void getPointerProperties(int, android.view.MotionEvent.PointerProperties);
    method public final float getPressure();
    method public final float getPressure(int);
    method public final float getRawX();
    method public final float getRawY();
    method public final float getSize();
    method public final float getSize(int);
    method public final int getSource();
    method public final float getToolMajor();
    method public final float getToolMajor(int);
    method public final float getToolMinor();
    method public final float getToolMinor(int);
    method public final int getToolType(int);
    method public final float getTouchMajor();
    method public final float getTouchMajor(int);
    method public final float getTouchMinor();
    method public final float getTouchMinor(int);
    method public final float getX();
    method public final float getX(int);
    method public final float getXPrecision();
    method public final float getY();
    method public final float getY(int);
    method public final float getYPrecision();
    method public final 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 final void offsetLocation(float, float);
    method public final void recycle();
    method public final void setAction(int);
    method public final void setEdgeFlags(int);
    method public final void setLocation(float, float);
    method public final void setSource(int);
    method public final 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_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.Surface, 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 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);
  }

  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 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 addFocusables(java.util.ArrayList<android.view.View>, int);
    method public void addFocusables(java.util.ArrayList<android.view.View>, int, int);
    method public void addOnAttachStateChangeListener(android.view.View.OnAttachStateChangeListener);
    method public void addOnLayoutChangeListener(android.view.View.OnLayoutChangeListener);
    method public void addTouchables(java.util.ArrayList<android.view.View>);
    method public android.view.ViewPropertyAnimator animate();
    method public void announceForAccessibility(java.lang.CharSequence);
    method protected boolean awakenScrollBars();
    method protected boolean awakenScrollBars(int);
    method protected boolean awakenScrollBars(int, boolean);
    method public void bringToFront();
    method public void buildDrawingCache();
    method public void buildDrawingCache(boolean);
    method public void buildLayer();
    method public boolean callOnClick();
    method public boolean canResolveLayoutDirection();
    method public boolean canResolveTextAlignment();
    method public boolean canResolveTextDirection();
    method public boolean canScrollHorizontally(int);
    method public boolean canScrollVertically(int);
    method public final void cancelDragAndDrop();
    method public void cancelLongPress();
    method public final void cancelPendingInputEvents();
    method public boolean checkInputConnectionProxy(android.view.View);
    method public void clearAnimation();
    method public void clearFocus();
    method public static int combineMeasuredStates(int, int);
    method protected int computeHorizontalScrollExtent();
    method protected int computeHorizontalScrollOffset();
    method protected int computeHorizontalScrollRange();
    method public void computeScroll();
    method public android.view.WindowInsets computeSystemWindowInsets(android.view.WindowInsets, android.graphics.Rect);
    method protected int computeVerticalScrollExtent();
    method protected int computeVerticalScrollOffset();
    method protected int computeVerticalScrollRange();
    method public android.view.accessibility.AccessibilityNodeInfo createAccessibilityNodeInfo();
    method public void createContextMenu(android.view.ContextMenu);
    method public void destroyDrawingCache();
    method public android.view.WindowInsets dispatchApplyWindowInsets(android.view.WindowInsets);
    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 boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    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 android.view.View findViewById(int);
    method public final android.view.View 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 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 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 static int getDefaultSize(int, int);
    method public android.view.Display getDisplay();
    method public final int[] getDrawableState();
    method public android.graphics.Bitmap getDrawingCache();
    method public android.graphics.Bitmap getDrawingCache(boolean);
    method public int getDrawingCacheBackgroundColor();
    method public 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 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 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 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 android.view.ViewOutlineProvider getOutlineProvider();
    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 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 hasFocus();
    method public boolean hasFocusable();
    method public boolean hasNestedScrollingParent();
    method public boolean hasOnClickListeners();
    method public boolean hasOverlappingRendering();
    method public boolean hasTransientState();
    method public boolean hasWindowFocus();
    method public static android.view.View inflate(android.content.Context, int, android.view.ViewGroup);
    method public void invalidate(android.graphics.Rect);
    method public 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 isActivated();
    method public boolean isAttachedToWindow();
    method public boolean isClickable();
    method public boolean isContextClickable();
    method public boolean isDirty();
    method public 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 boolean isHapticFeedbackEnabled();
    method public boolean isHardwareAccelerated();
    method public boolean isHorizontalFadingEdgeEnabled();
    method public boolean isHorizontalScrollBarEnabled();
    method public boolean isHovered();
    method public boolean isImportantForAccessibility();
    method public boolean isInEditMode();
    method public boolean isInLayout();
    method public boolean isInTouchMode();
    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 isPressed();
    method public boolean isSaveEnabled();
    method public boolean isSaveFromParentEnabled();
    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 void jumpDrawablesToCurrentState();
    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 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 onPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    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 boolean removeCallbacks(java.lang.Runnable);
    method public void removeOnAttachStateChangeListener(android.view.View.OnAttachStateChangeListener);
    method public void removeOnLayoutChangeListener(android.view.View.OnLayoutChangeListener);
    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 boolean requestRectangleOnScreen(android.graphics.Rect);
    method public boolean requestRectangleOnScreen(android.graphics.Rect, boolean);
    method public final void requestUnbufferedDispatch(android.view.MotionEvent);
    method public static int resolveSize(int, int);
    method public static int resolveSizeAndState(int, int, int);
    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 setAccessibilityLiveRegion(int);
    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 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 setDrawingCacheBackgroundColor(int);
    method public void setDrawingCacheEnabled(boolean);
    method public void setDrawingCacheQuality(int);
    method public void setDuplicateParentStateEnabled(boolean);
    method public void setElevation(float);
    method public void setEnabled(boolean);
    method public void setFadingEdgeLength(int);
    method public void setFilterTouchesWhenObscured(boolean);
    method public void setFitsSystemWindows(boolean);
    method public void setFocusable(boolean);
    method public void setFocusableInTouchMode(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 setKeepScreenOn(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 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 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 setOutlineProvider(android.view.ViewOutlineProvider);
    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 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 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 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 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 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 int DRAWING_CACHE_QUALITY_AUTO = 0; // 0x0
    field public static final int DRAWING_CACHE_QUALITY_HIGH = 1048576; // 0x100000
    field public static final int DRAWING_CACHE_QUALITY_LOW = 524288; // 0x80000
    field protected static final int[] EMPTY_STATE_SET;
    field protected static final int[] ENABLED_FOCUSED_SELECTED_STATE_SET;
    field protected static final int[] ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] ENABLED_FOCUSED_STATE_SET;
    field protected static final int[] ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] ENABLED_SELECTED_STATE_SET;
    field protected static final int[] ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET;
    field protected static final int[] ENABLED_STATE_SET;
    field protected static final int[] ENABLED_WINDOW_FOCUSED_STATE_SET;
    field public static final int FIND_VIEWS_WITH_CONTENT_DESCRIPTION = 2; // 0x2
    field public static final int FIND_VIEWS_WITH_TEXT = 1; // 0x1
    field public static final int FOCUSABLES_ALL = 0; // 0x0
    field public static final int FOCUSABLES_TOUCH_MODE = 1; // 0x1
    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 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 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_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 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.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 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 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 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();
  }

  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 int getPersistentDrawingCache();
    method public boolean getTouchscreenBlocksFocus();
    method public int indexOfChild(android.view.View);
    method public final void invalidateChild(android.view.View, android.graphics.Rect);
    method public 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 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 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 int PERSISTENT_ALL_CACHES = 3; // 0x3
    field public static final int PERSISTENT_ANIMATION_CACHE = 1; // 0x1
    field public static final int PERSISTENT_NO_CACHE = 0; // 0x0
    field public static final int PERSISTENT_SCROLLING_CACHE = 2; // 0x2
  }

  public static class ViewGroup.LayoutParams {
    ctor public ViewGroup.LayoutParams(android.content.Context, android.util.AttributeSet);
    ctor public ViewGroup.LayoutParams(int, int);
    ctor public ViewGroup.LayoutParams(android.view.ViewGroup.LayoutParams);
    method public void resolveLayoutDirection(int);
    method protected void setBaseAttributes(android.content.res.TypedArray, int, int);
    field 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 void invalidateChild(android.view.View, android.graphics.Rect);
    method public abstract 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 void notifySubtreeAccessibilityStateChanged(android.view.View, android.view.View, int);
    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 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 void setAccessibilityFocused(boolean);
    method public abstract void setActivated(boolean);
    method public abstract void setAlpha(float);
    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 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 setId(int, java.lang.String, java.lang.String, java.lang.String);
    method public abstract void setLongClickable(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 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);
  }

  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 final void dispatchOnDraw();
    method public final void dispatchOnGlobalLayout();
    method public final 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 android.view.View 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 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 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 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 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 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 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 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 consumeStableInsets();
    method public android.view.WindowInsets consumeSystemWindowInsets();
    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 final java.lang.CharSequence getTitle();
    method public static boolean mayUseInputMethod(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 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 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 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 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 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_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 int TYPE_PHONE = 2002; // 0x7d2
    field public static final int TYPE_PRIORITY_PHONE = 2007; // 0x7d7
    field public static final int TYPE_PRIVATE_PRESENTATION = 2030; // 0x7ee
    field public static final int TYPE_SEARCH_BAR = 2001; // 0x7d1
    field public static final int TYPE_STATUS_BAR = 2000; // 0x7d0
    field public static final int TYPE_STATUS_BAR_PANEL = 2014; // 0x7de
    field public static final int TYPE_SYSTEM_ALERT = 2003; // 0x7d3
    field public static final int TYPE_SYSTEM_DIALOG = 2008; // 0x7d8
    field public static final int TYPE_SYSTEM_ERROR = 2010; // 0x7da
    field public static final int TYPE_SYSTEM_OVERLAY = 2006; // 0x7d6
    field public static final int TYPE_TOAST = 2005; // 0x7d5
    field public static final int TYPE_WALLPAPER = 2013; // 0x7dd
    field public float alpha;
    field public float buttonBrightness;
    field public float dimAmount;
    field public int flags;
    field public int format;
    field public int gravity;
    field public float horizontalMargin;
    field public float horizontalWeight;
    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 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_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
  }

  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 boolean addAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener);
    method public boolean addTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener);
    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 boolean isEnabled();
    method public boolean isTouchExplorationEnabled();
    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 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 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 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 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 isImportantForAccessibility();
    method public boolean isLongClickable();
    method public boolean isMultiLine();
    method public boolean isPassword();
    method public boolean isScrollable();
    method public boolean isSelected();
    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 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 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 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 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 setScrollable(boolean);
    method public void setSelected(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 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_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 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_LONG_CLICK;
    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;
  }

  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 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 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 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 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 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 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 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 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.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_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 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 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 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 void setInputMethod(android.os.IBinder, java.lang.String);
    method public void setInputMethodAndSubtype(android.os.IBinder, java.lang.String, android.view.inputmethod.InputMethodSubtype);
    method public 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 void showSoftInputFromInputMethod(android.os.IBinder, int);
    method public void showStatusIcon(android.os.IBinder, java.lang.String, int);
    method public boolean switchToLastInputMethod(android.os.IBinder);
    method public 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.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 synchronized 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 extends android.webkit.WebSyncManager {
    method public static synchronized android.webkit.CookieSyncManager createInstance(android.content.Context);
    method public static synchronized android.webkit.CookieSyncManager getInstance();
    method protected deprecated void syncFromRamToFlash();
    field protected static final java.lang.String LOGTAG = "websync";
    field protected android.webkit.WebViewDatabase mDataBase;
    field protected android.os.Handler mHandler;
  }

  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 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 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 final 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 java.lang.String getSansSerifFontFamily();
    method public abstract 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 setSansSerifFontFamily(java.lang.String);
    method public abstract 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);
  }

   abstract deprecated class WebSyncManager implements java.lang.Runnable {
    ctor protected WebSyncManager(android.content.Context, java.lang.String);
    method protected void onSyncInit();
    method public void resetSync();
    method public void run();
    method public void startSync();
    method public void stopSync();
    method public void sync();
    field protected static final java.lang.String LOGTAG = "websync";
    field protected android.webkit.WebViewDatabase mDataBase;
    field protected android.os.Handler mHandler;
  }

  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 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 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 android.graphics.Bitmap getFavicon();
    method public android.webkit.WebView.HitTestResult getHitTestResult();
    method public java.lang.String[] getHttpAuthUsernamePassword(java.lang.String, java.lang.String);
    method public java.lang.String getOriginalUrl();
    method public int getProgress();
    method public deprecated float getScale();
    method public android.webkit.WebSettings getSettings();
    method public java.lang.String getTitle();
    method public java.lang.String getUrl();
    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 void setDownloadListener(android.webkit.DownloadListener);
    method public void setFindListener(android.webkit.WebView.FindListener);
    method public deprecated void setHorizontalScrollbarOverlay(boolean);
    method public 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 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 showFindDialog(java.lang.String, boolean);
    method public void stopLoading();
    method public void zoomBy(float);
    method public boolean zoomIn();
    method public boolean zoomOut();
    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 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_UNSUPPORTED_AUTH_SCHEME = -3; // 0xfffffffd
    field public static final int ERROR_UNSUPPORTED_SCHEME = -10; // 0xfffffff6
  }

  public abstract class WebViewDatabase {
    ctor public WebViewDatabase();
    method public abstract void clearFormData();
    method public abstract void clearHttpAuthUsernamePassword();
    method public abstract deprecated void clearUsernamePassword();
    method public static android.webkit.WebViewDatabase getInstance(android.content.Context);
    method public abstract boolean hasFormData();
    method public abstract boolean hasHttpAuthUsernamePassword();
    method public abstract deprecated boolean hasUsernamePassword();
  }

  public 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 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);
    method protected void onLayout(boolean, int, int, 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 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 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 protected void onLayout(boolean, int, int, int, int);
    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 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 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 getMode();
    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 deprecated void setSpinnersShown(boolean);
    method public void updateDate(int, int, int);
    field public static final int MODE_CALENDAR = 2; // 0x2
    field public static final int MODE_SPINNER = 1; // 0x1
  }

  public static abstract interface DatePicker.OnDateChangedListener {
    method public abstract void onDateChanged(android.widget.DatePicker, int, int, int);
  }

  public 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 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 public deprecated boolean getConsiderGoneChildrenWhenMeasuring();
    method public boolean getMeasureAllChildren();
    method protected void onLayout(boolean, int, int, int, int);
    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 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 protected void onLayout(boolean, int, int, int, int);
    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 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 protected void onLayout(boolean, int, int, int, int);
    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 protected android.view.View findViewTraversal(int);
    method protected android.view.View findViewWithTagTraversal(java.lang.Object);
    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 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 OverScroller(android.content.Context, android.view.animation.Interpolator, float, float);
    ctor public OverScroller(android.content.Context, android.view.animation.Interpolator, float, float, boolean);
    method public void abortAnimation();
    method public boolean computeScrollOffset();
    method public void fling(int, int, int, int, int, int, int, int);
    method public void fling(int, int, int, int, int, int, int, int, int, int);
    method public final void forceFinished(boolean);
    method public float getCurrVelocity();
    method public final int getCurrX();
    method public final int getCurrY();
    method public final int getFinalX();
    method public final int getFinalY();
    method public final int getStartX();
    method public final int getStartY();
    method public final boolean isFinished();
    method public boolean isOverScrolled();
    method public void notifyHorizontalEdgeReached(int, int, int);
    method public void notifyVerticalEdgeReached(int, int, int);
    method public final void setFriction(float);
    method public boolean springBack(int, int, int, int, int, int);
    method public void startScroll(int, int, int, int);
    method public void startScroll(int, int, int, int, int);
  }

  public class PopupMenu {
    ctor public PopupMenu(android.content.Context, android.view.View);
    ctor public PopupMenu(android.content.Context, android.view.View, int);
    ctor public PopupMenu(android.content.Context, android.view.View, int, int, int);
    method public void dismiss();
    method public android.view.View.OnTouchListener getDragToOpenListener();
    method public int getGravity();
    method public android.view.Menu getMenu();
    method public android.view.MenuInflater getMenuInflater();
    method public void inflate(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 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 synchronized boolean isIndeterminate();
    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 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 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 int getGravity();
    method protected void onLayout(boolean, int, int, int, int);
    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.os.Parcel);
    method public void addView(int, android.widget.RemoteViews);
    method public android.view.View apply(android.content.Context, android.view.ViewGroup);
    method public 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 protected void onLayout(boolean, int, int, int, int);
    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 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.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 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 java.lang.String getFontFeatureSettings();
    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 final android.text.method.KeyListener getKeyListener();
    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 final android.content.res.ColorStateList getTextColors();
    method public java.util.Locale getTextLocale();
    method public android.os.LocaleList getTextLocales();
    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 isCursorVisible();
    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 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 setFilters(android.text.InputFilter[]);
    method public void setFontFeatureSettings(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 setKeyListener(android.text.method.KeyListener);
    method public void setLetterSpacing(float);
    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 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 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);
  }

  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 int getMode();
    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);
    field public static final int MODE_CLOCK = 2; // 0x2
    field public static final int MODE_SPINNER = 1; // 0x1
  }

  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 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 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.view.View getNavigationView();
    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 protected void onLayout(boolean, int, int, int, int);
    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 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 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 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 com.android.internal.util {

  public abstract interface Predicate<T> {
    method public abstract boolean apply(T);
  }

}

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

  public class DexClassLoader extends dalvik.system.BaseDexClassLoader {
    ctor public DexClassLoader(java.lang.String, java.lang.String, java.lang.String, java.lang.ClassLoader);
  }

  public final class DexFile {
    ctor public DexFile(java.io.File) throws java.io.IOException;
    ctor public 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 dalvik.system.DexFile loadDex(java.lang.String, java.lang.String, int) throws java.io.IOException;
  }

  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);
    field protected volatile byte[] buf;
    field protected int count;
    field protected int marklimit;
    field protected int markpos;
    field protected int pos;
  }

  public class BufferedOutputStream extends java.io.FilterOutputStream {
    ctor public BufferedOutputStream(java.io.OutputStream);
    ctor public BufferedOutputStream(java.io.OutputStream, int);
    field protected byte[] buf;
    field protected int count;
  }

  public class BufferedReader extends java.io.Reader {
    ctor public BufferedReader(java.io.Reader, int);
    ctor public BufferedReader(java.io.Reader);
    method public void close() throws java.io.IOException;
    method public java.util.stream.Stream<java.lang.String> lines();
    method public int read(char[], int, int) throws java.io.IOException;
    method public 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 read();
    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(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 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 void close();
    method public void flush();
    method public void reset();
    method public int size();
    method public char[] toCharArray();
    method public void write(char[], 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 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 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 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 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 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 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 void connect(java.io.PipedOutputStream) throws java.io.IOException;
    method public synchronized int read() 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 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(char[], int, int) throws java.io.IOException;
  }

  public class PipedWriter extends java.io.Writer {
    ctor public PipedWriter(java.io.PipedReader) throws java.io.IOException;
    ctor public PipedWriter();
    method public void close() throws java.io.IOException;
    method public 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 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();
  }

  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 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(char[], int, int);
    field protected java.io.Writer out;
  }

  public class PushbackInputStream extends java.io.FilterInputStream {
    ctor public PushbackInputStream(java.io.InputStream, int);
    ctor public PushbackInputStream(java.io.InputStream);
    method public void unread(int) throws java.io.IOException;
    method public void unread(byte[], int, int) throws java.io.IOException;
    method public void unread(byte[]) throws java.io.IOException;
    field protected byte[] buf;
    field protected int pos;
  }

  public class PushbackReader extends java.io.FilterReader {
    ctor public PushbackReader(java.io.Reader, int);
    ctor public PushbackReader(java.io.Reader);
    method public void unread(int) throws java.io.IOException;
    method public void unread(char[], int, int) throws java.io.IOException;
    method public void unread(char[]) throws java.io.IOException;
  }

  public class RandomAccessFile implements java.io.Closeable java.io.DataInput java.io.DataOutput {
    ctor public RandomAccessFile(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 abstract void close() throws java.io.IOException;
    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 read();
    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 void close() throws java.io.IOException;
    method public void flush();
    method public java.lang.StringBuffer getBuffer();
    method public void write(char[], 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);
  }

  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);
    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 abstract void close() throws java.io.IOException;
    method public abstract void flush() 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);
  }

   abstract class AbstractStringBuilder implements java.lang.Appendable java.lang.CharSequence {
    method public java.lang.AbstractStringBuilder append(java.lang.CharSequence);
    method public java.lang.AbstractStringBuilder append(java.lang.CharSequence, int, int);
    method public java.lang.AbstractStringBuilder append(char);
    method public int capacity();
    method public char charAt(int);
    method public int codePointAt(int);
    method public int codePointBefore(int);
    method public int codePointCount(int, int);
    method public void ensureCapacity(int);
    method public void getChars(int, int, char[], int);
    method public int indexOf(java.lang.String);
    method public int indexOf(java.lang.String, int);
    method public int lastIndexOf(java.lang.String);
    method public int lastIndexOf(java.lang.String, int);
    method public int length();
    method public int offsetByCodePoints(int, int);
    method public void setCharAt(int, char);
    method public void setLength(int);
    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 abstract java.lang.String toString();
    method public void trimToSize();
  }

  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 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 final 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 final 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 java.lang.String getTypeName();
    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 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 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 extends java.lang.AbstractStringBuilder implements 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 java.lang.StringBuffer delete(int, int);
    method public synchronized java.lang.StringBuffer deleteCharAt(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 synchronized java.lang.StringBuffer replace(int, int, java.lang.String);
    method public synchronized java.lang.StringBuffer reverse();
    method public synchronized java.lang.String toString();
  }

  public final class StringBuilder extends java.lang.AbstractStringBuilder implements 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 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 java.lang.StringBuilder replace(int, int, java.lang.String);
    method public java.lang.StringBuilder reverse();
    method public java.lang.String toString();
  }

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

  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<?> getDeclaringClass();
    method public abstract java.lang.Class<?>[] getExceptionTypes();
    method public java.lang.reflect.Type[] getGenericExceptionTypes();
    method public java.lang.reflect.Type[] getGenericParameterTypes();
    method public abstract int getModifiers();
    method public abstract java.lang.String getName();
    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 abstract java.lang.reflect.TypeVariable<?>[] getTypeParameters();
    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();
  }

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

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

  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 {
  }

  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 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 final java.lang.Object getContent() throws java.io.IOException;
    method public final 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 java.net.URLConnection openConnection() throws java.io.IOException;
    method public java.net.URLConnection openConnection(java.net.Proxy) throws java.io.IOException;
    method public final java.io.InputStream openStream() throws java.io.IOException;
    method public boolean sameFile(java.net.URL);
    method protected void set(java.lang.String, java.lang.String, int, java.lang.String, java.lang.String);
    method protected void set(java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    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 abstract boolean isDirect();
    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 java.util.stream.IntStream chars();
    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 abstract boolean isDirect();
    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 boolean isDirect();
    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 boolean isDirect();
    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 boolean isDirect();
    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 boolean isDirect();
    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 boolean isDirect();
    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 {
    method public abstract void close() throws java.io.IOException;
  }

  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 abstract java.net.SocketAddress getLocalAddress() 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 getLocalAddress() throws java.io.IOException;
    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 java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer);
    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 java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer);
    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 void close() throws java.io.IOException;
    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 getLocalAddress() 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 abstract int read(java.nio.ByteBuffer) throws java.io.IOException;
    method public abstract long read(java.nio.ByteBuffer[], int, int) 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 abstract int write(java.nio.ByteBuffer) throws java.io.IOException;
    method public abstract long write(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
    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 long position() throws java.io.IOException;
    method public abstract java.nio.channels.FileChannel position(long) throws java.io.IOException;
    method public abstract int read(java.nio.ByteBuffer) throws java.io.IOException;
    method public abstract long read(java.nio.ByteBuffer[], int, int) 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 size() 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 abstract int write(java.nio.ByteBuffer) throws java.io.IOException;
    method public abstract long write(java.nio.ByteBuffer[], int, int) 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 {
    method public abstract void close() throws java.io.IOException;
  }

  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 void close() throws java.io.IOException;
    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 int read(java.nio.ByteBuffer) 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;
    method public abstract int write(java.nio.ByteBuffer) 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 void close() throws java.io.IOException;
    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 abstract java.net.SocketAddress getLocalAddress() 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 getLocalAddress() 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 abstract int read(java.nio.ByteBuffer) throws java.io.IOException;
    method public abstract long read(java.nio.ByteBuffer[], int, int) 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 abstract int write(java.nio.ByteBuffer) throws java.io.IOException;
    method public abstract long write(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
    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);
  }

  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 {
    method public abstract java.util.Iterator<T> iterator();
  }

  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 void close() throws java.io.IOException;
    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.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;
    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 void close() throws java.io.IOException;
    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 java.lang.String name();
    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.lang.String name();
    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.lang.String name();
    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 java.lang.String name();
    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 fromMillis(long);
    method public long to(java.util.concurrent.TimeUnit);
    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.lang.String name();
    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 java.lang.String name();
    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 char[] getPassword();
    method public java.lang.String getProtectionAlgorithm();
    method public java.security.spec.AlgorithmParameterSpec getProtectionParameters();
  }

  public static final class KeyStore.PrivateKeyEntry implements java.security.KeyStore.Entry {
    ctor public KeyStore.PrivateKeyEntry(java.security.PrivateKey, java.security.cert.Certificate[]);
    ctor public KeyStore.PrivateKeyEntry(java.security.PrivateKey, java.security.cert.Certificate[], java.util.Set<java.security.KeyStore.Entry.Attribute>);
    method public java.security.cert.Certificate getCertificate();
    method public java.security.cert.Certificate[] getCertificateChain();
    method public java.security.PrivateKey getPrivateKey();
  }

  public static 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.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 synchronized void forEach(java.util.function.BiConsumer<? super java.lang.Object, ? super 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 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 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>);
  }

  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 setSeed(byte[]);
  }

  public abstract class SecureRandomSpi implements java.io.Serializable {
    ctor public SecureRandomSpi();
    method protected abstract byte[] engineGenerateSeed(int);
    method protected abstract void engineNextBytes(byte[]);
    method protected abstract void engineSetSeed(byte[]);
  }

  public final class Security {
    method public static int addProvider(java.security.Provider);
    method 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();
    method public abstract void init(boolean) throws java.security.cert.CertPathValidatorException;
    method public abstract boolean isForwardCheckingSupported();
  }

  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.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 final int primaryOrder(int);
    method public void reset();
    method public static final 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 final 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();
    method public int hashCode();
  }

  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.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 abstract java.util.Iterator<E> iterator();
    method public boolean remove(java.lang.Object);
    method public boolean removeAll(java.util.Collection<?>);
    method public boolean retainAll(java.util.Collection<?>);
    method public abstract int size();
    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 abstract E get(int);
    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 abstract java.util.Set<java.util.Map.Entry<K, V>> entrySet();
    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);
    method public abstract java.util.ListIterator<E> listIterator(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();
    method public java.util.Spliterator<E> spliterator();
  }

  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 boolean removeIf(java.util.function.Predicate<? super E>);
    method public void replaceAll(java.util.function.UnaryOperator<E>);
    method public int size();
    method public void sort(java.util.Comparator<? super E>);
    method public java.util.Spliterator<E> spliterator();
    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 synchronized java.util.Locale[] getAvailableLocales();
    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);
    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 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 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 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 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.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 <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 <T> java.util.Set<T> emptySet();
    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 <E> java.util.Set<E> singleton(E);
    method public static <E> java.util.List<E> singletonList(E);
    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 <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 <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 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 deprecated java.lang.String toLocaleString();
  }

  public abstract interface Deque<E> implements java.util.Queue {
    method public abstract boolean add(E);
    method public abstract void addFirst(E);
    method public abstract void addLast(E);
    method public abstract boolean contains(java.lang.Object);
    method public abstract java.util.Iterator<E> descendingIterator();
    method public abstract E element();
    method public abstract E getFirst();
    method public abstract E getLast();
    method public abstract java.util.Iterator<E> iterator();
    method public abstract boolean offer(E);
    method public abstract boolean offerFirst(E);
    method public abstract boolean offerLast(E);
    method public abstract E peek();
    method public abstract E peekFirst();
    method public abstract E peekLast();
    method public abstract E poll();
    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 remove();
    method public abstract boolean remove(java.lang.Object);
    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);
    method public abstract int size();
  }

  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 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);
    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 V compute(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    method public V computeIfAbsent(K, java.util.function.Function<? super K, ? extends V>);
    method public V computeIfPresent(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    method public java.util.Set<java.util.Map.Entry<K, V>> entrySet();
    method public void forEach(java.util.function.BiConsumer<? super K, ? super V>);
    method public V getOrDefault(java.lang.Object, V);
    method public V merge(K, V, java.util.function.BiFunction<? super V, ? super V, ? extends V>);
    method public V putIfAbsent(K, V);
    method public boolean remove(java.lang.Object, java.lang.Object);
    method public boolean replace(K, V, V);
    method public V replace(K, V);
    method public void replaceAll(java.util.function.BiFunction<? super K, ? super V, ? extends V>);
  }

  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();
    method public java.util.Spliterator<E> spliterator();
  }

  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 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 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 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();
    method public void forEach(java.util.function.BiConsumer<? super K, ? super V>);
    method public void replaceAll(java.util.function.BiFunction<? super K, ? super V, ? extends V>);
  }

  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 java.util.ListIterator<E> listIterator(int);
    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();
    method public java.util.Spliterator<E> spliterator();
  }

  public abstract interface List<E> implements java.util.Collection {
    method public abstract boolean add(E);
    method public abstract void add(int, E);
    method public abstract boolean addAll(java.util.Collection<? extends E>);
    method public abstract boolean addAll(int, 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 E get(int);
    method public abstract int hashCode();
    method public abstract int indexOf(java.lang.Object);
    method public abstract boolean isEmpty();
    method public abstract java.util.Iterator<E> iterator();
    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 boolean remove(java.lang.Object);
    method public abstract E remove(int);
    method public abstract boolean removeAll(java.util.Collection<?>);
    method public default void replaceAll(java.util.function.UnaryOperator<E>);
    method public abstract boolean retainAll(java.util.Collection<?>);
    method public abstract E set(int, E);
    method public abstract int size();
    method public default void sort(java.util.Comparator<? super E>);
    method public abstract java.util.List<E> subList(int, int);
    method public abstract java.lang.Object[] toArray();
    method public abstract <T> T[] toArray(T[]);
  }

  public abstract interface ListIterator<E> implements java.util.Iterator {
    method public abstract void add(E);
    method public abstract boolean hasNext();
    method public abstract boolean hasPrevious();
    method public abstract E next();
    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.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 final java.lang.String getDisplayCountry();
    method public java.lang.String getDisplayCountry(java.util.Locale);
    method public final java.lang.String getDisplayLanguage();
    method public java.lang.String getDisplayLanguage(java.util.Locale);
    method public final 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 final 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 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();
    method public final java.lang.String toString();
    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 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.SortedMap<K, V> headMap(K);
    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.SortedMap<K, V> subMap(K, K);
    method public abstract java.util.NavigableMap<K, V> tailMap(K, boolean);
    method public abstract java.util.SortedMap<K, V> tailMap(K);
  }

  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 java.util.SortedSet<E> headSet(E);
    method public abstract E higher(E);
    method public abstract java.util.Iterator<E> iterator();
    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.SortedSet<E> subSet(E, E);
    method public abstract java.util.NavigableSet<E> tailSet(E, boolean);
    method public abstract java.util.SortedSet<E> tailSet(E);
  }

  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 boolean add(E);
    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 {
    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 abstract boolean remove(java.lang.Object);
    method public abstract boolean removeAll(java.util.Collection<?>);
    method public abstract boolean retainAll(java.util.Collection<?>);
    method public abstract int size();
    method public abstract java.lang.Object[] toArray();
    method public abstract <T> T[] toArray(T[]);
  }

  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 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 java.util.Set<java.util.Map.Entry<K, V>> entrySet();
    method public abstract K firstKey();
    method public abstract java.util.SortedMap<K, V> headMap(K);
    method public abstract java.util.Set<K> keySet();
    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);
    method public abstract java.util.Collection<V> values();
  }

  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 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 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 abstract void run();
    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 void forEach(java.util.function.BiConsumer<? super K, ? super V>);
    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 boolean replace(K, V, V);
    method public V replace(K, V);
    method public void replaceAll(java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    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.Spliterator<E> spliterator();
    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 void addElement(E);
    method public synchronized int capacity();
    method public synchronized java.lang.Object clone();
    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 E firstElement();
    method public synchronized void forEach(java.util.function.Consumer<? super E>);
    method public synchronized E get(int);
    method public synchronized int indexOf(java.lang.Object, int);
    method public synchronized void insertElementAt(E, int);
    method public synchronized E lastElement();
    method public synchronized int lastIndexOf(java.lang.Object, int);
    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 public synchronized void replaceAll(java.util.function.UnaryOperator<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 java.util.Spliterator<E> spliterator();
    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();
    method public void forEach(java.util.function.BiConsumer<? super K, ? super V>);
    method public void replaceAll(java.util.function.BiFunction<? super K, ? super V, ? extends V>);
  }

}

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 java.util.Spliterator<E> spliterator();
    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 add(E);
    method public abstract void addFirst(E);
    method public abstract void addLast(E);
    method public abstract boolean contains(java.lang.Object);
    method public abstract E element();
    method public abstract java.util.Iterator<E> iterator();
    method public abstract boolean offer(E);
    method public abstract boolean offer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract boolean offerFirst(E);
    method public abstract boolean offerFirst(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract boolean offerLast(E);
    method public abstract boolean offerLast(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
    method public abstract E peek();
    method public abstract E poll();
    method public abstract E poll(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 push(E);
    method public abstract void put(E) 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 remove();
    method public abstract boolean remove(java.lang.Object);
    method public abstract boolean removeFirstOccurrence(java.lang.Object);
    method public abstract boolean removeLastOccurrence(java.lang.Object);
    method public abstract int size();
    method public abstract E take() 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 boolean add(E);
    method public abstract boolean contains(java.lang.Object);
    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);
    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 boolean remove(java.lang.Object);
    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 V compute(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    method public V computeIfAbsent(K, java.util.function.Function<? super K, ? extends V>);
    method public V computeIfPresent(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    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(java.util.function.BiConsumer<? super K, ? super V>);
    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 V getOrDefault(java.lang.Object, V);
    method public java.util.concurrent.ConcurrentHashMap.KeySetView<K, V> keySet(V);
    method public java.util.Enumeration<K> keys();
    method public long mappingCount();
    method public V merge(K, V, java.util.function.BiFunction<? super V, ? super V, ? extends V>);
    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 V putIfAbsent(K, V);
    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 boolean remove(java.lang.Object, java.lang.Object);
    method public boolean replace(K, V, V);
    method public V replace(K, V);
    method public void replaceAll(java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    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>);
  }

   static abstract class ConcurrentHashMap.CollectionView<K, V, E> implements java.util.Collection java.io.Serializable {
    method public final void clear();
    method public abstract boolean contains(java.lang.Object);
    method public final boolean containsAll(java.util.Collection<?>);
    method public java.util.concurrent.ConcurrentHashMap<K, V> getMap();
    method public final boolean isEmpty();
    method public abstract java.util.Iterator<E> iterator();
    method public abstract boolean remove(java.lang.Object);
    method public final boolean removeAll(java.util.Collection<?>);
    method public final boolean retainAll(java.util.Collection<?>);
    method public final int size();
    method public final java.lang.Object[] toArray();
    method public final <T> T[] toArray(T[]);
    method public final java.lang.String toString();
  }

  public static class ConcurrentHashMap.KeySetView<K, V> extends java.util.concurrent.ConcurrentHashMap.CollectionView implements 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();
    method public java.util.Spliterator<E> spliterator();
  }

  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();
    method public java.util.Spliterator<E> spliterator();
  }

  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.NavigableSet<K> descendingKeySet();
    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.NavigableSet<K> navigableKeySet();
    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 V compute(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    method public V computeIfAbsent(K, java.util.function.Function<? super K, ? extends V>);
    method public V computeIfPresent(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    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 void forEach(java.util.function.BiConsumer<? super K, ? super V>);
    method public V getOrDefault(java.lang.Object, V);
    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.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 V merge(K, V, java.util.function.BiFunction<? super V, ? super V, ? extends V>);
    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 V putIfAbsent(K, V);
    method public boolean remove(java.lang.Object, java.lang.Object);
    method public boolean replace(K, V, V);
    method public V replace(K, V);
    method public void replaceAll(java.util.function.BiFunction<? super K, ? super V, ? extends V>);
    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.Spliterator<E> spliterator();
    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 synchronized boolean add(E);
    method public synchronized void add(int, 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 int addAllAbsent(java.util.Collection<? extends E>);
    method public synchronized boolean addIfAbsent(E);
    method public synchronized 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(E, int);
    method public int indexOf(java.lang.Object);
    method public boolean isEmpty();
    method public java.util.Iterator<E> iterator();
    method public int lastIndexOf(E, int);
    method public int lastIndexOf(java.lang.Object);
    method public java.util.ListIterator<E> listIterator(int);
    method public java.util.ListIterator<E> listIterator();
    method public synchronized E remove(int);
    method public synchronized boolean remove(java.lang.Object);
    method public synchronized boolean removeAll(java.util.Collection<?>);
    method public synchronized boolean retainAll(java.util.Collection<?>);
    method public synchronized 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 boolean removeIf(java.util.function.Predicate<? super E>);
    method public int size();
    method public java.util.Spliterator<E> spliterator();
  }

  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 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>);
    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 java.util.Spliterator<E> spliterator();
    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 java.util.Spliterator<E> spliterator();
    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 java.util.Spliterator<E> spliterator();
    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 java.util.Spliterator<E> spliterator();
    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 {
    method public abstract void run();
  }

  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 java.util.Spliterator<E> spliterator();
    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 int nextInt(int, int);
    method public long nextLong(long);
    method public long nextLong(long, long);
  }

  public class ThreadPoolExecutor extends java.util.concurrent.AbstractExecutorService {
    ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>);
    ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.ThreadFactory);
    ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.RejectedExecutionHandler);
    ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler);
    method protected void afterExecute(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 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.util.concurrent.atomic.Striped64 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.util.concurrent.atomic.Striped64 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.util.concurrent.atomic.Striped64 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.util.concurrent.atomic.Striped64 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();
  }

   abstract class Striped64 extends java.lang.Number {
  }

}

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 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 java.util.jar.Attributes.Name IMPLEMENTATION_URL;
    field public static final java.util.jar.Attributes.Name IMPLEMENTATION_VENDOR;
    field public static final java.util.jar.Attributes.Name IMPLEMENTATION_VENDOR_ID;
    field public static final java.util.jar.Attributes.Name IMPLEMENTATION_VERSION;
    field public static final java.util.jar.Attributes.Name MAIN_CLASS;
    field public static final java.util.jar.Attributes.Name MANIFEST_VERSION;
    field public static final java.util.jar.Attributes.Name SEALED;
    field public static final java.util.jar.Attributes.Name SIGNATURE_VERSION;
    field public static final java.util.jar.Attributes.Name SPECIFICATION_TITLE;
    field public static final java.util.jar.Attributes.Name SPECIFICATION_VENDOR;
    field public static final java.util.jar.Attributes.Name SPECIFICATION_VERSION;
  }

  public class JarEntry extends java.util.zip.ZipEntry {
    ctor public JarEntry(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();
  }

  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.jar.JarEntry getJarEntry(java.lang.String);
    method public java.util.jar.Manifest getManifest() throws java.io.IOException;
    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;
  }

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

  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 abstract 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 abstract 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 abstract void addPropertyChangeListener(java.beans.PropertyChangeListener);
    method public abstract java.util.SortedMap<java.lang.String, java.lang.String> properties();
    method public abstract 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();
  }

  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 synchronized 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 void setEncoding(java.lang.String) throws java.lang.SecurityException, java.io.UnsupportedEncodingException;
    method public void setErrorManager(java.util.logging.ErrorManager);
    method public void setFilter(java.util.logging.Filter) throws java.lang.SecurityException;
    method public void setFormatter(java.util.logging.Formatter) throws java.lang.SecurityException;
    method public 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 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 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 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 finer(java.lang.String);
    method public void finest(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 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.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 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.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 logrb(java.util.logging.Level, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
    method public 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.lang.String, java.lang.String, java.lang.Object[]);
    method public void logrb(java.util.logging.Level, java.lang.String, java.lang.String, java.lang.String, 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 setUseParentHandlers(boolean);
    method public void severe(java.lang.String);
    method public void throwing(java.lang.String, java.lang.String, java.lang.Throwable);
    method public void warning(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 synchronized java.util.logging.Level getPushLevel();
    method public synchronized void publish(java.util.logging.LogRecord);
    method public synchronized void push();
    method public void setPushLevel(java.util.logging.Level) throws java.lang.SecurityException;
  }

  public class SimpleFormatter extends java.util.logging.Formatter {
    ctor public SimpleFormatter();
    method public 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;
    method public java.lang.String toString();
    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 boolean find();
    method public boolean find(int);
    method public java.lang.String group();
    method public java.lang.String group(int);
    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) throws java.lang.IllegalStateException;
    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) throws java.util.regex.PatternSyntaxException;
    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 abstract void accept(double);
    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 abstract void accept(int);
    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 abstract void accept(long);
    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 abstract void accept(T);
    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 public void finish();
    method public boolean finished();
    method public int getAdler();
    method public long getBytesRead();
    method public long getBytesWritten();
    method public int getTotalIn();
    method public int getTotalOut();
    method public boolean needsInput();
    method public void reset();
    method public void setDictionary(byte[], int, int);
    method public void setDictionary(byte[]);
    method public void setInput(byte[], int, int);
    method public void setInput(byte[]);
    method public void setLevel(int);
    method public void setStrategy(int);
    field public static final int BEST_COMPRESSION = 9; // 0x9
    field public static final int BEST_SPEED = 1; // 0x1
    field public static final int DEFAULT_COMPRESSION = -1; // 0xffffffff
    field public static final int DEFAULT_STRATEGY = 0; // 0x0
    field public static final int DEFLATED = 8; // 0x8
    field public static final int FILTERED = 1; // 0x1
    field public static final int FULL_FLUSH = 3; // 0x3
    field public static final int HUFFMAN_ONLY = 2; // 0x2
    field public static final int NO_COMPRESSION = 0; // 0x0
    field public static final int NO_FLUSH = 0; // 0x0
    field public static final int SYNC_FLUSH = 2; // 0x2
  }

  public class DeflaterInputStream extends java.io.FilterInputStream {
    ctor public DeflaterInputStream(java.io.InputStream);
    ctor public DeflaterInputStream(java.io.InputStream, java.util.zip.Deflater);
    ctor public DeflaterInputStream(java.io.InputStream, java.util.zip.Deflater, int);
    field protected final byte[] buf;
    field protected final java.util.zip.Deflater def;
  }

  public class DeflaterOutputStream extends java.io.FilterOutputStream {
    ctor public DeflaterOutputStream(java.io.OutputStream, java.util.zip.Deflater, int, boolean);
    ctor public DeflaterOutputStream(java.io.OutputStream, java.util.zip.Deflater, int);
    ctor public DeflaterOutputStream(java.io.OutputStream, java.util.zip.Deflater, boolean);
    ctor public DeflaterOutputStream(java.io.OutputStream, java.util.zip.Deflater);
    ctor public DeflaterOutputStream(java.io.OutputStream, boolean);
    ctor public DeflaterOutputStream(java.io.OutputStream);
    method protected void deflate() throws java.io.IOException;
    method public void finish() throws java.io.IOException;
    field protected byte[] buf;
    field protected java.util.zip.Deflater def;
  }

  public class GZIPInputStream extends java.util.zip.InflaterInputStream {
    ctor public GZIPInputStream(java.io.InputStream, int) throws java.io.IOException;
    ctor public GZIPInputStream(java.io.InputStream) throws java.io.IOException;
    field public static final int GZIP_MAGIC = 35615; // 0x8b1f
    field protected java.util.zip.CRC32 crc;
    field protected boolean eos;
  }

  public class GZIPOutputStream extends java.util.zip.DeflaterOutputStream {
    ctor public GZIPOutputStream(java.io.OutputStream, int) throws java.io.IOException;
    ctor public GZIPOutputStream(java.io.OutputStream, int, boolean) throws java.io.IOException;
    ctor public GZIPOutputStream(java.io.OutputStream) throws java.io.IOException;
    ctor public GZIPOutputStream(java.io.OutputStream, boolean) throws java.io.IOException;
    field protected java.util.zip.CRC32 crc;
  }

  public class Inflater {
    ctor public Inflater(boolean);
    ctor public Inflater();
    method public void end();
    method 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 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 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);
    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 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 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);
  }

  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 junit.framework {

  public class Assert {
    ctor protected Assert();
    method public static void assertEquals(java.lang.String, java.lang.Object, java.lang.Object);
    method public static void assertEquals(java.lang.Object, java.lang.Object);
    method public static void assertEquals(java.lang.String, java.lang.String, java.lang.String);
    method public static void assertEquals(java.lang.String, java.lang.String);
    method public static void assertEquals(java.lang.String, double, double, double);
    method public static void assertEquals(double, double, double);
    method public static void assertEquals(java.lang.String, float, float, float);
    method public static void assertEquals(float, float, float);
    method public static void assertEquals(java.lang.String, long, long);
    method public static void assertEquals(long, long);
    method public static void assertEquals(java.lang.String, boolean, boolean);
    method public static void assertEquals(boolean, boolean);
    method public static void assertEquals(java.lang.String, byte, byte);
    method public static void assertEquals(byte, byte);
    method public static void assertEquals(java.lang.String, char, char);
    method public static void assertEquals(char, char);
    method public static void assertEquals(java.lang.String, short, short);
    method public static void assertEquals(short, short);
    method public static void assertEquals(java.lang.String, int, int);
    method public static void assertEquals(int, int);
    method public static void assertFalse(java.lang.String, boolean);
    method public static void assertFalse(boolean);
    method public static void assertNotNull(java.lang.Object);
    method public static void assertNotNull(java.lang.String, java.lang.Object);
    method public static void assertNotSame(java.lang.String, java.lang.Object, java.lang.Object);
    method public static void assertNotSame(java.lang.Object, java.lang.Object);
    method public static void assertNull(java.lang.Object);
    method public static void assertNull(java.lang.String, java.lang.Object);
    method public static void assertSame(java.lang.String, java.lang.Object, java.lang.Object);
    method public static void assertSame(java.lang.Object, java.lang.Object);
    method public static void assertTrue(java.lang.String, boolean);
    method public static void assertTrue(boolean);
    method public static void fail(java.lang.String);
    method public static void fail();
    method public static void failNotEquals(java.lang.String, java.lang.Object, java.lang.Object);
    method public static void failNotSame(java.lang.String, java.lang.Object, java.lang.Object);
    method public static void failSame(java.lang.String);
    method public static java.lang.String format(java.lang.String, java.lang.Object, java.lang.Object);
  }

  public class AssertionFailedError extends java.lang.AssertionError {
    ctor public AssertionFailedError();
    ctor public AssertionFailedError(java.lang.String);
  }

  public class ComparisonFailure extends junit.framework.AssertionFailedError {
    ctor public ComparisonFailure(java.lang.String, java.lang.String, java.lang.String);
    method public java.lang.String getActual();
    method public java.lang.String getExpected();
  }

  public abstract interface Protectable {
    method public abstract void protect() throws java.lang.Throwable;
  }

  public abstract interface Test {
    method public abstract int countTestCases();
    method public abstract void run(junit.framework.TestResult);
  }

  public abstract class TestCase extends junit.framework.Assert implements junit.framework.Test {
    ctor public TestCase();
    ctor public TestCase(java.lang.String);
    method public int countTestCases();
    method protected junit.framework.TestResult createResult();
    method public java.lang.String getName();
    method public junit.framework.TestResult run();
    method public void run(junit.framework.TestResult);
    method public void runBare() throws java.lang.Throwable;
    method protected void runTest() throws java.lang.Throwable;
    method public void setName(java.lang.String);
    method protected void setUp() throws java.lang.Exception;
    method protected void tearDown() throws java.lang.Exception;
  }

  public class TestFailure {
    ctor public TestFailure(junit.framework.Test, java.lang.Throwable);
    method public java.lang.String exceptionMessage();
    method public junit.framework.Test failedTest();
    method public boolean isFailure();
    method public java.lang.Throwable thrownException();
    method public java.lang.String trace();
    field protected junit.framework.Test fFailedTest;
    field protected java.lang.Throwable fThrownException;
  }

  public abstract interface TestListener {
    method public abstract void addError(junit.framework.Test, java.lang.Throwable);
    method public abstract void addFailure(junit.framework.Test, junit.framework.AssertionFailedError);
    method public abstract void endTest(junit.framework.Test);
    method public abstract void startTest(junit.framework.Test);
  }

  public class TestResult {
    ctor public TestResult();
    method public synchronized void addError(junit.framework.Test, java.lang.Throwable);
    method public synchronized void addFailure(junit.framework.Test, junit.framework.AssertionFailedError);
    method public synchronized void addListener(junit.framework.TestListener);
    method public void endTest(junit.framework.Test);
    method public synchronized int errorCount();
    method public synchronized java.util.Enumeration<junit.framework.TestFailure> errors();
    method public synchronized int failureCount();
    method public synchronized java.util.Enumeration<junit.framework.TestFailure> failures();
    method public synchronized void removeListener(junit.framework.TestListener);
    method protected void run(junit.framework.TestCase);
    method public synchronized int runCount();
    method public void runProtected(junit.framework.Test, junit.framework.Protectable);
    method public synchronized boolean shouldStop();
    method public void startTest(junit.framework.Test);
    method public synchronized void stop();
    method public synchronized boolean wasSuccessful();
    field protected java.util.Vector<junit.framework.TestFailure> fErrors;
    field protected java.util.Vector<junit.framework.TestFailure> fFailures;
    field protected java.util.Vector<junit.framework.TestListener> fListeners;
    field protected int fRunTests;
  }

  public class TestSuite implements junit.framework.Test {
    ctor public TestSuite();
    ctor public TestSuite(java.lang.Class<?>);
    ctor public TestSuite(java.lang.Class<? extends junit.framework.TestCase>, java.lang.String);
    ctor public TestSuite(java.lang.String);
    ctor public TestSuite(java.lang.Class<?>...);
    ctor public TestSuite(java.lang.Class<? extends junit.framework.TestCase>[], java.lang.String);
    method public void addTest(junit.framework.Test);
    method public void addTestSuite(java.lang.Class<? extends junit.framework.TestCase>);
    method public int countTestCases();
    method public static junit.framework.Test createTest(java.lang.Class<?>, java.lang.String);
    method public java.lang.String getName();
    method public static java.lang.reflect.Constructor<?> getTestConstructor(java.lang.Class<?>) throws java.lang.NoSuchMethodException;
    method public void run(junit.framework.TestResult);
    method public void runTest(junit.framework.Test, junit.framework.TestResult);
    method public void setName(java.lang.String);
    method public junit.framework.Test testAt(int);
    method public int testCount();
    method public java.util.Enumeration<junit.framework.Test> tests();
    method public static junit.framework.Test warning(java.lang.String);
  }

}

package junit.runner {

  public abstract class BaseTestRunner implements junit.framework.TestListener {
    ctor public BaseTestRunner();
    method public synchronized void addError(junit.framework.Test, java.lang.Throwable);
    method public synchronized void addFailure(junit.framework.Test, junit.framework.AssertionFailedError);
    method protected void clearStatus();
    method public java.lang.String elapsedTimeAsString(long);
    method public synchronized void endTest(junit.framework.Test);
    method public java.lang.String extractClassName(java.lang.String);
    method public static java.lang.String getFilteredTrace(java.lang.Throwable);
    method public static java.lang.String getFilteredTrace(java.lang.String);
    method public deprecated junit.runner.TestSuiteLoader getLoader();
    method public static java.lang.String getPreference(java.lang.String);
    method public static int getPreference(java.lang.String, int);
    method protected static java.util.Properties getPreferences();
    method public junit.framework.Test getTest(java.lang.String);
    method public static deprecated boolean inVAJava();
    method protected java.lang.Class<?> loadSuiteClass(java.lang.String) throws java.lang.ClassNotFoundException;
    method protected java.lang.String processArguments(java.lang.String[]);
    method protected abstract void runFailed(java.lang.String);
    method public static void savePreferences() throws java.io.IOException;
    method public void setLoading(boolean);
    method public void setPreference(java.lang.String, java.lang.String);
    method protected static void setPreferences(java.util.Properties);
    method protected static boolean showStackRaw();
    method public synchronized void startTest(junit.framework.Test);
    method public abstract void testEnded(java.lang.String);
    method public abstract void testFailed(int, junit.framework.Test, java.lang.Throwable);
    method public abstract void testStarted(java.lang.String);
    method public static java.lang.String truncate(java.lang.String);
    method protected boolean useReloadingTestSuiteLoader();
    field public static final java.lang.String SUITE_METHODNAME = "suite";
  }

  public abstract interface TestSuiteLoader {
    method public abstract java.lang.Class load(java.lang.String) throws java.lang.ClassNotFoundException;
    method public abstract java.lang.Class reload(java.lang.Class) throws java.lang.ClassNotFoundException;
  }

  public class Version {
    method public static java.lang.String id();
  }

}

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 boolean verify(java.lang.String, javax.net.ssl.SSLSession);
    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);
  }

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

}

