Skip to content

Commit

Permalink
Merge pull request #234 from android/variant_fix
Browse files Browse the repository at this point in the history
Remove macrobenchmark_setup_variant and fix license issue in readme
  • Loading branch information
yenerm committed Jun 12, 2023
2 parents fbce967 + fe67dfa commit aac6d03
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 31 deletions.
9 changes: 0 additions & 9 deletions MacrobenchmarkSample/macrobenchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ android {
}
// [END macrobenchmark_setup_android]

// [START macrobenchmark_setup_variant]
androidComponents {
beforeVariants(selector().all()) {
// enable only the benchmark buildType, since we only want to measure close to release performance
it.enable = it.buildType == "benchmark"
}
}
// [END macrobenchmark_setup_variant]

dependencies {
implementation(project(":baseBenchmarks"))
implementation(libs.benchmark.junit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class NestedRecyclerFrameTimingBenchmarks {
val nestedRecyclerToScroll = visibleNestedRecyclers[1]

// Set gesture margin to avoid triggering gesture navigation with input events from automation.
nestedRecyclerToScroll.setGestureMargin(device.displayWidth / 5)
nestedRecyclerToScroll.setGestureMargin(device.displayWidth / 3)

// swipe horizontally
nestedRecyclerToScroll.fling(Direction.RIGHT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ class NonExportedActivityBenchmark {
startActivityAndWait()

// click a button to launch the target activity.
// While we use resourceId here to find the button, you could also use
// accessibility info or button text content.
val selector = By.res(packageName, "launchRecyclerActivity")
// While we use button text here to find the button, you could also use
// accessibility info or resourceId.
val selector = By.text("RecyclerView")
if (!device.wait(Until.hasObject(selector), 5_500)) {
fail("Could not find resource in time")
}
Expand Down
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,3 @@ issue tracker link available in the sample README file.
[WorkManagerSample](https://github.com/googlesamples/android-architecture-components/tree/master/WorkManagerSample)
- Example of benchmarking asynchronously scheduled background work

## License

```
Copyright 2022 The Android Open Source Project, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
See the NOTICE file distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file to you 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.
```

0 comments on commit aac6d03

Please sign in to comment.