}
tree.restart();
printXMLBlock(&tree);
+ tree.uninit();
delete asset;
asset = NULL;
}
bool actWallpaperService = false;
bool specCameraFeature = false;
bool hasCameraPermission = false;
+ bool specGpsFeature = false;
+ bool hasGpsPermission = false;
int targetSdk = 0;
int smallScreen = 1;
int normalScreen = 1;
REQUIRED_ATTR, NULL, 1);
if (name == "android.hardware.camera") {
specCameraFeature = true;
+ } else if (name == "android.hardware.location.gps") {
+ specGpsFeature = true;
}
printf("uses-feature%s:'%s'\n",
req ? "" : "-not-required", name.string());
if (name != "" && error == "") {
if (name == "android.permission.CAMERA") {
hasCameraPermission = true;
+ } else if (name == "android.permission.ACCESS_FINE_LOCATION") {
+ hasGpsPermission = true;
}
printf("uses-permission:'%s'\n", name.string());
} else {
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;
+ }
}
} else if (depth == 3 && withinApplication) {
withinActivity = false;
printf("uses-feature:'android.hardware.camera.autofocus'\n");
}
+ if (!specGpsFeature && hasGpsPermission) {
+ // For applications that have not explicitly stated their
+ // GPS feature requirements, but have requested the "fine" (GPS)
+ // permission, we are going to give them compatibility treatment
+ // of requiring the equivalent to original android devices.
+ printf("uses-feature:'android.hardware.location.gps'\n");
+ }
+
if (hasMainActivity) {
printf("main\n");
}