File: uniqueid.py

package info (click to toggle)
python-plyer 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,808 kB
  • sloc: python: 13,395; sh: 217; makefile: 177
file content (28 lines) | stat: -rw-r--r-- 545 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'''
Module of Android API for plyer.uniqueid.
'''

from jnius import autoclass
from plyer.platforms.android import activity
from plyer.facades import UniqueID

Secure = autoclass('android.provider.Settings$Secure')


class AndroidUniqueID(UniqueID):
    '''
    Implementation of Android uniqueid API.
    '''

    def _get_uid(self):
        return Secure.getString(
            activity.getContentResolver(),
            Secure.ANDROID_ID
        )


def instance():
    '''
    Instance for facade proxy.
    '''
    return AndroidUniqueID()