From 341cee9340afb9a4f0f891db238a55dcaa39d425 Mon Sep 17 00:00:00 2001 From: isuPatches Date: Sat, 29 Oct 2016 15:00:38 -0500 Subject: [PATCH] Adjust adoptions --- app/build.gradle | 5 ++++ grant-set-animation-scale-permission.gradle | 30 +++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 grant-set-animation-scale-permission.gradle diff --git a/app/build.gradle b/app/build.gradle index 3d15ae01..e07b1487 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,6 +51,11 @@ dexcount { android { + adbOptions { + timeOutInMs 15 * 60 * 1000 // 15 minutes + installOptions "-d","-t" + } + testOptions { // Allows Android code to be called from unit tests without causing a crash. // Helpful for allowing Log.d()-type calls diff --git a/grant-set-animation-scale-permission.gradle b/grant-set-animation-scale-permission.gradle new file mode 100644 index 00000000..d875d9e0 --- /dev/null +++ b/grant-set-animation-scale-permission.gradle @@ -0,0 +1,30 @@ +/* + * Copyright 2015 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +def adb = android.getAdbExe().toString() + +task grantSetAnimationScalePermission(type: Exec, dependsOn: 'installDebug') { + group = 'verification' + description = 'Grant SET_ANIMATION_SCALE permission for testing.' + def saspermission = 'android.permission.SET_ANIMATION_SCALE' + commandLine "$adb shell pm grant $android.defaultConfig.applicationId $saspermission".split(' ') +} + +tasks.whenTaskAdded { task -> + if (task.name.startsWith('connectedDebugAndroidTest')) { + task.dependsOn grantSetAnimationScalePermission + } +} \ No newline at end of file