Skip to content

Commit

Permalink
Adjust adoptions
Browse files Browse the repository at this point in the history
  • Loading branch information
isuPatches committed Oct 29, 2016
1 parent ec8bf28 commit 341cee9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions grant-set-animation-scale-permission.gradle
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 341cee9

Please sign in to comment.