package android {

  public static final class Manifest.permission {
    field public static final java.lang.String SUBSCRIBED_FEEDS_READ = "android.permission.SUBSCRIBED_FEEDS_READ";
    field public static final java.lang.String SUBSCRIBED_FEEDS_WRITE = "android.permission.SUBSCRIBED_FEEDS_WRITE";
  }

}

package android.content.pm {

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

}

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

  public class AudioFormat {
    ctor public AudioFormat();
  }

}

package android.net {

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

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

}

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

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

}

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.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 static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable {
    field public static final int TYPE_KEYGUARD = 2004; // 0x7d4
  }

}

package android.widget {

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

}

