From 86877c4e8c387f11ab3b9294dcc795b34af67016 Mon Sep 17 00:00:00 2001 From: kumo01GitHub Date: Sun, 4 May 2025 01:39:35 +0900 Subject: [PATCH] feat(android): Deprecate public methods --- src/android/Device.java | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/android/Device.java b/src/android/Device.java index dc874f7..4262ac0 100644 --- a/src/android/Device.java +++ b/src/android/Device.java @@ -30,6 +30,7 @@ Licensed to the Apache Software Foundation (ASF) under one public class Device extends CordovaPlugin { + @Deprecated public static String uuid; // Device UUID private static final String ANDROID_PLATFORM = "Android"; @@ -85,47 +86,96 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo /** * Get the OS name. + * @deprecated + * This method is expected to be private. * * @return "Android" */ + @Deprecated public String getPlatform() { return ANDROID_PLATFORM; } /** * Get the device's Universally Unique Identifier (UUID). + * @deprecated + * This method is expected to be private. * * @return android.provider.Settings.Secure.ANDROID_ID */ + @Deprecated public String getUuid() { return Settings.Secure.getString(this.cordova.getContext().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); } + /** + * Get the name of the device's model. + * @deprecated + * This method is expected to be private. + * + * @return android.os.Build.MODEL + */ + @Deprecated public String getModel() { return android.os.Build.MODEL; } + /** + * Get the device's manufacturer. + * @deprecated + * This method is expected to be private. + * + * @return android.os.Build.MANUFACTURER + */ + @Deprecated public String getManufacturer() { return android.os.Build.MANUFACTURER; } + /** + * Get the device hardware serial number. + * @deprecated + * This method is expected to be private. + * + * @return android.os.Build.SERIAL + */ + @Deprecated public String getSerialNumber() { return android.os.Build.SERIAL; } /** * Get the OS version. + * @deprecated + * This method is expected to be private. * * @return android.os.Build.VERSION.RELEASE */ + @Deprecated public String getOSVersion() { return android.os.Build.VERSION.RELEASE; } + /** + * Get the Android device's SDK version. + * @deprecated + * This method is expected to be private. + * + * @return android.os.Build.VERSION.SDK_INT + */ + @Deprecated public String getSDKVersion() { return String.valueOf(android.os.Build.VERSION.SDK_INT); } + /** + * Get whether the device is running on a simulator. + * @deprecated + * This method is expected to be private. + * + * @return whether the device is running on a simulator + */ + @Deprecated public boolean isVirtual() { return android.os.Build.FINGERPRINT.contains("generic") || android.os.Build.PRODUCT.contains("sdk");