package android.app {

  public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
    method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs);
    method public deprecated void setPictureInPictureArgs(android.app.PictureInPictureArgs);
  }

  public class ActivityManager {
    method public static deprecated int getMaxNumPictureInPictureActions();
  }

  public class KeyguardManager {
    method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
  }

  public class Notification implements android.os.Parcelable {
    method public deprecated java.lang.String getChannel();
    method public static java.lang.Class<? extends android.app.Notification.Style> getNotificationStyleClass(java.lang.String);
    method public deprecated long getTimeout();
    method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent);
  }

  public static class Notification.Builder {
    method public deprecated android.app.Notification.Builder setChannel(java.lang.String);
    method public deprecated android.app.Notification.Builder setTimeout(long);
  }

  public final deprecated class PictureInPictureArgs implements android.os.Parcelable {
    method public static android.app.PictureInPictureArgs convert(android.app.PictureInPictureParams);
    method public static android.app.PictureInPictureParams convert(android.app.PictureInPictureArgs);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CONTENTS_FILE_DESCRIPTOR = 1; // 0x1
    field public static final android.os.Parcelable.Creator<android.app.PictureInPictureArgs> CREATOR;
    field public static final int PARCELABLE_WRITE_RETURN_VALUE = 1; // 0x1
  }

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

}

package android.app.admin {

  public class DevicePolicyManager {
    method public deprecated android.os.UserHandle createAndInitializeUser(android.content.ComponentName, java.lang.String, java.lang.String, android.content.ComponentName, android.os.Bundle);
    method public deprecated android.os.UserHandle createUser(android.content.ComponentName, java.lang.String);
  }

}

package android.app.job {

  public class JobInfo implements android.os.Parcelable {
    method public deprecated long getEstimatedNetworkBytes();
  }

  public static final class JobInfo.Builder {
    method public deprecated android.app.job.JobInfo.Builder setEstimatedNetworkBytes(long);
    method public deprecated android.app.job.JobInfo.Builder setIsPrefetch(boolean);
  }

  public final class JobWorkItem implements android.os.Parcelable {
    ctor public deprecated JobWorkItem(android.content.Intent, long);
    method public deprecated long getEstimatedNetworkBytes();
  }

}

package android.app.usage {

  public final class StorageStats implements android.os.Parcelable {
    method public deprecated long getCodeBytes();
  }

  public class StorageStatsManager {
    method public deprecated long getFreeBytes(java.lang.String) throws java.io.IOException;
    method public deprecated long getTotalBytes(java.lang.String) throws java.io.IOException;
    method public deprecated boolean isQuotaSupported(java.lang.String);
    method public deprecated android.app.usage.ExternalStorageStats queryExternalStatsForUser(java.lang.String, android.os.UserHandle) throws java.io.IOException;
    method public deprecated android.app.usage.StorageStats queryStatsForPackage(java.lang.String, java.lang.String, android.os.UserHandle) throws java.io.IOException, android.content.pm.PackageManager.NameNotFoundException;
    method public deprecated android.app.usage.StorageStats queryStatsForUid(java.lang.String, int) throws java.io.IOException;
    method public deprecated android.app.usage.StorageStats queryStatsForUser(java.lang.String, android.os.UserHandle) throws java.io.IOException;
  }

}

package android.content {

  public class ClipData implements android.os.Parcelable {
    method public deprecated void addItem(android.content.ClipData.Item, android.content.ContentResolver);
  }

  public abstract class Context {
    method public abstract android.content.SharedPreferences getSharedPreferences(java.io.File, int);
    method public abstract java.io.File getSharedPreferencesPath(java.lang.String);
  }

  public class ContextWrapper extends android.content.Context {
    method public android.content.SharedPreferences getSharedPreferences(java.io.File, int);
    method public java.io.File getSharedPreferencesPath(java.lang.String);
  }

  public class Intent implements java.lang.Cloneable android.os.Parcelable {
    field public static final deprecated java.lang.String EXTRA_QUICK_VIEW_ADVANCED = "android.intent.extra.QUICK_VIEW_ADVANCED";
  }

}

package android.content.pm {

  public class ApplicationInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
    field public deprecated java.lang.String volumeUuid;
  }

  public class ComponentInfo extends android.content.pm.PackageItemInfo {
    field public deprecated boolean encryptionAware;
  }

  public class PackageInfo implements android.os.Parcelable {
    field public static final int REQUESTED_PERMISSION_REQUIRED = 1; // 0x1
  }

  public abstract class PackageManager {
    method public abstract boolean setInstantAppCookie(byte[]);
  }

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

  public final class SharedLibraryInfo implements android.os.Parcelable {
    method public boolean isBuiltin();
    method public boolean isDynamic();
    method public boolean isStatic();
  }

}

