From b7da1f5f9886ff8a4ad81b0d617d442c461ca1e5 Mon Sep 17 00:00:00 2001 From: Anthony Hugh Date: Wed, 19 Aug 2015 11:44:43 -0700 Subject: 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 --- .../packageinstaller/permission/ui/GrantPermissionsActivity.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java') 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; -- cgit v1.2.3