diff --git a/device/README.md b/device/README.md
index 39b6c154f..608476fdb 100644
--- a/device/README.md
+++ b/device/README.md
@@ -124,26 +124,26 @@ Get the device's current language locale tag.
#### DeviceId
-| Prop | Type | Description | Since |
-| ---------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
-| **`identifier`** | string | The identifier of the device as available to the app. This identifier may change on modern mobile platforms that only allow per-app install ids. On iOS, the identifier is a UUID that uniquely identifies a device to the app’s vendor ([read more](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor)). on Android 8+, __the identifier is a 64-bit number (expressed as a hexadecimal string)__, unique to each combination of app-signing key, user, and device ([read more](https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID)). On web, a random identifier is generated and stored on localStorage for subsequent calls. If localStorage is not available a new random identifier will be generated on every call. | 1.0.0 |
+| Prop | Type | Description | Since |
+| ---------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
+| **`identifier`** | string | The identifier of the device as available to the app. This identifier may change on modern mobile platforms that only allow per-app install ids. On iOS, the identifier is a UUID that uniquely identifies a device to the app’s vendor ([read more](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor)). on Android, __the identifier is a 64-bit number (expressed as a hexadecimal string)__, unique to each combination of app-signing key, user, and device ([read more](https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID)). On web, a random identifier is generated and stored on localStorage for subsequent calls. If localStorage is not available a new random identifier will be generated on every call. | 1.0.0 |
#### DeviceInfo
-| Prop | Type | Description | Since |
-| ----------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
-| **`name`** | string | The name of the device. For example, "John's iPhone". This is only supported on iOS and Android 7.1 or above. On iOS 16+ this will return a generic device name without the appropriate [entitlements](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_device-information_user-assigned-device-name). | 1.0.0 |
-| **`model`** | string | The device model. For example, "iPhone13,4". | 1.0.0 |
-| **`platform`** | 'ios' \| 'android' \| 'web' | The device platform (lowercase). | 1.0.0 |
-| **`operatingSystem`** | OperatingSystem | The operating system of the device. | 1.0.0 |
-| **`osVersion`** | string | The version of the device OS. | 1.0.0 |
-| **`iOSVersion`** | number | The iOS version number. Only available on iOS. Multi-part version numbers are crushed down into an integer padded to two-digits, ex: `"16.3.1"` -> `160301` | 5.0.0 |
-| **`androidSDKVersion`** | number | The Android SDK version number. Only available on Android. | 5.0.0 |
-| **`manufacturer`** | string | The manufacturer of the device. | 1.0.0 |
-| **`isVirtual`** | boolean | Whether the app is running in a simulator/emulator. | 1.0.0 |
-| **`memUsed`** | number | Approximate memory used by the current app, in bytes. Divide by 1048576 to get the number of MBs used. | 1.0.0 |
-| **`webViewVersion`** | string | The web view browser version | 1.0.0 |
+| Prop | Type | Description | Since |
+| ----------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
+| **`name`** | string | The name of the device. For example, "John's iPhone". This is only supported on iOS and Android. On iOS 16+ this will return a generic device name without the appropriate [entitlements](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_device-information_user-assigned-device-name). | 1.0.0 |
+| **`model`** | string | The device model. For example, "iPhone13,4". | 1.0.0 |
+| **`platform`** | 'ios' \| 'android' \| 'web' | The device platform (lowercase). | 1.0.0 |
+| **`operatingSystem`** | OperatingSystem | The operating system of the device. | 1.0.0 |
+| **`osVersion`** | string | The version of the device OS. | 1.0.0 |
+| **`iOSVersion`** | number | The iOS version number. Only available on iOS. Multi-part version numbers are crushed down into an integer padded to two-digits, ex: `"16.3.1"` -> `160301` | 5.0.0 |
+| **`androidSDKVersion`** | number | The Android SDK version number. Only available on Android. | 5.0.0 |
+| **`manufacturer`** | string | The manufacturer of the device. | 1.0.0 |
+| **`isVirtual`** | boolean | Whether the app is running in a simulator/emulator. | 1.0.0 |
+| **`memUsed`** | number | Approximate memory used by the current app, in bytes. Divide by 1048576 to get the number of MBs used. | 1.0.0 |
+| **`webViewVersion`** | string | The web view browser version | 1.0.0 |
#### BatteryInfo
diff --git a/device/android/src/main/java/com/capacitorjs/plugins/device/Device.java b/device/android/src/main/java/com/capacitorjs/plugins/device/Device.java
index d9cbc9c96..41897d9d6 100644
--- a/device/android/src/main/java/com/capacitorjs/plugins/device/Device.java
+++ b/device/android/src/main/java/com/capacitorjs/plugins/device/Device.java
@@ -4,7 +4,6 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
import android.os.BatteryManager;
import android.os.Build;
import android.provider.Settings;
@@ -63,33 +62,14 @@ public boolean isVirtual() {
}
public String getName() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
- return Settings.Global.getString(this.context.getContentResolver(), Settings.Global.DEVICE_NAME);
- }
-
- return null;
+ return Settings.Global.getString(this.context.getContentResolver(), Settings.Global.DEVICE_NAME);
}
public String getWebViewVersion() {
- PackageInfo info = null;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- info = WebView.getCurrentWebViewPackage();
- } else {
- try {
- info = getWebViewVersionSubAndroid26();
- } catch (PackageManager.NameNotFoundException e) {
- e.printStackTrace();
- }
- }
+ PackageInfo info = WebView.getCurrentWebViewPackage();
if (info != null) {
return info.versionName;
}
-
return Build.VERSION.RELEASE;
}
-
- private PackageInfo getWebViewVersionSubAndroid26() throws PackageManager.NameNotFoundException {
- PackageManager pm = this.context.getPackageManager();
- return pm.getPackageInfo("com.android.chrome", 0);
- }
}
diff --git a/device/src/definitions.ts b/device/src/definitions.ts
index 20f4ed006..31b05b98d 100644
--- a/device/src/definitions.ts
+++ b/device/src/definitions.ts
@@ -7,7 +7,7 @@ export interface DeviceId {
*
* On iOS, the identifier is a UUID that uniquely identifies a device to the app’s vendor ([read more](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor)).
*
- * on Android 8+, __the identifier is a 64-bit number (expressed as a hexadecimal string)__, unique to each combination of app-signing key, user, and device ([read more](https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID)).
+ * on Android, __the identifier is a 64-bit number (expressed as a hexadecimal string)__, unique to each combination of app-signing key, user, and device ([read more](https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID)).
*
* On web, a random identifier is generated and stored on localStorage for subsequent calls.
* If localStorage is not available a new random identifier will be generated on every call.
@@ -21,7 +21,7 @@ export interface DeviceInfo {
/**
* The name of the device. For example, "John's iPhone".
*
- * This is only supported on iOS and Android 7.1 or above.
+ * This is only supported on iOS and Android.
*
* On iOS 16+ this will return a generic device name without the appropriate [entitlements](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_device-information_user-assigned-device-name).
*