package android.database {

  public abstract class AbstractCursor implements android.database.CrossProcessCursor {
    field protected java.lang.Long mCurrentRowID;
    field protected int mRowIdColumnIndex;
    field protected java.util.HashMap<java.lang.Long, java.util.Map<java.lang.String, java.lang.Object>> mUpdatedRows;
  }

}

package android.graphics {

  public deprecated class AvoidXfermode extends android.graphics.Xfermode {
    ctor public AvoidXfermode(int, int, android.graphics.AvoidXfermode.Mode);
  }

  public static final class AvoidXfermode.Mode extends java.lang.Enum {
    method public static android.graphics.AvoidXfermode.Mode valueOf(java.lang.String);
    method public static final android.graphics.AvoidXfermode.Mode[] values();
    enum_constant public static final android.graphics.AvoidXfermode.Mode AVOID;
    enum_constant public static final android.graphics.AvoidXfermode.Mode TARGET;
  }

  public class Canvas {
    method public deprecated boolean clipRegion(android.graphics.Region, android.graphics.Region.Op);
    method public deprecated boolean clipRegion(android.graphics.Region);
    method public deprecated int save(int);
    field public static final deprecated int CLIP_SAVE_FLAG = 2; // 0x2
    field public static final deprecated int CLIP_TO_LAYER_SAVE_FLAG = 16; // 0x10
    field public static final deprecated int FULL_COLOR_LAYER_SAVE_FLAG = 8; // 0x8
    field public static final deprecated int HAS_ALPHA_LAYER_SAVE_FLAG = 4; // 0x4
    field public static final deprecated int MATRIX_SAVE_FLAG = 1; // 0x1
  }

  public final class ImageDecoder implements java.lang.AutoCloseable {
    method public deprecated boolean getAsAlphaMask();
    method public deprecated boolean getDecodeAsAlphaMask();
    method public deprecated boolean getMutable();
    method public deprecated boolean getRequireUnpremultiplied();
    method public deprecated android.graphics.ImageDecoder setAsAlphaMask(boolean);
    method public deprecated android.graphics.ImageDecoder setDecodeAsAlphaMask(boolean);
    method public deprecated android.graphics.ImageDecoder setMutable(boolean);
    method public deprecated android.graphics.ImageDecoder setRequireUnpremultiplied(boolean);
    method public deprecated android.graphics.ImageDecoder setResize(int, int);
    method public deprecated android.graphics.ImageDecoder setResize(int);
    field public static final deprecated int ERROR_SOURCE_ERROR = 3; // 0x3
    field public static final deprecated int ERROR_SOURCE_EXCEPTION = 1; // 0x1
    field public static final deprecated int ERROR_SOURCE_INCOMPLETE = 2; // 0x2
  }

  public static deprecated class ImageDecoder.IncompleteException extends java.io.IOException {
    ctor public ImageDecoder.IncompleteException();
  }

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

  public deprecated class PixelXorXfermode extends android.graphics.Xfermode {
    ctor public PixelXorXfermode(int);
  }

  public class Rasterizer {
    ctor public Rasterizer();
  }

}

package android.graphics.drawable {

  public class AnimatedImageDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Animatable2 {
    method public deprecated int getLoopCount(int);
    method public deprecated void setLoopCount(int);
    field public static final deprecated int LOOP_INFINITE = -1; // 0xffffffff
  }

}

package android.hardware {

  public final class HardwareBuffer implements java.lang.AutoCloseable android.os.Parcelable {
    method public deprecated void destroy();
    method public deprecated boolean isDestroyed();
  }

  public final class SensorDirectChannel implements java.nio.channels.Channel {
    method public deprecated boolean isValid();
  }

  public abstract class SensorManager {
    method public deprecated int configureDirectChannel(android.hardware.SensorDirectChannel, android.hardware.Sensor, int);
  }

}

package android.location {

  public class Location implements android.os.Parcelable {
    method public deprecated void removeBearingAccuracy();
    method public deprecated void removeSpeedAccuracy();
    method public deprecated void removeVerticalAccuracy();
  }

}

package android.media {

  public final class AudioFormat implements android.os.Parcelable {
    ctor public AudioFormat();
  }

}

package android.media.tv {

  public class TvView extends android.view.ViewGroup {
    method public void requestUnblockContent(android.media.tv.TvContentRating);
  }

}

