public class DeviceManager extends Object
Modifier and Type | Field and Description |
---|---|
private Context |
context |
private static Device |
device |
private static String |
deviceId |
private static DeviceManager |
deviceManager |
Modifier | Constructor and Description |
---|---|
protected |
DeviceManager(Context context) |
Modifier and Type | Method and Description |
---|---|
private String |
getAndroidDeviceId()
Returns the AndroidDeviceId (IMEI) for this Android device.
|
private String |
getAndroidId()
Returns the device AndroidId.
|
private String |
getDeviceId()
This method fetches DeviceId from SharedPreferences.
|
static Device |
getDeviceInstance(Context context)
Returns a populated instance of the device object that represents the device that we are currently running.
|
protected Device |
getDeviceInstance(Device mockDevice)
Provided for unit test purposes.
|
private String |
getOsVersion()
Retrieves the version of the Android OS installed on this device.
|
private boolean |
isHacked()
Is this device running as root?
|
static void |
release()
Releases the manager.
|
static void |
resetAndroidDeviceId() |
static void |
resetAndroidId() |
static void |
setDeviceManager(DeviceManager manager) |
static void |
updateDeviceId() |
private String |
verifyVersionString(String version) |
private static Device device
private Context context
private static DeviceManager deviceManager
private static String deviceId
protected DeviceManager(Context context)
public static Device getDeviceInstance(Context context)
public static void setDeviceManager(DeviceManager manager)
private String getOsVersion()
String
. The Android OS version.protected Device getDeviceInstance(Device mockDevice)
public static void updateDeviceId()
public static void resetAndroidId()
public static void resetAndroidDeviceId()
private boolean isHacked()
private String getAndroidDeviceId()
private String getAndroidId()
private String getDeviceId()
public static void release()