diff --git a/src/android/Device.java b/src/android/Device.java index de281d3..b1a213d 100644 --- a/src/android/Device.java +++ b/src/android/Device.java @@ -18,8 +18,6 @@ Licensed to the Apache Software Foundation (ASF) under one */ package org.apache.cordova.device; -import java.util.TimeZone; - import org.apache.cordova.CordovaWebView; import org.apache.cordova.CallbackContext; import org.apache.cordova.CordovaPlugin; @@ -31,14 +29,10 @@ Licensed to the Apache Software Foundation (ASF) under one import android.provider.Settings; public class Device extends CordovaPlugin { - public static final String TAG = "Device"; - public static String platform; // Device OS public static String uuid; // Device UUID private static final String ANDROID_PLATFORM = "Android"; - private static final String AMAZON_PLATFORM = "amazon-fireos"; - private static final String AMAZON_DEVICE = "Amazon"; /** * Constructor. @@ -62,7 +56,7 @@ public void initialize(CordovaInterface cordova, CordovaWebView webView) { * Executes the request and returns PluginResult. * * @param action The action to execute. - * @param args JSONArry of arguments for the plugin. + * @param args JSONArray of arguments for the plugin. * @param callbackContext The callback id used when calling back into JavaScript. * @return True if the action was valid, false if not. */ @@ -92,79 +86,46 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo /** * Get the OS name. * - * @return + * @return "Android" */ public String getPlatform() { - String platform; - if (isAmazonDevice()) { - platform = AMAZON_PLATFORM; - } else { - platform = ANDROID_PLATFORM; - } - return platform; + return ANDROID_PLATFORM; } /** * Get the device's Universally Unique Identifier (UUID). * - * @return + * @return android.provider.Settings.Secure.ANDROID_ID */ public String getUuid() { - String uuid = Settings.Secure.getString(this.cordova.getActivity().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); - return uuid; + return Settings.Secure.getString(this.cordova.getActivity().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); } public String getModel() { - String model = android.os.Build.MODEL; - return model; - } - - public String getProductName() { - String productname = android.os.Build.PRODUCT; - return productname; + return android.os.Build.MODEL; } public String getManufacturer() { - String manufacturer = android.os.Build.MANUFACTURER; - return manufacturer; + return android.os.Build.MANUFACTURER; } public String getSerialNumber() { - String serial = android.os.Build.SERIAL; - return serial; + return android.os.Build.SERIAL; } /** * Get the OS version. * - * @return + * @return android.os.Build.VERSION.RELEASE */ public String getOSVersion() { - String osversion = android.os.Build.VERSION.RELEASE; - return osversion; + return android.os.Build.VERSION.RELEASE; } public String getSDKVersion() { return String.valueOf(android.os.Build.VERSION.SDK_INT); } - public String getTimeZoneID() { - TimeZone tz = TimeZone.getDefault(); - return (tz.getID()); - } - - /** - * Function to check if the device is manufactured by Amazon - * - * @return - */ - public boolean isAmazonDevice() { - if (android.os.Build.MANUFACTURER.equals(AMAZON_DEVICE)) { - return true; - } - return false; - } - public boolean isVirtual() { return android.os.Build.FINGERPRINT.contains("generic") || android.os.Build.PRODUCT.contains("sdk");