package android.net {

  public class ConnectivityManager {
    method public deprecated boolean requestRouteToHost(int, int);
    method public deprecated int startUsingNetworkFeature(int, java.lang.String);
    method public deprecated int stopUsingNetworkFeature(int, java.lang.String);
  }

  public deprecated class NetworkBadging {
    method public static android.graphics.drawable.Drawable getWifiIcon(int, int, android.content.res.Resources.Theme);
    field public static final int BADGING_4K = 30; // 0x1e
    field public static final int BADGING_HD = 20; // 0x14
    field public static final int BADGING_NONE = 0; // 0x0
    field public static final int BADGING_SD = 10; // 0xa
  }

  public static abstract class NetworkBadging.Badging implements java.lang.annotation.Annotation {
  }

  public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
    method public static deprecated org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int, android.net.SSLSessionCache);
  }

  public class TrafficStats {
    method public static deprecated void setThreadStatsUidSelf();
  }

}

package android.os {

  public class BatteryManager {
    ctor public BatteryManager();
  }

  public final class PowerManager {
    method public void goToSleep(long);
    method public deprecated void userActivity(long, boolean);
    method public void wakeUp(long);
  }

  public class RecoverySystem {
    ctor public RecoverySystem();
  }

  public static final class StrictMode.ThreadPolicy.Builder {
    method public android.os.StrictMode.ThreadPolicy.Builder penaltyListener(android.os.StrictMode.OnThreadViolationListener, java.util.concurrent.Executor);
  }

  public static final class StrictMode.VmPolicy.Builder {
    method public android.os.StrictMode.VmPolicy.Builder penaltyListener(android.os.StrictMode.OnVmViolationListener, java.util.concurrent.Executor);
  }

  public final class SystemClock {
    method public static java.time.Clock elapsedRealtimeClock();
    method public static java.time.Clock uptimeClock();
    method public static deprecated java.time.Clock uptimeMillisClock();
  }

  public class TestLooperManager {
    method public deprecated android.os.MessageQueue getQueue();
  }

  public class UserManager {
    method public android.graphics.drawable.Drawable getBadgedDrawableForUser(android.graphics.drawable.Drawable, android.os.UserHandle, android.graphics.Rect, int);
    method public android.graphics.drawable.Drawable getBadgedIconForUser(android.graphics.drawable.Drawable, android.os.UserHandle);
    method public java.lang.CharSequence getBadgedLabelForUser(java.lang.CharSequence, android.os.UserHandle);
  }

}

package android.os.storage {

  public class StorageManager {
    method public android.os.storage.StorageVolume getPrimaryVolume();
    method public android.os.storage.StorageVolume[] getVolumeList();
  }

}

