This is an automated email from the ASF dual-hosted git repository. jcesarmobile pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cordova-plugin-device.git
The following commit(s) were added to refs/heads/master by this push: new deaae75 refactor(android)!: Remove unused code (#183) deaae75 is described below commit deaae753b2e635375ab931d34fb2c5338ecabedb Author: jcesarmobile <jcesarmob...@gmail.com> AuthorDate: Mon May 13 22:42:25 2024 +0200 refactor(android)!: Remove unused code (#183) --- src/android/Device.java | 59 +++++++++---------------------------------------- 1 file changed, 10 insertions(+), 49 deletions(-) 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 @@ */ 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 @@ import org.json.JSONObject; 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 class Device extends CordovaPlugin { * 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 class Device extends CordovaPlugin { /** * 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"); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org