Adding definitions & APIs for features that are newly-optional in FroYo.
This also refactors the files containing the features so that they are more
modular. Note that this also changes data/etc/Android.mk so that
required_hardware.xml is NOT copied automatically for all devices
anymore. Accordingly, that file is removed.
diff --git a/api/current.xml b/api/current.xml
index ba28d14..dd0a804 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -45353,6 +45353,105 @@
visibility="public"
>
</field>
+<field name="FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.hardware.touchscreen.multitouch.distinct""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="FEATURE_BLUETOOTH"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.hardware.bluetooth""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="FEATURE_LOCATION"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.hardware.location""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="FEATURE_LOCATION_GPS"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.hardware.location.gps""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="FEATURE_LOCATION_NETWORK"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.hardware.location.network""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="FEATURE_MICROPHONE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.hardware.microphone""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="FEATURE_WIFI"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.hardware.wifi""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="FEATURE_SENSOR_ACCELEROMETER"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.hardware.sensor.accelerometer""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="FEATURE_SENSOR_COMPASS"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.hardware.sensor.compass""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="GET_ACTIVITIES"
type="int"
transient="false"
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index dc8f386..efd7bbc 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -602,33 +602,87 @@
/**
* Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature}: The device is capable of communicating with
+ * other devices via Bluetooth.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_BLUETOOTH = "android.hardware.bluetooth";
+
+ /**
+ * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device has a camera facing away
* from the screen.
*/
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_CAMERA = "android.hardware.camera";
-
+
/**
* Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device's camera supports auto-focus.
*/
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus";
-
+
/**
* Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device's camera supports flash.
*/
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash";
-
+
+ /**
+ * Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature}: The device supports one or more methods of
+ * reporting current location.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_LOCATION = "android.hardware.location";
+
+ /**
+ * Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature}: The device has a Global Positioning System
+ * receiver and can report precise location.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_LOCATION_GPS = "android.hardware.location.gps";
+
+ /**
+ * Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature}: The device can report location with coarse
+ * accuracy using a network-based geolocation system.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_LOCATION_NETWORK = "android.hardware.location.network";
+
+ /**
+ * Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature}: The device can record audio via a
+ * microphone.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_MICROPHONE = "android.hardware.microphone";
+
+ /**
+ * Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature}: The device includes a magnetometer (compass).
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_SENSOR_COMPASS = "android.hardware.sensor.compass";
+
+ /**
+ * Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature}: The device includes an accelerometer.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_SENSOR_ACCELEROMETER = "android.hardware.sensor.accelerometer";
+
/**
* Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device includes a light sensor.
*/
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light";
-
+
/**
* Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device includes a proximity sensor.
@@ -660,19 +714,35 @@
/**
* Feature for {@link #getSystemAvailableFeatures} and
- * {@link #hasSystemFeature}: The device's touch screen supports multitouch.
+ * {@link #hasSystemFeature}: The device's touch screen supports
+ * multitouch sufficient for basic two-finger gesture detection.
*/
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch";
/**
* Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature}: The device's touch screen is capable of
+ * tracking two or more fingers fully independently.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT = "android.hardware.touchscreen.multitouch.distinct";
+
+ /**
+ * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device supports live wallpapers.
*/
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper";
/**
+ * Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature}: The device supports WiFi (802.11) networking.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_WIFI = "android.hardware.wifi";
+
+ /**
* Action to external storage service to clean out removed apps.
* @hide
*/
diff --git a/data/etc/Android.mk b/data/etc/Android.mk
index 041c5d3..71a9a15 100644
--- a/data/etc/Android.mk
+++ b/data/etc/Android.mk
@@ -34,18 +34,18 @@
include $(BUILD_PREBUILT)
########################
-include $(CLEAR_VARS)
+#include $(CLEAR_VARS)
-LOCAL_MODULE := required_hardware.xml
+#LOCAL_MODULE := required_hardware.xml
-LOCAL_MODULE_TAGS := user
+#LOCAL_MODULE_TAGS := user
-LOCAL_MODULE_CLASS := ETC
+#LOCAL_MODULE_CLASS := ETC
# This will install the file in /system/etc/permissions
#
-LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
+#LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
-LOCAL_SRC_FILES := $(LOCAL_MODULE)
+#LOCAL_SRC_FILES := $(LOCAL_MODULE)
-include $(BUILD_PREBUILT)
+#include $(BUILD_PREBUILT)
diff --git a/data/etc/android.hardware.camera.xml b/data/etc/android.hardware.camera.xml
new file mode 100644
index 0000000..00a1ed7
--- /dev/null
+++ b/data/etc/android.hardware.camera.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- This is the standard set of features for a non auto-focus camera. -->
+<permissions>
+ <feature name="android.hardware.camera" />
+</permissions>
diff --git a/data/etc/required_hardware.xml b/data/etc/android.hardware.location.gps.xml
similarity index 66%
rename from data/etc/required_hardware.xml
rename to data/etc/android.hardware.location.gps.xml
index 3ffe6b2..72ab732 100644
--- a/data/etc/required_hardware.xml
+++ b/data/etc/android.hardware.location.gps.xml
@@ -14,16 +14,9 @@
limitations under the License.
-->
-<!-- These are the hardware features that all devices must possess.
- These are always added for you by the build system, you do not need
- to add them yourself. -->
+<!-- These are the location-related features for devices that include GPS. -->
<permissions>
<feature name="android.hardware.location" />
<feature name="android.hardware.location.network" />
<feature name="android.hardware.location.gps" />
- <feature name="android.hardware.sensor.compass" />
- <feature name="android.hardware.sensor.accelerometer" />
- <feature name="android.hardware.bluetooth" />
- <feature name="android.hardware.wifi" />
- <feature name="android.hardware.touchscreen" />
</permissions>
diff --git a/data/etc/required_hardware.xml b/data/etc/android.hardware.location.xml
similarity index 62%
copy from data/etc/required_hardware.xml
copy to data/etc/android.hardware.location.xml
index 3ffe6b2..ab901cf 100644
--- a/data/etc/required_hardware.xml
+++ b/data/etc/android.hardware.location.xml
@@ -14,16 +14,9 @@
limitations under the License.
-->
-<!-- These are the hardware features that all devices must possess.
- These are always added for you by the build system, you do not need
- to add them yourself. -->
+<!-- These are the location features for devices that do not include GPS. Note
+ that network location is required for all devices. -->
<permissions>
<feature name="android.hardware.location" />
<feature name="android.hardware.location.network" />
- <feature name="android.hardware.location.gps" />
- <feature name="android.hardware.sensor.compass" />
- <feature name="android.hardware.sensor.accelerometer" />
- <feature name="android.hardware.bluetooth" />
- <feature name="android.hardware.wifi" />
- <feature name="android.hardware.touchscreen" />
</permissions>
diff --git a/data/etc/android.hardware.sensor.accelerometer.xml b/data/etc/android.hardware.sensor.accelerometer.xml
new file mode 100644
index 0000000..22f18b8
--- /dev/null
+++ b/data/etc/android.hardware.sensor.accelerometer.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- Feature for devices with an accelerometer sensor. -->
+<permissions>
+ <feature name="android.hardware.sensor.accelerometer" />
+</permissions>
diff --git a/data/etc/android.hardware.sensor.compass.xml b/data/etc/android.hardware.sensor.compass.xml
new file mode 100644
index 0000000..963847d
--- /dev/null
+++ b/data/etc/android.hardware.sensor.compass.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- Feature for devices with a compass. -->
+<permissions>
+ <feature name="android.hardware.sensor.compass" />
+</permissions>
diff --git a/data/etc/android.hardware.telephony.cdma.xml b/data/etc/android.hardware.telephony.cdma.xml
index 72e0485..082378d5 100644
--- a/data/etc/android.hardware.telephony.cdma.xml
+++ b/data/etc/android.hardware.telephony.cdma.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<!-- This is the standard set of features for a CDMA phone. -->
+<!-- This is the standard set of telephony features for a CDMA phone. -->
<permissions>
<feature name="android.hardware.telephony" />
<feature name="android.hardware.telephony.cdma" />
diff --git a/data/etc/android.hardware.telephony.gsm.xml b/data/etc/android.hardware.telephony.gsm.xml
index ffde433..7927fa8 100644
--- a/data/etc/android.hardware.telephony.gsm.xml
+++ b/data/etc/android.hardware.telephony.gsm.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<!-- This is the standard set of features for a GSM phone. -->
+<!-- This is the standard set of telephony features for a GSM phone. -->
<permissions>
<feature name="android.hardware.telephony" />
<feature name="android.hardware.telephony.gsm" />
diff --git a/data/etc/android.hardware.touchscreen.multitouch.distinct.xml b/data/etc/android.hardware.touchscreen.multitouch.distinct.xml
new file mode 100644
index 0000000..a3c116a
--- /dev/null
+++ b/data/etc/android.hardware.touchscreen.multitouch.distinct.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- This is the standard set of features for a touchscreen that supports
+ independently-trackable multiple-finger multitouch. -->
+<permissions>
+ <feature name="android.hardware.touchscreen" />
+ <feature name="android.hardware.touchscreen.multitouch" />
+ <feature name="android.hardware.touchscreen.multitouch.distinct" />
+</permissions>
diff --git a/data/etc/android.hardware.touchscreen.multitouch.xml b/data/etc/android.hardware.touchscreen.multitouch.xml
index 3d2399a..34b518a 100644
--- a/data/etc/android.hardware.touchscreen.multitouch.xml
+++ b/data/etc/android.hardware.touchscreen.multitouch.xml
@@ -15,7 +15,9 @@
-->
<!-- This is the standard set of features for a touchscreen that supports
- multitouch. -->
+ basic multitouch capable of gestures but not fully-indendent finger
+ tracking. -->
<permissions>
+ <feature name="android.hardware.touchscreen" />
<feature name="android.hardware.touchscreen.multitouch" />
</permissions>
diff --git a/data/etc/android.hardware.touchscreen.xml b/data/etc/android.hardware.touchscreen.xml
new file mode 100644
index 0000000..10c91f1
--- /dev/null
+++ b/data/etc/android.hardware.touchscreen.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- This is the standard set of features for a touchscreen that does not
+ support multitouch. -->
+<permissions>
+ <feature name="android.hardware.touchscreen" />
+</permissions>
diff --git a/data/etc/android.hardware.wifi.xml b/data/etc/android.hardware.wifi.xml
new file mode 100644
index 0000000..512570c
--- /dev/null
+++ b/data/etc/android.hardware.wifi.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- This is the standard feature indicating that the device includes WiFi. -->
+<permissions>
+ <feature name="android.hardware.wifi" />
+</permissions>
diff --git a/data/etc/handheld_core_hardware.xml b/data/etc/handheld_core_hardware.xml
new file mode 100644
index 0000000..564fa84
--- /dev/null
+++ b/data/etc/handheld_core_hardware.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- These are the hardware components that all handheld devices
+ must include. Devices with optional hardware must also include extra
+ hardware files, per the comments below.
+
+ Handheld devices include phones, mobile Internet devices (MIDs),
+ Personal Media Players (PMPs), small tablets (7" or less), and similar
+ devices.
+-->
+<permissions>
+ <feature name="android.hardware.camera" />
+ <feature name="android.hardware.location" />
+ <feature name="android.hardware.location.network" />
+ <feature name="android.hardware.sensor.compass" />
+ <feature name="android.hardware.sensor.accelerometer" />
+ <feature name="android.hardware.bluetooth" />
+ <feature name="android.hardware.touchscreen" />
+ <feature name="android.hardware.microphone" />
+ <!-- devices with GPS must include android.hardware.location.gps.xml -->
+ <!-- devices with an autofocus camera and/or flash must include either
+ android.hardware.camera.autofocus.xml or
+ android.hardware.camera.autofocus-flash.xml -->
+ <!-- devices with WiFi must also include android.hardware.wifi.xml -->
+ <!-- devices with limited/gestural multitouch must also include
+ android.hardware.touchscreen.multitouch.xml -->
+ <!-- devices with full multitouch must also include
+ android.hardware.touchscreen.multitouch.distinct.xml -->
+ <!-- devices with an ambient light sensor must also include
+ android.hardware.sensor.light.xml -->
+ <!-- devices with a proximity sensor must also include
+ android.hardware.sensor.proximity.xml -->
+ <!-- GSM phones must also include android.hardware.telephony.gsm.xml -->
+ <!-- CDMA phones must also include android.hardware.telephony.cdma.xml -->
+</permissions>