package android.provider {

  public class Browser {
    method public static final void addSearchUrl(android.content.ContentResolver, java.lang.String);
    method public static final boolean canClearHistory(android.content.ContentResolver);
    method public static final void clearHistory(android.content.ContentResolver);
    method public static final void clearSearches(android.content.ContentResolver);
    method public static final void deleteFromHistory(android.content.ContentResolver, java.lang.String);
    method public static final void deleteHistoryTimeFrame(android.content.ContentResolver, long, long);
    method public static final android.database.Cursor getAllBookmarks(android.content.ContentResolver) throws java.lang.IllegalStateException;
    method public static final android.database.Cursor getAllVisitedUrls(android.content.ContentResolver) throws java.lang.IllegalStateException;
    method public static final void requestAllIcons(android.content.ContentResolver, java.lang.String, android.webkit.WebIconDatabase.IconListener);
    method public static final void saveBookmark(android.content.Context, java.lang.String, java.lang.String);
    method public static final void truncateHistory(android.content.ContentResolver);
    method public static final void updateVisitedHistory(android.content.ContentResolver, java.lang.String, boolean);
    field public static final android.net.Uri BOOKMARKS_URI;
    field public static final java.lang.String[] HISTORY_PROJECTION;
    field public static final int HISTORY_PROJECTION_BOOKMARK_INDEX = 4; // 0x4
    field public static final int HISTORY_PROJECTION_DATE_INDEX = 3; // 0x3
    field public static final int HISTORY_PROJECTION_FAVICON_INDEX = 6; // 0x6
    field public static final int HISTORY_PROJECTION_ID_INDEX = 0; // 0x0
    field public static final int HISTORY_PROJECTION_TITLE_INDEX = 5; // 0x5
    field public static final int HISTORY_PROJECTION_URL_INDEX = 1; // 0x1
    field public static final int HISTORY_PROJECTION_VISITS_INDEX = 2; // 0x2
    field public static final java.lang.String[] SEARCHES_PROJECTION;
    field public static final int SEARCHES_PROJECTION_DATE_INDEX = 2; // 0x2
    field public static final int SEARCHES_PROJECTION_SEARCH_INDEX = 1; // 0x1
    field public static final android.net.Uri SEARCHES_URI;
    field public static final java.lang.String[] TRUNCATE_HISTORY_PROJECTION;
    field public static final int TRUNCATE_HISTORY_PROJECTION_ID_INDEX = 0; // 0x0
    field public static final int TRUNCATE_N_OLDEST = 5; // 0x5
  }

  public static class Browser.BookmarkColumns implements android.provider.BaseColumns {
    ctor public Browser.BookmarkColumns();
    field public static final java.lang.String BOOKMARK = "bookmark";
    field public static final java.lang.String CREATED = "created";
    field public static final java.lang.String DATE = "date";
    field public static final java.lang.String FAVICON = "favicon";
    field public static final java.lang.String TITLE = "title";
    field public static final java.lang.String URL = "url";
    field public static final java.lang.String VISITS = "visits";
    field public static final java.lang.String _COUNT = "_count";
    field public static final java.lang.String _ID = "_id";
  }

  public static class Browser.SearchColumns implements android.provider.BaseColumns {
    ctor public Browser.SearchColumns();
    field public static final java.lang.String DATE = "date";
    field public static final java.lang.String SEARCH = "search";
    field public static final deprecated java.lang.String URL = "url";
    field public static final java.lang.String _COUNT = "_count";
    field public static final java.lang.String _ID = "_id";
  }

  public static final deprecated class ContactsContract.Contacts.StreamItems implements android.provider.ContactsContract.StreamItemsColumns {
    field public static final deprecated java.lang.String CONTENT_DIRECTORY = "stream_items";
  }

  public static final deprecated class ContactsContract.RawContacts.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns {
    field public static final deprecated java.lang.String CONTENT_DIRECTORY = "stream_items";
    field public static final java.lang.String _COUNT = "_count";
    field public static final java.lang.String _ID = "_id";
  }

  public static final deprecated class ContactsContract.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns {
    field public static final deprecated java.lang.String PHOTO = "photo";
    field public static final java.lang.String _COUNT = "_count";
    field public static final java.lang.String _ID = "_id";
  }

  protected static abstract deprecated interface ContactsContract.StreamItemPhotosColumns {
    field public static final deprecated java.lang.String PHOTO_FILE_ID = "photo_file_id";
    field public static final deprecated java.lang.String PHOTO_URI = "photo_uri";
    field public static final deprecated java.lang.String SORT_INDEX = "sort_index";
    field public static final deprecated java.lang.String STREAM_ITEM_ID = "stream_item_id";
    field public static final deprecated java.lang.String SYNC1 = "stream_item_photo_sync1";
    field public static final deprecated java.lang.String SYNC2 = "stream_item_photo_sync2";
    field public static final deprecated java.lang.String SYNC3 = "stream_item_photo_sync3";
    field public static final deprecated java.lang.String SYNC4 = "stream_item_photo_sync4";
  }

  public static final deprecated class ContactsContract.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns {
    field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item";
    field public static final deprecated android.net.Uri CONTENT_LIMIT_URI;
    field public static final deprecated android.net.Uri CONTENT_PHOTO_URI;
    field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item";
    field public static final deprecated android.net.Uri CONTENT_URI;
    field public static final deprecated java.lang.String MAX_ITEMS = "max_items";
    field public static final java.lang.String _COUNT = "_count";
    field public static final java.lang.String _ID = "_id";
  }

  public static final deprecated class ContactsContract.StreamItems.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns {
    field public static final deprecated java.lang.String CONTENT_DIRECTORY = "photo";
    field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item_photo";
    field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item_photo";
    field public static final java.lang.String _COUNT = "_count";
    field public static final java.lang.String _ID = "_id";
  }

  protected static abstract deprecated interface ContactsContract.StreamItemsColumns {
    field public static final deprecated java.lang.String ACCOUNT_NAME = "account_name";
    field public static final deprecated java.lang.String ACCOUNT_TYPE = "account_type";
    field public static final deprecated java.lang.String COMMENTS = "comments";
    field public static final deprecated java.lang.String CONTACT_ID = "contact_id";
    field public static final deprecated java.lang.String CONTACT_LOOKUP_KEY = "contact_lookup";
    field public static final deprecated java.lang.String DATA_SET = "data_set";
    field public static final deprecated java.lang.String RAW_CONTACT_ID = "raw_contact_id";
    field public static final deprecated java.lang.String RAW_CONTACT_SOURCE_ID = "raw_contact_source_id";
    field public static final deprecated java.lang.String RES_ICON = "icon";
    field public static final deprecated java.lang.String RES_LABEL = "label";
    field public static final deprecated java.lang.String RES_PACKAGE = "res_package";
    field public static final deprecated java.lang.String SYNC1 = "stream_item_sync1";
    field public static final deprecated java.lang.String SYNC2 = "stream_item_sync2";
    field public static final deprecated java.lang.String SYNC3 = "stream_item_sync3";
    field public static final deprecated java.lang.String SYNC4 = "stream_item_sync4";
    field public static final deprecated java.lang.String TEXT = "text";
    field public static final deprecated java.lang.String TIMESTAMP = "timestamp";
  }

  public static final class Settings.Global extends android.provider.Settings.NameValueTable {
    field public static final deprecated java.lang.String CONTACT_METADATA_SYNC = "contact_metadata_sync";
  }

  public static final class Settings.System extends android.provider.Settings.NameValueTable {
    field public static final java.lang.String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
    field public static final java.lang.String VOLUME_ALARM = "volume_alarm";
    field public static final java.lang.String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
    field public static final java.lang.String VOLUME_MUSIC = "volume_music";
    field public static final java.lang.String VOLUME_NOTIFICATION = "volume_notification";
    field public static final java.lang.String VOLUME_RING = "volume_ring";
    field public static final java.lang.String[] VOLUME_SETTINGS;
    field public static final java.lang.String VOLUME_SYSTEM = "volume_system";
    field public static final java.lang.String VOLUME_VOICE = "volume_voice";
  }

  public static final class Telephony.Sms.Intents {
    field public static final java.lang.String SMS_EMERGENCY_CB_RECEIVED_ACTION = "android.provider.Telephony.SMS_EMERGENCY_CB_RECEIVED";
  }

}

