Skip to content

Commit

Permalink
Merge pull request #5290 from cb1kenobi/timob-16322
Browse files Browse the repository at this point in the history
[TIMOB-16322] Fixed <uses-features> elements to not require a name attri...
  • Loading branch information
hieupham007 committed Feb 3, 2014
2 parents c8e0296 + 802135e commit 161420d
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 22 deletions.
17 changes: 16 additions & 1 deletion android/cli/lib/AndroidManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,26 @@ function toJS(obj, doc) {
});
break;

case 'uses-feature':
// array of features that if it has a name, must be unique
var tmp = obj[node.tagName] || (obj[node.tagName] = []),
a = attrsToObj(node);

// remove old one to prevent dupe
if (a.name) {
for (var i = 0; i < tmp.length; i++) {
if (tmp[i].name && tmp[i].name == a.name) {
tmp.splice(i--, 1);
}
}
}
tmp.push(a);
break;

case 'instrumentation':
case 'permission':
case 'permission-group':
case 'permission-tree':
case 'uses-feature':
case 'uses-library':
// object with objects keyed by name
initObjectByName(node, obj);
Expand Down
13 changes: 13 additions & 0 deletions android/cli/tests/resources/AndroidManifest_uses-feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,17 @@
android:name="android.hardware.camera"
android:required="true"
android:glEsVersion="2" />

<uses-feature
android:name="android.hardware.camera"
android:required="true"
android:glEsVersion="1" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

<uses-feature
android:glEsVersion="0x00030000"
android:required="true" />
</manifest>
60 changes: 39 additions & 21 deletions android/cli/tests/test-androidmanifest.js

Large diffs are not rendered by default.

0 comments on commit 161420d

Please sign in to comment.