summaryrefslogtreecommitdiffstats
path: root/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java
diff options
context:
space:
mode:
authorAnthony Hugh <ahugh@google.com>2015-08-19 11:44:43 -0700
committerAnthony Hugh <ahugh@google.com>2015-08-21 12:44:43 -0700
commitb7da1f5f9886ff8a4ad81b0d617d442c461ca1e5 (patch)
tree5ed7a00b0c862f255b2ff0ad7585d56898055abc /src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java
parent2b9cdf4e64d49c24658a5ca7e10633364ef2c1f2 (diff)
downloadandroid_packages_apps_PackageInstaller-b7da1f5f9886ff8a4ad81b0d617d442c461ca1e5.tar.gz
android_packages_apps_PackageInstaller-b7da1f5f9886ff8a4ad81b0d617d442c461ca1e5.tar.bz2
android_packages_apps_PackageInstaller-b7da1f5f9886ff8a4ad81b0d617d442c461ca1e5.zip
Implement base version of GrantPermissions dialog
With the Emerald release, we need to support the new permission APIs. This changelist adds a dialog for the Activity.requestPermissions() API so that users can request permissions. This check in is a functional version, but not polished. will need to be a follow up CL to add the correct animations and update the UI to the appropriate redlines. The implementation for the confirmation dialog is modeled after the one in the clockwork libs/Views folder. There are some tweaks to match the designed behavior of the permission dialog. When there's more time in the future, we should try to condense this to one implementation. BUG: 23118402 Change-Id: Ic90d37a2ce8a7adacb7c4e004b0a5260b624f5c8
Diffstat (limited to 'src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java')
-rw-r--r--src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java b/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java
index c451dd50..c55267e0 100644
--- a/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java
+++ b/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java
@@ -73,6 +73,8 @@ public class GrantPermissionsActivity extends OverlayTouchActivity
if (Utils.isTelevision(this)) {
mViewHandler = new GrantPermissionsTvViewHandler(this).setResultListener(this);
+ } else if (isWatch()) {
+ mViewHandler = new GrantPermissionsWatchViewHandler(this).setResultListener(this);
} else {
mViewHandler = new GrantPermissionsDefaultViewHandler(this).setResultListener(this);
}
@@ -357,6 +359,11 @@ public class GrantPermissionsActivity extends OverlayTouchActivity
SafetyNetLogger.logPermissionsRequested(mAppPermissions.getPackageInfo(), groups);
}
+ private boolean isWatch() {
+ PackageManager pm = getPackageManager();
+ return pm.hasSystemFeature(pm.FEATURE_WATCH);
+ }
+
private static final class GroupState {
static final int STATE_UNKNOWN = 0;
static final int STATE_ALLOWED = 1;