Skip to content

Instantly share code, notes, and snippets.

@jcs
Last active December 15, 2015 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcs/6b7b9a9b4a81bc521d68 to your computer and use it in GitHub Desktop.
Save jcs/6b7b9a9b4a81bc521d68 to your computer and use it in GitHub Desktop.

####Android Lock Screen Owner Info Permissions

To get the e-mail address of the Google account associated with an Android device, special permissions are required. On API level 14+:

android.permission.READ_PROFILE
android.permission.READ_CONTACTS

Yet a completely unprivileged application can read the lock_screen_owner_info key of Settings.Secure which often contains things such as the user's e-mail address, their real name, phone number, and/or physical address.

 String info = Settings.Secure.getString(getContentResolver(), "lock_screen_owner_info");

A quick example:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment