+ xlargeScreen = getIntegerAttribute(tree,
+ XLARGE_SCREEN_ATTR, NULL, 1);
+ } else if (tag == "uses-feature") {
+ String8 name = getAttribute(tree, NAME_ATTR, &error);
+
+ if (name != "" && error == "") {
+ int req = getIntegerAttribute(tree,
+ REQUIRED_ATTR, NULL, 1);
+
+ if (name == "android.hardware.camera") {
+ specCameraFeature = true;
+ } else if (name == "android.hardware.camera.autofocus") {
+ // these have no corresponding permission to check for,
+ // but should imply the foundational camera permission
+ reqCameraAutofocusFeature = reqCameraAutofocusFeature || req;
+ specCameraAutofocusFeature = true;
+ } else if (req && (name == "android.hardware.camera.flash")) {
+ // these have no corresponding permission to check for,
+ // but should imply the foundational camera permission
+ reqCameraFlashFeature = true;
+ } else if (name == "android.hardware.location") {
+ specLocationFeature = true;
+ } else if (name == "android.hardware.location.network") {
+ specNetworkLocFeature = true;
+ reqNetworkLocFeature = reqNetworkLocFeature || req;
+ } else if (name == "android.hardware.location.gps") {
+ specGpsFeature = true;
+ reqGpsFeature = reqGpsFeature || req;
+ } else if (name == "android.hardware.bluetooth") {
+ specBluetoothFeature = true;
+ } else if (name == "android.hardware.touchscreen") {
+ specTouchscreenFeature = true;
+ } else if (name == "android.hardware.touchscreen.multitouch") {
+ specMultitouchFeature = true;
+ } else if (name == "android.hardware.touchscreen.multitouch.distinct") {
+ reqDistinctMultitouchFeature = reqDistinctMultitouchFeature || req;
+ } else if (name == "android.hardware.microphone") {
+ specMicrophoneFeature = true;
+ } else if (name == "android.hardware.wifi") {
+ specWiFiFeature = true;
+ } else if (name == "android.hardware.telephony") {
+ specTelephonyFeature = true;
+ } else if (req && (name == "android.hardware.telephony.gsm" ||
+ name == "android.hardware.telephony.cdma")) {
+ // these have no corresponding permission to check for,
+ // but should imply the foundational telephony permission
+ reqTelephonySubFeature = true;
+ }
+ printf("uses-feature%s:'%s'\n",
+ req ? "" : "-not-required", name.string());
+ } else {
+ int vers = getIntegerAttribute(tree,
+ GL_ES_VERSION_ATTR, &error);
+ if (error == "") {
+ printf("uses-gl-es:'0x%x'\n", vers);
+ }
+ }
+ } else if (tag == "uses-permission") {
+ String8 name = getAttribute(tree, NAME_ATTR, &error);
+ if (name != "" && error == "") {
+ if (name == "android.permission.CAMERA") {
+ hasCameraPermission = true;
+ } else if (name == "android.permission.ACCESS_FINE_LOCATION") {
+ hasGpsPermission = true;
+ } else if (name == "android.permission.ACCESS_MOCK_LOCATION") {
+ hasMockLocPermission = true;
+ } else if (name == "android.permission.ACCESS_COARSE_LOCATION") {
+ hasCoarseLocPermission = true;
+ } else if (name == "android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" ||
+ name == "android.permission.INSTALL_LOCATION_PROVIDER") {
+ hasGeneralLocPermission = true;
+ } else if (name == "android.permission.BLUETOOTH" ||
+ name == "android.permission.BLUETOOTH_ADMIN") {
+ hasBluetoothPermission = true;
+ } else if (name == "android.permission.RECORD_AUDIO") {
+ hasRecordAudioPermission = true;
+ } else if (name == "android.permission.ACCESS_WIFI_STATE" ||
+ name == "android.permission.CHANGE_WIFI_STATE" ||
+ name == "android.permission.CHANGE_WIFI_MULTICAST_STATE") {
+ hasWiFiPermission = true;
+ } else if (name == "android.permission.CALL_PHONE" ||
+ name == "android.permission.CALL_PRIVILEGED" ||
+ name == "android.permission.MODIFY_PHONE_STATE" ||
+ name == "android.permission.PROCESS_OUTGOING_CALLS" ||
+ name == "android.permission.READ_SMS" ||
+ name == "android.permission.RECEIVE_SMS" ||
+ name == "android.permission.RECEIVE_MMS" ||
+ name == "android.permission.RECEIVE_WAP_PUSH" ||
+ name == "android.permission.SEND_SMS" ||
+ name == "android.permission.WRITE_APN_SETTINGS" ||
+ name == "android.permission.WRITE_SMS") {
+ hasTelephonyPermission = true;
+ }
+ printf("uses-permission:'%s'\n", name.string());
+ } else {
+ fprintf(stderr, "ERROR getting 'android:name' attribute: %s\n",
+ error.string());
+ goto bail;
+ }
+ } else if (tag == "original-package") {
+ String8 name = getAttribute(tree, NAME_ATTR, &error);
+ if (name != "" && error == "") {
+ printf("original-package:'%s'\n", name.string());
+ } else {
+ fprintf(stderr, "ERROR getting 'android:name' attribute: %s\n",
+ error.string());
+ goto bail;
+ }