package android.speech.tts {

  public abstract class UtteranceProgressListener {
    method public deprecated void onUtteranceRangeStart(java.lang.String, int, int);
  }

}

package android.text.format {

  public class DateFormat {
    field public static final deprecated char AM_PM = 97; // 0x0061 'a'
    field public static final deprecated char CAPITAL_AM_PM = 65; // 0x0041 'A'
    field public static final deprecated char DATE = 100; // 0x0064 'd'
    field public static final deprecated char DAY = 69; // 0x0045 'E'
    field public static final deprecated char HOUR = 104; // 0x0068 'h'
    field public static final deprecated char HOUR_OF_DAY = 107; // 0x006b 'k'
    field public static final deprecated char MINUTE = 109; // 0x006d 'm'
    field public static final deprecated char MONTH = 77; // 0x004d 'M'
    field public static final deprecated char QUOTE = 39; // 0x0027 '\''
    field public static final deprecated char SECONDS = 115; // 0x0073 's'
    field public static final deprecated char STANDALONE_MONTH = 76; // 0x004c 'L'
    field public static final deprecated char TIME_ZONE = 122; // 0x007a 'z'
    field public static final deprecated char YEAR = 121; // 0x0079 'y'
  }

}

package android.text.style {

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

}

package android.util {

  public deprecated class FloatMath {
    method public static float ceil(float);
    method public static float cos(float);
    method public static float exp(float);
    method public static float floor(float);
    method public static float hypot(float, float);
    method public static float pow(float, float);
    method public static float sin(float);
    method public static float sqrt(float);
  }

}

package android.view {

  public class View implements android.view.accessibility.AccessibilityEventSource android.graphics.drawable.Drawable.Callback android.view.KeyEvent.Callback {
    method protected void initializeFadingEdge(android.content.res.TypedArray);
    method protected void initializeScrollbars(android.content.res.TypedArray);
  }

  public class ViewConfiguration {
    method public int getScaledScrollFactor();
  }

  public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable {
    field public static final int TYPE_KEYGUARD = 2004; // 0x7d4
  }

}

package android.webkit {

  public class WebViewClient {
    method public void onUnhandledInputEvent(android.webkit.WebView, android.view.InputEvent);
  }

}

package android.widget {

  public class ListView extends android.widget.AbsListView {
    method protected <T extends android.view.View> T findViewTraversal(int);
    method protected <T extends android.view.View> T findViewWithTagTraversal(java.lang.Object);
  }

  public class TextView extends android.view.View implements android.view.ViewTreeObserver.OnPreDrawListener {
    method public static int getTextColor(android.content.Context, android.content.res.TypedArray, int);
    method public static android.content.res.ColorStateList getTextColors(android.content.Context, android.content.res.TypedArray);
  }

}

