summaryrefslogtreecommitdiff
path: root/external/plyer/platforms/android/uniqueid.py
diff options
context:
space:
mode:
Diffstat (limited to 'external/plyer/platforms/android/uniqueid.py')
-rw-r--r--external/plyer/platforms/android/uniqueid.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/external/plyer/platforms/android/uniqueid.py b/external/plyer/platforms/android/uniqueid.py
new file mode 100644
index 0000000..b8561de
--- /dev/null
+++ b/external/plyer/platforms/android/uniqueid.py
@@ -0,0 +1,16 @@
+from jnius import autoclass
+from plyer.platforms.android import activity
+from plyer.facades import UniqueID
+
+Secure = autoclass('android.provider.Settings$Secure')
+
+
+class AndroidUniqueID(UniqueID):
+
+ def _get_uid(self):
+ return Secure.getString(activity.getContentResolver(),
+ Secure.ANDROID_ID)
+
+
+def instance():
+ return AndroidUniqueID()