added ubuntu support
diff --git a/plugin.xml b/plugin.xml
index a07da50..0ff5804 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -3,7 +3,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="org.apache.cordova.device-orientation"
- version="0.3.2">
+ version="0.3.3-dev">
<name>Device Orientation</name>
<description>Cordova Device Orientation Plugin</description>
@@ -53,6 +53,22 @@
<source-file src="src/android/CompassListener.java" target-dir="src/org/apache/cordova/deviceorientation" />
</platform>
+ <!-- amazon-fireos -->
+ <platform name="amazon-fireos">
+ <config-file target="res/xml/config.xml" parent="/*">
+ <feature name="Compass">
+ <param name="android-package" value="org.apache.cordova.deviceorientation.CompassListener"/>
+ </feature>
+ </config-file>
+
+ <config-file target="AndroidManifest.xml" parent="/*">
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+ </config-file>
+
+ <source-file src="src/android/CompassListener.java" target-dir="src/org/apache/cordova/deviceorientation" />
+ </platform>
+
<!-- ubuntu -->
<platform name="ubuntu">
<header-file src="src/ubuntu/compass.h" />
diff --git a/test/cordova-incl.js b/test/cordova-incl.js
index dbcd1a6..bc1dd7a 100644
--- a/test/cordova-incl.js
+++ b/test/cordova-incl.js
@@ -20,7 +20,9 @@
*/
var PLAT;
-if (/Android/.exec(navigator.userAgent)) {
+if (/cordova-amazon-fireos/.exec(navigator.userAgent)) {
+ PLAT = 'amazon-fireos';
+}else if (/Android/.exec(navigator.userAgent)) {
PLAT = 'android';
} else if (/(iPad)|(iPhone)|(iPod)/.exec(navigator.userAgent)) {
PLAT = 'ios';
@@ -61,7 +63,7 @@
}
function backHome() {
- if (window.device && device.platform && device.platform.toLowerCase() == 'android') {
+ if (window.device && device.platform && (device.platform.toLowerCase() == 'android' || device.platform.toLowerCase() == 'amazon-fireos')) {
navigator.app.backHistory();
}
else {