Merge change I10073d50 into eclair

* changes:
  Add Annotation for optional features.
This commit is contained in:
Android (Google) Code Review
2009-12-16 12:14:11 -08:00
2 changed files with 13 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
public @interface SdkConstant { public @interface SdkConstant {
public static enum SdkConstantType { public static enum SdkConstantType {
ACTIVITY_INTENT_ACTION, BROADCAST_INTENT_ACTION, SERVICE_ACTION, INTENT_CATEGORY; ACTIVITY_INTENT_ACTION, BROADCAST_INTENT_ACTION, SERVICE_ACTION, INTENT_CATEGORY, FEATURE;
} }
SdkConstantType value(); SdkConstantType value();

View File

@@ -16,6 +16,8 @@
package android.content.pm; package android.content.pm;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
@@ -518,30 +520,35 @@ public abstract class PackageManager {
* {@link #hasSystemFeature}: The device has a camera facing away * {@link #hasSystemFeature}: The device has a camera facing away
* from the screen. * from the screen.
*/ */
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_CAMERA = "android.hardware.camera"; public static final String FEATURE_CAMERA = "android.hardware.camera";
/** /**
* Feature for {@link #getSystemAvailableFeatures} and * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device's camera supports auto-focus. * {@link #hasSystemFeature}: The device's camera supports auto-focus.
*/ */
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus"; public static final String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus";
/** /**
* Feature for {@link #getSystemAvailableFeatures} and * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device's camera supports flash. * {@link #hasSystemFeature}: The device's camera supports flash.
*/ */
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash"; public static final String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash";
/** /**
* Feature for {@link #getSystemAvailableFeatures} and * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device includes a light sensor. * {@link #hasSystemFeature}: The device includes a light sensor.
*/ */
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light"; public static final String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light";
/** /**
* Feature for {@link #getSystemAvailableFeatures} and * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device includes a proximity sensor. * {@link #hasSystemFeature}: The device includes a proximity sensor.
*/ */
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_SENSOR_PROXIMITY = "android.hardware.sensor.proximity"; public static final String FEATURE_SENSOR_PROXIMITY = "android.hardware.sensor.proximity";
/** /**
@@ -549,30 +556,35 @@ public abstract class PackageManager {
* {@link #hasSystemFeature}: The device has a telephony radio with data * {@link #hasSystemFeature}: The device has a telephony radio with data
* communication support. * communication support.
*/ */
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_TELEPHONY = "android.hardware.telephony"; public static final String FEATURE_TELEPHONY = "android.hardware.telephony";
/** /**
* Feature for {@link #getSystemAvailableFeatures} and * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device has a CDMA telephony stack. * {@link #hasSystemFeature}: The device has a CDMA telephony stack.
*/ */
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma"; public static final String FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma";
/** /**
* Feature for {@link #getSystemAvailableFeatures} and * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device has a GSM telephony stack. * {@link #hasSystemFeature}: The device has a GSM telephony stack.
*/ */
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm"; public static final String FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm";
/** /**
* Feature for {@link #getSystemAvailableFeatures} and * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device's touch screen supports multitouch. * {@link #hasSystemFeature}: The device's touch screen supports multitouch.
*/ */
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch"; public static final String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch";
/** /**
* Feature for {@link #getSystemAvailableFeatures} and * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device supports live wallpapers. * {@link #hasSystemFeature}: The device supports live wallpapers.
*/ */
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper"; public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper";
/** /**