From 9d0e8fa4362a0a0f39ab5eff727f7c5aa8c82fe6 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Fri, 23 Mar 2012 14:30:18 -0700 Subject: [PATCH] Tagged 1.6rc1 --- VERSION | 2 +- framework/src/org/apache/cordova/Device.java | 216 +++++++++---------- 2 files changed, 109 insertions(+), 109 deletions(-) diff --git a/VERSION b/VERSION index bc80560f..40ab7ec2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.0 +1.6.0rc1 diff --git a/framework/src/org/apache/cordova/Device.java b/framework/src/org/apache/cordova/Device.java index 9b3057c2..da1e61e6 100644 --- a/framework/src/org/apache/cordova/Device.java +++ b/framework/src/org/apache/cordova/Device.java @@ -38,73 +38,73 @@ import android.telephony.TelephonyManager; public class Device extends Plugin { public static final String TAG = "Device"; - public static String cordovaVersion = "1.5.0"; // Cordova version - public static String platform = "Android"; // Device OS - public static String uuid; // Device UUID + public static String cordovaVersion = "1.6.0rc1"; // Cordova version + public static String platform = "Android"; // Device OS + public static String uuid; // Device UUID BroadcastReceiver telephonyReceiver = null; /** * Constructor. */ - public Device() { + public Device() { } - - /** - * Sets the context of the Command. This can then be used to do things like - * get file paths associated with the Activity. - * - * @param ctx The context of the main Activity. - */ - public void setContext(CordovaInterface ctx) { - super.setContext(ctx); + + /** + * Sets the context of the Command. This can then be used to do things like + * get file paths associated with the Activity. + * + * @param ctx The context of the main Activity. + */ + public void setContext(CordovaInterface ctx) { + super.setContext(ctx); Device.uuid = getUuid(); this.initTelephonyReceiver(); - } + } - /** - * Executes the request and returns PluginResult. - * - * @param action The action to execute. - * @param args JSONArry of arguments for the plugin. - * @param callbackId The callback id used when calling back into JavaScript. - * @return A PluginResult object with a status and message. - */ - public PluginResult execute(String action, JSONArray args, String callbackId) { - PluginResult.Status status = PluginResult.Status.OK; - String result = ""; - - try { - if (action.equals("getDeviceInfo")) { - JSONObject r = new JSONObject(); - r.put("uuid", Device.uuid); - r.put("version", this.getOSVersion()); - r.put("platform", Device.platform); - r.put("name", this.getProductName()); - r.put("cordova", Device.cordovaVersion); - //JSONObject pg = new JSONObject(); - //pg.put("version", Device.CordovaVersion); - //r.put("cordova", pg); - return new PluginResult(status, r); - } - return new PluginResult(status, result); - } catch (JSONException e) { - return new PluginResult(PluginResult.Status.JSON_EXCEPTION); - } - } + /** + * Executes the request and returns PluginResult. + * + * @param action The action to execute. + * @param args JSONArry of arguments for the plugin. + * @param callbackId The callback id used when calling back into JavaScript. + * @return A PluginResult object with a status and message. + */ + public PluginResult execute(String action, JSONArray args, String callbackId) { + PluginResult.Status status = PluginResult.Status.OK; + String result = ""; + + try { + if (action.equals("getDeviceInfo")) { + JSONObject r = new JSONObject(); + r.put("uuid", Device.uuid); + r.put("version", this.getOSVersion()); + r.put("platform", Device.platform); + r.put("name", this.getProductName()); + r.put("cordova", Device.cordovaVersion); + //JSONObject pg = new JSONObject(); + //pg.put("version", Device.CordovaVersion); + //r.put("cordova", pg); + return new PluginResult(status, r); + } + return new PluginResult(status, result); + } catch (JSONException e) { + return new PluginResult(PluginResult.Status.JSON_EXCEPTION); + } + } - /** - * Identifies if action to be executed returns a value and should be run synchronously. - * - * @param action The action to execute - * @return T=returns value - */ - public boolean isSynch(String action) { - if (action.equals("getDeviceInfo")) { - return true; - } - return false; - } + /** + * Identifies if action to be executed returns a value and should be run synchronously. + * + * @param action The action to execute + * @return T=returns value + */ + public boolean isSynch(String action) { + if (action.equals("getDeviceInfo")) { + return true; + } + return false; + } /** * Unregister receiver. @@ -156,59 +156,59 @@ public class Device extends Plugin { this.ctx.registerReceiver(this.telephonyReceiver, intentFilter); } - /** - * Get the OS name. - * - * @return - */ - public String getPlatform() { - return Device.platform; - } - - /** - * Get the device's Universally Unique Identifier (UUID). - * - * @return - */ - public String getUuid() { - String uuid = Settings.Secure.getString(this.ctx.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); - return uuid; - } + /** + * Get the OS name. + * + * @return + */ + public String getPlatform() { + return Device.platform; + } + + /** + * Get the device's Universally Unique Identifier (UUID). + * + * @return + */ + public String getUuid() { + String uuid = Settings.Secure.getString(this.ctx.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); + return uuid; + } - /** - * Get the Cordova version. - * - * @return - */ - public String getCordovaVersion() { - return Device.cordovaVersion; - } - - public String getModel() { - String model = android.os.Build.MODEL; - return model; - } - - public String getProductName() { - String productname = android.os.Build.PRODUCT; - return productname; - } - - /** - * Get the OS version. - * - * @return - */ - public String getOSVersion() { - String osversion = android.os.Build.VERSION.RELEASE; - return osversion; - } - - public String getSDKVersion() { - String sdkversion = android.os.Build.VERSION.SDK; - return sdkversion; - } - + /** + * Get the Cordova version. + * + * @return + */ + public String getCordovaVersion() { + return Device.cordovaVersion; + } + + public String getModel() { + String model = android.os.Build.MODEL; + return model; + } + + public String getProductName() { + String productname = android.os.Build.PRODUCT; + return productname; + } + + /** + * Get the OS version. + * + * @return + */ + public String getOSVersion() { + String osversion = android.os.Build.VERSION.RELEASE; + return osversion; + } + + public String getSDKVersion() { + String sdkversion = android.os.Build.VERSION.SDK; + return sdkversion; + } + public String getTimeZoneID() { TimeZone tz = TimeZone.getDefault();