This is an initial checkin of a small demonstration program which demonstrates how optional permissions can be used. This app can do three things, which require permissions: * Vibrate the device (android.permission.VIBRATE) * Access the internet (android.permission.INTERNET) * Get the phone number (android.permission.READ_PHONE_STATE) At install time, this app has zero permissions. However, the app can request that the user grant permissions, based on pressing the "Prompt" button. The user can then choose to allow or deny the permissions. Known bugs and limitations: * Once a permission is granted, it currently cannot be revoked by the application nor the user. * Due to the way it's implemented, the INTERNET permission requires a restart of the application. That isn't in the sample code. * Getting the device phone number doesn't make sense for a tablet. This code was mostly written by klyubin@google.com with heavy modification by myself. Change-Id: I620db52c4a1f10ac7aa604ba34f77f7ec03af023
14 lines
285 B
Makefile
14 lines
285 B
Makefile
LOCAL_PATH:= $(call my-dir)
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE_TAGS := samples tests
|
|
|
|
# Only compile source java files in this apk.
|
|
LOCAL_SRC_FILES := $(call all-java-files-under, src)
|
|
|
|
LOCAL_PACKAGE_NAME := OptionalPermissions
|
|
|
|
LOCAL_SDK_VERSION := current
|
|
|
|
include $(BUILD_PACKAGE)
|